@insurance-broker/api-client 5.2.0 → 5.4.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 +200 -2
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -879,13 +879,13 @@ export interface paths {
879
879
  * Say which payment method the payments with a free-text source came through
880
880
  * @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.
881
881
  *
882
- * **A payment is never moved 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.
882
+ * **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.
883
883
  *
884
884
  * **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.
885
885
  *
886
886
  * **Idempotent.** Repeating the request maps nothing more and answers `mapped: 0`. Only payments that exist when the request runs are mapped: a payment recorded later with the same text is not, until the mapping is requested again.
887
887
  *
888
- * **A mapping cannot be undone yet** (#588): check the source and the method before sending it.
888
+ * **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`.
889
889
  *
890
890
  * 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.
891
891
  */
@@ -896,6 +896,56 @@ export interface paths {
896
896
  patch?: never;
897
897
  trace?: never;
898
898
  };
899
+ "/api/v1/payment-methods/{id}/source-mappings/removal": {
900
+ parameters: {
901
+ query?: never;
902
+ header?: never;
903
+ path?: never;
904
+ cookie?: never;
905
+ };
906
+ get?: never;
907
+ put?: never;
908
+ /**
909
+ * Undo a mapping: show the payments with a free-text source as typed again
910
+ * @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.
911
+ *
912
+ * **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.
913
+ *
914
+ * **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.
915
+ */
916
+ post: operations["UnmapFreeTextPaymentSource"];
917
+ delete?: never;
918
+ options?: never;
919
+ head?: never;
920
+ patch?: never;
921
+ trace?: never;
922
+ };
923
+ "/api/v1/payment-methods/{id}/source-mappings/correction": {
924
+ parameters: {
925
+ query?: never;
926
+ header?: never;
927
+ path?: never;
928
+ cookie?: never;
929
+ };
930
+ get?: never;
931
+ put?: never;
932
+ /**
933
+ * Correct a mapping: say the payments with a free-text source came through another method
934
+ * @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.
935
+ *
936
+ * `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.
937
+ *
938
+ * **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.
939
+ *
940
+ * **Idempotent.** Repeating the request answers `remapped: 0` and records nothing. 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 this ran, or something other than this API's recording route wrote a payment against the target method between this request's read and its save. Send it again; a retry reports any collision.
941
+ */
942
+ post: operations["RemapFreeTextPaymentSource"];
943
+ delete?: never;
944
+ options?: never;
945
+ head?: never;
946
+ patch?: never;
947
+ trace?: never;
948
+ };
899
949
  "/api/v1/insurers": {
900
950
  parameters: {
901
951
  query?: never;
@@ -1877,6 +1927,10 @@ export interface paths {
1877
1927
  * **One refusal covers four facts.** A policy that does not exist, one belonging to another broker, one belonging to another customer, and one not in force on the incident date are all answered the same way, so the route cannot be used to discover which policies a broker holds.
1878
1928
  *
1879
1929
  * The customer is named in the request and is not believed: it is checked against the policy, and the claim records the owner the policy gave.
1930
+ *
1931
+ * **`idempotencyKey` is optional, and it is the only thing that makes a retry safe.** Without one, sending the notification twice opens two claims. With one: a repeat carrying a key already used **returns the original claim and the same `201 Created` with the same `Location`**, so a retry after a lost response opens nothing new. A repeat carrying that key with a **different** policy, customer or incident day is a `409` and opens nothing.
1932
+ *
1933
+ * **A key is honoured for 30 days from the moment the claim was notified, and then stops being honoured.** After that the same key is one this platform has never seen. Mint a fresh key per form and reuse it only to retry that notification (#565). A key is shared by everybody at this broker — a colleague sending the same string meets the same claim — and is never shared with another broker, or with the key a customer sends when reporting a claim themselves.
1880
1934
  */
1881
1935
  post: operations["NotifyClaim"];
1882
1936
  delete?: never;
@@ -7890,6 +7944,7 @@ export interface components {
7890
7944
  customerId: string;
7891
7945
  /** Format: date */
7892
7946
  incidentOn: string;
7947
+ idempotencyKey?: null | string;
7893
7948
  };
7894
7949
  ObligationPage: {
7895
7950
  items: components["schemas"]["ObligationSummaryResponse"][];
@@ -8202,6 +8257,30 @@ export interface components {
8202
8257
  skippedCount: number | string;
8203
8258
  skipped: components["schemas"]["SkippedPaymentResponse"][];
8204
8259
  };
8260
+ PaymentSourceRemappingResponse: {
8261
+ /** Format: uuid */
8262
+ fromPaymentMethodId: string;
8263
+ /** Format: uuid */
8264
+ paymentMethodId: string;
8265
+ source: string;
8266
+ /** Format: int32 */
8267
+ remapped: number | string;
8268
+ /** Format: int32 */
8269
+ recordedAgainstMethod: number | string;
8270
+ /** Format: int32 */
8271
+ notYetCorrectable: number | string;
8272
+ };
8273
+ PaymentSourceUnmappingResponse: {
8274
+ /** Format: uuid */
8275
+ paymentMethodId: string;
8276
+ source: string;
8277
+ /** Format: int32 */
8278
+ unmapped: number | string;
8279
+ /** Format: int32 */
8280
+ recordedAgainstMethod: number | string;
8281
+ /** Format: int32 */
8282
+ notYetCorrectable: number | string;
8283
+ };
8205
8284
  PaymentSummaryResponse: {
8206
8285
  /** Format: uuid */
8207
8286
  id: string;
@@ -8868,6 +8947,11 @@ export interface components {
8868
8947
  ReleaseLegalHoldRequest: {
8869
8948
  releaseReason: null | string;
8870
8949
  };
8950
+ RemapPaymentSourceRequest: {
8951
+ source: string;
8952
+ /** Format: uuid */
8953
+ paymentMethodId: string;
8954
+ };
8871
8955
  RenameFormDefinitionRequest: {
8872
8956
  name: null | string;
8873
8957
  };
@@ -9504,6 +9588,9 @@ export interface components {
9504
9588
  /** @description The reason. One, because the caller named one submission; still an array. */
9505
9589
  violations: components["schemas"]["RenewalConfirmationViolationResponse"][];
9506
9590
  };
9591
+ UnmapPaymentSourceRequest: {
9592
+ source: string;
9593
+ };
9507
9594
  /** @description RFC 9457 problem answered when a policy cannot be opened because the quote request it names has no acceptance behind it (ADR-0028). Go back to the quote; nothing about this request will help. */
9508
9595
  UnplaceableQuoteProblem: {
9509
9596
  /**
@@ -11219,6 +11306,108 @@ export interface operations {
11219
11306
  };
11220
11307
  };
11221
11308
  };
11309
+ UnmapFreeTextPaymentSource: {
11310
+ parameters: {
11311
+ query?: never;
11312
+ header?: never;
11313
+ path: {
11314
+ id: string;
11315
+ };
11316
+ cookie?: never;
11317
+ };
11318
+ requestBody: {
11319
+ content: {
11320
+ "application/json": components["schemas"]["UnmapPaymentSourceRequest"];
11321
+ };
11322
+ };
11323
+ responses: {
11324
+ /** @description OK */
11325
+ 200: {
11326
+ headers: {
11327
+ [name: string]: unknown;
11328
+ };
11329
+ content: {
11330
+ "application/json": components["schemas"]["PaymentSourceUnmappingResponse"];
11331
+ };
11332
+ };
11333
+ /** @description Bad Request */
11334
+ 400: {
11335
+ headers: {
11336
+ [name: string]: unknown;
11337
+ };
11338
+ content: {
11339
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
11340
+ };
11341
+ };
11342
+ /** @description Not Found */
11343
+ 404: {
11344
+ headers: {
11345
+ [name: string]: unknown;
11346
+ };
11347
+ content?: never;
11348
+ };
11349
+ /** @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. */
11350
+ 409: {
11351
+ headers: {
11352
+ [name: string]: unknown;
11353
+ };
11354
+ content: {
11355
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
11356
+ };
11357
+ };
11358
+ };
11359
+ };
11360
+ RemapFreeTextPaymentSource: {
11361
+ parameters: {
11362
+ query?: never;
11363
+ header?: never;
11364
+ path: {
11365
+ id: string;
11366
+ };
11367
+ cookie?: never;
11368
+ };
11369
+ requestBody: {
11370
+ content: {
11371
+ "application/json": components["schemas"]["RemapPaymentSourceRequest"];
11372
+ };
11373
+ };
11374
+ responses: {
11375
+ /** @description OK */
11376
+ 200: {
11377
+ headers: {
11378
+ [name: string]: unknown;
11379
+ };
11380
+ content: {
11381
+ "application/json": components["schemas"]["PaymentSourceRemappingResponse"];
11382
+ };
11383
+ };
11384
+ /** @description Bad Request */
11385
+ 400: {
11386
+ headers: {
11387
+ [name: string]: unknown;
11388
+ };
11389
+ content: {
11390
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
11391
+ };
11392
+ };
11393
+ /** @description Not Found */
11394
+ 404: {
11395
+ headers: {
11396
+ [name: string]: unknown;
11397
+ };
11398
+ content?: never;
11399
+ };
11400
+ /** @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. */
11401
+ 409: {
11402
+ headers: {
11403
+ [name: string]: unknown;
11404
+ };
11405
+ content: {
11406
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
11407
+ };
11408
+ };
11409
+ };
11410
+ };
11222
11411
  ListInsurers: {
11223
11412
  parameters: {
11224
11413
  query?: {
@@ -13956,6 +14145,15 @@ export interface operations {
13956
14145
  "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
13957
14146
  };
13958
14147
  };
14148
+ /** @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. */
14149
+ 409: {
14150
+ headers: {
14151
+ [name: string]: unknown;
14152
+ };
14153
+ content: {
14154
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
14155
+ };
14156
+ };
13959
14157
  };
13960
14158
  };
13961
14159
  GetClaim: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "5.2.0",
3
+ "version": "5.4.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,