@voyant-travel/finance 0.133.0 → 0.134.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,20 @@
1
1
  import type { BindInvoiceRenditionInput, CreateInvoiceAttachmentInput, CreateInvoiceRenditionInput, CreateInvoiceTemplateInput, FinanceServiceRuntime, InvoiceTemplateListQuery, PostgresJsDatabase, RenderInvoiceInput, UpdateInvoiceAttachmentInput, UpdateInvoiceRenditionInput, UpdateInvoiceTemplateInput } from "./service-shared.js";
2
2
  export declare const financeInvoiceArtifactService: {
3
- listInvoiceTemplates(db: PostgresJsDatabase, query: InvoiceTemplateListQuery): Promise<{
4
- data: {
5
- id: string;
6
- name: string;
7
- slug: string;
8
- language: string;
9
- jurisdiction: string | null;
10
- bodyFormat: "html" | "markdown" | "lexical_json";
11
- body: string;
12
- cssStyles: string | null;
13
- isDefault: boolean;
14
- active: boolean;
15
- metadata: unknown;
16
- createdAt: Date;
17
- updatedAt: Date;
18
- }[];
19
- total: number;
20
- limit: number;
21
- offset: number;
22
- }>;
3
+ listInvoiceTemplates(db: PostgresJsDatabase, query: InvoiceTemplateListQuery): Promise<import("@voyant-travel/types").ListResponse<{
4
+ id: string;
5
+ name: string;
6
+ slug: string;
7
+ language: string;
8
+ jurisdiction: string | null;
9
+ bodyFormat: "html" | "markdown" | "lexical_json";
10
+ body: string;
11
+ cssStyles: string | null;
12
+ isDefault: boolean;
13
+ active: boolean;
14
+ metadata: unknown;
15
+ createdAt: Date;
16
+ updatedAt: Date;
17
+ }>>;
23
18
  getInvoiceTemplateById(db: PostgresJsDatabase, id: string): Promise<{
24
19
  id: string;
25
20
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"service-invoice-artifacts.d.ts","sourceRoot":"","sources":["../src/service-invoice-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,EAC1B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3B,0BAA0B,EAC1B,qBAAqB,EAErB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,qBAAqB,CAAA;AAiB5B,eAAO,MAAM,6BAA6B;6BACT,kBAAkB,SAAS,wBAAwB;;;;;;;;;;;;;;;+BAyBjD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;8BAS/B,kBAAkB,QAAQ,0BAA0B;;;;;;;;;;;;;;;8BAoB9E,kBAAkB,MAClB,MAAM,QACJ,0BAA0B;;;;;;;;;;;;;;;8BAUF,kBAAkB,MAAM,MAAM;;;8BAY9B,kBAAkB,aAAa,MAAM;;;;;;;;;;;;;;;;gCAQnC,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;+BAU1D,kBAAkB,aACX,MAAM,QACX,2BAA2B;;;;;;;;;;;;;;;;+BA6B7B,kBAAkB,MAClB,MAAM,QACJ,2BAA2B;;;;;;;;;;;;;;;;6BAgB7B,kBAAkB,aACX,MAAM,QACX,yBAAyB,YACtB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA8EC,kBAAkB,MAAM,MAAM;;;+BAY9B,kBAAkB,aAAa,MAAM;;;;;;;;;;;;iCAQnC,kBAAkB,MAAM,MAAM;;;;;;;;;;;;gCAU3D,kBAAkB,aACX,MAAM,QACX,4BAA4B;;;;;;;;;;;;gCA0B9B,kBAAkB,aACX,MAAM,MACb,MAAM,QACJ,4BAA4B;;;;;;;;;;;;gCAUF,kBAAkB,aAAa,MAAM,MAAM,MAAM;;;IAQnF;;;;;OAKG;sBACqB,kBAAkB,aAAa,MAAM,SAAS,kBAAkB;;;;;;;;;;;;;;;;;;;;;;CA4BzF,CAAA"}
@@ -19,7 +19,7 @@ export const financeInvoiceArtifactService = {
19
19
  .where(where)
20
20
  .limit(query.limit)
21
21
  .offset(query.offset)
22
- .orderBy(desc(invoiceTemplates.updatedAt)), db.select({ total: sql `count(*)::int` }).from(invoiceTemplates).where(where), query.limit, query.offset);
22
+ .orderBy(desc(invoiceTemplates.updatedAt)), db.select({ count: sql `count(*)::int` }).from(invoiceTemplates).where(where), query.limit, query.offset);
23
23
  },
