@andco/protocol 0.1.0-ti.0 → 0.1.0-ti.2
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/rar/bank.d.ts +164 -12
- package/dist/rar/bank.d.ts.map +1 -1
- package/dist/rar/bank.js +51 -13
- package/dist/rar/catalog.d.ts +134 -4
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +12 -6
- package/dist/rar/json-schemas.generated.d.ts.map +1 -1
- package/dist/rar/json-schemas.generated.js +375 -3
- package/dist/rar/money.d.ts +1 -1
- package/dist/rar/money.js +1 -1
- package/dist/rest/accounts.d.ts +66 -44
- package/dist/rest/accounts.d.ts.map +1 -1
- package/dist/rest/accounts.js +31 -21
- package/dist/rest/contract.d.ts +21 -15
- package/dist/rest/contract.d.ts.map +1 -1
- package/dist/rest/contract.js +4 -4
- package/dist/rest/events.js +1 -1
- package/dist/rest/intents.d.ts +42 -1
- package/dist/rest/intents.d.ts.map +1 -1
- package/dist/rest/intents.js +11 -3
- package/dist/transport/financial-events.d.ts +1 -1
- package/dist/transport/generated/oauth-api.d.ts +48 -24
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/rest.d.ts +5 -4
- package/dist/transport/rest.d.ts.map +1 -1
- package/dist/transport/rest.js +1 -1
- package/package.json +1 -1
package/dist/rest/accounts.js
CHANGED
|
@@ -36,7 +36,7 @@ export class InvalidAccountsCursor extends /* @__PURE__ */ AndcoAPIError.define(
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* The `after` of the
|
|
39
|
+
* The `after` of the movements walk is not the cursor AndCo issued for the next page. The
|
|
40
40
|
* AndCo's cursor travels untouched: take it from `pageInfo.endCursor` and nothing else.
|
|
41
41
|
*/
|
|
42
42
|
export class InvalidCursor extends /* @__PURE__ */ AndcoAPIError.define("invalid_cursor", 400, v.pipe(v.object({}), v.description("`after` is not a cursor AndCo issued."))) {
|
|
@@ -57,25 +57,35 @@ export const BankAccount = /* @__PURE__ */ v.strictObject({
|
|
|
57
57
|
/** A page of the subject's accounts. */
|
|
58
58
|
export const AccountPage = /* @__PURE__ */ connection(BankAccount, "A standard connection. Edge cursors remain present on nonempty terminal pages. Reads are live; offset positions can shift under concurrent changes.");
|
|
59
59
|
/**
|
|
60
|
-
* One account
|
|
61
|
-
*
|
|
62
|
-
*
|
|
60
|
+
* One Movement of an account: a credit or a debit, as AndCo reports it. The node is a closed list of
|
|
61
|
+
* fields with the names AndCo gives them, in snake_case: nothing else leaves the API, and a camelCase
|
|
62
|
+
* node or a field outside the list is refused. "Transaction" means only a ledger id, `transaction_id`.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* const movement: Movement = {
|
|
66
|
+
* object: "movement", id, transaction_id: "88213", description: "Transferencia", amount: 500000,
|
|
67
|
+
* currency: "CLP", movement_type: "withdrawal", movement_origin: null, movement_date,
|
|
68
|
+
* running_balance: 1200000, payment_type: null, reversed: false, note: null, transfer_id,
|
|
69
|
+
* };
|
|
63
70
|
*/
|
|
64
|
-
export const
|
|
71
|
+
export const Movement = /* @__PURE__ */ v.strictObject({
|
|
72
|
+
object: v.literal("movement"),
|
|
65
73
|
id: v.pipe(v.string(), v.uuid()),
|
|
66
|
-
|
|
74
|
+
transaction_id: v.pipe(v.nullable(v.string()), v.description("The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit.")),
|
|
67
75
|
description: v.string(),
|
|
68
|
-
amount: v.pipe(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
amount: v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(Number.MAX_SAFE_INTEGER), v.description("A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign.")),
|
|
77
|
+
currency: v.pipe(v.literal("CLP"), v.description("The currency of the account: a permission never assumes it, so the node names it.")),
|
|
78
|
+
movement_type: v.pipe(v.picklist(["deposit", "interest", "withdrawal"]), v.description("The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.")),
|
|
79
|
+
movement_origin: v.nullable(v.string()),
|
|
80
|
+
movement_date: v.pipe(v.string(), v.isoTimestamp()),
|
|
81
|
+
running_balance: v.pipe(v.nullable(v.pipe(v.number(), v.integer(), v.minValue(Number.MIN_SAFE_INTEGER), v.maxValue(Number.MAX_SAFE_INTEGER))), v.description("The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away.")),
|
|
82
|
+
payment_type: v.nullable(v.string()),
|
|
74
83
|
reversed: v.boolean(),
|
|
75
84
|
note: v.nullable(v.string()),
|
|
85
|
+
transfer_id: v.pipe(v.nullable(v.pipe(v.string(), v.uuid())), v.description("The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read. It is null for a credit too, except the credit leg of an own-account Transfer, which links by the same read rule as the debit.")),
|
|
76
86
|
});
|
|
77
|
-
/** A page of one account's
|
|
78
|
-
export const
|
|
87
|
+
/** A page of one account's Movements, read live from the bank. */
|
|
88
|
+
export const MovementPage = /* @__PURE__ */ cursorlessConnection(Movement, "A connection read live from AndCo, which issues one cursor per page and walks forward only. `pageInfo.endCursor` is that cursor and is null on the last page; `pageInfo.startCursor` is always null and `pageInfo.hasPreviousPage` always false. An edge's `cursor` is null: AndCo names no position inside a page, so a walk resumes from the end of a page, never from one Movement.");
|
|
79
89
|
/** Lists the personal digital accounts the Grant reaches, with their balances. */
|
|
80
90
|
export const listAccounts = /* @__PURE__ */ oc
|
|
81
91
|
.meta(http({
|
|
@@ -91,18 +101,18 @@ export const listAccounts = /* @__PURE__ */ oc
|
|
|
91
101
|
...PageQuery,
|
|
92
102
|
}))
|
|
93
103
|
.output(AccountPage);
|
|
94
|
-
/** Lists one account's
|
|
95
|
-
export const
|
|
104
|
+
/** Lists one account's Movements, newest first, read from the bank. */
|
|
105
|
+
export const listAccountMovements = /* @__PURE__ */ oc
|
|
96
106
|
.meta(http({
|
|
97
107
|
method: "GET",
|
|
98
|
-
path: "/accounts/{bank_account_id}/
|
|
99
|
-
summary: "List one account's
|
|
100
|
-
description: "Answers the
|
|
101
|
-
successDescription: "Authorized cursor page of account
|
|
108
|
+
path: "/accounts/{bank_account_id}/movements",
|
|
109
|
+
summary: "List one account's Movements",
|
|
110
|
+
description: "Answers the Movements the account's statement presentation reads, so an integrator sees exactly what a person would see, newest first, one page at a time: feed `pageInfo.endCursor` back as `?after=` while `pageInfo.hasNextPage`. Granted by a `bank_movement` authorization detail with `read` whose `accounts` reach this account. The account is named by its identifier or by its Account Key, whichever the integrator knows: a segment shaped like a UUID is an identifier, any other is an Account Key of the Grant's subject. The permission is the same for both and the key is resolved on this request: an account the Grant does not reach, by identifier or by key, and a key that names no account of the subject answer `404`, as if it did not exist, whether or not the account exists. The page is read from AndCo on behalf of the subject, and its read model walks forward only: `pageInfo.endCursor` is AndCo's own cursor for the next page, handed over untouched, and `after` accepts nothing else (`invalid_cursor` otherwise). There is no cursor per Movement, no backward walk and no offset: `before`, `last`, `offset` and `limit` answer `invalid_request`. Returns edges and camelCase pageInfo.",
|
|
111
|
+
successDescription: "Authorized cursor page of account Movements, newest first",
|
|
102
112
|
}))
|
|
103
113
|
.errors(errors(InvalidRequest, InvalidIdentifier, InvalidCursor, InvalidToken, InvalidOrigin, InsufficientAuthorization, NotFound, UnsupportedVersion, ServerError, BankConnectionInteractionRequired, TemporarilyUnavailable))
|
|
104
114
|
.input(v.object({
|
|
105
115
|
bank_account_id: v.pipe(v.string(), v.maxLength(64), v.description("The account's identifier (a UUID) or its Account Key.")),
|
|
106
116
|
...ForwardPageQuery,
|
|
107
117
|
}))
|
|
108
|
-
.output(
|
|
118
|
+
.output(MovementPage);
|
package/dist/rest/contract.d.ts
CHANGED
|
@@ -1869,7 +1869,7 @@ export declare const contract: {
|
|
|
1869
1869
|
server_time: string;
|
|
1870
1870
|
created_at: string;
|
|
1871
1871
|
authorization_url: string;
|
|
1872
|
-
}, "Authoritative Project-facing state of an account closure. It carries no amount and no fee.">]>], undefined>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof import("./common.js").InvalidRequest, typeof import("./intents.js").IdempotencyKeyNotAllowed, typeof import("./intents.js").ApprovedUseTransfers, typeof import("./intents.js").InvalidSignedInstruction, typeof import("./common.js").InvalidToken, typeof import("./intents.js").ExpiredSignedInstruction, typeof import("./common.js").InvalidOrigin, typeof import("./common.js").InsufficientAuthorization, typeof import("./intents.js").AccountKeyOutOfGrant, typeof import("./common.js").NotFound, typeof import("./common.js").UnsupportedVersion, typeof import("./common.js").ServerError, typeof import("./intents.js").IdempotencyConflict, typeof import("./intents.js").IntentInteractionRequired, typeof import("./intents.js").AccountKeyTaken, typeof import("./intents.js").BankAccountQuotaExceeded, typeof import("./intents.js").InvalidIntentState, typeof import("./intents.js").IntentExpired, typeof import("./common.js").PayloadTooLarge, typeof import("./common.js").UnsupportedMediaType, typeof import("./intents.js").DepositAmountOutOfBounds, typeof import("./intents.js").DepositDestinationAmbiguous, typeof import("./intents.js").AmountOutOfGrant, typeof import("./intents.js").InvalidSource, typeof import("./intents.js").InvalidDestination, typeof import("./intents.js").TransferSenderIdentityUnavailable, typeof import("./intents.js").UnsupportedBank, typeof import("./intents.js").BankConnectionUnavailable, typeof import("./intents.js").BankAccountNumberMissing, typeof import("./intents.js").BankAuthorizationDenied, typeof import("./intents.js").BankHolderWithoutAccount, typeof import("./intents.js").BankAccountLimitReached, typeof import("./intents.js").BankRefused, typeof import("./intents.js").InsufficientFunds, typeof import("./intents.js").BankRejected, typeof import("./intents.js").BankReviewRequired, typeof import("./intents.js").NotImplemented, typeof import("./common.js").TemporarilyUnavailable]>>;
|
|
1872
|
+
}, "Authoritative Project-facing state of an account closure. It carries no amount and no fee.">]>], undefined>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof import("./common.js").InvalidRequest, typeof import("./intents.js").IdempotencyKeyNotAllowed, typeof import("./intents.js").ApprovedUseTransfers, typeof import("./intents.js").InvalidSignedInstruction, typeof import("./common.js").InvalidToken, typeof import("./intents.js").ExpiredSignedInstruction, typeof import("./common.js").InvalidOrigin, typeof import("./common.js").InsufficientAuthorization, typeof import("./intents.js").AccountKeyOutOfGrant, typeof import("./common.js").NotFound, typeof import("./common.js").UnsupportedVersion, typeof import("./common.js").ServerError, typeof import("./intents.js").IdempotencyConflict, typeof import("./intents.js").IntentInteractionRequired, typeof import("./intents.js").AccountKeyTaken, typeof import("./intents.js").BankAccountQuotaExceeded, typeof import("./intents.js").InvalidIntentState, typeof import("./intents.js").IntentExpired, typeof import("./common.js").PayloadTooLarge, typeof import("./common.js").UnsupportedMediaType, typeof import("./intents.js").DepositAmountOutOfBounds, typeof import("./intents.js").DepositDestinationAmbiguous, typeof import("./intents.js").DestinationNotOwnAccount, typeof import("./intents.js").AmountOutOfGrant, typeof import("./intents.js").InvalidSource, typeof import("./intents.js").InvalidDestination, typeof import("./intents.js").TransferSenderIdentityUnavailable, typeof import("./intents.js").UnsupportedBank, typeof import("./intents.js").BankConnectionUnavailable, typeof import("./intents.js").BankAccountNumberMissing, typeof import("./intents.js").BankAuthorizationDenied, typeof import("./intents.js").BankHolderWithoutAccount, typeof import("./intents.js").BankAccountLimitReached, typeof import("./intents.js").BankRefused, typeof import("./intents.js").InsufficientFunds, typeof import("./intents.js").BankRejected, typeof import("./intents.js").BankReviewRequired, typeof import("./intents.js").NotImplemented, typeof import("./common.js").TemporarilyUnavailable]>>;
|
|
1873
1873
|
createTransfer: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1874
1874
|
readonly payload: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, v.DescriptionAction<string, "The base64url of the JSON claims (`SignedTransferClaims`).">]>;
|
|
1875
1875
|
readonly signatures: v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
|
|
@@ -2655,7 +2655,7 @@ export declare const contract: {
|
|
|
2655
2655
|
hasNextPage: boolean;
|
|
2656
2656
|
};
|
|
2657
2657
|
}, string>]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof import("./common.js").InvalidRequest, typeof import("./accounts.js").InvalidAccountsCursor, typeof import("./common.js").InvalidToken, typeof import("./common.js").InvalidOrigin, typeof import("./common.js").InsufficientAuthorization, typeof import("./common.js").UnsupportedVersion, typeof import("./common.js").ServerError, typeof import("./accounts.js").BankConnectionInteractionRequired, typeof import("./common.js").TemporarilyUnavailable]>>;
|
|
2658
|
-
|
|
2658
|
+
listAccountMovements: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
|
|
2659
2659
|
readonly after: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.DescriptionAction<string, "Opaque cursor previously returned by this collection.">]>, undefined>;
|
|
2660
2660
|
readonly first: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 100, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Cursor page size; forward and backward argument families are exclusive.">]>;
|
|
2661
2661
|
readonly bank_account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account's identifier (a UUID) or its Account Key.">]>;
|
|
@@ -2663,17 +2663,20 @@ export declare const contract: {
|
|
|
2663
2663
|
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
2664
2664
|
readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
2665
2665
|
readonly node: v.StrictObjectSchema<{
|
|
2666
|
+
readonly object: v.LiteralSchema<"movement", undefined>;
|
|
2666
2667
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
2667
|
-
readonly
|
|
2668
|
+
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit.">]>;
|
|
2668
2669
|
readonly description: v.StringSchema<undefined>;
|
|
2669
|
-
readonly amount: v.SchemaWithPipe<readonly [v.
|
|
2670
|
-
readonly
|
|
2671
|
-
readonly
|
|
2672
|
-
readonly
|
|
2673
|
-
readonly
|
|
2674
|
-
readonly
|
|
2670
|
+
readonly amount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>, v.DescriptionAction<number, "A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign.">]>;
|
|
2671
|
+
readonly currency: v.SchemaWithPipe<readonly [v.LiteralSchema<"CLP", undefined>, v.DescriptionAction<"CLP", "The currency of the account: a permission never assumes it, so the node names it.">]>;
|
|
2672
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.">]>;
|
|
2673
|
+
readonly movement_origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
2674
|
+
readonly movement_date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
2675
|
+
readonly running_balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>, v.DescriptionAction<number | null, "The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
2676
|
+
readonly payment_type: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
2675
2677
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
2676
2678
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
2679
|
+
readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read. It is null for a credit too, except the credit leg of an own-account Transfer, which links by the same read rule as the debit.">]>;
|
|
2677
2680
|
}, undefined>;
|
|
2678
2681
|
}, undefined>, undefined>;
|
|
2679
2682
|
readonly pageInfo: v.StrictObjectSchema<{
|
|
@@ -2686,17 +2689,20 @@ export declare const contract: {
|
|
|
2686
2689
|
edges: {
|
|
2687
2690
|
cursor: string | null;
|
|
2688
2691
|
node: {
|
|
2692
|
+
object: "movement";
|
|
2689
2693
|
id: string;
|
|
2690
|
-
|
|
2694
|
+
transaction_id: string | null;
|
|
2691
2695
|
description: string;
|
|
2692
|
-
amount:
|
|
2696
|
+
amount: number;
|
|
2697
|
+
currency: "CLP";
|
|
2693
2698
|
movement_type: "deposit" | "interest" | "withdrawal";
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2699
|
+
movement_origin: string | null;
|
|
2700
|
+
movement_date: string;
|
|
2701
|
+
running_balance: number | null;
|
|
2702
|
+
payment_type: string | null;
|
|
2698
2703
|
reversed: boolean;
|
|
2699
2704
|
note: string | null;
|
|
2705
|
+
transfer_id: string | null;
|
|
2700
2706
|
};
|
|
2701
2707
|
}[];
|
|
2702
2708
|
pageInfo: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/rest/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/rest/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAC;AAsHlC;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,aAAa,CA8EtD,CAAC"}
|
package/dist/rest/contract.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AccountClosureIntentCreateSchema, AccountOpeningIntentCreateSchema, DepositIntentCreateSchema, IntentAccountExternalSchema, IntentAccountIdSchema, IntentAccountKeySchema, IntentAccountSchema, IntentAmountSchema, IntentCancellationSchema, IntentNoteSchema, IntentRejectionSchema, SignedAccountClosureIntentClaimsSchema, SignedAccountOpeningIntentClaimsSchema, SignedAmountSchema, TransferAmountProposalSchema, TransferCommentProposalSchema, TransferIntentCreateSchema, TransferIntentReceiverProposalSchema, TransferIntentReceiverSchema, } from "../intent-input.js";
|
|
2
2
|
import { SignedTransferClaimsSchema, SignedTransferEnvelopeSchema, SignedTransferHeaderSchema, TransferPartySchema, TransferReceiverSchema, TransferSenderSchema, } from "../transfer.js";
|
|
3
3
|
import { UserInfo } from "../userinfo.js";
|
|
4
|
-
import { AccountPage, BankAccount,
|
|
4
|
+
import { AccountPage, BankAccount, listAccountMovements, listAccounts, Movement, MovementPage } from "./accounts.js";
|
|
5
5
|
import { Address, AddressCreate, AddressMutationResult, AddressPage, AddressUpdate, createOrganizationAddress, createProfileAddress, deleteOrganizationAddress, deleteProfileAddress, listOrganizationAddresses, listProfileAddresses, updateOrganizationAddress, updateProfileAddress, } from "./addresses.js";
|
|
6
6
|
import { ApplicationGrantSubject, GrantActor, GrantAuthorization, GrantHolder, GrantSubject, getGrantAuthorization, OrganizationGrantHolder, ProfileGrantHolder, ProfileGrantSubject, } from "./authorization.js";
|
|
7
7
|
import { BankCatalogEntry, BankCatalogPage, getBankCatalog, getPermissionCatalog, PermissionCatalogEntry, PermissionCatalogPage, } from "./catalog.js";
|
|
@@ -33,7 +33,7 @@ export const contract = {
|
|
|
33
33
|
getTransfer,
|
|
34
34
|
getUserInfo,
|
|
35
35
|
listAccounts,
|
|
36
|
-
|
|
36
|
+
listAccountMovements,
|
|
37
37
|
listAccountTransfers,
|
|
38
38
|
listOrganizationAddresses,
|
|
39
39
|
listOrganizationIdentities,
|
|
@@ -70,8 +70,8 @@ export const components = {
|
|
|
70
70
|
BankAccount,
|
|
71
71
|
BankCatalogEntry,
|
|
72
72
|
BankCatalogPage,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
Movement,
|
|
74
|
+
MovementPage,
|
|
75
75
|
DepositCloseResult,
|
|
76
76
|
DepositDestination,
|
|
77
77
|
DepositIntent,
|
package/dist/rest/events.js
CHANGED
|
@@ -33,7 +33,7 @@ export const readAccountEvents = /* @__PURE__ */ oc
|
|
|
33
33
|
.meta(http({
|
|
34
34
|
method: "GET",
|
|
35
35
|
path: "/accounts/{bank_account_id}/events",
|
|
36
|
-
summary: "Replay account facts with account
|
|
36
|
+
summary: "Replay account facts with account movement read permission",
|
|
37
37
|
description: "Returns edges and camelCase pageInfo. Cursor and offset argument families cannot be mixed.",
|
|
38
38
|
successDescription: "Authorized event page in publication order",
|
|
39
39
|
}))
|
package/dist/rest/intents.d.ts
CHANGED
|
@@ -650,6 +650,47 @@ declare const InvalidDestination_base: (abstract new (intentId?: string, message
|
|
|
650
650
|
/** The destination of a transfer, or the account a deposit names, is not one the Grant admits. */
|
|
651
651
|
export declare class InvalidDestination extends /* @__PURE__ */ InvalidDestination_base {
|
|
652
652
|
}
|
|
653
|
+
declare const DestinationNotOwnAccount_base: (abstract new (intentId?: string, message?: string) => {
|
|
654
|
+
readonly error: "destination_not_own_account";
|
|
655
|
+
readonly hint?: string;
|
|
656
|
+
readonly data: {
|
|
657
|
+
intent_id?: string | undefined;
|
|
658
|
+
};
|
|
659
|
+
name: string;
|
|
660
|
+
message: string;
|
|
661
|
+
stack?: string;
|
|
662
|
+
cause?: unknown;
|
|
663
|
+
}) & {
|
|
664
|
+
readonly error: "destination_not_own_account";
|
|
665
|
+
readonly status: 422;
|
|
666
|
+
readonly data: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
667
|
+
readonly intent_id: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | undefined, "The Intent the refusal is about, when it was refused at its release rather than at its creation.">]>;
|
|
668
|
+
}, undefined>, v.DescriptionAction<{
|
|
669
|
+
intent_id?: string | undefined;
|
|
670
|
+
}, string>]>;
|
|
671
|
+
define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): (abstract new (data: v.InferOutput<Data>, message?: string, hint?: string) => {
|
|
672
|
+
readonly error: Code;
|
|
673
|
+
readonly hint?: string;
|
|
674
|
+
readonly data: v.InferOutput<Data>;
|
|
675
|
+
name: string;
|
|
676
|
+
message: string;
|
|
677
|
+
stack?: string;
|
|
678
|
+
cause?: unknown;
|
|
679
|
+
}) & {
|
|
680
|
+
readonly error: Code;
|
|
681
|
+
readonly status: Status;
|
|
682
|
+
readonly data: Data;
|
|
683
|
+
define<const Code extends string, const Status extends number, Data extends import("./api-error.js").AndcoAPIErrorDataSchema>(error: Code, status: Status, data: Data): /*elided*/ any;
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
/**
|
|
687
|
+
* The receiver of a transfer is not an account of the Grant's subject, and the only authority the
|
|
688
|
+
* Grant holds for a transfer is `bank_own_account_transfer`, which never moves money out of its
|
|
689
|
+
* holder. At creation nothing is created. A transfer that leaves its holder needs `bank_transfer`
|
|
690
|
+
* `create`.
|
|
691
|
+
*/
|
|
692
|
+
export declare class DestinationNotOwnAccount extends /* @__PURE__ */ DestinationNotOwnAccount_base {
|
|
693
|
+
}
|
|
653
694
|
declare const DepositDestinationAmbiguous_base: (abstract new (intentId?: string, message?: string) => {
|
|
654
695
|
readonly error: "deposit_destination_ambiguous";
|
|
655
696
|
readonly hint?: string;
|
|
@@ -3117,7 +3158,7 @@ export declare const createIntent: import("@orpc/contract").ProcedureContractBui
|
|
|
3117
3158
|
server_time: string;
|
|
3118
3159
|
created_at: string;
|
|
3119
3160
|
authorization_url: string;
|
|
3120
|
-
}, "Authoritative Project-facing state of an account closure. It carries no amount and no fee.">]>], undefined>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof IdempotencyKeyNotAllowed, typeof ApprovedUseTransfers, typeof InvalidSignedInstruction, typeof InvalidToken, typeof ExpiredSignedInstruction, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof AccountKeyOutOfGrant, typeof NotFound, typeof UnsupportedVersion, typeof ServerError, typeof IdempotencyConflict, typeof IntentInteractionRequired, typeof AccountKeyTaken, typeof BankAccountQuotaExceeded, typeof InvalidIntentState, typeof IntentExpired, typeof PayloadTooLarge, typeof UnsupportedMediaType, typeof DepositAmountOutOfBounds, typeof DepositDestinationAmbiguous, typeof AmountOutOfGrant, typeof InvalidSource, typeof InvalidDestination, typeof TransferSenderIdentityUnavailable, typeof UnsupportedBank, typeof BankConnectionUnavailable, typeof BankAccountNumberMissing, typeof BankAuthorizationDenied, typeof BankHolderWithoutAccount, typeof BankAccountLimitReached, typeof BankRefused, typeof InsufficientFunds, typeof BankRejected, typeof BankReviewRequired, typeof NotImplemented, typeof TemporarilyUnavailable]>>;
|
|
3161
|
+
}, "Authoritative Project-facing state of an account closure. It carries no amount and no fee.">]>], undefined>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof IdempotencyKeyNotAllowed, typeof ApprovedUseTransfers, typeof InvalidSignedInstruction, typeof InvalidToken, typeof ExpiredSignedInstruction, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof AccountKeyOutOfGrant, typeof NotFound, typeof UnsupportedVersion, typeof ServerError, typeof IdempotencyConflict, typeof IntentInteractionRequired, typeof AccountKeyTaken, typeof BankAccountQuotaExceeded, typeof InvalidIntentState, typeof IntentExpired, typeof PayloadTooLarge, typeof UnsupportedMediaType, typeof DepositAmountOutOfBounds, typeof DepositDestinationAmbiguous, typeof DestinationNotOwnAccount, typeof AmountOutOfGrant, typeof InvalidSource, typeof InvalidDestination, typeof TransferSenderIdentityUnavailable, typeof UnsupportedBank, typeof BankConnectionUnavailable, typeof BankAccountNumberMissing, typeof BankAuthorizationDenied, typeof BankHolderWithoutAccount, typeof BankAccountLimitReached, typeof BankRefused, typeof InsufficientFunds, typeof BankRejected, typeof BankReviewRequired, typeof NotImplemented, typeof TemporarilyUnavailable]>>;
|
|
3121
3162
|
/** Reads one Intent created under the same exact OAuth Grant. */
|
|
3122
3163
|
export declare const getIntent: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
|
|
3123
3164
|
readonly intent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../../src/rest/intents.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0aA4BR,CAAC;AAElB,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8PAuBA,CAAC"}
|
package/dist/rest/intents.js
CHANGED
|
@@ -177,6 +177,14 @@ export class InvalidSource extends /* @__PURE__ */ intentRefusal("invalid_source
|
|
|
177
177
|
/** The destination of a transfer, or the account a deposit names, is not one the Grant admits. */
|
|
178
178
|
export class InvalidDestination extends /* @__PURE__ */ intentRefusal("invalid_destination", "The destination is not one the Grant admits.") {
|
|
179
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* The receiver of a transfer is not an account of the Grant's subject, and the only authority the
|
|
182
|
+
* Grant holds for a transfer is `bank_own_account_transfer`, which never moves money out of its
|
|
183
|
+
* holder. At creation nothing is created. A transfer that leaves its holder needs `bank_transfer`
|
|
184
|
+
* `create`.
|
|
185
|
+
*/
|
|
186
|
+
export class DestinationNotOwnAccount extends /* @__PURE__ */ intentRefusal("destination_not_own_account", "The receiver is not an account of the Grant's subject; a transfer between own accounts never leaves its holder.") {
|
|
187
|
+
}
|
|
180
188
|
/**
|
|
181
189
|
* A deposit named no `destination` and the `bank_deposit` Grant admits more than one account. Name
|
|
182
190
|
* the account in `destination`; a new Grant is not needed.
|
|
@@ -457,13 +465,13 @@ export const createIntent = /* @__PURE__ */ oc
|
|
|
457
465
|
method: "POST",
|
|
458
466
|
path: "/intents",
|
|
459
467
|
summary: "Create an intent under the exact OAuth Grant",
|
|
460
|
-
description: "The same creation has three representations, and the content type picks between them. An `application/json` body is an Intent born waiting for an Approval. An `application/jwt` body is one Signed Instruction, sent as a compact JWS whose verified payload is `SignedAccountOpeningIntentClaims` or `SignedAccountClosureIntentClaims`, and every value the operation uses comes from those claims and none from the envelope carrying them. An `application/jose+json` body is a signed transfer with `approved: false`: a `SignedTransferEnvelope`, a JWS in the General JSON Serialization, whose payload is `SignedTransferClaims`. It creates a transfer Intent that waits for a decision and answers a TransferIntent with `transfer_id` null. It is verified as `POST /transfers` verifies a signed transfer, with the same rules for the `jti` (a UUID in lowercase, and the only idempotency-key), `exp`, the keys, the `sender` and the `receiver`; the `unusable_key` reason means that the key is registered, but AndCo could not load it to check this signature, so its person registers a new key and revokes this one, then you sign again. A repeat of the same envelope answers the same Intent, and another body under the same `jti` answers `409 idempotency_conflict`. A signed transfer with `approved: true` answers `400 approved_use_transfers` and nothing is recorded: its signature is the approval, so send it to `POST /transfers`. A signed account opening or closure with `approved: true` stays accepted here and is born approved. A string body sent as anything but `application/jwt` answers `415 unsupported_media_type`. A Signed Instruction that does not verify answers `400 invalid_signed_instruction` with its `reason`, and one whose `exp` passed `401 expired_signed_instruction`. A signed account Intent is born approved when the signing client's Grant holds the family's `approve` action (`bank_account`); otherwise it waits, like a proposal, for the person on the hosted screen or for `POST /intents/{intent_id}/approve` by a Grant that holds it. Opening and closing an account fail synchronously with `403 account_key_out_of_grant` when the account_key is outside the Grant's `accounts` patterns and with `409 account_key_taken` when the account_key names an account of the subject (always for a closed one; otherwise unless `upsert`). The new account's number arrives in the `account_opening.succeeded` event as `account: { id, accountKey, number, name }`. Once the request is valid and authorized (a malformed body is still `400 invalid_request` and a Grant without the permission still `403 insufficient_authorization`), an opening and a
|
|
468
|
+
description: "The same creation has three representations, and the content type picks between them. An `application/json` body is an Intent born waiting for an Approval. An `application/jwt` body is one Signed Instruction, sent as a compact JWS whose verified payload is `SignedAccountOpeningIntentClaims` or `SignedAccountClosureIntentClaims`, and every value the operation uses comes from those claims and none from the envelope carrying them. An `application/jose+json` body is a signed transfer with `approved: false`: a `SignedTransferEnvelope`, a JWS in the General JSON Serialization, whose payload is `SignedTransferClaims`. It creates a transfer Intent that waits for a decision and answers a TransferIntent with `transfer_id` null. It is verified as `POST /transfers` verifies a signed transfer, with the same rules for the `jti` (a UUID in lowercase, and the only idempotency-key), `exp`, the keys, the `sender` and the `receiver`; the `unusable_key` reason means that the key is registered, but AndCo could not load it to check this signature, so its person registers a new key and revokes this one, then you sign again. A repeat of the same envelope answers the same Intent, and another body under the same `jti` answers `409 idempotency_conflict`. A signed transfer with `approved: true` answers `400 approved_use_transfers` and nothing is recorded: its signature is the approval, so send it to `POST /transfers`. A signed account opening or closure with `approved: true` stays accepted here and is born approved. A string body sent as anything but `application/jwt` answers `415 unsupported_media_type`. A Signed Instruction that does not verify answers `400 invalid_signed_instruction` with its `reason`, and one whose `exp` passed `401 expired_signed_instruction`. A signed account Intent is born approved when the signing client's Grant holds the family's `approve` action (`bank_account`); otherwise it waits, like a proposal, for the person on the hosted screen or for `POST /intents/{intent_id}/approve` by a Grant that holds it. Opening and closing an account fail synchronously with `403 account_key_out_of_grant` when the account_key is outside the Grant's `accounts` patterns and with `409 account_key_taken` when the account_key names an account of the subject (always for a closed one; otherwise unless `upsert`). The new account's number arrives in the `account_opening.succeeded` event as `account: { id, accountKey, number, name }`. Once the request is valid and authorized (a malformed body is still `400 invalid_request` and a Grant without the permission still `403 insufficient_authorization`), an opening and a `bank_transfer` proposal between two accounts of the same holder work where the bank serves them: the answer is `201` with the Intent `requires_action` and its `authorization_url`, or, for a signed account Intent whose signer also holds the family's `approve`, the Intent born `approved`. A transfer that `bank_own_account_transfer` covers is released at once instead (below). Where the deployment's bank does not serve one, the same request answers `501 not_implemented` with `code: account_opening_not_implemented` or `code: own_account_transfer_not_implemented`; a closure always answers `501 not_implemented` with `code: account_closure_not_implemented`. Nothing is created in those cases. A subject without a bank connection to a company cannot open an account: `422 bank_connection_unavailable` with the `intent_id`. A signed account Intent born approved answers the refusals of `POST /intents/{intent_id}/approve`.\n\nA `transfer` proposal needs `bank_transfer` `create` or `bank_own_account_transfer` `create`. When the Grant holds `bank_own_account_transfer` `create` whose `accounts` cover the named `sender` and `receiver` (two different active accounts of the Grant's subject) and the amount is not `editable`, the answer is a TransferIntent born `approved` with `transfer_id` set: nobody decides it, and it is released at once with nobody present. Its outcome lives on the Transfer, which reads `processing` and then `succeeded` or `failed`, never on the Intent. The same `Idempotency-Key` never names both kinds of transfer (`409 idempotency_conflict`). Any other transfer is a `bank_transfer` proposal, bounded by that detail alone. A Grant that holds no `bank_transfer` `create` refuses what `bank_own_account_transfer` does not cover with nothing created: `422 destination_not_own_account` when the `receiver` is missing or is not an account of the subject, `422 invalid_source` when the `sender` is missing, unusable or outside `accounts`, `422 invalid_destination` when the `receiver` cannot receive (closed, another currency, the `sender` itself) or is outside `accounts`, and `400 invalid_request` with the detail `transfer_amount_not_editable` for an editable amount. Where the deployment's bank does not serve transfers between own accounts, `501 not_implemented` with `code: own_account_transfer_not_implemented`. If the release cannot go on because only a person can, the answer is `409 interaction_required` before anything is stored. If it fails after the Transfer was stored, the same request sent again releases that Transfer again and answers the same Intent. An approved Intent has no client cancel.",
|
|
461
469
|
successStatus: 201,
|
|
462
470
|
successDescription: "Intent created or returned from an idempotent retry",
|
|
463
471
|
inputStructure: "detailed",
|
|
464
472
|
spec: (operation) => servedAsSignedInstructionOrTransfer(withCanonicalHeaderNames(operation)),
|
|
465
473
|
}))
|
|
466
|
-
.errors(errors(InvalidRequest, IdempotencyKeyNotAllowed, ApprovedUseTransfers, InvalidSignedInstruction, InvalidToken, ExpiredSignedInstruction, InvalidOrigin, InsufficientAuthorization, AccountKeyOutOfGrant, NotFound, UnsupportedVersion, ServerError, IdempotencyConflict, IntentInteractionRequired, AccountKeyTaken, BankAccountQuotaExceeded, InvalidIntentState, IntentExpired, PayloadTooLarge, UnsupportedMediaType, DepositAmountOutOfBounds, DepositDestinationAmbiguous, ...releaseRefusals, NotImplemented, TemporarilyUnavailable))
|
|
474
|
+
.errors(errors(InvalidRequest, IdempotencyKeyNotAllowed, ApprovedUseTransfers, InvalidSignedInstruction, InvalidToken, ExpiredSignedInstruction, InvalidOrigin, InsufficientAuthorization, AccountKeyOutOfGrant, NotFound, UnsupportedVersion, ServerError, IdempotencyConflict, IntentInteractionRequired, AccountKeyTaken, BankAccountQuotaExceeded, InvalidIntentState, IntentExpired, PayloadTooLarge, UnsupportedMediaType, DepositAmountOutOfBounds, DepositDestinationAmbiguous, DestinationNotOwnAccount, ...releaseRefusals, NotImplemented, TemporarilyUnavailable))
|
|
467
475
|
.input(v.object({
|
|
468
476
|
headers: v.object({
|
|
469
477
|
"idempotency-key": v.pipe(v.optional(v.pipe(v.string(), v.regex(/^[A-Za-z0-9._:-]{1,128}$/))), v.description("Required with `application/json`, and refused with `application/jwt` and `application/jose+json`, which answer `400 idempotency_key_not_allowed` when it arrives beside a signature: the idempotency key of a Signed Instruction is its own `jti`, and two candidates for one key is exactly the ambiguity that gets read the wrong way round. OpenAPI cannot make a header conditional on the media type, so it is published as optional rather than demanding what the server refuses.")),
|
|
@@ -497,7 +505,7 @@ export const closeDeposit = /* @__PURE__ */ oc
|
|
|
497
505
|
method: "POST",
|
|
498
506
|
path: "/intents/{intent_id}/close",
|
|
499
507
|
summary: "Close this application's no-target deposit collection with an explicit close Grant action",
|
|
500
|
-
description: "Idempotent. Preserves existing terminal outcomes. Does not move funds, cancel commands AndCo already accepted, or grant account
|
|
508
|
+
description: "Idempotent. Preserves existing terminal outcomes. Does not move funds, cancel commands AndCo already accepted, or grant account movement access.",
|
|
501
509
|
successDescription: "Current terminal state and historical manual closure, if any",
|
|
502
510
|
}))
|
|
503
511
|
.errors(errors(InvalidIdentifier, InvalidToken, InvalidOrigin, InsufficientAuthorization, NotFound, UnsupportedVersion, ServerError, InvalidIntentState, TemporarilyUnavailable))
|
|
@@ -57,7 +57,7 @@ export type AndCoIntentDepositEvent = AndCoFinancialEvent<"deposit.target_update
|
|
|
57
57
|
* An account-wide fact, independent of application attribution.
|
|
58
58
|
*
|
|
59
59
|
* Account events keep saying `deposit` and `withdrawal` on purpose. Here the word names the
|
|
60
|
-
* direction of a Movement — the entry a
|
|
60
|
+
* direction of a Movement — the entry a ledger transaction leaves in one account — and not the kind of
|
|
61
61
|
* request that produced it. One transfer publishes `transfer.succeeded` on the Transfer,
|
|
62
62
|
* `withdrawal.posted` on the account the money left, and `deposit.received` on the account it
|
|
63
63
|
* reached, and all three words are correct.
|