Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / testing / builders / subscription.ts
blob67b1a6ff2b689cbc34c6e7a0146405603ff64fa1
1 import { PLANS, PLAN_TYPES } from '@proton/payments';
2 import { CYCLE } from '@proton/shared/lib/constants';
3 import { External, Renew, type SubscriptionModel } from '@proton/shared/lib/interfaces';
5 export const buildSubscription = (value?: Partial<SubscriptionModel>): SubscriptionModel => {
6     return {
7         ID: 'subscriptionId123',
8         InvoiceID: 'invoiceId123',
9         Cycle: CYCLE.YEARLY,
10         PeriodStart: 1685966060,
11         PeriodEnd: 1717588460,
12         CreateTime: 1685966060,
13         CouponCode: null,
14         Currency: 'EUR',
15         Amount: 11988,
16         Discount: 0,
17         RenewAmount: 11988,
18         RenewDiscount: 0,
19         Renew: Renew.Enabled,
20         External: External.Default,
21         Plans: [
22             {
23                 ID: 'planId123',
24                 Name: PLANS.BUNDLE,
25                 Type: PLAN_TYPES.PLAN,
26                 Title: 'Proton Unlimited',
27                 MaxDomains: 3,
28                 MaxAddresses: 15,
29                 MaxCalendars: 25,
30                 MaxSpace: 536870912000,
31                 MaxMembers: 1,
32                 MaxVPN: 10,
33                 MaxTier: 2,
34                 Services: 15,
35                 Features: 1,
36                 State: 1,
37                 Cycle: 12,
38                 Currency: 'EUR',
39                 Amount: 11988,
40                 Quantity: 1,
41                 Offer: 'default',
42             },
43         ],
44         isManagedByMozilla: false,
45         ...value,
46     };