additional features, refinement and more control over the app from admin side, better bookings UX
This commit is contained in:
@@ -91,6 +91,16 @@ export const activityLogs = sqliteTable('activity_logs', {
|
||||
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
|
||||
});
|
||||
|
||||
// Metrics table for tracking monthly statistics
|
||||
export const metrics = sqliteTable('metrics', {
|
||||
id: text('id').primaryKey(),
|
||||
metricType: text('metric_type').notNull(), // e.g., 'monthly_bookings'
|
||||
period: text('period').notNull(), // e.g., '2025-09' for September 2025
|
||||
value: integer('value').notNull().default(0),
|
||||
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
|
||||
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
|
||||
});
|
||||
|
||||
// Zod schemas for validation
|
||||
export const insertUserSchema = createInsertSchema(users);
|
||||
export const selectUserSchema = createSelectSchema(users);
|
||||
@@ -106,6 +116,8 @@ export const insertSettingSchema = createInsertSchema(settings);
|
||||
export const selectSettingSchema = createSelectSchema(settings);
|
||||
export const insertActivityLogSchema = createInsertSchema(activityLogs);
|
||||
export const selectActivityLogSchema = createSelectSchema(activityLogs);
|
||||
export const insertMetricSchema = createInsertSchema(metrics);
|
||||
export const selectMetricSchema = createSelectSchema(metrics);
|
||||
|
||||
// Types
|
||||
export type User = typeof users.$inferSelect;
|
||||
@@ -122,3 +134,5 @@ export type Setting = typeof settings.$inferSelect;
|
||||
export type NewSetting = typeof settings.$inferInsert;
|
||||
export type ActivityLog = typeof activityLogs.$inferSelect;
|
||||
export type NewActivityLog = typeof activityLogs.$inferInsert;
|
||||
export type Metric = typeof metrics.$inferSelect;
|
||||
export type NewMetric = typeof metrics.$inferInsert;
|
||||
|
||||
Reference in New Issue
Block a user