@insurance-broker/api-client 1.45.0 → 1.47.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 +321 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -628,6 +628,56 @@ export interface paths {
628
628
  patch?: never;
629
629
  trace?: never;
630
630
  };
631
+ "/api/v1/exports/obligations": {
632
+ parameters: {
633
+ query?: never;
634
+ header?: never;
635
+ path?: never;
636
+ cookie?: never;
637
+ };
638
+ get?: never;
639
+ put?: never;
640
+ /**
641
+ * Export this broker's obligations book to CSV or PDF
642
+ * @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.
643
+ *
644
+ * **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.
645
+ *
646
+ * **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.
647
+ *
648
+ * **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.
649
+ *
650
+ * **`customerId` and `policyId` are filters and never authorisation.** The broker is the one in scope; another broker's charges are invisible rather than forbidden.
651
+ */
652
+ post: operations["ExportObligations"];
653
+ delete?: never;
654
+ options?: never;
655
+ head?: never;
656
+ patch?: never;
657
+ trace?: never;
658
+ };
659
+ "/api/v1/exports": {
660
+ parameters: {
661
+ query?: never;
662
+ header?: never;
663
+ path?: never;
664
+ cookie?: never;
665
+ };
666
+ /**
667
+ * What this broker has taken out of the platform, newest first
668
+ * @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).
669
+ *
670
+ * **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.
671
+ */
672
+ get: operations["ListExportReceipts"];
673
+ put?: never;
674
+ post?: never;
675
+ delete?: never;
676
+ options?: never;
677
+ head?: never;
678
+ patch?: never;
679
+ trace?: never;
680
+ };
631
681
  "/api/v1/insurers": {
632
682
  parameters: {
633
683
  query?: never;
@@ -4816,6 +4866,46 @@ export interface paths {
4816
4866
  patch?: never;
4817
4867
  trace?: never;
4818
4868
  };
4869
+ "/api/v1/dashboards/leads": {
4870
+ parameters: {
4871
+ query?: never;
4872
+ header?: never;
4873
+ path?: never;
4874
+ cookie?: never;
4875
+ };
4876
+ /**
4877
+ * How many enquiries arrived, how many nobody has taken, and where they came from
4878
+ * @description The lead funnel, read from phase 10's read model rather than from the module that owns leads (ADR-0047). Filter by a period and by a source; the response echoes both, so a figure carries its own question. Every response reports an as-at, which is the oldest projection instant among the rows counted: a read model is written when the Worker consumes an event, so a figure from one is about a recent past, and a count is only as current as its least-current row. A count of nil has no as-at, because it lags nothing. RPT-001 names eleven subjects and this is the only one with a read model behind it: the rest wait on the modules that own those facts publishing the lifecycle events to feed one, and a dashboard built over their tables instead would be the cross-module join the platform forbids everywhere else.
4879
+ */
4880
+ get: operations["ReadLeadFunnelDashboard"];
4881
+ put?: never;
4882
+ post?: never;
4883
+ delete?: never;
4884
+ options?: never;
4885
+ head?: never;
4886
+ patch?: never;
4887
+ trace?: never;
4888
+ };
4889
+ "/api/v1/dashboards/leads/entries": {
4890
+ parameters: {
4891
+ query?: never;
4892
+ header?: never;
4893
+ path?: never;
4894
+ cookie?: never;
4895
+ };
4896
+ /**
4897
+ * The leads behind a figure on the funnel dashboard
4898
+ * @description The rows the dashboard counted, newest first, paged by an opaque cursor. The filters are the dashboard's own plus 'assigned', which is how the unassigned figure is traced to its rows. Identifiers and dates only: a lead's name and contact details stay in the module that owns them, so this projection never becomes a second copy of personal data somebody has to find at erasure time (ADR-0047 section 6). There is no branch filter and no staff-member filter: the read model carries neither a branch nor a person, and resolving either would be a read of another module's tables.
4899
+ */
4900
+ get: operations["ListLeadFunnelEntries"];
4901
+ put?: never;
4902
+ post?: never;
4903
+ delete?: never;
4904
+ options?: never;
4905
+ head?: never;
4906
+ patch?: never;
4907
+ trace?: never;
4908
+ };
4819
4909
  "/api/v1/notifications": {
4820
4910
  parameters: {
4821
4911
  query?: never;
@@ -5479,6 +5569,39 @@ export interface components {
5479
5569
  source: string;
5480
5570
  isResolved: boolean;
5481
5571
  };
5572
+ ExportObligationsRequest: {
5573
+ view: null | string;
5574
+ format: null | string;
5575
+ /** Format: uuid */
5576
+ customerId: null | string;
5577
+ /** Format: uuid */
5578
+ policyId: null | string;
5579
+ };
5580
+ ExportReceiptPage: {
5581
+ items: components["schemas"]["ExportReceiptResponse"][];
5582
+ nextCursor: null | string;
5583
+ };
5584
+ ExportReceiptResponse: {
5585
+ /** Format: uuid */
5586
+ id: string;
5587
+ subject: string;
5588
+ view: string;
5589
+ format: string;
5590
+ /** Format: int32 */
5591
+ rowCount: number | string;
5592
+ /** Format: int64 */
5593
+ byteCount: number | string;
5594
+ contentSha256: string;
5595
+ /** Format: uuid */
5596
+ customerId: null | string;
5597
+ /** Format: uuid */
5598
+ policyId: null | string;
5599
+ /** Format: date */
5600
+ measuredOn: string;
5601
+ /** Format: date-time */
5602
+ producedAtUtc: string;
5603
+ producedBySubjectId: string;
5604
+ };
5482
5605
  FormDefinitionResponse: {
5483
5606
  /** Format: uuid */
5484
5607
  id: string;
@@ -5827,6 +5950,49 @@ export interface components {
5827
5950
  integrationName: null | string;
5828
5951
  };
5829
5952
  JsonElement: unknown;
5953
+ LeadFunnelDashboard: {
5954
+ /** Format: date-time */
5955
+ from: null | string;
5956
+ /** Format: date-time */
5957
+ to: null | string;
5958
+ source: null | string;
5959
+ /** Format: int32 */
5960
+ arrived: number | string;
5961
+ /** Format: int32 */
5962
+ unassigned: number | string;
5963
+ /** Format: int32 */
5964
+ assigned: number | string;
5965
+ bySource: components["schemas"]["LeadFunnelSourceRow"][];
5966
+ /** Format: date-time */
5967
+ asAtUtc: null | string;
5968
+ };
5969
+ LeadFunnelEntryPage: {
5970
+ items: components["schemas"]["LeadFunnelEntryResponse"][];
5971
+ nextCursor: null | string;
5972
+ /** Format: date-time */
5973
+ asAtUtc: null | string;
5974
+ };
5975
+ LeadFunnelEntryResponse: {
5976
+ /** Format: uuid */
5977
+ leadId: string;
5978
+ source: string;
5979
+ /** Format: date-time */
5980
+ createdAtUtc: string;
5981
+ assignedToSubjectId: null | string;
5982
+ /** Format: date-time */
5983
+ assignedAtUtc: null | string;
5984
+ /** Format: date-time */
5985
+ projectedAtUtc: string;
5986
+ };
5987
+ LeadFunnelSourceRow: {
5988
+ source: string;
5989
+ /** Format: int32 */
5990
+ arrived: number | string;
5991
+ /** Format: int32 */
5992
+ unassigned: number | string;
5993
+ /** Format: int32 */
5994
+ assigned: number | string;
5995
+ };
5830
5996
  LeadResponse: {
5831
5997
  /** Format: uuid */
5832
5998
  id: string;
@@ -8245,6 +8411,92 @@ export interface operations {
8245
8411
  };
8246
8412
  };
8247
8413
  };
8414
+ ExportObligations: {
8415
+ parameters: {
8416
+ query?: never;
8417
+ header?: never;
8418
+ path?: never;
8419
+ cookie?: never;
8420
+ };
8421
+ requestBody: {
8422
+ content: {
8423
+ "application/json": components["schemas"]["ExportObligationsRequest"];
8424
+ };
8425
+ };
8426
+ responses: {
8427
+ /** @description OK */
8428
+ 200: {
8429
+ headers: {
8430
+ [name: string]: unknown;
8431
+ };
8432
+ content?: never;
8433
+ };
8434
+ /** @description Bad Request */
8435
+ 400: {
8436
+ headers: {
8437
+ [name: string]: unknown;
8438
+ };
8439
+ content: {
8440
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
8441
+ };
8442
+ };
8443
+ /** @description Forbidden */
8444
+ 403: {
8445
+ headers: {
8446
+ [name: string]: unknown;
8447
+ };
8448
+ content?: never;
8449
+ };
8450
+ /** @description Unprocessable Entity */
8451
+ 422: {
8452
+ headers: {
8453
+ [name: string]: unknown;
8454
+ };
8455
+ content: {
8456
+ "application/problem+json": components["schemas"]["ProblemDetails"];
8457
+ };
8458
+ };
8459
+ };
8460
+ };
8461
+ ListExportReceipts: {
8462
+ parameters: {
8463
+ query?: {
8464
+ cursor?: string;
8465
+ limit?: number | string;
8466
+ };
8467
+ header?: never;
8468
+ path?: never;
8469
+ cookie?: never;
8470
+ };
8471
+ requestBody?: never;
8472
+ responses: {
8473
+ /** @description OK */
8474
+ 200: {
8475
+ headers: {
8476
+ [name: string]: unknown;
8477
+ };
8478
+ content: {
8479
+ "application/json": components["schemas"]["ExportReceiptPage"];
8480
+ };
8481
+ };
8482
+ /** @description Bad Request */
8483
+ 400: {
8484
+ headers: {
8485
+ [name: string]: unknown;
8486
+ };
8487
+ content: {
8488
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
8489
+ };
8490
+ };
8491
+ /** @description Forbidden */
8492
+ 403: {
8493
+ headers: {
8494
+ [name: string]: unknown;
8495
+ };
8496
+ content?: never;
8497
+ };
8498
+ };
8499
+ };
8248
8500
  ListInsurers: {
8249
8501
  parameters: {
8250
8502
  query?: {
@@ -19104,6 +19356,75 @@ export interface operations {
19104
19356
  };
19105
19357
  };
19106
19358
  };
19359
+ ReadLeadFunnelDashboard: {
19360
+ parameters: {
19361
+ query?: {
19362
+ from?: string;
19363
+ to?: string;
19364
+ source?: string;
19365
+ };
19366
+ header?: never;
19367
+ path?: never;
19368
+ cookie?: never;
19369
+ };
19370
+ requestBody?: never;
19371
+ responses: {
19372
+ /** @description OK */
19373
+ 200: {
19374
+ headers: {
19375
+ [name: string]: unknown;
19376
+ };
19377
+ content: {
19378
+ "application/json": components["schemas"]["LeadFunnelDashboard"];
19379
+ };
19380
+ };
19381
+ /** @description Bad Request */
19382
+ 400: {
19383
+ headers: {
19384
+ [name: string]: unknown;
19385
+ };
19386
+ content: {
19387
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
19388
+ };
19389
+ };
19390
+ };
19391
+ };
19392
+ ListLeadFunnelEntries: {
19393
+ parameters: {
19394
+ query?: {
19395
+ from?: string;
19396
+ to?: string;
19397
+ source?: string;
19398
+ assigned?: boolean;
19399
+ cursor?: string;
19400
+ limit?: number | string;
19401
+ };
19402
+ header?: never;
19403
+ path?: never;
19404
+ cookie?: never;
19405
+ };
19406
+ requestBody?: never;
19407
+ responses: {
19408
+ /** @description OK */
19409
+ 200: {
19410
+ headers: {
19411
+ [name: string]: unknown;
19412
+ };
19413
+ content: {
19414
+ "application/json": components["schemas"]["LeadFunnelEntryPage"];
19415
+ };
19416
+ };
19417
+ /** @description Bad Request */
19418
+ 400: {
19419
+ headers: {
19420
+ [name: string]: unknown;
19421
+ };
19422
+ content: {
19423
+ "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
19424
+ };
19425
+ };
19426
+ };
19427
+ };
19107
19428
  ListNotifications: {
19108
19429
  parameters: {
19109
19430
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "1.45.0",
3
+ "version": "1.47.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,