@insurance-broker/api-client 5.7.0 → 5.8.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 +41 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -152,6 +152,14 @@ export interface paths {
152
152
  * The **currency is not a field** — it is the policy's own, so BR-008's pair travels from one source. The **payer is not a field** either: an invoice is addressed to whoever owns the policy.
153
153
  *
154
154
  * A draft has **no total**. The total is fixed once, at issue, from the lines.
155
+ *
156
+ * A replay answers the invoice **as it is now**, lines and status included: a draft that has since gained lines, been issued or been discarded is still the one invoice the key drafted, so its body can differ from the first response's, `status` included.
157
+ *
158
+ * **`idempotencyKey` is optional, and it is what makes a retry after a lost response safe.** Without one, every request writes a new invoice. With one, a repeat carrying a key already used **answers the original invoice with the same `201 Created` and the same `Location`** and writes nothing; a repeat carrying that key with a **different** policy is a `409` and writes nothing. The key is trimmed, at most 200 characters, blank is no key, and it belongs to this broker alone.
159
+ *
160
+ * **A key is honoured for 30 days from the moment the invoice was written, and then stops being honoured** — after that the same key is one this platform has never seen. Mint a fresh key per intended invoice; do not recycle one.
161
+ *
162
+ * **The key collision `409` is settled**: retrying it can only fail again, and it carries no `retryable` marker.
155
163
  */
156
164
  post: operations["DraftInvoice"];
157
165
  delete?: never;
@@ -236,6 +244,12 @@ export interface paths {
236
244
  * **It may not credit more than the invoice demanded**, counting what earlier credit notes already credit. Crediting past the demand is a payment out rather than a correction, and a refund is its own record (WRK-004, Phase 2).
237
245
  *
238
246
  * Refused against a **draft** invoice: a draft was never demanded of anybody, so it is discarded rather than credited.
247
+ *
248
+ * **A retried credit note without a key credits the customer twice**, so send one. **`idempotencyKey` is optional, and it is what makes a retry after a lost response safe.** Without one, every request writes a new credit note. With one, a repeat carrying a key already used **answers the original credit note with the same `201 Created` and the same `Location`** and writes nothing; a repeat carrying that key with a **different** invoice, reason or set of lines is a `409` and writes nothing. The key is trimmed, at most 200 characters, blank is no key, and it belongs to this broker alone.
249
+ *
250
+ * **A key is honoured for 30 days from the moment the credit note was written, and then stops being honoured** — after that the same key is one this platform has never seen. Mint a fresh key per intended credit note; do not recycle one.
251
+ *
252
+ * **The key collision `409` is settled**: retrying it can only fail again, and it carries no `retryable` marker.
239
253
  */
240
254
  post: operations["IssueCreditNote"];
241
255
  delete?: never;
@@ -562,6 +576,12 @@ export interface paths {
562
576
  * **One currency per statement.** A charge carries its own currency, and a balance in two of them is not a number. A customer owing in two currencies gets two statements.
563
577
  *
564
578
  * **Nothing about money is stored on the row.** There is no balance column: every figure is derived from the obligations and payments the statement renders, bounded by its period and by the instant it was produced.
579
+ *
580
+ * **`idempotencyKey` is optional, and it is what makes a retry after a lost response safe.** Without one, every request produces a statement. With one, a repeat carrying a key already used **answers the original statement with the same `201 Created` and the same `Location`** and produces nothing; a repeat carrying that key with a **different** customer, currency or period is a `409` and produces nothing. The key is trimmed, at most 200 characters, blank is no key, and it belongs to this broker alone.
581
+ *
582
+ * **A key is honoured for 30 days from the moment the statement was produced, and then stops being honoured** — after that the same key is one this platform has never seen. Mint a fresh key per intended statement; do not recycle one.
583
+ *
584
+ * **The key collision `409` is settled**: retrying it can only fail again, and it carries no `retryable` marker.
565
585
  */
566
586
  post: operations["ProduceStatement"];
567
587
  delete?: never;
@@ -7219,6 +7239,7 @@ export interface components {
7219
7239
  DraftInvoiceRequest: {
7220
7240
  /** Format: uuid */
7221
7241
  policyId: string;
7242
+ idempotencyKey?: null | string;
7222
7243
  };
7223
7244
  EmergencyContactDetailsResponse: {
7224
7245
  providerName: string;
@@ -7820,6 +7841,7 @@ export interface components {
7820
7841
  IssueCreditNoteRequest: {
7821
7842
  reason: string;
7822
7843
  lines: components["schemas"]["CreditNoteLineRequest"][];
7844
+ idempotencyKey?: null | string;
7823
7845
  };
7824
7846
  IssuedCustomerInvitationResponse: {
7825
7847
  /** Format: uuid */
@@ -8608,6 +8630,7 @@ export interface components {
8608
8630
  periodStart: string;
8609
8631
  /** Format: date */
8610
8632
  periodEnd: string;
8633
+ idempotencyKey?: null | string;
8611
8634
  };
8612
8635
  ProductCategoryResponse: {
8613
8636
  /** Format: uuid */
@@ -10133,6 +10156,15 @@ export interface operations {
10133
10156
  "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
10134
10157
  };
10135
10158
  };
10159
+ /** @description Conflict. A type of urn:brokerplatform:problem:concurrency-conflict means someone else changed the record first and nothing was written: read it again and decide again. Any other type is a conflict this operation decided itself, and retrying it unchanged will not help. */
10160
+ 409: {
10161
+ headers: {
10162
+ [name: string]: unknown;
10163
+ };
10164
+ content: {
10165
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
10166
+ };
10167
+ };
10136
10168
  };
10137
10169
  };
10138
10170
  AddInvoiceLine: {
@@ -10844,6 +10876,15 @@ export interface operations {
10844
10876
  "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
10845
10877
  };
10846
10878
  };
10879
+ /** @description Conflict. A type of urn:brokerplatform:problem:concurrency-conflict means someone else changed the record first and nothing was written: read it again and decide again. Any other type is a conflict this operation decided itself, and retrying it unchanged will not help. */
10880
+ 409: {
10881
+ headers: {
10882
+ [name: string]: unknown;
10883
+ };
10884
+ content: {
10885
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
10886
+ };
10887
+ };
10847
10888
  /** @description Too Many Requests (ADR-0050). This operation renders, produces or exports, and the caller's own budget for such work, or their organisation's, is spent. Nothing was done: no document, statement, export or receipt exists for this request. Wait the number of seconds in Retry-After (also in retryAfterSeconds) before trying again. */
10848
10889
  429: {
10849
10890
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "5.7.0",
3
+ "version": "5.8.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,