@insurance-broker/api-client 1.46.0 → 1.48.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 +336 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -628,6 +628,116 @@ export interface paths {
628
628
  patch?: never;
629
629
  trace?: never;
630
630
  };
631
+ "/api/v1/customer/charges": {
632
+ parameters: {
633
+ query?: never;
634
+ header?: never;
635
+ path?: never;
636
+ cookie?: never;
637
+ };
638
+ /**
639
+ * See what you owe, and what you have already covered
640
+ * @description PAY-002, PAY-005. Every charge your broker has raised against your policies, oldest due date first, paged by cursor.
641
+ *
642
+ * **You are not named in the request.** There is no customer field and no broker field: the list is whoever is signed in, resolved from the session. Another person's charges are not in it - not filtered out of it, but absent.
643
+ *
644
+ * **This is a live position, not a statement.** Nothing here was produced for you in advance: the figures and the state on each row are worked out as this answer is written, so it can change between one request and the next. A statement is the other thing - a document your broker produced deliberately, for a period, fixed at the moment they produced it - and it is on `/api/v1/customer/statements`.
645
+ *
646
+ * **`state` is one of `due`, `overdue`, `paid` and `closed`**, and nothing stores it. A charge is `overdue` when its due date is before the day this page was measured against and something is still owed on it; that day is returned as `asOf`, so you can bucket the page against your own clock without asking again. `closed` means the charge has finished and nothing further is owed on it.
647
+ *
648
+ * **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 stays consistent. 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.
649
+ *
650
+ * **`balance` is not always `amount` less `paid`.** A charge your broker cancelled is owed nothing, so anything you paid against it counts in your favour; a charge your broker wrote off is owed only what had already arrived, because the rest was forgiven. The same rule your statement uses, so the two cannot disagree.
651
+ *
652
+ * **There is no total.** What you owe overall is a sum across a whole book and across currencies, which is what a statement is for.
653
+ */
654
+ get: operations["ListOwnCharges"];
655
+ put?: never;
656
+ post?: never;
657
+ delete?: never;
658
+ options?: never;
659
+ head?: never;
660
+ patch?: never;
661
+ trace?: never;
662
+ };
663
+ "/api/v1/customer/payments": {
664
+ parameters: {
665
+ query?: never;
666
+ header?: never;
667
+ path?: never;
668
+ cookie?: never;
669
+ };
670
+ /**
671
+ * See the payments your broker has recorded from you
672
+ * @description PAY-005. Every payment recorded against your charges, most recently recorded first, paged by cursor.
673
+ *
674
+ * **Recorded, not taken.** This platform does not collect money: a payment here is your broker writing down that money reached them somewhere else - a bank, a mobile-money service, a counter - with the reference it arrived under. **There is no route here that pays anything**, deliberately.
675
+ *
676
+ * **`state` is `received` or `returned`.** `received` means your broker has recorded the money and it counts against what you owe. `returned` means a reversal was recorded afterwards - the money did not arrive after all, or went back - so it no longer counts. A returned payment stays on this list rather than disappearing from it, because it happened.
677
+ *
678
+ * **No `asOf`**, unlike the charges list: a payment was recorded at an instant this row holds, and nothing about this list moves at midnight.
679
+ *
680
+ * **Each payment names the one charge it was recorded against**, and the policy that charge is owed under.
681
+ */
682
+ get: operations["ListOwnPayments"];
683
+ put?: never;
684
+ post?: never;
685
+ delete?: never;
686
+ options?: never;
687
+ head?: never;
688
+ patch?: never;
689
+ trace?: never;
690
+ };
691
+ "/api/v1/exports/obligations": {
692
+ parameters: {
693
+ query?: never;
694
+ header?: never;
695
+ path?: never;
696
+ cookie?: never;
697
+ };
698
+ get?: never;
699
+ put?: never;
700
+ /**
701
+ * Export this broker's obligations book to CSV or PDF
702
+ * @description RPT-004, under ADM-008's control. Produces a file of exactly the rows `GET /obligations` would return for the same view and filters — no more — and returns the bytes in the response.
703
+ *
704
+ * **Every export is logged before the file is handed over.** A receipt row and an audit entry naming what was exported, by whom, how much and a SHA-256 of the exact bytes are committed in one transaction first; if that commit fails, no data leaves. The receipts are readable at `GET /exports` under a separate key.
705
+ *
706
+ * **Nothing is stored.** The bytes are produced for this response and never written to the object store, so there is no link to fetch later and no file to orphan (ADR-0038 section 7 and section 11). The price is a ceiling: a selection of more than 5000 charges is refused with a `422` naming the count, and the caller narrows by customer, by policy or by view.
707
+ *
708
+ * **A PDF stops far sooner — 500 charges.** It is laid out one paragraph per charge and rendered under a lock the whole process shares, so a hundred-page one would be paid for by every other tenant's documents. The `422` names the format and its own ceiling; the same selection as a CSV carries the full amount.
709
+ *
710
+ * **`customerId` and `policyId` are filters and never authorisation.** The broker is the one in scope; another broker's charges are invisible rather than forbidden.
711
+ */
712
+ post: operations["ExportObligations"];
713
+ delete?: never;
714
+ options?: never;
715
+ head?: never;
716
+ patch?: never;
717
+ trace?: never;
718
+ };
719
+ "/api/v1/exports": {
720
+ parameters: {
721
+ query?: never;
722
+ header?: never;
723
+ path?: never;
724
+ cookie?: never;
725
+ };
726
+ /**
727
+ * What this broker has taken out of the platform, newest first
728
+ * @description ADM-008's logged half, and what SEC-008's alerting reads. One row per export: the dataset, the view, the format, the row count, the byte count, a SHA-256 of the bytes, the filters that were applied, and who produced it — paged by cursor, newest first (ADR-0031).
729
+ *
730
+ * **No row offers the file back.** The bytes were never stored, so there is nothing to re-download; a log entry that handed out a second copy would be a second export with none of the controls that governed the first.
731
+ */
732
+ get: operations["ListExportReceipts"];
733
+ put?: never;
734
+ post?: never;
735
+ delete?: never;
736
+ options?: never;
737
+ head?: never;
738
+ patch?: never;
739
+ trace?: never;
740
+ };
631
741
  "/api/v1/insurers": {
632
742
  parameters: {
633
743
  query?: never;
@@ -5257,6 +5367,29 @@ export interface components {
5257
5367
  issuedBySubjectId: string;
5258
5368
  lines: components["schemas"]["CreditNoteLineResponse"][];
5259
5369
  };
5370
+ CustomerChargePageResponse: {
5371
+ items: components["schemas"]["CustomerChargeResponse"][];
5372
+ nextCursor: null | string;
5373
+ /** Format: date */
5374
+ asOf: string;
5375
+ };
5376
+ CustomerChargeResponse: {
5377
+ /** Format: uuid */
5378
+ id: string;
5379
+ /** Format: uuid */
5380
+ policyId: string;
5381
+ /** Format: double */
5382
+ amount: number | string;
5383
+ /** Format: double */
5384
+ paid: number | string;
5385
+ /** Format: double */
5386
+ balance: number | string;
5387
+ currency: string;
5388
+ /** Format: date */
5389
+ dueOn: string;
5390
+ description: string;
5391
+ state: string;
5392
+ };
5260
5393
  CustomerClaimPage: {
5261
5394
  items: components["schemas"]["ClaimResponse"][];
5262
5395
  nextCursor: null | string;
@@ -5290,6 +5423,26 @@ export interface components {
5290
5423
  /** Format: date-time */
5291
5424
  revokedAtUtc: null | string;
5292
5425
  };
5426
+ CustomerPaymentPageResponse: {
5427
+ items: components["schemas"]["CustomerPaymentResponse"][];
5428
+ nextCursor: null | string;
5429
+ };
5430
+ CustomerPaymentResponse: {
5431
+ /** Format: uuid */
5432
+ id: string;
5433
+ /** Format: uuid */
5434
+ chargeId: string;
5435
+ /** Format: uuid */
5436
+ policyId: string;
5437
+ /** Format: double */
5438
+ amount: number | string;
5439
+ currency: string;
5440
+ source: string;
5441
+ externalReference: string;
5442
+ /** Format: date-time */
5443
+ recordedAtUtc: string;
5444
+ state: string;
5445
+ };
5293
5446
  CustomerPresentedQuoteResponse: {
5294
5447
  /** Format: uuid */
5295
5448
  presentationVersionId: string;
@@ -5519,6 +5672,39 @@ export interface components {
5519
5672
  source: string;
5520
5673
  isResolved: boolean;
5521
5674
  };
5675
+ ExportObligationsRequest: {
5676
+ view: null | string;
5677
+ format: null | string;
5678
+ /** Format: uuid */
5679
+ customerId: null | string;
5680
+ /** Format: uuid */
5681
+ policyId: null | string;
5682
+ };
5683
+ ExportReceiptPage: {
5684
+ items: components["schemas"]["ExportReceiptResponse"][];
5685
+ nextCursor: null | string;
5686
+ };
5687
+ ExportReceiptResponse: {
5688
+ /** Format: uuid */
5689
+ id: string;
5690
+ subject: string;
5691
+ view: string;
5692
+ format: string;
5693
+ /** Format: int32 */
5694
+ rowCount: number | string;
5695
+ /** Format: int64 */
5696
+ byteCount: number | string;
5697
+ contentSha256: string;
5698
+ /** Format: uuid */
5699
+ customerId: null | string;
5700
+ /** Format: uuid */
5701
+ policyId: null | string;
5702
+ /** Format: date */
5703
+ measuredOn: string;
5704
+ /** Format: date-time */
5705
+ producedAtUtc: string;
5706
+ producedBySubjectId: string;
5707
+ };
5522
5708
  FormDefinitionResponse: {
5523
5709
  /** Format: uuid */
5524
5710
  id: string;
@@ -8328,6 +8514,156 @@ export interface operations {
8328
8514
  };
8329
8515
  };
8330
8516
  };
8517
+ ListOwnCharges: {
8518
+ parameters: {
8519
+ query?: {
8520
+ cursor?: string;
8521
+ limit?: number | string;
8522
+ };
8523
+ header?: never;
8524
+ path?: never;
8525
+ cookie?: never;
8526
+ };
8527
+ requestBody?: never;
8528
+ responses: {
8529
+ /** @description OK */
8530
+ 200: {
8531
+ headers: {
8532
+ [name: string]: unknown;
8533
+ };
8534
+ content: {
8535
+ "application/json": components["schemas"]["CustomerChargePageResponse"];
8536
+ };
8537
+ };
8538
+ /** @description Bad Request */
8539
+ 400: {
8540
+ headers: {
8541
+ [name: string]: unknown;
8542
+ };
8543
+ content: {
8544
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
8545
+ };
8546
+ };
8547
+ };
8548
+ };
8549
+ ListOwnPayments: {
8550
+ parameters: {
8551
+ query?: {
8552
+ cursor?: string;
8553
+ limit?: number | string;
8554
+ };
8555
+ header?: never;
8556
+ path?: never;
8557
+ cookie?: never;
8558
+ };
8559
+ requestBody?: never;
8560
+ responses: {
8561
+ /** @description OK */
8562
+ 200: {
8563
+ headers: {
8564
+ [name: string]: unknown;
8565
+ };
8566
+ content: {
8567
+ "application/json": components["schemas"]["CustomerPaymentPageResponse"];
8568
+ };
8569
+ };
8570
+ /** @description Bad Request */
8571
+ 400: {
8572
+ headers: {
8573
+ [name: string]: unknown;
8574
+ };
8575
+ content: {
8576
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
8577
+ };
8578
+ };
8579
+ };
8580
+ };
8581
+ ExportObligations: {
8582
+ parameters: {
8583
+ query?: never;
8584
+ header?: never;
8585
+ path?: never;
8586
+ cookie?: never;
8587
+ };
8588
+ requestBody: {
8589
+ content: {
8590
+ "application/json": components["schemas"]["ExportObligationsRequest"];
8591
+ };
8592
+ };
8593
+ responses: {
8594
+ /** @description OK */
8595
+ 200: {
8596
+ headers: {
8597
+ [name: string]: unknown;
8598
+ };
8599
+ content?: never;
8600
+ };
8601
+ /** @description Bad Request */
8602
+ 400: {
8603
+ headers: {
8604
+ [name: string]: unknown;
8605
+ };
8606
+ content: {
8607
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
8608
+ };
8609
+ };
8610
+ /** @description Forbidden */
8611
+ 403: {
8612
+ headers: {
8613
+ [name: string]: unknown;
8614
+ };
8615
+ content?: never;
8616
+ };
8617
+ /** @description Unprocessable Entity */
8618
+ 422: {
8619
+ headers: {
8620
+ [name: string]: unknown;
8621
+ };
8622
+ content: {
8623
+ "application/problem+json": components["schemas"]["ProblemDetails"];
8624
+ };
8625
+ };
8626
+ };
8627
+ };
8628
+ ListExportReceipts: {
8629
+ parameters: {
8630
+ query?: {
8631
+ cursor?: string;
8632
+ limit?: number | string;
8633
+ };
8634
+ header?: never;
8635
+ path?: never;
8636
+ cookie?: never;
8637
+ };
8638
+ requestBody?: never;
8639
+ responses: {
8640
+ /** @description OK */
8641
+ 200: {
8642
+ headers: {
8643
+ [name: string]: unknown;
8644
+ };
8645
+ content: {
8646
+ "application/json": components["schemas"]["ExportReceiptPage"];
8647
+ };
8648
+ };
8649
+ /** @description Bad Request */
8650
+ 400: {
8651
+ headers: {
8652
+ [name: string]: unknown;
8653
+ };
8654
+ content: {
8655
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
8656
+ };
8657
+ };
8658
+ /** @description Forbidden */
8659
+ 403: {
8660
+ headers: {
8661
+ [name: string]: unknown;
8662
+ };
8663
+ content?: never;
8664
+ };
8665
+ };
8666
+ };
8331
8667
  ListInsurers: {
8332
8668
  parameters: {
8333
8669
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "1.46.0",
3
+ "version": "1.48.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,