@insurance-broker/api-client 2.5.0 → 2.6.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 +20 -0
  2. package/package.json +1 -1
package/dist/schema.d.ts CHANGED
@@ -34,6 +34,16 @@ export interface paths {
34
34
  * 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).
35
35
  *
36
36
  * 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.
37
+ *
38
+ * **`idempotencyKey` is optional, and it is the only thing that makes a retry safe.** Without one, a double-tapped button, a client retry after a timeout or two officers recording the same instalment each raise a separate debt — and that is correct, because two identical instalments falling due on one day is legitimate and nothing about `(policy, amount, due date, description)` can be made unique.
39
+ *
40
+ * With one: a repeat carrying a key already used **returns the original charge and the same `201 Created` with the same `Location`**, so an honest retry is indistinguishable from a first call and no second debt exists. A repeat carrying that key with a **different** policy, amount, due date or description is a `409` and raises nothing.
41
+ *
42
+ * **A key is honoured for as long as the charge it raised is kept, and nothing sweeps keys.** It is stored on the obligation rather than in a store of its own. Mint a fresh key per intended charge; do not recycle one (#394).
43
+ *
44
+ * **What a key does not do**: it assumes the retrying client owns it. Two people at two desks recording the same instalment invent two keys, and both charges are raised (ADR-0042 §19).
45
+ *
46
+ * **Two different things answer `409` here.** A key collision is settled — retrying it can only fail again — and carries no `retryable` marker. The group's concurrency conflict is the other one and says it is retryable. Branch on that, not on the status.
37
47
  */
38
48
  post: operations["RaiseObligation"];
39
49
  delete?: never;
@@ -7184,6 +7194,7 @@ export interface components {
7184
7194
  /** Format: date */
7185
7195
  dueOn: string;
7186
7196
  description: string;
7197
+ idempotencyKey?: null | string;
7187
7198
  };
7188
7199
  RaiseOutstandingItemRequest: {
7189
7200
  awaitedFrom: null | string;
@@ -7854,6 +7865,15 @@ export interface operations {
7854
7865
  "application/problem+json": components["schemas"]["HttpValidationProblemDetails"];
7855
7866
  };
7856
7867
  };
7868
+ /** @description Conflict */
7869
+ 409: {
7870
+ headers: {
7871
+ [name: string]: unknown;
7872
+ };
7873
+ content: {
7874
+ "application/problem+json": components["schemas"]["ProblemDetails"];
7875
+ };
7876
+ };
7857
7877
  };
7858
7878
  };
7859
7879
  GetObligation: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insurance-broker/api-client",
3
- "version": "2.5.0",
3
+ "version": "2.6.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,