@insurance-broker/api-client 1.36.0 → 1.38.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 +410 -2
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -11,7 +11,19 @@ export interface paths {
11
11
  path?: never;
12
12
  cookie?: never;
13
13
  };
14
- get?: never;
14
+ /**
15
+ * List what this broker is owed, what is overdue, and what has concluded
16
+ * @description PAY-002. Five views over one collection, oldest due date first, paged by cursor: `owed`, `overdue`, `settled`, `written-off` and `cancelled`. A `customerId` or a `policyId` narrows any of them.
17
+ *
18
+ * **Nothing stores `overdue`.** A charge is overdue when its due date is before the day the page was measured against and its balance is above nil, computed as the page is read (ADR-0042 section 9, section 14). The day is returned as `asOf` on every page, so a page saying nine charges are overdue also says what overdue meant when it said so.
19
+ *
20
+ * **One walk is measured against one day.** `asOf` is read from the clock on the first page and carried inside the cursor, so a walk crossing UTC midnight cannot lose the tie group it is inside. A walk resumed the next morning therefore serves the previous day's buckets: compare `asOf` with your own clock and start a new walk without a cursor.
21
+ *
22
+ * **`balance` is not always `amount` less `paid`.** A cancelled charge is owed nothing, so money paid against one leaves the customer in credit; a written-off charge is owed what actually arrived and no more, because a write-off forgives the remainder rather than the part that was paid. The same rule the customer's statement uses.
23
+ *
24
+ * **`customerId` and `policyId` are filters and never authorisation.** The broker whose charges these are comes from the session; naming a customer here selects among this broker's own rows and can reach nobody else's.
25
+ */
26
+ get: operations["ListObligations"];
15
27
  put?: never;
