SurfSense/surfsense_web/zero/schema/user.ts
DESKTOP-RTLN3BA\$punk a7407502d3 feat(refactor): refactor payment system to implement unified credit wallet.
- Updated environment variables and - configurations for credit purchases via Stripe, replacing legacy page pack system.
- Introduced auto-reload feature for credit top-ups and modified database models to track credit transactions.
- Updated notification system to handle insufficient credits and auto-reload failures.
- Adjusted API routes and schemas to reflect changes in credit management.
2026-06-10 16:49:03 -07:00

18 lines
694 B
TypeScript

import { number, string, table } from "@rocicorp/zero";
/**
* Live-meter slice of the ``user`` table replicated through Zero.
*
* ``creditMicrosBalance`` is stored as integer micro-USD (1_000_000 == $1.00);
* UI consumers divide by 1M when displaying and clamp at $0.00 (the balance can
* dip slightly negative when actual cost exceeds the pre-charge estimate).
* Sensitive fields (email, hashed_password, oauth, etc.) are intentionally
* omitted via the Postgres column-list publication so they never enter WAL
* replication.
*/
export const userTable = table("user")
.columns({
id: string(),
creditMicrosBalance: number().from("credit_micros_balance"),
})
.primaryKey("id");