@insurance-broker/api-client 1.34.0 → 1.35.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 +278 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -176,6 +176,40 @@ export interface paths {
176
176
  patch?: never;
177
177
  trace?: never;
178
178
  };
179
+ "/api/v1/invoices/{id}/credit-notes": {
180
+ parameters: {
181
+ query?: never;
182
+ header?: never;
183
+ path?: never;
184
+ cookie?: never;
185
+ };
186
+ /**
187
+ * The corrections issued against an invoice
188
+ * @description Oldest first, each with its lines. **The invoice's own figures are unchanged by any of them** - what a customer was demanded and what has since been credited are two separate records, which is what BR-010 asks for.
189
+ *
190
+ * There is no paging: an invoice's corrections are a handful of records by nature.
191
+ */
192
+ get: operations["ListCreditNotes"];
193
+ put?: never;
194
+ /**
195
+ * Correct an issued invoice with a credit note
196
+ * @description BR-010 and ADR-0042 section 8. **A correction to an issued invoice is a new record and never an edit** - "a separate record referencing the invoice it corrects, with its own lines and its own document. Never an edit, never a negative line on the original."
197
+ *
198
+ * **It arrives complete.** Unlike an invoice there is no draft and no route to add a line: a correction is a decision already taken, so it is immutable from the moment it is written.
199
+ *
200
+ * **Every amount is positive.** A credit is carried by the *kind* of record rather than by the sign of a number, so the original invoice's figures are untouched and byte-identical afterwards.
201
+ *
202
+ * **It may not credit more than the invoice demanded**, counting what earlier credit notes already credit. Crediting past the demand is a payment out rather than a correction, and a refund is its own record (WRK-004, Phase 2).
203
+ *
204
+ * Refused against a **draft** invoice: a draft was never demanded of anybody, so it is discarded rather than credited.
205
+ */
206
+ post: operations["IssueCreditNote"];
207
+ delete?: never;
208
+ options?: never;
209
+ head?: never;
210
+ patch?: never;
211
+ trace?: never;
212
+ };
179
213
  "/api/v1/invoices/{id}/discarding": {
180
214
  parameters: {
181
215
  query?: never;
@@ -348,6 +382,38 @@ export interface paths {
348
382
  patch?: never;
349
383
  trace?: never;
350
384
  };
385
+ "/api/v1/payments/{id}/reversal": {
386
+ parameters: {
387
+ query?: never;
388
+ header?: never;
389
+ path?: never;
390
+ cookie?: never;
391
+ };
392
+ /**
393
+ * The reversal against a payment, if there is one
394
+ * @description `404` when the payment has not been reversed, which is the ordinary case — a reversal is a correction and most payments never need one.
395
+ *
396
+ * **At most one exists**, which a unique index guarantees rather than a handler, so this route answers a single record and never a list.
397
+ */
398
+ get: operations["GetPaymentReversal"];
399
+ put?: never;
400
+ /**
401
+ * Record that a payment's money did not arrive after all
402
+ * @description BR-010 and ADR-0042 section 8. **A posted payment is never edited** — a mistake is a reversal record and the original stays. That is also what keeps the phase's exit criterion safe: if a posting could be edited its external reference could be edited, and the unique index would stop guaranteeing that the same money cannot be recorded twice.
403
+ *
404
+ * **It reverses the whole payment.** There is no amount to supply: a partial reversal would be a way to edit a figure by degrees, and money that arrived for the wrong amount was already refused at recording.
405
+ *
406
+ * **Once per payment.** A second attempt is a `409` and is not retryable — a unique index refuses it, so a race and an ordinary re-run read identically.
407
+ *
408
+ * **It does not re-open the charge the payment settled**, and that is deliberate rather than an oversight. A retention anchor once stamped is never moved (ADR-0038), and `Settled` records that the payments covered the debt at a knowable instant — which stayed true of that instant. What a broker owes after a reversal is collected by raising the charge again, which leaves both facts on the ledger instead of one row that has quietly changed its mind. The reversal appears in the payment's own history, which is the read a finance officer explains a payment from.
409
+ */
410
+ post: operations["ReversePayment"];
411
+ delete?: never;
412
+ options?: never;
413
+ head?: never;
414
+ patch?: never;
415
+ trace?: never;
416
+ };
351
417
  "/api/v1/payments/{id}/evidence/{evidenceId}/content": {
352
418
  parameters: {
353
419
  query?: never;
@@ -4067,6 +4133,38 @@ export interface components {
4067
4133
  name: null | string;
4068
4134
  registrationNumber: null | string;
4069
4135
  };
4136
+ CreditNoteLineRequest: {
4137
+ kind: string;
4138
+ description: string;
4139
+ /** Format: double */
4140
+ amount: number | string;
4141
+ };
4142
+ CreditNoteLineResponse: {
4143
+ /** Format: uuid */
4144
+ id: string;
4145
+ /** Format: int32 */
4146
+ ordinal: number | string;
4147
+ kind: string;
4148
+ description: string;
4149
+ /** Format: double */
4150
+ amount: number | string;
4151
+ };
4152
+ CreditNoteResponse: {
4153
+ /** Format: uuid */
4154
+ id: string;
4155
+ /** Format: uuid */
4156
+ invoiceId: string;
4157
+ /** Format: uuid */
4158
+ customerId: string;
4159
+ /** Format: double */
4160
+ totalAmount: number | string;
4161
+ currency: string;
4162
+ reason: string;
4163
+ /** Format: date-time */
4164
+ issuedAtUtc: string;
4165
+ issuedBySubjectId: string;
4166
+ lines: components["schemas"]["CreditNoteLineResponse"][];
4167
+ };
4070
4168
  CustomerClaimPage: {
4071
4169
  items: components["schemas"]["ClaimResponse"][];
4072
4170
  nextCursor: null | string;
@@ -4581,6 +4679,10 @@ export interface components {
4581
4679
  retentionAnchorAtUtc: null | string;
4582
4680
  lines: components["schemas"]["InvoiceLineResponse"][];
4583
4681
  };
4682
+ IssueCreditNoteRequest: {
4683
+ reason: string;
4684
+ lines: components["schemas"]["CreditNoteLineRequest"][];
4685
+ };
4584
4686
  IssuedCustomerInvitationResponse: {
4585
4687
  /** Format: uuid */
4586
4688
  id: string;
@@ -4827,6 +4929,19 @@ export interface components {
4827
4929
  /** Format: date-time */
4828
4930
  approvedAtUtc: null | string;
4829
4931
  };
4932
+ PaymentReversalResponse: {
4933
+ /** Format: uuid */
4934
+ id: string;
4935
+ /** Format: uuid */
4936
+ paymentId: string;
4937
+ /** Format: double */
4938
+ amount: number | string;
4939
+ currency: string;
4940
+ reason: string;
4941
+ /** Format: date-time */
4942
+ reversedAtUtc: string;
4943
+ reversedBySubjectId: string;
4944
+ };
4830
4945
  PlaceLegalHoldRequest: {
4831
4946
  moduleName: null | string;
4832
4947
  entityType: null | string;
@@ -5406,6 +5521,9 @@ export interface components {
5406
5521
  updatedAtUtc: null | string;
5407
5522
  setBySubjectId: null | string;
5408
5523
  };
5524
+ ReversePaymentRequest: {
5525
+ reason: string;
5526
+ };
5409
5527
  ReviseComparisonSchemaBodyRequest: {
5410
5528
  body: null | string;
5411
5529
  /** Format: int32 */
@@ -5865,6 +5983,86 @@ export interface operations {
5865
5983
  };
5866
5984
  };
5867
5985
  };
5986
+ ListCreditNotes: {
5987
+ parameters: {
5988
+ query?: never;
5989
+ header?: never;
5990
+ path: {
5991
+ id: string;
5992
+ };
5993
+ cookie?: never;
5994
+ };
5995
+ requestBody?: never;
5996
+ responses: {
5997
+ /** @description OK */
5998
+ 200: {
5999
+ headers: {
6000
+ [name: string]: unknown;
6001
+ };
6002
+ content: {
6003
+ "application/json": components["schemas"]["CreditNoteResponse"][];
6004
+ };
6005
+ };
6006
+ /** @description Not Found */
6007
+ 404: {
6008
+ headers: {
6009
+ [name: string]: unknown;
6010
+ };
6011
+ content?: never;
6012
+ };
6013
+ };
6014
+ };
6015
+ IssueCreditNote: {
6016
+ parameters: {
6017
+ query?: never;
6018
+ header?: never;
6019
+ path: {
6020
+ id: string;
6021
+ };
6022
+ cookie?: never;
6023
+ };
6024
+ requestBody: {
6025
+ content: {
6026
+ "application/json": components["schemas"]["IssueCreditNoteRequest"];
6027
+ };
6028
+ };
6029
+ responses: {
6030
+ /** @description Created */
6031
+ 201: {
6032
+ headers: {
6033
+ [name: string]: unknown;
6034
+ };
6035
+ content: {
6036
+ "application/json": components["schemas"]["CreditNoteResponse"];
6037
+ };
6038
+ };
6039
+ /** @description Bad Request */
6040
+ 400: {
6041
+ headers: {
6042
+ [name: string]: unknown;
6043
+ };
6044
+ content: {
6045
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
6046
+ };
6047
+ };
6048
+ /** @description Not Found */
6049
+ 404: {
6050
+ headers: {
6051
+ [name: string]: unknown;
6052
+ };
6053
+ content?: never;
6054
+ };
6055
+ /** @description Conflict */
6056
+ 409: {
6057
+ headers: {
6058
+ [name: string]: unknown;
6059
+ };
6060
+ content: {
6061
+ "application/problem+json": components["schemas"]["ProblemDetails"];
6062
+ };
6063
+ };
6064
+ };
6065
+ };
5868
6066
  DiscardInvoice: {
5869
6067
  parameters: {
5870
6068
  query?: never;
@@ -6108,6 +6306,86 @@ export interface operations {
6108
6306
  };
6109
6307
  };
6110
6308
  };
6309
+ GetPaymentReversal: {
6310
+ parameters: {
6311
+ query?: never;
6312
+ header?: never;
6313
+ path: {
6314
+ id: string;
6315
+ };
6316
+ cookie?: never;
6317
+ };
6318
+ requestBody?: never;
6319
+ responses: {
6320
+ /** @description OK */
6321
+ 200: {
6322
+ headers: {
6323
+ [name: string]: unknown;
6324
+ };
6325
+ content: {
6326
+ "application/json": components["schemas"]["PaymentReversalResponse"];
6327
+ };
6328
+ };
6329
+ /** @description Not Found */
6330
+ 404: {
6331
+ headers: {
6332
+ [name: string]: unknown;
6333
+ };
6334
+ content?: never;
6335
+ };
6336
+ };
6337
+ };
6338
+ ReversePayment: {
6339
+ parameters: {
6340
+ query?: never;
6341
+ header?: never;
6342
+ path: {
6343
+ id: string;
6344
+ };
6345
+ cookie?: never;
6346
+ };
6347
+ requestBody: {
6348
+ content: {
6349
+ "application/json": components["schemas"]["ReversePaymentRequest"];
6350
+ };
6351
+ };
6352
+ responses: {
6353
+ /** @description Created */
6354
+ 201: {
6355
+ headers: {
6356
+ [name: string]: unknown;
6357
+ };
6358
+ content: {
6359
+ "application/json": components["schemas"]["PaymentReversalResponse"];
6360
+ };
6361
+ };
6362
+ /** @description Bad Request */
6363
+ 400: {
6364
+ headers: {
6365
+ [name: string]: unknown;
6366
+ };
6367
+ content: {
6368
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
6369
+ };
6370
+ };
6371
+ /** @description Not Found */
6372
+ 404: {
6373
+ headers: {
6374
+ [name: string]: unknown;
6375
+ };
6376
+ content?: never;
6377
+ };
6378
+ /** @description Conflict */
6379
+ 409: {
6380
+ headers: {
6381
+ [name: string]: unknown;
6382
+ };
6383
+ content: {
6384
+ "application/problem+json": components["schemas"]["ProblemDetails"];
6385
+ };
6386
+ };
6387
+ };
6388
+ };
6111
6389
  DownloadPaymentEvidence: {
6112
6390
  parameters: {
6113
6391
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "1.34.0",
3
+ "version": "1.35.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,