@fantastic.dev/better-stripe 0.33.0 → 0.34.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.
- package/CHANGELOG.md +7 -0
- package/README.md +30 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +36 -0
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +18 -0
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +36 -0
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +18 -0
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/core/accountClosures.d.ts +15 -0
- package/dist/client/core/accountClosures.d.ts.map +1 -0
- package/dist/client/core/accountClosures.js +10 -0
- package/dist/client/core/accountClosures.js.map +1 -0
- package/dist/client/core/accounts.d.ts.map +1 -1
- package/dist/client/core/accounts.js +15 -23
- package/dist/client/core/accounts.js.map +1 -1
- package/dist/client/core/personalAccountMapping.d.ts +8 -0
- package/dist/client/core/personalAccountMapping.d.ts.map +1 -0
- package/dist/client/core/personalAccountMapping.js +11 -0
- package/dist/client/core/personalAccountMapping.js.map +1 -0
- package/dist/client/index.d.ts +55 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +13 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/publicTypes.d.ts +5 -0
- package/dist/client/publicTypes.d.ts.map +1 -0
- package/dist/client/publicTypes.js +2 -0
- package/dist/client/publicTypes.js.map +1 -0
- package/dist/component/_generated/component.d.ts +88 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/accountClosure/helpers.d.ts +18 -0
- package/dist/component/accountClosure/helpers.d.ts.map +1 -0
- package/dist/component/accountClosure/helpers.js +18 -0
- package/dist/component/accountClosure/helpers.js.map +1 -0
- package/dist/component/accountClosure/mutations.d.ts +20 -0
- package/dist/component/accountClosure/mutations.d.ts.map +1 -0
- package/dist/component/accountClosure/mutations.js +55 -0
- package/dist/component/accountClosure/mutations.js.map +1 -0
- package/dist/component/accountClosure/queries.d.ts +34 -0
- package/dist/component/accountClosure/queries.d.ts.map +1 -0
- package/dist/component/accountClosure/queries.js +36 -0
- package/dist/component/accountClosure/queries.js.map +1 -0
- package/dist/component/accountClosure/schema.d.ts +46 -0
- package/dist/component/accountClosure/schema.d.ts.map +1 -0
- package/dist/component/accountClosure/schema.js +20 -0
- package/dist/component/accountClosure/schema.js.map +1 -0
- package/dist/component/core/mutations.d.ts.map +1 -1
- package/dist/component/core/mutations.js +5 -0
- package/dist/component/core/mutations.js.map +1 -1
- package/dist/component/core/personalAccountMapping.d.ts +95 -0
- package/dist/component/core/personalAccountMapping.d.ts.map +1 -0
- package/dist/component/core/personalAccountMapping.js +54 -0
- package/dist/component/core/personalAccountMapping.js.map +1 -0
- package/dist/component/core/queries.d.ts +27 -0
- package/dist/component/core/queries.d.ts.map +1 -1
- package/dist/component/core/queries.js +7 -0
- package/dist/component/core/queries.js.map +1 -1
- package/dist/component/earnings/triggers.d.ts +42 -0
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/schema.d.ts +18 -0
- package/dist/component/schema.js +2 -0
- package/dist/component/schema.js.map +1 -1
- package/docs/personal-account-mapping.md +54 -0
- package/package.json +3 -2
- package/src/client/core/account-close-orchestration.test.ts +131 -0
- package/src/client/core/account-closure.test.ts +317 -0
- package/src/client/core/accountClosures.ts +37 -0
- package/src/client/core/accounts.test.ts +0 -111
- package/src/client/core/accounts.ts +24 -29
- package/src/client/core/personal-account-mapping.test.ts +71 -0
- package/src/client/core/personalAccountMapping.ts +23 -0
- package/src/client/index.ts +36 -33
- package/src/client/publicTypes.ts +35 -0
- package/src/component/_generated/api.ts +8 -0
- package/src/component/_generated/component.ts +126 -0
- package/src/component/accountClosure/helpers.ts +21 -0
- package/src/component/accountClosure/mutations.ts +56 -0
- package/src/component/accountClosure/queries.ts +43 -0
- package/src/component/accountClosure/schema.ts +20 -0
- package/src/component/core/mutations.ts +3 -0
- package/src/component/core/personal-account-mapping.test.ts +173 -0
- package/src/component/core/personalAccountMapping.ts +81 -0
- package/src/component/core/queries.ts +11 -0
- package/src/component/schema.ts +2 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { MutationCtx, QueryCtx } from "../_generated/server.js";
|
|
2
|
+
export declare function closureByStripeId(ctx: QueryCtx, stripeAccountId: string): Promise<{
|
|
3
|
+
_creationTime: number;
|
|
4
|
+
_id: import("convex/values").GenericId<"accountClosures">;
|
|
5
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
6
|
+
closedAt?: number | undefined;
|
|
7
|
+
orgId?: string | undefined;
|
|
8
|
+
state: "closed" | "pending";
|
|
9
|
+
stripeAccountId: string;
|
|
10
|
+
userId?: string | undefined;
|
|
11
|
+
} | null>;
|
|
12
|
+
/** A delayed account event cannot revive a closed recipient or change a pinned owner. */
|
|
13
|
+
export declare function canUpsertAccount(ctx: MutationCtx, account: {
|
|
14
|
+
stripeAccountId: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
orgId?: string;
|
|
17
|
+
}): Promise<boolean>;
|
|
18
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/component/accountClosure/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM;;;;;;;;;UAOvE;AACD,yFAAyF;AACzF,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,oBAQrE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function closureByStripeId(ctx, stripeAccountId) {
|
|
2
|
+
return ctx.db
|
|
3
|
+
.query("accountClosures")
|
|
4
|
+
.withIndex("by_stripe_account_id", (q) => q.eq("stripeAccountId", stripeAccountId))
|
|
5
|
+
.unique();
|
|
6
|
+
}
|
|
7
|
+
/** A delayed account event cannot revive a closed recipient or change a pinned owner. */
|
|
8
|
+
export async function canUpsertAccount(ctx, account) {
|
|
9
|
+
const closure = await closureByStripeId(ctx, account.stripeAccountId);
|
|
10
|
+
if (!closure)
|
|
11
|
+
return true;
|
|
12
|
+
if (closure.state === "closed")
|
|
13
|
+
return false;
|
|
14
|
+
if (closure.userId !== account.userId || closure.orgId !== account.orgId)
|
|
15
|
+
throw new Error("Account ownership is pinned while closure is unresolved");
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/component/accountClosure/helpers.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,iBAAiB,CAAC,GAAa,EAAE,eAAuB;IACtE,OAAO,GAAG,CAAC,EAAE;SACV,KAAK,CAAC,iBAAiB,CAAC;SACxB,SAAS,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,CACvC,CAAC,CAAC,EAAE,CAAC,iBAAiB,EAAE,eAAe,CAAC,CACzC;SACA,MAAM,EAAE,CAAC;AACd,CAAC;AACD,yFAAyF;AACzF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAgB,EAChB,OAAoE;IAEpE,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACtE,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,IAAI,OAAO,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK;QACtE,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Trusted host boundary: authenticate and authorize the actor before invoking close. */
|
|
2
|
+
export declare const prepare: import("convex/server").RegisteredMutation<"public", {
|
|
3
|
+
stripeAccountId: string;
|
|
4
|
+
}, Promise<{
|
|
5
|
+
closure: {
|
|
6
|
+
_creationTime: number;
|
|
7
|
+
_id: import("convex/values").GenericId<"accountClosures">;
|
|
8
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
9
|
+
closedAt?: number | undefined;
|
|
10
|
+
orgId?: string | undefined;
|
|
11
|
+
state: "closed" | "pending";
|
|
12
|
+
stripeAccountId: string;
|
|
13
|
+
userId?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
isRetry: boolean;
|
|
16
|
+
}>>;
|
|
17
|
+
export declare const complete: import("convex/server").RegisteredMutation<"public", {
|
|
18
|
+
stripeAccountId: string;
|
|
19
|
+
}, Promise<null>>;
|
|
20
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/accountClosure/mutations.ts"],"names":[],"mappings":"AAIA,yFAAyF;AACzF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;GAuBlB,CAAC;AAEH,eAAO,MAAM,QAAQ;;iBAyBnB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { mutation } from "../_generated/server.js";
|
|
3
|
+
import { closureByStripeId } from "./helpers.js";
|
|
4
|
+
import { closureDoc } from "./schema.js";
|
|
5
|
+
/** Trusted host boundary: authenticate and authorize the actor before invoking close. */
|
|
6
|
+
export const prepare = mutation({
|
|
7
|
+
args: { stripeAccountId: v.string() },
|
|
8
|
+
returns: v.object({ closure: closureDoc, isRetry: v.boolean() }),
|
|
9
|
+
handler: async (ctx, { stripeAccountId }) => {
|
|
10
|
+
const existing = await closureByStripeId(ctx, stripeAccountId);
|
|
11
|
+
if (existing)
|
|
12
|
+
return { closure: existing, isRetry: true };
|
|
13
|
+
const account = await ctx.db
|
|
14
|
+
.query("accounts")
|
|
15
|
+
.withIndex("by_stripe_account_id", (q) => q.eq("stripeAccountId", stripeAccountId))
|
|
16
|
+
.unique();
|
|
17
|
+
const id = await ctx.db.insert("accountClosures", {
|
|
18
|
+
stripeAccountId,
|
|
19
|
+
userId: account?.userId,
|
|
20
|
+
orgId: account?.orgId,
|
|
21
|
+
appliedConfigurations: account?.appliedConfigurations,
|
|
22
|
+
state: "pending",
|
|
23
|
+
});
|
|
24
|
+
const closure = await ctx.db.get("accountClosures", id);
|
|
25
|
+
if (!closure)
|
|
26
|
+
throw new Error("Closure intent was not persisted");
|
|
27
|
+
return { closure, isRetry: false };
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export const complete = mutation({
|
|
31
|
+
args: { stripeAccountId: v.string() },
|
|
32
|
+
returns: v.null(),
|
|
33
|
+
handler: async (ctx, { stripeAccountId }) => {
|
|
34
|
+
const closure = await closureByStripeId(ctx, stripeAccountId);
|
|
35
|
+
if (!closure)
|
|
36
|
+
throw new Error("Closure intent is required");
|
|
37
|
+
if (closure.state === "closed")
|
|
38
|
+
return null;
|
|
39
|
+
const account = await ctx.db
|
|
40
|
+
.query("accounts")
|
|
41
|
+
.withIndex("by_stripe_account_id", (q) => q.eq("stripeAccountId", stripeAccountId))
|
|
42
|
+
.unique();
|
|
43
|
+
if (account &&
|
|
44
|
+
(account.userId !== closure.userId || account.orgId !== closure.orgId))
|
|
45
|
+
throw new Error("Account ownership changed during closure");
|
|
46
|
+
await ctx.db.patch("accountClosures", closure._id, {
|
|
47
|
+
state: "closed",
|
|
48
|
+
closedAt: Date.now(),
|
|
49
|
+
});
|
|
50
|
+
if (account)
|
|
51
|
+
await ctx.db.delete("accounts", account._id);
|
|
52
|
+
return null;
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../../src/component/accountClosure/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,yFAAyF;AACzF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;IAC9B,IAAI,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;IAChE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE;QAC1C,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QAC/D,IAAI,QAAQ;YAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC1D,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,EAAE;aACzB,KAAK,CAAC,UAAU,CAAC;aACjB,SAAS,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,C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AAC,CACzC;aACA,MAAM,EAAE,CAAC;QACZ,IACE,OAAO;YACP,CAAC,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC;YAEtE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,MAAM,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG,EAAE;YACjD,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;SACrB,CAAC,CAAC;QACH,IAAI,OAAO;YAAE,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** This is provenance, not end-user authentication; hosts must compare the authenticated owner. */
|
|
2
|
+
export declare const getClosedAccountByStripeId: import("convex/server").RegisteredQuery<"public", {
|
|
3
|
+
stripeAccountId: string;
|
|
4
|
+
}, Promise<{
|
|
5
|
+
_creationTime: number;
|
|
6
|
+
_id: import("convex/values").GenericId<"accountClosures">;
|
|
7
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
8
|
+
closedAt?: number | undefined;
|
|
9
|
+
orgId?: string | undefined;
|
|
10
|
+
state: "closed" | "pending";
|
|
11
|
+
stripeAccountId: string;
|
|
12
|
+
userId?: string | undefined;
|
|
13
|
+
} | null>>;
|
|
14
|
+
export declare const listClosedAccountsByUserId: import("convex/server").RegisteredQuery<"public", {
|
|
15
|
+
paginationOpts: {
|
|
16
|
+
id?: number;
|
|
17
|
+
endCursor?: string | null;
|
|
18
|
+
maximumRowsRead?: number;
|
|
19
|
+
maximumBytesRead?: number;
|
|
20
|
+
numItems: number;
|
|
21
|
+
cursor: string | null;
|
|
22
|
+
};
|
|
23
|
+
userId: string;
|
|
24
|
+
}, Promise<import("convex/server").PaginationResult<{
|
|
25
|
+
_creationTime: number;
|
|
26
|
+
_id: import("convex/values").GenericId<"accountClosures">;
|
|
27
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
28
|
+
closedAt?: number | undefined;
|
|
29
|
+
orgId?: string | undefined;
|
|
30
|
+
state: "closed" | "pending";
|
|
31
|
+
stripeAccountId: string;
|
|
32
|
+
userId?: string | undefined;
|
|
33
|
+
}>>>;
|
|
34
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/accountClosure/queries.ts"],"names":[],"mappings":"AAUA,mGAAmG;AACnG,eAAO,MAAM,0BAA0B;;;;;;;;;;;UAOrC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;IAsBrC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { paginationOptsValidator, paginationResultValidator, } from "convex/server";
|
|
2
|
+
import { paginator } from "convex-helpers/server/pagination";
|
|
3
|
+
import { v } from "convex/values";
|
|
4
|
+
import { query } from "../_generated/server.js";
|
|
5
|
+
import schema from "../schema.js";
|
|
6
|
+
import { closureByStripeId } from "./helpers.js";
|
|
7
|
+
import { closureDoc } from "./schema.js";
|
|
8
|
+
/** This is provenance, not end-user authentication; hosts must compare the authenticated owner. */
|
|
9
|
+
export const getClosedAccountByStripeId = query({
|
|
10
|
+
args: { stripeAccountId: v.string() },
|
|
11
|
+
returns: v.union(closureDoc, v.null()),
|
|
12
|
+
handler: async (ctx, { stripeAccountId }) => {
|
|
13
|
+
const closure = await closureByStripeId(ctx, stripeAccountId);
|
|
14
|
+
return closure?.state === "closed" ? closure : null;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export const listClosedAccountsByUserId = query({
|
|
18
|
+
args: { userId: v.string(), paginationOpts: paginationOptsValidator },
|
|
19
|
+
returns: paginationResultValidator(closureDoc),
|
|
20
|
+
handler: async (ctx, { userId, paginationOpts }) => {
|
|
21
|
+
if (!Number.isInteger(paginationOpts.numItems) ||
|
|
22
|
+
paginationOpts.numItems < 1 ||
|
|
23
|
+
paginationOpts.numItems > 100)
|
|
24
|
+
throw new Error("Closure history page size must be between 1 and 100");
|
|
25
|
+
return paginator(ctx.db, schema)
|
|
26
|
+
.query("accountClosures")
|
|
27
|
+
.withIndex("by_user_state", (q) => q.eq("userId", userId).eq("orgId", undefined).eq("state", "closed"))
|
|
28
|
+
.order("desc")
|
|
29
|
+
.paginate({
|
|
30
|
+
...paginationOpts,
|
|
31
|
+
maximumRowsRead: 200,
|
|
32
|
+
maximumBytesRead: 1_000_000,
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/component/accountClosure/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,mGAAmG;AACnG,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;IAC9C,IAAI,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;IACrC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,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
|
|
|
1
|
+
export declare const closureFields: {
|
|
2
|
+
stripeAccountId: import("convex/values").VString<string, "required">;
|
|
3
|
+
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
4
|
+
orgId: import("convex/values").VString<string | undefined, "optional">;
|
|
5
|
+
appliedConfigurations: import("convex/values").VArray<("customer" | "merchant" | "recipient")[] | undefined, import("convex/values").VUnion<"customer" | "merchant" | "recipient", [import("convex/values").VLiteral<"customer", "required">, import("convex/values").VLiteral<"merchant", "required">, import("convex/values").VLiteral<"recipient", "required">], "required", never>, "optional">;
|
|
6
|
+
state: import("convex/values").VUnion<"closed" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"closed", "required">], "required", never>;
|
|
7
|
+
closedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
8
|
+
};
|
|
9
|
+
export declare const closureDoc: import("convex/values").VObject<{
|
|
10
|
+
_creationTime: number;
|
|
11
|
+
_id: import("convex/values").GenericId<"accountClosures">;
|
|
12
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
13
|
+
closedAt?: number | undefined;
|
|
14
|
+
orgId?: string | undefined;
|
|
15
|
+
state: "closed" | "pending";
|
|
16
|
+
stripeAccountId: string;
|
|
17
|
+
userId?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
stripeAccountId: import("convex/values").VString<string, "required">;
|
|
20
|
+
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
21
|
+
orgId: import("convex/values").VString<string | undefined, "optional">;
|
|
22
|
+
appliedConfigurations: import("convex/values").VArray<("customer" | "merchant" | "recipient")[] | undefined, import("convex/values").VUnion<"customer" | "merchant" | "recipient", [import("convex/values").VLiteral<"customer", "required">, import("convex/values").VLiteral<"merchant", "required">, import("convex/values").VLiteral<"recipient", "required">], "required", never>, "optional">;
|
|
23
|
+
state: import("convex/values").VUnion<"closed" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"closed", "required">], "required", never>;
|
|
24
|
+
closedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
25
|
+
_id: import("convex/values").VId<import("convex/values").GenericId<"accountClosures">, "required">;
|
|
26
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
27
|
+
}, "required", "_creationTime" | "_id" | "appliedConfigurations" | "closedAt" | "orgId" | "state" | "stripeAccountId" | "userId">;
|
|
28
|
+
export declare const accountClosuresTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
29
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
30
|
+
closedAt?: number | undefined;
|
|
31
|
+
orgId?: string | undefined;
|
|
32
|
+
state: "closed" | "pending";
|
|
33
|
+
stripeAccountId: string;
|
|
34
|
+
userId?: string | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
stripeAccountId: import("convex/values").VString<string, "required">;
|
|
37
|
+
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
38
|
+
orgId: import("convex/values").VString<string | undefined, "optional">;
|
|
39
|
+
appliedConfigurations: import("convex/values").VArray<("customer" | "merchant" | "recipient")[] | undefined, import("convex/values").VUnion<"customer" | "merchant" | "recipient", [import("convex/values").VLiteral<"customer", "required">, import("convex/values").VLiteral<"merchant", "required">, import("convex/values").VLiteral<"recipient", "required">], "required", never>, "optional">;
|
|
40
|
+
state: import("convex/values").VUnion<"closed" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"closed", "required">], "required", never>;
|
|
41
|
+
closedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
42
|
+
}, "required", "appliedConfigurations" | "closedAt" | "orgId" | "state" | "stripeAccountId" | "userId">, {
|
|
43
|
+
by_stripe_account_id: ["stripeAccountId", "_creationTime"];
|
|
44
|
+
by_user_state: ["userId", "orgId", "state", "_creationTime"];
|
|
45
|
+
}, {}, {}>;
|
|
46
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/accountClosure/schema.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;IACxB,eAAe;IACf,MAAM;IACN,KAAK;IACL,qBAAqB;IACrB,KAAK;IACL,QAAQ;CACT,CAAC;AACF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;iIAIrB,CAAC;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;UAEsB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineTable } from "convex/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
import { appliedConfigurationsValidator } from "../core/validators.js";
|
|
4
|
+
export const closureFields = {
|
|
5
|
+
stripeAccountId: v.string(),
|
|
6
|
+
userId: v.optional(v.string()),
|
|
7
|
+
orgId: v.optional(v.string()),
|
|
8
|
+
appliedConfigurations: appliedConfigurationsValidator,
|
|
9
|
+
state: v.union(v.literal("pending"), v.literal("closed")),
|
|
10
|
+
closedAt: v.optional(v.number()),
|
|
11
|
+
};
|
|
12
|
+
export const closureDoc = v.object({
|
|
13
|
+
_id: v.id("accountClosures"),
|
|
14
|
+
_creationTime: v.number(),
|
|
15
|
+
...closureFields,
|
|
16
|
+
});
|
|
17
|
+
export const accountClosuresTable = defineTable(closureFields)
|
|
18
|
+
.index("by_stripe_account_id", ["stripeAccountId"])
|
|
19
|
+
.index("by_user_state", ["userId", "orgId", "state"]);
|
|
20
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/component/accountClosure/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAEvE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,qBAAqB,EAAE,8BAA8B;IACrD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzD,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACjC,CAAC;AACF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC;IAC5B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,GAAG,aAAa;CACjB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC,aAAa,CAAC;KAC3D,KAAK,CAAC,sBAAsB,EAAE,CAAC,iBAAiB,CAAC,CAAC;KAClD,KAAK,CAAC,eAAe,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/core/mutations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/core/mutations.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAa1D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;iBAwCxB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;iBAuBjC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;oBAelC,CAAC;AAMH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;iBAkChC,CAAC;AAMH,eAAO,MAAM,cAAc;;;GAgCzB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { canUpsertAccount } from "../accountClosure/helpers.js";
|
|
1
2
|
import { assertPayoutResetSafe } from "./resetSafety.js";
|
|
2
3
|
import { v } from "convex/values";
|
|
3
4
|
import { mutation } from "../_generated/server";
|
|
@@ -24,6 +25,8 @@ export const upsertAccount = mutation({
|
|
|
24
25
|
},
|
|
25
26
|
returns: v.null(),
|
|
26
27
|
handler: async (ctx, args) => {
|
|
28
|
+
if (!(await canUpsertAccount(ctx, args)))
|
|
29
|
+
return null;
|
|
27
30
|
const existing = await ctx.db
|
|
28
31
|
.query("accounts")
|
|
29
32
|
.withIndex("by_stripe_account_id", (q) => q.eq("stripeAccountId", args.stripeAccountId))
|
|
@@ -107,6 +110,8 @@ export const upsertAccountInternal = mutation({
|
|
|
107
110
|
},
|
|
108
111
|
returns: v.null(),
|
|
109
112
|
handler: async (ctx, args) => {
|
|
113
|
+
if (!(await canUpsertAccount(ctx, args)))
|
|
114
|
+
return null;
|
|
110
115
|
const existing = await ctx.db
|
|
111
116
|
.query("accounts")
|
|
112
117
|
.withIndex("by_stripe_account_id", (q) => q.eq("stripeAccountId", args.stripeAccountId))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../../src/component/core/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGlC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,iCAAiC,GAClC,MAAM,cAAc,CAAC;AAEt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gBACpB,MAAM,OAAO,CAAC,GAAG;gBACf,0DAA0D;gBAC1D,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAC1C,CAAC;gBACF,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO,EAAE,YAAY;YACrB,MAAM;SACP,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type Infer } from "convex/values";
|
|
2
|
+
import type { QueryCtx } from "../_generated/server.js";
|
|
3
|
+
export declare const personalAccountMappingValidator: import("convex/values").VUnion<{
|
|
4
|
+
account: {
|
|
5
|
+
_creationTime: number;
|
|
6
|
+
_id: import("convex/values").GenericId<"accounts">;
|
|
7
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
8
|
+
capabilities?: any;
|
|
9
|
+
configuration?: any;
|
|
10
|
+
country?: string | undefined;
|
|
11
|
+
email?: string | undefined;
|
|
12
|
+
metadata?: any;
|
|
13
|
+
missingRequirements?: string[] | undefined;
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
|
|
16
|
+
orgId?: string | undefined;
|
|
17
|
+
requirements?: any;
|
|
18
|
+
statementDescriptor?: string | undefined;
|
|
19
|
+
stripeAccountId: string;
|
|
20
|
+
userId: string;
|
|
21
|
+
};
|
|
22
|
+
status: "unique";
|
|
23
|
+
} | {
|
|
24
|
+
reason: "ambiguous" | "closed" | "closure_unresolved" | "invalid_account" | "missing" | "organization";
|
|
25
|
+
status: "unavailable";
|
|
26
|
+
}, [import("convex/values").VObject<{
|
|
27
|
+
account: {
|
|
28
|
+
_creationTime: number;
|
|
29
|
+
_id: import("convex/values").GenericId<"accounts">;
|
|
30
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
31
|
+
capabilities?: any;
|
|
32
|
+
configuration?: any;
|
|
33
|
+
country?: string | undefined;
|
|
34
|
+
email?: string | undefined;
|
|
35
|
+
metadata?: any;
|
|
36
|
+
missingRequirements?: string[] | undefined;
|
|
37
|
+
name?: string | undefined;
|
|
38
|
+
onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
|
|
39
|
+
orgId?: string | undefined;
|
|
40
|
+
requirements?: any;
|
|
41
|
+
statementDescriptor?: string | undefined;
|
|
42
|
+
stripeAccountId: string;
|
|
43
|
+
userId: string;
|
|
44
|
+
};
|
|
45
|
+
status: "unique";
|
|
46
|
+
}, {
|
|
47
|
+
status: import("convex/values").VLiteral<"unique", "required">;
|
|
48
|
+
account: import("convex/values").VObject<{
|
|
49
|
+
_creationTime: number;
|
|
50
|
+
_id: import("convex/values").GenericId<"accounts">;
|
|
51
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
52
|
+
capabilities?: any;
|
|
53
|
+
configuration?: any;
|
|
54
|
+
country?: string | undefined;
|
|
55
|
+
email?: string | undefined;
|
|
56
|
+
metadata?: any;
|
|
57
|
+
missingRequirements?: string[] | undefined;
|
|
58
|
+
name?: string | undefined;
|
|
59
|
+
onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
|
|
60
|
+
orgId?: string | undefined;
|
|
61
|
+
requirements?: any;
|
|
62
|
+
statementDescriptor?: string | undefined;
|
|
63
|
+
stripeAccountId: string;
|
|
64
|
+
userId: string;
|
|
65
|
+
}, {
|
|
66
|
+
stripeAccountId: import("convex/values").VString<string, "required">;
|
|
67
|
+
userId: import("convex/values").VString<string, "required">;
|
|
68
|
+
orgId: import("convex/values").VString<string | undefined, "optional">;
|
|
69
|
+
email: import("convex/values").VString<string | undefined, "optional">;
|
|
70
|
+
name: import("convex/values").VString<string | undefined, "optional">;
|
|
71
|
+
country: import("convex/values").VString<string | undefined, "optional">;
|
|
72
|
+
capabilities: import("convex/values").VAny<any, "optional", string>;
|
|
73
|
+
requirements: import("convex/values").VAny<any, "optional", string>;
|
|
74
|
+
configuration: import("convex/values").VAny<any, "optional", string>;
|
|
75
|
+
appliedConfigurations: import("convex/values").VArray<("customer" | "merchant" | "recipient")[] | undefined, import("convex/values").VUnion<"customer" | "merchant" | "recipient", [import("convex/values").VLiteral<"customer", "required">, import("convex/values").VLiteral<"merchant", "required">, import("convex/values").VLiteral<"recipient", "required">], "required", never>, "optional">;
|
|
76
|
+
onboardingStatus: import("convex/values").VUnion<"complete" | "in_progress" | "pending" | "restricted", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"in_progress", "required">, import("convex/values").VLiteral<"complete", "required">, import("convex/values").VLiteral<"restricted", "required">], "required", never>;
|
|
77
|
+
missingRequirements: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
78
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
79
|
+
statementDescriptor: import("convex/values").VString<string | undefined, "optional">;
|
|
80
|
+
_id: import("convex/values").VId<import("convex/values").GenericId<"accounts">, "required">;
|
|
81
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
82
|
+
}, "required", "_creationTime" | "_id" | "appliedConfigurations" | "capabilities" | "configuration" | "country" | "email" | "metadata" | "missingRequirements" | "name" | "onboardingStatus" | "orgId" | "requirements" | "statementDescriptor" | "stripeAccountId" | "userId" | `capabilities.${string}` | `configuration.${string}` | `metadata.${string}` | `requirements.${string}`>;
|
|
83
|
+
}, "required", "account" | "account._creationTime" | "account._id" | "account.appliedConfigurations" | "account.capabilities" | "account.configuration" | "account.country" | "account.email" | "account.metadata" | "account.missingRequirements" | "account.name" | "account.onboardingStatus" | "account.orgId" | "account.requirements" | "account.statementDescriptor" | "account.stripeAccountId" | "account.userId" | "status" | `account.capabilities.${string}` | `account.configuration.${string}` | `account.metadata.${string}` | `account.requirements.${string}`>, import("convex/values").VObject<{
|
|
84
|
+
reason: "ambiguous" | "closed" | "closure_unresolved" | "invalid_account" | "missing" | "organization";
|
|
85
|
+
status: "unavailable";
|
|
86
|
+
}, {
|
|
87
|
+
status: import("convex/values").VLiteral<"unavailable", "required">;
|
|
88
|
+
reason: import("convex/values").VUnion<"ambiguous" | "closed" | "closure_unresolved" | "invalid_account" | "missing" | "organization", [import("convex/values").VLiteral<"missing", "required">, import("convex/values").VLiteral<"ambiguous", "required">, import("convex/values").VLiteral<"organization", "required">, import("convex/values").VLiteral<"invalid_account", "required">, import("convex/values").VLiteral<"closure_unresolved", "required">, import("convex/values").VLiteral<"closed", "required">], "required", never>;
|
|
89
|
+
}, "required", "reason" | "status">], "required", "account" | "account._creationTime" | "account._id" | "account.appliedConfigurations" | "account.capabilities" | "account.configuration" | "account.country" | "account.email" | "account.metadata" | "account.missingRequirements" | "account.name" | "account.onboardingStatus" | "account.orgId" | "account.requirements" | "account.statementDescriptor" | "account.stripeAccountId" | "account.userId" | "reason" | "status" | `account.capabilities.${string}` | `account.configuration.${string}` | `account.metadata.${string}` | `account.requirements.${string}`>;
|
|
90
|
+
export type PersonalAccountMapping = Infer<typeof personalAccountMappingValidator>;
|
|
91
|
+
/** Opaque host identity is an exact selector, never an authentication credential. */
|
|
92
|
+
export declare function assertPersonalAccountUserId(userId: string): void;
|
|
93
|
+
/** Reusable in query or mutation transactions; no guessed first/newest account or provider writes. */
|
|
94
|
+
export declare function resolvePersonalAccountMapping(ctx: QueryCtx, userId: string): Promise<PersonalAccountMapping>;
|
|
95
|
+
//# sourceMappingURL=personalAccountMapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personalAccountMapping.d.ts","sourceRoot":"","sources":["../../../src/component/core/personalAccountMapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAK,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6lBAa3C,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CACxC,OAAO,+BAA+B,CACvC,CAAC;AAEF,qFAAqF;AACrF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,QASzD;AAED,sGAAsG;AACtG,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,CAAC,CAyCjC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import { accountDocValidator } from "./validators.js";
|
|
3
|
+
export const personalAccountMappingValidator = v.union(v.object({ status: v.literal("unique"), account: accountDocValidator }), v.object({
|
|
4
|
+
status: v.literal("unavailable"),
|
|
5
|
+
reason: v.union(v.literal("missing"), v.literal("ambiguous"), v.literal("organization"), v.literal("invalid_account"), v.literal("closure_unresolved"), v.literal("closed")),
|
|
6
|
+
}));
|
|
7
|
+
/** Opaque host identity is an exact selector, never an authentication credential. */
|
|
8
|
+
export function assertPersonalAccountUserId(userId) {
|
|
9
|
+
if (typeof userId !== "string" ||
|
|
10
|
+
!userId.length ||
|
|
11
|
+
userId.length > 256 ||
|
|
12
|
+
userId.trim() !== userId ||
|
|
13
|
+
/[\u0000-\u001f\u007f]/.test(userId))
|
|
14
|
+
throw new Error("Invalid personal account user selector");
|
|
15
|
+
}
|
|
16
|
+
/** Reusable in query or mutation transactions; no guessed first/newest account or provider writes. */
|
|
17
|
+
export async function resolvePersonalAccountMapping(ctx, userId) {
|
|
18
|
+
assertPersonalAccountUserId(userId);
|
|
19
|
+
const candidates = await ctx.db
|
|
20
|
+
.query("accounts")
|
|
21
|
+
.withIndex("by_user_id", (q) => q.eq("userId", userId))
|
|
22
|
+
.take(2);
|
|
23
|
+
if (!candidates.length)
|
|
24
|
+
return { status: "unavailable", reason: "missing" };
|
|
25
|
+
if (candidates.length !== 1)
|
|
26
|
+
return { status: "unavailable", reason: "ambiguous" };
|
|
27
|
+
const account = candidates[0];
|
|
28
|
+
if (account.orgId !== undefined)
|
|
29
|
+
return { status: "unavailable", reason: "organization" };
|
|
30
|
+
if (account.userId !== userId ||
|
|
31
|
+
account.stripeAccountId.length > 128 ||
|
|
32
|
+
!/^acct_[A-Za-z0-9_]+$/.test(account.stripeAccountId))
|
|
33
|
+
return { status: "unavailable", reason: "invalid_account" };
|
|
34
|
+
const reciprocal = await ctx.db
|
|
35
|
+
.query("accounts")
|
|
36
|
+
.withIndex("by_stripe_account_id", (q) => q.eq("stripeAccountId", account.stripeAccountId))
|
|
37
|
+
.take(2);
|
|
38
|
+
if (reciprocal.length !== 1 || reciprocal[0]?._id !== account._id)
|
|
39
|
+
return { status: "unavailable", reason: "ambiguous" };
|
|
40
|
+
const closures = await ctx.db
|
|
41
|
+
.query("accountClosures")
|
|
42
|
+
.withIndex("by_stripe_account_id", (q) => q.eq("stripeAccountId", account.stripeAccountId))
|
|
43
|
+
.take(2);
|
|
44
|
+
if (closures.length > 1)
|
|
45
|
+
return { status: "unavailable", reason: "ambiguous" };
|
|
46
|
+
const closure = closures[0];
|
|
47
|
+
if (closure)
|
|
48
|
+
return {
|
|
49
|
+
status: "unavailable",
|
|
50
|
+
reason: closure.state === "closed" ? "closed" : "closure_unresolved",
|
|
51
|
+
};
|
|
52
|
+
return { status: "unique", account };
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=personalAccountMapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personalAccountMapping.js","sourceRoot":"","sources":["../../../src/component/core/personalAccountMapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,CAAC,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,+BA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C,CACjD;SACA,IAAI,CAAC,CAAC,CAAC,CAAC;IACX,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QACrB,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IACxD,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,OAAO;QACT,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAoB;SACrE,CAAC;IACJ,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -92,4 +92,31 @@ export declare const getAccountOnboardingStatus: import("convex/server").Registe
|
|
|
92
92
|
*/
|
|
93
93
|
export declare const getPublishableKey: import("convex/server").RegisteredQuery<"public", {}, Promise<string | null>>;
|
|
94
94
|
export declare const getStripeMode: import("convex/server").RegisteredQuery<"public", {}, Promise<"live" | "test">>;
|
|
95
|
+
/** Unique personal mapping evidence only; the host still authenticates its caller. */
|
|
96
|
+
export declare const getPersonalAccountMapping: import("convex/server").RegisteredQuery<"public", {
|
|
97
|
+
userId: string;
|
|
98
|
+
}, Promise<{
|
|
99
|
+
account: {
|
|
100
|
+
_creationTime: number;
|
|
101
|
+
_id: import("convex/values").GenericId<"accounts">;
|
|
102
|
+
appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
|
|
103
|
+
capabilities?: any;
|
|
104
|
+
configuration?: any;
|
|
105
|
+
country?: string | undefined;
|
|
106
|
+
email?: string | undefined;
|
|
107
|
+
metadata?: any;
|
|
108
|
+
missingRequirements?: string[] | undefined;
|
|
109
|
+
name?: string | undefined;
|
|
110
|
+
onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
|
|
111
|
+
orgId?: string | undefined;
|
|
112
|
+
requirements?: any;
|
|
113
|
+
statementDescriptor?: string | undefined;
|
|
114
|
+
stripeAccountId: string;
|
|
115
|
+
userId: string;
|
|
116
|
+
};
|
|
117
|
+
status: "unique";
|
|
118
|
+
} | {
|
|
119
|
+
reason: "ambiguous" | "closed" | "closure_unresolved" | "invalid_account" | "missing" | "organization";
|
|
120
|
+
status: "unavailable";
|
|
121
|
+
}>>;
|
|
95
122
|
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/core/queries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/core/queries.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;UAMrB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;UAW/B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;UAS7B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;UAS5B,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;UAsBrC,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,+EAM5B,CAAC;AAEH,eAAO,MAAM,aAAa,iFAOxB,CAAC;AAEH,sFAAsF;AACtF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;GAIpC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { v } from "convex/values";
|
|
2
2
|
import { query } from "../_generated/server";
|
|
3
3
|
import { accountDocValidator, onboardingStatusValidator } from "./validators";
|
|
4
|
+
import { personalAccountMappingValidator, resolvePersonalAccountMapping, } from "./personalAccountMapping.js";
|
|
4
5
|
// =============================================================================
|
|
5
6
|
// ACCOUNT QUERIES
|
|
6
7
|
// =============================================================================
|
|
@@ -83,4 +84,10 @@ export const getStripeMode = query({
|
|
|
83
84
|
return secretKey?.startsWith("sk_test_") ? "test" : "live";
|
|
84
85
|
},
|
|
85
86
|
});
|
|
87
|
+
/** Unique personal mapping evidence only; the host still authenticates its caller. */
|
|
88
|
+
export const getPersonalAccountMapping = query({
|
|
89
|
+
args: { userId: v.string() },
|
|
90
|
+
returns: personalAccountMappingValidator,
|
|
91
|
+
handler: (ctx, { userId }) => resolvePersonalAccountMapping(ctx, userId),
|
|
92
|
+
});
|
|
86
93
|
//# sourceMappingURL=queries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/component/core/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/component/core/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AAErC,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;IAC9B,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE;IACrC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,OAAO,MAAM,GAAG,CAAC,EAAE,CAAC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