@insurance-broker/api-client 5.1.0 → 5.3.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 +169 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -846,6 +846,56 @@ export interface paths {
846
846
  patch?: never;
847
847
  trace?: never;
848
848
  };
849
+ "/api/v1/payment-methods/free-text-sources": {
850
+ parameters: {
851
+ query?: never;
852
+ header?: never;
853
+ path?: never;
854
+ cookie?: never;
855
+ };
856
+ /**
857
+ * The free-text sources that still have payments with no payment method
858
+ * @description #568. Every distinct free-text `source` this broker's payments carry with no payment method, and how many payments carry it, most first, then by the text compared character by character. **At most 200**, the most frequent; `moreExist` says whether there are others, which come into the list as these are mapped. Each one is shown to customers as typed until it is mapped to a method with `POST /payment-methods/{id}/source-mappings`. Spellings are listed separately because a mapping matches the text exactly.
859
+ */
860
+ get: operations["ListFreeTextPaymentSources"];
861
+ put?: never;
862
+ post?: never;
863
+ delete?: never;
864
+ options?: never;
865
+ head?: never;
866
+ patch?: never;
867
+ trace?: never;
868
+ };
869
+ "/api/v1/payment-methods/{id}/source-mappings": {
870
+ parameters: {
871
+ query?: never;
872
+ header?: never;
873
+ path?: never;
874
+ cookie?: never;
875
+ };
876
+ get?: never;
877
+ put?: never;
878
+ /**
879
+ * Say which payment method the payments with a free-text source came through
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
+ *
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.
883
+ *
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
+ *
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
+ *
888
+ * **A mapping cannot be undone yet** (#588): check the source and the method before sending it.
889
+ *
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
+ */
892
+ post: operations["MapFreeTextPaymentSource"];
893
+ delete?: never;
894
+ options?: never;
895
+ head?: never;
896
+ patch?: never;
897
+ trace?: never;
898
+ };
849
899
  "/api/v1/insurers": {
850
900
  parameters: {
851
901
  query?: never;
@@ -1827,6 +1877,10 @@ export interface paths {
1827
1877
  * **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.
1828
1878
  *
1829
1879
  * 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.
1880
+ *
1881
+ * **`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.
1882
+ *
1883
+ * **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.
1830
1884
  */
1831
1885
  post: operations["NotifyClaim"];
1832
1886
  delete?: never;
@@ -7429,6 +7483,15 @@ export interface components {
7429
7483
  };
7430
7484
  /** @enum {string} */
7431
7485
  FormVersionStatus: "Draft" | "Published" | "Retired";
7486
+ FreeTextPaymentSourceResponse: {
7487
+ source: string;
7488
+ /** Format: int32 */
7489
+ payments: number | string;
7490
+ };
7491
+ FreeTextPaymentSourcesResponse: {
7492
+ sources: components["schemas"]["FreeTextPaymentSourceResponse"][];
7493
+ moreExist: boolean;
7494
+ };
7432
7495
  GenerateDocumentRequest: {
7433
7496
  format: null | string;
7434
7497
  };
@@ -7779,6 +7842,9 @@ export interface components {
7779
7842
  /** Format: date-time */
7780
7843
  publishedAtUtc: string;
7781
7844
  };
7845
+ MapPaymentSourceRequest: {
7846
+ source: string;
7847
+ };
7782
7848
  MissingTemplateValueResponse: {
7783
7849
  key: string;
7784
7850
  /** @description Which refusal this is, as a stable name from a closed set. Key grouping, counting and translation on this, never on message. A new code is additive; renaming one is a break. */
@@ -7828,6 +7894,7 @@ export interface components {
7828
7894
  customerId: string;
7829
7895
  /** Format: date */
7830
7896
  incidentOn: string;
7897
+ idempotencyKey?: null | string;
7831
7898
  };
7832
7899
  ObligationPage: {
7833
7900
  items: components["schemas"]["ObligationSummaryResponse"][];
@@ -8126,6 +8193,20 @@ export interface components {
8126
8193
  reversedAtUtc: string;
8127
8194
  reversedBySubjectId: string;
8128
8195
  };
8196
+ PaymentSourceMappingResponse: {
8197
+ /** Format: uuid */
8198
+ paymentMethodId: string;
8199
+ source: string;
8200
+ /** Format: int32 */
8201
+ mapped: number | string;
8202
+ /** Format: int32 */
8203
+ alreadyMapped: number | string;
8204
+ /** Format: int32 */
8205
+ mappedToAnotherMethod: number | string;
8206
+ /** Format: int32 */
8207
+ skippedCount: number | string;
8208
+ skipped: components["schemas"]["SkippedPaymentResponse"][];
8209
+ };
8129
8210
  PaymentSummaryResponse: {
8130
8211
  /** Format: uuid */
8131
8212
  id: string;
@@ -9101,6 +9182,13 @@ export interface components {
9101
9182
  amount: null | number | string;
9102
9183
  unit: null | string;
9103
9184
  };
9185
+ SkippedPaymentResponse: {
9186
+ /** Format: uuid */
9187
+ paymentId: string;
9188
+ externalReference: string;
9189
+ /** Format: uuid */
9190
+ conflictingPaymentId: string;
9191
+ };
9104
9192
  StaffNameResponse: {
9105
9193
  subjectId: string;
9106
9194
  displayName: string;
@@ -9168,6 +9256,7 @@ export interface components {
9168
9256
  /** Format: date-time */
9169
9257
  postedAtUtc: string;
9170
9258
  isReversed: boolean;
9259
+ sourceLabel: string;
9171
9260
  };
9172
9261
  StatementResponse: {
9173
9262
  /** Format: uuid */
@@ -11064,6 +11153,77 @@ export interface operations {
11064
11153
  };
11065
11154
  };
11066
11155
  };
11156
+ ListFreeTextPaymentSources: {
11157
+ parameters: {
11158
+ query?: never;
11159
+ header?: never;
11160
+ path?: never;
11161
+ cookie?: never;
11162
+ };
11163
+ requestBody?: never;
11164
+ responses: {
11165
+ /** @description OK */
11166
+ 200: {
11167
+ headers: {
11168
+ [name: string]: unknown;
11169
+ };
11170
+ content: {
11171
+ "application/json": components["schemas"]["FreeTextPaymentSourcesResponse"];
11172
+ };
11173
+ };
11174
+ };
11175
+ };
11176
+ MapFreeTextPaymentSource: {
11177
+ parameters: {
11178
+ query?: never;
11179
+ header?: never;
11180
+ path: {
11181
+ id: string;
11182
+ };
11183
+ cookie?: never;
11184
+ };
11185
+ requestBody: {
11186
+ content: {
11187
+ "application/json": components["schemas"]["MapPaymentSourceRequest"];
11188
+ };
11189
+ };
11190
+ responses: {
11191
+ /** @description OK */
11192
+ 200: {
11193
+ headers: {
11194
+ [name: string]: unknown;
11195
+ };
11196
+ content: {
11197
+ "application/json": components["schemas"]["PaymentSourceMappingResponse"];
11198
+ };
11199
+ };
11200
+ /** @description Bad Request */
11201
+ 400: {
11202
+ headers: {
11203
+ [name: string]: unknown;
11204
+ };
11205
+ content: {
11206
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
11207
+ };
11208
+ };
11209
+ /** @description Not Found */
11210
+ 404: {
11211
+ headers: {
11212
+ [name: string]: unknown;
11213
+ };
11214
+ content?: never;
11215
+ };
11216
+ /** @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. */
11217
+ 409: {
11218
+ headers: {
11219
+ [name: string]: unknown;
11220
+ };
11221
+ content: {
11222
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
11223
+ };
11224
+ };
11225
+ };
11226
+ };
11067
11227
  ListInsurers: {
11068
11228
  parameters: {
11069
11229
  query?: {
@@ -13801,6 +13961,15 @@ export interface operations {
13801
13961
  "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
13802
13962
  };
13803
13963
  };
13964
+ /** @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. */
13965
+ 409: {
13966
+ headers: {
13967
+ [name: string]: unknown;
13968
+ };
13969
+ content: {
13970
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
13971
+ };
13972
+ };
13804
13973
  };
13805
13974
  };
13806
13975
  GetClaim: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "5.1.0",
3
+ "version": "5.3.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,