@insurance-broker/api-client 1.32.0 → 1.34.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 +350 -1
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -74,6 +74,34 @@ export interface paths {
74
74
  patch?: never;
75
75
  trace?: never;
76
76
  };
77
+ "/api/v1/obligations/{id}/write-off": {
78
+ parameters: {
79
+ query?: never;
80
+ header?: never;
81
+ path?: never;
82
+ cookie?: never;
83
+ };
84
+ get?: never;
85
+ put?: never;
86
+ /**
87
+ * Forgive a debt that will not be collected
88
+ * @description PAY-002, and ADR-0042 section 12's anchoring event. Records that a **real** debt will not be collected, with the reason on the record.
89
+ *
90
+ * **This is not a cancellation.** Cancelling says the charge should never have existed; writing off says it should have been paid and will not be. A broker asking "how much did we forgive" needs the two apart, so they are separate acts with separate audit actions.
91
+ *
92
+ * **The reason is required and is the broker's own words.** This platform declares no vocabulary of write-off reasons, because why a debt is forgiven is a broker's collections policy rather than a platform's.
93
+ *
94
+ * **It is why an obligation nobody will chase is not kept for ever.** An unsettled charge has no retention anchor and is therefore kept (ADR-0038 section 2); writing one off is the event that starts its clock.
95
+ *
96
+ * Refused on a charge that has already concluded — a settled one was paid and a cancelled one was never owed — rather than silently re-stamping an anchor.
97
+ */
98
+ post: operations["WriteOffObligation"];
99
+ delete?: never;
100
+ options?: never;
101
+ head?: never;
102
+ patch?: never;
103
+ trace?: never;
104
+ };
77
105
  "/api/v1/invoices": {
78
106
  parameters: {
79
107
  query?: never;
@@ -255,7 +283,7 @@ export interface paths {
255
283
  * Read one payment
256
284
  * @description Another broker's payment and another customer's are invisible here rather than refused: the tenant and owner query filters remove them before the read runs, so all three cases answer the same `404` (ADR-0008, ADR-0030).
257
285
  *
258
- * There is **no approval field**: approval is a separate recorded act and arrives in step 9.6, so a field here would be an unreachable `false` a reader would take for a fact.
286
+ * **`approvedBySubjectId` and `approvedAtUtc` are null until somebody approves**, which is the ordinary state of a payment just recorded. Approval is a separate act on its own route and never a status: the status set is untouched by it.
259
287
  */
260
288
  get: operations["GetPayment"];
261
289
  put?: never;
@@ -292,6 +320,92 @@ export interface paths {
292
320
  patch?: never;
293
321
  trace?: never;
294
322
  };
323
+ "/api/v1/payments/{id}/approval": {
324
+ parameters: {
325
+ query?: never;
326
+ header?: never;
327
+ path?: never;
328
+ cookie?: never;
329
+ };
330
+ get?: never;
331
+ put?: never;
332
+ /**
333
+ * Approve a payment somebody else recorded
334
+ * @description PAY-003's second half. Records that somebody accepted responsibility for a payment another person wrote down.
335
+ *
336
+ * **The subject who recorded the payment cannot approve it.** That is refused here and again by a check constraint, so it holds over a data fix, an import and a restored backup as well as over this route (ADR-0042 section 15, step 9.6's amendment).
337
+ *
338
+ * **A payment with no evidence a scan has passed cannot be approved.** File the bank slip first and wait for the scan; only a `Clean` verdict counts, which is the rule step 6.7 already applies to a form's evidence checklist.
339
+ *
340
+ * **Approval is an act and not a status.** The payment's status set is untouched: collapsing the two would make *"recorded but not yet approved"* and *"the money is definitely there"* the same value.
341
+ *
342
+ * There is no un-approval. A payment approved in error is corrected by a reversal, which is step 9.7's, for the reason BR-010 gives about every financially significant record.
343
+ */
344
+ post: operations["ApprovePayment"];
345
+ delete?: never;
346
+ options?: never;
347
+ head?: never;
348
+ patch?: never;
349
+ trace?: never;
350
+ };
351
+ "/api/v1/payments/{id}/evidence/{evidenceId}/content": {
352
+ parameters: {
353
+ query?: never;
354
+ header?: never;
355
+ path?: never;
356
+ cookie?: never;
357
+ };
358
+ /**
359
+ * Take a copy of a document filed against a payment
360
+ * @description PAY-003. Streams one file back, and only when the malware scan has passed it.
361
+ *
362
+ * **A `409` here is about the scan and not about the request.** `urn:brokerplatform:problem:document-scan-pending` means wait and ask again; `document-infected` and `document-unscannable` mean this file will never be served and another must be filed. The `type` is what tells them apart — all three are 409 so that a client branching on status alone still behaves safely.
363
+ *
364
+ * **The response is verified as it is written.** If the store no longer holds what was filed, the transfer is aborted rather than completed over bytes nobody can vouch for.
365
+ */
366
+ get: operations["DownloadPaymentEvidence"];
367
+ put?: never;
368
+ post?: never;
369
+ delete?: never;
370
+ options?: never;
371
+ head?: never;
372
+ patch?: never;
373
+ trace?: never;
374
+ };
375
+ "/api/v1/payments/{id}/evidence": {
376
+ parameters: {
377
+ query?: never;
378
+ header?: never;
379
+ path?: never;
380
+ cookie?: never;
381
+ };
382
+ /**
383
+ * What has been filed against a payment
384
+ * @description PAY-003. Every file filed against the payment, oldest first, with its scan verdict.
385
+ *
386
+ * **A row here is not a file that can be served.** The verdict is what decides that, and only `Clean` is downloadable — so a client renders the others as being checked, refused or unreadable rather than offering a link that will answer 409.
387
+ *
388
+ * There is no paging. A payment's evidence is a handful of files by nature.
389
+ */
390
+ get: operations["ListPaymentEvidence"];
391
+ put?: never;
392
+ /**
393
+ * File a document supporting a recorded payment
394
+ * @description PAY-003. Stores one file against a payment — a bank slip, a statement line, a remittance advice, a counter receipt.
395
+ *
396
+ * **The file is quarantined the moment it is stored and only a malware scan moves it**, so a client that has just uploaded should say the file is being checked rather than that it is ready. Nothing but a `Clean` verdict is ever served back.
397
+ *
398
+ * **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.
399
+ *
400
+ * **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.
401
+ */
402
+ post: operations["UploadPaymentEvidence"];
403
+ delete?: never;
404
+ options?: never;
405
+ head?: never;
406
+ patch?: never;
407
+ trace?: never;
408
+ };
295
409
  "/api/v1/insurers": {
296
410
  parameters: {
297
411
  query?: never;
@@ -4555,6 +4669,7 @@ export interface components {
4555
4669
  raisedAtUtc: string;
4556
4670
  /** Format: date-time */
4557
4671
  retentionAnchorAtUtc: null | string;
4672
+ writeOffReason: null | string;
4558
4673
  };
4559
4674
  OfferedFormResponse: {
4560
4675
  /** Format: uuid */
@@ -4672,6 +4787,26 @@ export interface components {
4672
4787
  /** Format: uuid */
4673
4788
  paymentAttemptId: null | string;
4674
4789
  };
4790
+ PaymentEvidenceResponse: {
4791
+ /** Format: uuid */
4792
+ id: string;
4793
+ /** Format: uuid */
4794
+ paymentId: string;
4795
+ fileName: string;
4796
+ contentType: string;
4797
+ /** Format: int64 */
4798
+ sizeBytes: number | string;
4799
+ contentSha256: string;
4800
+ /** Format: date-time */
4801
+ uploadedAtUtc: string;
4802
+ uploadedBySubjectId: string;
4803
+ scanVerdict: string;
4804
+ /** Format: date-time */
4805
+ scannedAtUtc: null | string;
4806
+ };
4807
+ PaymentEvidenceUpload: {
4808
+ file: components["schemas"]["IFormFile"];
4809
+ };
4675
4810
  PaymentResponse: {
4676
4811
  /** Format: uuid */
4677
4812
  id: string;
@@ -4688,6 +4823,9 @@ export interface components {
4688
4823
  recordedBySubjectId: string;
4689
4824
  /** Format: date-time */
4690
4825
  postedAtUtc: string;
4826
+ approvedBySubjectId: null | string;
4827
+ /** Format: date-time */
4828
+ approvedAtUtc: null | string;
4691
4829
  };
4692
4830
  PlaceLegalHoldRequest: {
4693
4831
  moduleName: null | string;
@@ -5442,6 +5580,9 @@ export interface components {
5442
5580
  WriteClaimNoteRequest: {
5443
5581
  body: string;
5444
5582
  };
5583
+ WriteOffObligationRequest: {
5584
+ reason: string;
5585
+ };
5445
5586
  };
5446
5587
  responses: never;
5447
5588
  parameters: never;
@@ -5551,6 +5692,57 @@ export interface operations {
5551
5692
  };
5552
5693
  };
5553
5694
  };
5695
+ WriteOffObligation: {
5696
+ parameters: {
5697
+ query?: never;
5698
+ header?: never;
5699
+ path: {
5700
+ id: string;
5701
+ };
5702
+ cookie?: never;
5703
+ };
5704
+ requestBody: {
5705
+ content: {
5706
+ "application/json": components["schemas"]["WriteOffObligationRequest"];
5707
+ };
5708
+ };
5709
+ responses: {
5710
+ /** @description OK */
5711
+ 200: {
5712
+ headers: {
5713
+ [name: string]: unknown;
5714
+ };
5715
+ content: {
5716
+ "application/json": components["schemas"]["ObligationResponse"];
5717
+ };
5718
+ };
5719
+ /** @description Bad Request */
5720
+ 400: {
5721
+ headers: {
5722
+ [name: string]: unknown;
5723
+ };
5724
+ content: {
5725
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
5726
+ };
5727
+ };
5728
+ /** @description Not Found */
5729
+ 404: {
5730
+ headers: {
5731
+ [name: string]: unknown;
5732
+ };
5733
+ content?: never;
5734
+ };
5735
+ /** @description Conflict */
5736
+ 409: {
5737
+ headers: {
5738
+ [name: string]: unknown;
5739
+ };
5740
+ content: {
5741
+ "application/problem+json": components["schemas"]["ProblemDetails"];
5742
+ };
5743
+ };
5744
+ };
5745
+ };
5554
5746
  DraftInvoice: {
5555
5747
  parameters: {
5556
5748
  query?: never;
@@ -5878,6 +6070,163 @@ export interface operations {
5878
6070
  };
5879
6071
  };
5880
6072
  };
6073
+ ApprovePayment: {
6074
+ parameters: {
6075
+ query?: never;
6076
+ header?: never;
6077
+ path: {
6078
+ id: string;
6079
+ };
6080
+ cookie?: never;
6081
+ };
6082
+ requestBody?: never;
6083
+ responses: {
6084
+ /** @description OK */
6085
+ 200: {
6086
+ headers: {
6087
+ [name: string]: unknown;
6088
+ };
6089
+ content: {
6090
+ "application/json": components["schemas"]["PaymentResponse"];
6091
+ };
6092
+ };
6093
+ /** @description Not Found */
6094
+ 404: {
6095
+ headers: {
6096
+ [name: string]: unknown;
6097
+ };
6098
+ content?: never;
6099
+ };
6100
+ /** @description Conflict */
6101
+ 409: {
6102
+ headers: {
6103
+ [name: string]: unknown;
6104
+ };
6105
+ content: {
6106
+ "application/problem+json": components["schemas"]["ProblemDetails"];
6107
+ };
6108
+ };
6109
+ };
6110
+ };
6111
+ DownloadPaymentEvidence: {
6112
+ parameters: {
6113
+ query?: never;
6114
+ header?: never;
6115
+ path: {
6116
+ id: string;
6117
+ evidenceId: string;
6118
+ };
6119
+ cookie?: never;
6120
+ };
6121
+ requestBody?: never;
6122
+ responses: {
6123
+ /** @description OK */
6124
+ 200: {
6125
+ headers: {
6126
+ [name: string]: unknown;
6127
+ };
6128
+ content?: never;
6129
+ };
6130
+ /** @description Not Found */
6131
+ 404: {
6132
+ headers: {
6133
+ [name: string]: unknown;
6134
+ };
6135
+ content?: never;
6136
+ };
6137
+ /** @description Conflict */
6138
+ 409: {
6139
+ headers: {
6140
+ [name: string]: unknown;
6141
+ };
6142
+ content: {
6143
+ "application/problem+json": components["schemas"]["ProblemDetails"];
6144
+ };
6145
+ };
6146
+ };
6147
+ };
6148
+ ListPaymentEvidence: {
6149
+ parameters: {
6150
+ query?: never;
6151
+ header?: never;
6152
+ path: {
6153
+ id: string;
6154
+ };
6155
+ cookie?: never;
6156
+ };
6157
+ requestBody?: never;
6158
+ responses: {
6159
+ /** @description OK */
6160
+ 200: {
6161
+ headers: {
6162
+ [name: string]: unknown;
6163
+ };
6164
+ content: {
6165
+ "application/json": components["schemas"]["PaymentEvidenceResponse"][];
6166
+ };
6167
+ };
6168
+ /** @description Not Found */
6169
+ 404: {
6170
+ headers: {
6171
+ [name: string]: unknown;
6172
+ };
6173
+ content?: never;
6174
+ };
6175
+ };
6176
+ };
6177
+ UploadPaymentEvidence: {
6178
+ parameters: {
6179
+ query?: never;
6180
+ header?: {
6181
+ "X-Document-Sha256"?: string;
6182
+ };
6183
+ path: {
6184
+ id: string;
6185
+ };
6186
+ cookie?: never;
6187
+ };
6188
+ requestBody: {
6189
+ content: {
6190
+ "multipart/form-data": components["schemas"]["PaymentEvidenceUpload"];
6191
+ };
6192
+ };
6193
+ responses: {
6194
+ /** @description Created */
6195
+ 201: {
6196
+ headers: {
6197
+ [name: string]: unknown;
6198
+ };
6199
+ content: {
6200
+ "application/json": components["schemas"]["PaymentEvidenceResponse"];
6201
+ };
6202
+ };
6203
+ /** @description Bad Request */
6204
+ 400: {
6205
+ headers: {
6206
+ [name: string]: unknown;
6207
+ };
6208
+ content: {
6209
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
6210
+ };
6211
+ };
6212
+ /** @description Not Found */
6213
+ 404: {
6214
+ headers: {
6215
+ [name: string]: unknown;
6216
+ };
6217
+ content?: never;
6218
+ };
6219
+ /** @description Payload Too Large */
6220
+ 413: {
6221
+ headers: {
6222
+ [name: string]: unknown;
6223
+ };
6224
+ content: {
6225
+ "application/problem+json": components["schemas"]["ProblemDetails"];
6226
+ };
6227
+ };
6228
+ };
6229
+ };
5881
6230
  ListInsurers: {
5882
6231
  parameters: {
5883
6232
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "1.32.0",
3
+ "version": "1.34.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,