Remove payments API routing initialization
[ProtonMail-WebClient.git] / packages / components / containers / payments / features / b2b.ts
blobdc2a49ea571d5e604ddc2997c802d1a8bc39624e
1 import { c } from 'ttag';
3 import { PLANS } from '@proton/payments';
4 import { BRAND_NAME } from '@proton/shared/lib/constants';
5 import { Audience } from '@proton/shared/lib/interfaces';
7 import type { PlanCardFeature, PlanCardFeatureDefinition } from './interface';
8 import { getActivityLogText, getTeamPoliciesText } from './pass';
10 export const getTwoFA = (): PlanCardFeatureDefinition => {
11     return {
12         text: c('new_plans: feature').t`Two-factor authentication`,
13         tooltip: c('new_plans: tooltip')
14             .t`Requires a code sent to a mobile phone to sign in. This ensures even if a password is compromised, the account stays secure.`,
15         included: true,
16     };
19 export const getRequire2FA = (included: boolean = false): PlanCardFeatureDefinition => {
20     return {
21         text: c('new_plans: feature').t`Require 2FA for organization`,
22         included,
23     };
26 export const getTeamPolicies = (): PlanCardFeatureDefinition => {
27     return {
28         text: getTeamPoliciesText(),
29         included: true,
30     };
33 export const getActivityLog = (): PlanCardFeatureDefinition => {
34     return {
35         text: getActivityLogText(),
36         included: true,
37     };
40 export const getSSOIntegration = (included: boolean = false): PlanCardFeatureDefinition => {
41     return {
42         text: c('new_plans: feature').t`SSO integration (coming soon)`,
43         included,
44         status: 'coming-soon',
45     };
48 export const getConsole = (): PlanCardFeatureDefinition => {
49     return {
50         text: c('new_plans: feature').t`Admin console`,
51         tooltip: c('new_plans: tooltip')
52             .t`Organization management tool that lets admins add and remove users, manage their access to ${BRAND_NAME} services, and perform other tasks.`,
53         included: true,
54     };
57 export const getBilling = (): PlanCardFeatureDefinition => {
58     return {
59         text: c('new_plans: feature').t`Centralized billing`,
60         tooltip: c('new_plans: tooltip')
61             .t`Manage your subscription, including customization of your plan. Payment methods accepted are credit card, PayPal, cryptocurrency, and wire transfer.`,
62         included: true,
63     };
66 export const getAdmins = (): PlanCardFeatureDefinition => {
67     return {
68         text: c('new_plans: feature').t`Multiple admin roles`,
69         tooltip: c('new_plans: tooltip')
70             .t`You can have more than one admin. All admins can add and manage users but only the primary admin has control over billing.`,
71         included: true,
72     };
75 export const getSignIn = (): PlanCardFeatureDefinition => {
76     return {
77         text: c('new_plans: feature').t`Sign in as user`,
78         tooltip: c('new_plans: tooltip')
79             .t`Option to view non-private user inboxes as the user would, including full message and contact details`,
80         included: true,
81     };
83 export const getCredentials = (): PlanCardFeatureDefinition => {
84     return {
85         text: c('new_plans: feature').t`User credential management`,
86         tooltip: c('new_plans: tooltip').t`Reset user passwords and reset two-factor authentication on users`,
87         included: true,
88     };
91 export const getSessions = (): PlanCardFeatureDefinition => {
92     return {
93         text: c('new_plans: feature').t`User session management`,
94         tooltip: c('new_plans: tooltip')
95             .t`Force sign-out of user sessions when user credentials are believed to be compromised`,
96         included: true,
97     };
100 export const getUserStorageManagement = (): PlanCardFeatureDefinition => {
101     return {
102         text: c('new_plans: feature').t`User storage management`,
103         tooltip: c('new_plans: tooltip').t`Increase or reallocate storage for a user`,
104         included: true,
105     };
108 export const getTeamManagementFeatures = (): PlanCardFeature[] => {
109     return [
110         {
111             name: 'two-fa',
112             target: Audience.B2B,
113             plans: {
114                 [PLANS.FREE]: null,
115                 [PLANS.BUNDLE]: null,
116                 [PLANS.MAIL]: null,
117                 [PLANS.VPN]: null,
118                 [PLANS.DRIVE]: null,
119                 [PLANS.DRIVE_BUSINESS]: getTwoFA(),
120                 [PLANS.PASS]: null,
121                 [PLANS.PASS_FAMILY]: null,
122                 [PLANS.FAMILY]: null,
123                 [PLANS.DUO]: null,
124                 [PLANS.MAIL_PRO]: getTwoFA(),
125                 [PLANS.MAIL_BUSINESS]: getTwoFA(),
126                 [PLANS.BUNDLE_PRO]: getTwoFA(),
127                 [PLANS.BUNDLE_PRO_2024]: getTwoFA(),
128                 [PLANS.PASS_PRO]: getTwoFA(),
129                 [PLANS.PASS_BUSINESS]: getTwoFA(),
130                 [PLANS.VPN_PRO]: getTwoFA(),
131                 [PLANS.VPN_BUSINESS]: getTwoFA(),
132                 [PLANS.WALLET]: null,
133             },
134         },
135         {
136             name: 'require-two-fa',
137             target: Audience.B2B,
138             plans: {
139                 [PLANS.FREE]: null,
140                 [PLANS.BUNDLE]: null,
141                 [PLANS.MAIL]: null,
142                 [PLANS.VPN]: null,
143                 [PLANS.DRIVE]: null,
144                 [PLANS.DRIVE_BUSINESS]: null,
145                 [PLANS.PASS]: null,
146                 [PLANS.PASS_FAMILY]: null,
147                 [PLANS.FAMILY]: null,
148                 [PLANS.DUO]: null,
149                 [PLANS.MAIL_PRO]: null,
150                 [PLANS.MAIL_BUSINESS]: null,
151                 [PLANS.BUNDLE_PRO]: null,
152                 [PLANS.BUNDLE_PRO_2024]: null,
153                 [PLANS.PASS_PRO]: getRequire2FA(),
154                 [PLANS.PASS_BUSINESS]: getRequire2FA(true),
155                 [PLANS.VPN_PRO]: null,
156                 [PLANS.VPN_BUSINESS]: null,
157                 [PLANS.WALLET]: null,
158             },
159         },
160         {
161             name: 'console',
162             target: Audience.B2B,
163             plans: {
164                 [PLANS.FREE]: null,
165                 [PLANS.BUNDLE]: null,
166                 [PLANS.MAIL]: null,
167                 [PLANS.VPN]: null,
168                 [PLANS.DRIVE]: null,
169                 [PLANS.DRIVE_BUSINESS]: getConsole(),
170                 [PLANS.PASS]: null,
171                 [PLANS.PASS_FAMILY]: null,
172                 [PLANS.FAMILY]: null,
173                 [PLANS.DUO]: null,
174                 [PLANS.MAIL_PRO]: getConsole(),
175                 [PLANS.MAIL_BUSINESS]: getConsole(),
176                 [PLANS.BUNDLE_PRO]: getConsole(),
177                 [PLANS.BUNDLE_PRO_2024]: getConsole(),
178                 [PLANS.PASS_PRO]: getConsole(),
179                 [PLANS.PASS_BUSINESS]: getConsole(),
180                 [PLANS.VPN_PRO]: getConsole(),
181                 [PLANS.VPN_BUSINESS]: getConsole(),
182                 [PLANS.WALLET]: null,
183             },
184         },
185         {
186             name: 'billing',
187             target: Audience.B2B,
188             plans: {
189                 [PLANS.FREE]: null,
190                 [PLANS.BUNDLE]: null,
191                 [PLANS.MAIL]: null,
192                 [PLANS.VPN]: null,
193                 [PLANS.DRIVE]: null,
194                 [PLANS.DRIVE_BUSINESS]: getBilling(),
195                 [PLANS.PASS]: null,
196                 [PLANS.PASS_FAMILY]: null,
197                 [PLANS.FAMILY]: null,
198                 [PLANS.DUO]: null,
199                 [PLANS.MAIL_PRO]: getBilling(),
200                 [PLANS.MAIL_BUSINESS]: getBilling(),
201                 [PLANS.BUNDLE_PRO]: getBilling(),
202                 [PLANS.BUNDLE_PRO_2024]: getBilling(),
203                 [PLANS.PASS_PRO]: getBilling(),
204                 [PLANS.PASS_BUSINESS]: getBilling(),
205                 [PLANS.VPN_PRO]: getBilling(),
206                 [PLANS.VPN_BUSINESS]: getBilling(),
207                 [PLANS.WALLET]: null,
208             },
209         },
210         {
211             name: 'admins',
212             target: Audience.B2B,
213             plans: {
214                 [PLANS.FREE]: null,
215                 [PLANS.BUNDLE]: null,
216                 [PLANS.MAIL]: null,
217                 [PLANS.VPN]: null,
218                 [PLANS.DRIVE]: null,
219                 [PLANS.DRIVE_BUSINESS]: getAdmins(),
220                 [PLANS.PASS]: null,
221                 [PLANS.PASS_FAMILY]: null,
222                 [PLANS.FAMILY]: null,
223                 [PLANS.DUO]: null,
224                 [PLANS.MAIL_PRO]: getAdmins(),
225                 [PLANS.MAIL_BUSINESS]: getAdmins(),
226                 [PLANS.BUNDLE_PRO]: getAdmins(),
227                 [PLANS.BUNDLE_PRO_2024]: getAdmins(),
228                 [PLANS.PASS_PRO]: getAdmins(),
229                 [PLANS.PASS_BUSINESS]: getAdmins(),
230                 [PLANS.VPN_PRO]: getAdmins(),
231                 [PLANS.VPN_BUSINESS]: getAdmins(),
232                 [PLANS.WALLET]: null,
233             },
234         },
235         {
236             name: 'sso',
237             target: Audience.B2B,
238             plans: {
239                 [PLANS.FREE]: null,
240                 [PLANS.BUNDLE]: null,
241                 [PLANS.MAIL]: null,
242                 [PLANS.VPN]: null,
243                 [PLANS.DRIVE]: null,
244                 [PLANS.DRIVE_BUSINESS]: null,
245                 [PLANS.PASS]: null,
246                 [PLANS.PASS_FAMILY]: null,
247                 [PLANS.FAMILY]: null,
248                 [PLANS.DUO]: null,
249                 [PLANS.MAIL_PRO]: null,
250                 [PLANS.MAIL_BUSINESS]: null,
251                 [PLANS.BUNDLE_PRO]: null,
252                 [PLANS.BUNDLE_PRO_2024]: null,
253                 [PLANS.PASS_PRO]: getSSOIntegration(),
254                 [PLANS.PASS_BUSINESS]: getSSOIntegration(true),
255                 [PLANS.VPN_PRO]: null,
256                 [PLANS.VPN_BUSINESS]: null,
257                 [PLANS.WALLET]: null,
258             },
259         },
260         {
261             name: 'sign-in',
262             target: Audience.B2B,
263             plans: {
264                 [PLANS.FREE]: null,
265                 [PLANS.BUNDLE]: null,
266                 [PLANS.MAIL]: null,
267                 [PLANS.VPN]: null,
268                 [PLANS.DRIVE]: null,
269                 [PLANS.DRIVE_BUSINESS]: null,
270                 [PLANS.PASS]: null,
271                 [PLANS.PASS_FAMILY]: null,
272                 [PLANS.FAMILY]: null,
273                 [PLANS.DUO]: null,
274                 [PLANS.MAIL_PRO]: getSignIn(),
275                 [PLANS.MAIL_BUSINESS]: getSignIn(),
276                 [PLANS.BUNDLE_PRO]: getSignIn(),
277                 [PLANS.BUNDLE_PRO_2024]: getSignIn(),
278                 [PLANS.PASS_PRO]: getSignIn(),
279                 [PLANS.PASS_BUSINESS]: getSignIn(),
280                 [PLANS.VPN_PRO]: getSignIn(),
281                 [PLANS.VPN_BUSINESS]: getSignIn(),
282                 [PLANS.WALLET]: null,
283             },
284         },
285         {
286             name: 'storage',
287             target: Audience.B2B,
288             plans: {
289                 [PLANS.FREE]: null,
290                 [PLANS.BUNDLE]: null,
291                 [PLANS.MAIL]: null,
292                 [PLANS.VPN]: null,
293                 [PLANS.DRIVE]: null,
294                 [PLANS.DRIVE_BUSINESS]: getUserStorageManagement(),
295                 [PLANS.PASS]: null,
296                 [PLANS.PASS_FAMILY]: null,
297                 [PLANS.FAMILY]: null,
298                 [PLANS.DUO]: null,
299                 [PLANS.MAIL_PRO]: getUserStorageManagement(),
300                 [PLANS.MAIL_BUSINESS]: getUserStorageManagement(),
301                 [PLANS.BUNDLE_PRO]: getUserStorageManagement(),
302                 [PLANS.BUNDLE_PRO_2024]: getUserStorageManagement(),
303                 [PLANS.PASS_PRO]: null,
304                 [PLANS.PASS_BUSINESS]: null,
305                 [PLANS.VPN_PRO]: null,
306                 [PLANS.VPN_BUSINESS]: null,
307                 [PLANS.WALLET]: null,
308             },
309         },
310         {
311             name: 'credentials',
312             target: Audience.B2B,
313             plans: {
314                 [PLANS.FREE]: null,
315                 [PLANS.BUNDLE]: null,
316                 [PLANS.MAIL]: null,
317                 [PLANS.VPN]: null,
318                 [PLANS.DRIVE]: null,
319                 [PLANS.DRIVE_BUSINESS]: getCredentials(),
320                 [PLANS.PASS]: null,
321                 [PLANS.PASS_FAMILY]: null,
322                 [PLANS.FAMILY]: null,
323                 [PLANS.DUO]: null,
324                 [PLANS.MAIL_PRO]: getCredentials(),
325                 [PLANS.MAIL_BUSINESS]: getCredentials(),
326                 [PLANS.BUNDLE_PRO]: getCredentials(),
327                 [PLANS.BUNDLE_PRO_2024]: getCredentials(),
328                 [PLANS.PASS_PRO]: getCredentials(),
329                 [PLANS.PASS_BUSINESS]: getCredentials(),
330                 [PLANS.VPN_PRO]: getCredentials(),
331                 [PLANS.VPN_BUSINESS]: getCredentials(),
332                 [PLANS.WALLET]: null,
333             },
334         },
335         {
336             name: 'sessions',
337             target: Audience.B2B,
338             plans: {
339                 [PLANS.FREE]: null,
340                 [PLANS.BUNDLE]: null,
341                 [PLANS.MAIL]: null,
342                 [PLANS.VPN]: null,
343                 [PLANS.DRIVE]: null,
344                 [PLANS.DRIVE_BUSINESS]: getSessions(),
345                 [PLANS.PASS]: null,
346                 [PLANS.PASS_FAMILY]: null,
347                 [PLANS.FAMILY]: null,
348                 [PLANS.DUO]: null,
349                 [PLANS.MAIL_PRO]: getSessions(),
350                 [PLANS.MAIL_BUSINESS]: getSessions(),
351                 [PLANS.BUNDLE_PRO]: getSessions(),
352                 [PLANS.BUNDLE_PRO_2024]: getSessions(),
353                 [PLANS.PASS_PRO]: getSessions(),
354                 [PLANS.PASS_BUSINESS]: getSessions(),
355                 [PLANS.VPN_PRO]: getSessions(),
356                 [PLANS.VPN_BUSINESS]: getSessions(),
357                 [PLANS.WALLET]: null,
358             },
359         },
360     ];
362 export const getGDPR = (): PlanCardFeatureDefinition => {
363     return {
364         text: c('new_plans: feature').t`GDPR data processing agreement`,
365         included: true,
366     };
368 export const getHIPAA = (): PlanCardFeatureDefinition => {
369     return {
370         text: c('new_plans: feature').t`Enables HIPAA compliance`,
371         tooltip: c('new_plans: tooltip')
372             .t`We’re committed to helping customers subject to HIPAA/HITECH regulations safeguard protected health information (PHI). Signed BAAs are available for all ${BRAND_NAME} for Business customers.`,
373         included: true,
374     };
376 export const getSupport = (): PlanCardFeatureDefinition => {
377     return {
378         text: c('new_plans: feature').t`Priority email support`,
379         tooltip: c('new_plans: tooltip')
380             .t`On business days, receive support from the ${BRAND_NAME} Customer Support team within 24 hours of requests`,
381         included: true,
382     };
384 export const getPhoneSupport = (): PlanCardFeatureDefinition => {
385     return {
386         text: c('new_plans: feature').t`Phone support (20+ users)`,
387         tooltip: c('new_plans: tooltip')
388             .t`Phone support is available from the ${BRAND_NAME} Customer Support team during European business hours, for customers with 20 or more users`,
389         included: true,
390         icon: 'phone',
391     };
393 export const getSLA = (): PlanCardFeatureDefinition => {
394     return {
395         text: c('new_plans: feature').t`99.95% SLA`,
396         tooltip: c('new_plans: tooltip')
397             .t`Our robust infrastructure ensures you will be able to access your account when you need it`,
398         included: true,
399     };
402 export const getSupportFeatures = (): PlanCardFeature[] => {
403     return [
404         {
405             name: 'gdpr',
406             target: Audience.B2B,
407             plans: {
408                 [PLANS.FREE]: null,
409                 [PLANS.BUNDLE]: null,
410                 [PLANS.MAIL]: null,
411                 [PLANS.VPN]: null,
412                 [PLANS.DRIVE]: null,
413                 [PLANS.DRIVE_BUSINESS]: getGDPR(),
414                 [PLANS.PASS]: null,
415                 [PLANS.PASS_FAMILY]: null,
416                 [PLANS.FAMILY]: null,
417                 [PLANS.DUO]: null,
418                 [PLANS.MAIL_PRO]: getGDPR(),
419                 [PLANS.MAIL_BUSINESS]: getGDPR(),
420                 [PLANS.BUNDLE_PRO]: getGDPR(),
421                 [PLANS.BUNDLE_PRO_2024]: getGDPR(),
422                 [PLANS.PASS_PRO]: getGDPR(),
423                 [PLANS.PASS_BUSINESS]: getGDPR(),
424                 [PLANS.VPN_PRO]: getGDPR(),
425                 [PLANS.VPN_BUSINESS]: getGDPR(),
426                 [PLANS.WALLET]: null,
427             },
428         },
429         {
430             name: 'hipaa',
431             target: Audience.B2B,
432             plans: {
433                 [PLANS.FREE]: null,
434                 [PLANS.BUNDLE]: null,
435                 [PLANS.MAIL]: null,
436                 [PLANS.VPN]: null,
437                 [PLANS.DRIVE]: null,
438                 [PLANS.DRIVE_BUSINESS]: getHIPAA(),
439                 [PLANS.PASS]: null,
440                 [PLANS.PASS_FAMILY]: null,
441                 [PLANS.FAMILY]: null,
442                 [PLANS.DUO]: null,
443                 [PLANS.MAIL_PRO]: getHIPAA(),
444                 [PLANS.MAIL_BUSINESS]: getHIPAA(),
445                 [PLANS.BUNDLE_PRO]: getHIPAA(),
446                 [PLANS.BUNDLE_PRO_2024]: getHIPAA(),
447                 [PLANS.PASS_PRO]: getHIPAA(),
448                 [PLANS.PASS_BUSINESS]: getHIPAA(),
449                 [PLANS.VPN_PRO]: getHIPAA(),
450                 [PLANS.VPN_BUSINESS]: getHIPAA(),
451                 [PLANS.WALLET]: null,
452             },
453         },
454         {
455             name: 'b2b-support',
456             target: Audience.B2B,
457             plans: {
458                 [PLANS.FREE]: null,
459                 [PLANS.BUNDLE]: null,
460                 [PLANS.MAIL]: null,
461                 [PLANS.VPN]: null,
462                 [PLANS.DRIVE]: null,
463                 [PLANS.DRIVE_BUSINESS]: getSupport(),
464                 [PLANS.PASS]: null,
465                 [PLANS.PASS_FAMILY]: null,
466                 [PLANS.FAMILY]: null,
467                 [PLANS.DUO]: null,
468                 [PLANS.MAIL_PRO]: getSupport(),
469                 [PLANS.MAIL_BUSINESS]: getSupport(),
470                 [PLANS.BUNDLE_PRO]: getSupport(),
471                 [PLANS.BUNDLE_PRO_2024]: getSupport(),
472                 [PLANS.PASS_PRO]: getSupport(),
473                 [PLANS.PASS_BUSINESS]: getSupport(),
474                 [PLANS.VPN_PRO]: getSupport(),
475                 [PLANS.VPN_BUSINESS]: getSupport(),
476                 [PLANS.WALLET]: null,
477             },
478         },
479         {
480             name: 'phone-support',
481             target: Audience.B2B,
482             plans: {
483                 [PLANS.FREE]: null,
484                 [PLANS.BUNDLE]: null,
485                 [PLANS.MAIL]: null,
486                 [PLANS.VPN]: null,
487                 [PLANS.DRIVE]: null,
488                 [PLANS.DRIVE_BUSINESS]: getPhoneSupport(),
489                 [PLANS.PASS]: null,
490                 [PLANS.PASS_FAMILY]: null,
491                 [PLANS.FAMILY]: null,
492                 [PLANS.DUO]: null,
493                 [PLANS.MAIL_PRO]: getPhoneSupport(),
494                 [PLANS.MAIL_BUSINESS]: getPhoneSupport(),
495                 [PLANS.BUNDLE_PRO]: getPhoneSupport(),
496                 [PLANS.BUNDLE_PRO_2024]: getPhoneSupport(),
497                 [PLANS.PASS_PRO]: getPhoneSupport(),
498                 [PLANS.PASS_BUSINESS]: getPhoneSupport(),
499                 [PLANS.VPN_PRO]: getPhoneSupport(),
500                 [PLANS.VPN_BUSINESS]: getPhoneSupport(),
501                 [PLANS.WALLET]: null,
502             },
503         },
504         {
505             name: 'sla',
506             target: Audience.B2B,
507             plans: {
508                 [PLANS.FREE]: null,
509                 [PLANS.BUNDLE]: null,
510                 [PLANS.MAIL]: null,
511                 [PLANS.VPN]: null,
512                 [PLANS.DRIVE]: null,
513                 [PLANS.DRIVE_BUSINESS]: getSLA(),
514                 [PLANS.PASS]: null,
515                 [PLANS.PASS_FAMILY]: null,
516                 [PLANS.FAMILY]: null,
517                 [PLANS.DUO]: null,
518                 [PLANS.MAIL_PRO]: getSLA(),
519                 [PLANS.MAIL_BUSINESS]: getSLA(),
520                 [PLANS.BUNDLE_PRO]: getSLA(),
521                 [PLANS.BUNDLE_PRO_2024]: getSLA(),
522                 [PLANS.PASS_PRO]: getSLA(),
523                 [PLANS.PASS_BUSINESS]: getSLA(),
524                 [PLANS.VPN_PRO]: getSLA(),
525                 [PLANS.VPN_BUSINESS]: getSLA(),
526                 [PLANS.WALLET]: null,
527             },
528         },
529     ];