@voyantjs/finance 0.52.1 → 0.52.3

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.
Files changed (54) hide show
  1. package/dist/action-ledger-drift.d.ts +29 -0
  2. package/dist/action-ledger-drift.d.ts.map +1 -0
  3. package/dist/action-ledger-drift.js +163 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +2 -0
  6. package/dist/routes-action-ledger.d.ts +181 -0
  7. package/dist/routes-action-ledger.d.ts.map +1 -0
  8. package/dist/routes-action-ledger.js +142 -0
  9. package/dist/routes-documents.d.ts +8 -8
  10. package/dist/routes-public.d.ts +48 -48
  11. package/dist/routes-settlement.d.ts +1 -1
  12. package/dist/routes-shared.d.ts +12 -0
  13. package/dist/routes-shared.d.ts.map +1 -1
  14. package/dist/routes.d.ts +288 -217
  15. package/dist/routes.d.ts.map +1 -1
  16. package/dist/routes.js +280 -46
  17. package/dist/schema.d.ts +22 -22
  18. package/dist/service-action-ledger-accounting.d.ts +77 -0
  19. package/dist/service-action-ledger-accounting.d.ts.map +1 -0
  20. package/dist/service-action-ledger-accounting.js +307 -0
  21. package/dist/service-action-ledger-booking-payments.d.ts +48 -0
  22. package/dist/service-action-ledger-booking-payments.d.ts.map +1 -0
  23. package/dist/service-action-ledger-booking-payments.js +178 -0
  24. package/dist/service-action-ledger-payment-authorizations.d.ts +48 -0
  25. package/dist/service-action-ledger-payment-authorizations.d.ts.map +1 -0
  26. package/dist/service-action-ledger-payment-authorizations.js +209 -0
  27. package/dist/service-action-ledger-payment-sessions.d.ts +83 -0
  28. package/dist/service-action-ledger-payment-sessions.d.ts.map +1 -0
  29. package/dist/service-action-ledger-payment-sessions.js +294 -0
  30. package/dist/service-action-ledger-supplier-payments.d.ts +21 -0
  31. package/dist/service-action-ledger-supplier-payments.d.ts.map +1 -0
  32. package/dist/service-action-ledger-supplier-payments.js +70 -0
  33. package/dist/service-action-ledger.d.ts +6 -0
  34. package/dist/service-action-ledger.d.ts.map +1 -0
  35. package/dist/service-action-ledger.js +5 -0
  36. package/dist/service-booking-create.d.ts +50 -8
  37. package/dist/service-booking-create.d.ts.map +1 -1
  38. package/dist/service-booking-create.js +58 -1
  39. package/dist/service-bookings-dual-create.d.ts +50 -8
  40. package/dist/service-bookings-dual-create.d.ts.map +1 -1
  41. package/dist/service-issue.d.ts +42 -12
  42. package/dist/service-issue.d.ts.map +1 -1
  43. package/dist/service-issue.js +141 -4
  44. package/dist/service-public.d.ts +13 -13
  45. package/dist/service-vouchers.d.ts +10 -10
  46. package/dist/service.d.ts +291 -279
  47. package/dist/service.d.ts.map +1 -1
  48. package/dist/service.js +753 -238
  49. package/dist/validation-billing.d.ts +37 -37
  50. package/dist/validation-payments.d.ts +102 -102
  51. package/dist/validation-public.d.ts +45 -45
  52. package/dist/validation-shared.d.ts +32 -32
  53. package/dist/validation-vouchers.d.ts +2 -2
  54. package/package.json +13 -7
package/dist/service.d.ts CHANGED
@@ -1,8 +1,10 @@
1
+ import { type ActionLedgerRequestContextValues } from "@voyantjs/action-ledger";
1
2
  import type { EventBus } from "@voyantjs/core";
2
3
  import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
3
4
  import type { z } from "zod";
4
5
  import { bookingPaymentSchedules, invoiceRenditions, invoices, paymentSessions } from "./schema.js";
5
6
  import { getFinanceAggregates } from "./service-aggregates.js";
7
+ export { buildBookingGuaranteeCreateActionLedgerInput, buildBookingGuaranteeDeleteActionLedgerInput, buildBookingGuaranteeUpdateActionLedgerInput, buildBookingPaymentScheduleCreateActionLedgerInput, buildBookingPaymentScheduleDeleteActionLedgerInput, buildBookingPaymentScheduleUpdateActionLedgerInput, buildCreditNoteCreationActionLedgerInput, buildCreditNoteLineItemCreateActionLedgerInput, buildCreditNoteUpdateActionLedgerInput, buildInvoiceDeleteActionLedgerInput, buildInvoiceIssuedActionLedgerInput, buildInvoiceLineItemCreateActionLedgerInput, buildInvoiceLineItemDeleteActionLedgerInput, buildInvoiceLineItemUpdateActionLedgerInput, buildInvoiceUpdateActionLedgerInput, buildPaymentAuthorizationCreateActionLedgerInput, buildPaymentAuthorizationDeleteActionLedgerInput, buildPaymentAuthorizationUpdateActionLedgerInput, buildPaymentCaptureCreateActionLedgerInput, buildPaymentCaptureDeleteActionLedgerInput, buildPaymentCaptureUpdateActionLedgerInput, buildPaymentInstrumentCreateActionLedgerInput, buildPaymentInstrumentDeleteActionLedgerInput, buildPaymentInstrumentUpdateActionLedgerInput, buildPaymentSessionCancelledActionLedgerInput, buildPaymentSessionCompletionActionLedgerInput, buildPaymentSessionCreateActionLedgerInput, buildPaymentSessionExpiredActionLedgerInput, buildPaymentSessionFailedActionLedgerInput, buildPaymentSessionRequiresRedirectActionLedgerInput, buildPaymentSessionUpdateActionLedgerInput, buildRecordPaymentActionLedgerInput, buildSupplierPaymentCreateActionLedgerInput, buildSupplierPaymentUpdateActionLedgerInput, } from "./service-action-ledger.js";
6
8
  import type { agingReportQuerySchema, applyDefaultBookingPaymentPlanSchema, cancelPaymentSessionSchema, completePaymentSessionSchema, createPaymentSessionFromGuaranteeSchema, createPaymentSessionFromInvoiceSchema, createPaymentSessionFromScheduleSchema, expirePaymentSessionSchema, failPaymentSessionSchema, insertBookingGuaranteeSchema, insertBookingItemCommissionSchema, insertBookingItemTaxLineSchema, insertBookingPaymentScheduleSchema, insertCreditNoteLineItemSchema, insertCreditNoteSchema, insertFinanceNoteSchema, insertInvoiceAttachmentSchema, insertInvoiceExternalRefSchema, insertInvoiceLineItemSchema, insertInvoiceNumberSeriesSchema, insertInvoiceRenditionSchema, insertInvoiceSchema, insertInvoiceTemplateSchema, insertPaymentAuthorizationSchema, insertPaymentCaptureSchema, insertPaymentInstrumentSchema, insertPaymentSchema, insertPaymentSessionSchema, insertSupplierPaymentSchema, insertTaxClassSchema, insertTaxPolicyProfileSchema, insertTaxPolicyRuleSchema, insertTaxRegimeSchema, invoiceFromBookingSchema, invoiceListQuerySchema, invoiceNumberSeriesListQuerySchema, invoiceTemplateListQuerySchema, markPaymentSessionRequiresRedirectSchema, paymentAuthorizationListQuerySchema, paymentCaptureListQuerySchema, paymentInstrumentListQuerySchema, paymentListQuerySchema, paymentSessionListQuerySchema, profitabilityQuerySchema, renderInvoiceInputSchema, revenueReportQuerySchema, supplierPaymentListQuerySchema, taxClassListQuerySchema, taxPolicyProfileListQuerySchema, taxPolicyRuleListQuerySchema, taxRegimeListQuerySchema, updateBookingGuaranteeSchema, updateBookingItemCommissionSchema, updateBookingItemTaxLineSchema, updateBookingPaymentScheduleSchema, updateCreditNoteSchema, updateInvoiceAttachmentSchema, updateInvoiceLineItemSchema, updateInvoiceNumberSeriesSchema, updateInvoiceRenditionSchema, updateInvoiceSchema, updateInvoiceTemplateSchema, updatePaymentAuthorizationSchema, updatePaymentCaptureSchema, updatePaymentInstrumentSchema, updatePaymentSessionSchema, updateSupplierPaymentSchema, updateTaxClassSchema, updateTaxPolicyProfileSchema, updateTaxPolicyRuleSchema, updateTaxRegimeSchema } from "./validation.js";
7
9
  type RevenueReportQuery = z.infer<typeof revenueReportQuerySchema>;
8
10
  type AgingReportQuery = z.infer<typeof agingReportQuerySchema>;
