mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-03 21:02:40 +02:00
feat: unified credits and its cost calculations
This commit is contained in:
parent
451a98936e
commit
ae9d36d77f
61 changed files with 5835 additions and 272 deletions
|
|
@ -1,11 +1,20 @@
|
|||
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"),
|
||||
premiumTokensLimit: number().from("premium_tokens_limit"),
|
||||
premiumTokensUsed: number().from("premium_tokens_used"),
|
||||
premiumCreditMicrosLimit: number().from("premium_credit_micros_limit"),
|
||||
premiumCreditMicrosUsed: number().from("premium_credit_micros_used"),
|
||||
})
|
||||
.primaryKey("id");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue