@insurance-broker/api-client 5.9.0 → 5.10.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 +31 -15
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -45,7 +45,7 @@ export interface paths {
45
45
  *
46
46
  * **What a key does not do**: it assumes the retrying client owns it. Two people at two desks recording the same instalment invent two keys, and both charges are raised (ADR-0042 §19).
47
47
  *
48
- * **Two different things answer `409` here.** A key collision is settled — retrying it can only fail again — and carries no `retryable` marker. The group's concurrency conflict is the other one and says it is retryable. Branch on that, not on the status.
48
+ * **Two different things answer `409` here.** A key collision is settled — retrying it can only fail again — carries no `retryable` marker, and is typed `urn:brokerplatform:problem:idempotency-key-reused` (#593). The group's concurrency conflict is the other one, `urn:brokerplatform:problem:concurrency-conflict`, and says it is retryable. Branch on the `type`, not on the status.
49
49
  */
50
50
  post: operations["RaiseObligation"];
51
51
  delete?: never;
@@ -91,7 +91,7 @@ export interface paths {
91
91
  * Withdraw an obligation raised in error
92
92
  * @description Records that the charge should never have existed. **This is not a write-off**: writing off records that a real debt will not be collected, which is a decision with money behind it and a reason attached, and it arrives in step 9.7. Collapsing the two would make "how much did this broker forgive" unanswerable.
93
93
  *
94
- * Cancelling starts the record's retention clock (ADR-0038 §2), so it is refused a second time rather than silently re-stamped — re-stamping would move the anchor of a record that concluded earlier.
94
+ * Cancelling starts the record's retention clock (ADR-0038 §2), so it is refused a second time rather than silently re-stamped — re-stamping would move the anchor of a record that concluded earlier. That refusal is `409` `urn:brokerplatform:problem:obligation-concluded` (#593), the type recording a payment against a concluded charge answers, and it is not retryable. A `409` can also be the platform's concurrency conflict, `urn:brokerplatform:problem:concurrency-conflict` with `retryable: true`.
95
95
  */
96
96
  post: operations["CancelObligation"];
97
97
  delete?: never;
@@ -119,7 +119,9 @@ export interface paths {
119
119
  *
120
120
  * **It is why an obligation nobody will chase is not kept for ever.** An unsettled charge has no retention anchor and is therefore kept (ADR-0038 section 2); writing one off is the event that starts its clock.
121
121
  *
122
- * Refused on a charge that has already concluded — a settled one was paid and a cancelled one was never owed — rather than silently re-stamping an anchor.
122
+ * Refused on a charge that has already concluded — a settled one was paid and a cancelled one was never owed — rather than silently re-stamping an anchor. That refusal is `409` `urn:brokerplatform:problem:obligation-concluded` (#593), and it is not retryable. A `409` can also be the platform's concurrency conflict, `urn:brokerplatform:problem:concurrency-conflict` with `retryable: true`.
123
+ *
124
+ * A missing or over-long reason is `400` on `Reason`, the member's own name, which is the platform's majority convention; WorkflowComms' device and preference routes are the known exception (#613). It was `reason` until client 5.10.0 (#593).
123
125
  */
124
126
  post: operations["WriteOffObligation"];
125
127
  delete?: never;
@@ -159,7 +161,7 @@ export interface paths {
159
161
  *
160
162
  * **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
163
  *
162
- * **The key collision `409` is settled**: retrying it can only fail again, and it carries no `retryable` marker.
164
+ * **The key collision `409` is settled**: retrying it can only fail again, it carries no `retryable` marker, and it is typed `urn:brokerplatform:problem:idempotency-key-reused` (#593).
163
165
  */
164
166
  post: operations["DraftInvoice"];
165
167
  delete?: never;
@@ -185,7 +187,7 @@ export interface paths {
185
187
  *
186
188
  * There is **no ordinal field**. The position is derived from the lines already present.
187
189
  *
188
- * Refused once the invoice is issued: issue is a one-way door.
190
+ * Refused once the invoice is issued: issue is a one-way door. That refusal, and the same one for a discarded invoice, is `409` `urn:brokerplatform:problem:invoice-not-a-draft` (#593), which is not retryable. A `409` can also be the platform's concurrency conflict, `urn:brokerplatform:problem:concurrency-conflict` with `retryable: true`.
189
191
  */
190
192
  post: operations["AddInvoiceLine"];
191
193
  delete?: never;
@@ -210,6 +212,8 @@ export interface paths {
210
212
  * An invoice with **no lines is refused**: that would be a demand for nothing. A broker charging nil says so with a zero-rated line.
211
213
  *
212
214
  * Issuing twice is a `409`, and it is not retryable: the invoice is already issued and reading it back is the resolution.
215
+ *
216
+ * **Each `409` carries a `type`** (#593): `urn:brokerplatform:problem:invoice-not-a-draft` (already issued or discarded; read it back), `urn:brokerplatform:problem:invoice-has-no-lines` (still a draft; add a line and issue again), and the platform's `urn:brokerplatform:problem:concurrency-conflict` with `retryable: true`.
213
217
  */
214
218
  post: operations["IssueInvoice"];
215
219
  delete?: never;
@@ -245,11 +249,15 @@ export interface paths {
245
249
  *
246
250
  * Refused against a **draft** invoice: a draft was never demanded of anybody, so it is discarded rather than credited.
247
251
  *
252
+ * **Each `409` carries a `type`** (#593): `urn:brokerplatform:problem:invoice-not-issued` (a draft or a discarded invoice), `urn:brokerplatform:problem:credit-note-exceeds-invoice` (credit less, counting the notes already issued) and `urn:brokerplatform:problem:idempotency-key-reused`. None is retryable.
253
+ *
254
+ * **Validation keys are the members' own names** — `Reason`, `Lines`, `IdempotencyKey` — which is the platform's majority convention; WorkflowComms' device and preference routes are the known exception (#613). They were camel-cased until client 5.10.0 (#593).
255
+ *
248
256
  * **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
257
  *
250
258
  * **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
259
  *
252
- * **The key collision `409` is settled**: retrying it can only fail again, and it carries no `retryable` marker.
260
+ * **The key collision `409` is settled**: retrying it can only fail again, it carries no `retryable` marker, and it is typed `urn:brokerplatform:problem:idempotency-key-reused` (#593).
253
261
  */
254
262
  post: operations["IssueCreditNote"];
255
263
  delete?: never;
@@ -271,7 +279,7 @@ export interface paths {
271
279
  * Abandon a draft that should never have been raised
272
280
  * @description Records that this demand was never made — the customer never saw it and owes nothing on account of it. **Only a draft may be discarded.** An issued invoice that should not have been issued is corrected by a credit note, because the customer has seen the demand and BR-010 will not have it silently withdrawn.
273
281
  *
274
- * Discarding starts the record's retention clock (ADR-0038 section 2), so it is refused a second time rather than silently re-stamped.
282
+ * Discarding starts the record's retention clock (ADR-0038 section 2), so it is refused a second time rather than silently re-stamped. Refusing an invoice that is not a draft is `409` `urn:brokerplatform:problem:invoice-not-a-draft` (#593), which is not retryable. A `409` can also be the platform's concurrency conflict, `urn:brokerplatform:problem:concurrency-conflict` with `retryable: true`.
275
283
  */
276
284
  post: operations["DiscardInvoice"];
277
285
  delete?: never;
@@ -456,6 +464,10 @@ export interface paths {
456
464
  * **Approval is an act and not a status.** The payment's status set is untouched: collapsing the two would make *"recorded but not yet approved"* and *"the money is definitely there"* the same value.
457
465
  *
458
466
  * There is no un-approval. A payment approved in error is corrected by a reversal, which is step 9.7's, for the reason BR-010 gives about every financially significant record.
467
+ *
468
+ * **A reversed payment cannot be approved** (#604): the reversal records that the money did not arrive, so there is nothing to take responsibility for.
469
+ *
470
+ * **Each `409` carries a `type`**: `urn:brokerplatform:problem:payment-already-approved`, `urn:brokerplatform:problem:payment-already-reversed`, `urn:brokerplatform:problem:payment-self-approval` (a colleague must approve it), `urn:brokerplatform:problem:payment-approval-unevidenced` (file evidence and wait for the scan), and the platform's `urn:brokerplatform:problem:concurrency-conflict` with `retryable: true`. Only the last is worth retrying as it stands.
459
471
  */
460
472
  post: operations["ApprovePayment"];
461
473
  delete?: never;
@@ -587,7 +599,7 @@ export interface paths {
587
599
  *
588
600
  * **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.
589
601
  *
590
- * **The key collision `409` is settled**: retrying it can only fail again, and it carries no `retryable` marker.
602
+ * **The key collision `409` is settled**: retrying it can only fail again, it carries no `retryable` marker, and it is typed `urn:brokerplatform:problem:idempotency-key-reused` (#593).
591
603
  */
592
604
  post: operations["ProduceStatement"];
593
605
  delete?: never;
@@ -811,7 +823,7 @@ export interface paths {
811
823
  * Add a way this broker's customers pay
812
824
  * @description #530. `code` is a stable identifier — lower-case letters, digits and hyphens, at most 40 characters — unique within this broker and never changed. `label` is what customers read, at most 80 characters, and can be changed later.
813
825
  *
814
- * **A code is never reused**, even after its method is retired, because payments recorded against the method carry it as their `source`. A code already taken is `409`.
826
+ * **A code is never reused**, even after its method is retired, because payments recorded against the method carry it as their `source`. A code already taken is `409` `urn:brokerplatform:problem:payment-method-code-taken` (#604), which is not retryable: choose another code.
815
827
  */
816
828
  post: operations["CreatePaymentMethod"];
817
829
  delete?: never;
@@ -873,7 +885,7 @@ export interface paths {
873
885
  put?: never;
874
886
  /**
875
887
  * Stop a payment method being chosen for new payments
876
- * @description #530. **One-way.** A retired method cannot be chosen when recording a payment, keeps labelling the payments already recorded against it, and keeps its code, which is never given to another method. Retiring one already retired is `409`. A `409` can also be the platform's concurrency conflict, with `retryable: true`, when another write changed the method after it was read.
888
+ * @description #530. **One-way.** A retired method cannot be chosen when recording a payment, keeps labelling the payments already recorded against it, and keeps its code, which is never given to another method. Retiring one already retired is `409` `urn:brokerplatform:problem:payment-method-retired` (#604), which is not retryable: the method is already retired. A `409` can also be the platform's concurrency conflict, `urn:brokerplatform:problem:concurrency-conflict` with `retryable: true`, when another write changed the method after it was read.
877
889
  */
878
890
  post: operations["RetirePaymentMethod"];
879
891
  delete?: never;
@@ -7809,7 +7821,7 @@ export interface components {
7809
7821
  coverStart: null | string;
7810
7822
  /** Format: date */
7811
7823
  coverEnd: null | string;
7812
- status: string;
7824
+ status: components["schemas"]["InvoiceStatus"];
7813
7825
  /** Format: date-time */
7814
7826
  draftedAtUtc: string;
7815
7827
  /** Format: date-time */
@@ -7820,6 +7832,8 @@ export interface components {
7820
7832
  retentionAnchorAtUtc: null | string;
7821
7833
  lines: components["schemas"]["InvoiceLineResponse"][];
7822
7834
  };
7835
+ /** @enum {string} */
7836
+ InvoiceStatus: "Draft" | "Issued" | "Discarded";
7823
7837
  InvoiceSummaryResponse: {
7824
7838
  /** Format: uuid */
7825
7839
  id: string;
@@ -7836,7 +7850,7 @@ export interface components {
7836
7850
  coverStart: null | string;
7837
7851
  /** Format: date */
7838
7852
  coverEnd: null | string;
7839
- status: string;
7853
+ status: components["schemas"]["InvoiceStatus"];
7840
7854
  /** Format: date-time */
7841
7855
  draftedAtUtc: string;
7842
7856
  /** Format: date-time */
@@ -8043,13 +8057,15 @@ export interface components {
8043
8057
  /** Format: date */
8044
8058
  dueOn: string;
8045
8059
  description: string;
8046
- status: string;
8060
+ status: components["schemas"]["ObligationStatus"];
8047
8061
  /** Format: date-time */
8048
8062
  raisedAtUtc: string;
8049
8063
  /** Format: date-time */
8050
8064
  retentionAnchorAtUtc: null | string;
8051
8065
  writeOffReason: null | string;
8052
8066
  };
8067
+ /** @enum {string} */
8068
+ ObligationStatus: "Outstanding" | "Cancelled" | "Settled" | "WrittenOff";
8053
8069
  ObligationSummaryResponse: {
8054
8070
  /** Format: uuid */
8055
8071
  id: string;
@@ -8069,7 +8085,7 @@ export interface components {
8069
8085
  /** Format: date */
8070
8086
  dueOn: string;
8071
8087
  description: string;
8072
- status: string;
8088
+ status: components["schemas"]["ObligationStatus"];
8073
8089
  };
8074
8090
  OfferedFormResponse: {
8075
8091
  /** Format: uuid */
@@ -9402,7 +9418,7 @@ export interface components {
9402
9418
  dueOn: string;
9403
9419
  /** Format: date-time */
9404
9420
  raisedAtUtc: string;
9405
- status: string;
9421
+ status: components["schemas"]["ObligationStatus"];
9406
9422
  };
9407
9423
  StatementPage: {
9408
9424
  items: components["schemas"]["StatementSummaryResponse"][];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "5.9.0",
3
+ "version": "5.10.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,