mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-12 20:45:20 +02:00
- 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.
18 lines
694 B
TypeScript
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");
|