|
| 1 | +// Invoice paid is a legacy/unsupported event which is implicitly handled through GenericEvent |
| 2 | + |
| 3 | +import { IEventsResponse } from '../../../types/index.js'; |
| 4 | + |
| 5 | +export const InvoicePaidMock: IEventsResponse<object> = { |
| 6 | + event_id: 'evt_01jdw4vq5a26w8mpfc59mez047', |
| 7 | + event_type: 'invoice.paid', |
| 8 | + occurred_at: '2024-11-29T14:23:08.971054Z', |
| 9 | + notification_id: 'ntf_01h90nmerv7vrn93f97j5v72p7', |
| 10 | + data: { |
| 11 | + id: 'inv_01jdw4vk9fr1n6smpbhykm6ha9', |
| 12 | + items: [ |
| 13 | + { |
| 14 | + price: { |
| 15 | + product_id: 'pro_01gv5dvjjx0nmydxa2pb9trdcq', |
| 16 | + unit_price: { |
| 17 | + amount: '1000', |
| 18 | + currency_code: 'GBP', |
| 19 | + }, |
| 20 | + }, |
| 21 | + quantity: 1, |
| 22 | + }, |
| 23 | + ], |
| 24 | + due_at: '2024-11-30T14:23:07.865592Z', |
| 25 | + status: 'paid', |
| 26 | + details: { |
| 27 | + totals: { |
| 28 | + tax: '167', |
| 29 | + total: '1000', |
| 30 | + subtotal: '833', |
| 31 | + }, |
| 32 | + line_items: [ |
| 33 | + { |
| 34 | + totals: { |
| 35 | + tax: '0', |
| 36 | + total: '1000', |
| 37 | + subtotal: '1000', |
| 38 | + }, |
| 39 | + product: { |
| 40 | + id: 'pro_01gv5dvjjx0nmydxa2pb9trdcq', |
| 41 | + name: 'AT Test Product', |
| 42 | + status: 'active', |
| 43 | + image_url: null, |
| 44 | + description: 'Exmaple', |
| 45 | + tax_category: 'standard', |
| 46 | + }, |
| 47 | + quantity: 1, |
| 48 | + tax_rate: '0', |
| 49 | + unit_totals: { |
| 50 | + tax: '0', |
| 51 | + total: '1000', |
| 52 | + subtotal: '1000', |
| 53 | + }, |
| 54 | + }, |
| 55 | + ], |
| 56 | + }, |
| 57 | + paid_at: '2024-11-29T14:23:05.561011761Z', |
| 58 | + checkout: null, |
| 59 | + issued_at: '2024-11-29T14:23:07.865592Z', |
| 60 | + address_id: 'add_01jaav7fx9ew7w6293cxjdkrp7', |
| 61 | + created_at: '2024-11-29T14:23:05.007735Z', |
| 62 | + updated_at: '2024-11-29T14:23:05.007735Z', |
| 63 | + business_id: 'biz_01jaav8zw7anv2egarn5vz7xhr', |
| 64 | + custom_data: [], |
| 65 | + customer_id: 'ctm_01gv5gb258na82skxd7ng7ha3r', |
| 66 | + currency_code: 'GBP', |
| 67 | + billing_period: { |
| 68 | + type: 'billing', |
| 69 | + ends_at: '2024-11-30', |
| 70 | + starts_at: '2024-11-29', |
| 71 | + }, |
| 72 | + invoice_number: '296-844420', |
| 73 | + transaction_id: 'txn_01jdw4vgdq62e0b6x8dqsm4ycn', |
| 74 | + billing_details: { |
| 75 | + payment_terms: { |
| 76 | + interval: 'day', |
| 77 | + frequency: 1, |
| 78 | + }, |
| 79 | + enable_checkout: true, |
| 80 | + purchase_order_number: null, |
| 81 | + additional_information: null, |
| 82 | + }, |
| 83 | + }, |
| 84 | +}; |
| 85 | + |
| 86 | +export const InvoicePaidMockExpectation = { |
| 87 | + data: { |
| 88 | + addressId: 'add_01jaav7fx9ew7w6293cxjdkrp7', |
| 89 | + billingDetails: { |
| 90 | + additionalInformation: null, |
| 91 | + enableCheckout: true, |
| 92 | + paymentTerms: { |
| 93 | + frequency: 1, |
| 94 | + interval: 'day', |
| 95 | + }, |
| 96 | + purchaseOrderNumber: null, |
| 97 | + }, |
| 98 | + billingPeriod: { |
| 99 | + endsAt: '2024-11-30', |
| 100 | + startsAt: '2024-11-29', |
| 101 | + type: 'billing', |
| 102 | + }, |
| 103 | + businessId: 'biz_01jaav8zw7anv2egarn5vz7xhr', |
| 104 | + checkout: null, |
| 105 | + createdAt: '2024-11-29T14:23:05.007735Z', |
| 106 | + currencyCode: 'GBP', |
| 107 | + customData: [], |
| 108 | + customerId: 'ctm_01gv5gb258na82skxd7ng7ha3r', |
| 109 | + details: { |
| 110 | + lineItems: [ |
| 111 | + { |
| 112 | + product: { |
| 113 | + description: 'Exmaple', |
| 114 | + id: 'pro_01gv5dvjjx0nmydxa2pb9trdcq', |
| 115 | + imageUrl: null, |
| 116 | + name: 'AT Test Product', |
| 117 | + status: 'active', |
| 118 | + taxCategory: 'standard', |
| 119 | + }, |
| 120 | + quantity: 1, |
| 121 | + taxRate: '0', |
| 122 | + totals: { |
| 123 | + subtotal: '1000', |
| 124 | + tax: '0', |
| 125 | + total: '1000', |
| 126 | + }, |
| 127 | + unitTotals: { |
| 128 | + subtotal: '1000', |
| 129 | + tax: '0', |
| 130 | + total: '1000', |
| 131 | + }, |
| 132 | + }, |
| 133 | + ], |
| 134 | + totals: { |
| 135 | + subtotal: '833', |
| 136 | + tax: '167', |
| 137 | + total: '1000', |
| 138 | + }, |
| 139 | + }, |
| 140 | + dueAt: '2024-11-30T14:23:07.865592Z', |
| 141 | + id: 'inv_01jdw4vk9fr1n6smpbhykm6ha9', |
| 142 | + invoiceNumber: '296-844420', |
| 143 | + issuedAt: '2024-11-29T14:23:07.865592Z', |
| 144 | + items: [ |
| 145 | + { |
| 146 | + price: { |
| 147 | + productId: 'pro_01gv5dvjjx0nmydxa2pb9trdcq', |
| 148 | + unitPrice: { |
| 149 | + amount: '1000', |
| 150 | + currencyCode: 'GBP', |
| 151 | + }, |
| 152 | + }, |
| 153 | + quantity: 1, |
| 154 | + }, |
| 155 | + ], |
| 156 | + paidAt: '2024-11-29T14:23:05.561011761Z', |
| 157 | + status: 'paid', |
| 158 | + transactionId: 'txn_01jdw4vgdq62e0b6x8dqsm4ycn', |
| 159 | + updatedAt: '2024-11-29T14:23:05.007735Z', |
| 160 | + }, |
| 161 | + eventId: 'evt_01jdw4vq5a26w8mpfc59mez047', |
| 162 | + eventType: 'invoice.paid', |
| 163 | + notificationId: 'ntf_01h90nmerv7vrn93f97j5v72p7', |
| 164 | + occurredAt: '2024-11-29T14:23:08.971054Z', |
| 165 | +}; |
0 commit comments