feat(shared,api): add pause + sort_order columns and contracts
Adds server-side pause accounting and activity ordering primitives. - WorkSession contract gains paused_seconds (number) and paused_at (ISO string | null). - Activity contract gains sort_order (number); new ReorderActivitiesInput zod. - work_sessions += paused_seconds (int NOT NULL DEFAULT 0) + paused_at (timestamp_ms nullable). - activities += sort_order (int NOT NULL DEFAULT 0). - toWorkSession / toActivity map the new fields; generated migration 0003. The new fields are additive; existing api/worker/admin tests stay green. Products affected: SoleLog backend (apps/api), shared contracts (packages/shared)
This commit is contained in:
@@ -124,6 +124,7 @@ export const activities = sqliteTable('activities', {
|
||||
.$type<string[]>()
|
||||
.notNull()
|
||||
.default(['Kurk', 'Berk', '3D']),
|
||||
sortOrder: integer('sort_order').notNull().default(0),
|
||||
createdAt: integer('created_at', { mode: 'timestamp_ms' })
|
||||
.default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`)
|
||||
.notNull(),
|
||||
@@ -144,6 +145,8 @@ export const workSessions = sqliteTable(
|
||||
startTime: integer('start_time', { mode: 'timestamp_ms' }).notNull(),
|
||||
endTime: integer('end_time', { mode: 'timestamp_ms' }), // null = active
|
||||
durationSeconds: integer('duration_seconds'),
|
||||
pausedSeconds: integer('paused_seconds').notNull().default(0),
|
||||
pausedAt: integer('paused_at', { mode: 'timestamp_ms' }), // null = running
|
||||
status: text('status').notNull().default('active'), // 'active' | 'completed' | 'discarded'
|
||||
source: text('source').notNull().default('app'), // 'app' | 'manual'
|
||||
notes: text('notes'),
|
||||
|
||||
Reference in New Issue
Block a user