subscriptions.ts 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  1. import {
  2. CustomSubscription,
  3. GroupSubscription,
  4. PaidSubscription,
  5. } from '../../../../../types/subscription/dashboard/subscription'
  6. import dateformat from 'dateformat'
  7. const today = new Date()
  8. const oneYearFromToday = new Date().setFullYear(today.getFullYear() + 1)
  9. const nextPaymentDueAt = dateformat(oneYearFromToday, 'dS mmmm yyyy')
  10. const nextPaymentDueDate = dateformat(oneYearFromToday, 'dS mmmm yyyy')
  11. const sevenDaysFromToday = new Date().setDate(today.getDate() + 7)
  12. const sevenDaysFromTodayFormatted = dateformat(
  13. sevenDaysFromToday,
  14. 'dS mmmm yyyy'
  15. )
  16. export const annualActiveSubscription: PaidSubscription = {
  17. manager_ids: ['abc123'],
  18. member_ids: [],
  19. invited_emails: [],
  20. groupPlan: false,
  21. membersLimit: 0,
  22. _id: 'def456',
  23. admin_id: 'abc123',
  24. teamInvites: [],
  25. planCode: 'collaborator-annual',
  26. plan: {
  27. planCode: 'collaborator-annual',
  28. name: 'Standard (Collaborator) Annual',
  29. price_in_cents: 21900,
  30. annual: true,
  31. featureDescription: [],
  32. canUseFlexibleLicensing: false,
  33. },
  34. payment: {
  35. taxRate: 0,
  36. billingDetailsLink: '/user/subscription/payment/billing-details',
  37. accountManagementLink: '/user/subscription/payment/account-management',
  38. additionalLicenses: 0,
  39. totalLicenses: 0,
  40. nextPaymentDueAt,
  41. nextPaymentDueDate,
  42. currency: 'USD',
  43. state: 'active',
  44. trialEndsAtFormatted: null,
  45. trialEndsAt: null,
  46. activeCoupons: [],
  47. accountEmail: 'fake@example.com',
  48. hasPastDueInvoice: false,
  49. displayPrice: '$199.00',
  50. planOnlyDisplayPrice: '$199.00',
  51. addOns: [],
  52. addOnDisplayPricesWithoutAdditionalLicense: {},
  53. isEligibleForGroupPlan: true,
  54. isEligibleForPause: false,
  55. isEligibleForDowngradeUpsell: false,
  56. isMigratedFromRecurly: false,
  57. },
  58. }
  59. export const annualActiveSubscriptionWithCoupons: PaidSubscription = {
  60. manager_ids: ['abc123'],
  61. member_ids: [],
  62. invited_emails: [],
  63. groupPlan: false,
  64. membersLimit: 0,
  65. _id: 'def456',
  66. admin_id: 'abc123',
  67. teamInvites: [],
  68. planCode: 'collaborator-annual',
  69. plan: {
  70. planCode: 'collaborator-annual',
  71. name: 'Standard (Collaborator) Annual',
  72. price_in_cents: 21900,
  73. annual: true,
  74. featureDescription: [],
  75. canUseFlexibleLicensing: false,
  76. },
  77. payment: {
  78. taxRate: 0,
  79. billingDetailsLink: '/user/subscription/payment/billing-details',
  80. accountManagementLink: '/user/subscription/payment/account-management',
  81. additionalLicenses: 0,
  82. totalLicenses: 0,
  83. nextPaymentDueAt,
  84. nextPaymentDueDate,
  85. currency: 'USD',
  86. state: 'active',
  87. trialEndsAtFormatted: null,
  88. trialEndsAt: null,
  89. activeCoupons: [
  90. { name: 'Coupon1', code: 'c1', description: 'Coupon1 for 10% off' },
  91. { name: 'Coupon2', code: 'c2', description: 'Coupon2 for 15% off' },
  92. ],
  93. accountEmail: 'fake@example.com',
  94. hasPastDueInvoice: false,
  95. displayPrice: '$199.00',
  96. planOnlyDisplayPrice: '$199.00',
  97. addOns: [],
  98. addOnDisplayPricesWithoutAdditionalLicense: {},
  99. isEligibleForGroupPlan: true,
  100. isEligibleForPause: false,
  101. isEligibleForDowngradeUpsell: false,
  102. isMigratedFromRecurly: false,
  103. },
  104. }
  105. export const pendingPausedSubscription: PaidSubscription = {
  106. manager_ids: ['abc123'],
  107. member_ids: [],
  108. invited_emails: [],
  109. groupPlan: false,
  110. membersLimit: 0,
  111. _id: 'def456',
  112. admin_id: 'abc123',
  113. teamInvites: [],
  114. planCode: 'collaborator-annual',
  115. plan: {
  116. planCode: 'collaborator-annual',
  117. name: 'Standard (Collaborator) Annual',
  118. price_in_cents: 21900,
  119. annual: true,
  120. featureDescription: [],
  121. canUseFlexibleLicensing: false,
  122. },
  123. payment: {
  124. taxRate: 0,
  125. billingDetailsLink: '/user/subscription/payment/billing-details',
  126. accountManagementLink: '/user/subscription/payment/account-management',
  127. additionalLicenses: 0,
  128. totalLicenses: 0,
  129. nextPaymentDueAt,
  130. nextPaymentDueDate,
  131. currency: 'USD',
  132. state: 'active',
  133. remainingPauseCycles: 1,
  134. trialEndsAtFormatted: null,
  135. trialEndsAt: null,
  136. activeCoupons: [],
  137. accountEmail: 'fake@example.com',
  138. hasPastDueInvoice: false,
  139. displayPrice: '$199.00',
  140. planOnlyDisplayPrice: '$199.00',
  141. addOns: [],
  142. addOnDisplayPricesWithoutAdditionalLicense: {},
  143. isEligibleForGroupPlan: true,
  144. isEligibleForPause: false,
  145. isEligibleForDowngradeUpsell: false,
  146. isMigratedFromRecurly: false,
  147. },
  148. }
  149. export const pausedSubscription: PaidSubscription = {
  150. manager_ids: ['abc123'],
  151. member_ids: [],
  152. invited_emails: [],
  153. groupPlan: false,
  154. membersLimit: 0,
  155. _id: 'def456',
  156. admin_id: 'abc123',
  157. teamInvites: [],
  158. planCode: 'collaborator-annual',
  159. plan: {
  160. planCode: 'collaborator-annual',
  161. name: 'Standard (Collaborator) Annual',
  162. price_in_cents: 21900,
  163. annual: true,
  164. featureDescription: [],
  165. canUseFlexibleLicensing: false,
  166. },
  167. payment: {
  168. taxRate: 0,
  169. billingDetailsLink: '/user/subscription/payment/billing-details',
  170. accountManagementLink: '/user/subscription/payment/account-management',
  171. additionalLicenses: 0,
  172. totalLicenses: 0,
  173. nextPaymentDueAt,
  174. nextPaymentDueDate,
  175. currency: 'USD',
  176. state: 'paused',
  177. remainingPauseCycles: 1,
  178. trialEndsAtFormatted: null,
  179. trialEndsAt: null,
  180. activeCoupons: [],
  181. accountEmail: 'fake@example.com',
  182. hasPastDueInvoice: false,
  183. displayPrice: '$199.00',
  184. planOnlyDisplayPrice: '$199.00',
  185. addOns: [],
  186. addOnDisplayPricesWithoutAdditionalLicense: {},
  187. isEligibleForGroupPlan: true,
  188. isEligibleForPause: false,
  189. isEligibleForDowngradeUpsell: false,
  190. isMigratedFromRecurly: false,
  191. },
  192. }
  193. export const annualActiveSubscriptionWithAddons: PaidSubscription = {
  194. manager_ids: ['abc123'],
  195. member_ids: [],
  196. invited_emails: [],
  197. groupPlan: false,
  198. membersLimit: 0,
  199. _id: 'def456',
  200. admin_id: 'abc123',
  201. teamInvites: [],
  202. planCode: 'collaborator-annual',
  203. plan: {
  204. planCode: 'collaborator-annual',
  205. name: 'Standard (Collaborator) Annual',
  206. price_in_cents: 21900,
  207. annual: true,
  208. featureDescription: [],
  209. canUseFlexibleLicensing: false,
  210. },
  211. payment: {
  212. taxRate: 0,
  213. billingDetailsLink: '/user/subscription/payment/billing-details',
  214. accountManagementLink: '/user/subscription/payment/account-management',
  215. additionalLicenses: 0,
  216. totalLicenses: 0,
  217. nextPaymentDueAt,
  218. nextPaymentDueDate,
  219. currency: 'USD',
  220. state: 'active',
  221. trialEndsAtFormatted: null,
  222. trialEndsAt: null,
  223. activeCoupons: [],
  224. accountEmail: 'fake@example.com',
  225. hasPastDueInvoice: false,
  226. displayPrice: '$199.00',
  227. planOnlyDisplayPrice: '$199.00',
  228. addOns: [],
  229. addOnDisplayPricesWithoutAdditionalLicense: {
  230. assistant: '$100.00',
  231. },
  232. isEligibleForGroupPlan: true,
  233. isEligibleForPause: false,
  234. isEligibleForDowngradeUpsell: false,
  235. isMigratedFromRecurly: false,
  236. },
  237. addOns: [{ addOnCode: 'assistant', quantity: 1, unitAmountInCents: 10000 }],
  238. }
  239. export const annualActiveSubscriptionEuro: PaidSubscription = {
  240. manager_ids: ['abc123'],
  241. member_ids: [],
  242. invited_emails: [],
  243. groupPlan: false,
  244. membersLimit: 0,
  245. _id: 'def456',
  246. admin_id: 'abc123',
  247. teamInvites: [],
  248. planCode: 'collaborator-annual',
  249. plan: {
  250. planCode: 'collaborator-annual',
  251. name: 'Standard (Collaborator) Annual',
  252. price_in_cents: 21900,
  253. annual: true,
  254. featureDescription: [],
  255. canUseFlexibleLicensing: false,
  256. },
  257. payment: {
  258. taxRate: 0.24,
  259. billingDetailsLink: '/user/subscription/payment/billing-details',
  260. accountManagementLink: '/user/subscription/payment/account-management',
  261. additionalLicenses: 0,
  262. totalLicenses: 0,
  263. nextPaymentDueAt,
  264. nextPaymentDueDate,
  265. currency: 'EUR',
  266. state: 'active',
  267. trialEndsAtFormatted: null,
  268. trialEndsAt: null,
  269. activeCoupons: [],
  270. accountEmail: 'fake@example.com',
  271. hasPastDueInvoice: false,
  272. displayPrice: '€221.96',
  273. planOnlyDisplayPrice: '€221.96',
  274. addOns: [],
  275. addOnDisplayPricesWithoutAdditionalLicense: {},
  276. isEligibleForGroupPlan: true,
  277. isEligibleForPause: true,
  278. isEligibleForDowngradeUpsell: false,
  279. isMigratedFromRecurly: false,
  280. },
  281. }
  282. export const annualActiveSubscriptionPro: PaidSubscription = {
  283. manager_ids: ['abc123'],
  284. member_ids: [],
  285. invited_emails: [],
  286. groupPlan: false,
  287. membersLimit: 0,
  288. _id: 'def456',
  289. admin_id: 'abc123',
  290. teamInvites: [],
  291. planCode: 'professional',
  292. plan: {
  293. planCode: 'professional',
  294. name: 'Professional',
  295. price_in_cents: 4500,
  296. featureDescription: [],
  297. canUseFlexibleLicensing: false,
  298. },
  299. payment: {
  300. taxRate: 0,
  301. billingDetailsLink: '/user/subscription/payment/billing-details',
  302. accountManagementLink: '/user/subscription/payment/account-management',
  303. additionalLicenses: 0,
  304. totalLicenses: 0,
  305. nextPaymentDueAt,
  306. nextPaymentDueDate,
  307. currency: 'USD',
  308. state: 'active',
  309. trialEndsAtFormatted: null,
  310. trialEndsAt: null,
  311. activeCoupons: [],
  312. accountEmail: 'fake@example.com',
  313. hasPastDueInvoice: false,
  314. displayPrice: '$42.00',
  315. planOnlyDisplayPrice: '$42.00',
  316. addOns: [],
  317. addOnDisplayPricesWithoutAdditionalLicense: {},
  318. isEligibleForGroupPlan: true,
  319. isEligibleForPause: true,
  320. isEligibleForDowngradeUpsell: false,
  321. isMigratedFromRecurly: false,
  322. },
  323. }
  324. export const pastDueExpiredSubscription: PaidSubscription = {
  325. manager_ids: ['abc123'],
  326. member_ids: [],
  327. invited_emails: [],
  328. groupPlan: false,
  329. membersLimit: 0,
  330. _id: 'def456',
  331. admin_id: 'abc123',
  332. teamInvites: [],
  333. planCode: 'collaborator-annual',
  334. plan: {
  335. planCode: 'collaborator-annual',
  336. name: 'Standard (Collaborator) Annual',
  337. price_in_cents: 21900,
  338. annual: true,
  339. featureDescription: [],
  340. canUseFlexibleLicensing: false,
  341. },
  342. payment: {
  343. taxRate: 0,
  344. billingDetailsLink: '/user/subscription/payment/billing-details',
  345. accountManagementLink: '/user/subscription/payment/account-management',
  346. additionalLicenses: 0,
  347. totalLicenses: 0,
  348. nextPaymentDueAt,
  349. nextPaymentDueDate,
  350. currency: 'USD',
  351. state: 'expired',
  352. trialEndsAtFormatted: null,
  353. trialEndsAt: null,
  354. activeCoupons: [],
  355. accountEmail: 'fake@example.com',
  356. hasPastDueInvoice: true,
  357. displayPrice: '$199.00',
  358. planOnlyDisplayPrice: '$199.00',
  359. addOns: [],
  360. addOnDisplayPricesWithoutAdditionalLicense: {},
  361. isEligibleForGroupPlan: true,
  362. isEligibleForPause: true,
  363. isEligibleForDowngradeUpsell: false,
  364. isMigratedFromRecurly: false,
  365. },
  366. }
  367. export const canceledSubscription: PaidSubscription = {
  368. manager_ids: ['abc123'],
  369. member_ids: [],
  370. invited_emails: [],
  371. groupPlan: false,
  372. membersLimit: 0,
  373. _id: 'def456',
  374. admin_id: 'abc123',
  375. teamInvites: [],
  376. planCode: 'collaborator-annual',
  377. plan: {
  378. planCode: 'collaborator-annual',
  379. name: 'Standard (Collaborator) Annual',
  380. price_in_cents: 21900,
  381. annual: true,
  382. featureDescription: [],
  383. canUseFlexibleLicensing: false,
  384. },
  385. payment: {
  386. taxRate: 0,
  387. billingDetailsLink: '/user/subscription/payment/billing-details',
  388. accountManagementLink: '/user/subscription/payment/account-management',
  389. additionalLicenses: 0,
  390. totalLicenses: 0,
  391. nextPaymentDueAt,
  392. nextPaymentDueDate,
  393. currency: 'USD',
  394. state: 'canceled',
  395. trialEndsAtFormatted: null,
  396. trialEndsAt: null,
  397. activeCoupons: [],
  398. accountEmail: 'fake@example.com',
  399. hasPastDueInvoice: false,
  400. displayPrice: '$199.00',
  401. planOnlyDisplayPrice: '$199.00',
  402. addOns: [],
  403. addOnDisplayPricesWithoutAdditionalLicense: {},
  404. isEligibleForGroupPlan: true,
  405. isEligibleForPause: true,
  406. isEligibleForDowngradeUpsell: false,
  407. isMigratedFromRecurly: false,
  408. },
  409. }
  410. export const pendingAddOnChange: PaidSubscription = {
  411. manager_ids: ['abc123'],
  412. member_ids: [],
  413. invited_emails: [],
  414. groupPlan: false,
  415. membersLimit: 0,
  416. _id: 'add-on-change-123',
  417. admin_id: 'abc123',
  418. teamInvites: [],
  419. planCode: 'collaborator-annual',
  420. plan: {
  421. planCode: 'collaborator-annual',
  422. name: 'Standard (Collaborator) Annual',
  423. price_in_cents: 21900,
  424. annual: true,
  425. featureDescription: [],
  426. canUseFlexibleLicensing: false,
  427. },
  428. payment: {
  429. taxRate: 0,
  430. billingDetailsLink: '/user/subscription/payment/billing-details',
  431. accountManagementLink: '/user/subscription/payment/account-management',
  432. additionalLicenses: 0,
  433. totalLicenses: 0,
  434. nextPaymentDueAt,
  435. nextPaymentDueDate,
  436. currency: 'USD',
  437. state: 'active',
  438. trialEndsAtFormatted: null,
  439. trialEndsAt: null,
  440. activeCoupons: [],
  441. accountEmail: 'fake@example.com',
  442. hasPastDueInvoice: false,
  443. displayPrice: '$199.00',
  444. planOnlyDisplayPrice: '$199.00',
  445. addOns: [
  446. {
  447. code: 'AI',
  448. quantity: 1,
  449. unitPrice: 1000,
  450. name: 'AI Add-on',
  451. },
  452. ],
  453. addOnDisplayPricesWithoutAdditionalLicense: {},
  454. isEligibleForGroupPlan: true,
  455. isEligibleForPause: false,
  456. isEligibleForDowngradeUpsell: false,
  457. isMigratedFromRecurly: false,
  458. },
  459. pendingPlan: {
  460. planCode: 'collaborator-annual',
  461. name: 'Standard (Collaborator) Annual',
  462. price_in_cents: 21900,
  463. annual: true,
  464. featureDescription: [],
  465. },
  466. }
  467. export const pendingSubscriptionChange: PaidSubscription = {
  468. manager_ids: ['abc123'],
  469. member_ids: [],
  470. invited_emails: [],
  471. groupPlan: false,
  472. membersLimit: 0,
  473. _id: 'def456',
  474. admin_id: 'abc123',
  475. teamInvites: [],
  476. planCode: 'collaborator-annual',
  477. plan: {
  478. planCode: 'collaborator-annual',
  479. name: 'Standard (Collaborator) Annual',
  480. price_in_cents: 21900,
  481. annual: true,
  482. featureDescription: [],
  483. canUseFlexibleLicensing: false,
  484. },
  485. payment: {
  486. taxRate: 0,
  487. billingDetailsLink: '/user/subscription/payment/billing-details',
  488. accountManagementLink: '/user/subscription/payment/account-management',
  489. additionalLicenses: 0,
  490. totalLicenses: 0,
  491. nextPaymentDueAt,
  492. nextPaymentDueDate,
  493. currency: 'USD',
  494. state: 'active',
  495. trialEndsAtFormatted: null,
  496. trialEndsAt: null,
  497. activeCoupons: [],
  498. accountEmail: 'fake@example.com',
  499. hasPastDueInvoice: false,
  500. displayPrice: '$199.00',
  501. planOnlyDisplayPrice: '$199.00',
  502. addOns: [],
  503. addOnDisplayPricesWithoutAdditionalLicense: {},
  504. isEligibleForGroupPlan: true,
  505. isEligibleForPause: false,
  506. isEligibleForDowngradeUpsell: false,
  507. isMigratedFromRecurly: false,
  508. },
  509. pendingPlan: {
  510. planCode: 'professional-annual',
  511. name: 'Professional Annual',
  512. price_in_cents: 42900,
  513. annual: true,
  514. featureDescription: [],
  515. },
  516. }
  517. export const groupActiveSubscription: GroupSubscription = {
  518. manager_ids: ['abc123'],
  519. member_ids: ['abc123'],
  520. invited_emails: [],
  521. groupPlan: true,
  522. teamName: 'GAS',
  523. membersLimit: 10,
  524. _id: 'bcd567',
  525. admin_id: 'abc123',
  526. teamInvites: [],
  527. planCode: 'group_collaborator_10_enterprise',
  528. plan: {
  529. planCode: 'group_collaborator_10_enterprise',
  530. name: 'Overleaf Standard (Collaborator) - Group Account (10 licenses) - Enterprise',
  531. hideFromUsers: true,
  532. price_in_cents: 129000,
  533. annual: true,
  534. groupPlan: true,
  535. membersLimit: 10,
  536. membersLimitAddOn: 'additional-license',
  537. canUseFlexibleLicensing: true,
  538. },
  539. payment: {
  540. taxRate: 0,
  541. billingDetailsLink: '/user/subscription/payment/billing-details',
  542. accountManagementLink: '/user/subscription/payment/account-management',
  543. additionalLicenses: 0,
  544. totalLicenses: 10,
  545. nextPaymentDueAt,
  546. nextPaymentDueDate,
  547. currency: 'USD',
  548. state: 'active',
  549. trialEndsAtFormatted: null,
  550. trialEndsAt: null,
  551. activeCoupons: [],
  552. accountEmail: 'fake@example.com',
  553. hasPastDueInvoice: false,
  554. displayPrice: '$1290.00',
  555. planOnlyDisplayPrice: '$1290.00',
  556. addOns: [],
  557. addOnDisplayPricesWithoutAdditionalLicense: {},
  558. isEligibleForGroupPlan: true,
  559. isEligibleForPause: false,
  560. isEligibleForDowngradeUpsell: false,
  561. isMigratedFromRecurly: false,
  562. },
  563. }
  564. export const groupProfessionalActiveSubscription: GroupSubscription = {
  565. manager_ids: ['abc123'],
  566. member_ids: ['abc123'],
  567. invited_emails: [],
  568. groupPlan: true,
  569. teamName: 'GAS',
  570. membersLimit: 2,
  571. _id: 'bcd567',
  572. admin_id: 'abc123',
  573. teamInvites: [],
  574. planCode: 'group_professional_2_enterprise',
  575. plan: {
  576. planCode: 'group_professional_2_enterprise',
  577. name: 'Group Professional Plan (2 licenses)',
  578. hideFromUsers: true,
  579. price_in_cents: 129000,
  580. annual: true,
  581. groupPlan: true,
  582. membersLimit: 2,
  583. membersLimitAddOn: 'additional-license',
  584. canUseFlexibleLicensing: true,
  585. },
  586. payment: {
  587. taxRate: 0,
  588. billingDetailsLink: '/user/subscription/payment/billing-details',
  589. accountManagementLink: '/user/subscription/payment/account-management',
  590. additionalLicenses: 0,
  591. totalLicenses: 10,
  592. nextPaymentDueAt,
  593. nextPaymentDueDate,
  594. currency: 'USD',
  595. state: 'active',
  596. trialEndsAtFormatted: null,
  597. trialEndsAt: null,
  598. activeCoupons: [],
  599. accountEmail: 'fake@example.com',
  600. hasPastDueInvoice: false,
  601. displayPrice: '$1290.00',
  602. planOnlyDisplayPrice: '$1290.00',
  603. addOns: [],
  604. addOnDisplayPricesWithoutAdditionalLicense: {},
  605. isEligibleForGroupPlan: true,
  606. isEligibleForPause: false,
  607. isEligibleForDowngradeUpsell: false,
  608. isMigratedFromRecurly: false,
  609. },
  610. }
  611. export const groupActiveSubscriptionWithPendingLicenseChange: GroupSubscription =
  612. {
  613. manager_ids: ['abc123'],
  614. member_ids: ['abc123'],
  615. invited_emails: [],
  616. groupPlan: true,
  617. teamName: 'GASWPLC',
  618. membersLimit: 10,
  619. _id: 'def456',
  620. admin_id: 'abc123',
  621. teamInvites: [],
  622. planCode: 'group_collaborator_10_enterprise',
  623. plan: {
  624. planCode: 'group_collaborator_10_enterprise',
  625. name: 'Overleaf Standard (Collaborator) - Group Account (10 licenses) - Enterprise',
  626. hideFromUsers: true,
  627. price_in_cents: 129000,
  628. annual: true,
  629. groupPlan: true,
  630. membersLimit: 10,
  631. membersLimitAddOn: 'additional-license',
  632. canUseFlexibleLicensing: true,
  633. },
  634. payment: {
  635. taxRate: 0,
  636. billingDetailsLink: '/user/subscription/payment/billing-details',
  637. accountManagementLink: '/user/subscription/payment/account-management',
  638. additionalLicenses: 11,
  639. totalLicenses: 21,
  640. nextPaymentDueAt,
  641. nextPaymentDueDate,
  642. currency: 'USD',
  643. state: 'active',
  644. trialEndsAtFormatted: null,
  645. trialEndsAt: null,
  646. activeCoupons: [],
  647. accountEmail: 'fake@example.com',
  648. hasPastDueInvoice: false,
  649. displayPrice: '$2967.00',
  650. pendingAdditionalLicenses: 13,
  651. pendingTotalLicenses: 23,
  652. planOnlyDisplayPrice: '$2967.00',
  653. addOns: [],
  654. addOnDisplayPricesWithoutAdditionalLicense: {},
  655. isEligibleForGroupPlan: true,
  656. isEligibleForPause: false,
  657. isEligibleForDowngradeUpsell: false,
  658. isMigratedFromRecurly: false,
  659. },
  660. pendingPlan: {
  661. planCode: 'group_collaborator_10_enterprise',
  662. name: 'Overleaf Standard (Collaborator) - Group Account (10 licenses) - Enterprise',
  663. hideFromUsers: true,
  664. price_in_cents: 129000,
  665. annual: true,
  666. groupPlan: true,
  667. membersLimit: 10,
  668. membersLimitAddOn: 'additional-license',
  669. },
  670. }
  671. export const trialSubscription: PaidSubscription = {
  672. manager_ids: ['abc123'],
  673. member_ids: [],
  674. invited_emails: [],
  675. groupPlan: false,
  676. membersLimit: 0,
  677. _id: 'def456',
  678. admin_id: 'abc123',
  679. teamInvites: [],
  680. planCode: 'paid-personal_free_trial_7_days',
  681. plan: {
  682. planCode: 'paid-personal_free_trial_7_days',
  683. name: 'Personal',
  684. price_in_cents: 1500,
  685. featureDescription: [],
  686. hideFromUsers: true,
  687. },
  688. payment: {
  689. taxRate: 0,
  690. billingDetailsLink: '/user/subscription/payment/billing-details',
  691. accountManagementLink: '/user/subscription/payment/account-management',
  692. additionalLicenses: 0,
  693. totalLicenses: 0,
  694. nextPaymentDueAt: sevenDaysFromTodayFormatted,
  695. nextPaymentDueDate: sevenDaysFromTodayFormatted,
  696. currency: 'USD',
  697. state: 'active',
  698. trialEndsAtFormatted: sevenDaysFromTodayFormatted,
  699. trialEndsAt: new Date(sevenDaysFromToday).toString(),
  700. activeCoupons: [],
  701. accountEmail: 'fake@example.com',
  702. hasPastDueInvoice: false,
  703. displayPrice: '$14.00',
  704. planOnlyDisplayPrice: '$14.00',
  705. addOns: [],
  706. addOnDisplayPricesWithoutAdditionalLicense: {},
  707. isEligibleForGroupPlan: true,
  708. isEligibleForPause: false,
  709. isEligibleForDowngradeUpsell: false,
  710. isMigratedFromRecurly: false,
  711. },
  712. }
  713. export const customSubscription: CustomSubscription = {
  714. manager_ids: ['abc123'],
  715. member_ids: [],
  716. invited_emails: [],
  717. groupPlan: false,
  718. membersLimit: 0,
  719. _id: 'def456',
  720. admin_id: 'abc123',
  721. teamInvites: [],
  722. planCode: 'collaborator-annual',
  723. plan: {
  724. planCode: 'collaborator-annual',
  725. name: 'Standard (Collaborator) Annual',
  726. price_in_cents: 21900,
  727. annual: true,
  728. featureDescription: [],
  729. },
  730. customAccount: true,
  731. }
  732. export const trialCollaboratorSubscription: PaidSubscription = {
  733. manager_ids: ['abc123'],
  734. member_ids: [],
  735. invited_emails: [],
  736. groupPlan: false,
  737. membersLimit: 0,
  738. _id: 'def456',
  739. admin_id: 'abc123',
  740. teamInvites: [],
  741. planCode: 'collaborator_free_trial_7_days',
  742. plan: {
  743. planCode: 'collaborator_free_trial_7_days',
  744. name: 'Standard (Collaborator)',
  745. price_in_cents: 2300,
  746. featureDescription: [],
  747. hideFromUsers: true,
  748. canUseFlexibleLicensing: false,
  749. },
  750. payment: {
  751. taxRate: 0,
  752. billingDetailsLink: '/user/subscription/payment/billing-details',
  753. accountManagementLink: '/user/subscription/payment/account-management',
  754. additionalLicenses: 0,
  755. totalLicenses: 0,
  756. nextPaymentDueAt: sevenDaysFromTodayFormatted,
  757. nextPaymentDueDate: sevenDaysFromTodayFormatted,
  758. currency: 'USD',
  759. state: 'active',
  760. trialEndsAtFormatted: sevenDaysFromTodayFormatted,
  761. trialEndsAt: new Date(sevenDaysFromToday).toString(),
  762. activeCoupons: [],
  763. accountEmail: 'foo@example.com',
  764. hasPastDueInvoice: false,
  765. displayPrice: '$21.00',
  766. planOnlyDisplayPrice: '$21.00',
  767. addOns: [],
  768. addOnDisplayPricesWithoutAdditionalLicense: {},
  769. isEligibleForGroupPlan: true,
  770. isEligibleForPause: true,
  771. isEligibleForDowngradeUpsell: false,
  772. isMigratedFromRecurly: false,
  773. },
  774. }
  775. export const monthlyActiveCollaborator: PaidSubscription = {
  776. manager_ids: ['abc123'],
  777. member_ids: [],
  778. invited_emails: [],
  779. groupPlan: false,
  780. membersLimit: 0,
  781. _id: 'def456',
  782. admin_id: 'abc123',
  783. teamInvites: [],
  784. planCode: 'collaborator',
  785. plan: {
  786. planCode: 'collaborator',
  787. name: 'Standard (Collaborator)',
  788. price_in_cents: 212300900,
  789. featureDescription: [],
  790. canUseFlexibleLicensing: false,
  791. },
  792. payment: {
  793. taxRate: 0,
  794. billingDetailsLink: '/user/subscription/payment/billing-details',
  795. accountManagementLink: '/user/subscription/payment/account-management',
  796. additionalLicenses: 0,
  797. totalLicenses: 0,
  798. nextPaymentDueAt,
  799. nextPaymentDueDate,
  800. currency: 'USD',
  801. state: 'active',
  802. trialEndsAtFormatted: null,
  803. trialEndsAt: null,
  804. activeCoupons: [],
  805. accountEmail: 'foo@example.com',
  806. hasPastDueInvoice: false,
  807. displayPrice: '$21.00',
  808. planOnlyDisplayPrice: '$21.00',
  809. addOns: [],
  810. addOnDisplayPricesWithoutAdditionalLicense: {},
  811. isEligibleForGroupPlan: true,
  812. isEligibleForPause: true,
  813. isEligibleForDowngradeUpsell: true,
  814. isMigratedFromRecurly: false,
  815. },
  816. }