billingConfig.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import AM1_PLANS from 'getsentry-test/fixtures/am1Plans';
  2. import AM2_PLANS from 'getsentry-test/fixtures/am2Plans';
  3. import AM3_PLANS from 'getsentry-test/fixtures/am3Plans';
  4. import {FeatureListFixture} from 'getsentry-test/fixtures/featureList';
  5. import MM1_PLANS from 'getsentry-test/fixtures/mm1Plans';
  6. import MM2_PLANS from 'getsentry-test/fixtures/mm2Plans';
  7. import type {BillingConfig} from 'getsentry/types';
  8. import {PlanTier} from 'getsentry/types';
  9. export function BillingConfigFixture(tier: PlanTier): BillingConfig {
  10. if (tier === PlanTier.TEST) {
  11. return {
  12. id: PlanTier.TEST,
  13. freePlan: 'am3_f',
  14. defaultPlan: 'am3_f',
  15. defaultReserved: {errors: 1000000},
  16. annualDiscount: 0.1,
  17. planList: Object.values(AM3_PLANS),
  18. featureList: FeatureListFixture(),
  19. };
  20. }
  21. if (tier === PlanTier.MM1) {
  22. return {
  23. id: PlanTier.MM1,
  24. freePlan: 'f1',
  25. defaultPlan: 'm1',
  26. defaultReserved: {errors: 1000000},
  27. annualDiscount: 0.1,
  28. planList: Object.values(MM1_PLANS),
  29. featureList: FeatureListFixture(),
  30. };
  31. }
  32. if (tier === PlanTier.MM2) {
  33. return {
  34. id: PlanTier.MM2,
  35. freePlan: 'mm2_f',
  36. defaultPlan: 'mm2_a_100k',
  37. defaultReserved: {errors: 100000},
  38. annualDiscount: 0.1,
  39. planList: Object.values(MM2_PLANS),
  40. featureList: FeatureListFixture(),
  41. };
  42. }
  43. if (tier === PlanTier.AM2) {
  44. return {
  45. id: PlanTier.AM2,
  46. freePlan: 'am2_f',
  47. defaultPlan: 'am2_team',
  48. defaultReserved: {
  49. errors: 50000,
  50. transactions: 100000,
  51. attachments: 1,
  52. replays: 500,
  53. monitorSeats: 1,
  54. uptime: 1,
  55. },
  56. annualDiscount: 0.1,
  57. planList: Object.values(AM2_PLANS),
  58. featureList: FeatureListFixture(),
  59. };
  60. }
  61. if (tier === PlanTier.AM3) {
  62. return {
  63. id: PlanTier.AM3,
  64. freePlan: 'am3_f',
  65. defaultPlan: 'am3_team',
  66. defaultReserved: {
  67. errors: 50_000,
  68. attachments: 1,
  69. replays: 50,
  70. monitorSeats: 1,
  71. spans: 10_000_000,
  72. uptime: 1,
  73. },
  74. annualDiscount: 0.1,
  75. planList: Object.values(AM3_PLANS),
  76. featureList: FeatureListFixture(),
  77. };
  78. }
  79. return {
  80. id: PlanTier.AM1,
  81. freePlan: 'am1_f',
  82. defaultPlan: 'am1_team',
  83. defaultReserved: {
  84. errors: 50000,
  85. transactions: 100000,
  86. attachments: 1,
  87. replays: 500,
  88. monitorSeats: 1,
  89. uptime: 1,
  90. },
  91. annualDiscount: 0.1,
  92. planList: Object.values(AM1_PLANS),
  93. featureList: FeatureListFixture(),
  94. };
  95. }