feat(db): mesh data model — meshes, members, invites, audit log
- pgSchema "mesh" with 4 tables isolating the peer mesh domain - Enums: visibility, transport, tier, role - audit_log is metadata-only (E2E encryption enforced at broker/client) - Cascade on mesh delete, soft-delete via archivedAt/revokedAt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
38
apps/web/src/modules/billing/lib/api.ts
Normal file
38
apps/web/src/modules/billing/lib/api.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { handle } from "@turbostarter/api/utils";
|
||||
|
||||
import { api } from "~/lib/api/client";
|
||||
|
||||
import type { InferRequestType } from "hono/client";
|
||||
|
||||
const KEY = "billing";
|
||||
|
||||
const queries = {
|
||||
customer: {
|
||||
get: {
|
||||
queryKey: [KEY, "customer"],
|
||||
queryFn: () => handle(api.billing.customer.$get)(),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
portal: {
|
||||
get: {
|
||||
mutationKey: [KEY, "portal"],
|
||||
mutationFn: (data: InferRequestType<typeof api.billing.portal.$get>) =>
|
||||
handle(api.billing.portal.$get)(data),
|
||||
},
|
||||
},
|
||||
checkout: {
|
||||
create: {
|
||||
mutationKey: [KEY, "checkout"],
|
||||
mutationFn: (data: InferRequestType<typeof api.billing.checkout.$post>) =>
|
||||
handle(api.billing.checkout.$post)(data),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const billing = {
|
||||
queries,
|
||||
mutations,
|
||||
};
|
||||
Reference in New Issue
Block a user