@zinn-digital/sdk 0.1.1948 → 0.1.1950
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.
- package/dist/generated/schema.d.ts +170 -0
- package/package.json +1 -1
|
@@ -10802,6 +10802,49 @@ export interface paths {
|
|
|
10802
10802
|
patch?: never;
|
|
10803
10803
|
trace?: never;
|
|
10804
10804
|
};
|
|
10805
|
+
"/v1/admin/orphan-debits": {
|
|
10806
|
+
parameters: {
|
|
10807
|
+
query?: never;
|
|
10808
|
+
header?: never;
|
|
10809
|
+
path?: never;
|
|
10810
|
+
cookie?: never;
|
|
10811
|
+
};
|
|
10812
|
+
/**
|
|
10813
|
+
* Every unresolved orphan wallet debit (credit taken, no payment recorded) — staff queue.
|
|
10814
|
+
* @description DAY-0351 / X173 R2. A wallet debit keyed to an order whose matching payment was never recorded is NEVER repaired by itself; this is the queue staff decide from (one row per debit, across orgs, last 60 days; a debit with a resolution is gone from it). Requires staff + `billing.entitlement.manage`.
|
|
10815
|
+
*/
|
|
10816
|
+
get: operations["listOrphanDebits"];
|
|
10817
|
+
put?: never;
|
|
10818
|
+
post?: never;
|
|
10819
|
+
delete?: never;
|
|
10820
|
+
options?: never;
|
|
10821
|
+
head?: never;
|
|
10822
|
+
patch?: never;
|
|
10823
|
+
trace?: never;
|
|
10824
|
+
};
|
|
10825
|
+
"/v1/admin/orphan-debits/{debitId}/resolve": {
|
|
10826
|
+
parameters: {
|
|
10827
|
+
query?: never;
|
|
10828
|
+
header?: never;
|
|
10829
|
+
path: {
|
|
10830
|
+
/** @description The wallet debit (`CreditDrawdown` / `ClientWalletEntry`) id. */
|
|
10831
|
+
debitId: string;
|
|
10832
|
+
};
|
|
10833
|
+
cookie?: never;
|
|
10834
|
+
};
|
|
10835
|
+
get?: never;
|
|
10836
|
+
put?: never;
|
|
10837
|
+
/**
|
|
10838
|
+
* Resolve one orphan wallet debit ONCE — apply it to the order, or give it back as credit (staff, audit-logged).
|
|
10839
|
+
* @description Records ONE resolution per debit and carries it out in the debit's own org scope. `apply` settles the order from the debit already taken (no second debit) and is refused (409, `details[0].code`) unless the order still awaits payment (`order_not_awaiting`) and the debit covers its whole total (`amount_mismatch`). When a later credit to the org names the order/debit OR equals the amount, both actions answer **422 `later_credit_found`** whose detail names that credit (`credit_id`, `credit_at`; staff only) and nothing is recorded: `apply` is never allowed then (it would pay the customer twice); `give_back` may be repeated WITH `already_given_back: true` (and the required reason) to record the debit as already given back, which moves NO money and names the found credit on the resolution and the audit row. `already_given_back: true` with no such later credit is refused 422 `no_later_credit` (it never closes a debit without money given back); with `apply` it is refused 422 `bad_action`. Otherwise `give_back` credits the amount back to the wallet (credit only, never a card). The two exclude each other (`other_action_taken`); a second press of the same action returns the first result with `created: false` and writes no second audit row. Audit actions `orphan_debit.apply` / `orphan_debit.give_back` (platform rows; the org in metadata). Requires staff + `billing.entitlement.manage`.
|
|
10840
|
+
*/
|
|
10841
|
+
post: operations["resolveOrphanDebit"];
|
|
10842
|
+
delete?: never;
|
|
10843
|
+
options?: never;
|
|
10844
|
+
head?: never;
|
|
10845
|
+
patch?: never;
|
|
10846
|
+
trace?: never;
|
|
10847
|
+
};
|
|
10805
10848
|
"/v1/admin/orphan-payments": {
|
|
10806
10849
|
parameters: {
|
|
10807
10850
|
query?: never;
|
|
@@ -65834,6 +65877,68 @@ export interface components {
|
|
|
65834
65877
|
site_id: components["schemas"]["Uuid"];
|
|
65835
65878
|
verdict: string;
|
|
65836
65879
|
};
|
|
65880
|
+
/** @description One wallet debit keyed to an order with no payment recorded at its attempt key (DAY-0351). */
|
|
65881
|
+
AdminOrphanDebit: {
|
|
65882
|
+
/**
|
|
65883
|
+
* Format: int64
|
|
65884
|
+
* @description The debit in integer minor units (§2.8).
|
|
65885
|
+
*/
|
|
65886
|
+
amount_minor: number;
|
|
65887
|
+
currency: components["schemas"]["CurrencyCode"];
|
|
65888
|
+
/** Format: uuid */
|
|
65889
|
+
debit_id: string;
|
|
65890
|
+
/** @enum {string} */
|
|
65891
|
+
ledger: "account_credit" | "client_float";
|
|
65892
|
+
order_currency: components["schemas"]["CurrencyCode"];
|
|
65893
|
+
/** Format: uuid */
|
|
65894
|
+
order_id: string;
|
|
65895
|
+
order_ref: string;
|
|
65896
|
+
order_status: string;
|
|
65897
|
+
/** Format: int64 */
|
|
65898
|
+
order_total_minor: number;
|
|
65899
|
+
/** Format: uuid */
|
|
65900
|
+
org_id: string;
|
|
65901
|
+
};
|
|
65902
|
+
/** @description The ONE staff decision on an orphan wallet debit. */
|
|
65903
|
+
AdminOrphanDebitResolution: {
|
|
65904
|
+
/** @enum {string} */
|
|
65905
|
+
action: "apply" | "give_back";
|
|
65906
|
+
actor: string;
|
|
65907
|
+
/** @description True when staff recorded the debit as already given back by an earlier credit: no money moved. */
|
|
65908
|
+
already_given_back: boolean;
|
|
65909
|
+
/** Format: int64 */
|
|
65910
|
+
amount_minor: number;
|
|
65911
|
+
/** @description False on a second press (nothing was done). */
|
|
65912
|
+
created: boolean;
|
|
65913
|
+
/** Format: date-time */
|
|
65914
|
+
created_at: string;
|
|
65915
|
+
currency: components["schemas"]["CurrencyCode"];
|
|
65916
|
+
debit_id: string;
|
|
65917
|
+
/** @description When `already_given_back`: the later credit found (`<ledger>:<id>`); else empty. */
|
|
65918
|
+
found_credit_ref: string;
|
|
65919
|
+
/** Format: uuid */
|
|
65920
|
+
id: string;
|
|
65921
|
+
/** @enum {string} */
|
|
65922
|
+
ledger: "account_credit" | "client_float";
|
|
65923
|
+
/** Format: uuid */
|
|
65924
|
+
order_id: string;
|
|
65925
|
+
/** Format: uuid */
|
|
65926
|
+
org_id: string;
|
|
65927
|
+
reason: string;
|
|
65928
|
+
/** @description `apply`: the Payment id; `give_back`: the credit's idempotency key; empty when `already_given_back` (no money moved). */
|
|
65929
|
+
result_ref: string;
|
|
65930
|
+
};
|
|
65931
|
+
AdminOrphanDebitResolveRequest: {
|
|
65932
|
+
/** @enum {string} */
|
|
65933
|
+
action: "apply" | "give_back";
|
|
65934
|
+
/**
|
|
65935
|
+
* @description Only with `give_back`, and only after a 422 `later_credit_found`: staff confirm that the credit it named already gave this debit back. Records the resolution and moves no money. Refused (`no_later_credit`) when no such credit exists.
|
|
65936
|
+
* @default false
|
|
65937
|
+
*/
|
|
65938
|
+
already_given_back: boolean;
|
|
65939
|
+
/** @description Recorded on the resolution and in the audit row. */
|
|
65940
|
+
reason: string;
|
|
65941
|
+
};
|
|
65837
65942
|
/** @description A customer's own outbound mail service, as staff see it. Read-only, and it carries no credential and no vault path - only what answers "is their sender verified, and is it refusing messages?". The pointer to their API key answers neither. */
|
|
65838
65943
|
AdminOutboundMail: {
|
|
65839
65944
|
consecutive_failures: number;
|
|
@@ -88741,6 +88846,13 @@ export interface components {
|
|
|
88741
88846
|
checkout_url?: string;
|
|
88742
88847
|
/** @example INVALID */
|
|
88743
88848
|
code: string;
|
|
88849
|
+
/**
|
|
88850
|
+
* Format: date-time
|
|
88851
|
+
* @description Only beside `credit_id`: when that credit was given.
|
|
88852
|
+
*/
|
|
88853
|
+
credit_at?: string;
|
|
88854
|
+
/** @description Only on a `later_credit_found` detail of a 422 from the staff-only `POST /v1/admin/orphan-debits/{debitId}/resolve`: the later credit found (`<ledger>:<id>`, ledger `account_credit` or `client_float`). */
|
|
88855
|
+
credit_id?: string;
|
|
88744
88856
|
/**
|
|
88745
88857
|
* @description JSON path to the offending field.
|
|
88746
88858
|
* @example default_currency
|
|
@@ -140050,6 +140162,64 @@ export interface operations {
|
|
|
140050
140162
|
429: components["responses"]["TooManyRequests"];
|
|
140051
140163
|
};
|
|
140052
140164
|
};
|
|
140165
|
+
listOrphanDebits: {
|
|
140166
|
+
parameters: {
|
|
140167
|
+
query?: never;
|
|
140168
|
+
header?: never;
|
|
140169
|
+
path?: never;
|
|
140170
|
+
cookie?: never;
|
|
140171
|
+
};
|
|
140172
|
+
requestBody?: never;
|
|
140173
|
+
responses: {
|
|
140174
|
+
/** @description The unresolved orphan debits. */
|
|
140175
|
+
200: {
|
|
140176
|
+
headers: {
|
|
140177
|
+
[name: string]: unknown;
|
|
140178
|
+
};
|
|
140179
|
+
content: {
|
|
140180
|
+
"application/json": {
|
|
140181
|
+
data: components["schemas"]["AdminOrphanDebit"][];
|
|
140182
|
+
};
|
|
140183
|
+
};
|
|
140184
|
+
};
|
|
140185
|
+
401: components["responses"]["Unauthorized"];
|
|
140186
|
+
403: components["responses"]["Forbidden"];
|
|
140187
|
+
429: components["responses"]["TooManyRequests"];
|
|
140188
|
+
};
|
|
140189
|
+
};
|
|
140190
|
+
resolveOrphanDebit: {
|
|
140191
|
+
parameters: {
|
|
140192
|
+
query?: never;
|
|
140193
|
+
header?: never;
|
|
140194
|
+
path: {
|
|
140195
|
+
/** @description The wallet debit (`CreditDrawdown` / `ClientWalletEntry`) id. */
|
|
140196
|
+
debitId: string;
|
|
140197
|
+
};
|
|
140198
|
+
cookie?: never;
|
|
140199
|
+
};
|
|
140200
|
+
requestBody: {
|
|
140201
|
+
content: {
|
|
140202
|
+
"application/json": components["schemas"]["AdminOrphanDebitResolveRequest"];
|
|
140203
|
+
};
|
|
140204
|
+
};
|
|
140205
|
+
responses: {
|
|
140206
|
+
/** @description The resolution (the first one, on a second press). */
|
|
140207
|
+
200: {
|
|
140208
|
+
headers: {
|
|
140209
|
+
[name: string]: unknown;
|
|
140210
|
+
};
|
|
140211
|
+
content: {
|
|
140212
|
+
"application/json": components["schemas"]["AdminOrphanDebitResolution"];
|
|
140213
|
+
};
|
|
140214
|
+
};
|
|
140215
|
+
401: components["responses"]["Unauthorized"];
|
|
140216
|
+
403: components["responses"]["Forbidden"];
|
|
140217
|
+
404: components["responses"]["NotFound"];
|
|
140218
|
+
409: components["responses"]["Conflict"];
|
|
140219
|
+
422: components["responses"]["UnprocessableEntity"];
|
|
140220
|
+
429: components["responses"]["TooManyRequests"];
|
|
140221
|
+
};
|
|
140222
|
+
};
|
|
140053
140223
|
listOrphanPayments: {
|
|
140054
140224
|
parameters: {
|
|
140055
140225
|
query?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zinn-digital/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1950",
|
|
4
4
|
"description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",
|