feature plus ux rearrangements
This commit is contained in:
+15
-5
@@ -5,10 +5,12 @@
|
||||
// Relations reference collections by name; the `ids` map maps collection
|
||||
// name -> runtime id (filled as each collection is created).
|
||||
//
|
||||
// NOTE: the native `users` auth collection and the superuser-only `otp`
|
||||
// collection are NOT in SCHEMA_PLAN — they're applied separately in
|
||||
// migrate.ts (users is PB's built-in auth model; `otp` needs null rules,
|
||||
// which the `col()` builder can't express). Everything else lives here.
|
||||
// NOTE: the native `users` auth collection and the superuser-only `otp` +
|
||||
// `accesscodes` collections are NOT in SCHEMA_PLAN — they're applied separately
|
||||
// in migrate.ts (users is PB's built-in auth model; `otp`/`accesscodes` need
|
||||
// null rules, which the `col()` builder can't express). The public-read
|
||||
// `platform` settings collection is also applied there (needs null write
|
||||
// rules). Everything else lives here.
|
||||
|
||||
export interface FieldDef {
|
||||
name: string;
|
||||
@@ -133,11 +135,19 @@ export const SCHEMA_PLAN: CollectionPlanEntry[] = [
|
||||
uniqueText("slug"),
|
||||
text("stripeCustomerId"),
|
||||
bool("active"),
|
||||
jsonField("featureFlags"),
|
||||
number("payday"),
|
||||
text("lastIssued"),
|
||||
text("paydayTime"),
|
||||
text("timezone"),
|
||||
// Access gating. paymentMode: how this fam has access — a code, a
|
||||
// Stripe subscription, canceled, or none (no access). `active` is the
|
||||
// derived "usable right now" flag recomputed by the access check on
|
||||
// every layout load (and by the Stripe webhook for subs). `accessCodeId`
|
||||
// + `accessCodeEnteredAt` back the 'code' mode (the duration clock
|
||||
// starts at entry; global expiry is the code createdAt + expiry months).
|
||||
select("paymentMode", ["none", "code", "sub", "canceled"]),
|
||||
text("accessCodeId"),
|
||||
date("accessCodeEnteredAt"),
|
||||
],
|
||||
{ listRule: RULE_OWN_FAM, viewRule: RULE_OWN_FAM, updateRule: RULE_OWN_FAM },
|
||||
)(ids),
|
||||
|
||||
Reference in New Issue
Block a user