16
28
  /**
17
29
  * Record what a customer owes against one of their policies
@@ -306,6 +318,34 @@ export interface paths {
306
318
  patch?: never;
307
319
  trace?: never;
308
320
  };
321
+ "/api/v1/payments": {
322
+ parameters: {
323
+ query?: never;
324
+ header?: never;
325
+ path?: never;
326
+ cookie?: never;
327
+ };
328
+ /**
329
+ * List the money this broker has recorded, most recent first
330
+ * @description PAY-005. The payments this broker has recorded, ordered by when they posted, paged by cursor. A `customerId` or an `obligationId` narrows the list.
331
+ *
332
+ * **There is no `asOf` here, unlike `GET /obligations`.** Nothing in this list's predicate reads the clock - a payment posted at an instant the row records - so a member reporting when the page was measured would read as a freshness guarantee while guaranteeing nothing.
333
+ *
334
+ * **A reversed payment stays on the list** and carries `reversed: true`. Money that arrived and was sent back is a fact a reconciliation has to see, and a reversal is its own record rather than an edit to this one (ADR-0042 section 8).
335
+ *
336
+ * **Rows carry no subject identifiers.** Who recorded a payment and who approved it is the separation-of-duties record and it is on the payment itself, so a page-sized read cannot enumerate a broker's finance staff.
337
+ *
338
+ * **`customerId` and `obligationId` are filters and never authorisation.** The broker whose payments these are comes from the session.
339
+ */
340
+ get: operations["ListPayments"];
341
+ put?: never;
342
+ post?: never;
343
+ delete?: never;
344
+ options?: never;
345
+ head?: never;
346
+ patch?: never;
347
+ trace?: never;
348
+ };
309
349
  "/api/v1/payments/{id}": {
310
350
  parameters: {
311
351
  query?: never;
@@ -2801,7 +2841,9 @@ export interface paths {
2801
2841
  put?: never;
2802
2842
  /**
2803
2843
  * Record what the insurer confirmed
2804
- * @description Records the insurer's own reference and the date the insurer confirmed cover from, and makes the policy active. This is the only way a policy becomes active: the platform does not bind cover, so active is what an insurer confirmed and never something a caller asserts.
2844
+ * @description Records the insurer's own reference and the date the insurer confirmed cover from. This is the only way a policy leaves `pendingInsurer`: the platform does not bind cover, so what happens next is what an insurer confirmed and never something a caller asserts.
2845
+ *
2846
+ * **Where it lands depends on whether this broker has declared a payment gate** (`GET /policies/payment-gates`, BR-004). With no gate - which is every broker that has configured nothing - the policy becomes `active`. With one, it becomes `pendingPayment`, and cover begins when somebody records that the requirement was met.
2805
2847
  */
2806
2848
  post: operations["RecordInsurerConfirmation"];
2807
2849
  delete?: never;
@@ -2810,6 +2852,32 @@ export interface paths {
2810
2852
  patch?: never;
2811
2853
  trace?: never;
2812
2854
  };
2855
+ "/api/v1/policies/{id}/payment-requirement": {
2856
+ parameters: {
2857
+ query?: never;
2858
+ header?: never;
2859
+ path?: never;
2860
+ cookie?: never;
2861
+ };
2862
+ get?: never;
2863
+ put?: never;
2864
+ /**
2865
+ * Record that the outstanding payment requirement has been met
2866
+ * @description BR-004. Releases a policy this broker's payment gate is holding, naming the billing record the recorder relied on, and makes it `active`.
2867
+ *
2868
+ * **A payment posting does not do this** (ADR-0042 section 7). If it did, the platform would be asserting that cover began. A person looks at a payment and records that the requirement is discharged: the payment is the evidence, the person is the actor, and the platform is neither. There is no consumer, no sweep and no side effect that reaches this route.
2869
+ *
2870
+ * **Only a policy in `pendingPayment` can be released, and only once.** Recording it against a policy no gate ever held would write an evidence trail for a requirement that never existed.
2871
+ *
2872
+ * **The `paymentId` is recorded and not verified.** The payment lives in another module this one may not read (ADR-0002), so a mistyped identifier is a bad record rather than a refusal - issue #306 carries the contract that would check it.
2873
+ */
2874
+ post: operations["RecordPaymentRequirementMet"];
2875
+ delete?: never;
2876
+ options?: never;
2877
+ head?: never;
2878
+ patch?: never;
2879
+ trace?: never;
2880
+ };
2813
2881
  "/api/v1/policies/{id}": {
2814
2882
  parameters: {
2815
2883
  query?: never;
@@ -2827,6 +2895,62 @@ export interface paths {
2827
2895
  patch?: never;
2828
2896
  trace?: never;
2829
2897
  };
2898
+ "/api/v1/policies/payment-gates": {
2899
+ parameters: {
2900
+ query?: never;
2901
+ header?: never;
2902
+ path?: never;
2903
+ cookie?: never;
2904
+ };
2905
+ /**
2906
+ * Whether this broker's cover waits for a payment
2907
+ * @description BR-004. Every gate this broker has declared: one for its whole book, one per product, or any combination.
2908
+ *
2909
+ * **An empty list is the normal answer and it means no gate.** Cover begins when the insurer's confirmation is recorded, which is what this platform did before step 9.11. A row exists only where a broker has asked for the gate, so there is nothing to turn off and nothing to seed.
2910
+ *
2911
+ * **A gate for the whole book cannot be exempted for one product.** An exemption would be a claim about a broker's credit policy that BR-004 does not ask this platform to model; a broker wanting to gate all but one product declares the rest.
2912
+ */
2913
+ get: operations["ReadPaymentGates"];
2914
+ put?: never;
2915
+ /**
2916
+ * Declare that cover waits for a payment
2917
+ * @description BR-004. Records that a payment must be recorded before cover begins - for every product this broker sells, or for one of them.
2918
+ *
2919
+ * **It changes no existing policy.** A confirmation resolves the gate at the instant it is recorded, so a policy already active stays active and one already held stays held. What changes is where the *next* confirmation lands: `PendingPayment` instead of `Active`.
2920
+ *
2921
+ * **Declaring the same gate twice is a `409`.** The row is the declaration, so a second one would be the same fact recorded twice with two authors and two instants.
2922
+ *
2923
+ * **A product this broker does not sell is a `400`.** Checked through the catalogue before the row is written.
2924
+ */
2925
+ post: operations["DeclarePaymentGate"];
2926
+ delete?: never;
2927
+ options?: never;
2928
+ head?: never;
2929
+ patch?: never;
2930
+ trace?: never;
2931
+ };
2932
+ "/api/v1/policies/payment-gates/{id}": {
2933
+ parameters: {
2934
+ query?: never;
2935
+ header?: never;
2936
+ path?: never;
2937
+ cookie?: never;
2938
+ };
2939
+ get?: never;
2940
+ put?: never;
2941
+ post?: never;
2942
+ /**
2943
+ * Stop requiring a payment before cover begins
2944
+ * @description Deletes the declaration. No gate applies by absence, which is what an empty table means.
2945
+ *
2946
+ * **Policies already held are not released by this.** They stay `PendingPayment` until somebody records that the requirement was met, because releasing cover is an act with an author and evidence (ADR-0042 section 7) and withdrawing a rule is neither. A broker that gated its book by mistake releases each held policy deliberately.
2947
+ */
2948
+ delete: operations["WithdrawPaymentGate"];
2949
+ options?: never;
2950
+ head?: never;
2951
+ patch?: never;
2952
+ trace?: never;
2953
+ };
2830
2954
  "/api/v1/policies/{id}/documents/{kind}": {
2831
2955
  parameters: {
2832
2956
  query?: never;
@@ -4411,6 +4535,10 @@ export interface components {
4411
4535
  key: null | string;
4412
4536
  name: null | string;
4413
4537
  };
4538
+ DeclarePaymentGateRequest: {
4539
+ /** Format: uuid */
4540
+ productId: null | string;
4541
+ };
4414
4542
  DeclineQuoteRequest: {
4415
4543
  /** Format: uuid */
4416
4544
  presentationVersionId: null | string;
@@ -4867,6 +4995,12 @@ export interface components {
4867
4995
  /** Format: date */
4868
4996
  incidentOn: string;
4869
4997
  };
4998
+ ObligationPage: {
4999
+ items: components["schemas"]["ObligationSummaryResponse"][];
5000
+ nextCursor: null | string;
5001
+ /** Format: date */
5002
+ asOf: string;
5003
+ };
4870
5004
  ObligationResponse: {
4871
5005
  /** Format: uuid */
4872
5006
  id: string;
@@ -4889,6 +5023,27 @@ export interface components {
4889
5023
  retentionAnchorAtUtc: null | string;
4890
5024
  writeOffReason: null | string;
4891
5025
  };
5026
+ ObligationSummaryResponse: {
5027
+ /** Format: uuid */
5028
+ id: string;
5029
+ /** Format: uuid */
5030
+ customerId: string;
5031
+ /** Format: uuid */
5032
+ policyId: string;
5033
+ /** Format: uuid */
5034
+ productId: string;
5035
+ /** Format: double */
5036
+ amount: number | string;
5037
+ /** Format: double */
5038
+ paid: number | string;
5039
+ /** Format: double */
5040
+ balance: number | string;
5041
+ currency: string;
5042
+ /** Format: date */
5043
+ dueOn: string;
5044
+ description: string;
5045
+ status: string;
5046
+ };
4892
5047
  OfferedFormResponse: {
4893
5048
  /** Format: uuid */
4894
5049
  id: string;
@@ -5025,6 +5180,20 @@ export interface components {
5025
5180
  PaymentEvidenceUpload: {
5026
5181
  file: components["schemas"]["IFormFile"];
5027
5182
  };
5183
+ PaymentGateResponse: {
5184
+ /** Format: uuid */
5185
+ id: string;
5186
+ /** Format: uuid */
5187
+ productId: null | string;
5188
+ appliesToEveryProduct: boolean;
5189
+ /** Format: date-time */
5190
+ setAtUtc: string;
5191
+ setBySubjectId: string;
5192
+ };
5193
+ PaymentPage: {
5194
+ items: components["schemas"]["PaymentSummaryResponse"][];
5195
+ nextCursor: null | string;
5196
+ };
5028
5197
  PaymentResponse: {
5029
5198
  /** Format: uuid */
5030
5199
  id: string;
@@ -5058,6 +5227,25 @@ export interface components {
5058
5227
  reversedAtUtc: string;
5059
5228
  reversedBySubjectId: string;
5060
5229
  };
5230
+ PaymentSummaryResponse: {
5231
+ /** Format: uuid */
5232
+ id: string;
5233
+ /** Format: uuid */
5234
+ obligationId: string;
5235
+ /** Format: uuid */
5236
+ customerId: string;
5237
+ /** Format: double */
5238
+ amount: number | string;
5239
+ currency: string;
5240
+ source: string;
5241
+ externalReference: string;
5242
+ status: string;
5243
+ /** Format: date-time */
5244
+ postedAtUtc: string;
5245
+ /** Format: date-time */
5246
+ approvedAtUtc: null | string;
5247
+ reversed: boolean;
5248
+ };
5061
5249
  PlaceLegalHoldRequest: {
5062
5250
  moduleName: null | string;
5063
5251
  entityType: null | string;
@@ -5150,6 +5338,11 @@ export interface components {
5150
5338
  /** Format: date-time */
5151
5339
  importedAtUtc: null | string;
5152
5340
  importedBySubjectId: null | string;
5341
+ /** Format: date-time */
5342
+ paymentRequirementMetAtUtc: null | string;
5343
+ paymentRequirementMetBySubjectId: null | string;
5344
+ /** Format: uuid */
5345
+ paymentEvidenceReference: null | string;
5153
5346
  };
5154
5347
  PresentationBodyResponse: {
5155
5348
  version: components["schemas"]["PresentationVersionResponse"];
@@ -5462,6 +5655,10 @@ export interface components {
5462
5655
  source: string;
5463
5656
  externalReference: string;
5464
5657
  };
5658
+ RecordPaymentRequirementMetRequest: {
5659
+ /** Format: uuid */
5660
+ paymentId: null | string;
5661
+ };
5465
5662
  RecordRenewalCustomerInformationRequest: {
5466
5663
  /** Format: uuid */
5467
5664
  formSubmissionId: null | string;
@@ -5907,6 +6104,41 @@ export interface components {
5907
6104
  }
5908
6105
  export type $defs = Record<string, never>;
5909
6106
  export interface operations {
6107
+ ListObligations: {
6108
+ parameters: {
6109
+ query?: {
6110
+ view?: string;
6111
+ customerId?: string;
6112
+ policyId?: string;
6113
+ cursor?: string;
6114
+ limit?: number | string;
6115
+ };
6116
+ header?: never;
6117
+ path?: never;
6118
+ cookie?: never;
6119
+ };
6120
+ requestBody?: never;
6121
+ responses: {
6122
+ /** @description OK */
6123
+ 200: {
6124
+ headers: {
6125
+ [name: string]: unknown;
6126
+ };
6127
+ content: {
6128
+ "application/json": components["schemas"]["ObligationPage"];
6129
+ };
6130
+ };
6131
+ /** @description Bad Request */
6132
+ 400: {
6133
+ headers: {
6134
+ [name: string]: unknown;
6135
+ };
6136
+ content: {
6137
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
6138
+ };
6139
+ };
6140
+ };
6141
+ };
5910
6142
  RaiseObligation: {
5911
6143
  parameters: {
5912
6144
  query?: never;
@@ -6407,6 +6639,40 @@ export interface operations {
6407
6639
  };
6408
6640
  };
6409
6641
  };
6642
+ ListPayments: {
6643
+ parameters: {
6644
+ query?: {
6645
+ customerId?: string;
6646
+ obligationId?: string;
6647
+ cursor?: string;
6648
+ limit?: number | string;
6649
+ };
6650
+ header?: never;
6651
+ path?: never;
6652
+ cookie?: never;
6653
+ };
6654
+ requestBody?: never;
6655
+ responses: {
6656
+ /** @description OK */
6657
+ 200: {
6658
+ headers: {
6659
+ [name: string]: unknown;
6660
+ };
6661
+ content: {
6662
+ "application/json": components["schemas"]["PaymentPage"];
6663
+ };
6664
+ };
6665
+ /** @description Bad Request */
6666
+ 400: {
6667
+ headers: {
6668
+ [name: string]: unknown;
6669
+ };
6670
+ content: {
6671
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
6672
+ };
6673
+ };
6674
+ };
6675
+ };
6410
6676
  GetPayment: {
6411
6677
  parameters: {
6412
6678
  query?: never;
@@ -12368,6 +12634,59 @@ export interface operations {
12368
12634
  };
12369
12635
  };
12370
12636
  };
12637
+ RecordPaymentRequirementMet: {
12638
+ parameters: {
12639
+ query?: never;
12640
+ header?: never;
12641
+ path: {
12642
+ id: string;
12643
+ };
12644
+ cookie?: never;
12645
+ };
12646
+ requestBody: {
12647
+ content: {
12648
+ "application/json": components["schemas"]["RecordPaymentRequirementMetRequest"];
12649
+ };
12650
+ };
12651
+ responses: {
12652
+ /** @description OK */
12653
+ 200: {
12654
+ headers: {
12655
+ [name: string]: unknown;
12656
+ };
12657
+ content: {
12658
+ "application/json": components["schemas"]["PolicyResponse"];
12659
+ };
12660
+ };
12661
+ /** @description Bad Request */
12662
+ 400: {
12663
+ headers: {
12664
+ [name: string]: unknown;
12665
+ };
12666
+ content: {
12667
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
12668
+ };
12669
+ };
12670
+ /** @description Not Found */
12671
+ 404: {
12672
+ headers: {
12673
+ [name: string]: unknown;
12674
+ };
12675
+ content: {
12676
+ "application/problem+json": components["schemas"]["ProblemDetails"];
12677
+ };
12678
+ };
12679
+ /** @description Conflict */
12680
+ 409: {
12681
+ headers: {
12682
+ [name: string]: unknown;
12683
+ };
12684
+ content: {
12685
+ "application/problem+json": components["schemas"]["ProblemDetails"];
12686
+ };
12687
+ };
12688
+ };
12689
+ };
12371
12690
  GetPolicy: {
12372
12691
  parameters: {
12373
12692
  query?: never;
@@ -12399,6 +12718,95 @@ export interface operations {
12399
12718
  };
12400
12719
  };
12401
12720
  };
12721
+ ReadPaymentGates: {
12722
+ parameters: {
12723
+ query?: never;
12724
+ header?: never;
12725
+ path?: never;
12726
+ cookie?: never;
12727
+ };
12728
+ requestBody?: never;
12729
+ responses: {
12730
+ /** @description OK */
12731
+ 200: {
12732
+ headers: {
12733
+ [name: string]: unknown;
12734
+ };
12735
+ content: {
12736
+ "application/json": components["schemas"]["PaymentGateResponse"][];
12737
+ };
12738
+ };
12739
+ };
12740
+ };
12741
+ DeclarePaymentGate: {
12742
+ parameters: {
12743
+ query?: never;
12744
+ header?: never;
12745
+ path?: never;
12746
+ cookie?: never;
12747
+ };
12748
+ requestBody: {
12749
+ content: {
12750
+ "application/json": components["schemas"]["DeclarePaymentGateRequest"];
12751
+ };
12752
+ };
12753
+ responses: {
12754
+ /** @description Created */
12755
+ 201: {
12756
+ headers: {
12757
+ [name: string]: unknown;
12758
+ };
12759
+ content: {
12760
+ "application/json": components["schemas"]["PaymentGateResponse"];
12761
+ };
12762
+ };
12763
+ /** @description Bad Request */
12764
+ 400: {
12765
+ headers: {
12766
+ [name: string]: unknown;
12767
+ };
12768
+ content: {
12769
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
12770
+ };
12771
+ };
12772
+ /** @description Conflict */
12773
+ 409: {
12774
+ headers: {
12775
+ [name: string]: unknown;
12776
+ };
12777
+ content: {
12778
+ "application/problem+json": components["schemas"]["ProblemDetails"];
12779
+ };
12780
+ };
12781
+ };
12782
+ };
12783
+ WithdrawPaymentGate: {
12784
+ parameters: {
12785
+ query?: never;
12786
+ header?: never;
12787
+ path: {
12788
+ id: string;
12789
+ };
12790
+ cookie?: never;
12791
+ };
12792
+ requestBody?: never;
12793
+ responses: {
12794
+ /** @description No Content */
12795
+ 204: {
12796
+ headers: {
12797
+ [name: string]: unknown;
12798
+ };
12799
+ content?: never;
12800
+ };
12801
+ /** @description Not Found */
12802
+ 404: {
12803
+ headers: {
12804
+ [name: string]: unknown;
12805
+ };
12806
+ content?: never;
12807
+ };
12808
+ };
12809
+ };
12402
12810
  UploadPolicyDocument: {
12403
12811
  parameters: {
12404
12812
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "1.36.0",
3
+ "version": "1.38.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,