@insurance-broker/api-client 5.1.0 → 5.2.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 +155 -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;
@@ -7429,6 +7479,15 @@ export interface components {
7429
7479
  };
7430
7480
  /** @enum {string} */
7431
7481
  FormVersionStatus: "Draft" | "Published" | "Retired";
7482
+ FreeTextPaymentSourceResponse: {
7483
+ source: string;
7484
+ /** Format: int32 */
7485
+ payments: number | string;
7486
+ };
7487
+ FreeTextPaymentSourcesResponse: {
7488
+ sources: components["schemas"]["FreeTextPaymentSourceResponse"][];
7489
+ moreExist: boolean;
7490
+ };
7432
7491
  GenerateDocumentRequest: {
7433
7492
  format: null | string;
7434
7493
  };
@@ -7779,6 +7838,9 @@ export interface components {
7779
7838
  /** Format: date-time */
7780
7839
  publishedAtUtc: string;
7781
7840
  };
7841
+ MapPaymentSourceRequest: {
7842
+ source: string;
7843
+ };
7782
7844
  MissingTemplateValueResponse: {
7783
7845
  key: string;
7784
7846
  /** @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. */
@@ -8126,6 +8188,20 @@ export interface components {
8126
8188
  reversedAtUtc: string;
8127
8189
  reversedBySubjectId: string;
8128
8190
  };
8191
+ PaymentSourceMappingResponse: {
8192
+ /** Format: uuid */
8193
+ paymentMethodId: string;
8194
+ source: string;
8195
+ /** Format: int32 */
8196
+ mapped: number | string;
8197
+ /** Format: int32 */
8198
+ alreadyMapped: number | string;
8199
+ /** Format: int32 */
8200
+ mappedToAnotherMethod: number | string;
8201
+ /** Format: int32 */
8202
+ skippedCount: number | string;
8203
+ skipped: components["schemas"]["SkippedPaymentResponse"][];
8204
+ };
8129
8205
  PaymentSummaryResponse: {
8130
8206
  /** Format: uuid */
8131
8207
  id: string;
@@ -9101,6 +9177,13 @@ export interface components {
9101
9177
  amount: null | number | string;
9102
9178
  unit: null | string;
9103
9179
  };
9180
+ SkippedPaymentResponse: {
9181
+ /** Format: uuid */
9182
+ paymentId: string;
9183
+ externalReference: string;
9184
+ /** Format: uuid */
9185
+ conflictingPaymentId: string;
9186
+ };
9104
9187
  StaffNameResponse: {
9105
9188
  subjectId: string;
9106
9189
  displayName: string;
@@ -9168,6 +9251,7 @@ export interface components {
9168
9251
  /** Format: date-time */
9169
9252
  postedAtUtc: string;
9170
9253
  isReversed: boolean;
9254
+ sourceLabel: string;
9171
9255
  };
9172
9256
  StatementResponse: {
9173
9257
  /** Format: uuid */
@@ -11064,6 +11148,77 @@ export interface operations {
11064
11148
  };
11065
11149
  };
11066
11150
  };
11151
+ ListFreeTextPaymentSources: {
11152
+ parameters: {
11153
+ query?: never;
11154
+ header?: never;
11155
+ path?: never;
11156
+ cookie?: never;
11157
+ };
11158
+ requestBody?: never;
11159
+ responses: {
11160
+ /** @description OK */
11161
+ 200: {
11162
+ headers: {
11163
+ [name: string]: unknown;
11164
+ };
11165
+ content: {
11166
+ "application/json": components["schemas"]["FreeTextPaymentSourcesResponse"];
11167
+ };
11168
+ };
11169
+ };
11170
+ };
11171
+ MapFreeTextPaymentSource: {
11172
+ parameters: {
11173
+ query?: never;
11174
+ header?: never;
11175
+ path: {
11176
+ id: string;
11177
+ };
11178
+ cookie?: never;
11179
+ };
11180
+ requestBody: {
11181
+ content: {
11182
+ "application/json": components["schemas"]["MapPaymentSourceRequest"];
11183
+ };
11184
+ };
11185
+ responses: {
11186
+ /** @description OK */
11187
+ 200: {
11188
+ headers: {
11189
+ [name: string]: unknown;
11190
+ };
11191
+ content: {
11192
+ "application/json": components["schemas"]["PaymentSourceMappingResponse"];
11193
+ };
11194
+ };
11195
+ /** @description Bad Request */
11196
+ 400: {
11197
+ headers: {
11198
+ [name: string]: unknown;
11199
+ };
11200
+ content: {
11201
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
11202
+ };
11203
+ };
11204
+ /** @description Not Found */
11205
+ 404: {
11206
+ headers: {
11207
+ [name: string]: unknown;
11208
+ };
11209
+ content?: never;
11210
+ };
11211
+ /** @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. */
11212
+ 409: {
11213
+ headers: {
11214
+ [name: string]: unknown;
11215
+ };
11216
+ content: {
11217
+ "application/problem+json": components["schemas"]["ConcurrencyConflictProblem"] | components["schemas"]["ProblemDetails"];
11218
+ };
11219
+ };
11220
+ };
11221
+ };
11067
11222
  ListInsurers: {
11068
11223
  parameters: {
11069
11224
  query?: {
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.2.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,