@insurance-broker/api-client 5.9.0 → 5.11.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 +40 -16
  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;
@@ -323,7 +331,9 @@ export interface paths {
323
331
  *
324
332
  * The currency is **not** a field: it is the obligation's, held by a foreign key rather than by this handler. Nil is refused — a payment of nothing is nothing having arrived.
325
333
  *
326
- * **Name a payment method or type a source, exactly one** (#530). `paymentMethodId` is one of this broker's active payment methods: its code becomes the payment's `source`, and customers see the method's label. `source` alone is free text, as before, and customers see it as typed. Both, neither, a retired method or another broker's method are refused with `400` and nothing is recorded. A typed source containing a control character is refused with `400` on `Source` (#601).
334
+ * **Name a payment method or type a source, exactly one** (#530). `paymentMethodId` is one of this broker's active payment methods: its code becomes the payment's `source`, and customers see the method's label. `source` alone is free text, as before, and customers see it as typed. Both, neither, a retired method or another broker's method are refused with `400` and nothing is recorded. A typed source containing a character that does not print as text is refused with `400` on `Source`, and a reference with one on `ExternalReference` (#601): a control or format character (a direction override, a zero-width character), U+2028 or U+2029, a private-use or unassigned code point, or an unpaired surrogate. A payment stored with one before #601 is refused the same way when its text is sent again.
335
+ *
336
+ * **A typed source is stored in Unicode normalisation form C** (#601), so a composed and a decomposed spelling of the same words are one source and the same money cannot be recorded once under each. The response carries the stored spelling. The reference is stored as sent.
327
337
  *
328
338
  * **Each `409` carries a `type`** (#593): `urn:brokerplatform:problem:payment-already-recorded` (the same money is already recorded; the problem names the payment), `urn:brokerplatform:problem:payment-reference-amount-conflict` (that reference is recorded for a different amount), `urn:brokerplatform:problem:obligation-concluded` (the charge is settled, cancelled or written off, so nothing can be paid against it; nothing is recorded), and the platform's `urn:brokerplatform:problem:concurrency-conflict` with `retryable: true`. Only the last is worth retrying.
329
339
  */
@@ -456,6 +466,10 @@ export interface paths {
456
466
  * **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
467
  *
458
468
  * 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.
469
+ *
470
+ * **A reversed payment cannot be approved** (#604): the reversal records that the money did not arrive, so there is nothing to take responsibility for.
471
+ *
472
+ * **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
473
  */
460
474
  post: operations["ApprovePayment"];
461
475
  delete?: never;
@@ -587,7 +601,7 @@ export interface paths {
587
601
  *
588
602
  * **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
603
  *
590
- * **The key collision `409` is settled**: retrying it can only fail again, and it carries no `retryable` marker.
604
+ * **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
605
  */
592
606
  post: operations["ProduceStatement"];
593
607
  delete?: never;
@@ -811,7 +825,7 @@ export interface paths {
811
825
  * Add a way this broker's customers pay
812
826
  * @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
827
  *
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`.
828
+ * **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
829
  */
816
830
  post: operations["CreatePaymentMethod"];
817
831
  delete?: never;
@@ -873,7 +887,7 @@ export interface paths {
873
887
  put?: never;
874
888
  /**
875
889
  * 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.
890
+ * @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
891
  */
878
892
  post: operations["RetirePaymentMethod"];
879
893
  delete?: never;
@@ -915,6 +929,8 @@ export interface paths {
915
929
  * Say which payment method the payments with a free-text source came through
916
930
  * @description #568. Every payment of this broker whose `source` is exactly the given text (after trimming, case as typed) and that names no payment method is given this method. Customers then see the method's label for those payments as `sourceLabel`. **The stored `source` is not changed**, and no amount or reference is.
917
931
  *
932
+ * **The text is compared exactly, code point for code point, and is not normalised** (#601). Payments recorded since #601 hold their source in Unicode normalisation form C, which is what a keyboard produces; a source stored in another spelling before then is reached by sending it as `GET /payment-methods/free-text-sources` lists it. A control character is refused with `400` on `Source`; any other character recording refuses (a format character, a line separator, a private-use or unassigned code point) is accepted here, because a source stored with one before #601 is the one most worth mapping to a method.
933
+ *
918
934
  * **A mapping never moves a payment between methods.** Payments with this source that already name this method are counted in `alreadyMapped`, and those naming another method in `mappedToAnotherMethod`; neither is changed.
919
935
  *
920
936
  * **A payment whose reference the method already holds is skipped** and listed in `skipped` with the payment that holds it, because mapping it would put the same reference against the method twice. The method holds a reference through a payment recorded against it, one mapped to it, or a free-text payment typed exactly as its code: the last is cautious, because such a payment is in the method's duplicate space under §5's index. `skippedCount` is the full count and `skipped` lists at most 200, earliest first. The rest are still mapped.
@@ -947,6 +963,8 @@ export interface paths {
947
963
  * Undo a mapping: show the payments with a free-text source as typed again
948
964
  * @description #588. Every payment of this broker whose `source` is exactly the given text (after trimming, case as typed) and that **a mapping** gave this method goes back to naming no method. Customers see the source as typed again, and the source returns to `GET /payment-methods/free-text-sources`. No amount, source or reference changes.
949
965
  *
966
+ * **The text is compared exactly, code point for code point, and is not normalised** (#601), as the mapping route compares it. A control character is refused with `400` on `Source`; any other character recording refuses (a format character, a line separator, a private-use or unassigned code point) is accepted here, so a source stored with one before #601 stays reachable.
967
+ *
950
968
  * **A payment recorded against this method is never changed**: its method is part of what was recorded. Such payments with this text (possible only when the text is the method's own code) are counted in `recordedAgainstMethod`. A payment recorded against the wrong method is corrected by a reversal. A payment that names this method through a mapping not marked as one (made by an API instance from before #588, possible only when the text is not the method's code) is counted in `notYetCorrectable` and left alone: map the source to this method again, which marks it, and then undo.
951
969
  *
952
970
  * **Idempotent.** Repeating the request answers `unmapped: 0` and records nothing. A retired method can be unmapped from. A statement already produced keeps the wording it was produced with. A `409` is the platform's concurrency conflict, with `retryable: true`, when another write changed one of the payments while this ran.
@@ -971,6 +989,8 @@ export interface paths {
971
989
  * Correct a mapping: say the payments with a free-text source came through another method
972
990
  * @description #588. Every payment of this broker whose `source` is exactly the given text and that **a mapping** gave this method is given `paymentMethodId` instead, in one step. Customers then see that method's label. No amount, source or reference changes, and a payment recorded against this method is never moved (counted in `recordedAgainstMethod`). A payment mapped by an API instance from before #588 is counted in `notYetCorrectable` and left alone until the source is mapped to this method again.
973
991
  *
992
+ * **The text is compared exactly, code point for code point, and is not normalised** (#601), as the mapping route compares it. A control character is refused with `400` on `Source`; any other character recording refuses (a format character, a line separator, a private-use or unassigned code point) is accepted here, so a source stored with one before #601 stays reachable.
993
+ *
974
994
  * `paymentMethodId` must be another active method of this broker: the same method, an unknown or another broker's method is `400` on `PaymentMethodId`, and a retired one is `409` `urn:brokerplatform:problem:payment-method-retired`, which is not retryable. The method in the route may be retired.
975
995
  *
976
996
  * **All or nothing.** If the target method already holds the reference of any of the payments (a payment recorded against it, one mapped to it, or a free-text payment typed exactly as its code), nothing is moved and the answer is `409` `urn:brokerplatform:problem:payment-source-remap-collision`, which is not retryable, with `collisionCount`. **`collisions` is present only when the caller also holds `billing.payments.read`**: up to 200 entries naming each payment, its reference and the payment holding it. Undo the mapping instead and map the source to the target: the mapping maps the rest and lists those it skips.
@@ -7809,7 +7829,7 @@ export interface components {
7809
7829
  coverStart: null | string;
7810
7830
  /** Format: date */
7811
7831
  coverEnd: null | string;
7812
- status: string;
7832
+ status: components["schemas"]["InvoiceStatus"];
7813
7833
  /** Format: date-time */
7814
7834
  draftedAtUtc: string;
7815
7835
  /** Format: date-time */
@@ -7820,6 +7840,8 @@ export interface components {
7820
7840
  retentionAnchorAtUtc: null | string;
7821
7841
  lines: components["schemas"]["InvoiceLineResponse"][];
7822
7842
  };
7843
+ /** @enum {string} */
7844
+ InvoiceStatus: "Draft" | "Issued" | "Discarded";
7823
7845
  InvoiceSummaryResponse: {
7824
7846
  /** Format: uuid */
7825
7847
  id: string;
@@ -7836,7 +7858,7 @@ export interface components {
7836
7858
  coverStart: null | string;
7837
7859
  /** Format: date */
7838
7860
  coverEnd: null | string;
7839
- status: string;
7861
+ status: components["schemas"]["InvoiceStatus"];
7840
7862
  /** Format: date-time */
7841
7863
  draftedAtUtc: string;
7842
7864
  /** Format: date-time */
@@ -8043,13 +8065,15 @@ export interface components {
8043
8065
  /** Format: date */
8044
8066
  dueOn: string;
8045
8067
  description: string;
8046
- status: string;
8068
+ status: components["schemas"]["ObligationStatus"];
8047
8069
  /** Format: date-time */
8048
8070
  raisedAtUtc: string;
8049
8071
  /** Format: date-time */
8050
8072
  retentionAnchorAtUtc: null | string;
8051
8073
  writeOffReason: null | string;
8052
8074
  };
8075
+ /** @enum {string} */
8076
+ ObligationStatus: "Outstanding" | "Cancelled" | "Settled" | "WrittenOff";
8053
8077
  ObligationSummaryResponse: {
8054
8078
  /** Format: uuid */
8055
8079
  id: string;
@@ -8069,7 +8093,7 @@ export interface components {
8069
8093
  /** Format: date */
8070
8094
  dueOn: string;
8071
8095
  description: string;
8072
- status: string;
8096
+ status: components["schemas"]["ObligationStatus"];
8073
8097
  };
8074
8098
  OfferedFormResponse: {
8075
8099
  /** Format: uuid */
@@ -9402,7 +9426,7 @@ export interface components {
9402
9426
  dueOn: string;
9403
9427
  /** Format: date-time */
9404
9428
  raisedAtUtc: string;
9405
- status: string;
9429
+ status: components["schemas"]["ObligationStatus"];
9406
9430
  };
9407
9431
  StatementPage: {
9408
9432
  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.11.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,