@beacon-build/sdk 3.1.4 → 3.2.0

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 (60) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/clients/agent/connectors.client.d.ts +69 -0
  3. package/dist/clients/agent/connectors.client.d.ts.map +1 -0
  4. package/dist/clients/agent/connectors.client.js +25 -0
  5. package/dist/clients/agent/connectors.client.js.map +1 -0
  6. package/dist/clients/billing-account.types.d.ts +68 -0
  7. package/dist/clients/billing-account.types.d.ts.map +1 -0
  8. package/dist/clients/billing-account.types.js +6 -0
  9. package/dist/clients/billing-account.types.js.map +1 -0
  10. package/dist/clients/billing-errors.d.ts +26 -0
  11. package/dist/clients/billing-errors.d.ts.map +1 -0
  12. package/dist/clients/billing-errors.js +49 -0
  13. package/dist/clients/billing-errors.js.map +1 -0
  14. package/dist/clients/billing-invoice-list-query.d.ts +10 -0
  15. package/dist/clients/billing-invoice-list-query.d.ts.map +1 -0
  16. package/dist/clients/billing-invoice-list-query.js +23 -0
  17. package/dist/clients/billing-invoice-list-query.js.map +1 -0
  18. package/dist/clients/billing-invoice-list.client.d.ts +27 -0
  19. package/dist/clients/billing-invoice-list.client.d.ts.map +1 -0
  20. package/dist/clients/billing-invoice-list.client.js +40 -0
  21. package/dist/clients/billing-invoice-list.client.js.map +1 -0
  22. package/dist/clients/billing-invoice-list.types.d.ts +94 -0
  23. package/dist/clients/billing-invoice-list.types.d.ts.map +1 -0
  24. package/dist/clients/billing-invoice-list.types.js +9 -0
  25. package/dist/clients/billing-invoice-list.types.js.map +1 -0
  26. package/dist/clients/billing-invoice.types.d.ts +64 -0
  27. package/dist/clients/billing-invoice.types.d.ts.map +1 -0
  28. package/dist/clients/billing-invoice.types.js +2 -0
  29. package/dist/clients/billing-invoice.types.js.map +1 -0
  30. package/dist/clients/billing-pricing.types.d.ts +34 -0
  31. package/dist/clients/billing-pricing.types.d.ts.map +1 -0
  32. package/dist/clients/billing-pricing.types.js +3 -0
  33. package/dist/clients/billing-pricing.types.js.map +1 -0
  34. package/dist/clients/billing.client.d.ts +41 -52
  35. package/dist/clients/billing.client.d.ts.map +1 -1
  36. package/dist/clients/billing.client.js +72 -44
  37. package/dist/clients/billing.client.js.map +1 -1
  38. package/dist/clients/master-data.client.d.ts +89 -0
  39. package/dist/clients/master-data.client.d.ts.map +1 -0
  40. package/dist/clients/master-data.client.js +36 -0
  41. package/dist/clients/master-data.client.js.map +1 -0
  42. package/dist/factory/agent-sdk.d.ts +3 -0
  43. package/dist/factory/agent-sdk.d.ts.map +1 -1
  44. package/dist/factory/agent-sdk.js +3 -0
  45. package/dist/factory/agent-sdk.js.map +1 -1
  46. package/dist/factory/user-sdk.d.ts +3 -0
  47. package/dist/factory/user-sdk.d.ts.map +1 -1
  48. package/dist/factory/user-sdk.js +11 -1
  49. package/dist/factory/user-sdk.js.map +1 -1
  50. package/dist/index.d.ts +5 -1
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +4 -0
  53. package/dist/index.js.map +1 -1
  54. package/dist/manifest.agent-entries.d.ts.map +1 -1
  55. package/dist/manifest.agent-entries.js +10 -0
  56. package/dist/manifest.agent-entries.js.map +1 -1
  57. package/dist/manifest.negative-list.d.ts.map +1 -1
  58. package/dist/manifest.negative-list.js +5 -0
  59. package/dist/manifest.negative-list.js.map +1 -1
  60. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @beacon-build/sdk Changelog
2
2
 