@@ -141,6 +143,8 @@ export declare function renderInvoiceBody(body: string, bodyFormat: "html" | "ma
141
143
  */
142
144
  export interface FinanceServiceRuntime {
143
145
  eventBus?: EventBus;
146
+ actionLedgerContext?: ActionLedgerRequestContextValues;
147
+ actionLedgerAuthorizationSource?: string | null;
144
148
  }
145
149
  export interface BookingPaymentSchedulePaidEvent {
146
150
  bookingId: string;
@@ -195,7 +199,7 @@ export declare const financeService: {
195
199
  list(db: PostgresJsDatabase, query: {
196
200
  limit: number;
197
201
  offset: number;
198
- status?: "void" | "active" | "expired" | "redeemed" | undefined;
202
+ status?: "expired" | "void" | "active" | "redeemed" | undefined;
199
203
  seriesCode?: string | undefined;
200
204
  issuedToPersonId?: string | undefined;
201
205
  issuedToOrganizationId?: string | undefined;
@@ -206,7 +210,7 @@ export declare const financeService: {
206
210
  id: string;
207
211
  code: string;
208
212
  seriesCode: string | null;
209
- status: "void" | "active" | "expired" | "redeemed";
213
+ status: "expired" | "void" | "active" | "redeemed";
210
214
  currency: string;
211
215
  initialAmountCents: number;
212
216
  remainingAmountCents: number;
@@ -239,7 +243,7 @@ export declare const financeService: {
239
243
  id: string;
240
244
  code: string;
241
245
  seriesCode: string | null;
242
- status: "void" | "active" | "expired" | "redeemed";
246
+ status: "expired" | "void" | "active" | "redeemed";
243
247
  currency: string;
244
248
  initialAmountCents: number;
245
249
  remainingAmountCents: number;
@@ -270,26 +274,26 @@ export declare const financeService: {
270
274
  notes?: string | null | undefined;
271
275
  }, issuedByUserId?: string): Promise<{
272
276
  id: string;
277
+ status: "expired" | "void" | "active" | "redeemed";
273
278
  createdAt: Date;
274
- updatedAt: Date;
275
279
  expiresAt: Date | null;
276
- status: "void" | "active" | "expired" | "redeemed";
277
- currency: string;
278
- notes: string | null;
279
280
  code: string;
280
- sourceType: "manual" | "refund" | "cancellation_credit" | "gift" | "promo";
281
281
  seriesCode: string | null;
282
+ currency: string;
282
283
  initialAmountCents: number;
283
284
  remainingAmountCents: number;
284
285
  issuedToPersonId: string | null;
285
286
  issuedToOrganizationId: string | null;
287
+ sourceType: "manual" | "refund" | "cancellation_credit" | "gift" | "promo";
286
288
  sourceBookingId: string | null;
287
289
  sourcePaymentId: string | null;
288
290
  validFrom: Date | null;
291
+ notes: string | null;
289
292
  issuedByUserId: string | null;
293
+ updatedAt: Date;
290
294
  } | null>;
291
295
  update(db: PostgresJsDatabase, id: string, input: {
292
- status?: "void" | "active" | "expired" | "redeemed" | undefined;
296
+ status?: "expired" | "void" | "active" | "redeemed" | undefined;
293
297
  seriesCode?: string | null | undefined;
294
298
  validFrom?: string | null | undefined;
295
299
  expiresAt?: string | null | undefined;
@@ -300,7 +304,7 @@ export declare const financeService: {
300
304
  id: string;
301
305
  code: string;
302
306
  seriesCode: string | null;
303
- status: "void" | "active" | "expired" | "redeemed";
307
+ status: "expired" | "void" | "active" | "redeemed";
304
308
  currency: string;
305
309
  initialAmountCents: number;
306
310
  remainingAmountCents: number;
@@ -325,7 +329,7 @@ export declare const financeService: {
325
329
  id: string;
326
330
  code: string;
327
331
  seriesCode: string | null;
328
- status: "void" | "active" | "expired" | "redeemed";
332
+ status: "expired" | "void" | "active" | "redeemed";
329
333
  currency: string;
330
334
  initialAmountCents: number;
331
335
  remainingAmountCents: number;
@@ -344,8 +348,8 @@ export declare const financeService: {
344
348
  redemption: {
345
349
  id: string;
346
350
  createdAt: Date;
347
- bookingId: string;
348
351
  voucherId: string;
352
+ bookingId: string;
349
353
  paymentId: string | null;
350
354
  amountCents: number;
351
355
  createdByUserId: string | null;
@@ -356,13 +360,13 @@ export declare const financeService: {
356
360
  listPaymentInstruments(db: PostgresJsDatabase, query: PaymentInstrumentListQuery): Promise<{
357
361
  data: {
358
362
  id: string;
359
- ownerType: "internal" | "supplier" | "other" | "client" | "channel" | "agency";
363
+ ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
360
364
  personId: string | null;
361
365
  organizationId: string | null;
362
366
  supplierId: string | null;
363
367
  channelId: string | null;
364
- instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
365
- status: "active" | "expired" | "revoked" | "inactive" | "failed_verification";
368
+ instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
369
+ status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
366
370
  label: string;
367
371
  provider: string | null;
368
372
  brand: string | null;
@@ -386,13 +390,13 @@ export declare const financeService: {
386
390
  }>;
387
391
  getPaymentInstrumentById(db: PostgresJsDatabase, id: string): Promise<{
388
392
  id: string;
389
- ownerType: "internal" | "supplier" | "other" | "client" | "channel" | "agency";
393
+ ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
390
394
  personId: string | null;
391
395
  organizationId: string | null;
392
396
  supplierId: string | null;
393
397
  channelId: string | null;
394
- instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
395
- status: "active" | "expired" | "revoked" | "inactive" | "failed_verification";
398
+ instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
399
+ status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
396
400
  label: string;
397
401
  provider: string | null;
398
402
  brand: string | null;
@@ -410,22 +414,21 @@ export declare const financeService: {
410
414
  createdAt: Date;
411
415
  updatedAt: Date;
412
416
  } | null>;
413
- createPaymentInstrument(db: PostgresJsDatabase, data: CreatePaymentInstrumentInput): Promise<{
414
- metadata: unknown;
417
+ createPaymentInstrument(db: PostgresJsDatabase, data: CreatePaymentInstrumentInput, runtime?: FinanceServiceRuntime): Promise<{
415
418
  id: string;
416
419
  brand: string | null;
417
- createdAt: Date;
418
- updatedAt: Date;
420
+ status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
419
421
  organizationId: string | null;
420
- status: "active" | "expired" | "revoked" | "inactive" | "failed_verification";
422
+ createdAt: Date;
421
423
  notes: string | null;
422
- provider: string | null;
424
+ updatedAt: Date;
425
+ ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
423
426
  personId: string | null;
424
- label: string;
425
- ownerType: "internal" | "supplier" | "other" | "client" | "channel" | "agency";
426
427
  supplierId: string | null;
427
428
  channelId: string | null;
428
- instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
429
+ instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
430
+ label: string;
431
+ provider: string | null;
429
432
  last4: string | null;
430
433
  holderName: string | null;
431
434
  expiryMonth: number | null;
@@ -435,16 +438,17 @@ export declare const financeService: {
435
438
  billingEmail: string | null;
436
439
  billingAddress: string | null;
437
440
  directBillReference: string | null;
441
+ metadata: unknown;
438
442
  } | null>;
439
- updatePaymentInstrument(db: PostgresJsDatabase, id: string, data: UpdatePaymentInstrumentInput): Promise<{
443
+ updatePaymentInstrument(db: PostgresJsDatabase, id: string, data: UpdatePaymentInstrumentInput, runtime?: FinanceServiceRuntime): Promise<{
440
444
  id: string;
441
- ownerType: "internal" | "supplier" | "other" | "client" | "channel" | "agency";
445
+ ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
442
446
  personId: string | null;
443
447
  organizationId: string | null;
444
448
  supplierId: string | null;
445
449
  channelId: string | null;
446
- instrumentType: "other" | "voucher" | "wallet" | "credit_card" | "debit_card" | "cash" | "direct_bill" | "bank_account";
447
- status: "active" | "expired" | "revoked" | "inactive" | "failed_verification";
450
+ instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
451
+ status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
448
452
  label: string;
449
453
  provider: string | null;
450
454
  brand: string | null;
@@ -462,7 +466,7 @@ export declare const financeService: {
462
466
  createdAt: Date;
463
467
  updatedAt: Date;
464
468
  } | null>;
465
- deletePaymentInstrument(db: PostgresJsDatabase, id: string): Promise<{
469
+ deletePaymentInstrument(db: PostgresJsDatabase, id: string, runtime?: FinanceServiceRuntime): Promise<{
466
470
  id: string;
467
471
  } | null>;
468
472
  listPaymentSessions(db: PostgresJsDatabase, query: PaymentSessionListQuery): Promise<{
@@ -479,7 +483,7 @@ export declare const financeService: {
479
483
  paymentAuthorizationId: string | null;
480
484
  paymentCaptureId: string | null;
481
485
  paymentId: string | null;
482
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
486
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
483
487
  provider: string | null;
484
488
  providerSessionId: string | null;
485
489
  providerPaymentId: string | null;
@@ -488,7 +492,7 @@ export declare const financeService: {
488
492
  clientReference: string | null;
489
493
  currency: string;
490
494
  amountCents: number;
491
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
495
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
492
496
  payerPersonId: string | null;
493
497
  payerOrganizationId: string | null;
494
498
  payerEmail: string | null;
@@ -527,7 +531,7 @@ export declare const financeService: {
527
531
  paymentAuthorizationId: string | null;
528
532
  paymentCaptureId: string | null;
529
533
  paymentId: string | null;
530
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
534
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
531
535
  provider: string | null;
532
536
  providerSessionId: string | null;
533
537
  providerPaymentId: string | null;
@@ -536,7 +540,7 @@ export declare const financeService: {
536
540
  clientReference: string | null;
537
541
  currency: string;
538
542
  amountCents: number;
539
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
543
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
540
544
  payerPersonId: string | null;
541
545
  payerOrganizationId: string | null;
542
546
  payerEmail: string | null;
@@ -558,25 +562,22 @@ export declare const financeService: {
558
562
  createdAt: Date;
559
563
  updatedAt: Date;
560
564
  } | null>;
561
- createPaymentSession(db: PostgresJsDatabase, data: CreatePaymentSessionInput): Promise<{
562
- metadata: Record<string, unknown> | null;
565
+ createPaymentSession(db: PostgresJsDatabase, data: CreatePaymentSessionInput, runtime?: FinanceServiceRuntime): Promise<{
563
566
  id: string;
567
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
568
+ idempotencyKey: string | null;
569
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
570
+ targetId: string | null;
564
571
  createdAt: Date;
565
- updatedAt: Date;
566
572
  expiresAt: Date | null;
567
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
568
573
  currency: string;
569
574
  notes: string | null;
570
- idempotencyKey: string | null;
571
- provider: string | null;
575
+ updatedAt: Date;
572
576
  bookingId: string | null;
573
- expiredAt: Date | null;
574
- cancelledAt: Date | null;
575
- completedAt: Date | null;
576
577
  paymentId: string | null;
577
578
  amountCents: number;
578
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
579
- targetId: string | null;
579
+ provider: string | null;
580
+ metadata: Record<string, unknown> | null;
580
581
  orderId: string | null;
581
582
  invoiceId: string | null;
582
583
  bookingPaymentScheduleId: string | null;
@@ -584,7 +585,7 @@ export declare const financeService: {
584
585
  bookingGuaranteeId: string | null;
585
586
  paymentAuthorizationId: string | null;
586
587
  paymentCaptureId: string | null;
587
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
588
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
588
589
  providerSessionId: string | null;
589
590
  providerPaymentId: string | null;
590
591
  externalReference: string | null;
@@ -597,12 +598,15 @@ export declare const financeService: {
597
598
  returnUrl: string | null;
598
599
  cancelUrl: string | null;
599
600
  callbackUrl: string | null;
601
+ completedAt: Date | null;
600
602
  failedAt: Date | null;
603
+ cancelledAt: Date | null;
604
+ expiredAt: Date | null;
601
605
  failureCode: string | null;
602
606
  failureMessage: string | null;
603
607
  providerPayload: Record<string, unknown> | null;
604
608
  } | null>;
605
- updatePaymentSession(db: PostgresJsDatabase, id: string, data: UpdatePaymentSessionInput): Promise<{
609
+ updatePaymentSession(db: PostgresJsDatabase, id: string, data: UpdatePaymentSessionInput, runtime?: FinanceServiceRuntime): Promise<{
606
610
  id: string;
607
611
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
608
612
  targetId: string | null;
@@ -615,7 +619,7 @@ export declare const financeService: {
615
619
  paymentAuthorizationId: string | null;
616
620
  paymentCaptureId: string | null;
617
621
  paymentId: string | null;
618
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
622
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
619
623
  provider: string | null;
620
624
  providerSessionId: string | null;
621
625
  providerPaymentId: string | null;
@@ -624,7 +628,7 @@ export declare const financeService: {
624
628
  clientReference: string | null;
625
629
  currency: string;
626
630
  amountCents: number;
627
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
631
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
628
632
  payerPersonId: string | null;
629
633
  payerOrganizationId: string | null;
630
634
  payerEmail: string | null;
@@ -646,7 +650,7 @@ export declare const financeService: {
646
650
  createdAt: Date;
647
651
  updatedAt: Date;
648
652
  } | null>;
649
- markPaymentSessionRequiresRedirect(db: PostgresJsDatabase, id: string, data: MarkPaymentSessionRequiresRedirectInput): Promise<{
653
+ markPaymentSessionRequiresRedirect(db: PostgresJsDatabase, id: string, data: MarkPaymentSessionRequiresRedirectInput, runtime?: FinanceServiceRuntime): Promise<{
650
654
  id: string;
651
655
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
652
656
  targetId: string | null;
@@ -659,7 +663,7 @@ export declare const financeService: {
659
663
  paymentAuthorizationId: string | null;
660
664
  paymentCaptureId: string | null;
661
665
  paymentId: string | null;
662
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
666
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
663
667
  provider: string | null;
664
668
  providerSessionId: string | null;
665
669
  providerPaymentId: string | null;
@@ -668,7 +672,7 @@ export declare const financeService: {
668
672
  clientReference: string | null;
669
673
  currency: string;
670
674
  amountCents: number;
671
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
675
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
672
676
  payerPersonId: string | null;
673
677
  payerOrganizationId: string | null;
674
678
  payerEmail: string | null;
@@ -690,7 +694,7 @@ export declare const financeService: {
690
694
  createdAt: Date;
691
695
  updatedAt: Date;
692
696
  } | null>;
693
- failPaymentSession(db: PostgresJsDatabase, id: string, data: FailPaymentSessionInput): Promise<{
697
+ failPaymentSession(db: PostgresJsDatabase, id: string, data: FailPaymentSessionInput, runtime?: FinanceServiceRuntime): Promise<{
694
698
  id: string;
695
699
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
696
700
  targetId: string | null;
@@ -703,7 +707,7 @@ export declare const financeService: {
703
707
  paymentAuthorizationId: string | null;
704
708
  paymentCaptureId: string | null;
705
709
  paymentId: string | null;
706
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
710
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
707
711
  provider: string | null;
708
712
  providerSessionId: string | null;
709
713
  providerPaymentId: string | null;
@@ -712,7 +716,7 @@ export declare const financeService: {
712
716
  clientReference: string | null;
713
717
  currency: string;
714
718
  amountCents: number;
715
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
719
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
716
720
  payerPersonId: string | null;
717
721
  payerOrganizationId: string | null;
718
722
  payerEmail: string | null;
@@ -734,7 +738,7 @@ export declare const financeService: {
734
738
  createdAt: Date;
735
739
  updatedAt: Date;
736
740
  } | null>;
737
- cancelPaymentSession(db: PostgresJsDatabase, id: string, data: CancelPaymentSessionInput): Promise<{
741
+ cancelPaymentSession(db: PostgresJsDatabase, id: string, data: CancelPaymentSessionInput, runtime?: FinanceServiceRuntime): Promise<{
738
742
  id: string;
739
743
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
740
744
  targetId: string | null;
@@ -747,7 +751,7 @@ export declare const financeService: {
747
751
  paymentAuthorizationId: string | null;
748
752
  paymentCaptureId: string | null;
749
753
  paymentId: string | null;
750
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
754
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
751
755
  provider: string | null;
752
756
  providerSessionId: string | null;
753
757
  providerPaymentId: string | null;
@@ -756,7 +760,7 @@ export declare const financeService: {
756
760
  clientReference: string | null;
757
761
  currency: string;
758
762
  amountCents: number;
759
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
763
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
760
764
  payerPersonId: string | null;
761
765
  payerOrganizationId: string | null;
762
766
  payerEmail: string | null;
@@ -778,7 +782,7 @@ export declare const financeService: {
778
782
  createdAt: Date;
779
783
  updatedAt: Date;
780
784
  } | null>;
781
- expirePaymentSession(db: PostgresJsDatabase, id: string, data: ExpirePaymentSessionInput): Promise<{
785
+ expirePaymentSession(db: PostgresJsDatabase, id: string, data: ExpirePaymentSessionInput, runtime?: FinanceServiceRuntime): Promise<{
782
786
  id: string;
783
787
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
784
788
  targetId: string | null;
@@ -791,7 +795,7 @@ export declare const financeService: {
791
795
  paymentAuthorizationId: string | null;
792
796
  paymentCaptureId: string | null;
793
797
  paymentId: string | null;
794
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
798
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
795
799
  provider: string | null;
796
800
  providerSessionId: string | null;
797
801
  providerPaymentId: string | null;
@@ -800,7 +804,7 @@ export declare const financeService: {
800
804
  clientReference: string | null;
801
805
  currency: string;
802
806
  amountCents: number;
803
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
807
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
804
808
  payerPersonId: string | null;
805
809
  payerOrganizationId: string | null;
806
810
  payerEmail: string | null;
@@ -835,7 +839,7 @@ export declare const financeService: {
835
839
  paymentAuthorizationId: string | null;
836
840
  paymentCaptureId: string | null;
837
841
  paymentId: string | null;
838
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
842
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
839
843
  provider: string | null;
840
844
  providerSessionId: string | null;
841
845
  providerPaymentId: string | null;
@@ -844,7 +848,7 @@ export declare const financeService: {
844
848
  clientReference: string | null;
845
849
  currency: string;
846
850
  amountCents: number;
847
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
851
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
848
852
  payerPersonId: string | null;
849
853
  payerOrganizationId: string | null;
850
854
  payerEmail: string | null;
@@ -874,8 +878,8 @@ export declare const financeService: {
874
878
  invoiceId: string | null;
875
879
  bookingGuaranteeId: string | null;
876
880
  paymentInstrumentId: string | null;
877
- status: "pending" | "failed" | "expired" | "authorized" | "partially_captured" | "captured" | "voided";
878
- captureMode: "manual" | "automatic";
881
+ status: "failed" | "expired" | "pending" | "authorized" | "partially_captured" | "captured" | "voided";
882
+ captureMode: "automatic" | "manual";
879
883
  currency: string;
880
884
  amountCents: number;
881
885
  provider: string | null;
@@ -899,8 +903,8 @@ export declare const financeService: {
899
903
  invoiceId: string | null;
900
904
  bookingGuaranteeId: string | null;
901
905
  paymentInstrumentId: string | null;
902
- status: "pending" | "failed" | "expired" | "authorized" | "partially_captured" | "captured" | "voided";
903
- captureMode: "manual" | "automatic";
906
+ status: "failed" | "expired" | "pending" | "authorized" | "partially_captured" | "captured" | "voided";
907
+ captureMode: "automatic" | "manual";
904
908
  currency: string;
905
909
  amountCents: number;
906
910
  provider: string | null;
@@ -913,36 +917,36 @@ export declare const financeService: {
913
917
  createdAt: Date;
914
918
  updatedAt: Date;
915
919
  } | null>;
916
- createPaymentAuthorization(db: PostgresJsDatabase, data: CreatePaymentAuthorizationInput): Promise<{
920
+ createPaymentAuthorization(db: PostgresJsDatabase, data: CreatePaymentAuthorizationInput, runtime?: FinanceServiceRuntime): Promise<{
917
921
  id: string;
922
+ status: "failed" | "expired" | "pending" | "authorized" | "partially_captured" | "captured" | "voided";
918
923
  createdAt: Date;
919
- updatedAt: Date;
920
924
  expiresAt: Date | null;
921
- status: "pending" | "failed" | "expired" | "authorized" | "partially_captured" | "captured" | "voided";
922
925
  currency: string;
923
926
  notes: string | null;
924
- provider: string | null;
927
+ updatedAt: Date;
925
928
  bookingId: string | null;
926
929
  amountCents: number;
930
+ provider: string | null;
927
931
  orderId: string | null;
928
932
  invoiceId: string | null;
929
933
  paymentInstrumentId: string | null;
930
934
  bookingGuaranteeId: string | null;
931
- captureMode: "manual" | "automatic";
935
+ captureMode: "automatic" | "manual";
932
936
  externalAuthorizationId: string | null;
933
937
  approvalCode: string | null;
934
938
  authorizedAt: Date | null;
935
939
  voidedAt: Date | null;
936
940
  } | null>;
937
- updatePaymentAuthorization(db: PostgresJsDatabase, id: string, data: UpdatePaymentAuthorizationInput): Promise<{
941
+ updatePaymentAuthorization(db: PostgresJsDatabase, id: string, data: UpdatePaymentAuthorizationInput, runtime?: FinanceServiceRuntime): Promise<{
938
942
  id: string;
939
943
  bookingId: string | null;
940
944
  orderId: string | null;
941
945
  invoiceId: string | null;
942
946
  bookingGuaranteeId: string | null;
943
947
  paymentInstrumentId: string | null;
944
- status: "pending" | "failed" | "expired" | "authorized" | "partially_captured" | "captured" | "voided";
945
- captureMode: "manual" | "automatic";
948
+ status: "failed" | "expired" | "pending" | "authorized" | "partially_captured" | "captured" | "voided";
949
+ captureMode: "automatic" | "manual";
946
950
  currency: string;
947
951
  amountCents: number;
948
952
  provider: string | null;
@@ -955,7 +959,7 @@ export declare const financeService: {
955
959
  createdAt: Date;
956
960
  updatedAt: Date;
957
961
  } | null>;
958
- deletePaymentAuthorization(db: PostgresJsDatabase, id: string): Promise<{
962
+ deletePaymentAuthorization(db: PostgresJsDatabase, id: string, runtime?: FinanceServiceRuntime): Promise<{
959
963
  id: string;
960
964
  } | null>;
961
965
  listPaymentCaptures(db: PostgresJsDatabase, query: PaymentCaptureListQuery): Promise<{
@@ -963,7 +967,7 @@ export declare const financeService: {
963
967
  id: string;
964
968
  paymentAuthorizationId: string | null;
965
969
  invoiceId: string | null;
966
- status: "pending" | "completed" | "failed" | "refunded" | "voided";
970
+ status: "failed" | "pending" | "completed" | "refunded" | "voided";
967
971
  currency: string;
968
972
  amountCents: number;
969
973
  provider: string | null;
@@ -982,7 +986,7 @@ export declare const financeService: {
982
986
  id: string;
983
987
  paymentAuthorizationId: string | null;
984
988
  invoiceId: string | null;
985
- status: "pending" | "completed" | "failed" | "refunded" | "voided";
989
+ status: "failed" | "pending" | "completed" | "refunded" | "voided";
986
990
  currency: string;
987
991
  amountCents: number;
988
992
  provider: string | null;
@@ -993,26 +997,26 @@ export declare const financeService: {
993
997
  createdAt: Date;
994
998
  updatedAt: Date;
995
999
  } | null>;
996
- createPaymentCapture(db: PostgresJsDatabase, data: CreatePaymentCaptureInput): Promise<{
1000
+ createPaymentCapture(db: PostgresJsDatabase, data: CreatePaymentCaptureInput, runtime?: FinanceServiceRuntime): Promise<{
997
1001
  id: string;
1002
+ status: "failed" | "pending" | "completed" | "refunded" | "voided";
998
1003
  createdAt: Date;
999
- updatedAt: Date;
1000
- status: "pending" | "completed" | "failed" | "refunded" | "voided";
1001
1004
  currency: string;
1002
1005
  notes: string | null;
1003
- provider: string | null;
1006
+ updatedAt: Date;
1004
1007
  amountCents: number;
1008
+ provider: string | null;
1005
1009
  invoiceId: string | null;
1006
1010
  paymentAuthorizationId: string | null;
1007
1011
  externalCaptureId: string | null;
1008
1012
  capturedAt: Date | null;
1009
1013
  settledAt: Date | null;
1010
1014
  } | null>;
1011
- updatePaymentCapture(db: PostgresJsDatabase, id: string, data: UpdatePaymentCaptureInput): Promise<{
1015
+ updatePaymentCapture(db: PostgresJsDatabase, id: string, data: UpdatePaymentCaptureInput, runtime?: FinanceServiceRuntime): Promise<{
1012
1016
  id: string;
1013
1017
  paymentAuthorizationId: string | null;
1014
1018
  invoiceId: string | null;
1015
- status: "pending" | "completed" | "failed" | "refunded" | "voided";
1019
+ status: "failed" | "pending" | "completed" | "refunded" | "voided";
1016
1020
  currency: string;
1017
1021
  amountCents: number;
1018
1022
  provider: string | null;
@@ -1023,7 +1027,7 @@ export declare const financeService: {
1023
1027
  createdAt: Date;
1024
1028
  updatedAt: Date;
1025
1029
  } | null>;
1026
- deletePaymentCapture(db: PostgresJsDatabase, id: string): Promise<{
1030
+ deletePaymentCapture(db: PostgresJsDatabase, id: string, runtime?: FinanceServiceRuntime): Promise<{
1027
1031
  id: string;
1028
1032
  } | null>;
1029
1033
  listBookingPaymentSchedules(db: PostgresJsDatabase, bookingId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"booking_payment_schedules", {
@@ -1100,7 +1104,7 @@ export declare const financeService: {
1100
1104
  tableName: "booking_payment_schedules";
1101
1105
  dataType: "string";
1102
1106
  columnType: "PgEnumColumn";
1103
- data: "pending" | "cancelled" | "expired" | "paid" | "due" | "waived";
1107
+ data: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1104
1108
  driverParam: string;
1105
1109
  notNull: true;
1106
1110
  hasDefault: true;
@@ -1219,7 +1223,7 @@ export declare const financeService: {
1219
1223
  bookingId: string;
1220
1224
  bookingItemId: string | null;
1221
1225
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1222
- status: "pending" | "cancelled" | "expired" | "paid" | "due" | "waived";
1226
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1223
1227
  dueDate: string;
1224
1228
  currency: string;
1225
1229
  amountCents: number;
@@ -1300,7 +1304,7 @@ export declare const financeService: {
1300
1304
  tableName: "booking_payment_schedules";
1301
1305
  dataType: "string";
1302
1306
  columnType: "PgEnumColumn";
1303
- data: "pending" | "cancelled" | "expired" | "paid" | "due" | "waived";
1307
+ data: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1304
1308
  driverParam: string;
1305
1309
  notNull: true;
1306
1310
  hasDefault: true;
@@ -1415,17 +1419,17 @@ export declare const financeService: {
1415
1419
  generated: undefined;
1416
1420
  }, {}, {}>;
1417
1421
  }>, "where" | "orderBy">;
1418
- createBookingPaymentSchedule(db: PostgresJsDatabase, bookingId: string, data: CreateBookingPaymentScheduleInput): Promise<{
1422
+ createBookingPaymentSchedule(db: PostgresJsDatabase, bookingId: string, data: CreateBookingPaymentScheduleInput, runtime?: FinanceServiceRuntime): Promise<{
1419
1423
  id: string;
1424
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1420
1425
  createdAt: Date;
1421
- updatedAt: Date;
1422
- status: "pending" | "cancelled" | "expired" | "paid" | "due" | "waived";
1423
1426
  currency: string;
1424
1427
  notes: string | null;
1428
+ updatedAt: Date;
1425
1429
  bookingId: string;
1426
- bookingItemId: string | null;
1427
1430
  amountCents: number;
1428
1431
  dueDate: string;
1432
+ bookingItemId: string | null;
1429
1433
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1430
1434
  } | null>;
1431
1435
  /**
@@ -1451,36 +1455,36 @@ export declare const financeService: {
1451
1455
  replace?: boolean;
1452
1456
  }): Promise<{
1453
1457
  id: string;
1458
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1454
1459
  createdAt: Date;
1455
- updatedAt: Date;
1456
- status: "pending" | "cancelled" | "expired" | "paid" | "due" | "waived";
1457
1460
  currency: string;
1458
1461
  notes: string | null;
1462
+ updatedAt: Date;
1459
1463
  bookingId: string;
1460
- bookingItemId: string | null;
1461
1464
  amountCents: number;
1462
1465
  dueDate: string;
1466
+ bookingItemId: string | null;
1463
1467
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1464
1468
  }[] | null>;
1465
- applyDefaultBookingPaymentPlan(db: PostgresJsDatabase, bookingId: string, data: ApplyDefaultBookingPaymentPlanInput): Promise<{
1469
+ applyDefaultBookingPaymentPlan(db: PostgresJsDatabase, bookingId: string, data: ApplyDefaultBookingPaymentPlanInput, runtime?: FinanceServiceRuntime): Promise<{
1466
1470
  id: string;
1471
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1467
1472
  createdAt: Date;
1468
- updatedAt: Date;
1469
- status: "pending" | "cancelled" | "expired" | "paid" | "due" | "waived";
1470
1473
  currency: string;
1471
1474
  notes: string | null;
1475
+ updatedAt: Date;
1472
1476
  bookingId: string;
1473
- bookingItemId: string | null;
1474
1477
  amountCents: number;
1475
1478
  dueDate: string;
1479
+ bookingItemId: string | null;
1476
1480
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1477
1481
  }[] | null>;
1478
- updateBookingPaymentSchedule(db: PostgresJsDatabase, scheduleId: string, data: UpdateBookingPaymentScheduleInput): Promise<{
1482
+ updateBookingPaymentSchedule(db: PostgresJsDatabase, scheduleId: string, data: UpdateBookingPaymentScheduleInput, runtime?: FinanceServiceRuntime): Promise<{
1479
1483
  id: string;
1480
1484
  bookingId: string;
1481
1485
  bookingItemId: string | null;
1482
1486
  scheduleType: "other" | "deposit" | "installment" | "balance" | "hold";
1483
- status: "pending" | "cancelled" | "expired" | "paid" | "due" | "waived";
1487
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
1484
1488
  dueDate: string;
1485
1489
  currency: string;
1486
1490
  amountCents: number;
@@ -1488,28 +1492,25 @@ export declare const financeService: {
1488
1492
  createdAt: Date;
1489
1493
  updatedAt: Date;
1490
1494
  } | null>;
1491
- deleteBookingPaymentSchedule(db: PostgresJsDatabase, scheduleId: string): Promise<{
1495
+ deleteBookingPaymentSchedule(db: PostgresJsDatabase, scheduleId: string, runtime?: FinanceServiceRuntime): Promise<{
1492
1496
  id: string;
1493
1497
  } | null>;
1494
- createPaymentSessionFromBookingSchedule(db: PostgresJsDatabase, scheduleId: string, data: CreatePaymentSessionFromScheduleInput): Promise<{
1495
- metadata: Record<string, unknown> | null;
1498
+ createPaymentSessionFromBookingSchedule(db: PostgresJsDatabase, scheduleId: string, data: CreatePaymentSessionFromScheduleInput, runtime?: FinanceServiceRuntime): Promise<{
1496
1499
  id: string;
1500
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
1501
+ idempotencyKey: string | null;
1502
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
1503
+ targetId: string | null;
1497
1504
  createdAt: Date;
1498
- updatedAt: Date;
1499
1505
  expiresAt: Date | null;
1500
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
1501
1506
  currency: string;
1502
1507
  notes: string | null;
1503
- idempotencyKey: string | null;
1504
- provider: string | null;
1508
+ updatedAt: Date;
1505
1509
  bookingId: string | null;
1506
- expiredAt: Date | null;
1507
- cancelledAt: Date | null;
1508
- completedAt: Date | null;
1509
1510
  paymentId: string | null;
1510
1511
  amountCents: number;
1511
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
1512
- targetId: string | null;
1512
+ provider: string | null;
1513
+ metadata: Record<string, unknown> | null;
1513
1514
  orderId: string | null;
1514
1515
  invoiceId: string | null;
1515
1516
  bookingPaymentScheduleId: string | null;
@@ -1517,7 +1518,7 @@ export declare const financeService: {
1517
1518
  bookingGuaranteeId: string | null;
1518
1519
  paymentAuthorizationId: string | null;
1519
1520
  paymentCaptureId: string | null;
1520
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
1521
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
1521
1522
  providerSessionId: string | null;
1522
1523
  providerPaymentId: string | null;
1523
1524
  externalReference: string | null;
@@ -1530,30 +1531,30 @@ export declare const financeService: {
1530
1531
  returnUrl: string | null;
1531
1532
  cancelUrl: string | null;
1532
1533
  callbackUrl: string | null;
1534
+ completedAt: Date | null;
1533
1535
  failedAt: Date | null;
1536
+ cancelledAt: Date | null;
1537
+ expiredAt: Date | null;
1534
1538
  failureCode: string | null;
1535
1539
  failureMessage: string | null;
1536
1540
  providerPayload: Record<string, unknown> | null;
1537
1541
  } | null>;
1538
- createPaymentSessionFromInvoice(db: PostgresJsDatabase, invoiceId: string, data: CreatePaymentSessionFromInvoiceInput): Promise<{
1539
- metadata: Record<string, unknown> | null;
1542
+ createPaymentSessionFromInvoice(db: PostgresJsDatabase, invoiceId: string, data: CreatePaymentSessionFromInvoiceInput, runtime?: FinanceServiceRuntime): Promise<{
1540
1543
  id: string;
1544
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
1545
+ idempotencyKey: string | null;
1546
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
1547
+ targetId: string | null;
1541
1548
  createdAt: Date;
1542
- updatedAt: Date;
1543
1549
  expiresAt: Date | null;
1544
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
1545
1550
  currency: string;
1546
1551
  notes: string | null;
1547
- idempotencyKey: string | null;
1548
- provider: string | null;
1552
+ updatedAt: Date;
1549
1553
  bookingId: string | null;
1550
- expiredAt: Date | null;
1551
- cancelledAt: Date | null;
1552
- completedAt: Date | null;
1553
1554
  paymentId: string | null;
1554
1555
  amountCents: number;
1555
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
1556
- targetId: string | null;
1556
+ provider: string | null;
1557
+ metadata: Record<string, unknown> | null;
1557
1558
  orderId: string | null;
1558
1559
  invoiceId: string | null;
1559
1560
  bookingPaymentScheduleId: string | null;
@@ -1561,7 +1562,7 @@ export declare const financeService: {
1561
1562
  bookingGuaranteeId: string | null;
1562
1563
  paymentAuthorizationId: string | null;
1563
1564
  paymentCaptureId: string | null;
1564
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
1565
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
1565
1566
  providerSessionId: string | null;
1566
1567
  providerPaymentId: string | null;
1567
1568
  externalReference: string | null;
@@ -1574,7 +1575,10 @@ export declare const financeService: {
1574
1575
  returnUrl: string | null;
1575
1576
  cancelUrl: string | null;
1576
1577
  callbackUrl: string | null;
1578
+ completedAt: Date | null;
1577
1579
  failedAt: Date | null;
1580
+ cancelledAt: Date | null;
1581
+ expiredAt: Date | null;
1578
1582
  failureCode: string | null;
1579
1583
  failureMessage: string | null;
1580
1584
  providerPayload: Record<string, unknown> | null;
@@ -1653,7 +1657,7 @@ export declare const financeService: {
1653
1657
  tableName: "booking_guarantees";
1654
1658
  dataType: "string";
1655
1659
  columnType: "PgEnumColumn";
1656
- data: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1660
+ data: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1657
1661
  driverParam: string;
1658
1662
  notNull: true;
1659
1663
  hasDefault: false;
@@ -1670,7 +1674,7 @@ export declare const financeService: {
1670
1674
  tableName: "booking_guarantees";
1671
1675
  dataType: "string";
1672
1676
  columnType: "PgEnumColumn";
1673
- data: "pending" | "failed" | "cancelled" | "active" | "expired" | "released";
1677
+ data: "failed" | "expired" | "cancelled" | "pending" | "active" | "released";
1674
1678
  driverParam: string;
1675
1679
  notNull: true;
1676
1680
  hasDefault: true;
@@ -1891,8 +1895,8 @@ export declare const financeService: {
1891
1895
  bookingId: string;
1892
1896
  bookingPaymentScheduleId: string | null;
1893
1897
  bookingItemId: string | null;
1894
- guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1895
- status: "pending" | "failed" | "cancelled" | "active" | "expired" | "released";
1898
+ guaranteeType: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1899
+ status: "failed" | "expired" | "cancelled" | "pending" | "active" | "released";
1896
1900
  paymentInstrumentId: string | null;
1897
1901
  paymentAuthorizationId: string | null;
1898
1902
  currency: string | null;
@@ -1979,7 +1983,7 @@ export declare const financeService: {
1979
1983
  tableName: "booking_guarantees";
1980
1984
  dataType: "string";
1981
1985
  columnType: "PgEnumColumn";
1982
- data: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1986
+ data: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
1983
1987
  driverParam: string;
1984
1988
  notNull: true;
1985
1989
  hasDefault: false;
@@ -1996,7 +2000,7 @@ export declare const financeService: {
1996
2000
  tableName: "booking_guarantees";
1997
2001
  dataType: "string";
1998
2002
  columnType: "PgEnumColumn";
1999
- data: "pending" | "failed" | "cancelled" | "active" | "expired" | "released";
2003
+ data: "failed" | "expired" | "cancelled" | "pending" | "active" | "released";
2000
2004
  driverParam: string;
2001
2005
  notNull: true;
2002
2006
  hasDefault: true;
@@ -2213,45 +2217,42 @@ export declare const financeService: {
2213
2217
  generated: undefined;
2214
2218
  }, {}, {}>;
2215
2219
  }>, "where" | "orderBy">;
2216
- createBookingGuarantee(db: PostgresJsDatabase, bookingId: string, data: CreateBookingGuaranteeInput): Promise<{
2220
+ createBookingGuarantee(db: PostgresJsDatabase, bookingId: string, data: CreateBookingGuaranteeInput, runtime?: FinanceServiceRuntime): Promise<{
2217
2221
  id: string;
2222
+ status: "failed" | "expired" | "cancelled" | "pending" | "active" | "released";
2218
2223
  createdAt: Date;
2219
- updatedAt: Date;
2220
2224
  expiresAt: Date | null;
2221
- status: "pending" | "failed" | "cancelled" | "active" | "expired" | "released";
2222
2225
  currency: string | null;
2223
2226
  notes: string | null;
2224
- provider: string | null;
2227
+ updatedAt: Date;
2225
2228
  bookingId: string;
2226
- bookingItemId: string | null;
2227
- releasedAt: Date | null;
2228
2229
  amountCents: number | null;
2230
+ provider: string | null;
2231
+ bookingItemId: string | null;
2229
2232
  bookingPaymentScheduleId: string | null;
2230
- guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
2233
+ guaranteeType: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
2231
2234
  paymentInstrumentId: string | null;
2232
2235
  paymentAuthorizationId: string | null;
2233
2236
  referenceNumber: string | null;
2234
2237
  guaranteedAt: Date | null;
2238
+ releasedAt: Date | null;
2235
2239
  } | null>;
2236
- createPaymentSessionFromBookingGuarantee(db: PostgresJsDatabase, guaranteeId: string, data: CreatePaymentSessionFromGuaranteeInput): Promise<{
2237
- metadata: Record<string, unknown> | null;
2240
+ createPaymentSessionFromBookingGuarantee(db: PostgresJsDatabase, guaranteeId: string, data: CreatePaymentSessionFromGuaranteeInput, runtime?: FinanceServiceRuntime): Promise<{
2238
2241
  id: string;
2242
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
2243
+ idempotencyKey: string | null;
2244
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
2245
+ targetId: string | null;
2239
2246
  createdAt: Date;
2240
- updatedAt: Date;
2241
2247
  expiresAt: Date | null;
2242
- status: "pending" | "failed" | "cancelled" | "expired" | "paid" | "requires_redirect" | "processing" | "authorized";
2243
2248
  currency: string;
2244
2249
  notes: string | null;
2245
- idempotencyKey: string | null;
2246
- provider: string | null;
2250
+ updatedAt: Date;
2247
2251
  bookingId: string | null;
2248
- expiredAt: Date | null;
2249
- cancelledAt: Date | null;
2250
- completedAt: Date | null;
2251
2252
  paymentId: string | null;
2252
2253
  amountCents: number;
2253
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
2254
- targetId: string | null;
2254
+ provider: string | null;
2255
+ metadata: Record<string, unknown> | null;
2255
2256
  orderId: string | null;
2256
2257
  invoiceId: string | null;
2257
2258
  bookingPaymentScheduleId: string | null;
@@ -2259,7 +2260,7 @@ export declare const financeService: {
2259
2260
  bookingGuaranteeId: string | null;
2260
2261
  paymentAuthorizationId: string | null;
2261
2262
  paymentCaptureId: string | null;
2262
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
2263
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
2263
2264
  providerSessionId: string | null;
2264
2265
  providerPaymentId: string | null;
2265
2266
  externalReference: string | null;
@@ -2272,18 +2273,21 @@ export declare const financeService: {
2272
2273
  returnUrl: string | null;
2273
2274
  cancelUrl: string | null;
2274
2275
  callbackUrl: string | null;
2276
+ completedAt: Date | null;
2275
2277
  failedAt: Date | null;
2278
+ cancelledAt: Date | null;
2279
+ expiredAt: Date | null;
2276
2280
  failureCode: string | null;
2277
2281
  failureMessage: string | null;
2278
2282
  providerPayload: Record<string, unknown> | null;
2279
2283
  } | null>;
2280
- updateBookingGuarantee(db: PostgresJsDatabase, guaranteeId: string, data: UpdateBookingGuaranteeInput): Promise<{
2284
+ updateBookingGuarantee(db: PostgresJsDatabase, guaranteeId: string, data: UpdateBookingGuaranteeInput, runtime?: FinanceServiceRuntime): Promise<{
2281
2285
  id: string;
2282
2286
  bookingId: string;
2283
2287
  bookingPaymentScheduleId: string | null;
2284
2288
  bookingItemId: string | null;
2285
- guaranteeType: "other" | "voucher" | "bank_transfer" | "credit_card" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
2286
- status: "pending" | "failed" | "cancelled" | "active" | "expired" | "released";
2289
+ guaranteeType: "bank_transfer" | "credit_card" | "voucher" | "other" | "deposit" | "preauth" | "card_on_file" | "agency_letter";
2290
+ status: "failed" | "expired" | "cancelled" | "pending" | "active" | "released";
2287
2291
  paymentInstrumentId: string | null;
2288
2292
  paymentAuthorizationId: string | null;
2289
2293
  currency: string | null;
@@ -2297,7 +2301,7 @@ export declare const financeService: {
2297
2301
  createdAt: Date;
2298
2302
  updatedAt: Date;
2299
2303
  } | null>;
2300
- deleteBookingGuarantee(db: PostgresJsDatabase, guaranteeId: string): Promise<{
2304
+ deleteBookingGuarantee(db: PostgresJsDatabase, guaranteeId: string, runtime?: FinanceServiceRuntime): Promise<{
2301
2305
  id: string;
2302
2306
  } | null>;
2303
2307
  listBookingItemTaxLines(db: PostgresJsDatabase, bookingItemId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"booking_item_tax_lines", {
@@ -2798,13 +2802,13 @@ export declare const financeService: {
2798
2802
  name: string;
2799
2803
  id: string;
2800
2804
  createdAt: Date;
2801
- updatedAt: Date;
2802
- scope: "included" | "excluded" | "withheld";
2803
- currency: string;
2804
2805
  code: string | null;
2805
- bookingItemId: string;
2806
+ currency: string;
2807
+ updatedAt: Date;
2806
2808
  amountCents: number;
2809
+ bookingItemId: string;
2807
2810
  jurisdiction: string | null;
2811
+ scope: "included" | "excluded" | "withheld";
2808
2812
  rateBasisPoints: number | null;
2809
2813
  includedInPrice: boolean;
2810
2814
  remittanceParty: string | null;
@@ -2886,7 +2890,7 @@ export declare const financeService: {
2886
2890
  tableName: "booking_item_commissions";
2887
2891
  dataType: "string";
2888
2892
  columnType: "PgEnumColumn";
2889
- data: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
2893
+ data: "agent" | "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate";
2890
2894
  driverParam: string;
2891
2895
  notNull: true;
2892
2896
  hasDefault: false;
@@ -2971,7 +2975,7 @@ export declare const financeService: {
2971
2975
  tableName: "booking_item_commissions";
2972
2976
  dataType: "string";
2973
2977
  columnType: "PgEnumColumn";
2974
- data: "pending" | "void" | "paid" | "accrued" | "payable";
2978
+ data: "pending" | "paid" | "void" | "accrued" | "payable";
2975
2979
  driverParam: string;
2976
2980
  notNull: true;
2977
2981
  hasDefault: true;
@@ -3072,12 +3076,12 @@ export declare const financeService: {
3072
3076
  id: string;
3073
3077
  bookingItemId: string;
3074
3078
  channelId: string | null;
3075
- recipientType: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
3079
+ recipientType: "agent" | "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate";
3076
3080
  commissionModel: "fixed" | "percentage" | "markup" | "net";
3077
3081
  currency: string | null;
3078
3082
  amountCents: number | null;
3079
3083
  rateBasisPoints: number | null;
3080
- status: "pending" | "void" | "paid" | "accrued" | "payable";
3084
+ status: "pending" | "paid" | "void" | "accrued" | "payable";
3081
3085
  payableAt: string | null;
3082
3086
  paidAt: string | null;
3083
3087
  notes: string | null;
@@ -3140,7 +3144,7 @@ export declare const financeService: {
3140
3144
  tableName: "booking_item_commissions";
3141
3145
  dataType: "string";
3142
3146
  columnType: "PgEnumColumn";
3143
- data: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
3147
+ data: "agent" | "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate";
3144
3148
  driverParam: string;
3145
3149
  notNull: true;
3146
3150
  hasDefault: false;
@@ -3225,7 +3229,7 @@ export declare const financeService: {
3225
3229
  tableName: "booking_item_commissions";
3226
3230
  dataType: "string";
3227
3231
  columnType: "PgEnumColumn";
3228
- data: "pending" | "void" | "paid" | "accrued" | "payable";
3232
+ data: "pending" | "paid" | "void" | "accrued" | "payable";
3229
3233
  driverParam: string;
3230
3234
  notNull: true;
3231
3235
  hasDefault: true;
@@ -3325,30 +3329,30 @@ export declare const financeService: {
3325
3329
  }>, "where" | "orderBy">;
3326
3330
  createBookingItemCommission(db: PostgresJsDatabase, bookingItemId: string, data: CreateBookingItemCommissionInput): Promise<{
3327
3331
  id: string;
3332
+ status: "pending" | "paid" | "void" | "accrued" | "payable";
3328
3333
  createdAt: Date;
3329
- updatedAt: Date;
3330
- status: "pending" | "void" | "paid" | "accrued" | "payable";
3331
3334
  currency: string | null;
3332
3335
  notes: string | null;
3333
- paidAt: string | null;
3334
- bookingItemId: string;
3336
+ updatedAt: Date;
3335
3337
  amountCents: number | null;
3336
3338
  channelId: string | null;
3339
+ bookingItemId: string;
3337
3340
  rateBasisPoints: number | null;
3338
- recipientType: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
3341
+ recipientType: "agent" | "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate";
3339
3342
  commissionModel: "fixed" | "percentage" | "markup" | "net";
3340
3343
  payableAt: string | null;
3344
+ paidAt: string | null;
3341
3345
  } | null>;
3342
3346
  updateBookingItemCommission(db: PostgresJsDatabase, commissionId: string, data: UpdateBookingItemCommissionInput): Promise<{
3343
3347
  id: string;
3344
3348
  bookingItemId: string;
3345
3349
  channelId: string | null;
3346
- recipientType: "internal" | "supplier" | "other" | "affiliate" | "channel" | "agency" | "agent";
3350
+ recipientType: "agent" | "other" | "supplier" | "channel" | "agency" | "internal" | "affiliate";
3347
3351
  commissionModel: "fixed" | "percentage" | "markup" | "net";
3348
3352
  currency: string | null;
3349
3353
  amountCents: number | null;
3350
3354
  rateBasisPoints: number | null;
3351
- status: "pending" | "void" | "paid" | "accrued" | "payable";
3355
+ status: "pending" | "paid" | "void" | "accrued" | "payable";
3352
3356
  payableAt: string | null;
3353
3357
  paidAt: string | null;
3354
3358
  notes: string | null;
@@ -3362,7 +3366,7 @@ export declare const financeService: {
3362
3366
  month: import("drizzle-orm").SQL<string>;
3363
3367
  totalCents: import("drizzle-orm").SQL<number>;
3364
3368
  count: import("drizzle-orm").SQL<number>;
3365
- }, "partial", Record<"invoices", "not-null">, false, "where" | "groupBy" | "orderBy", {
3369
+ }, "partial", Record<"invoices", "not-null">, false, "where" | "orderBy" | "groupBy", {
3366
3370
  month: string;
3367
3371
  totalCents: number;
3368
3372
  count: number;
@@ -3370,7 +3374,7 @@ export declare const financeService: {
3370
3374
  month: import("drizzle-orm").DrizzleTypeError<"You cannot reference this field without assigning it an alias first - use `.as(<alias>)`">;
3371
3375
  totalCents: import("drizzle-orm").DrizzleTypeError<"You cannot reference this field without assigning it an alias first - use `.as(<alias>)`">;
3372
3376
  count: import("drizzle-orm").DrizzleTypeError<"You cannot reference this field without assigning it an alias first - use `.as(<alias>)`">;
3373
- }>, "where" | "groupBy" | "orderBy">;
3377
+ }>, "where" | "orderBy" | "groupBy">;
3374
3378
  getAgingReport(db: PostgresJsDatabase, query: AgingReportQuery): Omit<import("drizzle-orm/pg-core").PgSelectBase<"invoices", {
3375
3379
  bucket: import("drizzle-orm").SQL<string>;
3376
3380
  totalCents: import("drizzle-orm").SQL<number>;
@@ -3402,9 +3406,9 @@ export declare const financeService: {
3402
3406
  baseCurrency: string | null;
3403
3407
  baseAmountCents: number | null;
3404
3408
  fxRateSetId: string | null;
3405
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
3409
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
3406
3410
  paymentInstrumentId: string | null;
3407
- status: "pending" | "completed" | "failed" | "refunded";
3411
+ status: "failed" | "pending" | "completed" | "refunded";
3408
3412
  referenceNumber: string | null;
3409
3413
  paymentDate: string;
3410
3414
  notes: string | null;
@@ -3415,26 +3419,26 @@ export declare const financeService: {
3415
3419
  limit: number;
3416
3420
  offset: number;
3417
3421
  }>;
3418
- createSupplierPayment(db: PostgresJsDatabase, data: CreateSupplierPaymentInput): Promise<{
3422
+ createSupplierPayment(db: PostgresJsDatabase, data: CreateSupplierPaymentInput, runtime?: FinanceServiceRuntime): Promise<{
3419
3423
  id: string;
3424
+ status: "failed" | "pending" | "completed" | "refunded";
3420
3425
  createdAt: Date;
3421
- updatedAt: Date;
3422
- status: "pending" | "completed" | "failed" | "refunded";
3423
3426
  currency: string;
3424
3427
  notes: string | null;
3428
+ updatedAt: Date;
3425
3429
  bookingId: string;
3426
- baseCurrency: string | null;
3427
- fxRateSetId: string | null;
3428
3430
  amountCents: number;
3429
3431
  supplierId: string | null;
3432
+ baseCurrency: string | null;
3433
+ fxRateSetId: string | null;
3430
3434
  paymentInstrumentId: string | null;
3431
3435
  referenceNumber: string | null;
3432
3436
  baseAmountCents: number | null;
3433
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
3437
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
3434
3438
  paymentDate: string;
3435
3439
  bookingSupplierStatusId: string | null;
3436
3440
  } | undefined>;
3437
- updateSupplierPayment(db: PostgresJsDatabase, id: string, data: UpdateSupplierPaymentInput): Promise<{
3441
+ updateSupplierPayment(db: PostgresJsDatabase, id: string, data: UpdateSupplierPaymentInput, runtime?: FinanceServiceRuntime): Promise<{
3438
3442
  id: string;
3439
3443
  bookingId: string;
3440
3444
  supplierId: string | null;
@@ -3444,9 +3448,9 @@ export declare const financeService: {
3444
3448
  baseCurrency: string | null;
3445
3449
  baseAmountCents: number | null;
3446
3450
  fxRateSetId: string | null;
3447
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
3451
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
3448
3452
  paymentInstrumentId: string | null;
3449
- status: "pending" | "completed" | "failed" | "refunded";
3453
+ status: "failed" | "pending" | "completed" | "refunded";
3450
3454
  referenceNumber: string | null;
3451
3455
  paymentDate: string;
3452
3456
  notes: string | null;
@@ -3467,7 +3471,7 @@ export declare const financeService: {
3467
3471
  bookingId: string;
3468
3472
  personId: string | null;
3469
3473
  organizationId: string | null;
3470
- status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
3474
+ status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
3471
3475
  currency: string;
3472
3476
  baseCurrency: string | null;
3473
3477
  fxRateSetId: string | null;
@@ -3495,17 +3499,14 @@ export declare const financeService: {
3495
3499
  }>;
3496
3500
  createInvoice(db: PostgresJsDatabase, data: CreateInvoiceInput): Promise<{
3497
3501
  id: string;
3498
- createdAt: Date;
3499
- updatedAt: Date;
3502
+ status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
3500
3503
  organizationId: string | null;
3501
- status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
3502
- issueDate: string;
3504
+ createdAt: Date;
3503
3505
  currency: string;
3504
3506
  notes: string | null;
3507
+ updatedAt: Date;
3505
3508
  bookingId: string;
3506
3509
  personId: string | null;
3507
- baseCurrency: string | null;
3508
- fxRateSetId: string | null;
3509
3510
  invoiceNumber: string;
3510
3511
  invoiceType: "invoice" | "proforma" | "credit_note";
3511
3512
  convertedFromInvoiceId: string | null;
@@ -3514,6 +3515,8 @@ export declare const financeService: {
3514
3515
  templateId: string | null;
3515
3516
  taxRegimeId: string | null;
3516
3517
  language: string | null;
3518
+ baseCurrency: string | null;
3519
+ fxRateSetId: string | null;
3517
3520
  subtotalCents: number;
3518
3521
  baseSubtotalCents: number | null;
3519
3522
  taxCents: number;
@@ -3526,21 +3529,19 @@ export declare const financeService: {
3526
3529
  baseBalanceDueCents: number | null;
3527
3530
  commissionPercent: number | null;
3528
3531
  commissionAmountCents: number | null;
3532
+ issueDate: string;
3529
3533
  dueDate: string;
3530
3534
  } | undefined>;
3531
3535
  createInvoiceFromBooking(db: PostgresJsDatabase, data: CreateInvoiceFromBookingInput, bookingData: InvoiceFromBookingData): Promise<{
3532
3536
  id: string;
3533
- createdAt: Date;
3534
- updatedAt: Date;
3537
+ status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
3535
3538
  organizationId: string | null;
3536
- status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
3537
- issueDate: string;
3539
+ createdAt: Date;
3538
3540
  currency: string;
3539
3541
  notes: string | null;
3542
+ updatedAt: Date;
3540
3543
  bookingId: string;
3541
3544
  personId: string | null;
3542
- baseCurrency: string | null;
3543
- fxRateSetId: string | null;
3544
3545
  invoiceNumber: string;
3545
3546
  invoiceType: "invoice" | "proforma" | "credit_note";
3546
3547
  convertedFromInvoiceId: string | null;
@@ -3549,6 +3550,8 @@ export declare const financeService: {
3549
3550
  templateId: string | null;
3550
3551
  taxRegimeId: string | null;
3551
3552
  language: string | null;
3553
+ baseCurrency: string | null;
3554
+ fxRateSetId: string | null;
3552
3555
  subtotalCents: number;
3553
3556
  baseSubtotalCents: number | null;
3554
3557
  taxCents: number;
@@ -3561,6 +3564,7 @@ export declare const financeService: {
3561
3564
  baseBalanceDueCents: number | null;
3562
3565
  commissionPercent: number | null;
3563
3566
  commissionAmountCents: number | null;
3567
+ issueDate: string;
3564
3568
  dueDate: string;
3565
3569
  } | null>;
3566
3570
  getInvoiceById(db: PostgresJsDatabase, id: string): Promise<{
@@ -3576,7 +3580,7 @@ export declare const financeService: {
3576
3580
  bookingId: string;
3577
3581
  personId: string | null;
3578
3582
  organizationId: string | null;
3579
- status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
3583
+ status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
3580
3584
  currency: string;
3581
3585
  baseCurrency: string | null;
3582
3586
  fxRateSetId: string | null;
@@ -3598,7 +3602,7 @@ export declare const financeService: {
3598
3602
  createdAt: Date;
3599
3603
  updatedAt: Date;
3600
3604
  } | null>;
3601
- updateInvoice(db: PostgresJsDatabase, id: string, data: UpdateInvoiceInput): Promise<{
3605
+ updateInvoice(db: PostgresJsDatabase, id: string, data: UpdateInvoiceInput, runtime?: FinanceServiceRuntime): Promise<{
3602
3606
  id: string;
3603
3607
  invoiceNumber: string;
3604
3608
  invoiceType: "invoice" | "proforma" | "credit_note";
@@ -3611,7 +3615,7 @@ export declare const financeService: {
3611
3615
  bookingId: string;
3612
3616
  personId: string | null;
3613
3617
  organizationId: string | null;
3614
- status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
3618
+ status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
3615
3619
  currency: string;
3616
3620
  baseCurrency: string | null;
3617
3621
  fxRateSetId: string | null;
@@ -3633,7 +3637,7 @@ export declare const financeService: {
3633
3637
  createdAt: Date;
3634
3638
  updatedAt: Date;
3635
3639
  } | null>;
3636
- deleteInvoice(db: PostgresJsDatabase, id: string): Promise<{
3640
+ deleteInvoice(db: PostgresJsDatabase, id: string, runtime?: FinanceServiceRuntime): Promise<{
3637
3641
  status: "not_found";
3638
3642
  } | {
3639
3643
  status: "not_draft";
@@ -3994,19 +3998,19 @@ export declare const financeService: {
3994
3998
  generated: undefined;
3995
3999
  }, {}, {}>;
3996
4000
  }>, "where" | "orderBy">;
3997
- createInvoiceLineItem(db: PostgresJsDatabase, invoiceId: string, data: CreateInvoiceLineItemInput): Promise<{
4001
+ createInvoiceLineItem(db: PostgresJsDatabase, invoiceId: string, data: CreateInvoiceLineItemInput, runtime?: FinanceServiceRuntime): Promise<{
3998
4002
  id: string;
3999
- createdAt: Date;
4000
4003
  description: string;
4001
- quantity: number;
4002
- bookingItemId: string | null;
4004
+ createdAt: Date;
4003
4005
  totalCents: number;
4004
4006
  invoiceId: string;
4007
+ bookingItemId: string | null;
4005
4008
  sortOrder: number;
4009
+ quantity: number;
4006
4010
  unitPriceCents: number;
4007
4011
  taxRate: number | null;
4008
- } | null | undefined>;
4009
- updateInvoiceLineItem(db: PostgresJsDatabase, lineId: string, data: UpdateInvoiceLineItemInput): Promise<{
4012
+ } | null>;
4013
+ updateInvoiceLineItem(db: PostgresJsDatabase, lineId: string, data: UpdateInvoiceLineItemInput, runtime?: FinanceServiceRuntime): Promise<{
4010
4014
  id: string;
4011
4015
  invoiceId: string;
4012
4016
  bookingItemId: string | null;
@@ -4018,8 +4022,17 @@ export declare const financeService: {
4018
4022
  sortOrder: number;
4019
4023
  createdAt: Date;
4020
4024
  } | null>;
4021
- deleteInvoiceLineItem(db: PostgresJsDatabase, lineId: string): Promise<{
4025
+ deleteInvoiceLineItem(db: PostgresJsDatabase, lineId: string, runtime?: FinanceServiceRuntime): Promise<{
4022
4026
  id: string;
4027
+ description: string;
4028
+ createdAt: Date;
4029
+ totalCents: number;
4030
+ invoiceId: string;
4031
+ bookingItemId: string | null;
4032
+ sortOrder: number;
4033
+ quantity: number;
4034
+ unitPriceCents: number;
4035
+ taxRate: number | null;
4023
4036
  } | null>;
4024
4037
  listPayments(db: PostgresJsDatabase, invoiceId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"payments", {
4025
4038
  id: import("drizzle-orm/pg-core").PgColumn<{
@@ -4146,7 +4159,7 @@ export declare const financeService: {
4146
4159
  tableName: "payments";
4147
4160
  dataType: "string";
4148
4161
  columnType: "PgEnumColumn";
4149
- data: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
4162
+ data: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
4150
4163
  driverParam: string;
4151
4164
  notNull: true;
4152
4165
  hasDefault: false;
@@ -4214,7 +4227,7 @@ export declare const financeService: {
4214
4227
  tableName: "payments";
4215
4228
  dataType: "string";
4216
4229
  columnType: "PgEnumColumn";
4217
- data: "pending" | "completed" | "failed" | "refunded";
4230
+ data: "failed" | "pending" | "completed" | "refunded";
4218
4231
  driverParam: string;
4219
4232
  notNull: true;
4220
4233
  hasDefault: true;
@@ -4319,11 +4332,11 @@ export declare const financeService: {
4319
4332
  baseCurrency: string | null;
4320
4333
  baseAmountCents: number | null;
4321
4334
  fxRateSetId: string | null;
4322
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
4335
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
4323
4336
  paymentInstrumentId: string | null;
4324
4337
  paymentAuthorizationId: string | null;
4325
4338
  paymentCaptureId: string | null;
4326
- status: "pending" | "completed" | "failed" | "refunded";
4339
+ status: "failed" | "pending" | "completed" | "refunded";
4327
4340
  referenceNumber: string | null;
4328
4341
  paymentDate: string;
4329
4342
  notes: string | null;
@@ -4454,7 +4467,7 @@ export declare const financeService: {
4454
4467
  tableName: "payments";
4455
4468
  dataType: "string";
4456
4469
  columnType: "PgEnumColumn";
4457
- data: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
4470
+ data: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
4458
4471
  driverParam: string;
4459
4472
  notNull: true;
4460
4473
  hasDefault: false;
@@ -4522,7 +4535,7 @@ export declare const financeService: {
4522
4535
  tableName: "payments";
4523
4536
  dataType: "string";
4524
4537
  columnType: "PgEnumColumn";
4525
- data: "pending" | "completed" | "failed" | "refunded";
4538
+ data: "failed" | "pending" | "completed" | "refunded";
4526
4539
  driverParam: string;
4527
4540
  notNull: true;
4528
4541
  hasDefault: true;
@@ -4633,23 +4646,23 @@ export declare const financeService: {
4633
4646
  * share a single record schema.
4634
4647
  */
4635
4648
  getPaymentById(db: PostgresJsDatabase, id: string): Promise<UnifiedPaymentRow | null>;
4636
- createPayment(db: PostgresJsDatabase, invoiceId: string, data: CreatePaymentInput): Promise<{
4649
+ createPayment(db: PostgresJsDatabase, invoiceId: string, data: CreatePaymentInput, runtime?: FinanceServiceRuntime): Promise<{
4637
4650
  id: string;
4651
+ status: "failed" | "pending" | "completed" | "refunded";
4638
4652
  createdAt: Date;
4639
- updatedAt: Date;
4640
- status: "pending" | "completed" | "failed" | "refunded";
4641
4653
  currency: string;
4642
4654
  notes: string | null;
4655
+ updatedAt: Date;
4656
+ amountCents: number;
4643
4657
  baseCurrency: string | null;
4644
4658
  fxRateSetId: string | null;
4645
- amountCents: number;
4646
4659
  invoiceId: string;
4647
4660
  paymentInstrumentId: string | null;
4648
4661
  paymentAuthorizationId: string | null;
4649
4662
  referenceNumber: string | null;
4650
4663
  paymentCaptureId: string | null;
4651
4664
  baseAmountCents: number | null;
4652
- paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill";
4665
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other";
4653
4666
  paymentDate: string;
4654
4667
  } | null | undefined>;
4655
4668
  listCreditNotes(db: PostgresJsDatabase, invoiceId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"credit_notes", {
@@ -5111,22 +5124,22 @@ export declare const financeService: {
5111
5124
  generated: undefined;
5112
5125
  }, {}, {}>;
5113
5126
  }>, "where" | "orderBy">;
5114
- createCreditNote(db: PostgresJsDatabase, invoiceId: string, data: CreateCreditNoteInput): Promise<{
5127
+ createCreditNote(db: PostgresJsDatabase, invoiceId: string, data: CreateCreditNoteInput, runtime?: FinanceServiceRuntime): Promise<{
5115
5128
  id: string;
5116
- createdAt: Date;
5117
- updatedAt: Date;
5118
5129
  status: "draft" | "issued" | "applied";
5130
+ createdAt: Date;
5119
5131
  currency: string;
5120
5132
  notes: string | null;
5133
+ updatedAt: Date;
5134
+ amountCents: number;
5121
5135
  baseCurrency: string | null;
5122
5136
  fxRateSetId: string | null;
5123
- reason: string;
5124
- amountCents: number;
5125
5137
  invoiceId: string;
5126
5138
  baseAmountCents: number | null;
5127
5139
  creditNoteNumber: string;
5140
+ reason: string;
5128
5141
  } | null | undefined>;
5129
- updateCreditNote(db: PostgresJsDatabase, creditNoteId: string, data: UpdateCreditNoteInput): Promise<{
5142
+ updateCreditNote(db: PostgresJsDatabase, creditNoteId: string, data: UpdateCreditNoteInput, runtime?: FinanceServiceRuntime): Promise<{
5130
5143
  id: string;
5131
5144
  creditNoteNumber: string;
5132
5145
  invoiceId: string;
@@ -5425,16 +5438,16 @@ export declare const financeService: {
5425
5438
  generated: undefined;
5426
5439
  }, {}, {}>;
5427
5440
  }>, "where" | "orderBy">;
5428
- createCreditNoteLineItem(db: PostgresJsDatabase, creditNoteId: string, data: CreateCreditNoteLineItemInput): Promise<{
5441
+ createCreditNoteLineItem(db: PostgresJsDatabase, creditNoteId: string, data: CreateCreditNoteLineItemInput, runtime?: FinanceServiceRuntime): Promise<{
5429
5442
  id: string;
5430
- createdAt: Date;
5431
5443
  description: string;
5432
- quantity: number;
5444
+ createdAt: Date;
5433
5445
  totalCents: number;
5434
5446
  sortOrder: number;
5447
+ quantity: number;
5435
5448
  unitPriceCents: number;
5436
5449
  creditNoteId: string;
5437
- } | null | undefined>;
5450
+ } | null>;
5438
5451
  listNotes(db: PostgresJsDatabase, invoiceId: string): Omit<import("drizzle-orm/pg-core").PgSelectBase<"finance_notes", {
5439
5452
  id: import("drizzle-orm/pg-core").PgColumn<{
5440
5453
  name: string;
@@ -5617,9 +5630,9 @@ export declare const financeService: {
5617
5630
  createNote(db: PostgresJsDatabase, invoiceId: string, userId: string, data: CreateFinanceNoteInput): Promise<{
5618
5631
  id: string;
5619
5632
  createdAt: Date;
5633
+ invoiceId: string;
5620
5634
  authorId: string;
5621
5635
  content: string;
5622
- invoiceId: string;
5623
5636
  } | null | undefined>;
5624
5637
  listInvoiceNumberSeries(db: PostgresJsDatabase, query: InvoiceNumberSeriesListQuery): Promise<{
5625
5638
  data: {
@@ -5659,12 +5672,12 @@ export declare const financeService: {
5659
5672
  createInvoiceNumberSeries(db: PostgresJsDatabase, data: CreateInvoiceNumberSeriesInput): Promise<{
5660
5673
  name: string;
5661
5674
  id: string;
5662
- prefix: string;
5663
5675
  createdAt: Date;
5676
+ active: boolean;
5677
+ code: string;
5664
5678
  updatedAt: Date;
5665
5679
  scope: "invoice" | "proforma" | "credit_note";
5666
- code: string;
5667
- active: boolean;
5680
+ prefix: string;
5668
5681
  separator: string;
5669
5682
  padLength: number;
5670
5683
  currentSequence: number;
@@ -5747,17 +5760,17 @@ export declare const financeService: {
5747
5760
  updatedAt: Date;
5748
5761
  } | null>;
5749
5762
  createInvoiceTemplate(db: PostgresJsDatabase, data: CreateInvoiceTemplateInput): Promise<{
5750
- metadata: unknown;
5751
5763
  name: string;
5752
5764
  id: string;
5753
5765
  createdAt: Date;
5754
- updatedAt: Date;
5755
- slug: string;
5756
5766
  active: boolean;
5757
- body: string;
5767
+ updatedAt: Date;
5768
+ metadata: unknown;
5758
5769
  language: string;
5759
5770
  jurisdiction: string | null;
5771
+ slug: string;
5760
5772
  bodyFormat: "html" | "markdown" | "lexical_json";
5773
+ body: string;
5761
5774
  cssStyles: string | null;
5762
5775
  isDefault: boolean;
5763
5776
  } | null>;
@@ -5783,8 +5796,8 @@ export declare const financeService: {
5783
5796
  id: string;
5784
5797
  invoiceId: string;
5785
5798
  templateId: string | null;
5786
- format: "json" | "pdf" | "html" | "xml";
5787
- status: "pending" | "failed" | "ready" | "stale";
5799
+ format: "json" | "html" | "pdf" | "xml";
5800
+ status: "failed" | "pending" | "ready" | "stale";
5788
5801
  storageKey: string | null;
5789
5802
  fileSize: number | null;
5790
5803
  checksum: string | null;
@@ -5799,8 +5812,8 @@ export declare const financeService: {
5799
5812
  id: string;
5800
5813
  invoiceId: string;
5801
5814
  templateId: string | null;
5802
- format: "json" | "pdf" | "html" | "xml";
5803
- status: "pending" | "failed" | "ready" | "stale";
5815
+ format: "json" | "html" | "pdf" | "xml";
5816
+ status: "failed" | "pending" | "ready" | "stale";
5804
5817
  storageKey: string | null;
5805
5818
  fileSize: number | null;
5806
5819
  checksum: string | null;
@@ -5812,27 +5825,27 @@ export declare const financeService: {
5812
5825
  updatedAt: Date;
5813
5826
  } | null>;
5814
5827
  createInvoiceRendition(db: PostgresJsDatabase, invoiceId: string, data: CreateInvoiceRenditionInput): Promise<{
5815
- metadata: unknown;
5828
+ format: "json" | "html" | "pdf" | "xml";
5816
5829
  id: string;
5830
+ status: "failed" | "pending" | "ready" | "stale";
5817
5831
  createdAt: Date;
5818
5832
  updatedAt: Date;
5819
- status: "pending" | "failed" | "ready" | "stale";
5820
- format: "json" | "pdf" | "html" | "xml";
5821
- errorMessage: string | null;
5833
+ metadata: unknown;
5822
5834
  templateId: string | null;
5823
5835
  language: string | null;
5824
5836
  invoiceId: string;
5825
5837
  storageKey: string | null;
5826
5838
  fileSize: number | null;
5827
5839
  checksum: string | null;
5840
+ errorMessage: string | null;
5828
5841
  generatedAt: Date | null;
5829
5842
  } | null>;
5830
5843
  updateInvoiceRendition(db: PostgresJsDatabase, id: string, data: UpdateInvoiceRenditionInput): Promise<{
5831
5844
  id: string;
5832
5845
  invoiceId: string;
5833
5846
  templateId: string | null;
5834
- format: "json" | "pdf" | "html" | "xml";
5835
- status: "pending" | "failed" | "ready" | "stale";
5847
+ format: "json" | "html" | "pdf" | "xml";
5848
+ status: "failed" | "pending" | "ready" | "stale";
5836
5849
  storageKey: string | null;
5837
5850
  fileSize: number | null;
5838
5851
  checksum: string | null;
@@ -5851,23 +5864,23 @@ export declare const financeService: {
5851
5864
  status: "bound";
5852
5865
  invoice: {
5853
5866
  id: string;
5854
- status: "void" | "draft" | "sent" | "partially_paid" | "paid" | "overdue";
5867
+ status: "draft" | "sent" | "partially_paid" | "paid" | "overdue" | "void";
5855
5868
  invoiceType: "invoice" | "proforma" | "credit_note";
5856
5869
  };
5857
5870
  rendition: {
5858
- metadata: unknown;
5871
+ format: "json" | "html" | "pdf" | "xml";
5859
5872
  id: string;
5873
+ status: "failed" | "pending" | "ready" | "stale";
5860
5874
  createdAt: Date;
5861
5875
  updatedAt: Date;
5862
- status: "pending" | "failed" | "ready" | "stale";
5863
- format: "json" | "pdf" | "html" | "xml";
5864
- errorMessage: string | null;
5876
+ metadata: unknown;
5865
5877
  templateId: string | null;
5866
5878
  language: string | null;
5867
5879
  invoiceId: string;
5868
5880
  storageKey: string | null;
5869
5881
  fileSize: number | null;
5870
5882
  checksum: string | null;
5883
+ errorMessage: string | null;
5871
5884
  generatedAt: Date | null;
5872
5885
  };
5873
5886
  }>;
@@ -5899,15 +5912,15 @@ export declare const financeService: {
5899
5912
  createdAt: Date;
5900
5913
  } | null>;
5901
5914
  createInvoiceAttachment(db: PostgresJsDatabase, invoiceId: string, data: CreateInvoiceAttachmentInput): Promise<{
5902
- metadata: unknown;
5903
5915
  name: string;
5904
5916
  id: string;
5905
5917
  createdAt: Date;
5906
- kind: string;
5918
+ metadata: unknown;
5907
5919
  invoiceId: string;
5908
5920
  storageKey: string | null;
5909
5921
  fileSize: number | null;
5910
5922
  checksum: string | null;
5923
+ kind: string;
5911
5924
  mimeType: string | null;
5912
5925
  } | null>;
5913
5926
  updateInvoiceAttachment(db: PostgresJsDatabase, invoiceId: string, id: string, data: UpdateInvoiceAttachmentInput): Promise<{
@@ -5937,19 +5950,19 @@ export declare const financeService: {
5937
5950
  } | {
5938
5951
  status: "requested";
5939
5952
  rendition: {
5940
- metadata: unknown;
5953
+ format: "json" | "html" | "pdf" | "xml";
5941
5954
  id: string;
5955
+ status: "failed" | "pending" | "ready" | "stale";
5942
5956
  createdAt: Date;
5943
5957
  updatedAt: Date;
5944
- status: "pending" | "failed" | "ready" | "stale";
5945
- format: "json" | "pdf" | "html" | "xml";
5946
- errorMessage: string | null;
5958
+ metadata: unknown;
5947
5959
  templateId: string | null;
5948
5960
  language: string | null;
5949
5961
  invoiceId: string;
5950
5962
  storageKey: string | null;
5951
5963
  fileSize: number | null;
5952
5964
  checksum: string | null;
5965
+ errorMessage: string | null;
5953
5966
  generatedAt: Date | null;
5954
5967
  } | null;
5955
5968
  }>;
@@ -5985,14 +5998,14 @@ export declare const financeService: {
5985
5998
  updatedAt: Date;
5986
5999
  } | null>;
5987
6000
  createTaxRegime(db: PostgresJsDatabase, data: CreateTaxRegimeInput): Promise<{
5988
- metadata: unknown;
5989
6001
  name: string;
5990
6002
  id: string;
5991
- createdAt: Date;
5992
- updatedAt: Date;
5993
6003
  description: string | null;
5994
- code: "other" | "standard" | "reduced" | "exempt" | "reverse_charge" | "margin_scheme_art311" | "zero_rated" | "out_of_scope";
6004
+ createdAt: Date;
5995
6005
  active: boolean;
6006
+ code: "other" | "standard" | "reduced" | "exempt" | "reverse_charge" | "margin_scheme_art311" | "zero_rated" | "out_of_scope";
6007
+ updatedAt: Date;
6008
+ metadata: unknown;
5996
6009
  jurisdiction: string | null;
5997
6010
  ratePercent: number | null;
5998
6011
  legalReference: string | null;
@@ -6048,11 +6061,11 @@ export declare const financeService: {
6048
6061
  } | null>;
6049
6062
  createTaxClass(db: PostgresJsDatabase, data: CreateTaxClassInput): Promise<{
6050
6063
  id: string;
6051
- createdAt: Date;
6052
- updatedAt: Date;
6053
6064
  description: string | null;
6054
- code: string;
6065
+ createdAt: Date;
6055
6066
  active: boolean;
6067
+ code: string;
6068
+ updatedAt: Date;
6056
6069
  label: string;
6057
6070
  defaultRegimeId: string | null;
6058
6071
  lines: {
@@ -6105,11 +6118,11 @@ export declare const financeService: {
6105
6118
  createTaxPolicyProfile(db: PostgresJsDatabase, data: CreateTaxPolicyProfileInput): Promise<{
6106
6119
  name: string;
6107
6120
  id: string;
6108
- createdAt: Date;
6109
- updatedAt: Date;
6110
6121
  description: string | null;
6111
- code: string;
6122
+ createdAt: Date;
6112
6123
  active: boolean;
6124
+ code: string;
6125
+ updatedAt: Date;
6113
6126
  jurisdiction: string | null;
6114
6127
  } | null>;
6115
6128
  updateTaxPolicyProfile(db: PostgresJsDatabase, id: string, data: UpdateTaxPolicyProfileInput): Promise<{
@@ -6132,7 +6145,7 @@ export declare const financeService: {
6132
6145
  side: "sell" | "buy";
6133
6146
  priority: number;
6134
6147
  name: string;
6135
- appliesTo: "all" | "accommodation" | "base" | "addon";
6148
+ appliesTo: "base" | "addon" | "accommodation" | "all";
6136
6149
  condition: Record<string, unknown> | null;
6137
6150
  taxRegimeId: string;
6138
6151
  active: boolean;
@@ -6149,7 +6162,7 @@ export declare const financeService: {
6149
6162
  side: "sell" | "buy";
6150
6163
  priority: number;
6151
6164
  name: string;
6152
- appliesTo: "all" | "accommodation" | "base" | "addon";
6165
+ appliesTo: "base" | "addon" | "accommodation" | "all";
6153
6166
  condition: Record<string, unknown> | null;
6154
6167
  taxRegimeId: string;
6155
6168
  active: boolean;
@@ -6160,13 +6173,13 @@ export declare const financeService: {
6160
6173
  name: string;
6161
6174
  id: string;
6162
6175
  createdAt: Date;
6163
- updatedAt: Date;
6164
6176
  active: boolean;
6177
+ updatedAt: Date;
6165
6178
  taxRegimeId: string;
6166
6179
  profileId: string;
6167
6180
  side: "sell" | "buy";
6168
6181
  priority: number;
6169
- appliesTo: "all" | "accommodation" | "base" | "addon";
6182
+ appliesTo: "base" | "addon" | "accommodation" | "all";
6170
6183
  condition: Record<string, unknown> | null;
6171
6184
  } | null>;
6172
6185
  updateTaxPolicyRule(db: PostgresJsDatabase, id: string, data: UpdateTaxPolicyRuleInput): Promise<{
@@ -6175,7 +6188,7 @@ export declare const financeService: {
6175
6188
  side: "sell" | "buy";
6176
6189
  priority: number;
6177
6190
  name: string;
6178
- appliesTo: "all" | "accommodation" | "base" | "addon";
6191
+ appliesTo: "base" | "addon" | "accommodation" | "all";
6179
6192
  condition: Record<string, unknown> | null;
6180
6193
  taxRegimeId: string;
6181
6194
  active: boolean;
@@ -6205,12 +6218,12 @@ export declare const financeService: {
6205
6218
  * immediately after a successful provider call.
6206
6219
  */
6207
6220
  registerInvoiceExternalRef(db: PostgresJsDatabase, invoiceId: string, data: CreateInvoiceExternalRefInput): Promise<{
6208
- metadata: unknown;
6209
6221
  id: string;
6222
+ status: string | null;
6210
6223
  createdAt: Date;
6211
6224
  updatedAt: Date;
6212
- status: string | null;
6213
6225
  provider: string;
6226
+ metadata: unknown;
6214
6227
  invoiceId: string;
6215
6228
  externalId: string | null;
6216
6229
  externalNumber: string | null;
@@ -6222,5 +6235,4 @@ export declare const financeService: {
6222
6235
  id: string;
6223
6236
  } | null>;
6224
6237
  };
6225
- export {};
6226
6238
  //# sourceMappingURL=service.d.ts.map