SurfSense/surfsense_web/zero/schema/user.ts
DESKTOP-RTLN3BA\$punk ae9d36d77f
Some checks are pending
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Blocked by required conditions
Build and Push Docker Images / tag_release (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Blocked by required conditions
feat: unified credits and its cost calculations
2026-05-02 14:34:23 -07:00

20 lines
788 B
TypeScript

import { number, string, table } from "@rocicorp/zero";
/**
* Live-meter slice of the ``user`` table replicated through Zero.
*
* ``premiumCreditMicrosLimit`` / ``premiumCreditMicrosUsed`` are stored
* as integer micro-USD (1_000_000 == $1.00). UI consumers divide by 1M
* when displaying. 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(),
pagesLimit: number().from("pages_limit"),
pagesUsed: number().from("pages_used"),
premiumCreditMicrosLimit: number().from("premium_credit_micros_limit"),
premiumCreditMicrosUsed: number().from("premium_credit_micros_used"),
})
.primaryKey("id");