3
+ ## 3.2.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 2669916: F733 increment 3: connector instance CRUD/status/sync API + SDK clients + connector_status/connector_sync MCP tools
8
+ - 0d3275f: F730 Increment 5 (AC-15): GET /organizations/{id}/billing/account and GET /users/me/billing/account expose { billingAccountId, holderType, recipientStatus, recipient } (never stripeCustomerId), wired through a new InvoiceRecipientService instance in BillingServices. OrgBillingStatusPanel.tsx and BillingStatusTab.tsx show a "Rechnungsangaben unvollständig" hint listing every missing item, linking to ?tab=master-data, once recipientStatus.complete is false. New SDK BillingClient.orgAccount/myAccount methods and DTOs. All 29 F730 ACs are now implemented; the M2 contract migration (dropping the old organizations/users billing\* columns) is deliberately deferred to the next release per the owner's rolling-deploy decision.
9
+ - 07c7211: F572: Stripe foundation increment 6 — AC-15 permissions smoke check logic + the normative permission table, and the SDK payment-method client methods
10
+ - 93a3714: F574 round 9 (Worker B, item 1): BillingClient gains accountInvoices/vendorInvoices/vendorInvoicesExport/vendorPayouts/createPaymentLink/downloadInvoicePdf for the AC-23/AC-24/AC-25/AC-26 round-7 routes, wired through a new optional BinaryClient transport for the CSV export and the archived PDF download (constructor backward-compatible).
11
+ - 23d0d67: F574 round 9 follow-up: BillingClient.vendorInvoiceDetail(invoiceId) for the AC-25 vendor invoice detail view (GET /admin/invoices/{id}), plus a VendorInvoiceListFilter.q recipient-name filter on vendorInvoices/vendorInvoicesExport.
12
+ - 3bc8e7c: Fix PR #1049 review findings (14 Copilot threads) and the F728 master-data merge-contributor blocker: connector-stripe is now loadable via CONNECTOR_TYPE_PACKAGES, the webhook ingress derives a per-type replay id/timestamp (Stripe-compatible) and bounds its rate limiter, a malformed webhook instance id no longer reaches the DB as a raw error, connector source runs are now atomic (DB-level single-in-flight guard), keep their prior contentHash on a failed item and never advance the cursor past a partial failure with secrets redacted from error messages, invoice archiving/delivery alerting is fully fail-safe, organization slug rename is idempotent, connector webhook deliveries are now pruned by the retention worker, and the master-data PersonMergeContributor is registered so claiming a Person with contact data no longer rolls back.
13
+ - Updated dependencies [6dc50b2]
14
+ - Updated dependencies [a12f615]
15
+ - Updated dependencies [c2d2584]
16
+ - Updated dependencies [ef6f4b2]
17
+ - Updated dependencies [48dab4c]
18
+ - Updated dependencies [87a2798]
19
+ - Updated dependencies [4b37b86]
20
+ - Updated dependencies [43719b0]
21
+ - Updated dependencies [b15b53b]
22
+ - Updated dependencies [fd575dd]
23
+ - Updated dependencies [553477f]
24
+ - Updated dependencies [b6cf744]
25
+ - Updated dependencies [ef3276d]
26
+ - Updated dependencies [c3d1605]
27
+ - Updated dependencies [b5246d4]
28
+ - Updated dependencies [d3f0699]
29
+ - Updated dependencies [315d5e6]
30
+ - Updated dependencies [acac63b]
31
+ - Updated dependencies [fdf5e2f]
32
+ - Updated dependencies [dc5e131]
33
+ - Updated dependencies [aaf36dc]
34
+ - Updated dependencies [0e00a93]
35
+ - Updated dependencies [358a17f]
36
+ - Updated dependencies [1c9825d]
37
+ - Updated dependencies [bf7aaea]
38
+ - Updated dependencies [ce630cb]
39
+ - Updated dependencies [8cac6d3]
40
+ - Updated dependencies [0dcf7bb]
41
+ - Updated dependencies [0dd2bb6]
42
+ - Updated dependencies [ea9a5ab]
43
+ - Updated dependencies [a870f53]
44
+ - Updated dependencies [c9219d3]
45
+ - Updated dependencies [3bc8e7c]
46
+ - @beacon-build/core@3.2.0
47
+
3
48
  ## 3.1.4
4
49
 
5
50
  ### Patch Changes
