invoicePreview.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import type {PreviewData} from 'getsentry/types';
  2. import {InvoiceItemType} from 'getsentry/types';
  3. export function InvoicePreviewFixture(params: Partial<PreviewData> = {}): PreviewData {
  4. return {
  5. atPeriodEnd: false,
  6. balanceChange: 0,
  7. proratedAmount: 8900,
  8. billedAmount: 8900,
  9. creditApplied: 0,
  10. newBalance: 0,
  11. effectiveAt: '2020-06-08T05:01:02.304299Z',
  12. previewToken: '1:2020-06-08T05:01:02',
  13. invoiceItems: [
  14. {
  15. amount: 8900,
  16. data: {plan: 'am1_business'},
  17. description: 'Subscription to Business',
  18. period_end: '2020-07-07',
  19. period_start: '2020-06-08',
  20. type: InvoiceItemType.SUBSCRIPTION,
  21. },
  22. {
  23. amount: 0,
  24. data: {quantity: 50000},
  25. description: '50,000 prepaid errors',
  26. period_end: '2020-07-07',
  27. period_start: '2020-06-08',
  28. type: InvoiceItemType.RESERVED_ERRORS,
  29. },
  30. {
  31. amount: 0,
  32. data: {quantity: 150000},
  33. description: '150,000 prepaid transactions',
  34. period_end: '2020-07-07',
  35. period_start: '2020-06-08',
  36. type: InvoiceItemType.RESERVED_TRANSACTIONS,
  37. },
  38. {
  39. amount: 0,
  40. data: {quantity: 5},
  41. description: '5 GB prepaid attachments',
  42. period_end: '2020-07-07',
  43. period_start: '2020-06-08',
  44. type: InvoiceItemType.RESERVED_ATTACHMENTS,
  45. },
  46. ],
  47. ...params,
  48. };
  49. }