Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / testing / builders / user.ts
blob87ddb150a578c7b5d0228f246958752e2c3d5999
1 import { ChargebeeEnabled, type Key, type UserModel } from '@proton/shared/lib/interfaces';
3 import { privateKeyA } from '../data';
5 export const buildUser = (value?: Partial<UserModel>): UserModel => {
6     return {
7         ID: 'rSUCW_Qlh8dCCsxWKPXvkUsoDNL5eW9FJUM7WX8jTPrDE3ftOMIfWt-BSuKaw5PZ7EQ6Zsp8HL9Y9qMv4Y5XJQ==',
8         Name: 'alice',
9         Currency: 'EUR',
10         Credit: 0,
11         Type: 1,
12         CreateTime: 1589313678,
13         MaxSpace: 7516192768,
14         MaxBaseSpace: 7516192768,
15         MaxDriveSpace: 7516192768,
16         MaxUpload: 26214400,
17         NumAI: 0,
18         UsedSpace: 99993,
19         UsedDriveSpace: 99993,
20         UsedBaseSpace: 99993,
21         Subscribed: 1,
22         Services: 1,
23         MnemonicStatus: 4,
24         Role: 2,
25         Private: 1,
26         Delinquent: 0,
27         DriveEarlyAccess: 0,
28         ProductUsedSpace: {
29             Drive: 0,
30             Mail: 99993,
31             Calendar: 0,
32             Contact: 0,
33             Pass: 0,
34         },
35         Idle: 0,
36         Keys: [
37             {
38                 ID: '4Xi8TArBe1WYfrFoJF5_wIDF0shMe5ACAqOArU6hjpUNoC0O0c_Zu5Afz11gGU1eeDu5Aanp_EUkpd44kjQ2lg==',
39                 Version: 3,
40                 Primary: 1,
41                 RecoverySecret: null,
42                 RecoverySecretSignature: null,
43                 PrivateKey: privateKeyA,
44                 Fingerprint: '5372de721b9971518273581e04cd9dc25fbae509',
45                 Active: 1,
46             } as Key,
47         ],
48         ToMigrate: 0,
49         Email: 'alice@jomail.com',
50         DisplayName: 'alice',
51         Flags: {
52             protected: false,
53             'drive-early-access': false,
54             'onboard-checklist-storage-granted': false,
55             'has-temporary-password': false,
56             'test-account': false,
57             'no-login': false,
58             'no-proton-address': false,
59             'recovery-attempt': false,
60             'pass-lifetime': false,
61             sso: false,
62         },
63         isAdmin: true,
64         isMember: false,
65         isFree: false,
66         isPaid: true,
67         isPrivate: true,
68         isSubUser: false,
69         isDelinquent: false,
70         hasNonDelinquentScope: true,
71         hasPaidMail: true,
72         hasPaidVpn: false,
73         hasPaidDrive: false,
74         hasPaidPass: false,
75         hasPassLifetime: false,
76         canPay: true,
77         AccountRecovery: null,
78         ChargebeeUser: ChargebeeEnabled.CHARGEBEE_FORCED,
79         ...value,
80     };