@insurance-broker/api-client 5.6.0 → 5.7.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 (2) hide show
  1. package/dist/schema.d.ts +80 -1
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -66,6 +66,8 @@ export interface paths {
66
66
  * @description PAY-002. Another broker's obligation and another customer's are invisible here rather than refused: the tenant and owner query filters remove them before the read runs, so all three cases answer the same `404` (ADR-0008, ADR-0030).
67
67
  *
68
68
  * There is **no overdue field**. Whether an obligation is overdue is a comparison between its due date and the clock, and step 9.10's lists compute it at read time and return the day they measured against — ADR-0035 §4's rule, which forbids storing a status a date comparison answers.
69
+ *
70
+ * **`paid` and `balance` are computed as the response is written** (#595), by the same rule as the list. `paid` is read a moment after the charge itself, so a payment that lands in between can show in `paid` and `balance` before `status` reflects it; read again and the two agree. `balance` is not always `amount` less `paid`: a cancelled charge is owed nothing, so money paid against one leaves the customer in credit, and a written-off charge is owed what actually arrived and no more.
69
71
  */
70
72
  get: operations["GetObligation"];
71
73
  put?: never;
@@ -133,7 +135,15 @@ export interface paths {
133
135
  path?: never;
134
136
  cookie?: never;
135
137
  };
136
- get?: never;
138
+ /**
139
+ * List what this broker has invoiced, newest first
140
+ * @description ADR-0042 section 8, ADR-0031. Every invoice this broker has drafted — drafts, issued invoices and discarded drafts — **most recently drafted first**, ordered by `draftedAtUtc` and then `id`, both descending, and paged by cursor. The drafting instant is the key because it never changes: an invoice keeps its place in the walk when it is issued or discarded.
141
+ *
142
+ * `customerId`, `policyId` and `status` (`Draft`, `Issued`, `Discarded`) narrow the list and combine. **None of them is authorisation**: the broker whose invoices these are comes from the session, and naming another broker's customer selects nothing rather than refusing.
143
+ *
144
+ * A row carries no lines; `GET /invoices/{id}` returns one invoice with its lines. There is no total and no count: `nextCursor` is null at the end of the walk (ADR-0031 section 4). A cursor this endpoint did not issue is a `400`.
145
+ */
146
+ get: operations["ListInvoices"];
137
147
  put?: never;
138
148
  /**
139
149
  * Open a draft invoice against a policy
@@ -7750,6 +7760,10 @@ export interface components {
7750
7760
  amount: number | string;
7751
7761
  currency: string;
7752
7762
  };
7763
+ InvoicePage: {
7764
+ items: components["schemas"]["InvoiceSummaryResponse"][];
7765
+ nextCursor: null | string;
7766
+ };
7753
7767
  InvoiceResponse: {
7754
7768
  /** Format: uuid */
7755
7769
  id: string;
@@ -7777,6 +7791,32 @@ export interface components {
7777
7791
  retentionAnchorAtUtc: null | string;
7778
7792
  lines: components["schemas"]["InvoiceLineResponse"][];
7779
7793
  };
7794
+ InvoiceSummaryResponse: {
7795
+ /** Format: uuid */
7796
+ id: string;
7797
+ /** Format: uuid */
7798
+ customerId: string;
7799
+ /** Format: uuid */
7800
+ policyId: string;
7801
+ /** Format: uuid */
7802
+ productId: string;
7803
+ /** Format: double */
7804
+ premiumAmount: number | string;
7805
+ currency: string;
7806
+ /** Format: date */
7807
+ coverStart: null | string;
7808
+ /** Format: date */
7809
+ coverEnd: null | string;
7810
+ status: string;
7811
+ /** Format: date-time */
7812
+ draftedAtUtc: string;
7813
+ /** Format: date-time */
7814
+ issuedAtUtc: null | string;
7815
+ /** Format: double */
7816
+ totalAmount: null | number | string;
7817
+ /** Format: date-time */
7818
+ retentionAnchorAtUtc: null | string;
7819
+ };
7780
7820
  IssueCreditNoteRequest: {
7781
7821
  reason: string;
7782
7822
  lines: components["schemas"]["CreditNoteLineRequest"][];
@@ -7965,6 +8005,10 @@ export interface components {
7965
8005
  productId: string;
7966
8006
  /** Format: double */
7967
8007
  amount: number | string;
8008
+ /** Format: double */
8009
+ paid: number | string;
8010
+ /** Format: double */
8011
+ balance: number | string;
7968
8012
  currency: string;
7969
8013
  /** Format: date */
7970
8014
  dueOn: string;
@@ -10023,6 +10067,41 @@ export interface operations {
10023
10067
  };
10024
10068
  };
10025
10069
  };
10070
+ ListInvoices: {
10071
+ parameters: {
10072
+ query?: {
10073
+ customerId?: string;
10074
+ policyId?: string;
10075
+ status?: string;
10076
+ cursor?: string;
10077
+ limit?: number | string;
10078
+ };
10079
+ header?: never;
10080
+ path?: never;
10081
+ cookie?: never;
10082
+ };
10083
+ requestBody?: never;
10084
+ responses: {
10085
+ /** @description OK */
10086
+ 200: {
10087
+ headers: {
10088
+ [name: string]: unknown;
10089
+ };
10090
+ content: {
10091
+ "application/json": components["schemas"]["InvoicePage"];
10092
+ };
10093
+ };
10094
+ /** @description Bad Request */
10095
+ 400: {
10096
+ headers: {
10097
+ [name: string]: unknown;
10098
+ };
10099
+ content: {
10100
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
10101
+ };
10102
+ };
10103
+ };
10104
+ };
10026
10105
  DraftInvoice: {
10027
10106
  parameters: {
10028
10107
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "description": "Generated TypeScript client for the Insurance Broker Platform API. Do not edit by hand: regenerate with scripts/update-api-contract.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,