24
24
  async getInvoiceTemplateById(db, id) {
25
25
  const [row] = await db
@@ -1,28 +1,23 @@
1
1
  import type { CreateInvoiceNumberSeriesInput, EnsureExternalInvoiceNumberSeriesInput, InvoiceNumberScope, InvoiceNumberSeriesListQuery, PostgresJsDatabase, UpdateInvoiceNumberSeriesInput } from "./service-shared.js";
2
2
  export declare const financeInvoiceNumberingService: {
3
- listInvoiceNumberSeries(db: PostgresJsDatabase, query: InvoiceNumberSeriesListQuery): Promise<{
4
- data: {
5
- id: string;
6
- code: string;
7
- name: string;
8
- prefix: string;
9
- separator: string;
10
- padLength: number;
11
- currentSequence: number;
12
- resetStrategy: "never" | "annual" | "monthly";
13
- resetAt: Date | null;
14
- scope: "invoice" | "proforma" | "credit_note";
15
- isDefault: boolean;
16
- externalProvider: string | null;
17
- externalConfigKey: string | null;
18
- active: boolean;
19
- createdAt: Date;
20
- updatedAt: Date;
21
- }[];
22
- total: number;
23
- limit: number;
24
- offset: number;
25
- }>;
3
+ listInvoiceNumberSeries(db: PostgresJsDatabase, query: InvoiceNumberSeriesListQuery): Promise<import("@voyant-travel/types").ListResponse<{
4
+ id: string;
5
+ code: string;
6
+ name: string;
7
+ prefix: string;
8
+ separator: string;
9
+ padLength: number;
10
+ currentSequence: number;
11
+ resetStrategy: "never" | "annual" | "monthly";
12
+ resetAt: Date | null;
13
+ scope: "invoice" | "proforma" | "credit_note";
14
+ isDefault: boolean;
15
+ externalProvider: string | null;
16
+ externalConfigKey: string | null;
17
+ active: boolean;
18
+ createdAt: Date;
19
+ updatedAt: Date;
20
+ }>>;
26
21
  getInvoiceNumberSeriesById(db: PostgresJsDatabase, id: string): Promise<{
27
22
  id: string;
28
23
  code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"service-invoice-numbering.d.ts","sourceRoot":"","sources":["../src/service-invoice-numbering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,sCAAsC,EACtC,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAClB,8BAA8B,EAC/B,MAAM,qBAAqB,CAAA;AAkB5B,eAAO,MAAM,8BAA8B;gCACP,kBAAkB,SAAS,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;mCAoBpD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;0CASvB,kBAAkB,SAAS,kBAAkB;;;;;;;;;;;;;;;;;;0CAenF,kBAAkB,UACd,sCAAsC,EAAE;;;;;;;;;;;;;;;;;;kCA+Gd,kBAAkB,QAAQ,8BAA8B;;;;;;;;;;;;;;;;;;kCAkCtF,kBAAkB,MAClB,MAAM,QACJ,8BAA8B;;;;;;;;;;;;;;;;;;kCAoCF,kBAAkB,MAAM,MAAM;;;IAQlE;;;;;OAKG;8BAC6B,kBAAkB,YAAY,MAAM;;;;;;;;;;;;;;;;uCAiD9D,kBAAkB,aACX,MAAM,QACX;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B/D,CAAA"}
1
+ {"version":3,"file":"service-invoice-numbering.d.ts","sourceRoot":"","sources":["../src/service-invoice-numbering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,sCAAsC,EACtC,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAClB,8BAA8B,EAC/B,MAAM,qBAAqB,CAAA;AAkB5B,eAAO,MAAM,8BAA8B;gCACP,kBAAkB,SAAS,4BAA4B;;;;;;;;;;;;;;;;;;mCAoBpD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;0CASvB,kBAAkB,SAAS,kBAAkB;;;;;;;;;;;;;;;;;;0CAenF,kBAAkB,UACd,sCAAsC,EAAE;;;;;;;;;;;;;;;;;;kCA+Gd,kBAAkB,QAAQ,8BAA8B;;;;;;;;;;;;;;;;;;kCAkCtF,kBAAkB,MAClB,MAAM,QACJ,8BAA8B;;;;;;;;;;;;;;;;;;kCAoCF,kBAAkB,MAAM,MAAM;;;IAQlE;;;;;OAKG;8BAC6B,kBAAkB,YAAY,MAAM;;;;;;;;;;;;;;;;uCAiD9D,kBAAkB,aACX,MAAM,QACX;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B/D,CAAA"}
@@ -13,7 +13,7 @@ export const financeInvoiceNumberingService = {
13
13
  .where(where)
14
14
  .limit(query.limit)
15
15
  .offset(query.offset)
16
- .orderBy(desc(invoiceNumberSeries.updatedAt)), db.select({ total: sql `count(*)::int` }).from(invoiceNumberSeries).where(where), query.limit, query.offset);
16
+ .orderBy(desc(invoiceNumberSeries.updatedAt)), db.select({ count: sql `count(*)::int` }).from(invoiceNumberSeries).where(where), query.limit, query.offset);
17
17
  },
18
18
  async getInvoiceNumberSeriesById(db, id) {
19
19
  const [row] = await db
@@ -1,31 +1,26 @@
1
1
  import type { CreatePaymentAuthorizationInput, CreatePaymentCaptureInput, FinanceServiceRuntime, PaymentAuthorizationListQuery, PaymentCaptureListQuery, PostgresJsDatabase, UpdatePaymentAuthorizationInput, UpdatePaymentCaptureInput } from "./service-shared.js";
2
2
  export declare const financePaymentAuthorizationService: {
3
- listPaymentAuthorizations(db: PostgresJsDatabase, query: PaymentAuthorizationListQuery): Promise<{
4
- data: {
5
- id: string;
6
- bookingId: string | null;
7
- orderId: string | null;
8
- invoiceId: string | null;
9
- bookingGuaranteeId: string | null;
10
- paymentInstrumentId: string | null;
11
- status: "failed" | "expired" | "pending" | "authorized" | "partially_captured" | "captured" | "voided";
12
- captureMode: "automatic" | "manual";
13
- currency: string;
14
- amountCents: number;
15
- provider: string | null;
16
- externalAuthorizationId: string | null;
17
- approvalCode: string | null;
18
- authorizedAt: Date | null;
19
- expiresAt: Date | null;
20
- voidedAt: Date | null;
21
- notes: string | null;
22
- createdAt: Date;
23
- updatedAt: Date;
24
- }[];
25
- total: number;
26
- limit: number;
27
- offset: number;
28
- }>;
3
+ listPaymentAuthorizations(db: PostgresJsDatabase, query: PaymentAuthorizationListQuery): Promise<import("@voyant-travel/types").ListResponse<{
4
+ id: string;
5
+ bookingId: string | null;
6
+ orderId: string | null;
7
+ invoiceId: string | null;
8
+ bookingGuaranteeId: string | null;
9
+ paymentInstrumentId: string | null;
10
+ status: "failed" | "expired" | "pending" | "authorized" | "partially_captured" | "captured" | "voided";
11
+ captureMode: "automatic" | "manual";
12
+ currency: string;
13
+ amountCents: number;
14
+ provider: string | null;
15
+ externalAuthorizationId: string | null;
16
+ approvalCode: string | null;
17
+ authorizedAt: Date | null;
18
+ expiresAt: Date | null;
19
+ voidedAt: Date | null;
20
+ notes: string | null;
21
+ createdAt: Date;
22
+ updatedAt: Date;
23
+ }>>;
29
24
  getPaymentAuthorizationById(db: PostgresJsDatabase, id: string): Promise<{
30
25
  id: string;
31
26
  bookingId: string | null;
@@ -92,26 +87,21 @@ export declare const financePaymentAuthorizationService: {
92
87
  deletePaymentAuthorization(db: PostgresJsDatabase, id: string, runtime?: FinanceServiceRuntime): Promise<{
93
88
  id: string;
94
89
  } | null>;
95
- listPaymentCaptures(db: PostgresJsDatabase, query: PaymentCaptureListQuery): Promise<{
96
- data: {
97
- id: string;
98
- paymentAuthorizationId: string | null;
99
- invoiceId: string | null;
100
- status: "failed" | "pending" | "completed" | "refunded" | "voided";
101
- currency: string;
102
- amountCents: number;
103
- provider: string | null;
104
- externalCaptureId: string | null;
105
- capturedAt: Date | null;
106
- settledAt: Date | null;
107
- notes: string | null;
108
- createdAt: Date;
109
- updatedAt: Date;
110
- }[];
111
- total: number;
112
- limit: number;
113
- offset: number;
114
- }>;
90
+ listPaymentCaptures(db: PostgresJsDatabase, query: PaymentCaptureListQuery): Promise<import("@voyant-travel/types").ListResponse<{
91
+ id: string;
92
+ paymentAuthorizationId: string | null;
93
+ invoiceId: string | null;
94
+ status: "failed" | "pending" | "completed" | "refunded" | "voided";
95
+ currency: string;
96
+ amountCents: number;
97
+ provider: string | null;
98
+ externalCaptureId: string | null;
99
+ capturedAt: Date | null;
100
+ settledAt: Date | null;
101
+ notes: string | null;
102
+ createdAt: Date;
103
+ updatedAt: Date;
104
+ }>>;
115
105
  getPaymentCaptureById(db: PostgresJsDatabase, id: string): Promise<{
116
106
  id: string;
117
107
  paymentAuthorizationId: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"service-payment-authorizations.d.ts","sourceRoot":"","sources":["../src/service-payment-authorizations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,yBAAyB,EACzB,qBAAqB,EACrB,6BAA6B,EAC7B,uBAAuB,EACvB,kBAAkB,EAClB,+BAA+B,EAC/B,yBAAyB,EAC1B,MAAM,qBAAqB,CAAA;AA8C5B,eAAO,MAAM,kCAAkC;kCACT,kBAAkB,SAAS,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;oCAyBtD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;mCAU9D,kBAAkB,QAChB,+BAA+B,YAC5B,qBAAqB;;;;;;;;;;;;;;;;;;;;;mCAkD1B,kBAAkB,MAClB,MAAM,QACJ,+BAA+B,YAC5B,qBAAqB;;;;;;;;;;;;;;;;;;;;;mCAuD1B,kBAAkB,MAClB,MAAM,YACD,qBAAqB;;;4BAoCF,kBAAkB,SAAS,uBAAuB;;;;;;;;;;;;;;;;;;;;8BAqBhD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;6BAMxD,kBAAkB,QAChB,yBAAyB,YACtB,qBAAqB;;;;;;;;;;;;;;;6BAuC1B,kBAAkB,MAClB,MAAM,QACJ,yBAAyB,YACtB,qBAAqB;;;;;;;;;;;;;;;6BAyC1B,kBAAkB,MAClB,MAAM,YACD,qBAAqB;;;CAmCjC,CAAA"}
1
+ {"version":3,"file":"service-payment-authorizations.d.ts","sourceRoot":"","sources":["../src/service-payment-authorizations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,+BAA+B,EAC/B,yBAAyB,EACzB,qBAAqB,EACrB,6BAA6B,EAC7B,uBAAuB,EACvB,kBAAkB,EAClB,+BAA+B,EAC/B,yBAAyB,EAC1B,MAAM,qBAAqB,CAAA;AA8C5B,eAAO,MAAM,kCAAkC;kCACT,kBAAkB,SAAS,6BAA6B;;;;;;;;;;;;;;;;;;;;;oCAyBtD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;mCAU9D,kBAAkB,QAChB,+BAA+B,YAC5B,qBAAqB;;;;;;;;;;;;;;;;;;;;;mCAkD1B,kBAAkB,MAClB,MAAM,QACJ,+BAA+B,YAC5B,qBAAqB;;;;;;;;;;;;;;;;;;;;;mCAuD1B,kBAAkB,MAClB,MAAM,YACD,qBAAqB;;;4BAoCF,kBAAkB,SAAS,uBAAuB;;;;;;;;;;;;;;;8BAqBhD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;6BAMxD,kBAAkB,QAChB,yBAAyB,YACtB,qBAAqB;;;;;;;;;;;;;;;6BAuC1B,kBAAkB,MAClB,MAAM,QACJ,yBAAyB,YACtB,qBAAqB;;;;;;;;;;;;;;;6BAyC1B,kBAAkB,MAClB,MAAM,YACD,qBAAqB;;;CAmCjC,CAAA"}
@@ -38,7 +38,7 @@ export const financePaymentAuthorizationService = {
38
38
  .where(where)
39
39
  .limit(query.limit)
40
40
  .offset(query.offset)
41
- .orderBy(desc(paymentAuthorizations.createdAt)), db.select({ total: sql `count(*)::int` }).from(paymentAuthorizations).where(where), query.limit, query.offset);
41
+ .orderBy(desc(paymentAuthorizations.createdAt)), db.select({ count: sql `count(*)::int` }).from(paymentAuthorizations).where(where), query.limit, query.offset);
42
42
  },
43
43
  async getPaymentAuthorizationById(db, id) {
44
44
  const [row] = await db
@@ -147,7 +147,7 @@ export const financePaymentAuthorizationService = {
147
147
  .where(where)
148
148
  .limit(query.limit)
149
149
  .offset(query.offset)
150
- .orderBy(desc(paymentCaptures.createdAt)), db.select({ total: sql `count(*)::int` }).from(paymentCaptures).where(where), query.limit, query.offset);
150
+ .orderBy(desc(paymentCaptures.createdAt)), db.select({ count: sql `count(*)::int` }).from(paymentCaptures).where(where), query.limit, query.offset);
151
151
  },
152
152
  async getPaymentCaptureById(db, id) {
153
153
  const [row] = await db.select().from(paymentCaptures).where(eq(paymentCaptures.id, id)).limit(1);
@@ -1,36 +1,31 @@
1
1
  import type { CreatePaymentInstrumentInput, FinanceServiceRuntime, PaymentInstrumentListQuery, PostgresJsDatabase, UpdatePaymentInstrumentInput } from "./service-shared.js";
2
2
  export declare const financePaymentInstrumentService: {
3
- listPaymentInstruments(db: PostgresJsDatabase, query: PaymentInstrumentListQuery): Promise<{
4
- data: {
5
- id: string;
6
- ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
7
- personId: string | null;
8
- organizationId: string | null;
9
- supplierId: string | null;
10
- channelId: string | null;
11
- instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
12
- status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
13
- label: string;
14
- provider: string | null;
15
- brand: string | null;
16
- last4: string | null;
17
- holderName: string | null;
18
- expiryMonth: number | null;
19
- expiryYear: number | null;
20
- externalToken: string | null;
21
- externalCustomerId: string | null;
22
- billingEmail: string | null;
23
- billingAddress: string | null;
24
- directBillReference: string | null;
25
- notes: string | null;
26
- metadata: unknown;
27
- createdAt: Date;
28
- updatedAt: Date;
29
- }[];
30
- total: number;
31
- limit: number;
32
- offset: number;
33
- }>;
3
+ listPaymentInstruments(db: PostgresJsDatabase, query: PaymentInstrumentListQuery): Promise<import("@voyant-travel/types").ListResponse<{
4
+ id: string;
5
+ ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
6
+ personId: string | null;
7
+ organizationId: string | null;
8
+ supplierId: string | null;
9
+ channelId: string | null;
10
+ instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
11
+ status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
12
+ label: string;
13
+ provider: string | null;
14
+ brand: string | null;
15
+ last4: string | null;
16
+ holderName: string | null;
17
+ expiryMonth: number | null;
18
+ expiryYear: number | null;
19
+ externalToken: string | null;
20
+ externalCustomerId: string | null;
21
+ billingEmail: string | null;
22
+ billingAddress: string | null;
23
+ directBillReference: string | null;
24
+ notes: string | null;
25
+ metadata: unknown;
26
+ createdAt: Date;
27
+ updatedAt: Date;
28
+ }>>;
34
29
  getPaymentInstrumentById(db: PostgresJsDatabase, id: string): Promise<{
35
30
  id: string;
36
31
  ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
@@ -1 +1 @@
1
- {"version":3,"file":"service-payment-instruments.d.ts","sourceRoot":"","sources":["../src/service-payment-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAgB5B,eAAO,MAAM,+BAA+B;+BACT,kBAAkB,SAAS,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAgCnD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;gCAU3D,kBAAkB,QAChB,4BAA4B,YACzB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;gCAgC1B,kBAAkB,MAClB,MAAM,QACJ,4BAA4B,YACzB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;gCAoC1B,kBAAkB,MAClB,MAAM,YACD,qBAAqB;;;CAmCjC,CAAA"}
1
+ {"version":3,"file":"service-payment-instruments.d.ts","sourceRoot":"","sources":["../src/service-payment-instruments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAgB5B,eAAO,MAAM,+BAA+B;+BACT,kBAAkB,SAAS,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;iCAgCnD,kBAAkB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;gCAU3D,kBAAkB,QAChB,4BAA4B,YACzB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;gCAgC1B,kBAAkB,MAClB,MAAM,QACJ,4BAA4B,YACzB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;gCAoC1B,kBAAkB,MAClB,MAAM,YACD,qBAAqB;;;CAmCjC,CAAA"}
@@ -27,7 +27,7 @@ export const financePaymentInstrumentService = {
27
27
  .where(where)
28
28
  .limit(query.limit)
29
29
  .offset(query.offset)
30
- .orderBy(desc(paymentInstruments.updatedAt)), db.select({ total: sql `count(*)::int` }).from(paymentInstruments).where(where), query.limit, query.offset);
30
+ .orderBy(desc(paymentInstruments.updatedAt)), db.select({ count: sql `count(*)::int` }).from(paymentInstruments).where(where), query.limit, query.offset);
31
31
  },
32
32
  async getPaymentInstrumentById(db, id) {
33
33
  const [row] = await db
@@ -1,30 +1,25 @@
1
1
  export declare const financePaymentProcessingService: {
2
- listPaymentAuthorizations(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./service-shared.js").PaymentAuthorizationListQuery): Promise<{
3
- data: {
4
- id: string;
5
- bookingId: string | null;
6
- orderId: string | null;
7
- invoiceId: string | null;
8
- bookingGuaranteeId: string | null;
9
- paymentInstrumentId: string | null;
10
- status: "failed" | "expired" | "pending" | "authorized" | "partially_captured" | "captured" | "voided";
11
- captureMode: "automatic" | "manual";
12
- currency: string;
13
- amountCents: number;
14
- provider: string | null;
15
- externalAuthorizationId: string | null;
16
- approvalCode: string | null;
17
- authorizedAt: Date | null;
18
- expiresAt: Date | null;
19
- voidedAt: Date | null;
20
- notes: string | null;
21
- createdAt: Date;
22
- updatedAt: Date;
23
- }[];
24
- total: number;
25
- limit: number;
26
- offset: number;
27
- }>;
2
+ listPaymentAuthorizations(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./service-shared.js").PaymentAuthorizationListQuery): Promise<import("@voyant-travel/types").ListResponse<{
3
+ id: string;
4
+ bookingId: string | null;
5
+ orderId: string | null;
6
+ invoiceId: string | null;
7
+ bookingGuaranteeId: string | null;
8
+ paymentInstrumentId: string | null;
9
+ status: "failed" | "expired" | "pending" | "authorized" | "partially_captured" | "captured" | "voided";
10
+ captureMode: "automatic" | "manual";
11
+ currency: string;
12
+ amountCents: number;
13
+ provider: string | null;
14
+ externalAuthorizationId: string | null;
15
+ approvalCode: string | null;
16
+ authorizedAt: Date | null;
17
+ expiresAt: Date | null;
18
+ voidedAt: Date | null;
19
+ notes: string | null;
20
+ createdAt: Date;
21
+ updatedAt: Date;
22
+ }>>;
28
23
  getPaymentAuthorizationById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
29
24
  id: string;
30
25
  bookingId: string | null;
@@ -91,26 +86,21 @@ export declare const financePaymentProcessingService: {
91
86
  deletePaymentAuthorization(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string, runtime?: import("./service-shared.js").FinanceServiceRuntime): Promise<{
92
87
  id: string;
93
88
  } | null>;
94
- listPaymentCaptures(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./service-shared.js").PaymentCaptureListQuery): Promise<{
95
- data: {
96
- id: string;
97
- paymentAuthorizationId: string | null;
98
- invoiceId: string | null;
99
- status: "failed" | "pending" | "completed" | "refunded" | "voided";
100
- currency: string;
101
- amountCents: number;
102
- provider: string | null;
103
- externalCaptureId: string | null;
104
- capturedAt: Date | null;
105
- settledAt: Date | null;
106
- notes: string | null;
107
- createdAt: Date;
108
- updatedAt: Date;
109
- }[];
110
- total: number;
111
- limit: number;
112
- offset: number;
113
- }>;
89
+ listPaymentCaptures(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./service-shared.js").PaymentCaptureListQuery): Promise<import("@voyant-travel/types").ListResponse<{
90
+ id: string;
91
+ paymentAuthorizationId: string | null;
92
+ invoiceId: string | null;
93
+ status: "failed" | "pending" | "completed" | "refunded" | "voided";
94
+ currency: string;
95
+ amountCents: number;
96
+ provider: string | null;
97
+ externalCaptureId: string | null;
98
+ capturedAt: Date | null;
99
+ settledAt: Date | null;
100
+ notes: string | null;
101
+ createdAt: Date;
102
+ updatedAt: Date;
103
+ }>>;
114
104
  getPaymentCaptureById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
115
105
  id: string;
116
106
  paymentAuthorizationId: string | null;
@@ -203,55 +193,50 @@ export declare const financePaymentProcessingService: {
203
193
  createdAt: Date;
204
194
  updatedAt: Date;
205
195
  } | null>;
206
- listPaymentSessions(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./service-shared.js").PaymentSessionListQuery): Promise<{
207
- data: {
208
- id: string;
209
- targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
210
- targetId: string | null;
211
- bookingId: string | null;
212
- orderId: string | null;
213
- invoiceId: string | null;
214
- bookingPaymentScheduleId: string | null;
215
- bookingGuaranteeId: string | null;
216
- paymentInstrumentId: string | null;
217
- paymentAuthorizationId: string | null;
218
- paymentCaptureId: string | null;
219
- paymentId: string | null;
220
- status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
221
- provider: string | null;
222
- providerSessionId: string | null;
223
- providerPaymentId: string | null;
224
- externalReference: string | null;
225
- idempotencyKey: string | null;
226
- clientReference: string | null;
227
- currency: string;
228
- amountCents: number;
229
- paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
230
- payerPersonId: string | null;
231
- payerOrganizationId: string | null;
232
- payerEmail: string | null;
233
- payerName: string | null;
234
- redirectUrl: string | null;
235
- returnUrl: string | null;
236
- cancelUrl: string | null;
237
- callbackUrl: string | null;
238
- expiresAt: Date | null;
239
- completedAt: Date | null;
240
- failedAt: Date | null;
241
- cancelledAt: Date | null;
242
- expiredAt: Date | null;
243
- failureCode: string | null;
244
- failureMessage: string | null;
245
- notes: string | null;
246
- providerPayload: Record<string, unknown> | null;
247
- metadata: Record<string, unknown> | null;
248
- createdAt: Date;
249
- updatedAt: Date;
250
- }[];
251
- total: number;
252
- limit: number;
253
- offset: number;
254
- }>;
196
+ listPaymentSessions(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./service-shared.js").PaymentSessionListQuery): Promise<import("@voyant-travel/types").ListResponse<{
197
+ id: string;
198
+ targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
199
+ targetId: string | null;
200
+ bookingId: string | null;
201
+ orderId: string | null;
202
+ invoiceId: string | null;
203
+ bookingPaymentScheduleId: string | null;
204
+ bookingGuaranteeId: string | null;
205
+ paymentInstrumentId: string | null;
206
+ paymentAuthorizationId: string | null;
207
+ paymentCaptureId: string | null;
208
+ paymentId: string | null;
209
+ status: "failed" | "expired" | "cancelled" | "pending" | "processing" | "paid" | "requires_redirect" | "authorized";
210
+ provider: string | null;
211
+ providerSessionId: string | null;
212
+ providerPaymentId: string | null;
213
+ externalReference: string | null;
214
+ idempotencyKey: string | null;
215
+ clientReference: string | null;
216
+ currency: string;
217
+ amountCents: number;
218
+ paymentMethod: "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "wallet" | "direct_bill" | "voucher" | "other" | null;
219
+ payerPersonId: string | null;
220
+ payerOrganizationId: string | null;
221
+ payerEmail: string | null;
222
+ payerName: string | null;
223
+ redirectUrl: string | null;
224
+ returnUrl: string | null;
225
+ cancelUrl: string | null;
226
+ callbackUrl: string | null;
227
+ expiresAt: Date | null;
228
+ completedAt: Date | null;
229
+ failedAt: Date | null;
230
+ cancelledAt: Date | null;
231
+ expiredAt: Date | null;
232
+ failureCode: string | null;
233
+ failureMessage: string | null;
234
+ notes: string | null;
235
+ providerPayload: Record<string, unknown> | null;
236
+ metadata: Record<string, unknown> | null;
237
+ createdAt: Date;
238
+ updatedAt: Date;
239
+ }>>;
255
240
  getPaymentSessionById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
256
241
  id: string;
257
242
  targetType: "other" | "booking" | "order" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "flight_order";
@@ -560,37 +545,32 @@ export declare const financePaymentProcessingService: {
560
545
  createdAt: Date;
561
546
  updatedAt: Date;
562
547
  } | null>;
563
- listPaymentInstruments(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./service-shared.js").PaymentInstrumentListQuery): Promise<{
564
- data: {
565
- id: string;
566
- ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
567
- personId: string | null;
568
- organizationId: string | null;
569
- supplierId: string | null;
570
- channelId: string | null;
571
- instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
572
- status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
573
- label: string;
574
- provider: string | null;
575
- brand: string | null;
576
- last4: string | null;
577
- holderName: string | null;
578
- expiryMonth: number | null;
579
- expiryYear: number | null;
580
- externalToken: string | null;
581
- externalCustomerId: string | null;
582
- billingEmail: string | null;
583
- billingAddress: string | null;
584
- directBillReference: string | null;
585
- notes: string | null;
586
- metadata: unknown;
587
- createdAt: Date;
588
- updatedAt: Date;
589
- }[];
590
- total: number;
591
- limit: number;
592
- offset: number;
593
- }>;
548
+ listPaymentInstruments(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, query: import("./service-shared.js").PaymentInstrumentListQuery): Promise<import("@voyant-travel/types").ListResponse<{
549
+ id: string;
550
+ ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
551
+ personId: string | null;
552
+ organizationId: string | null;
553
+ supplierId: string | null;
554
+ channelId: string | null;
555
+ instrumentType: "credit_card" | "debit_card" | "cash" | "wallet" | "direct_bill" | "voucher" | "other" | "bank_account";
556
+ status: "expired" | "active" | "inactive" | "revoked" | "failed_verification";
557
+ label: string;
558
+ provider: string | null;
559
+ brand: string | null;
560
+ last4: string | null;
561
+ holderName: string | null;
562
+ expiryMonth: number | null;
563
+ expiryYear: number | null;
564
+ externalToken: string | null;
565
+ externalCustomerId: string | null;
566
+ billingEmail: string | null;
567
+ billingAddress: string | null;
568
+ directBillReference: string | null;
569
+ notes: string | null;
570
+ metadata: unknown;
571
+ createdAt: Date;
572
+ updatedAt: Date;
573
+ }>>;
594
574
  getPaymentInstrumentById(db: import("drizzle-orm/postgres-js").PostgresJsDatabase, id: string): Promise<{
595
575
  id: string;
596
576
  ownerType: "other" | "client" | "supplier" | "channel" | "agency" | "internal";
@@ -1 +1 @@
1
- {"version":3,"file":"service-payment-processing.d.ts","sourceRoot":"","sources":["../src/service-payment-processing.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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