modified: shared/schema.ts

This commit is contained in:
MrPiglr 2026-01-29 10:24:03 -07:00
parent 5bc0bdaca6
commit b6833f0432

View file

@ -853,8 +853,8 @@ export type RevenueEvent = typeof revenue_events.$inferSelect;
// ============================================ // ============================================
// Revenue Splits (SPLITS-1) // Revenue Splits (SPLITS-1)
// ============================================ // ============================================
// Project collaborators: Who contributes to a project // Revenue split collaborators: Historical tracking of who contributes to revenue splits
export const project_collaborators = pgTable("project_collaborators", { export const revenue_split_collaborators = pgTable("revenue_split_collaborators", {
id: varchar("id").primaryKey().$defaultFn(() => crypto.randomUUID()), id: varchar("id").primaryKey().$defaultFn(() => crypto.randomUUID()),
project_id: varchar("project_id").notNull(), project_id: varchar("project_id").notNull(),
user_id: varchar("user_id").notNull(), user_id: varchar("user_id").notNull(),
@ -863,16 +863,16 @@ export const project_collaborators = pgTable("project_collaborators", {
left_at: timestamp("left_at"), // Null if still active left_at: timestamp("left_at"), // Null if still active
}); });
export const insertProjectCollaboratorSchema = createInsertSchema( export const insertRevenueSplitCollaboratorSchema = createInsertSchema(
project_collaborators revenue_split_collaborators
).omit({ ).omit({
joined_at: true, joined_at: true,
}); });
export type InsertProjectCollaborator = z.infer< export type InsertRevenueSplitCollaborator = z.infer<
typeof insertProjectCollaboratorSchema typeof insertRevenueSplitCollaboratorSchema
>; >;
export type ProjectCollaborator = typeof project_collaborators.$inferSelect; export type RevenueSplitCollaborator = typeof revenue_split_collaborators.$inferSelect;
// Revenue splits: Time-versioned allocation rules // Revenue splits: Time-versioned allocation rules
export const revenue_splits = pgTable("revenue_splits", { export const revenue_splits = pgTable("revenue_splits", {