@insurance-broker/api-client 1.28.0 → 1.30.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 +557 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -4,6 +4,196 @@
4
4
  */
5
5
 
6
6
  export interface paths {
7
+ "/api/v1/obligations": {
8
+ parameters: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
14
+ get?: never;
15
+ put?: never;
16
+ /**
17
+ * Record what a customer owes against one of their policies
18
+ * @description PAY-002. Records an amount, a currency, a due date, the payer and the policy the money is owed against.
19
+ *
20
+ * The **currency is not a field**: it is copied from the policy's own premium, so the pair BR-008 requires travels from one source and a caller cannot invent one. The **amount is** a field, because an instalment is a fraction of a premium and no requirement lets this platform decide a payment schedule.
21
+ *
22
+ * The **payer is not a field** either. An obligation is owed by whoever owns the policy, so a customer identifier here could only ever agree or be wrong (ADR-0042 §3).
23
+ *
24
+ * A **due date in the past is accepted**: a book carried across from another system arrives already in arrears, and refusing that would make a migrated debt unrepresentable.
25
+ */
26
+ post: operations["RaiseObligation"];
27
+ delete?: never;
28
+ options?: never;
29
+ head?: never;
30
+ patch?: never;
31
+ trace?: never;
32
+ };
33
+ "/api/v1/obligations/{id}": {
34
+ parameters: {
35
+ query?: never;
36
+ header?: never;
37
+ path?: never;
38
+ cookie?: never;
39
+ };
40
+ /**
41
+ * Read one obligation
42
+ * @description PAY-002. Another broker's obligation 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).
43
+ *
44
+ * There is **no overdue field**. Whether an obligation is overdue is a comparison between its due date and the clock, and step 9.10's lists compute it at read time and return the day they measured against — ADR-0035 §4's rule, which forbids storing a status a date comparison answers.
45
+ */
46
+ get: operations["GetObligation"];
47
+ put?: never;
48
+ post?: never;
49
+ delete?: never;
50
+ options?: never;
51
+ head?: never;
52
+ patch?: never;
53
+ trace?: never;
54
+ };
55
+ "/api/v1/obligations/{id}/cancellation": {
56
+ parameters: {
57
+ query?: never;
58
+ header?: never;
59
+ path?: never;
60
+ cookie?: never;
61
+ };
62
+ get?: never;
63
+ put?: never;
64
+ /**
65
+ * Withdraw an obligation raised in error
66
+ * @description Records that the charge should never have existed. **This is not a write-off**: writing off records that a real debt will not be collected, which is a decision with money behind it and a reason attached, and it arrives in step 9.7. Collapsing the two would make "how much did this broker forgive" unanswerable.
67
+ *
68
+ * Cancelling starts the record's retention clock (ADR-0038 §2), so it is refused a second time rather than silently re-stamped — re-stamping would move the anchor of a record that concluded earlier.
69
+ */
70
+ post: operations["CancelObligation"];
71
+ delete?: never;
72
+ options?: never;
73
+ head?: never;
74
+ patch?: never;
75
+ trace?: never;
76
+ };
77
+ "/api/v1/invoices": {
78
+ parameters: {
79
+ query?: never;
80
+ header?: never;
81
+ path?: never;
82
+ cookie?: never;
83
+ };
84
+ get?: never;
85
+ put?: never;
86
+ /**
87
+ * Open a draft invoice against a policy
88
+ * @description ADR-0042 section 8. Opens an empty draft and pins the basis it was raised against: the premium, its currency and the cover period, copied once from the policy and never recomputed. A policy whose premium is later corrected does not silently change what a customer was invoiced.
89
+ *
90
+ * The **currency is not a field** — it is the policy's own, so BR-008's pair travels from one source. The **payer is not a field** either: an invoice is addressed to whoever owns the policy.
91
+ *
92
+ * A draft has **no total**. The total is fixed once, at issue, from the lines.
93
+ */
94
+ post: operations["DraftInvoice"];
95
+ delete?: never;
96
+ options?: never;
97
+ head?: never;
98
+ patch?: never;
99
+ trace?: never;
100
+ };
101
+ "/api/v1/invoices/{id}/lines": {
102
+ parameters: {
103
+ query?: never;
104
+ header?: never;
105
+ path?: never;
106
+ cookie?: never;
107
+ };
108
+ get?: never;
109
+ put?: never;
110
+ /**
111
+ * Add one charge to a draft invoice
112
+ * @description BR-008's tax and fee components, without this platform naming a tax. **A tax or a fee is a line with a kind**, and the kind is the broker's own word: this platform declares no vocabulary for it.
113
+ *
114
+ * There is **no currency field**. A line is in its invoice's currency or it does not exist, and that is held by a four-column foreign key rather than by this handler.
115
+ *
116
+ * There is **no ordinal field**. The position is derived from the lines already present.
117
+ *
118
+ * Refused once the invoice is issued: issue is a one-way door.
119
+ */
120
+ post: operations["AddInvoiceLine"];
121
+ delete?: never;
122
+ options?: never;
123
+ head?: never;
124
+ patch?: never;
125
+ trace?: never;
126
+ };
127
+ "/api/v1/invoices/{id}/issuance": {
128
+ parameters: {
129
+ query?: never;
130
+ header?: never;
131
+ path?: never;
132
+ cookie?: never;
133
+ };
134
+ get?: never;
135
+ put?: never;
136
+ /**
137
+ * Issue a draft, which fixes its total and closes it
138
+ * @description **The one-way door** (ADR-0042 section 8, BR-010). Issuing sums the lines, stores the total and stamps the instant. After this no route changes a figure on the invoice, and a correction is a credit note — a record of its own, with its own lines — rather than an edit.
139
+ *
140
+ * An invoice with **no lines is refused**: that would be a demand for nothing. A broker charging nil says so with a zero-rated line.
141
+ *
142
+ * Issuing twice is a `409`, and it is not retryable: the invoice is already issued and reading it back is the resolution.
143
+ */
144
+ post: operations["IssueInvoice"];
145
+ delete?: never;
146
+ options?: never;
147
+ head?: never;
148
+ patch?: never;
149
+ trace?: never;
150
+ };
151
+ "/api/v1/invoices/{id}/discarding": {
152
+ parameters: {
153
+ query?: never;
154
+ header?: never;
155
+ path?: never;
156
+ cookie?: never;
157
+ };
158
+ get?: never;
159
+ put?: never;
160
+ /**
161
+ * Abandon a draft that should never have been raised
162
+ * @description Records that this demand was never made — the customer never saw it and owes nothing on account of it. **Only a draft may be discarded.** An issued invoice that should not have been issued is corrected by a credit note, because the customer has seen the demand and BR-010 will not have it silently withdrawn.
163
+ *
164
+ * Discarding starts the record's retention clock (ADR-0038 section 2), so it is refused a second time rather than silently re-stamped.
165
+ */
166
+ post: operations["DiscardInvoice"];
167
+ delete?: never;
168
+ options?: never;
169
+ head?: never;
170
+ patch?: never;
171
+ trace?: never;
172
+ };
173
+ "/api/v1/invoices/{id}": {
174
+ parameters: {
175
+ query?: never;
176
+ header?: never;
177
+ path?: never;
178
+ cookie?: never;
179
+ };
180
+ /**
181
+ * Read one invoice with its lines
182
+ * @description Another broker's invoice 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).
183
+ *
184
+ * The **lines come with the invoice**, because an invoice without its lines is a total with nothing behind it.
185
+ *
186
+ * There is **no balance and no amount paid**: nothing has been paid against anything until payments exist, so either field would be an unreachable zero a reader would take for a fact.
187
+ */
188
+ get: operations["GetInvoice"];
189
+ put?: never;
190
+ post?: never;
191
+ delete?: never;
192
+ options?: never;
193
+ head?: never;
194
+ patch?: never;
195
+ trace?: never;
196
+ };
7
197
  "/api/v1/insurers": {
8
198
  parameters: {
9
199
  query?: never;
@@ -3396,6 +3586,12 @@ export interface components {
3396
3586
  phone: null | string;
3397
3587
  website: null | string;
3398
3588
  };
3589
+ AddInvoiceLineRequest: {
3590
+ kind: string;
3591
+ description: string;
3592
+ /** Format: double */
3593
+ amount: number | string;
3594
+ };
3399
3595
  AddProductCategoryRequest: {
3400
3596
  key: null | string;
3401
3597
  name: null | string;
@@ -3833,6 +4029,10 @@ export interface components {
3833
4029
  retiredAtUtc: null | string;
3834
4030
  retiredBySubjectId: null | string;
3835
4031
  };
4032
+ DraftInvoiceRequest: {
4033
+ /** Format: uuid */
4034
+ policyId: string;
4035
+ };
3836
4036
  EmergencyContactDetailsResponse: {
3837
4037
  providerName: string;
3838
4038
  contactDetail: string;
@@ -4131,6 +4331,44 @@ export interface components {
4131
4331
  email: null | string;
4132
4332
  role: null | string;
4133
4333
  };
4334
+ InvoiceLineResponse: {
4335
+ /** Format: uuid */
4336
+ id: string;
4337
+ /** Format: int32 */
4338
+ ordinal: number | string;
4339
+ kind: string;
4340
+ description: string;
4341
+ /** Format: double */
4342
+ amount: number | string;
4343
+ currency: string;
4344
+ };
4345
+ InvoiceResponse: {
4346
+ /** Format: uuid */
4347
+ id: string;
4348
+ /** Format: uuid */
4349
+ customerId: string;
4350
+ /** Format: uuid */
4351
+ policyId: string;
4352
+ /** Format: uuid */
4353
+ productId: string;
4354
+ /** Format: double */
4355
+ premiumAmount: number | string;
4356
+ currency: string;
4357
+ /** Format: date */
4358
+ coverStart: null | string;
4359
+ /** Format: date */
4360
+ coverEnd: null | string;
4361
+ status: string;
4362
+ /** Format: date-time */
4363
+ draftedAtUtc: string;
4364
+ /** Format: date-time */
4365
+ issuedAtUtc: null | string;
4366
+ /** Format: double */
4367
+ totalAmount: null | number | string;
4368
+ /** Format: date-time */
4369
+ retentionAnchorAtUtc: null | string;
4370
+ lines: components["schemas"]["InvoiceLineResponse"][];
4371
+ };
4134
4372
  IssuedCustomerInvitationResponse: {
4135
4373
  /** Format: uuid */
4136
4374
  id: string;
@@ -4199,6 +4437,27 @@ export interface components {
4199
4437
  /** Format: date */
4200
4438
  incidentOn: string;
4201
4439
  };
4440
+ ObligationResponse: {
4441
+ /** Format: uuid */
4442
+ id: string;
4443
+ /** Format: uuid */
4444
+ customerId: string;
4445
+ /** Format: uuid */
4446
+ policyId: string;
4447
+ /** Format: uuid */
4448
+ productId: string;
4449
+ /** Format: double */
4450
+ amount: number | string;
4451
+ currency: string;
4452
+ /** Format: date */
4453
+ dueOn: string;
4454
+ description: string;
4455
+ status: string;
4456
+ /** Format: date-time */
4457
+ raisedAtUtc: string;
4458
+ /** Format: date-time */
4459
+ retentionAnchorAtUtc: null | string;
4460
+ };
4202
4461
  OfferedFormResponse: {
4203
4462
  /** Format: uuid */
4204
4463
  id: string;
@@ -4621,6 +4880,15 @@ export interface components {
4621
4880
  awaitedFrom: string;
4622
4881
  description: string;
4623
4882
  };
4883
+ RaiseObligationRequest: {
4884
+ /** Format: uuid */
4885
+ policyId: string;
4886
+ /** Format: double */
4887
+ amount: number | string;
4888
+ /** Format: date */
4889
+ dueOn: string;
4890
+ description: string;
4891
+ };
4624
4892
  RaiseOutstandingItemRequest: {
4625
4893
  awaitedFrom: null | string;
4626
4894
  description: null | string;
@@ -5031,6 +5299,295 @@ export interface components {
5031
5299
  }
5032
5300
  export type $defs = Record<string, never>;
5033
5301
  export interface operations {
5302
+ RaiseObligation: {
5303
+ parameters: {
5304
+ query?: never;
5305
+ header?: never;
5306
+ path?: never;
5307
+ cookie?: never;
5308
+ };
5309
+ requestBody: {
5310
+ content: {
5311
+ "application/json": components["schemas"]["RaiseObligationRequest"];
5312
+ };
5313
+ };
5314
+ responses: {
5315
+ /** @description Created */
5316
+ 201: {
5317
+ headers: {
5318
+ [name: string]: unknown;
5319
+ };
5320
+ content: {
5321
+ "application/json": components["schemas"]["ObligationResponse"];
5322
+ };
5323
+ };
5324
+ /** @description Bad Request */
5325
+ 400: {
5326
+ headers: {
5327
+ [name: string]: unknown;
5328
+ };
5329
+ content: {
5330
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
5331
+ };
5332
+ };
5333
+ };
5334
+ };
5335
+ GetObligation: {
5336
+ parameters: {
5337
+ query?: never;
5338
+ header?: never;
5339
+ path: {
5340
+ id: string;
5341
+ };
5342
+ cookie?: never;
5343
+ };
5344
+ requestBody?: never;
5345
+ responses: {
5346
+ /** @description OK */
5347
+ 200: {
5348
+ headers: {
5349
+ [name: string]: unknown;
5350
+ };
5351
+ content: {
5352
+ "application/json": components["schemas"]["ObligationResponse"];
5353
+ };
5354
+ };
5355
+ /** @description Not Found */
5356
+ 404: {
5357
+ headers: {
5358
+ [name: string]: unknown;
5359
+ };
5360
+ content?: never;
5361
+ };
5362
+ };
5363
+ };
5364
+ CancelObligation: {
5365
+ parameters: {
5366
+ query?: never;
5367
+ header?: never;
5368
+ path: {
5369
+ id: string;
5370
+ };
5371
+ cookie?: never;
5372
+ };
5373
+ requestBody?: never;
5374
+ responses: {
5375
+ /** @description OK */
5376
+ 200: {
5377
+ headers: {
5378
+ [name: string]: unknown;
5379
+ };
5380
+ content: {
5381
+ "application/json": components["schemas"]["ObligationResponse"];
5382
+ };
5383
+ };
5384
+ /** @description Not Found */
5385
+ 404: {
5386
+ headers: {
5387
+ [name: string]: unknown;
5388
+ };
5389
+ content?: never;
5390
+ };
5391
+ /** @description Conflict */
5392
+ 409: {
5393
+ headers: {
5394
+ [name: string]: unknown;
5395
+ };
5396
+ content: {
5397
+ "application/problem+json": components["schemas"]["ProblemDetails"];
5398
+ };
5399
+ };
5400
+ };
5401
+ };
5402
+ DraftInvoice: {
5403
+ parameters: {
5404
+ query?: never;
5405
+ header?: never;
5406
+ path?: never;
5407
+ cookie?: never;
5408
+ };
5409
+ requestBody: {
5410
+ content: {
5411
+ "application/json": components["schemas"]["DraftInvoiceRequest"];
5412
+ };
5413
+ };
5414
+ responses: {
5415
+ /** @description Created */
5416
+ 201: {
5417
+ headers: {
5418
+ [name: string]: unknown;
5419
+ };
5420
+ content: {
5421
+ "application/json": components["schemas"]["InvoiceResponse"];
5422
+ };
5423
+ };
5424
+ /** @description Bad Request */
5425
+ 400: {
5426
+ headers: {
5427
+ [name: string]: unknown;
5428
+ };
5429
+ content: {
5430
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
5431
+ };
5432
+ };
5433
+ };
5434
+ };
5435
+ AddInvoiceLine: {
5436
+ parameters: {
5437
+ query?: never;
5438
+ header?: never;
5439
+ path: {
5440
+ id: string;
5441
+ };
5442
+ cookie?: never;
5443
+ };
5444
+ requestBody: {
5445
+ content: {
5446
+ "application/json": components["schemas"]["AddInvoiceLineRequest"];
5447
+ };
5448
+ };
5449
+ responses: {
5450
+ /** @description OK */
5451
+ 200: {
5452
+ headers: {
5453
+ [name: string]: unknown;
5454
+ };
5455
+ content: {
5456
+ "application/json": components["schemas"]["InvoiceResponse"];
5457
+ };
5458
+ };
5459
+ /** @description Bad Request */
5460
+ 400: {
5461
+ headers: {
5462
+ [name: string]: unknown;
5463
+ };
5464
+ content: {
5465
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
5466
+ };
5467
+ };
5468
+ /** @description Not Found */
5469
+ 404: {
5470
+ headers: {
5471
+ [name: string]: unknown;
5472
+ };
5473
+ content?: never;
5474
+ };
5475
+ /** @description Conflict */
5476
+ 409: {
5477
+ headers: {
5478
+ [name: string]: unknown;
5479
+ };
5480
+ content: {
5481
+ "application/problem+json": components["schemas"]["ProblemDetails"];
5482
+ };
5483
+ };
5484
+ };
5485
+ };
5486
+ IssueInvoice: {
5487
+ parameters: {
5488
+ query?: never;
5489
+ header?: never;
5490
+ path: {
5491
+ id: string;
5492
+ };
5493
+ cookie?: never;
5494
+ };
5495
+ requestBody?: never;
5496
+ responses: {
5497
+ /** @description OK */
5498
+ 200: {
5499
+ headers: {
5500
+ [name: string]: unknown;
5501
+ };
5502
+ content: {
5503
+ "application/json": components["schemas"]["InvoiceResponse"];
5504
+ };
5505
+ };
5506
+ /** @description Not Found */
5507
+ 404: {
5508
+ headers: {
5509
+ [name: string]: unknown;
5510
+ };
5511
+ content?: never;
5512
+ };
5513
+ /** @description Conflict */
5514
+ 409: {
5515
+ headers: {
5516
+ [name: string]: unknown;
5517
+ };
5518
+ content: {
5519
+ "application/problem+json": components["schemas"]["ProblemDetails"];
5520
+ };
5521
+ };
5522
+ };
5523
+ };
5524
+ DiscardInvoice: {
5525
+ parameters: {
5526
+ query?: never;
5527
+ header?: never;
5528
+ path: {
5529
+ id: string;
5530
+ };
5531
+ cookie?: never;
5532
+ };
5533
+ requestBody?: never;
5534
+ responses: {
5535
+ /** @description OK */
5536
+ 200: {
5537
+ headers: {
5538
+ [name: string]: unknown;
5539
+ };
5540
+ content: {
5541
+ "application/json": components["schemas"]["InvoiceResponse"];
5542
+ };
5543
+ };
5544
+ /** @description Not Found */
5545
+ 404: {
5546
+ headers: {
5547
+ [name: string]: unknown;
5548
+ };
5549
+ content?: never;
5550
+ };
5551
+ /** @description Conflict */
5552
+ 409: {
5553
+ headers: {
5554
+ [name: string]: unknown;
5555
+ };
5556
+ content: {
5557
+ "application/problem+json": components["schemas"]["ProblemDetails"];
5558
+ };
5559
+ };
5560
+ };
5561
+ };
5562
+ GetInvoice: {
5563
+ parameters: {
5564
+ query?: never;
5565
+ header?: never;
5566
+ path: {
5567
+ id: string;
5568
+ };
5569
+ cookie?: never;
5570
+ };
5571
+ requestBody?: never;
5572
+ responses: {
5573
+ /** @description OK */
5574
+ 200: {
5575
+ headers: {
5576
+ [name: string]: unknown;
5577
+ };
5578
+ content: {
5579
+ "application/json": components["schemas"]["InvoiceResponse"];
5580
+ };
5581
+ };
5582
+ /** @description Not Found */
5583
+ 404: {
5584
+ headers: {
5585
+ [name: string]: unknown;
5586
+ };
5587
+ content?: never;
5588
+ };
5589
+ };
5590
+ };
5034
5591
  ListInsurers: {
5035
5592
  parameters: {
5036
5593
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "1.28.0",
3
+ "version": "1.30.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,