@@ -0,0 +1,69 @@
1
+ /**
2
+ * AgentConnectorsClient — F733/AC-16/AC-17/AC-24: the agent-facing SDK surface for the
3
+ * connector infrastructure's status/sync API (`services/api/src/routes/connectors*.ts`).
4
+ * Canonical under `/api/v1/connectors` — same basePath every other `Agent*Client` uses.
5
+ */
6
+ import type { HttpClient } from '../../transport/http-client.js';
7
+ export interface ConnectorInstanceSummary {
8
+ id: string;
9
+ typeId: string;
10
+ typeVersion: string;
11
+ orgId: string | null;
12
+ projectId: string | null;
13
+ name: string;
14
+ config: Record<string, unknown>;
15
+ allowedHosts: string[];
16
+ profile: string | null;
17
+ cadenceMinutes: number | null;
18
+ state: 'enabled' | 'disabled' | 'misconfigured' | 'archived';
19
+ createdAt: string;
20
+ updatedAt: string;
21
+ }
22
+ export interface ConnectorStatus {
23
+ instanceId: string;
24
+ state: string;
25
+ source: {
26
+ active: boolean;
27
+ lastRun: {
28
+ startedAt: string;
29
+ finishedAt: string | null;
30
+ result: string | null;
31
+ } | null;
32
+ lastSuccessfulRunAt: string | null;
33
+ stale: boolean;
34
+ counts: Record<string, number> | null;
35
+ } | null;
36
+ sink: {
37
+ active: boolean;
38
+ backlog: number;
39
+ oldestPendingAt: string | null;
40
+ dead: number;
41
+ } | null;
42
+ health: 'healthy' | 'stale' | 'degraded';
43
+ }
44
+ export interface ConnectorSyncOutcome {
45
+ source: {
46
+ started: boolean;
47
+ } | null;
48
+ sink: {
49
+ requeued: number;
50
+ } | null;
51
+ }
52
+ export declare class AgentConnectorsClient {
53
+ private http;
54
+ constructor(http: HttpClient);
55
+ listTypes(): Promise<{
56
+ id: string;
57
+ version: string;
58
+ roles: string[];
59
+ secretKeys: string[];
60
+ }[]>;
61
+ list(): Promise<ConnectorInstanceSummary[]>;
62
+ get(id: string): Promise<ConnectorInstanceSummary>;
63
+ /** AC-16: the tenant-guard-filtered status/drift read. */
64
+ status(id: string): Promise<ConnectorStatus>;
65
+ /** AC-17/AC-24: `connector_sync` — server-side gated (operator capability + tenant
66
+ * guard), never a client-side capability check. */
67
+ sync(id: string, role?: 'source' | 'sink'): Promise<ConnectorSyncOutcome>;
68
+ }
69
+ //# sourceMappingURL=connectors.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectors.client.d.ts","sourceRoot":"","sources":["../../../src/clients/agent/connectors.client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAEhE,MAAM,WAAW,wBAAwB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,OAAO,EAA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C;QAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAI9F,IAAI,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAI3C,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAIlD,0DAA0D;IAC1D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI5C;wDACoD;IACpD,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAG5E"}
@@ -0,0 +1,25 @@
1
+ export class AgentConnectorsClient {
2
+ http;
3
+ constructor(http) {
4
+ this.http = http;
5
+ }
6
+ listTypes() {
7
+ return this.http.get('/connectors/types');
8
+ }
9
+ list() {
10
+ return this.http.get('/connectors');
11
+ }
12
+ get(id) {
13
+ return this.http.get(`/connectors/${encodeURIComponent(id)}`);
14
+ }
15
+ /** AC-16: the tenant-guard-filtered status/drift read. */
16
+ status(id) {
17
+ return this.http.get(`/connectors/${encodeURIComponent(id)}/status`);
18
+ }
19
+ /** AC-17/AC-24: `connector_sync` — server-side gated (operator capability + tenant
20
+ * guard), never a client-side capability check. */
21
+ sync(id, role) {
22
+ return this.http.post(`/connectors/${encodeURIComponent(id)}/sync`, role ? { role } : {});
23
+ }
24
+ }
25
+ //# sourceMappingURL=connectors.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectors.client.js","sourceRoot":"","sources":["../../../src/clients/agent/connectors.client.ts"],"names":[],"mappings":"AA0CA,MAAM,OAAO,qBAAqB;IACV;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC,SAAS;QACL,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;IAC7C,CAAC;IAED,IAAI;QACA,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IACvC,CAAC;IAED,GAAG,CAAC,EAAU;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;IACjE,CAAC;IAED,0DAA0D;IAC1D,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,kBAAkB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAA;IACxE,CAAC;IAED;wDACoD;IACpD,IAAI,CAAC,EAAU,EAAE,IAAwB;QACrC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAC7F,CAAC;CACJ"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * F730 (billing account / recipient / vendor merge) and F572 (Stripe payment-method setup)
3
+ * wire types — split out of billing.client.ts (loc-guard), re-exported from there.
4
+ */
5
+ /** F730/AC-13..AC-15 — resolved billing recipient (never contains `stripeCustomerId`, D11
6
+ * billing contact as `{personId, displayName}` only). */
7
+ export interface InvoiceRecipientDto {
8
+ holderType: 'organization' | 'person';
9
+ holderId: string;
10
+ name: string;
11
+ legalName: string | null;
12
+ address: {
13
+ street: string;
14
+ houseNumber: string | null;
15
+ streetExtra: string | null;
16
+ postalCode: string;
17
+ city: string;
18
+ region: string | null;
19
+ countryCode: string;
20
+ };
21
+ countryCode: string;
22
+ vatId: string | null;
23
+ vatScheme: 'CH' | 'EU' | 'LI' | 'GB' | null;
24
+ vatCountry: string | null;
25
+ invoiceEmails: string[];
26
+ billingContact: {
27
+ personId: string;
28
+ displayName: string;
29
+ } | null;
30
+ }
31
+ /** F730/AC-15 — `GET .../billing/account` response. */
32
+ export interface BillingAccountViewDto {
33
+ billingAccountId: string;
34
+ holderType: 'organization' | 'person';
35
+ recipientStatus: {
36
+ complete: boolean;
37
+ missing: Array<'billing_address' | 'legal_name' | 'invoice_email'>;
38
+ };
39
+ recipient: InvoiceRecipientDto | null;
40
+ }
41
+ /** F730/D15 — vendor company merge response (`POST /vendor/billing-accounts/merge`). */
42
+ export interface BillingAccountMergeResultDto {
43
+ sourceOrgId: string;
44
+ targetOrgId: string;
45
+ closedBillingAccountId: string;
46
+ survivingBillingAccountId: string;
47
+ movedCounts: {
48
+ activationPeriods: number;
49
+ tierSnapshots: number;
50
+ tierSnapshotRuns: number;
51
+ requestMonths: number;
52
+ };
53
+ mergedAt: string;
54
+ }
55
+ /** F572 AC-11 — start the payment-method Checkout Session. */
56
+ export interface PaymentMethodSetupInput {
57
+ successUrl: string;
58
+ cancelUrl: string;
59
+ locale?: 'de' | 'en';
60
+ }
61
+ export interface PaymentMethodSetupResultDto {
62
+ url: string;
63
+ }
64
+ /** F572 AC-13 — chargeability read. */
65
+ export interface PaymentMethodStatusDto {
66
+ paymentMethodOnFile: boolean;
67
+ }
68
+ //# sourceMappingURL=billing-account.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-account.types.d.ts","sourceRoot":"","sources":["../../src/clients/billing-account.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;yDACyD;AACzD,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,cAAc,GAAG,QAAQ,CAAA;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE;QACL,MAAM,EAAE,MAAM,CAAA;QACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,UAAU,EAAE,MAAM,CAAA;QAClB,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,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2BAA2B;IACxC,GAAG,EAAE,MAAM,CAAA;CACd;AACD,uCAAuC;AACvC,MAAM,WAAW,sBAAsB;IACnC,mBAAmB,EAAE,OAAO,CAAA;CAC/B"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * F730 (billing account / recipient / vendor merge) and F572 (Stripe payment-method setup)
3
+ * wire types — split out of billing.client.ts (loc-guard), re-exported from there.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=billing-account.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-account.types.js","sourceRoot":"","sources":["../../src/clients/billing-account.types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * billing-errors.ts — typed SdkError subclasses for the billing lifecycle (F705) + the
3
+ * `typed()` wrapper that maps a raw SdkError onto one of these by `apiCode`. Extracted out of
4
+ * `billing.client.ts` (loc-guard) — that file only imports `typed`/`toTypedBillingError` now.
5
+ */
6
+ import { SdkError } from '../transport/errors.js';
7
+ import type { InactiveReasonValue } from './billing.client.js';
8
+ /** 403/409 BILLING_ENTITY_INACTIVE — writes to a resource of an inactive entity. */
9
+ export declare class BillingEntityInactiveError extends SdkError {
10
+ readonly entity: 'company' | 'personal';
11
+ readonly rootOrgId: string | null;
12
+ readonly inactiveReason: InactiveReasonValue | null;
13
+ constructor(e: SdkError);
14
+ }
15
+ export declare class PersonalSubscriptionRequiredError extends SdkError {
16
+ }
17
+ export declare class ProjectOwnerRequiredError extends SdkError {
18
+ }
19
+ export declare class PaymentOverdueError extends SdkError {
20
+ }
21
+ export declare class PaymentRequiredError extends SdkError {
22
+ }
23
+ /** Maps a raw SdkError to its typed billing subclass (unchanged when not a billing code). */
24
+ export declare function toTypedBillingError(err: unknown): unknown;
25
+ export declare function typed<T>(p: Promise<T>): Promise<T>;
26
+ //# sourceMappingURL=billing-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-errors.d.ts","sourceRoot":"","sources":["../../src/clients/billing-errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,oFAAoF;AACpF,qBAAa,0BAA2B,SAAQ,QAAQ;IACpD,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,QAAQ,CAAC,cAAc,EAAE,mBAAmB,GAAG,IAAI,CAAA;gBACvC,CAAC,EAAE,QAAQ;CAO1B;AACD,qBAAa,iCAAkC,SAAQ,QAAQ;CAAG;AAClE,qBAAa,yBAA0B,SAAQ,QAAQ;CAAG;AAC1D,qBAAa,mBAAoB,SAAQ,QAAQ;CAAG;AACpD,qBAAa,oBAAqB,SAAQ,QAAQ;CAAG;AAcrD,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAIzD;AAED,wBAAsB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMxD"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * billing-errors.ts — typed SdkError subclasses for the billing lifecycle (F705) + the
3
+ * `typed()` wrapper that maps a raw SdkError onto one of these by `apiCode`. Extracted out of
4
+ * `billing.client.ts` (loc-guard) — that file only imports `typed`/`toTypedBillingError` now.
5
+ */
6
+ import { SdkError } from '../transport/errors.js';
7
+ /** 403/409 BILLING_ENTITY_INACTIVE — writes to a resource of an inactive entity. */
8
+ export class BillingEntityInactiveError extends SdkError {
9
+ entity;
10
+ rootOrgId;
11
+ inactiveReason;
12
+ constructor(e) {
13
+ super(e.code, e.message, e.status, e.apiCode, e.details);
14
+ this.name = 'BillingEntityInactiveError';
15
+ this.entity = e.details?.entity ?? 'company';
16
+ this.rootOrgId = e.details?.rootOrgId ?? null;
17
+ this.inactiveReason = e.details?.inactiveReason ?? null;
18
+ }
19
+ }
20
+ export class PersonalSubscriptionRequiredError extends SdkError {
21
+ }
22
+ export class ProjectOwnerRequiredError extends SdkError {
23
+ }
24
+ export class PaymentOverdueError extends SdkError {
25
+ }
26
+ export class PaymentRequiredError extends SdkError {
27
+ }
28
+ const TYPED = {
29
+ BILLING_ENTITY_INACTIVE: (e) => new BillingEntityInactiveError(e),
30
+ PERSONAL_SUBSCRIPTION_REQUIRED: (e) => new PersonalSubscriptionRequiredError(e.code, e.message, e.status, e.apiCode, e.details),
31
+ PROJECT_OWNER_REQUIRED: (e) => new ProjectOwnerRequiredError(e.code, e.message, e.status, e.apiCode, e.details),
32
+ PAYMENT_OVERDUE: (e) => new PaymentOverdueError(e.code, e.message, e.status, e.apiCode, e.details),
33
+ PAYMENT_REQUIRED: (e) => new PaymentRequiredError(e.code, e.message, e.status, e.apiCode, e.details),
34
+ };
35
+ /** Maps a raw SdkError to its typed billing subclass (unchanged when not a billing code). */
36
+ export function toTypedBillingError(err) {
37
+ if (err instanceof SdkError && err.apiCode && TYPED[err.apiCode])
38
+ return TYPED[err.apiCode](err);
39
+ return err;
40
+ }
41
+ export async function typed(p) {
42
+ try {
43
+ return await p;
44
+ }
45
+ catch (err) {
46
+ throw toTypedBillingError(err);
47
+ }
48
+ }
49
+ //# sourceMappingURL=billing-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-errors.js","sourceRoot":"","sources":["../../src/clients/billing-errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAGjD,oFAAoF;AACpF,MAAM,OAAO,0BAA2B,SAAQ,QAAQ;IAC3C,MAAM,CAAwB;IAC9B,SAAS,CAAe;IACxB,cAAc,CAA4B;IACnD,YAAY,CAAW;QACnB,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,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AAC,OAAO,CAAC;IAC9E,gBAAgB,EAAE,CAAC,CAAC,EAAE,EAAE,CACpB,IAAI,oBAAoB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC;CAClF,CAAA;AAED,6FAA6F;AAC7F,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC5C,IAAI,GAAG,YAAY,QAAQ,IAAI,GAAG,CAAC,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;QAC5D,OAAO,KAAK,CAAC,GAAG,CAAC,OAAO,CAAE,CAAC,GAAG,CAAC,CAAA;IACnC,OAAO,GAAG,CAAA;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAI,CAAa;IACxC,IAAI,CAAC;QACD,OAAO,MAAM,CAAC,CAAA;IAClB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,mBAAmB,CAAC,GAAG,CAAC,CAAA;IAClC,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * F574/AC-25/AC-26 — query-string builders shared by `BillingClient.vendorInvoices`/
3
+ * `vendorInvoicesExport` (same filter shape, one JSON, one CSV via `BinaryClient`) and
4
+ * `vendorPayouts`. Kept out of `billing.client.ts` to keep that file's per-method bodies
5
+ * short (loc-guard).
6
+ */
7
+ import type { VendorInvoiceListFilter, VendorPayoutListFilter } from './billing-invoice-list.types.js';
8
+ export declare function vendorInvoiceQuery(filter?: VendorInvoiceListFilter): string;
9
+ export declare function vendorPayoutQuery(filter?: VendorPayoutListFilter): string;
10
+ //# sourceMappingURL=billing-invoice-list-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-invoice-list-query.d.ts","sourceRoot":"","sources":["../../src/clients/billing-invoice-list-query.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACR,uBAAuB,EACvB,sBAAsB,EACzB,MAAM,iCAAiC,CAAA;AAExC,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,uBAA4B,GAAG,MAAM,CAQ/E;AAED,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,sBAA2B,GAAG,MAAM,CAK7E"}
@@ -0,0 +1,23 @@
1
+ export function vendorInvoiceQuery(filter = {}) {
2
+ const params = new URLSearchParams();
3
+ if (filter.status && filter.status.length > 0)
4
+ params.set('status', filter.status.join(','));
5
+ if (filter.billingAccountId)
6
+ params.set('billingAccountId', filter.billingAccountId);
7
+ if (filter.issuedFrom)
8
+ params.set('issuedFrom', filter.issuedFrom);
9
+ if (filter.issuedTo)
10
+ params.set('issuedTo', filter.issuedTo);
11
+ if (filter.q)
12
+ params.set('q', filter.q);
13
+ return params.toString();
14
+ }
15
+ export function vendorPayoutQuery(filter = {}) {
16
+ const params = new URLSearchParams();
17
+ if (filter.arrivalFrom)
18
+ params.set('arrivalFrom', filter.arrivalFrom);
19
+ if (filter.arrivalTo)
20
+ params.set('arrivalTo', filter.arrivalTo);
21
+ return params.toString();
22
+ }
23
+ //# sourceMappingURL=billing-invoice-list-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-invoice-list-query.js","sourceRoot":"","sources":["../../src/clients/billing-invoice-list-query.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,kBAAkB,CAAC,SAAkC,EAAE;IACnE,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAA;IACpC,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IAC5F,IAAI,MAAM,CAAC,gBAAgB;QAAE,MAAM,CAAC,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACpF,IAAI,MAAM,CAAC,UAAU;QAAE,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAClE,IAAI,MAAM,CAAC,QAAQ;QAAE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAA;IAC5D,IAAI,MAAM,CAAC,CAAC;QAAE,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;IACvC,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAA;AAC5B,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,SAAiC,EAAE;IACjE,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAA;IACpC,IAAI,MAAM,CAAC,WAAW;QAAE,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;IACrE,IAAI,MAAM,CAAC,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;IAC/D,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAA;AAC5B,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * F574/AC-23..AC-26 — invoice list, vendor overview + CSV export, payout view and payment-link
3
+ * method bodies, extracted out of `billing.client.ts` (loc-guard — that file was already near
4
+ * the 300-line threshold). `BillingClient`'s own methods are thin delegations into these plain
5
+ * functions, same split `tasks-attachments.client.ts` established for `AdminTasksClient`.
6
+ */
7
+ import type { HttpClient } from '../transport/http-client.js';
8
+ import type { BinaryClient, BinaryDownloadResult } from '../transport/binary-client.js';
9
+ import type { InvoiceDetailDto, InvoiceListItemDto, PaymentLinkInput, PaymentLinkResultDto, PayoutListItemDto, VendorInvoiceListFilter, VendorPayoutListFilter } from './billing-invoice-list.types.js';
10
+ /** GET /billing-accounts/{id}/invoices — one billing account's own invoice list (AC-23). */
11
+ export declare function accountInvoices(http: HttpClient, billingAccountId: string): Promise<InvoiceListItemDto[]>;
12
+ /** GET /admin/invoices — vendor cross-account overview, filterable (AC-25). */
13
+ export declare function vendorInvoices(http: HttpClient, filter?: VendorInvoiceListFilter): Promise<InvoiceListItemDto[]>;
14
+ /** GET /admin/invoices/export — same filter, CSV (AC-25). Needs the binary transport — throws
15
+ * if not configured, same guard B302's `downloadAttachment` uses. */
16
+ export declare function vendorInvoicesExport(binary: BinaryClient | undefined, filter?: VendorInvoiceListFilter): Promise<BinaryDownloadResult>;
17
+ /** GET /admin/invoices/{id} — vendor invoice detail + payment-event timeline (AC-25). */
18
+ export declare function vendorInvoiceDetail(http: HttpClient, invoiceId: string): Promise<InvoiceDetailDto>;
19
+ /** GET /admin/payouts — vendor payout view with per-payout BT attribution (AC-26). */
20
+ export declare function vendorPayouts(http: HttpClient, filter?: VendorPayoutListFilter): Promise<PayoutListItemDto[]>;
21
+ /** POST /billing-accounts/{id}/payment-link — pay an invoice or set up a payment method, one
22
+ * unified endpoint (AC-24). */
23
+ export declare function createPaymentLink(http: HttpClient, billingAccountId: string, input: PaymentLinkInput): Promise<PaymentLinkResultDto>;
24
+ /** GET /invoices/{id}/pdf — the archived invoice/credit-note PDF (AC-23/AC-31). Serves ONLY the
25
+ * F574 archive (F710/DOM-29), never a live re-render (Worker A's download-route contract). */
26
+ export declare function downloadInvoicePdf(binary: BinaryClient | undefined, invoiceId: string): Promise<BinaryDownloadResult>;
27
+ //# sourceMappingURL=billing-invoice-list.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-invoice-list.client.d.ts","sourceRoot":"","sources":["../../src/clients/billing-invoice-list.client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACvF,OAAO,KAAK,EACR,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACzB,MAAM,iCAAiC,CAAA;AAGxC,4FAA4F;AAC5F,wBAAgB,eAAe,CAC3B,IAAI,EAAE,UAAU,EAChB,gBAAgB,EAAE,MAAM,GACzB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAI/B;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAC1B,IAAI,EAAE,UAAU,EAChB,MAAM,CAAC,EAAE,uBAAuB,GACjC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAG/B;AAED;sEACsE;AACtE,wBAAgB,oBAAoB,CAChC,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,MAAM,CAAC,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC,CAI/B;AAED,yFAAyF;AACzF,wBAAgB,mBAAmB,CAC/B,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAE3B;AAED,sFAAsF;AACtF,wBAAgB,aAAa,CACzB,IAAI,EAAE,UAAU,EAChB,MAAM,CAAC,EAAE,sBAAsB,GAChC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAG9B;AAED;gCACgC;AAChC,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,UAAU,EAChB,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,gBAAgB,GACxB,OAAO,CAAC,oBAAoB,CAAC,CAK/B;AAED;+FAC+F;AAC/F,wBAAgB,kBAAkB,CAC9B,MAAM,EAAE,YAAY,GAAG,SAAS,EAChC,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,CAAC,CAG/B"}
@@ -0,0 +1,40 @@
1
+ import { vendorInvoiceQuery, vendorPayoutQuery } from './billing-invoice-list-query.js';
2
+ /** GET /billing-accounts/{id}/invoices — one billing account's own invoice list (AC-23). */
3
+ export function accountInvoices(http, billingAccountId) {
4
+ return http.get(`/billing-accounts/${encodeURIComponent(billingAccountId)}/invoices`);
5
+ }
6
+ /** GET /admin/invoices — vendor cross-account overview, filterable (AC-25). */
7
+ export function vendorInvoices(http, filter) {
8
+ const qs = vendorInvoiceQuery(filter);
9
+ return http.get(`/admin/invoices${qs ? `?${qs}` : ''}`);
10
+ }
11
+ /** GET /admin/invoices/export — same filter, CSV (AC-25). Needs the binary transport — throws
12
+ * if not configured, same guard B302's `downloadAttachment` uses. */
13
+ export function vendorInvoicesExport(binary, filter) {
14
+ if (!binary)
15
+ throw new Error('BillingClient: binary transport not configured');
16
+ const qs = vendorInvoiceQuery(filter);
17
+ return binary.download(`/admin/invoices/export${qs ? `?${qs}` : ''}`);
18
+ }
19
+ /** GET /admin/invoices/{id} — vendor invoice detail + payment-event timeline (AC-25). */
20
+ export function vendorInvoiceDetail(http, invoiceId) {
21
+ return http.get(`/admin/invoices/${encodeURIComponent(invoiceId)}`);
22
+ }
23
+ /** GET /admin/payouts — vendor payout view with per-payout BT attribution (AC-26). */
24
+ export function vendorPayouts(http, filter) {
25
+ const qs = vendorPayoutQuery(filter);
26
+ return http.get(`/admin/payouts${qs ? `?${qs}` : ''}`);
27
+ }
28
+ /** POST /billing-accounts/{id}/payment-link — pay an invoice or set up a payment method, one
29
+ * unified endpoint (AC-24). */
30
+ export function createPaymentLink(http, billingAccountId, input) {
31
+ return http.post(`/billing-accounts/${encodeURIComponent(billingAccountId)}/payment-link`, input);
32
+ }
33
+ /** GET /invoices/{id}/pdf — the archived invoice/credit-note PDF (AC-23/AC-31). Serves ONLY the
34
+ * F574 archive (F710/DOM-29), never a live re-render (Worker A's download-route contract). */
35
+ export function downloadInvoicePdf(binary, invoiceId) {
36
+ if (!binary)
37
+ throw new Error('BillingClient: binary transport not configured');
38
+ return binary.download(`/invoices/${encodeURIComponent(invoiceId)}/pdf`);
39
+ }
40
+ //# sourceMappingURL=billing-invoice-list.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-invoice-list.client.js","sourceRoot":"","sources":["../../src/clients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C,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAC/E,CAAC;AAED;gCACgC;AAChC,MAAM,UAAU,iBAAiB,CAC7B,IAAgB,EAChB,gBAAwB,EACxB,KAAuB;IAEvB,OAAO,IAAI,CAAC,IAAI,CACZ,qBAAqB,kBAAkB,CAAC,gBAAgB,CAAC,eAAe,EACxE,KAAK,CACR,CAAA;AACL,CAAC;AAED;+FAC+F;AAC/F,MAAM,UAAU,kBAAkB,CAC9B,MAAgC,EAChC,SAAiB;IAEjB,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;IAC9E,OAAO,MAAM,CAAC,QAAQ,CAAC,aAAa,kBAAkB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;AAC5E,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * F574/AC-23/AC-24/AC-25/AC-26 — wire DTOs for the customer invoice list, the vendor
3
+ * cross-account invoice overview + CSV export, the vendor payout view, and the unified
4
+ * payment-link endpoint. Shapes mirror `services/api/src/routes/billing-account-invoices.ts`,
5
+ * `routes/admin/billing-invoices-admin.ts`, `routes/admin/billing-payouts-admin.ts` and
6
+ * `routes/billing-payment-link.ts` exactly (see each route's own zod schema).
7
+ */
8
+ export type InvoicePaymentStatusValue = 'open' | 'paid' | 'overdue' | 'refunded' | 'disputed' | 'credited';
9
+ /** One row of `GET /billing-accounts/{id}/invoices` (AC-23) or `GET /admin/invoices` (AC-25) —
10
+ * same shape (`toInvoiceListDto`), so the customer list and the vendor overview share ONE DTO. */
11
+ export interface InvoiceListItemDto {
12
+ id: string;
13
+ number: string;
14
+ billingAccountId: string;
15
+ billingAccountHolderType: 'organization' | 'person';
16
+ recipientName: string;
17
+ issuedAt: string;
18
+ billingDate: string;
19
+ status: InvoicePaymentStatusValue;
20
+ paidAt: string | null;
21
+ amountRefundedChf: string;
22
+ creditedAmountChf: string;
23
+ totalNetChf: string;
24
+ totalVatChf: string;
25
+ totalGrossChf: string;
26
+ stripeInvoiceId: string | null;
27
+ hasPendingCreditNote: boolean;
28
+ }
29
+ /** Filter for `GET /admin/invoices` / `GET /admin/invoices/export` (AC-25). */
30
+ export interface VendorInvoiceListFilter {
31
+ status?: InvoicePaymentStatusValue[];
32
+ billingAccountId?: string;
33
+ issuedFrom?: string;
34
+ issuedTo?: string;
35
+ /** AC-25 — the "billing-account-name" filter: a free-text search over the invoice row's
36
+ * own recipient-name snapshot. */
37
+ q?: string;
38
+ }
39
+ /** One row of the detail view's payment-event timeline (`GET /admin/invoices/{id}`, AC-25). */
40
+ export interface PaymentEventDto {
41
+ id: string;
42
+ kind: string;
43
+ occurredAt: string;
44
+ amountChf: string | null;
45
+ stripeEventId: string;
46
+ }
47
+ /** `GET /admin/invoices/{id}` (AC-25) — the list-row shape plus the payment-event timeline. */
48
+ export interface InvoiceDetailDto extends InvoiceListItemDto {
49
+ events: PaymentEventDto[];
50
+ }
51
+ export type PayoutBtTypeValue = 'charge' | 'refund' | 'payment' | 'adjustment' | 'stripe_fee';
52
+ export type PayoutStatusValue = 'paid' | 'failed' | 'in_transit' | 'pending' | 'canceled';
53
+ export type PayoutReconciliationStatusValue = 'balanced' | 'mismatch';
54
+ export interface PayoutBalanceTransactionDto {
55
+ stripeBalanceTransactionId: string;
56
+ type: PayoutBtTypeValue;
57
+ grossAmountChf: string;
58
+ feeAmountChf: string;
59
+ netAmountChf: string;
60
+ invoiceId: string | null;
61
+ invoiceNumber: string | null;
62
+ }
63
+ /** One row of `GET /admin/payouts` (AC-26). */
64
+ export interface PayoutListItemDto {
65
+ stripePayoutId: string;
66
+ arrivalDate: string;
67
+ status: PayoutStatusValue;
68
+ reconciliationStatus: PayoutReconciliationStatusValue | null;
69
+ grossChf: string;
70
+ feeChf: string;
71
+ refundedChf: string;
72
+ netChf: string;
73
+ amountChf: string;
74
+ items: PayoutBalanceTransactionDto[];
75
+ }
76
+ /** Filter for `GET /admin/payouts` (AC-26). */
77
+ export interface VendorPayoutListFilter {
78
+ arrivalFrom?: string;
79
+ arrivalTo?: string;
80
+ }
81
+ /** Body of `POST /billing-accounts/{id}/payment-link` (AC-24). */
82
+ export interface PaymentLinkInput {
83
+ purpose: 'pay_invoice' | 'setup_payment_method';
84
+ invoiceId?: string;
85
+ locale: 'de' | 'en';
86
+ successUrl: string;
87
+ cancelUrl: string;
88
+ returnUrl: string;
89
+ }
90
+ export interface PaymentLinkResultDto {
91
+ url: string;
92
+ expiresAt?: string;
93
+ }
94
+ //# sourceMappingURL=billing-invoice-list.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-invoice-list.types.d.ts","sourceRoot":"","sources":["../../src/clients/billing-invoice-list.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,yBAAyB,GAC/B,MAAM,GACN,MAAM,GACN,SAAS,GACT,UAAU,GACV,UAAU,GACV,UAAU,CAAA;AAEhB;mGACmG;AACnG,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,MAAM,CAAA;IACxB,wBAAwB,EAAE,cAAc,GAAG,QAAQ,CAAA;IACnD,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,yBAAyB,CAAA;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,oBAAoB,EAAE,OAAO,CAAA;CAChC;AAED,+EAA+E;AAC/E,MAAM,WAAW,uBAAuB;IACpC,MAAM,CAAC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;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,2BAA2B,EAAE,CAAA;CACvC;AAED,+CAA+C;AAC/C,MAAM,WAAW,sBAAsB;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,aAAa,GAAG,sBAAsB,CAAA;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * F574/AC-23/AC-24/AC-25/AC-26 — wire DTOs for the customer invoice list, the vendor
3
+ * cross-account invoice overview + CSV export, the vendor payout view, and the unified
4
+ * payment-link endpoint. Shapes mirror `services/api/src/routes/billing-account-invoices.ts`,
5
+ * `routes/admin/billing-invoices-admin.ts`, `routes/admin/billing-payouts-admin.ts` and
6
+ * `routes/billing-payment-link.ts` exactly (see each route's own zod schema).
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=billing-invoice-list.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-invoice-list.types.js","sourceRoot":"","sources":["../../src/clients/billing-invoice-list.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,64 @@
1
+ /** F573/AC-22 — `GET /billing/invoices/{id}` response shape. */
2
+ export interface InvoiceDocumentRecipientDto {
3
+ holderType: 'organization' | 'person';
4
+ holderId: string;
5
+ name: string;
6
+ legalName: string | null;
7
+ address: {
8
+ street: string;
9
+ houseNumber: string | null;
10
+ streetExtra: string | null;
11
+ postalCode: string;
12
+ city: string;
13
+ region: string | null;
14
+ countryCode: string;
15
+ };
16
+ countryCode: string;
17
+ vatId: string | null;
18
+ vatScheme: 'CH' | 'EU' | 'LI' | 'GB' | null;
19
+ vatCountry: string | null;
20
+ invoiceEmails: string[];
21
+ billingContact: {
22
+ personId: string;
23
+ displayName: string;
24
+ } | null;
25
+ }
26
+ export interface InvoiceDocumentLineDto {
27
+ lineNo: number;
28
+ positionKind: 'advance_floor' | 'true_up' | 'credit_brought_forward' | 'credit_carried_forward';
29
+ tier: 'community' | 'solo' | 'org_contributor' | 'org_reviewer' | 'viewer' | null;
30
+ isCompanyMinimum: boolean;
31
+ seatCount: number | null;
32
+ description: string;
33
+ priceBasis: 'net' | 'gross' | null;
34
+ netAmountChf: string;
35
+ vatCode: string;
36
+ vatRate: string;
37
+ vatAmountChf: string;
38
+ grossAmountChf: string;
39
+ }
40
+ export interface InvoiceDocumentDto {
41
+ id: string;
42
+ kind: 'invoice' | 'credit_note';
43
+ number: string;
44
+ billingAccountId: string;
45
+ billingKind: 'first' | 'reactivation' | 'monthly' | null;
46
+ billingDate: string;
47
+ issuedAt: string;
48
+ creditedInvoiceId: string | null;
49
+ creditReason: string | null;
50
+ creditOrigin: 'vendor' | 'stripe_refund' | 'stripe_dispute' | null;
51
+ recipient: InvoiceDocumentRecipientDto;
52
+ vatCode: string;
53
+ vatNote: string | null;
54
+ lines: InvoiceDocumentLineDto[];
55
+ totalNetChf: string;
56
+ totalVatChf: string;
57
+ totalGrossChf: string;
58
+ creditAppliedChf: string;
59
+ creditCarriedChf: string;
60
+ amountDueChf: string;
61
+ stripeInvoiceId: string | null;
62
+ stripeSyncStatus: string | null;
63
+ }
64
+ //# sourceMappingURL=billing-invoice.types.d.ts.map