@insurance-broker/api-client 1.30.0 → 1.31.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 +225 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -194,6 +194,78 @@ export interface paths {
194
194
  patch?: never;
195
195
  trace?: never;
196
196
  };
197
+ "/api/v1/obligations/{id}/payments": {
198
+ parameters: {
199
+ query?: never;
200
+ header?: never;
201
+ path?: never;
202
+ cookie?: never;
203
+ };
204
+ get?: never;
205
+ put?: never;
206
+ /**
207
+ * Record money that arrived against this charge
208
+ * @description PAY-001, ADR-0042 sections 4 and 5. Records that money arrived somewhere else. **The platform never asserts that it did**: under `ExternalRecordOnly` there is no gateway, nothing is collected here, and every payment carries the source it came through and the reference that source gave it.
209
+ *
210
+ * **Those two fields are the idempotency key.** `(tenant, source, externalReference)` is unique, so the same money cannot be recorded twice — not because a handler checks, but because the row is unrepresentable (BR-009). There is deliberately **no `idempotencyKey` field**: a caller-invented key answers "is this the same request", and only "is this the same money" has A8's answer in it.
211
+ *
212
+ * **A refusal is recorded, not merely returned.** Every attempt is written before the posting is tried, so a refused duplicate is findable in the reconciliation history read below.
213
+ *
214
+ * The currency is **not** a field: it is the obligation's, held by a foreign key rather than by this handler. Nil is refused — a payment of nothing is nothing having arrived.
215
+ */
216
+ post: operations["RecordPayment"];
217
+ delete?: never;
218
+ options?: never;
219
+ head?: never;
220
+ patch?: never;
221
+ trace?: never;
222
+ };
223
+ "/api/v1/obligations/{id}/payment-attempts": {
224
+ parameters: {
225
+ query?: never;
226
+ header?: never;
227
+ path?: never;
228
+ cookie?: never;
229
+ };
230
+ /**
231
+ * The reconciliation history for this charge
232
+ * @description **A8's second half**: a duplicate posting must be *visible* in reconciliation history and not merely refused. One row per attempt — what arrived, from where, with which reference, at what instant, and by which subject — stamped with what the platform decided.
233
+ *
234
+ * An `outcome` of `null` is a real state and not missing data: the attempt is written before the posting is tried, so it means a posting in flight, or a process that died between the two. That case is exactly what this read exists to surface.
235
+ *
236
+ * `existingAmount` appears on one outcome only — a refusal because that reference is already recorded for a **different** figure. Both amounts survive and neither overwrites the other (BR-010).
237
+ */
238
+ get: operations["ReadPaymentAttempts"];
239
+ put?: never;
240
+ post?: never;
241
+ delete?: never;
242
+ options?: never;
243
+ head?: never;
244
+ patch?: never;
245
+ trace?: never;
246
+ };
247
+ "/api/v1/payments/{id}": {
248
+ parameters: {
249
+ query?: never;
250
+ header?: never;
251
+ path?: never;
252
+ cookie?: never;
253
+ };
254
+ /**
255
+ * Read one payment
256
+ * @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
+ *
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.
259
+ */
260
+ get: operations["GetPayment"];
261
+ put?: never;
262
+ post?: never;
263
+ delete?: never;
264
+ options?: never;
265
+ head?: never;
266
+ patch?: never;
267
+ trace?: never;
268
+ };
197
269
  "/api/v1/insurers": {
198
270
  parameters: {
199
271
  query?: never;
@@ -4543,6 +4615,44 @@ export interface components {
4543
4615
  /** Format: date-time */
4544
4616
  acceptedAtUtc: null | string;
4545
4617
  };
4618
+ PaymentAttemptResponse: {
4619
+ /** Format: uuid */
4620
+ id: string;
4621
+ /** Format: uuid */
4622
+ obligationId: string;
4623
+ /** Format: double */
4624
+ amount: number | string;
4625
+ currency: string;
4626
+ source: string;
4627
+ externalReference: string;
4628
+ attemptedBySubjectId: string;
4629
+ /** Format: date-time */
4630
+ attemptedAtUtc: string;
4631
+ outcome: null | string;
4632
+ /** Format: date-time */
4633
+ concludedAtUtc: null | string;
4634
+ /** Format: uuid */
4635
+ paymentId: null | string;
4636
+ /** Format: double */
4637
+ existingAmount: null | number | string;
4638
+ };
4639
+ PaymentResponse: {
4640
+ /** Format: uuid */
4641
+ id: string;
4642
+ /** Format: uuid */
4643
+ obligationId: string;
4644
+ /** Format: uuid */
4645
+ customerId: string;
4646
+ /** Format: double */
4647
+ amount: number | string;
4648
+ currency: string;
4649
+ source: string;
4650
+ externalReference: string;
4651
+ status: string;
4652
+ recordedBySubjectId: string;
4653
+ /** Format: date-time */
4654
+ postedAtUtc: string;
4655
+ };
4546
4656
  PlaceLegalHoldRequest: {
4547
4657
  moduleName: null | string;
4548
4658
  entityType: null | string;
@@ -4932,6 +5042,12 @@ export interface components {
4932
5042
  /** Format: date */
4933
5043
  submittedOn: string;
4934
5044
  };
5045
+ RecordPaymentRequest: {
5046
+ /** Format: double */
5047
+ amount: number | string;
5048
+ source: string;
5049
+ externalReference: string;
5050
+ };
4935
5051
  RecordRenewalCustomerInformationRequest: {
4936
5052
  /** Format: uuid */
4937
5053
  formSubmissionId: null | string;
@@ -5588,6 +5704,115 @@ export interface operations {
5588
5704
  };
5589
5705
  };
5590
5706
  };
5707
+ RecordPayment: {
5708
+ parameters: {
5709
+ query?: never;
5710
+ header?: never;
5711
+ path: {
5712
+ id: string;
5713
+ };
5714
+ cookie?: never;
5715
+ };
5716
+ requestBody: {
5717
+ content: {
5718
+ "application/json": components["schemas"]["RecordPaymentRequest"];
5719
+ };
5720
+ };
5721
+ responses: {
5722
+ /** @description Created */
5723
+ 201: {
5724
+ headers: {
5725
+ [name: string]: unknown;
5726
+ };
5727
+ content: {
5728
+ "application/json": components["schemas"]["PaymentResponse"];
5729
+ };
5730
+ };
5731
+ /** @description Bad Request */
5732
+ 400: {
5733
+ headers: {
5734
+ [name: string]: unknown;
5735
+ };
5736
+ content: {
5737
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
5738
+ };
5739
+ };
5740
+ /** @description Not Found */
5741
+ 404: {
5742
+ headers: {
5743
+ [name: string]: unknown;
5744
+ };
5745
+ content?: never;
5746
+ };
5747
+ /** @description Conflict */
5748
+ 409: {
5749
+ headers: {
5750
+ [name: string]: unknown;
5751
+ };
5752
+ content: {
5753
+ "application/problem+json": components["schemas"]["ProblemDetails"];
5754
+ };
5755
+ };
5756
+ };
5757
+ };
5758
+ ReadPaymentAttempts: {
5759
+ parameters: {
5760
+ query?: never;
5761
+ header?: never;
5762
+ path: {
5763
+ id: string;
5764
+ };
5765
+ cookie?: never;
5766
+ };
5767
+ requestBody?: never;
5768
+ responses: {
5769
+ /** @description OK */
5770
+ 200: {
5771
+ headers: {
5772
+ [name: string]: unknown;
5773
+ };
5774
+ content: {
5775
+ "application/json": components["schemas"]["PaymentAttemptResponse"][];
5776
+ };
5777
+ };
5778
+ /** @description Not Found */
5779
+ 404: {
5780
+ headers: {
5781
+ [name: string]: unknown;
5782
+ };
5783
+ content?: never;
5784
+ };
5785
+ };
5786
+ };
5787
+ GetPayment: {
5788
+ parameters: {
5789
+ query?: never;
5790
+ header?: never;
5791
+ path: {
5792
+ id: string;
5793
+ };
5794
+ cookie?: never;
5795
+ };
5796
+ requestBody?: never;
5797
+ responses: {
5798
+ /** @description OK */
5799
+ 200: {
5800
+ headers: {
5801
+ [name: string]: unknown;
5802
+ };
5803
+ content: {
5804
+ "application/json": components["schemas"]["PaymentResponse"];
5805
+ };
5806
+ };
5807
+ /** @description Not Found */
5808
+ 404: {
5809
+ headers: {
5810
+ [name: string]: unknown;
5811
+ };
5812
+ content?: never;
5813
+ };
5814
+ };
5815
+ };
5591
5816
  ListInsurers: {
5592
5817
  parameters: {
5593
5818
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "1.30.0",
3
+ "version": "1.31.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,