@insurance-broker/api-client 5.8.0 → 5.9.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 +34 -8
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -323,7 +323,9 @@ export interface paths {
323
323
  *
324
324
  * 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
325
  *
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.
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).
327
+ *
328
+ * **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.
327
329
  */
328
330
  post: operations["RecordPayment"];
329
331
  delete?: never;
@@ -367,13 +369,15 @@ export interface paths {
367
369
  * List the money this broker has recorded, most recent first
368
370
  * @description PAY-005. The payments this broker has recorded, ordered by when they posted, paged by cursor. A `customerId` or an `obligationId` narrows the list.
369
371
  *
372
+ * **`awaitingApproval=true` is the approver's queue** (#593): only payments nobody has approved yet, that have not been reversed, and that the caller did not record - so it holds what this caller can approve, because nobody may approve a payment they recorded. The caller is the session's subject, so another approver's queue holds the payments this caller recorded. A payment with no clean evidence is still listed. It combines with the other filters and pages the same way. `false` or absent is no filter. A reversed payment is not in the queue, because the money it records did not arrive.
373
+ *
370
374
  * **There is no `asOf` here, unlike `GET /obligations`.** Nothing in this list's predicate reads the clock - a payment posted at an instant the row records - so a member reporting when the page was measured would read as a freshness guarantee while guaranteeing nothing.
371
375
  *
372
376
  * **A reversed payment stays on the list** and carries `reversed: true`. Money that arrived and was sent back is a fact a reconciliation has to see, and a reversal is its own record rather than an edit to this one (ADR-0042 section 8).
373
377
  *
374
378
  * **Rows carry no subject identifiers.** Who recorded a payment and who approved it is the separation-of-duties record and it is on the payment itself, so a page-sized read cannot enumerate a broker's finance staff.
375
379
  *
376
- * **`customerId` and `obligationId` are filters and never authorisation.** The broker whose payments these are comes from the session.
380
+ * **`customerId`, `obligationId` and `awaitingApproval` are filters and never authorisation.** The broker whose payments these are comes from the session.
377
381
  */
378
382
  get: operations["ListPayments"];
379
383
  put?: never;
@@ -542,6 +546,8 @@ export interface paths {
542
546
  * **The type is taken from the file's own bytes, never from the part header.** A part declaring one thing and holding another is refused rather than believed.
543
547
  *
544
548
  * **A payment cannot be approved until at least one of its files is `Clean`**, which is the other half of PAY-003 and the reason this route exists.
549
+ *
550
+ * **A reversed payment takes no evidence** (#593): the money it records did not arrive, so there is nothing left to approve. The answer is `409` `urn:brokerplatform:problem:payment-already-reversed`, the type reversing it again answers, and it is not retryable. The body is not read.
545
551
  */
546
552
  post: operations["UploadPaymentEvidence"];
547
553
  delete?: never;
@@ -917,7 +923,9 @@ export interface paths {
917
923
  *
918
924
  * **A mapping can be undone** with `POST /payment-methods/{id}/source-mappings/removal`, or pointed at another method with `POST /payment-methods/{id}/source-mappings/correction` (#588). A payment with this source that names this method through a mapping not marked as one (made by an API instance from before #588) is marked by this request, so it can then be corrected; it is counted in `alreadyMapped`.
919
925
  *
920
- * A retired method is `409`. A statement already produced keeps the wording it was produced with. A `409` can also be the platform's concurrency conflict, with `retryable: true`, when another write changed one of the payments while it was being mapped.
926
+ * **`skipped` lists payments only when the caller also holds `billing.payments.read`** (#602). Without it, `skipped` is empty and `skippedCount` still says how many were skipped: the entries name payments and their references, which is payment data. So **a `skippedCount` above zero with an empty `skipped` means the skipped payments are not shown to this caller**, not that the list was lost; with `billing.payments.read`, `skipped` is never empty while `skippedCount` is above zero.
927
+ *
928
+ * A retired method is `409` `urn:brokerplatform:problem:payment-method-retired`, which is not retryable: choose an active method. A statement already produced keeps the wording it was produced with. A `409` can also be the platform's concurrency conflict, `urn:brokerplatform:problem:concurrency-conflict` with `retryable: true`: another write changed one of the payments while it was being mapped, or a payment was recorded against the method under one of these payments' references while the mapping ran. Nothing was mapped; send it again, and a retry lists any payment it would now duplicate as skipped.
921
929
  */
922
930
  post: operations["MapFreeTextPaymentSource"];
923
931
  delete?: never;
@@ -963,7 +971,7 @@ export interface paths {
963
971
  * Correct a mapping: say the payments with a free-text source came through another method
964
972
  * @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.
965
973
  *
966
- * `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`. The method in the route may be retired.
974
+ * `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.
967
975
  *
968
976
  * **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.
969
977
  *
@@ -8214,10 +8222,12 @@ export interface components {
8214
8222
  /** Format: double */
8215
8223
  existingAmount: null | number | string;
8216
8224
  };
8225
+ /** @enum {string} */
8226
+ PaymentEventKind: "Recorded" | "DuplicateRefused" | "ConflictingAmountRefused" | "EvidenceAttached" | "Approved" | "Reversed";
8217
8227
  PaymentEventResponse: {
8218
8228
  /** Format: uuid */
8219
8229
  id: string;
8220
- kind: string;
8230
+ kind: components["schemas"]["PaymentEventKind"];
8221
8231
  /** Format: date-time */
8222
8232
  occurredAtUtc: string;
8223
8233
  actorSubjectId: string;
@@ -8237,7 +8247,7 @@ export interface components {
8237
8247
  /** Format: date-time */
8238
8248
  uploadedAtUtc: string;
8239
8249
  uploadedBySubjectId: string;
8240
- scanVerdict: string;
8250
+ scanVerdict: components["schemas"]["ScanVerdict"];
8241
8251
  /** Format: date-time */
8242
8252
  scannedAtUtc: null | string;
8243
8253
  };
@@ -8288,7 +8298,7 @@ export interface components {
8288
8298
  currency: string;
8289
8299
  source: string;
8290
8300
  externalReference: string;
8291
- status: string;
8301
+ status: components["schemas"]["PaymentStatus"];
8292
8302
  recordedBySubjectId: string;
8293
8303
  /** Format: date-time */
8294
8304
  postedAtUtc: string;
@@ -8297,6 +8307,7 @@ export interface components {
8297
8307
  approvedAtUtc: null | string;
8298
8308
  /** Format: uuid */
8299
8309
  paymentMethodId: null | string;
8310
+ paymentMethodWasMapped: boolean;
8300
8311
  };
8301
8312
  PaymentReversalResponse: {
8302
8313
  /** Format: uuid */
@@ -8349,6 +8360,8 @@ export interface components {
8349
8360
  /** Format: int32 */
8350
8361
  notYetCorrectable: number;
8351
8362
  };
8363
+ /** @enum {string} */
8364
+ PaymentStatus: "Posted";
8352
8365
  PaymentSummaryResponse: {
8353
8366
  /** Format: uuid */
8354
8367
  id: string;
@@ -8361,7 +8374,7 @@ export interface components {
8361
8374
  currency: string;
8362
8375
  source: string;
8363
8376
  externalReference: string;
8364
- status: string;
8377
+ status: components["schemas"]["PaymentStatus"];
8365
8378
  /** Format: date-time */
8366
8379
  postedAtUtc: string;
8367
8380
  /** Format: date-time */
@@ -8369,6 +8382,7 @@ export interface components {
8369
8382
  reversed: boolean;
8370
8383
  /** Format: uuid */
8371
8384
  paymentMethodId: null | string;
8385
+ paymentMethodWasMapped: boolean;
8372
8386
  };
8373
8387
  PlacedMemberResponse: {
8374
8388
  /** Format: uuid */
@@ -9276,6 +9290,8 @@ export interface components {
9276
9290
  email: null | string;
9277
9291
  phone: null | string;
9278
9292
  };
9293
+ /** @enum {string} */
9294
+ ScanVerdict: "Quarantined" | "Clean" | "Infected" | "Unscannable";
9279
9295
  ServiceLocationResponse: {
9280
9296
  /** Format: uuid */
9281
9297
  id: string;
@@ -10488,6 +10504,7 @@ export interface operations {
10488
10504
  query?: {
10489
10505
  customerId?: string;
10490
10506
  obligationId?: string;
10507
+ awaitingApproval?: boolean;
10491
10508
  cursor?: string;
10492
10509
  limit?: number | string;
10493
10510
  };
@@ -10801,6 +10818,15 @@ export interface operations {
10801
10818
  };
10802
10819
  content?: never;
10803
10820
  };
10821
+ /** @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. */
10822
+ 409: {
10823
+ headers: {
10824
+ [name: string]: unknown;
10825
+ };
10826
+ content: {
10827
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
10828
+ };
10829
+ };
10804
10830
  /** @description Payload Too Large */
10805
10831
  413: {
10806
10832
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "5.8.0",
3
+ "version": "5.9.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,