@voyantjs/finance 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/service.d.ts CHANGED
@@ -91,8 +91,8 @@ export declare const financeService: {
91
91
  organizationId: string | null;
92
92
  supplierId: string | null;
93
93
  channelId: string | null;
94
- instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
95
- status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
94
+ instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
95
+ status: "expired" | "revoked" | "active" | "inactive" | "failed_verification";
96
96
  label: string;
97
97
  provider: string | null;
98
98
  brand: string | null;
@@ -121,8 +121,8 @@ export declare const financeService: {
121
121
  organizationId: string | null;
122
122
  supplierId: string | null;
123
123
  channelId: string | null;
124
- instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
125
- status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
124
+ instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
125
+ status: "expired" | "revoked" | "active" | "inactive" | "failed_verification";
126
126
  label: string;
127
127
  provider: string | null;
128
128
  brand: string | null;
@@ -143,13 +143,17 @@ export declare const financeService: {
143
143
  createPaymentInstrument(db: PostgresJsDatabase, data: CreatePaymentInstrumentInput): Promise<{
144
144
  id: string;
145
145
  brand: string | null;
146
- ownerType: "internal" | "supplier" | "other" | "client" | "channel" | "agency";
146
+ status: "expired" | "revoked" | "active" | "inactive" | "failed_verification";
147
147
  personId: string | null;
148
148
  organizationId: string | null;
149
+ createdAt: Date;
150
+ updatedAt: Date;
151
+ notes: string | null;
152
+ metadata: unknown;
153
+ ownerType: "internal" | "supplier" | "other" | "client" | "channel" | "agency";
149
154
  supplierId: string | null;
150
155
  channelId: string | null;
151
- instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
152
- status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
156
+ instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
153
157
  label: string;
154
158
  provider: string | null;
155
159
  last4: string | null;
@@ -161,10 +165,6 @@ export declare const financeService: {
161
165
  billingEmail: string | null;
162
166
  billingAddress: string | null;
163
167
  directBillReference: string | null;
164
- notes: string | null;
165
- metadata: unknown;
166
- createdAt: Date;
167
- updatedAt: Date;
168
168
  } | null>;
169
169
  updatePaymentInstrument(db: PostgresJsDatabase, id: string, data: UpdatePaymentInstrumentInput): Promise<{
170
170
  id: string;
@@ -173,8 +173,8 @@ export declare const financeService: {
173
173
  organizationId: string | null;
174
174
  supplierId: string | null;
175
175
  channelId: string | null;
176
- instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
177
- status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
176
+ instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
177
+ status: "expired" | "revoked" | "active" | "inactive" | "failed_verification";
178
178
  label: string;
179
179
  provider: string | null;
180
180
  brand: string | null;
@@ -209,7 +209,7 @@ export declare const financeService: {
209
209
  paymentAuthorizationId: string | null;
210
210
  paymentCaptureId: string | null;
211
211
  paymentId: string | null;
212
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
212
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
213
213
  provider: string | null;
214
214
  providerSessionId: string | null;
215
215
  providerPaymentId: string | null;
@@ -218,7 +218,7 @@ export declare const financeService: {
218
218
  clientReference: string | null;
219
219
  currency: string;
220
220
  amountCents: number;
221
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
221
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
222
222
  payerPersonId: string | null;
223
223
  payerOrganizationId: string | null;
224
224
  payerEmail: string | null;
@@ -257,7 +257,7 @@ export declare const financeService: {
257
257
  paymentAuthorizationId: string | null;
258
258
  paymentCaptureId: string | null;
259
259
  paymentId: string | null;
260
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
260
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
261
261
  provider: string | null;
262
262
  providerSessionId: string | null;
263
263
  providerPaymentId: string | null;
@@ -266,7 +266,7 @@ export declare const financeService: {
266
266
  clientReference: string | null;
267
267
  currency: string;
268
268
  amountCents: number;
269
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
269
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
270
270
  payerPersonId: string | null;
271
271
  payerOrganizationId: string | null;
272
272
  payerEmail: string | null;
@@ -290,15 +290,19 @@ export declare const financeService: {
290
290
  } | null>;
291
291
  createPaymentSession(db: PostgresJsDatabase, data: CreatePaymentSessionInput): Promise<{
292
292
  id: string;
293
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
294
- provider: string | null;
295
- notes: string | null;
296
- metadata: Record<string, unknown> | null;
293
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
294
+ expiredAt: Date | null;
295
+ cancelledAt: Date | null;
296
+ completedAt: Date | null;
297
297
  createdAt: Date;
298
298
  updatedAt: Date;
299
+ bookingId: string | null;
300
+ notes: string | null;
301
+ metadata: Record<string, unknown> | null;
302
+ expiresAt: Date | null;
303
+ provider: string | null;
299
304
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
300
305
  targetId: string | null;
301
- bookingId: string | null;
302
306
  orderId: string | null;
303
307
  currency: string;
304
308
  invoiceId: string | null;
@@ -306,10 +310,9 @@ export declare const financeService: {
306
310
  bookingPaymentScheduleId: string | null;
307
311
  paymentInstrumentId: string | null;
308
312
  bookingGuaranteeId: string | null;
309
- expiresAt: Date | null;
310
313
  paymentAuthorizationId: string | null;
311
314
  paymentCaptureId: string | null;
312
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
315
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
313
316
  paymentId: string | null;
314
317
  providerSessionId: string | null;
315
318
  providerPaymentId: string | null;
@@ -324,10 +327,7 @@ export declare const financeService: {
324
327
  returnUrl: string | null;
325
328
  cancelUrl: string | null;
326
329
  callbackUrl: string | null;
327
- completedAt: Date | null;
328
330
  failedAt: Date | null;
329
- cancelledAt: Date | null;
330
- expiredAt: Date | null;
331
331
  failureCode: string | null;
332
332
  failureMessage: string | null;
333
333
  providerPayload: Record<string, unknown> | null;
@@ -345,7 +345,7 @@ export declare const financeService: {
345
345
  paymentAuthorizationId: string | null;
346
346
  paymentCaptureId: string | null;
347
347
  paymentId: string | null;
348
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
348
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
349
349
  provider: string | null;
350
350
  providerSessionId: string | null;
351
351
  providerPaymentId: string | null;
@@ -354,7 +354,7 @@ export declare const financeService: {
354
354
  clientReference: string | null;
355
355
  currency: string;
356
356
  amountCents: number;
357
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
357
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
358
358
  payerPersonId: string | null;
359
359
  payerOrganizationId: string | null;
360
360
  payerEmail: string | null;
@@ -389,7 +389,7 @@ export declare const financeService: {
389
389
  paymentAuthorizationId: string | null;
390
390
  paymentCaptureId: string | null;
391
391
  paymentId: string | null;
392
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
392
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
393
393
  provider: string | null;
394
394
  providerSessionId: string | null;
395
395
  providerPaymentId: string | null;
@@ -398,7 +398,7 @@ export declare const financeService: {
398
398
  clientReference: string | null;
399
399
  currency: string;
400
400
  amountCents: number;
401
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
401
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
402
402
  payerPersonId: string | null;
403
403
  payerOrganizationId: string | null;
404
404
  payerEmail: string | null;
@@ -433,7 +433,7 @@ export declare const financeService: {
433
433
  paymentAuthorizationId: string | null;
434
434
  paymentCaptureId: string | null;
435
435
  paymentId: string | null;
436
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
436
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
437
437
  provider: string | null;
438
438
  providerSessionId: string | null;
439
439
  providerPaymentId: string | null;
@@ -442,7 +442,7 @@ export declare const financeService: {
442
442
  clientReference: string | null;
443
443
  currency: string;
444
444
  amountCents: number;
445
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
445
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
446
446
  payerPersonId: string | null;
447
447
  payerOrganizationId: string | null;
448
448
  payerEmail: string | null;
@@ -477,7 +477,7 @@ export declare const financeService: {
477
477
  paymentAuthorizationId: string | null;
478
478
  paymentCaptureId: string | null;
479
479
  paymentId: string | null;
480
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
480
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
481
481
  provider: string | null;
482
482
  providerSessionId: string | null;
483
483
  providerPaymentId: string | null;
@@ -486,7 +486,7 @@ export declare const financeService: {
486
486
  clientReference: string | null;
487
487
  currency: string;
488
488
  amountCents: number;
489
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
489
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
490
490
  payerPersonId: string | null;
491
491
  payerOrganizationId: string | null;
492
492
  payerEmail: string | null;
@@ -521,7 +521,7 @@ export declare const financeService: {
521
521
  paymentAuthorizationId: string | null;
522
522
  paymentCaptureId: string | null;
523
523
  paymentId: string | null;
524
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
524
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
525
525
  provider: string | null;
526
526
  providerSessionId: string | null;
527
527
  providerPaymentId: string | null;
@@ -530,7 +530,7 @@ export declare const financeService: {
530
530
  clientReference: string | null;
531
531
  currency: string;
532
532
  amountCents: number;
533
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
533
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
534
534
  payerPersonId: string | null;
535
535
  payerOrganizationId: string | null;
536
536
  payerEmail: string | null;
@@ -565,7 +565,7 @@ export declare const financeService: {
565
565
  paymentAuthorizationId: string | null;
566
566
  paymentCaptureId: string | null;
567
567
  paymentId: string | null;
568
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
568
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
569
569
  provider: string | null;
570
570
  providerSessionId: string | null;
571
571
  providerPaymentId: string | null;
@@ -574,7 +574,7 @@ export declare const financeService: {
574
574
  clientReference: string | null;
575
575
  currency: string;
576
576
  amountCents: number;
577
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
577
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
578
578
  payerPersonId: string | null;
579
579
  payerOrganizationId: string | null;
580
580
  payerEmail: string | null;
@@ -604,8 +604,8 @@ export declare const financeService: {
604
604
  invoiceId: string | null;
605
605
  bookingGuaranteeId: string | null;
606
606
  paymentInstrumentId: string | null;
607
- status: "pending" | "failed" | "authorized" | "expired" | "partially_captured" | "captured" | "voided";
608
- captureMode: "automatic" | "manual";
607
+ status: "expired" | "pending" | "failed" | "authorized" | "partially_captured" | "captured" | "voided";
608
+ captureMode: "manual" | "automatic";
609
609
  currency: string;
610
610
  amountCents: number;
611
611
  provider: string | null;
@@ -629,8 +629,8 @@ export declare const financeService: {
629
629
  invoiceId: string | null;
630
630
  bookingGuaranteeId: string | null;
631
631
  paymentInstrumentId: string | null;
632
- status: "pending" | "failed" | "authorized" | "expired" | "partially_captured" | "captured" | "voided";
633
- captureMode: "automatic" | "manual";
632
+ status: "expired" | "pending" | "failed" | "authorized" | "partially_captured" | "captured" | "voided";
633
+ captureMode: "manual" | "automatic";
634
634
  currency: string;
635
635
  amountCents: number;
636
636
  provider: string | null;
@@ -645,23 +645,23 @@ export declare const financeService: {
645
645
  } | null>;
646
646
  createPaymentAuthorization(db: PostgresJsDatabase, data: CreatePaymentAuthorizationInput): Promise<{
647
647
  id: string;
648
- status: "pending" | "failed" | "authorized" | "expired" | "partially_captured" | "captured" | "voided";
649
- provider: string | null;
650
- notes: string | null;
648
+ status: "expired" | "pending" | "failed" | "authorized" | "partially_captured" | "captured" | "voided";
651
649
  createdAt: Date;
652
650
  updatedAt: Date;
653
651
  bookingId: string | null;
652
+ notes: string | null;
653
+ expiresAt: Date | null;
654
+ provider: string | null;
654
655
  orderId: string | null;
655
656
  currency: string;
656
657
  invoiceId: string | null;
657
658
  amountCents: number;
658
659
  paymentInstrumentId: string | null;
659
660
  bookingGuaranteeId: string | null;
660
- captureMode: "automatic" | "manual";
661
+ captureMode: "manual" | "automatic";
661
662
  externalAuthorizationId: string | null;
662
663
  approvalCode: string | null;
663
664
  authorizedAt: Date | null;
664
- expiresAt: Date | null;
665
665
  voidedAt: Date | null;
666
666
  } | null>;
667
667
  updatePaymentAuthorization(db: PostgresJsDatabase, id: string, data: UpdatePaymentAuthorizationInput): Promise<{
@@ -671,8 +671,8 @@ export declare const financeService: {
671
671
  invoiceId: string | null;
672
672
  bookingGuaranteeId: string | null;
673
673
  paymentInstrumentId: string | null;
674
- status: "pending" | "failed" | "authorized" | "expired" | "partially_captured" | "captured" | "voided";
675
- captureMode: "automatic" | "manual";
674
+ status: "expired" | "pending" | "failed" | "authorized" | "partially_captured" | "captured" | "voided";
675
+ captureMode: "manual" | "automatic";
676
676
  currency: string;
677
677
  amountCents: number;
678
678
  provider: string | null;
@@ -693,7 +693,7 @@ export declare const financeService: {
693
693
  id: string;
694
694
  paymentAuthorizationId: string | null;
695
695
  invoiceId: string | null;
696
- status: "pending" | "completed" | "failed" | "refunded" | "voided";
696
+ status: "completed" | "pending" | "failed" | "refunded" | "voided";
697
697
  currency: string;
698
698
  amountCents: number;
699
699
  provider: string | null;
@@ -712,7 +712,7 @@ export declare const financeService: {
712
712
  id: string;
713
713
  paymentAuthorizationId: string | null;
714
714
  invoiceId: string | null;
715
- status: "pending" | "completed" | "failed" | "refunded" | "voided";
715
+ status: "completed" | "pending" | "failed" | "refunded" | "voided";
716
716
  currency: string;
717
717
  amountCents: number;
718
718
  provider: string | null;
@@ -725,11 +725,11 @@ export declare const financeService: {
725
725
  } | null>;
726
726
  createPaymentCapture(db: PostgresJsDatabase, data: CreatePaymentCaptureInput): Promise<{
727
727
  id: string;
728
- status: "pending" | "completed" | "failed" | "refunded" | "voided";
729
- provider: string | null;
730
- notes: string | null;
728
+ status: "completed" | "pending" | "failed" | "refunded" | "voided";
731
729
  createdAt: Date;
732
730
  updatedAt: Date;
731
+ notes: string | null;
732
+ provider: string | null;
733
733
  currency: string;
734
734
  invoiceId: string | null;
735
735
  amountCents: number;
@@ -742,7 +742,7 @@ export declare const financeService: {
742
742
  id: string;
743
743
  paymentAuthorizationId: string | null;
744
744
  invoiceId: string | null;
745
- status: "pending" | "completed" | "failed" | "refunded" | "voided";
745
+ status: "completed" | "pending" | "failed" | "refunded" | "voided";
746
746
  currency: string;
747
747
  amountCents: number;
748
748
  provider: string | null;
@@ -830,7 +830,7 @@ export declare const financeService: {
830
830
  tableName: "booking_payment_schedules";
831
831
  dataType: "string";
832
832
  columnType: "PgEnumColumn";
833
- data: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
833
+ data: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
834
834
  driverParam: string;
835
835
  notNull: true;
836
836
  hasDefault: true;
@@ -949,7 +949,7 @@ export declare const financeService: {
949
949
  bookingId: string;
950
950
  bookingItemId: string | null;
951
951
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
952
- status: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
952
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
953
953
  dueDate: string;
954
954
  currency: string;
955
955
  amountCents: number;
@@ -1030,7 +1030,7 @@ export declare const financeService: {
1030
1030
  tableName: "booking_payment_schedules";
1031
1031
  dataType: "string";
1032
1032
  columnType: "PgEnumColumn";
1033
- data: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
1033
+ data: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1034
1034
  driverParam: string;
1035
1035
  notNull: true;
1036
1036
  hasDefault: true;
@@ -1147,27 +1147,27 @@ export declare const financeService: {
1147
1147
  }>, "where" | "orderBy">;
1148
1148
  createBookingPaymentSchedule(db: PostgresJsDatabase, bookingId: string, data: CreateBookingPaymentScheduleInput): Promise<{
1149
1149
  id: string;
1150
- status: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
1151
- notes: string | null;
1150
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1152
1151
  createdAt: Date;
1153
1152
  updatedAt: Date;
1154
1153
  bookingId: string;
1154
+ notes: string | null;
1155
+ bookingItemId: string | null;
1155
1156
  currency: string;
1156
1157
  dueDate: string;
1157
- bookingItemId: string | null;
1158
1158
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1159
1159
  amountCents: number;
1160
1160
  } | null>;
1161
1161
  applyDefaultBookingPaymentPlan(db: PostgresJsDatabase, bookingId: string, data: ApplyDefaultBookingPaymentPlanInput): Promise<{
1162
1162
  id: string;
1163
- status: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
1164
- notes: string | null;
1163
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1165
1164
  createdAt: Date;
1166
1165
  updatedAt: Date;
1167
1166
  bookingId: string;
1167
+ notes: string | null;
1168
+ bookingItemId: string | null;
1168
1169
  currency: string;
1169
1170
  dueDate: string;
1170
- bookingItemId: string | null;
1171
1171
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1172
1172
  amountCents: number;
1173
1173
  }[] | null>;
@@ -1176,7 +1176,7 @@ export declare const financeService: {
1176
1176
  bookingId: string;
1177
1177
  bookingItemId: string | null;
1178
1178
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1179
- status: "paid" | "pending" | "cancelled" | "expired" | "due" | "waived";
1179
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1180
1180
  dueDate: string;
1181
1181
  currency: string;
1182
1182
  amountCents: number;
@@ -1189,15 +1189,19 @@ export declare const financeService: {
1189
1189
  } | null>;
1190
1190
  createPaymentSessionFromBookingSchedule(db: PostgresJsDatabase, scheduleId: string, data: CreatePaymentSessionFromScheduleInput): Promise<{
1191
1191
  id: string;
1192
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
1193
- provider: string | null;
1194
- notes: string | null;
1195
- metadata: Record<string, unknown> | null;
1192
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
1193
+ expiredAt: Date | null;
1194
+ cancelledAt: Date | null;
1195
+ completedAt: Date | null;
1196
1196
  createdAt: Date;
1197
1197
  updatedAt: Date;
1198
+ bookingId: string | null;
1199
+ notes: string | null;
1200
+ metadata: Record<string, unknown> | null;
1201
+ expiresAt: Date | null;
1202
+ provider: string | null;
1198
1203
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
1199
1204
  targetId: string | null;
1200
- bookingId: string | null;
1201
1205
  orderId: string | null;
1202
1206
  currency: string;
1203
1207
  invoiceId: string | null;
@@ -1205,10 +1209,9 @@ export declare const financeService: {
1205
1209
  bookingPaymentScheduleId: string | null;
1206
1210
  paymentInstrumentId: string | null;
1207
1211
  bookingGuaranteeId: string | null;
1208
- expiresAt: Date | null;
1209
1212
  paymentAuthorizationId: string | null;
1210
1213
  paymentCaptureId: string | null;
1211
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
1214
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
1212
1215
  paymentId: string | null;
1213
1216
  providerSessionId: string | null;
1214
1217
  providerPaymentId: string | null;
@@ -1223,25 +1226,26 @@ export declare const financeService: {
1223
1226
  returnUrl: string | null;
1224
1227
  cancelUrl: string | null;
1225
1228
  callbackUrl: string | null;
1226
- completedAt: Date | null;
1227
1229
  failedAt: Date | null;
1228
- cancelledAt: Date | null;
1229
- expiredAt: Date | null;
1230
1230
  failureCode: string | null;
1231
1231
  failureMessage: string | null;
1232
1232
  providerPayload: Record<string, unknown> | null;
1233
1233
  } | null>;
1234
1234
  createPaymentSessionFromInvoice(db: PostgresJsDatabase, invoiceId: string, data: CreatePaymentSessionFromInvoiceInput): Promise<{
1235
1235
  id: string;
1236
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
1237
- provider: string | null;
1238
- notes: string | null;
1239
- metadata: Record<string, unknown> | null;
1236
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
1237
+ expiredAt: Date | null;
1238
+ cancelledAt: Date | null;
1239
+ completedAt: Date | null;
1240
1240
  createdAt: Date;
1241
1241
  updatedAt: Date;
1242
+ bookingId: string | null;
1243
+ notes: string | null;
1244
+ metadata: Record<string, unknown> | null;
1245
+ expiresAt: Date | null;
1246
+ provider: string | null;
1242
1247
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
1243
1248
  targetId: string | null;
1244
- bookingId: string | null;
1245
1249
  orderId: string | null;
1246
1250
  currency: string;
1247
1251
  invoiceId: string | null;
@@ -1249,10 +1253,9 @@ export declare const financeService: {
1249
1253
  bookingPaymentScheduleId: string | null;
1250
1254
  paymentInstrumentId: string | null;
1251
1255
  bookingGuaranteeId: string | null;
1252
- expiresAt: Date | null;
1253
1256
  paymentAuthorizationId: string | null;
1254
1257
  paymentCaptureId: string | null;
1255
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
1258
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
1256
1259
  paymentId: string | null;
1257
1260
  providerSessionId: string | null;
1258
1261
  providerPaymentId: string | null;
@@ -1267,10 +1270,7 @@ export declare const financeService: {
1267
1270
  returnUrl: string | null;
1268
1271
  cancelUrl: string | null;
1269
1272
  callbackUrl: string | null;
1270
- completedAt: Date | null;
1271
1273
  failedAt: Date | null;
1272
- cancelledAt: Date | null;
1273
- expiredAt: Date | null;
1274
1274
  failureCode: string | null;
1275
1275
  failureMessage: string | null;
1276
1276
  providerPayload: Record<string, unknown> | null;
@@ -1349,7 +1349,7 @@ export declare const financeService: {
1349
1349
  tableName: "booking_guarantees";
1350
1350
  dataType: "string";
1351
1351
  columnType: "PgEnumColumn";
1352
- data: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1352
+ data: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1353
1353
  driverParam: string;
1354
1354
  notNull: true;
1355
1355
  hasDefault: false;
@@ -1366,7 +1366,7 @@ export declare const financeService: {
1366
1366
  tableName: "booking_guarantees";
1367
1367
  dataType: "string";
1368
1368
  columnType: "PgEnumColumn";
1369
- data: "pending" | "failed" | "cancelled" | "expired" | "active" | "released";
1369
+ data: "expired" | "cancelled" | "pending" | "released" | "failed" | "active";
1370
1370
  driverParam: string;
1371
1371
  notNull: true;
1372
1372
  hasDefault: true;
@@ -1587,8 +1587,8 @@ export declare const financeService: {
1587
1587
  bookingId: string;
1588
1588
  bookingPaymentScheduleId: string | null;
1589
1589
  bookingItemId: string | null;
1590
- guaranteeType: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1591
- status: "pending" | "failed" | "cancelled" | "expired" | "active" | "released";
1590
+ guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1591
+ status: "expired" | "cancelled" | "pending" | "released" | "failed" | "active";
1592
1592
  paymentInstrumentId: string | null;
1593
1593
  paymentAuthorizationId: string | null;
1594
1594
  currency: string | null;
@@ -1675,7 +1675,7 @@ export declare const financeService: {
1675
1675
  tableName: "booking_guarantees";
1676
1676
  dataType: "string";
1677
1677
  columnType: "PgEnumColumn";
1678
- data: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1678
+ data: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1679
1679
  driverParam: string;
1680
1680
  notNull: true;
1681
1681
  hasDefault: false;
@@ -1692,7 +1692,7 @@ export declare const financeService: {
1692
1692
  tableName: "booking_guarantees";
1693
1693
  dataType: "string";
1694
1694
  columnType: "PgEnumColumn";
1695
- data: "pending" | "failed" | "cancelled" | "expired" | "active" | "released";
1695
+ data: "expired" | "cancelled" | "pending" | "released" | "failed" | "active";
1696
1696
  driverParam: string;
1697
1697
  notNull: true;
1698
1698
  hasDefault: true;
@@ -1911,35 +1911,39 @@ export declare const financeService: {
1911
1911
  }>, "where" | "orderBy">;
1912
1912
  createBookingGuarantee(db: PostgresJsDatabase, bookingId: string, data: CreateBookingGuaranteeInput): Promise<{
1913
1913
  id: string;
1914
- status: "pending" | "failed" | "cancelled" | "expired" | "active" | "released";
1915
- provider: string | null;
1916
- notes: string | null;
1914
+ status: "expired" | "cancelled" | "pending" | "released" | "failed" | "active";
1917
1915
  createdAt: Date;
1918
1916
  updatedAt: Date;
1919
1917
  bookingId: string;
1920
- currency: string | null;
1918
+ notes: string | null;
1921
1919
  bookingItemId: string | null;
1920
+ releasedAt: Date | null;
1921
+ expiresAt: Date | null;
1922
+ provider: string | null;
1923
+ currency: string | null;
1922
1924
  amountCents: number | null;
1923
1925
  bookingPaymentScheduleId: string | null;
1924
- guaranteeType: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1926
+ guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1925
1927
  paymentInstrumentId: string | null;
1926
- expiresAt: Date | null;
1927
1928
  paymentAuthorizationId: string | null;
1928
1929
  referenceNumber: string | null;
1929
1930
  guaranteedAt: Date | null;
1930
- releasedAt: Date | null;
1931
1931
  } | null>;
1932
1932
  createPaymentSessionFromBookingGuarantee(db: PostgresJsDatabase, guaranteeId: string, data: CreatePaymentSessionFromGuaranteeInput): Promise<{
1933
1933
  id: string;
1934
- status: "paid" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "cancelled" | "expired";
1935
- provider: string | null;
1936
- notes: string | null;
1937
- metadata: Record<string, unknown> | null;
1934
+ status: "expired" | "cancelled" | "pending" | "failed" | "paid" | "requires_redirect" | "processing" | "authorized";
1935
+ expiredAt: Date | null;
1936
+ cancelledAt: Date | null;
1937
+ completedAt: Date | null;
1938
1938
  createdAt: Date;
1939
1939
  updatedAt: Date;
1940
+ bookingId: string | null;
1941
+ notes: string | null;
1942
+ metadata: Record<string, unknown> | null;
1943
+ expiresAt: Date | null;
1944
+ provider: string | null;
1940
1945
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee";
1941
1946
  targetId: string | null;
1942
- bookingId: string | null;
1943
1947
  orderId: string | null;
1944
1948
  currency: string;
1945
1949
  invoiceId: string | null;
@@ -1947,10 +1951,9 @@ export declare const financeService: {
1947
1951
  bookingPaymentScheduleId: string | null;
1948
1952
  paymentInstrumentId: string | null;
1949
1953
  bookingGuaranteeId: string | null;
1950
- expiresAt: Date | null;
1951
1954
  paymentAuthorizationId: string | null;
1952
1955
  paymentCaptureId: string | null;
1953
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
1956
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
1954
1957
  paymentId: string | null;
1955
1958
  providerSessionId: string | null;
1956
1959
  providerPaymentId: string | null;
@@ -1965,10 +1968,7 @@ export declare const financeService: {
1965
1968
  returnUrl: string | null;
1966
1969
  cancelUrl: string | null;
1967
1970
  callbackUrl: string | null;
1968
- completedAt: Date | null;
1969
1971
  failedAt: Date | null;
1970
- cancelledAt: Date | null;
1971
- expiredAt: Date | null;
1972
1972
  failureCode: string | null;
1973
1973
  failureMessage: string | null;
1974
1974
  providerPayload: Record<string, unknown> | null;
@@ -1978,8 +1978,8 @@ export declare const financeService: {
1978
1978
  bookingId: string;
1979
1979
  bookingPaymentScheduleId: string | null;
1980
1980
  bookingItemId: string | null;
1981
- guaranteeType: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1982
- status: "pending" | "failed" | "cancelled" | "expired" | "active" | "released";
1981
+ guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1982
+ status: "expired" | "cancelled" | "pending" | "released" | "failed" | "active";
1983
1983
  paymentInstrumentId: string | null;
1984
1984
  paymentAuthorizationId: string | null;
1985
1985
  currency: string | null;
@@ -2495,8 +2495,8 @@ export declare const financeService: {
2495
2495
  name: string;
2496
2496
  createdAt: Date;
2497
2497
  updatedAt: Date;
2498
- currency: string;
2499
2498
  bookingItemId: string;
2499
+ currency: string;
2500
2500
  amountCents: number;
2501
2501
  code: string | null;
2502
2502
  jurisdiction: string | null;
@@ -2582,7 +2582,7 @@ export declare const financeService: {
2582
2582
  tableName: "booking_item_commissions";
2583
2583
  dataType: "string";
2584
2584
  columnType: "PgEnumColumn";
2585
- data: "internal" | "supplier" | "other" | "channel" | "agency" | "affiliate" | "agent";
2585
+ data: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
2586
2586
  driverParam: string;
2587
2587
  notNull: true;
2588
2588
  hasDefault: false;
@@ -2667,7 +2667,7 @@ export declare const financeService: {
2667
2667
  tableName: "booking_item_commissions";
2668
2668
  dataType: "string";
2669
2669
  columnType: "PgEnumColumn";
2670
- data: "paid" | "void" | "pending" | "accrued" | "payable";
2670
+ data: "pending" | "paid" | "void" | "accrued" | "payable";
2671
2671
  driverParam: string;
2672
2672
  notNull: true;
2673
2673
  hasDefault: true;
@@ -2768,12 +2768,12 @@ export declare const financeService: {
2768
2768
  id: string;
2769
2769
  bookingItemId: string;
2770
2770
  channelId: string | null;
2771
- recipientType: "internal" | "supplier" | "other" | "channel" | "agency" | "affiliate" | "agent";
2771
+ recipientType: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
2772
2772
  commissionModel: "fixed" | "percentage" | "markup" | "net";
2773
2773
  currency: string | null;
2774
2774
  amountCents: number | null;
2775
2775
  rateBasisPoints: number | null;
2776
- status: "paid" | "void" | "pending" | "accrued" | "payable";
2776
+ status: "pending" | "paid" | "void" | "accrued" | "payable";
2777
2777
  payableAt: string | null;
2778
2778
  paidAt: string | null;
2779
2779
  notes: string | null;
@@ -2836,7 +2836,7 @@ export declare const financeService: {
2836
2836
  tableName: "booking_item_commissions";
2837
2837
  dataType: "string";
2838
2838
  columnType: "PgEnumColumn";
2839
- data: "internal" | "supplier" | "other" | "channel" | "agency" | "affiliate" | "agent";
2839
+ data: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
2840
2840
  driverParam: string;
2841
2841
  notNull: true;
2842
2842
  hasDefault: false;
@@ -2921,7 +2921,7 @@ export declare const financeService: {
2921
2921
  tableName: "booking_item_commissions";
2922
2922
  dataType: "string";
2923
2923
  columnType: "PgEnumColumn";
2924
- data: "paid" | "void" | "pending" | "accrued" | "payable";
2924
+ data: "pending" | "paid" | "void" | "accrued" | "payable";
2925
2925
  driverParam: string;
2926
2926
  notNull: true;
2927
2927
  hasDefault: true;
@@ -3021,16 +3021,16 @@ export declare const financeService: {
3021
3021
  }>, "where" | "orderBy">;
3022
3022
  createBookingItemCommission(db: PostgresJsDatabase, bookingItemId: string, data: CreateBookingItemCommissionInput): Promise<{
3023
3023
  id: string;
3024
- channelId: string | null;
3025
- status: "paid" | "void" | "pending" | "accrued" | "payable";
3026
- notes: string | null;
3024
+ status: "pending" | "paid" | "void" | "accrued" | "payable";
3027
3025
  createdAt: Date;
3028
3026
  updatedAt: Date;
3029
- currency: string | null;
3027
+ notes: string | null;
3030
3028
  bookingItemId: string;
3029
+ channelId: string | null;
3030
+ currency: string | null;
3031
3031
  amountCents: number | null;
3032
3032
  rateBasisPoints: number | null;
3033
- recipientType: "internal" | "supplier" | "other" | "channel" | "agency" | "affiliate" | "agent";
3033
+ recipientType: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
3034
3034
  commissionModel: "fixed" | "percentage" | "markup" | "net";
3035
3035
  payableAt: string | null;
3036
3036
  paidAt: string | null;
@@ -3039,12 +3039,12 @@ export declare const financeService: {
3039
3039
  id: string;
3040
3040
  bookingItemId: string;
3041
3041
  channelId: string | null;
3042
- recipientType: "internal" | "supplier" | "other" | "channel" | "agency" | "affiliate" | "agent";
3042
+ recipientType: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
3043
3043
  commissionModel: "fixed" | "percentage" | "markup" | "net";
3044
3044
  currency: string | null;
3045
3045
  amountCents: number | null;
3046
3046
  rateBasisPoints: number | null;
3047
- status: "paid" | "void" | "pending" | "accrued" | "payable";
3047
+ status: "pending" | "paid" | "void" | "accrued" | "payable";
3048
3048
  payableAt: string | null;
3049
3049
  paidAt: string | null;
3050
3050
  notes: string | null;
@@ -3080,13 +3080,7 @@ export declare const financeService: {
3080
3080
  totalCents: import("drizzle-orm").DrizzleTypeError<"You cannot reference this field without assigning it an alias first - use `.as(<alias>)`">;
3081
3081
  count: import("drizzle-orm").DrizzleTypeError<"You cannot reference this field without assigning it an alias first - use `.as(<alias>)`">;
3082
3082
  }>, "where" | "groupBy">;
3083
- /**
3084
- * @deprecated Use a template-level query that joins bookings + finance data.
3085
- * This stub is retained for backward compatibility — it returns an empty array.
3086
- * The profitability report requires cross-module data (bookings + finance) and
3087
- * should be implemented at the template level where both modules are available.
3088
- */
3089
- getProfitabilityReport(_db: PostgresJsDatabase, _query: ProfitabilityQuery): Promise<{
3083
+ getProfitabilityReport(db: PostgresJsDatabase, query: ProfitabilityQuery): Promise<{
3090
3084
  bookingId: string;
3091
3085
  bookingNumber: string;
3092
3086
  sellAmountCents: number | null;
@@ -3104,9 +3098,9 @@ export declare const financeService: {
3104
3098
  baseCurrency: string | null;
3105
3099
  baseAmountCents: number | null;
3106
3100
  fxRateSetId: string | null;
3107
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
3101
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
3108
3102
  paymentInstrumentId: string | null;
3109
- status: "pending" | "completed" | "failed" | "refunded";
3103
+ status: "completed" | "pending" | "failed" | "refunded";
3110
3104
  referenceNumber: string | null;
3111
3105
  paymentDate: string;
3112
3106
  notes: string | null;
@@ -3119,20 +3113,20 @@ export declare const financeService: {
3119
3113
  }>;
3120
3114
  createSupplierPayment(db: PostgresJsDatabase, data: CreateSupplierPaymentInput): Promise<{
3121
3115
  id: string;
3122
- supplierId: string | null;
3123
- status: "pending" | "completed" | "failed" | "refunded";
3124
- notes: string | null;
3116
+ status: "completed" | "pending" | "failed" | "refunded";
3117
+ baseCurrency: string | null;
3125
3118
  createdAt: Date;
3126
3119
  updatedAt: Date;
3127
3120
  bookingId: string;
3121
+ notes: string | null;
3122
+ supplierId: string | null;
3128
3123
  currency: string;
3129
- baseCurrency: string | null;
3130
3124
  fxRateSetId: string | null;
3131
3125
  amountCents: number;
3132
3126
  paymentInstrumentId: string | null;
3133
3127
  referenceNumber: string | null;
3134
3128
  baseAmountCents: number | null;
3135
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
3129
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
3136
3130
  paymentDate: string;
3137
3131
  bookingSupplierStatusId: string | null;
3138
3132
  } | undefined>;
@@ -3146,9 +3140,9 @@ export declare const financeService: {
3146
3140
  baseCurrency: string | null;
3147
3141
  baseAmountCents: number | null;
3148
3142
  fxRateSetId: string | null;
3149
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
3143
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
3150
3144
  paymentInstrumentId: string | null;
3151
- status: "pending" | "completed" | "failed" | "refunded";
3145
+ status: "completed" | "pending" | "failed" | "refunded";
3152
3146
  referenceNumber: string | null;
3153
3147
  paymentDate: string;
3154
3148
  notes: string | null;
@@ -3196,13 +3190,14 @@ export declare const financeService: {
3196
3190
  }>;
3197
3191
  createInvoice(db: PostgresJsDatabase, data: CreateInvoiceInput): Promise<{
3198
3192
  id: string;
3193
+ status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
3199
3194
  personId: string | null;
3200
3195
  organizationId: string | null;
3201
- status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
3202
- notes: string | null;
3196
+ baseCurrency: string | null;
3203
3197
  createdAt: Date;
3204
3198
  updatedAt: Date;
3205
3199
  bookingId: string;
3200
+ notes: string | null;
3206
3201
  invoiceNumber: string;
3207
3202
  invoiceType: "invoice" | "proforma" | "credit_note";
3208
3203
  seriesId: string | null;
@@ -3211,7 +3206,6 @@ export declare const financeService: {
3211
3206
  taxRegimeId: string | null;
3212
3207
  language: string | null;
3213
3208
  currency: string;
3214
- baseCurrency: string | null;
3215
3209
  fxRateSetId: string | null;
3216
3210
  subtotalCents: number;
3217
3211
  baseSubtotalCents: number | null;
@@ -3230,13 +3224,14 @@ export declare const financeService: {
3230
3224
  } | undefined>;
3231
3225
  createInvoiceFromBooking(db: PostgresJsDatabase, data: CreateInvoiceFromBookingInput, bookingData: InvoiceFromBookingData): Promise<{
3232
3226
  id: string;
3227
+ status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
3233
3228
  personId: string | null;
3234
3229
  organizationId: string | null;
3235
- status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
3236
- notes: string | null;
3230
+ baseCurrency: string | null;
3237
3231
  createdAt: Date;
3238
3232
  updatedAt: Date;
3239
3233
  bookingId: string;
3234
+ notes: string | null;
3240
3235
  invoiceNumber: string;
3241
3236
  invoiceType: "invoice" | "proforma" | "credit_note";
3242
3237
  seriesId: string | null;
@@ -3245,7 +3240,6 @@ export declare const financeService: {
3245
3240
  taxRegimeId: string | null;
3246
3241
  language: string | null;
3247
3242
  currency: string;
3248
- baseCurrency: string | null;
3249
3243
  fxRateSetId: string | null;
3250
3244
  subtotalCents: number;
3251
3245
  baseSubtotalCents: number | null;
@@ -3694,12 +3688,12 @@ export declare const financeService: {
3694
3688
  createInvoiceLineItem(db: PostgresJsDatabase, invoiceId: string, data: CreateInvoiceLineItemInput): Promise<{
3695
3689
  id: string;
3696
3690
  createdAt: Date;
3691
+ description: string;
3692
+ quantity: number;
3693
+ bookingItemId: string | null;
3697
3694
  totalCents: number;
3698
3695
  invoiceId: string;
3699
- bookingItemId: string | null;
3700
3696
  sortOrder: number;
3701
- description: string;
3702
- quantity: number;
3703
3697
  unitPriceCents: number;
3704
3698
  taxRate: number | null;
3705
3699
  } | null | undefined>;
@@ -3843,7 +3837,7 @@ export declare const financeService: {
3843
3837
  tableName: "payments";
3844
3838
  dataType: "string";
3845
3839
  columnType: "PgEnumColumn";
3846
- data: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
3840
+ data: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
3847
3841
  driverParam: string;
3848
3842
  notNull: true;
3849
3843
  hasDefault: false;
@@ -3911,7 +3905,7 @@ export declare const financeService: {
3911
3905
  tableName: "payments";
3912
3906
  dataType: "string";
3913
3907
  columnType: "PgEnumColumn";
3914
- data: "pending" | "completed" | "failed" | "refunded";
3908
+ data: "completed" | "pending" | "failed" | "refunded";
3915
3909
  driverParam: string;
3916
3910
  notNull: true;
3917
3911
  hasDefault: true;
@@ -4016,11 +4010,11 @@ export declare const financeService: {
4016
4010
  baseCurrency: string | null;
4017
4011
  baseAmountCents: number | null;
4018
4012
  fxRateSetId: string | null;
4019
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
4013
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
4020
4014
  paymentInstrumentId: string | null;
4021
4015
  paymentAuthorizationId: string | null;
4022
4016
  paymentCaptureId: string | null;
4023
- status: "pending" | "completed" | "failed" | "refunded";
4017
+ status: "completed" | "pending" | "failed" | "refunded";
4024
4018
  referenceNumber: string | null;
4025
4019
  paymentDate: string;
4026
4020
  notes: string | null;
@@ -4151,7 +4145,7 @@ export declare const financeService: {
4151
4145
  tableName: "payments";
4152
4146
  dataType: "string";
4153
4147
  columnType: "PgEnumColumn";
4154
- data: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
4148
+ data: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
4155
4149
  driverParam: string;
4156
4150
  notNull: true;
4157
4151
  hasDefault: false;
@@ -4219,7 +4213,7 @@ export declare const financeService: {
4219
4213
  tableName: "payments";
4220
4214
  dataType: "string";
4221
4215
  columnType: "PgEnumColumn";
4222
- data: "pending" | "completed" | "failed" | "refunded";
4216
+ data: "completed" | "pending" | "failed" | "refunded";
4223
4217
  driverParam: string;
4224
4218
  notNull: true;
4225
4219
  hasDefault: true;
@@ -4319,12 +4313,12 @@ export declare const financeService: {
4319
4313
  }>, "where" | "orderBy">;
4320
4314
  createPayment(db: PostgresJsDatabase, invoiceId: string, data: CreatePaymentInput): Promise<{
4321
4315
  id: string;
4322
- status: "pending" | "completed" | "failed" | "refunded";
4323
- notes: string | null;
4316
+ status: "completed" | "pending" | "failed" | "refunded";
4317
+ baseCurrency: string | null;
4324
4318
  createdAt: Date;
4325
4319
  updatedAt: Date;
4320
+ notes: string | null;
4326
4321
  currency: string;
4327
- baseCurrency: string | null;
4328
4322
  fxRateSetId: string | null;
4329
4323
  invoiceId: string;
4330
4324
  amountCents: number;
@@ -4333,7 +4327,7 @@ export declare const financeService: {
4333
4327
  referenceNumber: string | null;
4334
4328
  paymentCaptureId: string | null;
4335
4329
  baseAmountCents: number | null;
4336
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
4330
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
4337
4331
  paymentDate: string;
4338
4332
  } | null | undefined>;
4339
4333
  listCreditNotes(db: PostgresJsDatabase, invoiceId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"credit_notes", {
@@ -4798,17 +4792,17 @@ export declare const financeService: {
4798
4792
  createCreditNote(db: PostgresJsDatabase, invoiceId: string, data: CreateCreditNoteInput): Promise<{
4799
4793
  id: string;
4800
4794
  status: "draft" | "issued" | "applied";
4801
- notes: string | null;
4795
+ baseCurrency: string | null;
4802
4796
  createdAt: Date;
4803
4797
  updatedAt: Date;
4798
+ notes: string | null;
4799
+ reason: string;
4804
4800
  currency: string;
4805
- baseCurrency: string | null;
4806
4801
  fxRateSetId: string | null;
4807
4802
  invoiceId: string;
4808
4803
  amountCents: number;
4809
4804
  baseAmountCents: number | null;
4810
4805
  creditNoteNumber: string;
4811
- reason: string;
4812
4806
  } | null | undefined>;
4813
4807
  updateCreditNote(db: PostgresJsDatabase, creditNoteId: string, data: UpdateCreditNoteInput): Promise<{
4814
4808
  id: string;
@@ -5112,10 +5106,10 @@ export declare const financeService: {
5112
5106
  createCreditNoteLineItem(db: PostgresJsDatabase, creditNoteId: string, data: CreateCreditNoteLineItemInput): Promise<{
5113
5107
  id: string;
5114
5108
  createdAt: Date;
5115
- totalCents: number;
5116
- sortOrder: number;
5117
5109
  description: string;
5118
5110
  quantity: number;
5111
+ totalCents: number;
5112
+ sortOrder: number;
5119
5113
  unitPriceCents: number;
5120
5114
  creditNoteId: string;
5121
5115
  } | null | undefined>;
@@ -5301,9 +5295,9 @@ export declare const financeService: {
5301
5295
  createNote(db: PostgresJsDatabase, invoiceId: string, userId: string, data: CreateFinanceNoteInput): Promise<{
5302
5296
  id: string;
5303
5297
  createdAt: Date;
5304
- invoiceId: string;
5305
5298
  authorId: string;
5306
5299
  content: string;
5300
+ invoiceId: string;
5307
5301
  } | null | undefined>;
5308
5302
  listInvoiceNumberSeries(db: PostgresJsDatabase, query: InvoiceNumberSeriesListQuery): Promise<{
5309
5303
  data: {
@@ -5343,9 +5337,9 @@ export declare const financeService: {
5343
5337
  createInvoiceNumberSeries(db: PostgresJsDatabase, data: CreateInvoiceNumberSeriesInput): Promise<{
5344
5338
  id: string;
5345
5339
  name: string;
5346
- active: boolean;
5347
5340
  createdAt: Date;
5348
5341
  updatedAt: Date;
5342
+ active: boolean;
5349
5343
  code: string;
5350
5344
  scope: "invoice" | "proforma" | "credit_note";
5351
5345
  prefix: string;
@@ -5433,10 +5427,10 @@ export declare const financeService: {
5433
5427
  createInvoiceTemplate(db: PostgresJsDatabase, data: CreateInvoiceTemplateInput): Promise<{
5434
5428
  id: string;
5435
5429
  name: string;
5436
- active: boolean;
5437
- metadata: unknown;
5438
5430
  createdAt: Date;
5439
5431
  updatedAt: Date;
5432
+ metadata: unknown;
5433
+ active: boolean;
5440
5434
  language: string;
5441
5435
  jurisdiction: string | null;
5442
5436
  slug: string;
@@ -5467,7 +5461,7 @@ export declare const financeService: {
5467
5461
  id: string;
5468
5462
  invoiceId: string;
5469
5463
  templateId: string | null;
5470
- format: "html" | "pdf" | "xml" | "json";
5464
+ format: "json" | "pdf" | "html" | "xml";
5471
5465
  status: "pending" | "failed" | "ready" | "stale";
5472
5466
  storageKey: string | null;
5473
5467
  fileSize: number | null;
@@ -5483,7 +5477,7 @@ export declare const financeService: {
5483
5477
  id: string;
5484
5478
  invoiceId: string;
5485
5479
  templateId: string | null;
5486
- format: "html" | "pdf" | "xml" | "json";
5480
+ format: "json" | "pdf" | "html" | "xml";
5487
5481
  status: "pending" | "failed" | "ready" | "stale";
5488
5482
  storageKey: string | null;
5489
5483
  fileSize: number | null;
@@ -5496,12 +5490,12 @@ export declare const financeService: {
5496
5490
  updatedAt: Date;
5497
5491
  } | null>;
5498
5492
  createInvoiceRendition(db: PostgresJsDatabase, invoiceId: string, data: CreateInvoiceRenditionInput): Promise<{
5499
- format: "html" | "pdf" | "xml" | "json";
5493
+ format: "json" | "pdf" | "html" | "xml";
5500
5494
  id: string;
5501
5495
  status: "pending" | "failed" | "ready" | "stale";
5502
- metadata: unknown;
5503
5496
  createdAt: Date;
5504
5497
  updatedAt: Date;
5498
+ metadata: unknown;
5505
5499
  templateId: string | null;
5506
5500
  language: string | null;
5507
5501
  invoiceId: string;
@@ -5515,7 +5509,7 @@ export declare const financeService: {
5515
5509
  id: string;
5516
5510
  invoiceId: string;
5517
5511
  templateId: string | null;
5518
- format: "html" | "pdf" | "xml" | "json";
5512
+ format: "json" | "pdf" | "html" | "xml";
5519
5513
  status: "pending" | "failed" | "ready" | "stale";
5520
5514
  storageKey: string | null;
5521
5515
  fileSize: number | null;
@@ -5542,12 +5536,12 @@ export declare const financeService: {
5542
5536
  } | {
5543
5537
  status: "requested";
5544
5538
  rendition: {
5545
- format: "html" | "pdf" | "xml" | "json";
5539
+ format: "json" | "pdf" | "html" | "xml";
5546
5540
  id: string;
5547
5541
  status: "pending" | "failed" | "ready" | "stale";
5548
- metadata: unknown;
5549
5542
  createdAt: Date;
5550
5543
  updatedAt: Date;
5544
+ metadata: unknown;
5551
5545
  templateId: string | null;
5552
5546
  language: string | null;
5553
5547
  invoiceId: string;
@@ -5592,13 +5586,13 @@ export declare const financeService: {
5592
5586
  createTaxRegime(db: PostgresJsDatabase, data: CreateTaxRegimeInput): Promise<{
5593
5587
  id: string;
5594
5588
  name: string;
5595
- active: boolean;
5596
- metadata: unknown;
5597
5589
  createdAt: Date;
5598
5590
  updatedAt: Date;
5591
+ metadata: unknown;
5592
+ description: string | null;
5593
+ active: boolean;
5599
5594
  code: "other" | "standard" | "reduced" | "exempt" | "reverse_charge" | "margin_scheme_art311" | "zero_rated" | "out_of_scope";
5600
5595
  jurisdiction: string | null;
5601
- description: string | null;
5602
5596
  ratePercent: number | null;
5603
5597
  legalReference: string | null;
5604
5598
  } | null>;
@@ -5640,10 +5634,10 @@ export declare const financeService: {
5640
5634
  registerInvoiceExternalRef(db: PostgresJsDatabase, invoiceId: string, data: CreateInvoiceExternalRefInput): Promise<{
5641
5635
  id: string;
5642
5636
  status: string | null;
5643
- provider: string;
5644
- metadata: unknown;
5645
5637
  createdAt: Date;
5646
5638
  updatedAt: Date;
5639
+ metadata: unknown;
5640
+ provider: string;
5647
5641
  invoiceId: string;
5648
5642
  externalId: string | null;
5649
5643
  externalNumber: string | null;