@happyvertical/smrt-timesheets 0.53.0 → 0.53.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/AGENTS.md +32 -21
  2. package/README.md +124 -58
  3. package/agents/period-rollup.md +130 -0
  4. package/dist/attendance/models.d.ts +59 -0
  5. package/dist/attendance/models.d.ts.map +1 -0
  6. package/dist/attendance/service.d.ts +64 -0
  7. package/dist/attendance/service.d.ts.map +1 -0
  8. package/dist/attendance.d.ts +5 -0
  9. package/dist/attendance.d.ts.map +1 -0
  10. package/dist/attendance.js +323 -0
  11. package/dist/attendance.js.map +1 -0
  12. package/dist/chunks/attendance-Bk8o96dt.js +60 -0
  13. package/dist/chunks/attendance-Bk8o96dt.js.map +1 -0
  14. package/dist/chunks/models-D9n8HKXH.js +166 -0
  15. package/dist/chunks/models-D9n8HKXH.js.map +1 -0
  16. package/dist/chunks/rollup-yE0TFLJe.js +425 -0
  17. package/dist/chunks/rollup-yE0TFLJe.js.map +1 -0
  18. package/dist/chunks/service-time-entry-B2gHrJYI.js +190 -0
  19. package/dist/chunks/service-time-entry-B2gHrJYI.js.map +1 -0
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +25 -205
  23. package/dist/index.js.map +1 -1
  24. package/dist/manifest.json +2553 -652
  25. package/dist/rollup/attendance.d.ts +8 -0
  26. package/dist/rollup/attendance.d.ts.map +1 -0
  27. package/dist/rollup/calculation.d.ts +7 -0
  28. package/dist/rollup/calculation.d.ts.map +1 -0
  29. package/dist/rollup/models.d.ts +47 -0
  30. package/dist/rollup/models.d.ts.map +1 -0
  31. package/dist/rollup/service.d.ts +37 -0
  32. package/dist/rollup/service.d.ts.map +1 -0
  33. package/dist/rollup/types.d.ts +38 -0
  34. package/dist/rollup/types.d.ts.map +1 -0
  35. package/dist/rollup/write.d.ts +4 -0
  36. package/dist/rollup/write.d.ts.map +1 -0
  37. package/dist/rollup.d.ts +5 -0
  38. package/dist/rollup.d.ts.map +1 -0
  39. package/dist/rollup.js +2 -0
  40. package/dist/smrt-knowledge.json +1319 -433
  41. package/package.json +19 -10
  42. package/dist/svelte/components/__tests__/DurationDisplay.test.js +0 -57
  43. package/dist/svelte/components/__tests__/TimeEntryApprovalQueue.test.js +0 -114
  44. package/dist/svelte/components/__tests__/TimeEntryCard.test.js +0 -45
  45. package/dist/svelte/components/__tests__/TimeEntryList.test.js +0 -50
  46. package/dist/svelte/components/__tests__/TimeSummary.test.js +0 -39
@@ -2,86 +2,83 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-timesheets",
5
- "packageVersion": "0.53.0",
5
+ "packageVersion": "0.53.2",
6
6
  "objects": {
7
- "@happyvertical/smrt-timesheets:ServiceChargeSnapshot": {
8
- "name": "servicechargesnapshot",
9
- "className": "ServiceChargeSnapshot",
10
- "qualifiedName": "@happyvertical/smrt-timesheets:ServiceChargeSnapshot",
11
- "collection": "servicechargesnapshots",
12
- "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-snapshots.ts",
7
+ "@happyvertical/smrt-timesheets:AttendancePunch": {
8
+ "name": "attendancepunch",
9
+ "className": "AttendancePunch",
10
+ "qualifiedName": "@happyvertical/smrt-timesheets:AttendancePunch",
11
+ "collection": "attendancepunches",
12
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/attendance/models.ts",
13
13
  "packageName": "@happyvertical/smrt-timesheets",
14
14
  "fields": {
15
15
  "tenantId": {
16
16
  "type": "text",
17
- "required": false,
17
+ "required": true,
18
18
  "_meta": {
19
19
  "sqlType": "UUID",
20
- "nullable": true,
21
20
  "__tenancy": {
22
21
  "isTenantIdField": true,
23
22
  "autoFilter": true,
24
- "required": false,
23
+ "required": true,
25
24
  "autoPopulate": true,
26
- "nullable": true,
27
- "mode": "optional",
25
+ "nullable": false,
26
+ "mode": "required",
28
27
  "field": "tenantId",
29
28
  "allowSuperAdminBypass": false
30
29
  }
31
30
  }
32
31
  },
33
- "timeEntryId": {
34
- "type": "foreignKey",
35
- "required": true,
36
- "related": "ServiceTimeEntry",
37
- "_meta": {
38
- "required": true
39
- }
32
+ "profileId": {
33
+ "type": "crossPackageRef",
34
+ "required": false,
35
+ "related": "@happyvertical/smrt-profiles:Profile"
40
36
  },
41
- "amount": {
37
+ "startedAt": {
38
+ "type": "datetime",
39
+ "required": false
40
+ },
41
+ "endedAt": {
42
+ "type": "datetime",
43
+ "required": false
44
+ },
45
+ "durationSeconds": {
42
46
  "type": "integer",
43
- "required": false,
47
+ "required": true,
44
48
  "default": 0
45
49
  },
46
- "currency": {
47
- "type": "text",
48
- "required": false,
49
- "_meta": {}
50
+ "unpaidBreakSeconds": {
51
+ "type": "integer",
52
+ "required": true,
53
+ "default": 0
50
54
  },
51
- "pricingVersion": {
52
- "type": "text",
53
- "required": false,
54
- "_meta": {}
55
+ "reviewRequired": {
56
+ "type": "boolean",
57
+ "required": true,
58
+ "default": false
55
59
  },
56
- "strategy": {
57
- "type": "text",
58
- "required": false,
59
- "_meta": {}
60
+ "recordedOffline": {
61
+ "type": "boolean",
62
+ "required": true,
63
+ "default": false
60
64
  },
61
- "rateSnapshot": {
62
- "type": "text",
65
+ "serviceTimeEntryId": {
66
+ "type": "foreignKey",
63
67
  "required": false,
64
- "_meta": {}
68
+ "related": "ServiceTimeEntry",
69
+ "_meta": {
70
+ "nullable": true
71
+ }
65
72
  },
66
- "sourceChargeRef": {
73
+ "openSlot": {
67
74
  "type": "text",
68
- "required": false,
69
- "_meta": {}
70
- },
71
- "createdAt": {
72
- "type": "datetime",
73
- "required": false
75
+ "required": true,
76
+ "_meta": {
77
+ "required": true
78
+ }
74
79
  }
75
80
  },
76
81
  "methods": {
77
- "initialize": {
78
- "name": "initialize",
79
- "async": true,
80
- "parameters": [],
81
- "returnType": "Promise<this>",
82
- "isStatic": false,
83
- "isPublic": true
84
- },
85
82
  "save": {
86
83
  "name": "save",
87
84
  "async": true,
@@ -92,12 +89,17 @@
92
89
  }
93
90
  },
94
91
  "decoratorConfig": {
95
- "tableName": "service_charge_snapshots",
96
- "previousQualifiedNames": [
97
- "@happyvertical/smrt-projects:ServiceChargeSnapshot"
98
- ],
99
- "conflictColumns": [
100
- "time_entry_id"
92
+ "tableName": "attendance_punches",
93
+ "indexes": [
94
+ {
95
+ "name": "attendance_punches_open_owner_key",
96
+ "columns": [
97
+ "tenantId",
98
+ "profileId",
99
+ "openSlot"
100
+ ],
101
+ "unique": true
102
+ }
101
103
  ],
102
104
  "api": {
103
105
  "include": [
@@ -118,22 +120,47 @@
118
120
  ]
119
121
  },
120
122
  "tenantScoped": {
121
- "mode": "optional"
122
- }
123
+ "mode": "required"
124
+ },
125
+ "conflictColumns": [
126
+ "tenant_id",
127
+ "slug",
128
+ "context"
129
+ ]
123
130
  },
124
131
  "extends": "SmrtObject",
125
- "exportName": "ServiceChargeSnapshot",
126
- "collectionExportName": "ServiceChargeSnapshotCollection",
132
+ "exportName": "AttendancePunch",
133
+ "collectionExportName": "AttendancePunchCollection",
127
134
  "validationRules": [
128
135
  {
129
- "field": "timeEntryId",
136
+ "field": "durationSeconds",
130
137
  "rule": "required",
131
- "fieldType": "foreignKey"
138
+ "fieldType": "integer"
139
+ },
140
+ {
141
+ "field": "unpaidBreakSeconds",
142
+ "rule": "required",
143
+ "fieldType": "integer"
144
+ },
145
+ {
146
+ "field": "reviewRequired",
147
+ "rule": "required",
148
+ "fieldType": "boolean"
149
+ },
150
+ {
151
+ "field": "recordedOffline",
152
+ "rule": "required",
153
+ "fieldType": "boolean"
154
+ },
155
+ {
156
+ "field": "openSlot",
157
+ "rule": "required",
158
+ "fieldType": "text"
132
159
  }
133
160
  ],
134
161
  "schema": {
135
- "tableName": "service_charge_snapshots",
136
- "ddl": "CREATE TABLE IF NOT EXISTS \"service_charge_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"time_entry_id\" UUID NOT NULL,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT,\n \"pricing_version\" TEXT,\n \"strategy\" TEXT,\n \"rate_snapshot\" TEXT,\n \"source_charge_ref\" TEXT\n);",
162
+ "tableName": "attendance_punches",
163
+ "ddl": "CREATE TABLE IF NOT EXISTS \"attendance_punches\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"profile_id\" UUID,\n \"started_at\" TIMESTAMP,\n \"ended_at\" TIMESTAMP,\n \"duration_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"unpaid_break_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"review_required\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"recorded_offline\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"service_time_entry_id\" UUID,\n \"open_slot\" TEXT NOT NULL\n);",
137
164
  "columns": {
138
165
  "id": {
139
166
  "type": "UUID",
@@ -163,150 +190,164 @@
163
190
  "tenant_id": {
164
191
  "type": "UUID",
165
192
  "referenceKind": "tenantId",
166
- "notNull": false,
193
+ "notNull": true,
167
194
  "unique": false
168
195
  },
169
- "time_entry_id": {
196
+ "profile_id": {
170
197
  "type": "UUID",
171
- "referenceKind": "foreignKey",
172
- "notNull": true,
173
- "unique": false,
174
- "foreignKey": {
175
- "table": "service_time_entries",
176
- "column": "id",
177
- "onDelete": "CASCADE",
178
- "onUpdate": "CASCADE"
179
- }
180
- },
181
- "amount": {
182
- "type": "INTEGER",
183
- "notNull": false,
184
- "unique": false,
185
- "default": 0
186
- },
187
- "currency": {
188
- "type": "TEXT",
198
+ "referenceKind": "crossPackageRef",
189
199
  "notNull": false,
190
200
  "unique": false
191
201
  },
192
- "pricing_version": {
193
- "type": "TEXT",
202
+ "started_at": {
203
+ "type": "TIMESTAMP",
194
204
  "notNull": false,
195
205
  "unique": false
196
206
  },
197
- "strategy": {
198
- "type": "TEXT",
207
+ "ended_at": {
208
+ "type": "TIMESTAMP",
199
209
  "notNull": false,
200
210
  "unique": false
201
211
  },
202
- "rate_snapshot": {
203
- "type": "TEXT",
212
+ "duration_seconds": {
213
+ "type": "INTEGER",
214
+ "notNull": true,
215
+ "unique": false,
216
+ "default": 0
217
+ },
218
+ "unpaid_break_seconds": {
219
+ "type": "INTEGER",
220
+ "notNull": true,
221
+ "unique": false,
222
+ "default": 0
223
+ },
224
+ "review_required": {
225
+ "type": "BOOLEAN",
226
+ "notNull": true,
227
+ "unique": false,
228
+ "default": false
229
+ },
230
+ "recorded_offline": {
231
+ "type": "BOOLEAN",
232
+ "notNull": true,
233
+ "unique": false,
234
+ "default": false
235
+ },
236
+ "service_time_entry_id": {
237
+ "type": "UUID",
238
+ "referenceKind": "foreignKey",
204
239
  "notNull": false,
205
- "unique": false
240
+ "unique": false,
241
+ "foreignKey": {
242
+ "table": "service_time_entries",
243
+ "column": "id",
244
+ "onDelete": "NO ACTION",
245
+ "onUpdate": "CASCADE"
246
+ }
206
247
  },
207
- "source_charge_ref": {
248
+ "open_slot": {
208
249
  "type": "TEXT",
209
- "notNull": false,
250
+ "notNull": true,
210
251
  "unique": false
211
252
  }
212
253
  },
213
254
  "indexes": [
214
255
  {
215
- "name": "service_charge_snapshots_time_entry_id_idx",
256
+ "name": "attendance_punches_slug_context_idx",
216
257
  "columns": [
217
- "time_entry_id"
258
+ "tenant_id",
259
+ "slug",
260
+ "context"
218
261
  ],
219
262
  "unique": true
220
263
  },
221
264
  {
222
- "name": "service_charge_snapshots_slug_context_idx",
265
+ "name": "attendance_punches_open_owner_key",
223
266
  "columns": [
224
- "slug",
225
- "context"
226
- ]
267
+ "tenant_id",
268
+ "profile_id",
269
+ "open_slot"
270
+ ],
271
+ "unique": true
227
272
  },
228
273
  {
229
- "name": "service_charge_snapshots_tenant_id_created_at_idx",
274
+ "name": "attendance_punches_tenant_id_created_at_idx",
230
275
  "columns": [
231
276
  "tenant_id",
232
277
  "created_at"
233
278
  ]
279
+ },
280
+ {
281
+ "name": "attendance_punches_profile_id_idx",
282
+ "columns": [
283
+ "profile_id"
284
+ ]
285
+ },
286
+ {
287
+ "name": "attendance_punches_service_time_entry_id_idx",
288
+ "columns": [
289
+ "service_time_entry_id"
290
+ ]
234
291
  }
235
292
  ],
236
- "version": "1393a1e2"
293
+ "version": "eeca63b1"
237
294
  },
238
- "importPath": "@happyvertical/smrt-timesheets"
295
+ "importPath": "@happyvertical/smrt-timesheets/attendance"
239
296
  },
240
- "@happyvertical/smrt-timesheets:ServiceCompensationSnapshot": {
241
- "name": "servicecompensationsnapshot",
242
- "className": "ServiceCompensationSnapshot",
243
- "qualifiedName": "@happyvertical/smrt-timesheets:ServiceCompensationSnapshot",
244
- "collection": "servicecompensationsnapshots",
245
- "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-snapshots.ts",
297
+ "@happyvertical/smrt-timesheets:AttendanceBreak": {
298
+ "name": "attendancebreak",
299
+ "className": "AttendanceBreak",
300
+ "qualifiedName": "@happyvertical/smrt-timesheets:AttendanceBreak",
301
+ "collection": "attendancebreaks",
302
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/attendance/models.ts",
246
303
  "packageName": "@happyvertical/smrt-timesheets",
247
304
  "fields": {
248
305
  "tenantId": {
249
306
  "type": "text",
250
- "required": false,
307
+ "required": true,
251
308
  "_meta": {
252
309
  "sqlType": "UUID",
253
- "nullable": true,
254
310
  "__tenancy": {
255
311
  "isTenantIdField": true,
256
312
  "autoFilter": true,
257
- "required": false,
313
+ "required": true,
258
314
  "autoPopulate": true,
259
- "nullable": true,
260
- "mode": "optional",
315
+ "nullable": false,
316
+ "mode": "required",
261
317
  "field": "tenantId",
262
318
  "allowSuperAdminBypass": false
263
319
  }
264
320
  }
265
321
  },
266
- "timeEntryId": {
322
+ "punchId": {
267
323
  "type": "foreignKey",
268
- "required": true,
269
- "related": "ServiceTimeEntry",
270
- "_meta": {
271
- "required": true
272
- }
273
- },
274
- "amount": {
275
- "type": "integer",
276
- "required": false,
277
- "default": 0
278
- },
279
- "currency": {
280
- "type": "text",
281
- "required": false,
282
- "_meta": {}
283
- },
284
- "termsVersion": {
285
- "type": "text",
286
324
  "required": false,
287
- "_meta": {}
325
+ "related": "AttendancePunch"
288
326
  },
289
- "rateSnapshot": {
290
- "type": "text",
291
- "required": false,
292
- "_meta": {}
327
+ "startedAt": {
328
+ "type": "datetime",
329
+ "required": false
293
330
  },
294
- "createdAt": {
331
+ "endedAt": {
295
332
  "type": "datetime",
296
333
  "required": false
334
+ },
335
+ "paid": {
336
+ "type": "boolean",
337
+ "required": true,
338
+ "default": false
339
+ },
340
+ "openSlot": {
341
+ "type": "text",
342
+ "required": true,
343
+ "_meta": {
344
+ "required": true
345
+ }
297
346
  }
298
347
  },
299
348
  "methods": {
300
- "initialize": {
301
- "name": "initialize",
302
- "async": true,
303
- "parameters": [],
304
- "returnType": "Promise<this>",
305
- "isStatic": false,
306
- "isPublic": true
307
- },
308
- "save": {
309
- "name": "save",
349
+ "save": {
350
+ "name": "save",
310
351
  "async": true,
311
352
  "parameters": [],
312
353
  "returnType": "Promise<this>",
@@ -315,12 +356,17 @@
315
356
  }
316
357
  },
317
358
  "decoratorConfig": {
318
- "tableName": "service_compensation_snapshots",
319
- "previousQualifiedNames": [
320
- "@happyvertical/smrt-projects:ServiceCompensationSnapshot"
321
- ],
322
- "conflictColumns": [
323
- "time_entry_id"
359
+ "tableName": "attendance_breaks",
360
+ "indexes": [
361
+ {
362
+ "name": "attendance_breaks_open_punch_key",
363
+ "columns": [
364
+ "tenantId",
365
+ "punchId",
366
+ "openSlot"
367
+ ],
368
+ "unique": true
369
+ }
324
370
  ],
325
371
  "api": {
326
372
  "include": [
@@ -341,22 +387,32 @@
341
387
  ]
342
388
  },
343
389
  "tenantScoped": {
344
- "mode": "optional"
345
- }
390
+ "mode": "required"
391
+ },
392
+ "conflictColumns": [
393
+ "tenant_id",
394
+ "slug",
395
+ "context"
396
+ ]
346
397
  },
347
398
  "extends": "SmrtObject",
348
- "exportName": "ServiceCompensationSnapshot",
349
- "collectionExportName": "ServiceCompensationSnapshotCollection",
399
+ "exportName": "AttendanceBreak",
400
+ "collectionExportName": "AttendanceBreakCollection",
350
401
  "validationRules": [
351
402
  {
352
- "field": "timeEntryId",
403
+ "field": "paid",
353
404
  "rule": "required",
354
- "fieldType": "foreignKey"
405
+ "fieldType": "boolean"
406
+ },
407
+ {
408
+ "field": "openSlot",
409
+ "rule": "required",
410
+ "fieldType": "text"
355
411
  }
356
412
  ],
357
413
  "schema": {
358
- "tableName": "service_compensation_snapshots",
359
- "ddl": "CREATE TABLE IF NOT EXISTS \"service_compensation_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"time_entry_id\" UUID NOT NULL,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT,\n \"terms_version\" TEXT,\n \"rate_snapshot\" TEXT\n);",
414
+ "tableName": "attendance_breaks",
415
+ "ddl": "CREATE TABLE IF NOT EXISTS \"attendance_breaks\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"punch_id\" UUID,\n \"started_at\" TIMESTAMP,\n \"ended_at\" TIMESTAMP,\n \"paid\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"open_slot\" TEXT NOT NULL\n);",
360
416
  "columns": {
361
417
  "id": {
362
418
  "type": "UUID",
@@ -386,89 +442,190 @@
386
442
  "tenant_id": {
387
443
  "type": "UUID",
388
444
  "referenceKind": "tenantId",
389
- "notNull": false,
445
+ "notNull": true,
390
446
  "unique": false
391
447
  },
392
- "time_entry_id": {
448
+ "punch_id": {
393
449
  "type": "UUID",
394
450
  "referenceKind": "foreignKey",
395
- "notNull": true,
451
+ "notNull": false,
396
452
  "unique": false,
397
453
  "foreignKey": {
398
- "table": "service_time_entries",
454
+ "table": "attendance_punches",
399
455
  "column": "id",
400
- "onDelete": "CASCADE",
456
+ "onDelete": "NO ACTION",
401
457
  "onUpdate": "CASCADE"
402
458
  }
403
459
  },
404
- "amount": {
405
- "type": "INTEGER",
406
- "notNull": false,
407
- "unique": false,
408
- "default": 0
409
- },
410
- "currency": {
411
- "type": "TEXT",
460
+ "started_at": {
461
+ "type": "TIMESTAMP",
412
462
  "notNull": false,
413
463
  "unique": false
414
464
  },
415
- "terms_version": {
416
- "type": "TEXT",
465
+ "ended_at": {
466
+ "type": "TIMESTAMP",
417
467
  "notNull": false,
418
468
  "unique": false
419
469
  },
420
- "rate_snapshot": {
470
+ "paid": {
471
+ "type": "BOOLEAN",
472
+ "notNull": true,
473
+ "unique": false,
474
+ "default": false
475
+ },
476
+ "open_slot": {
421
477
  "type": "TEXT",
422
- "notNull": false,
478
+ "notNull": true,
423
479
  "unique": false
424
480
  }
425
481
  },
426
482
  "indexes": [
427
483
  {
428
- "name": "service_compensation_snapshots_time_entry_id_idx",
484
+ "name": "attendance_breaks_slug_context_idx",
429
485
  "columns": [
430
- "time_entry_id"
486
+ "tenant_id",
487
+ "slug",
488
+ "context"
431
489
  ],
432
490
  "unique": true
433
491
  },
434
492
  {
435
- "name": "service_compensation_snapshots_slug_context_idx",
493
+ "name": "attendance_breaks_open_punch_key",
436
494
  "columns": [
437
- "slug",
438
- "context"
439
- ]
495
+ "tenant_id",
496
+ "punch_id",
497
+ "open_slot"
498
+ ],
499
+ "unique": true
440
500
  },
441
501
  {
442
- "name": "service_compensation_snapshots_tenant_id_created_at_idx",
502
+ "name": "attendance_breaks_tenant_id_created_at_idx",
443
503
  "columns": [
444
504
  "tenant_id",
445
505
  "created_at"
446
506
  ]
507
+ },
508
+ {
509
+ "name": "attendance_breaks_punch_id_idx",
510
+ "columns": [
511
+ "punch_id"
512
+ ]
447
513
  }
448
514
  ],
449
- "version": "cd8670e5"
515
+ "version": "00cb739e"
450
516
  },
451
- "importPath": "@happyvertical/smrt-timesheets"
517
+ "importPath": "@happyvertical/smrt-timesheets/attendance"
452
518
  },
453
- "@happyvertical/smrt-timesheets:ServiceChargeSnapshotCollection": {
454
- "name": "servicechargesnapshotcollection",
455
- "className": "ServiceChargeSnapshotCollection",
456
- "qualifiedName": "@happyvertical/smrt-timesheets:ServiceChargeSnapshotCollection",
457
- "collection": "servicechargesnapshots",
458
- "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-snapshots.ts",
519
+ "@happyvertical/smrt-timesheets:AttendanceReplay": {
520
+ "name": "attendancereplay",
521
+ "className": "AttendanceReplay",
522
+ "qualifiedName": "@happyvertical/smrt-timesheets:AttendanceReplay",
523
+ "collection": "attendancereplays",
524
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/attendance/models.ts",
459
525
  "packageName": "@happyvertical/smrt-timesheets",
460
- "fields": {},
461
- "methods": {},
526
+ "fields": {
527
+ "tenantId": {
528
+ "type": "text",
529
+ "required": true,
530
+ "_meta": {
531
+ "sqlType": "UUID",
532
+ "__tenancy": {
533
+ "isTenantIdField": true,
534
+ "autoFilter": true,
535
+ "required": true,
536
+ "autoPopulate": true,
537
+ "nullable": false,
538
+ "mode": "required",
539
+ "field": "tenantId",
540
+ "allowSuperAdminBypass": false
541
+ }
542
+ }
543
+ },
544
+ "replayKey": {
545
+ "type": "text",
546
+ "required": true,
547
+ "_meta": {
548
+ "required": true,
549
+ "unique": true
550
+ }
551
+ },
552
+ "content": {
553
+ "type": "text",
554
+ "required": false,
555
+ "_meta": {}
556
+ },
557
+ "outcome": {
558
+ "type": "text",
559
+ "required": false,
560
+ "_meta": {}
561
+ }
562
+ },
563
+ "methods": {
564
+ "getOutcome": {
565
+ "name": "getOutcome",
566
+ "async": false,
567
+ "parameters": [],
568
+ "returnType": "AttendanceReplayOutcome",
569
+ "isStatic": false,
570
+ "isPublic": true
571
+ },
572
+ "setOutcome": {
573
+ "name": "setOutcome",
574
+ "async": false,
575
+ "parameters": [
576
+ {
577
+ "name": "value",
578
+ "type": "AttendanceReplayOutcome",
579
+ "optional": false
580
+ }
581
+ ],
582
+ "returnType": "void",
583
+ "isStatic": false,
584
+ "isPublic": true
585
+ },
586
+ "save": {
587
+ "name": "save",
588
+ "async": true,
589
+ "parameters": [],
590
+ "returnType": "Promise<this>",
591
+ "isStatic": false,
592
+ "isPublic": true
593
+ }
594
+ },
462
595
  "decoratorConfig": {
463
- "tableName": "service_charge_snapshots"
596
+ "tableName": "attendance_replays",
597
+ "sensitive": true,
598
+ "api": {
599
+ "include": []
600
+ },
601
+ "cli": {
602
+ "include": []
603
+ },
604
+ "mcp": {
605
+ "include": []
606
+ },
607
+ "tenantScoped": {
608
+ "mode": "required"
609
+ },
610
+ "conflictColumns": [
611
+ "tenant_id",
612
+ "slug",
613
+ "context"
614
+ ]
464
615
  },
465
- "extends": "SmrtCollection",
466
- "extendsTypeArg": "ServiceChargeSnapshot",
467
- "exportName": "ServiceChargeSnapshotCollection",
468
- "collectionExportName": "ServiceChargeSnapshotCollectionCollection",
616
+ "extends": "SmrtObject",
617
+ "exportName": "AttendanceReplay",
618
+ "collectionExportName": "AttendanceReplayCollection",
619
+ "validationRules": [
620
+ {
621
+ "field": "replayKey",
622
+ "rule": "required",
623
+ "fieldType": "text"
624
+ }
625
+ ],
469
626
  "schema": {
470
- "tableName": "service_charge_snapshots",
471
- "ddl": "CREATE TABLE IF NOT EXISTS \"service_charge_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"time_entry_id\" UUID NOT NULL,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT,\n \"pricing_version\" TEXT,\n \"strategy\" TEXT,\n \"rate_snapshot\" TEXT,\n \"source_charge_ref\" TEXT\n);",
627
+ "tableName": "attendance_replays",
628
+ "ddl": "CREATE TABLE IF NOT EXISTS \"attendance_replays\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"replay_key\" TEXT NOT NULL UNIQUE,\n \"content\" TEXT,\n \"outcome\" TEXT\n);",
472
629
  "columns": {
473
630
  "id": {
474
631
  "type": "UUID",
@@ -498,48 +655,20 @@
498
655
  "tenant_id": {
499
656
  "type": "UUID",
500
657
  "referenceKind": "tenantId",
501
- "notNull": false,
502
- "unique": false
503
- },
504
- "time_entry_id": {
505
- "type": "UUID",
506
- "referenceKind": "foreignKey",
507
658
  "notNull": true,
508
- "unique": false,
509
- "foreignKey": {
510
- "table": "service_time_entries",
511
- "column": "id",
512
- "onDelete": "CASCADE",
513
- "onUpdate": "CASCADE"
514
- }
515
- },
516
- "amount": {
517
- "type": "INTEGER",
518
- "notNull": false,
519
- "unique": false,
520
- "default": 0
521
- },
522
- "currency": {
523
- "type": "TEXT",
524
- "notNull": false,
525
- "unique": false
526
- },
527
- "pricing_version": {
528
- "type": "TEXT",
529
- "notNull": false,
530
659
  "unique": false
531
660
  },
532
- "strategy": {
661
+ "replay_key": {
533
662
  "type": "TEXT",
534
- "notNull": false,
535
- "unique": false
663
+ "notNull": true,
664
+ "unique": true
536
665
  },
537
- "rate_snapshot": {
666
+ "content": {
538
667
  "type": "TEXT",
539
668
  "notNull": false,
540
669
  "unique": false
541
670
  },
542
- "source_charge_ref": {
671
+ "outcome": {
543
672
  "type": "TEXT",
544
673
  "notNull": false,
545
674
  "unique": false
@@ -547,50 +676,45 @@
547
676
  },
548
677
  "indexes": [
549
678
  {
550
- "name": "service_charge_snapshots_time_entry_id_idx",
551
- "columns": [
552
- "time_entry_id"
553
- ],
554
- "unique": true
555
- },
556
- {
557
- "name": "service_charge_snapshots_slug_context_idx",
679
+ "name": "attendance_replays_slug_context_idx",
558
680
  "columns": [
681
+ "tenant_id",
559
682
  "slug",
560
683
  "context"
561
- ]
684
+ ],
685
+ "unique": true
562
686
  },
563
687
  {
564
- "name": "service_charge_snapshots_tenant_id_created_at_idx",
688
+ "name": "attendance_replays_tenant_id_created_at_idx",
565
689
  "columns": [
566
690
  "tenant_id",
567
691
  "created_at"
568
692
  ]
569
693
  }
570
694
  ],
571
- "version": "1393a1e2"
695
+ "version": "f051b7b6"
572
696
  },
573
- "importPath": "@happyvertical/smrt-timesheets"
697
+ "importPath": "@happyvertical/smrt-timesheets/attendance"
574
698
  },
575
- "@happyvertical/smrt-timesheets:ServiceCompensationSnapshotCollection": {
576
- "name": "servicecompensationsnapshotcollection",
577
- "className": "ServiceCompensationSnapshotCollection",
578
- "qualifiedName": "@happyvertical/smrt-timesheets:ServiceCompensationSnapshotCollection",
579
- "collection": "servicecompensationsnapshots",
580
- "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-snapshots.ts",
699
+ "@happyvertical/smrt-timesheets:AttendancePunchCollection": {
700
+ "name": "attendancepunchcollection",
701
+ "className": "AttendancePunchCollection",
702
+ "qualifiedName": "@happyvertical/smrt-timesheets:AttendancePunchCollection",
703
+ "collection": "attendancepunches",
704
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/attendance/models.ts",
581
705
  "packageName": "@happyvertical/smrt-timesheets",
582
706
  "fields": {},
583
707
  "methods": {},
584
708
  "decoratorConfig": {
585
- "tableName": "service_compensation_snapshots"
709
+ "tableName": "attendance_punches"
586
710
  },
587
711
  "extends": "SmrtCollection",
588
- "extendsTypeArg": "ServiceCompensationSnapshot",
589
- "exportName": "ServiceCompensationSnapshotCollection",
590
- "collectionExportName": "ServiceCompensationSnapshotCollectionCollection",
712
+ "extendsTypeArg": "AttendancePunch",
713
+ "exportName": "AttendancePunchCollection",
714
+ "collectionExportName": "AttendancePunchCollectionCollection",
591
715
  "schema": {
592
- "tableName": "service_compensation_snapshots",
593
- "ddl": "CREATE TABLE IF NOT EXISTS \"service_compensation_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"time_entry_id\" UUID NOT NULL,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT,\n \"terms_version\" TEXT,\n \"rate_snapshot\" TEXT\n);",
716
+ "tableName": "attendance_punches",
717
+ "ddl": "CREATE TABLE IF NOT EXISTS \"attendance_punches\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"profile_id\" UUID,\n \"started_at\" TIMESTAMP,\n \"ended_at\" TIMESTAMP,\n \"duration_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"unpaid_break_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"review_required\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"recorded_offline\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"service_time_entry_id\" UUID,\n \"open_slot\" TEXT NOT NULL\n);",
594
718
  "columns": {
595
719
  "id": {
596
720
  "type": "UUID",
@@ -620,29 +744,960 @@
620
744
  "tenant_id": {
621
745
  "type": "UUID",
622
746
  "referenceKind": "tenantId",
623
- "notNull": false,
747
+ "notNull": true,
624
748
  "unique": false
625
749
  },
626
- "time_entry_id": {
750
+ "profile_id": {
627
751
  "type": "UUID",
628
- "referenceKind": "foreignKey",
629
- "notNull": true,
630
- "unique": false,
631
- "foreignKey": {
632
- "table": "service_time_entries",
633
- "column": "id",
634
- "onDelete": "CASCADE",
635
- "onUpdate": "CASCADE"
636
- }
637
- },
638
- "amount": {
639
- "type": "INTEGER",
752
+ "referenceKind": "crossPackageRef",
640
753
  "notNull": false,
641
- "unique": false,
642
- "default": 0
754
+ "unique": false
643
755
  },
644
- "currency": {
645
- "type": "TEXT",
756
+ "started_at": {
757
+ "type": "TIMESTAMP",
758
+ "notNull": false,
759
+ "unique": false
760
+ },
761
+ "ended_at": {
762
+ "type": "TIMESTAMP",
763
+ "notNull": false,
764
+ "unique": false
765
+ },
766
+ "duration_seconds": {
767
+ "type": "INTEGER",
768
+ "notNull": true,
769
+ "unique": false,
770
+ "default": 0
771
+ },
772
+ "unpaid_break_seconds": {
773
+ "type": "INTEGER",
774
+ "notNull": true,
775
+ "unique": false,
776
+ "default": 0
777
+ },
778
+ "review_required": {
779
+ "type": "BOOLEAN",
780
+ "notNull": true,
781
+ "unique": false,
782
+ "default": false
783
+ },
784
+ "recorded_offline": {
785
+ "type": "BOOLEAN",
786
+ "notNull": true,
787
+ "unique": false,
788
+ "default": false
789
+ },
790
+ "service_time_entry_id": {
791
+ "type": "UUID",
792
+ "referenceKind": "foreignKey",
793
+ "notNull": false,
794
+ "unique": false,
795
+ "foreignKey": {
796
+ "table": "service_time_entries",
797
+ "column": "id",
798
+ "onDelete": "NO ACTION",
799
+ "onUpdate": "CASCADE"
800
+ }
801
+ },
802
+ "open_slot": {
803
+ "type": "TEXT",
804
+ "notNull": true,
805
+ "unique": false
806
+ }
807
+ },
808
+ "indexes": [
809
+ {
810
+ "name": "attendance_punches_slug_context_idx",
811
+ "columns": [
812
+ "tenant_id",
813
+ "slug",
814
+ "context"
815
+ ],
816
+ "unique": true
817
+ },
818
+ {
819
+ "name": "attendance_punches_open_owner_key",
820
+ "columns": [
821
+ "tenant_id",
822
+ "profile_id",
823
+ "open_slot"
824
+ ],
825
+ "unique": true
826
+ },
827
+ {
828
+ "name": "attendance_punches_tenant_id_created_at_idx",
829
+ "columns": [
830
+ "tenant_id",
831
+ "created_at"
832
+ ]
833
+ },
834
+ {
835
+ "name": "attendance_punches_profile_id_idx",
836
+ "columns": [
837
+ "profile_id"
838
+ ]
839
+ },
840
+ {
841
+ "name": "attendance_punches_service_time_entry_id_idx",
842
+ "columns": [
843
+ "service_time_entry_id"
844
+ ]
845
+ }
846
+ ],
847
+ "version": "eeca63b1"
848
+ },
849
+ "importPath": "@happyvertical/smrt-timesheets/attendance"
850
+ },
851
+ "@happyvertical/smrt-timesheets:AttendanceBreakCollection": {
852
+ "name": "attendancebreakcollection",
853
+ "className": "AttendanceBreakCollection",
854
+ "qualifiedName": "@happyvertical/smrt-timesheets:AttendanceBreakCollection",
855
+ "collection": "attendancebreaks",
856
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/attendance/models.ts",
857
+ "packageName": "@happyvertical/smrt-timesheets",
858
+ "fields": {},
859
+ "methods": {},
860
+ "decoratorConfig": {
861
+ "tableName": "attendance_breaks"
862
+ },
863
+ "extends": "SmrtCollection",
864
+ "extendsTypeArg": "AttendanceBreak",
865
+ "exportName": "AttendanceBreakCollection",
866
+ "collectionExportName": "AttendanceBreakCollectionCollection",
867
+ "schema": {
868
+ "tableName": "attendance_breaks",
869
+ "ddl": "CREATE TABLE IF NOT EXISTS \"attendance_breaks\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"punch_id\" UUID,\n \"started_at\" TIMESTAMP,\n \"ended_at\" TIMESTAMP,\n \"paid\" BOOLEAN NOT NULL DEFAULT FALSE,\n \"open_slot\" TEXT NOT NULL\n);",
870
+ "columns": {
871
+ "id": {
872
+ "type": "UUID",
873
+ "primaryKey": true,
874
+ "referenceKind": "id",
875
+ "notNull": true
876
+ },
877
+ "slug": {
878
+ "type": "TEXT",
879
+ "notNull": true
880
+ },
881
+ "context": {
882
+ "type": "TEXT",
883
+ "notNull": true,
884
+ "default": ""
885
+ },
886
+ "created_at": {
887
+ "type": "TIMESTAMP",
888
+ "notNull": true,
889
+ "default": "current_timestamp"
890
+ },
891
+ "updated_at": {
892
+ "type": "TIMESTAMP",
893
+ "notNull": true,
894
+ "default": "current_timestamp"
895
+ },
896
+ "tenant_id": {
897
+ "type": "UUID",
898
+ "referenceKind": "tenantId",
899
+ "notNull": true,
900
+ "unique": false
901
+ },
902
+ "punch_id": {
903
+ "type": "UUID",
904
+ "referenceKind": "foreignKey",
905
+ "notNull": false,
906
+ "unique": false,
907
+ "foreignKey": {
908
+ "table": "attendance_punches",
909
+ "column": "id",
910
+ "onDelete": "NO ACTION",
911
+ "onUpdate": "CASCADE"
912
+ }
913
+ },
914
+ "started_at": {
915
+ "type": "TIMESTAMP",
916
+ "notNull": false,
917
+ "unique": false
918
+ },
919
+ "ended_at": {
920
+ "type": "TIMESTAMP",
921
+ "notNull": false,
922
+ "unique": false
923
+ },
924
+ "paid": {
925
+ "type": "BOOLEAN",
926
+ "notNull": true,
927
+ "unique": false,
928
+ "default": false
929
+ },
930
+ "open_slot": {
931
+ "type": "TEXT",
932
+ "notNull": true,
933
+ "unique": false
934
+ }
935
+ },
936
+ "indexes": [
937
+ {
938
+ "name": "attendance_breaks_slug_context_idx",
939
+ "columns": [
940
+ "tenant_id",
941
+ "slug",
942
+ "context"
943
+ ],
944
+ "unique": true
945
+ },
946
+ {
947
+ "name": "attendance_breaks_open_punch_key",
948
+ "columns": [
949
+ "tenant_id",
950
+ "punch_id",
951
+ "open_slot"
952
+ ],
953
+ "unique": true
954
+ },
955
+ {
956
+ "name": "attendance_breaks_tenant_id_created_at_idx",
957
+ "columns": [
958
+ "tenant_id",
959
+ "created_at"
960
+ ]
961
+ },
962
+ {
963
+ "name": "attendance_breaks_punch_id_idx",
964
+ "columns": [
965
+ "punch_id"
966
+ ]
967
+ }
968
+ ],
969
+ "version": "00cb739e"
970
+ },
971
+ "importPath": "@happyvertical/smrt-timesheets/attendance"
972
+ },
973
+ "@happyvertical/smrt-timesheets:AttendanceReplayCollection": {
974
+ "name": "attendancereplaycollection",
975
+ "className": "AttendanceReplayCollection",
976
+ "qualifiedName": "@happyvertical/smrt-timesheets:AttendanceReplayCollection",
977
+ "collection": "attendancereplays",
978
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/attendance/models.ts",
979
+ "packageName": "@happyvertical/smrt-timesheets",
980
+ "fields": {},
981
+ "methods": {},
982
+ "decoratorConfig": {
983
+ "tableName": "attendance_replays"
984
+ },
985
+ "extends": "SmrtCollection",
986
+ "extendsTypeArg": "AttendanceReplay",
987
+ "exportName": "AttendanceReplayCollection",
988
+ "collectionExportName": "AttendanceReplayCollectionCollection",
989
+ "schema": {
990
+ "tableName": "attendance_replays",
991
+ "ddl": "CREATE TABLE IF NOT EXISTS \"attendance_replays\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"replay_key\" TEXT NOT NULL UNIQUE,\n \"content\" TEXT,\n \"outcome\" TEXT\n);",
992
+ "columns": {
993
+ "id": {
994
+ "type": "UUID",
995
+ "primaryKey": true,
996
+ "referenceKind": "id",
997
+ "notNull": true
998
+ },
999
+ "slug": {
1000
+ "type": "TEXT",
1001
+ "notNull": true
1002
+ },
1003
+ "context": {
1004
+ "type": "TEXT",
1005
+ "notNull": true,
1006
+ "default": ""
1007
+ },
1008
+ "created_at": {
1009
+ "type": "TIMESTAMP",
1010
+ "notNull": true,
1011
+ "default": "current_timestamp"
1012
+ },
1013
+ "updated_at": {
1014
+ "type": "TIMESTAMP",
1015
+ "notNull": true,
1016
+ "default": "current_timestamp"
1017
+ },
1018
+ "tenant_id": {
1019
+ "type": "UUID",
1020
+ "referenceKind": "tenantId",
1021
+ "notNull": true,
1022
+ "unique": false
1023
+ },
1024
+ "replay_key": {
1025
+ "type": "TEXT",
1026
+ "notNull": true,
1027
+ "unique": true
1028
+ },
1029
+ "content": {
1030
+ "type": "TEXT",
1031
+ "notNull": false,
1032
+ "unique": false
1033
+ },
1034
+ "outcome": {
1035
+ "type": "TEXT",
1036
+ "notNull": false,
1037
+ "unique": false
1038
+ }
1039
+ },
1040
+ "indexes": [
1041
+ {
1042
+ "name": "attendance_replays_slug_context_idx",
1043
+ "columns": [
1044
+ "tenant_id",
1045
+ "slug",
1046
+ "context"
1047
+ ],
1048
+ "unique": true
1049
+ },
1050
+ {
1051
+ "name": "attendance_replays_tenant_id_created_at_idx",
1052
+ "columns": [
1053
+ "tenant_id",
1054
+ "created_at"
1055
+ ]
1056
+ }
1057
+ ],
1058
+ "version": "f051b7b6"
1059
+ },
1060
+ "importPath": "@happyvertical/smrt-timesheets/attendance"
1061
+ },
1062
+ "@happyvertical/smrt-timesheets:ServiceChargeSnapshot": {
1063
+ "name": "servicechargesnapshot",
1064
+ "className": "ServiceChargeSnapshot",
1065
+ "qualifiedName": "@happyvertical/smrt-timesheets:ServiceChargeSnapshot",
1066
+ "collection": "servicechargesnapshots",
1067
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-snapshots.ts",
1068
+ "packageName": "@happyvertical/smrt-timesheets",
1069
+ "fields": {
1070
+ "tenantId": {
1071
+ "type": "text",
1072
+ "required": false,
1073
+ "_meta": {
1074
+ "sqlType": "UUID",
1075
+ "nullable": true,
1076
+ "__tenancy": {
1077
+ "isTenantIdField": true,
1078
+ "autoFilter": true,
1079
+ "required": false,
1080
+ "autoPopulate": true,
1081
+ "nullable": true,
1082
+ "mode": "optional",
1083
+ "field": "tenantId",
1084
+ "allowSuperAdminBypass": false
1085
+ }
1086
+ }
1087
+ },
1088
+ "timeEntryId": {
1089
+ "type": "foreignKey",
1090
+ "required": true,
1091
+ "related": "ServiceTimeEntry",
1092
+ "_meta": {
1093
+ "required": true
1094
+ }
1095
+ },
1096
+ "amount": {
1097
+ "type": "integer",
1098
+ "required": false,
1099
+ "default": 0
1100
+ },
1101
+ "currency": {
1102
+ "type": "text",
1103
+ "required": false,
1104
+ "_meta": {}
1105
+ },
1106
+ "pricingVersion": {
1107
+ "type": "text",
1108
+ "required": false,
1109
+ "_meta": {}
1110
+ },
1111
+ "strategy": {
1112
+ "type": "text",
1113
+ "required": false,
1114
+ "_meta": {}
1115
+ },
1116
+ "rateSnapshot": {
1117
+ "type": "text",
1118
+ "required": false,
1119
+ "_meta": {}
1120
+ },
1121
+ "sourceChargeRef": {
1122
+ "type": "text",
1123
+ "required": false,
1124
+ "_meta": {}
1125
+ },
1126
+ "createdAt": {
1127
+ "type": "datetime",
1128
+ "required": false
1129
+ }
1130
+ },
1131
+ "methods": {
1132
+ "initialize": {
1133
+ "name": "initialize",
1134
+ "async": true,
1135
+ "parameters": [],
1136
+ "returnType": "Promise<this>",
1137
+ "isStatic": false,
1138
+ "isPublic": true
1139
+ },
1140
+ "save": {
1141
+ "name": "save",
1142
+ "async": true,
1143
+ "parameters": [],
1144
+ "returnType": "Promise<this>",
1145
+ "isStatic": false,
1146
+ "isPublic": true
1147
+ }
1148
+ },
1149
+ "decoratorConfig": {
1150
+ "tableName": "service_charge_snapshots",
1151
+ "previousQualifiedNames": [
1152
+ "@happyvertical/smrt-projects:ServiceChargeSnapshot"
1153
+ ],
1154
+ "conflictColumns": [
1155
+ "time_entry_id"
1156
+ ],
1157
+ "api": {
1158
+ "include": [
1159
+ "list",
1160
+ "get"
1161
+ ]
1162
+ },
1163
+ "cli": {
1164
+ "include": [
1165
+ "list",
1166
+ "get"
1167
+ ]
1168
+ },
1169
+ "mcp": {
1170
+ "include": [
1171
+ "list",
1172
+ "get"
1173
+ ]
1174
+ },
1175
+ "tenantScoped": {
1176
+ "mode": "optional"
1177
+ }
1178
+ },
1179
+ "extends": "SmrtObject",
1180
+ "exportName": "ServiceChargeSnapshot",
1181
+ "collectionExportName": "ServiceChargeSnapshotCollection",
1182
+ "validationRules": [
1183
+ {
1184
+ "field": "timeEntryId",
1185
+ "rule": "required",
1186
+ "fieldType": "foreignKey"
1187
+ }
1188
+ ],
1189
+ "schema": {
1190
+ "tableName": "service_charge_snapshots",
1191
+ "ddl": "CREATE TABLE IF NOT EXISTS \"service_charge_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"time_entry_id\" UUID NOT NULL,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT,\n \"pricing_version\" TEXT,\n \"strategy\" TEXT,\n \"rate_snapshot\" TEXT,\n \"source_charge_ref\" TEXT\n);",
1192
+ "columns": {
1193
+ "id": {
1194
+ "type": "UUID",
1195
+ "primaryKey": true,
1196
+ "referenceKind": "id",
1197
+ "notNull": true
1198
+ },
1199
+ "slug": {
1200
+ "type": "TEXT",
1201
+ "notNull": true
1202
+ },
1203
+ "context": {
1204
+ "type": "TEXT",
1205
+ "notNull": true,
1206
+ "default": ""
1207
+ },
1208
+ "created_at": {
1209
+ "type": "TIMESTAMP",
1210
+ "notNull": true,
1211
+ "default": "current_timestamp"
1212
+ },
1213
+ "updated_at": {
1214
+ "type": "TIMESTAMP",
1215
+ "notNull": true,
1216
+ "default": "current_timestamp"
1217
+ },
1218
+ "tenant_id": {
1219
+ "type": "UUID",
1220
+ "referenceKind": "tenantId",
1221
+ "notNull": false,
1222
+ "unique": false
1223
+ },
1224
+ "time_entry_id": {
1225
+ "type": "UUID",
1226
+ "referenceKind": "foreignKey",
1227
+ "notNull": true,
1228
+ "unique": false,
1229
+ "foreignKey": {
1230
+ "table": "service_time_entries",
1231
+ "column": "id",
1232
+ "onDelete": "CASCADE",
1233
+ "onUpdate": "CASCADE"
1234
+ }
1235
+ },
1236
+ "amount": {
1237
+ "type": "INTEGER",
1238
+ "notNull": false,
1239
+ "unique": false,
1240
+ "default": 0
1241
+ },
1242
+ "currency": {
1243
+ "type": "TEXT",
1244
+ "notNull": false,
1245
+ "unique": false
1246
+ },
1247
+ "pricing_version": {
1248
+ "type": "TEXT",
1249
+ "notNull": false,
1250
+ "unique": false
1251
+ },
1252
+ "strategy": {
1253
+ "type": "TEXT",
1254
+ "notNull": false,
1255
+ "unique": false
1256
+ },
1257
+ "rate_snapshot": {
1258
+ "type": "TEXT",
1259
+ "notNull": false,
1260
+ "unique": false
1261
+ },
1262
+ "source_charge_ref": {
1263
+ "type": "TEXT",
1264
+ "notNull": false,
1265
+ "unique": false
1266
+ }
1267
+ },
1268
+ "indexes": [
1269
+ {
1270
+ "name": "service_charge_snapshots_time_entry_id_idx",
1271
+ "columns": [
1272
+ "time_entry_id"
1273
+ ],
1274
+ "unique": true
1275
+ },
1276
+ {
1277
+ "name": "service_charge_snapshots_slug_context_idx",
1278
+ "columns": [
1279
+ "slug",
1280
+ "context"
1281
+ ]
1282
+ },
1283
+ {
1284
+ "name": "service_charge_snapshots_tenant_id_created_at_idx",
1285
+ "columns": [
1286
+ "tenant_id",
1287
+ "created_at"
1288
+ ]
1289
+ }
1290
+ ],
1291
+ "version": "1393a1e2"
1292
+ },
1293
+ "importPath": "@happyvertical/smrt-timesheets"
1294
+ },
1295
+ "@happyvertical/smrt-timesheets:ServiceCompensationSnapshot": {
1296
+ "name": "servicecompensationsnapshot",
1297
+ "className": "ServiceCompensationSnapshot",
1298
+ "qualifiedName": "@happyvertical/smrt-timesheets:ServiceCompensationSnapshot",
1299
+ "collection": "servicecompensationsnapshots",
1300
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-snapshots.ts",
1301
+ "packageName": "@happyvertical/smrt-timesheets",
1302
+ "fields": {
1303
+ "tenantId": {
1304
+ "type": "text",
1305
+ "required": false,
1306
+ "_meta": {
1307
+ "sqlType": "UUID",
1308
+ "nullable": true,
1309
+ "__tenancy": {
1310
+ "isTenantIdField": true,
1311
+ "autoFilter": true,
1312
+ "required": false,
1313
+ "autoPopulate": true,
1314
+ "nullable": true,
1315
+ "mode": "optional",
1316
+ "field": "tenantId",
1317
+ "allowSuperAdminBypass": false
1318
+ }
1319
+ }
1320
+ },
1321
+ "timeEntryId": {
1322
+ "type": "foreignKey",
1323
+ "required": true,
1324
+ "related": "ServiceTimeEntry",
1325
+ "_meta": {
1326
+ "required": true
1327
+ }
1328
+ },
1329
+ "amount": {
1330
+ "type": "integer",
1331
+ "required": false,
1332
+ "default": 0
1333
+ },
1334
+ "currency": {
1335
+ "type": "text",
1336
+ "required": false,
1337
+ "_meta": {}
1338
+ },
1339
+ "termsVersion": {
1340
+ "type": "text",
1341
+ "required": false,
1342
+ "_meta": {}
1343
+ },
1344
+ "rateSnapshot": {
1345
+ "type": "text",
1346
+ "required": false,
1347
+ "_meta": {}
1348
+ },
1349
+ "createdAt": {
1350
+ "type": "datetime",
1351
+ "required": false
1352
+ }
1353
+ },
1354
+ "methods": {
1355
+ "initialize": {
1356
+ "name": "initialize",
1357
+ "async": true,
1358
+ "parameters": [],
1359
+ "returnType": "Promise<this>",
1360
+ "isStatic": false,
1361
+ "isPublic": true
1362
+ },
1363
+ "save": {
1364
+ "name": "save",
1365
+ "async": true,
1366
+ "parameters": [],
1367
+ "returnType": "Promise<this>",
1368
+ "isStatic": false,
1369
+ "isPublic": true
1370
+ }
1371
+ },
1372
+ "decoratorConfig": {
1373
+ "tableName": "service_compensation_snapshots",
1374
+ "previousQualifiedNames": [
1375
+ "@happyvertical/smrt-projects:ServiceCompensationSnapshot"
1376
+ ],
1377
+ "conflictColumns": [
1378
+ "time_entry_id"
1379
+ ],
1380
+ "api": {
1381
+ "include": [
1382
+ "list",
1383
+ "get"
1384
+ ]
1385
+ },
1386
+ "cli": {
1387
+ "include": [
1388
+ "list",
1389
+ "get"
1390
+ ]
1391
+ },
1392
+ "mcp": {
1393
+ "include": [
1394
+ "list",
1395
+ "get"
1396
+ ]
1397
+ },
1398
+ "tenantScoped": {
1399
+ "mode": "optional"
1400
+ }
1401
+ },
1402
+ "extends": "SmrtObject",
1403
+ "exportName": "ServiceCompensationSnapshot",
1404
+ "collectionExportName": "ServiceCompensationSnapshotCollection",
1405
+ "validationRules": [
1406
+ {
1407
+ "field": "timeEntryId",
1408
+ "rule": "required",
1409
+ "fieldType": "foreignKey"
1410
+ }
1411
+ ],
1412
+ "schema": {
1413
+ "tableName": "service_compensation_snapshots",
1414
+ "ddl": "CREATE TABLE IF NOT EXISTS \"service_compensation_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"time_entry_id\" UUID NOT NULL,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT,\n \"terms_version\" TEXT,\n \"rate_snapshot\" TEXT\n);",
1415
+ "columns": {
1416
+ "id": {
1417
+ "type": "UUID",
1418
+ "primaryKey": true,
1419
+ "referenceKind": "id",
1420
+ "notNull": true
1421
+ },
1422
+ "slug": {
1423
+ "type": "TEXT",
1424
+ "notNull": true
1425
+ },
1426
+ "context": {
1427
+ "type": "TEXT",
1428
+ "notNull": true,
1429
+ "default": ""
1430
+ },
1431
+ "created_at": {
1432
+ "type": "TIMESTAMP",
1433
+ "notNull": true,
1434
+ "default": "current_timestamp"
1435
+ },
1436
+ "updated_at": {
1437
+ "type": "TIMESTAMP",
1438
+ "notNull": true,
1439
+ "default": "current_timestamp"
1440
+ },
1441
+ "tenant_id": {
1442
+ "type": "UUID",
1443
+ "referenceKind": "tenantId",
1444
+ "notNull": false,
1445
+ "unique": false
1446
+ },
1447
+ "time_entry_id": {
1448
+ "type": "UUID",
1449
+ "referenceKind": "foreignKey",
1450
+ "notNull": true,
1451
+ "unique": false,
1452
+ "foreignKey": {
1453
+ "table": "service_time_entries",
1454
+ "column": "id",
1455
+ "onDelete": "CASCADE",
1456
+ "onUpdate": "CASCADE"
1457
+ }
1458
+ },
1459
+ "amount": {
1460
+ "type": "INTEGER",
1461
+ "notNull": false,
1462
+ "unique": false,
1463
+ "default": 0
1464
+ },
1465
+ "currency": {
1466
+ "type": "TEXT",
1467
+ "notNull": false,
1468
+ "unique": false
1469
+ },
1470
+ "terms_version": {
1471
+ "type": "TEXT",
1472
+ "notNull": false,
1473
+ "unique": false
1474
+ },
1475
+ "rate_snapshot": {
1476
+ "type": "TEXT",
1477
+ "notNull": false,
1478
+ "unique": false
1479
+ }
1480
+ },
1481
+ "indexes": [
1482
+ {
1483
+ "name": "service_compensation_snapshots_time_entry_id_idx",
1484
+ "columns": [
1485
+ "time_entry_id"
1486
+ ],
1487
+ "unique": true
1488
+ },
1489
+ {
1490
+ "name": "service_compensation_snapshots_slug_context_idx",
1491
+ "columns": [
1492
+ "slug",
1493
+ "context"
1494
+ ]
1495
+ },
1496
+ {
1497
+ "name": "service_compensation_snapshots_tenant_id_created_at_idx",
1498
+ "columns": [
1499
+ "tenant_id",
1500
+ "created_at"
1501
+ ]
1502
+ }
1503
+ ],
1504
+ "version": "cd8670e5"
1505
+ },
1506
+ "importPath": "@happyvertical/smrt-timesheets"
1507
+ },
1508
+ "@happyvertical/smrt-timesheets:ServiceChargeSnapshotCollection": {
1509
+ "name": "servicechargesnapshotcollection",
1510
+ "className": "ServiceChargeSnapshotCollection",
1511
+ "qualifiedName": "@happyvertical/smrt-timesheets:ServiceChargeSnapshotCollection",
1512
+ "collection": "servicechargesnapshots",
1513
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-snapshots.ts",
1514
+ "packageName": "@happyvertical/smrt-timesheets",
1515
+ "fields": {},
1516
+ "methods": {},
1517
+ "decoratorConfig": {
1518
+ "tableName": "service_charge_snapshots"
1519
+ },
1520
+ "extends": "SmrtCollection",
1521
+ "extendsTypeArg": "ServiceChargeSnapshot",
1522
+ "exportName": "ServiceChargeSnapshotCollection",
1523
+ "collectionExportName": "ServiceChargeSnapshotCollectionCollection",
1524
+ "schema": {
1525
+ "tableName": "service_charge_snapshots",
1526
+ "ddl": "CREATE TABLE IF NOT EXISTS \"service_charge_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"time_entry_id\" UUID NOT NULL,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT,\n \"pricing_version\" TEXT,\n \"strategy\" TEXT,\n \"rate_snapshot\" TEXT,\n \"source_charge_ref\" TEXT\n);",
1527
+ "columns": {
1528
+ "id": {
1529
+ "type": "UUID",
1530
+ "primaryKey": true,
1531
+ "referenceKind": "id",
1532
+ "notNull": true
1533
+ },
1534
+ "slug": {
1535
+ "type": "TEXT",
1536
+ "notNull": true
1537
+ },
1538
+ "context": {
1539
+ "type": "TEXT",
1540
+ "notNull": true,
1541
+ "default": ""
1542
+ },
1543
+ "created_at": {
1544
+ "type": "TIMESTAMP",
1545
+ "notNull": true,
1546
+ "default": "current_timestamp"
1547
+ },
1548
+ "updated_at": {
1549
+ "type": "TIMESTAMP",
1550
+ "notNull": true,
1551
+ "default": "current_timestamp"
1552
+ },
1553
+ "tenant_id": {
1554
+ "type": "UUID",
1555
+ "referenceKind": "tenantId",
1556
+ "notNull": false,
1557
+ "unique": false
1558
+ },
1559
+ "time_entry_id": {
1560
+ "type": "UUID",
1561
+ "referenceKind": "foreignKey",
1562
+ "notNull": true,
1563
+ "unique": false,
1564
+ "foreignKey": {
1565
+ "table": "service_time_entries",
1566
+ "column": "id",
1567
+ "onDelete": "CASCADE",
1568
+ "onUpdate": "CASCADE"
1569
+ }
1570
+ },
1571
+ "amount": {
1572
+ "type": "INTEGER",
1573
+ "notNull": false,
1574
+ "unique": false,
1575
+ "default": 0
1576
+ },
1577
+ "currency": {
1578
+ "type": "TEXT",
1579
+ "notNull": false,
1580
+ "unique": false
1581
+ },
1582
+ "pricing_version": {
1583
+ "type": "TEXT",
1584
+ "notNull": false,
1585
+ "unique": false
1586
+ },
1587
+ "strategy": {
1588
+ "type": "TEXT",
1589
+ "notNull": false,
1590
+ "unique": false
1591
+ },
1592
+ "rate_snapshot": {
1593
+ "type": "TEXT",
1594
+ "notNull": false,
1595
+ "unique": false
1596
+ },
1597
+ "source_charge_ref": {
1598
+ "type": "TEXT",
1599
+ "notNull": false,
1600
+ "unique": false
1601
+ }
1602
+ },
1603
+ "indexes": [
1604
+ {
1605
+ "name": "service_charge_snapshots_time_entry_id_idx",
1606
+ "columns": [
1607
+ "time_entry_id"
1608
+ ],
1609
+ "unique": true
1610
+ },
1611
+ {
1612
+ "name": "service_charge_snapshots_slug_context_idx",
1613
+ "columns": [
1614
+ "slug",
1615
+ "context"
1616
+ ]
1617
+ },
1618
+ {
1619
+ "name": "service_charge_snapshots_tenant_id_created_at_idx",
1620
+ "columns": [
1621
+ "tenant_id",
1622
+ "created_at"
1623
+ ]
1624
+ }
1625
+ ],
1626
+ "version": "1393a1e2"
1627
+ },
1628
+ "importPath": "@happyvertical/smrt-timesheets"
1629
+ },
1630
+ "@happyvertical/smrt-timesheets:ServiceCompensationSnapshotCollection": {
1631
+ "name": "servicecompensationsnapshotcollection",
1632
+ "className": "ServiceCompensationSnapshotCollection",
1633
+ "qualifiedName": "@happyvertical/smrt-timesheets:ServiceCompensationSnapshotCollection",
1634
+ "collection": "servicecompensationsnapshots",
1635
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-snapshots.ts",
1636
+ "packageName": "@happyvertical/smrt-timesheets",
1637
+ "fields": {},
1638
+ "methods": {},
1639
+ "decoratorConfig": {
1640
+ "tableName": "service_compensation_snapshots"
1641
+ },
1642
+ "extends": "SmrtCollection",
1643
+ "extendsTypeArg": "ServiceCompensationSnapshot",
1644
+ "exportName": "ServiceCompensationSnapshotCollection",
1645
+ "collectionExportName": "ServiceCompensationSnapshotCollectionCollection",
1646
+ "schema": {
1647
+ "tableName": "service_compensation_snapshots",
1648
+ "ddl": "CREATE TABLE IF NOT EXISTS \"service_compensation_snapshots\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"time_entry_id\" UUID NOT NULL,\n \"amount\" INTEGER DEFAULT 0,\n \"currency\" TEXT,\n \"terms_version\" TEXT,\n \"rate_snapshot\" TEXT\n);",
1649
+ "columns": {
1650
+ "id": {
1651
+ "type": "UUID",
1652
+ "primaryKey": true,
1653
+ "referenceKind": "id",
1654
+ "notNull": true
1655
+ },
1656
+ "slug": {
1657
+ "type": "TEXT",
1658
+ "notNull": true
1659
+ },
1660
+ "context": {
1661
+ "type": "TEXT",
1662
+ "notNull": true,
1663
+ "default": ""
1664
+ },
1665
+ "created_at": {
1666
+ "type": "TIMESTAMP",
1667
+ "notNull": true,
1668
+ "default": "current_timestamp"
1669
+ },
1670
+ "updated_at": {
1671
+ "type": "TIMESTAMP",
1672
+ "notNull": true,
1673
+ "default": "current_timestamp"
1674
+ },
1675
+ "tenant_id": {
1676
+ "type": "UUID",
1677
+ "referenceKind": "tenantId",
1678
+ "notNull": false,
1679
+ "unique": false
1680
+ },
1681
+ "time_entry_id": {
1682
+ "type": "UUID",
1683
+ "referenceKind": "foreignKey",
1684
+ "notNull": true,
1685
+ "unique": false,
1686
+ "foreignKey": {
1687
+ "table": "service_time_entries",
1688
+ "column": "id",
1689
+ "onDelete": "CASCADE",
1690
+ "onUpdate": "CASCADE"
1691
+ }
1692
+ },
1693
+ "amount": {
1694
+ "type": "INTEGER",
1695
+ "notNull": false,
1696
+ "unique": false,
1697
+ "default": 0
1698
+ },
1699
+ "currency": {
1700
+ "type": "TEXT",
646
1701
  "notNull": false,
647
1702
  "unique": false
648
1703
  },
@@ -651,7 +1706,700 @@
651
1706
  "notNull": false,
652
1707
  "unique": false
653
1708
  },
654
- "rate_snapshot": {
1709
+ "rate_snapshot": {
1710
+ "type": "TEXT",
1711
+ "notNull": false,
1712
+ "unique": false
1713
+ }
1714
+ },
1715
+ "indexes": [
1716
+ {
1717
+ "name": "service_compensation_snapshots_time_entry_id_idx",
1718
+ "columns": [
1719
+ "time_entry_id"
1720
+ ],
1721
+ "unique": true
1722
+ },
1723
+ {
1724
+ "name": "service_compensation_snapshots_slug_context_idx",
1725
+ "columns": [
1726
+ "slug",
1727
+ "context"
1728
+ ]
1729
+ },
1730
+ {
1731
+ "name": "service_compensation_snapshots_tenant_id_created_at_idx",
1732
+ "columns": [
1733
+ "tenant_id",
1734
+ "created_at"
1735
+ ]
1736
+ }
1737
+ ],
1738
+ "version": "cd8670e5"
1739
+ },
1740
+ "importPath": "@happyvertical/smrt-timesheets"
1741
+ },
1742
+ "@happyvertical/smrt-timesheets:ServiceTimeEntry": {
1743
+ "name": "servicetimeentry",
1744
+ "className": "ServiceTimeEntry",
1745
+ "qualifiedName": "@happyvertical/smrt-timesheets:ServiceTimeEntry",
1746
+ "collection": "servicetimeentries",
1747
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-time-entry.ts",
1748
+ "packageName": "@happyvertical/smrt-timesheets",
1749
+ "fields": {
1750
+ "tenantId": {
1751
+ "type": "text",
1752
+ "required": false,
1753
+ "_meta": {
1754
+ "sqlType": "UUID",
1755
+ "nullable": true,
1756
+ "__tenancy": {
1757
+ "isTenantIdField": true,
1758
+ "autoFilter": true,
1759
+ "required": false,
1760
+ "autoPopulate": true,
1761
+ "nullable": true,
1762
+ "mode": "optional",
1763
+ "field": "tenantId",
1764
+ "allowSuperAdminBypass": false
1765
+ }
1766
+ }
1767
+ },
1768
+ "workRefType": {
1769
+ "type": "text",
1770
+ "required": false,
1771
+ "_meta": {
1772
+ "nullable": true
1773
+ }
1774
+ },
1775
+ "workRefId": {
1776
+ "type": "text",
1777
+ "required": false,
1778
+ "_meta": {
1779
+ "nullable": true
1780
+ }
1781
+ },
1782
+ "participantKind": {
1783
+ "type": "text",
1784
+ "required": false,
1785
+ "_meta": {}
1786
+ },
1787
+ "participantProfileId": {
1788
+ "type": "crossPackageRef",
1789
+ "required": false,
1790
+ "related": "@happyvertical/smrt-profiles:Profile",
1791
+ "_meta": {
1792
+ "nullable": true
1793
+ }
1794
+ },
1795
+ "agentRef": {
1796
+ "type": "text",
1797
+ "required": false,
1798
+ "_meta": {}
1799
+ },
1800
+ "source": {
1801
+ "type": "text",
1802
+ "required": false,
1803
+ "_meta": {}
1804
+ },
1805
+ "description": {
1806
+ "type": "text",
1807
+ "required": false,
1808
+ "_meta": {}
1809
+ },
1810
+ "startedAt": {
1811
+ "type": "datetime",
1812
+ "required": false
1813
+ },
1814
+ "endedAt": {
1815
+ "type": "datetime",
1816
+ "required": false
1817
+ },
1818
+ "durationSeconds": {
1819
+ "type": "integer",
1820
+ "required": false,
1821
+ "default": 0
1822
+ },
1823
+ "evidence": {
1824
+ "type": "text",
1825
+ "required": false,
1826
+ "_meta": {}
1827
+ },
1828
+ "status": {
1829
+ "type": "text",
1830
+ "required": false,
1831
+ "_meta": {}
1832
+ },
1833
+ "submittedAt": {
1834
+ "type": "datetime",
1835
+ "required": false
1836
+ },
1837
+ "submittedByProfileId": {
1838
+ "type": "crossPackageRef",
1839
+ "required": false,
1840
+ "related": "@happyvertical/smrt-profiles:Profile",
1841
+ "_meta": {
1842
+ "nullable": true
1843
+ }
1844
+ },
1845
+ "approvedAt": {
1846
+ "type": "datetime",
1847
+ "required": false
1848
+ },
1849
+ "approvedByProfileId": {
1850
+ "type": "crossPackageRef",
1851
+ "required": false,
1852
+ "related": "@happyvertical/smrt-profiles:Profile",
1853
+ "_meta": {
1854
+ "nullable": true
1855
+ }
1856
+ },
1857
+ "approvalPath": {
1858
+ "type": "text",
1859
+ "required": false,
1860
+ "_meta": {}
1861
+ },
1862
+ "rejectedAt": {
1863
+ "type": "datetime",
1864
+ "required": false
1865
+ },
1866
+ "rejectedByProfileId": {
1867
+ "type": "crossPackageRef",
1868
+ "required": false,
1869
+ "related": "@happyvertical/smrt-profiles:Profile",
1870
+ "_meta": {
1871
+ "nullable": true
1872
+ }
1873
+ },
1874
+ "rejectionReason": {
1875
+ "type": "text",
1876
+ "required": false,
1877
+ "_meta": {}
1878
+ },
1879
+ "correctionOfId": {
1880
+ "type": "foreignKey",
1881
+ "required": false,
1882
+ "related": "ServiceTimeEntry"
1883
+ },
1884
+ "metadata": {
1885
+ "type": "text",
1886
+ "required": false,
1887
+ "_meta": {}
1888
+ }
1889
+ },
1890
+ "methods": {
1891
+ "getEvidence": {
1892
+ "name": "getEvidence",
1893
+ "async": false,
1894
+ "parameters": [],
1895
+ "returnType": "ServiceEvidence[]",
1896
+ "isStatic": false,
1897
+ "isPublic": true
1898
+ },
1899
+ "setEvidence": {
1900
+ "name": "setEvidence",
1901
+ "async": false,
1902
+ "parameters": [
1903
+ {
1904
+ "name": "value",
1905
+ "type": "ServiceEvidence[]",
1906
+ "optional": false
1907
+ }
1908
+ ],
1909
+ "returnType": "void",
1910
+ "isStatic": false,
1911
+ "isPublic": true
1912
+ },
1913
+ "getMetadata": {
1914
+ "name": "getMetadata",
1915
+ "async": false,
1916
+ "parameters": [],
1917
+ "returnType": "Record<string, unknown>",
1918
+ "isStatic": false,
1919
+ "isPublic": true
1920
+ },
1921
+ "setMetadata": {
1922
+ "name": "setMetadata",
1923
+ "async": false,
1924
+ "parameters": [
1925
+ {
1926
+ "name": "value",
1927
+ "type": "Record<string, unknown>",
1928
+ "optional": false
1929
+ }
1930
+ ],
1931
+ "returnType": "void",
1932
+ "isStatic": false,
1933
+ "isPublic": true
1934
+ },
1935
+ "durationHours": {
1936
+ "name": "durationHours",
1937
+ "async": false,
1938
+ "parameters": [],
1939
+ "returnType": "number",
1940
+ "isStatic": false,
1941
+ "isPublic": true
1942
+ },
1943
+ "initialize": {
1944
+ "name": "initialize",
1945
+ "async": true,
1946
+ "parameters": [],
1947
+ "returnType": "Promise<this>",
1948
+ "isStatic": false,
1949
+ "isPublic": true
1950
+ },
1951
+ "save": {
1952
+ "name": "save",
1953
+ "async": true,
1954
+ "parameters": [],
1955
+ "returnType": "Promise<this>",
1956
+ "isStatic": false,
1957
+ "isPublic": true
1958
+ }
1959
+ },
1960
+ "decoratorConfig": {
1961
+ "tableName": "service_time_entries",
1962
+ "previousQualifiedNames": [
1963
+ "@happyvertical/smrt-projects:ServiceTimeEntry"
1964
+ ],
1965
+ "api": {
1966
+ "include": [
1967
+ "list",
1968
+ "get"
1969
+ ]
1970
+ },
1971
+ "cli": {
1972
+ "include": [
1973
+ "list",
1974
+ "get"
1975
+ ]
1976
+ },
1977
+ "mcp": {
1978
+ "include": [
1979
+ "list",
1980
+ "get"
1981
+ ]
1982
+ },
1983
+ "tenantScoped": {
1984
+ "mode": "optional"
1985
+ },
1986
+ "conflictColumns": [
1987
+ "tenant_id",
1988
+ "slug",
1989
+ "context"
1990
+ ]
1991
+ },
1992
+ "extends": "SmrtObject",
1993
+ "exportName": "ServiceTimeEntry",
1994
+ "collectionExportName": "ServiceTimeEntryCollection",
1995
+ "schema": {
1996
+ "tableName": "service_time_entries",
1997
+ "ddl": "CREATE TABLE IF NOT EXISTS \"service_time_entries\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"work_ref_type\" TEXT,\n \"work_ref_id\" TEXT,\n \"participant_kind\" TEXT,\n \"participant_profile_id\" UUID,\n \"agent_ref\" TEXT,\n \"source\" TEXT,\n \"description\" TEXT,\n \"started_at\" TIMESTAMP,\n \"ended_at\" TIMESTAMP,\n \"duration_seconds\" INTEGER DEFAULT 0,\n \"evidence\" TEXT,\n \"status\" TEXT,\n \"submitted_at\" TIMESTAMP,\n \"submitted_by_profile_id\" UUID,\n \"approved_at\" TIMESTAMP,\n \"approved_by_profile_id\" UUID,\n \"approval_path\" TEXT,\n \"rejected_at\" TIMESTAMP,\n \"rejected_by_profile_id\" UUID,\n \"rejection_reason\" TEXT,\n \"correction_of_id\" UUID,\n \"metadata\" TEXT\n);",
1998
+ "columns": {
1999
+ "id": {
2000
+ "type": "UUID",
2001
+ "primaryKey": true,
2002
+ "referenceKind": "id",
2003
+ "notNull": true
2004
+ },
2005
+ "slug": {
2006
+ "type": "TEXT",
2007
+ "notNull": true
2008
+ },
2009
+ "context": {
2010
+ "type": "TEXT",
2011
+ "notNull": true,
2012
+ "default": ""
2013
+ },
2014
+ "created_at": {
2015
+ "type": "TIMESTAMP",
2016
+ "notNull": true,
2017
+ "default": "current_timestamp"
2018
+ },
2019
+ "updated_at": {
2020
+ "type": "TIMESTAMP",
2021
+ "notNull": true,
2022
+ "default": "current_timestamp"
2023
+ },
2024
+ "tenant_id": {
2025
+ "type": "UUID",
2026
+ "referenceKind": "tenantId",
2027
+ "notNull": false,
2028
+ "unique": false
2029
+ },
2030
+ "work_ref_type": {
2031
+ "type": "TEXT",
2032
+ "notNull": false,
2033
+ "unique": false
2034
+ },
2035
+ "work_ref_id": {
2036
+ "type": "TEXT",
2037
+ "notNull": false,
2038
+ "unique": false
2039
+ },
2040
+ "participant_kind": {
2041
+ "type": "TEXT",
2042
+ "notNull": false,
2043
+ "unique": false
2044
+ },
2045
+ "participant_profile_id": {
2046
+ "type": "UUID",
2047
+ "referenceKind": "crossPackageRef",
2048
+ "notNull": false,
2049
+ "unique": false
2050
+ },
2051
+ "agent_ref": {
2052
+ "type": "TEXT",
2053
+ "notNull": false,
2054
+ "unique": false
2055
+ },
2056
+ "source": {
2057
+ "type": "TEXT",
2058
+ "notNull": false,
2059
+ "unique": false
2060
+ },
2061
+ "description": {
2062
+ "type": "TEXT",
2063
+ "notNull": false,
2064
+ "unique": false
2065
+ },
2066
+ "started_at": {
2067
+ "type": "TIMESTAMP",
2068
+ "notNull": false,
2069
+ "unique": false
2070
+ },
2071
+ "ended_at": {
2072
+ "type": "TIMESTAMP",
2073
+ "notNull": false,
2074
+ "unique": false
2075
+ },
2076
+ "duration_seconds": {
2077
+ "type": "INTEGER",
2078
+ "notNull": false,
2079
+ "unique": false,
2080
+ "default": 0
2081
+ },
2082
+ "evidence": {
2083
+ "type": "TEXT",
2084
+ "notNull": false,
2085
+ "unique": false
2086
+ },
2087
+ "status": {
2088
+ "type": "TEXT",
2089
+ "notNull": false,
2090
+ "unique": false
2091
+ },
2092
+ "submitted_at": {
2093
+ "type": "TIMESTAMP",
2094
+ "notNull": false,
2095
+ "unique": false
2096
+ },
2097
+ "submitted_by_profile_id": {
2098
+ "type": "UUID",
2099
+ "referenceKind": "crossPackageRef",
2100
+ "notNull": false,
2101
+ "unique": false
2102
+ },
2103
+ "approved_at": {
2104
+ "type": "TIMESTAMP",
2105
+ "notNull": false,
2106
+ "unique": false
2107
+ },
2108
+ "approved_by_profile_id": {
2109
+ "type": "UUID",
2110
+ "referenceKind": "crossPackageRef",
2111
+ "notNull": false,
2112
+ "unique": false
2113
+ },
2114
+ "approval_path": {
2115
+ "type": "TEXT",
2116
+ "notNull": false,
2117
+ "unique": false
2118
+ },
2119
+ "rejected_at": {
2120
+ "type": "TIMESTAMP",
2121
+ "notNull": false,
2122
+ "unique": false
2123
+ },
2124
+ "rejected_by_profile_id": {
2125
+ "type": "UUID",
2126
+ "referenceKind": "crossPackageRef",
2127
+ "notNull": false,
2128
+ "unique": false
2129
+ },
2130
+ "rejection_reason": {
2131
+ "type": "TEXT",
2132
+ "notNull": false,
2133
+ "unique": false
2134
+ },
2135
+ "correction_of_id": {
2136
+ "type": "UUID",
2137
+ "referenceKind": "foreignKey",
2138
+ "notNull": false,
2139
+ "unique": false,
2140
+ "foreignKey": {
2141
+ "table": "service_time_entries",
2142
+ "column": "id",
2143
+ "onDelete": "NO ACTION",
2144
+ "onUpdate": "CASCADE"
2145
+ }
2146
+ },
2147
+ "metadata": {
2148
+ "type": "TEXT",
2149
+ "notNull": false,
2150
+ "unique": false
2151
+ }
2152
+ },
2153
+ "indexes": [
2154
+ {
2155
+ "name": "service_time_entries_slug_context_idx",
2156
+ "columns": [
2157
+ "tenant_id",
2158
+ "slug",
2159
+ "context"
2160
+ ],
2161
+ "unique": true,
2162
+ "nullsNotDistinct": true
2163
+ },
2164
+ {
2165
+ "name": "service_time_entries_tenant_id_created_at_idx",
2166
+ "columns": [
2167
+ "tenant_id",
2168
+ "created_at"
2169
+ ]
2170
+ },
2171
+ {
2172
+ "name": "service_time_entries_participant_profile_id_idx",
2173
+ "columns": [
2174
+ "participant_profile_id"
2175
+ ]
2176
+ },
2177
+ {
2178
+ "name": "service_time_entries_submitted_by_profile_id_idx",
2179
+ "columns": [
2180
+ "submitted_by_profile_id"
2181
+ ]
2182
+ },
2183
+ {
2184
+ "name": "service_time_entries_approved_by_profile_id_idx",
2185
+ "columns": [
2186
+ "approved_by_profile_id"
2187
+ ]
2188
+ },
2189
+ {
2190
+ "name": "service_time_entries_rejected_by_profile_id_idx",
2191
+ "columns": [
2192
+ "rejected_by_profile_id"
2193
+ ]
2194
+ },
2195
+ {
2196
+ "name": "service_time_entries_correction_of_id_idx",
2197
+ "columns": [
2198
+ "correction_of_id"
2199
+ ]
2200
+ }
2201
+ ],
2202
+ "version": "16c0d6c8"
2203
+ },
2204
+ "importPath": "@happyvertical/smrt-timesheets"
2205
+ },
2206
+ "@happyvertical/smrt-timesheets:ServiceTimeEntryCollection": {
2207
+ "name": "servicetimeentrycollection",
2208
+ "className": "ServiceTimeEntryCollection",
2209
+ "qualifiedName": "@happyvertical/smrt-timesheets:ServiceTimeEntryCollection",
2210
+ "collection": "servicetimeentries",
2211
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-time-entry.ts",
2212
+ "packageName": "@happyvertical/smrt-timesheets",
2213
+ "fields": {},
2214
+ "methods": {
2215
+ "forWork": {
2216
+ "name": "forWork",
2217
+ "async": true,
2218
+ "parameters": [
2219
+ {
2220
+ "name": "workRefType",
2221
+ "type": "string",
2222
+ "optional": false
2223
+ },
2224
+ {
2225
+ "name": "workRefId",
2226
+ "type": "string",
2227
+ "optional": false
2228
+ }
2229
+ ],
2230
+ "returnType": "Promise<ServiceTimeEntry[]>",
2231
+ "isStatic": false,
2232
+ "isPublic": true
2233
+ },
2234
+ "pendingApproval": {
2235
+ "name": "pendingApproval",
2236
+ "async": true,
2237
+ "parameters": [],
2238
+ "returnType": "Promise<ServiceTimeEntry[]>",
2239
+ "isStatic": false,
2240
+ "isPublic": true
2241
+ }
2242
+ },
2243
+ "decoratorConfig": {
2244
+ "tableName": "service_time_entries"
2245
+ },
2246
+ "extends": "SmrtCollection",
2247
+ "extendsTypeArg": "ServiceTimeEntry",
2248
+ "exportName": "ServiceTimeEntryCollection",
2249
+ "collectionExportName": "ServiceTimeEntryCollectionCollection",
2250
+ "schema": {
2251
+ "tableName": "service_time_entries",
2252
+ "ddl": "CREATE TABLE IF NOT EXISTS \"service_time_entries\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"work_ref_type\" TEXT,\n \"work_ref_id\" TEXT,\n \"participant_kind\" TEXT,\n \"participant_profile_id\" UUID,\n \"agent_ref\" TEXT,\n \"source\" TEXT,\n \"description\" TEXT,\n \"started_at\" TIMESTAMP,\n \"ended_at\" TIMESTAMP,\n \"duration_seconds\" INTEGER DEFAULT 0,\n \"evidence\" TEXT,\n \"status\" TEXT,\n \"submitted_at\" TIMESTAMP,\n \"submitted_by_profile_id\" UUID,\n \"approved_at\" TIMESTAMP,\n \"approved_by_profile_id\" UUID,\n \"approval_path\" TEXT,\n \"rejected_at\" TIMESTAMP,\n \"rejected_by_profile_id\" UUID,\n \"rejection_reason\" TEXT,\n \"correction_of_id\" UUID,\n \"metadata\" TEXT\n);",
2253
+ "columns": {
2254
+ "id": {
2255
+ "type": "UUID",
2256
+ "primaryKey": true,
2257
+ "referenceKind": "id",
2258
+ "notNull": true
2259
+ },
2260
+ "slug": {
2261
+ "type": "TEXT",
2262
+ "notNull": true
2263
+ },
2264
+ "context": {
2265
+ "type": "TEXT",
2266
+ "notNull": true,
2267
+ "default": ""
2268
+ },
2269
+ "created_at": {
2270
+ "type": "TIMESTAMP",
2271
+ "notNull": true,
2272
+ "default": "current_timestamp"
2273
+ },
2274
+ "updated_at": {
2275
+ "type": "TIMESTAMP",
2276
+ "notNull": true,
2277
+ "default": "current_timestamp"
2278
+ },
2279
+ "tenant_id": {
2280
+ "type": "UUID",
2281
+ "referenceKind": "tenantId",
2282
+ "notNull": false,
2283
+ "unique": false
2284
+ },
2285
+ "work_ref_type": {
2286
+ "type": "TEXT",
2287
+ "notNull": false,
2288
+ "unique": false
2289
+ },
2290
+ "work_ref_id": {
2291
+ "type": "TEXT",
2292
+ "notNull": false,
2293
+ "unique": false
2294
+ },
2295
+ "participant_kind": {
2296
+ "type": "TEXT",
2297
+ "notNull": false,
2298
+ "unique": false
2299
+ },
2300
+ "participant_profile_id": {
2301
+ "type": "UUID",
2302
+ "referenceKind": "crossPackageRef",
2303
+ "notNull": false,
2304
+ "unique": false
2305
+ },
2306
+ "agent_ref": {
2307
+ "type": "TEXT",
2308
+ "notNull": false,
2309
+ "unique": false
2310
+ },
2311
+ "source": {
2312
+ "type": "TEXT",
2313
+ "notNull": false,
2314
+ "unique": false
2315
+ },
2316
+ "description": {
2317
+ "type": "TEXT",
2318
+ "notNull": false,
2319
+ "unique": false
2320
+ },
2321
+ "started_at": {
2322
+ "type": "TIMESTAMP",
2323
+ "notNull": false,
2324
+ "unique": false
2325
+ },
2326
+ "ended_at": {
2327
+ "type": "TIMESTAMP",
2328
+ "notNull": false,
2329
+ "unique": false
2330
+ },
2331
+ "duration_seconds": {
2332
+ "type": "INTEGER",
2333
+ "notNull": false,
2334
+ "unique": false,
2335
+ "default": 0
2336
+ },
2337
+ "evidence": {
2338
+ "type": "TEXT",
2339
+ "notNull": false,
2340
+ "unique": false
2341
+ },
2342
+ "status": {
2343
+ "type": "TEXT",
2344
+ "notNull": false,
2345
+ "unique": false
2346
+ },
2347
+ "submitted_at": {
2348
+ "type": "TIMESTAMP",
2349
+ "notNull": false,
2350
+ "unique": false
2351
+ },
2352
+ "submitted_by_profile_id": {
2353
+ "type": "UUID",
2354
+ "referenceKind": "crossPackageRef",
2355
+ "notNull": false,
2356
+ "unique": false
2357
+ },
2358
+ "approved_at": {
2359
+ "type": "TIMESTAMP",
2360
+ "notNull": false,
2361
+ "unique": false
2362
+ },
2363
+ "approved_by_profile_id": {
2364
+ "type": "UUID",
2365
+ "referenceKind": "crossPackageRef",
2366
+ "notNull": false,
2367
+ "unique": false
2368
+ },
2369
+ "approval_path": {
2370
+ "type": "TEXT",
2371
+ "notNull": false,
2372
+ "unique": false
2373
+ },
2374
+ "rejected_at": {
2375
+ "type": "TIMESTAMP",
2376
+ "notNull": false,
2377
+ "unique": false
2378
+ },
2379
+ "rejected_by_profile_id": {
2380
+ "type": "UUID",
2381
+ "referenceKind": "crossPackageRef",
2382
+ "notNull": false,
2383
+ "unique": false
2384
+ },
2385
+ "rejection_reason": {
2386
+ "type": "TEXT",
2387
+ "notNull": false,
2388
+ "unique": false
2389
+ },
2390
+ "correction_of_id": {
2391
+ "type": "UUID",
2392
+ "referenceKind": "foreignKey",
2393
+ "notNull": false,
2394
+ "unique": false,
2395
+ "foreignKey": {
2396
+ "table": "service_time_entries",
2397
+ "column": "id",
2398
+ "onDelete": "NO ACTION",
2399
+ "onUpdate": "CASCADE"
2400
+ }
2401
+ },
2402
+ "metadata": {
655
2403
  "type": "TEXT",
656
2404
  "notNull": false,
657
2405
  "unique": false
@@ -659,274 +2407,198 @@
659
2407
  },
660
2408
  "indexes": [
661
2409
  {
662
- "name": "service_compensation_snapshots_time_entry_id_idx",
2410
+ "name": "service_time_entries_slug_context_idx",
663
2411
  "columns": [
664
- "time_entry_id"
2412
+ "tenant_id",
2413
+ "slug",
2414
+ "context"
665
2415
  ],
666
- "unique": true
2416
+ "unique": true,
2417
+ "nullsNotDistinct": true
667
2418
  },
668
2419
  {
669
- "name": "service_compensation_snapshots_slug_context_idx",
2420
+ "name": "service_time_entries_tenant_id_created_at_idx",
670
2421
  "columns": [
671
- "slug",
672
- "context"
2422
+ "tenant_id",
2423
+ "created_at"
673
2424
  ]
674
2425
  },
675
2426
  {
676
- "name": "service_compensation_snapshots_tenant_id_created_at_idx",
2427
+ "name": "service_time_entries_participant_profile_id_idx",
677
2428
  "columns": [
678
- "tenant_id",
679
- "created_at"
2429
+ "participant_profile_id"
2430
+ ]
2431
+ },
2432
+ {
2433
+ "name": "service_time_entries_submitted_by_profile_id_idx",
2434
+ "columns": [
2435
+ "submitted_by_profile_id"
2436
+ ]
2437
+ },
2438
+ {
2439
+ "name": "service_time_entries_approved_by_profile_id_idx",
2440
+ "columns": [
2441
+ "approved_by_profile_id"
2442
+ ]
2443
+ },
2444
+ {
2445
+ "name": "service_time_entries_rejected_by_profile_id_idx",
2446
+ "columns": [
2447
+ "rejected_by_profile_id"
2448
+ ]
2449
+ },
2450
+ {
2451
+ "name": "service_time_entries_correction_of_id_idx",
2452
+ "columns": [
2453
+ "correction_of_id"
680
2454
  ]
681
2455
  }
682
2456
  ],
683
- "version": "cd8670e5"
2457
+ "version": "16c0d6c8"
684
2458
  },
685
2459
  "importPath": "@happyvertical/smrt-timesheets"
686
2460
  },
687
- "@happyvertical/smrt-timesheets:ServiceTimeEntry": {
688
- "name": "servicetimeentry",
689
- "className": "ServiceTimeEntry",
690
- "qualifiedName": "@happyvertical/smrt-timesheets:ServiceTimeEntry",
691
- "collection": "servicetimeentries",
692
- "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-time-entry.ts",
2461
+ "@happyvertical/smrt-timesheets:PeriodTimecard": {
2462
+ "name": "periodtimecard",
2463
+ "className": "PeriodTimecard",
2464
+ "qualifiedName": "@happyvertical/smrt-timesheets:PeriodTimecard",
2465
+ "collection": "periodtimecards",
2466
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/rollup/models.ts",
693
2467
  "packageName": "@happyvertical/smrt-timesheets",
694
2468
  "fields": {
695
2469
  "tenantId": {
696
2470
  "type": "text",
697
- "required": false,
2471
+ "required": true,
698
2472
  "_meta": {
699
2473
  "sqlType": "UUID",
700
- "nullable": true,
701
2474
  "__tenancy": {
702
2475
  "isTenantIdField": true,
703
2476
  "autoFilter": true,
704
- "required": false,
2477
+ "required": true,
705
2478
  "autoPopulate": true,
706
- "nullable": true,
707
- "mode": "optional",
2479
+ "nullable": false,
2480
+ "mode": "required",
708
2481
  "field": "tenantId",
709
2482
  "allowSuperAdminBypass": false
710
2483
  }
711
2484
  }
712
2485
  },
713
- "workRefType": {
714
- "type": "text",
715
- "required": false,
716
- "_meta": {
717
- "nullable": true
718
- }
719
- },
720
- "workRefId": {
721
- "type": "text",
722
- "required": false,
723
- "_meta": {
724
- "nullable": true
725
- }
726
- },
727
- "participantKind": {
728
- "type": "text",
729
- "required": false,
730
- "_meta": {}
731
- },
732
- "participantProfileId": {
2486
+ "profileId": {
733
2487
  "type": "crossPackageRef",
734
2488
  "required": false,
735
2489
  "related": "@happyvertical/smrt-profiles:Profile",
736
2490
  "_meta": {
737
- "nullable": true
2491
+ "onDelete": "RESTRICT"
738
2492
  }
739
2493
  },
740
- "agentRef": {
741
- "type": "text",
742
- "required": false,
743
- "_meta": {}
744
- },
745
- "source": {
746
- "type": "text",
747
- "required": false,
748
- "_meta": {}
749
- },
750
- "description": {
751
- "type": "text",
752
- "required": false,
753
- "_meta": {}
754
- },
755
- "startedAt": {
2494
+ "startsAt": {
756
2495
  "type": "datetime",
757
2496
  "required": false
758
2497
  },
759
- "endedAt": {
2498
+ "endsAt": {
760
2499
  "type": "datetime",
761
2500
  "required": false
762
2501
  },
763
- "durationSeconds": {
764
- "type": "integer",
765
- "required": false,
766
- "default": 0
2502
+ "timezone": {
2503
+ "type": "text",
2504
+ "required": false
767
2505
  },
768
- "evidence": {
2506
+ "rulesVersion": {
2507
+ "type": "text",
2508
+ "required": false
2509
+ },
2510
+ "rulesSnapshot": {
769
2511
  "type": "text",
770
2512
  "required": false,
771
2513
  "_meta": {}
772
2514
  },
773
- "status": {
2515
+ "sourceSnapshot": {
774
2516
  "type": "text",
775
2517
  "required": false,
776
2518
  "_meta": {}
777
2519
  },
778
- "submittedAt": {
779
- "type": "datetime",
780
- "required": false
781
- },
782
- "submittedByProfileId": {
783
- "type": "crossPackageRef",
784
- "required": false,
785
- "related": "@happyvertical/smrt-profiles:Profile",
786
- "_meta": {
787
- "nullable": true
788
- }
2520
+ "regularSeconds": {
2521
+ "type": "integer",
2522
+ "required": true,
2523
+ "default": 0
789
2524
  },
790
- "approvedAt": {
791
- "type": "datetime",
792
- "required": false
2525
+ "overtimeSeconds": {
2526
+ "type": "integer",
2527
+ "required": true,
2528
+ "default": 0
793
2529
  },
794
- "approvedByProfileId": {
795
- "type": "crossPackageRef",
796
- "required": false,
797
- "related": "@happyvertical/smrt-profiles:Profile",
798
- "_meta": {
799
- "nullable": true
800
- }
2530
+ "totalSeconds": {
2531
+ "type": "integer",
2532
+ "required": true,
2533
+ "default": 0
801
2534
  },
802
- "approvalPath": {
2535
+ "status": {
803
2536
  "type": "text",
804
2537
  "required": false,
805
2538
  "_meta": {}
806
2539
  },
807
- "rejectedAt": {
2540
+ "confirmedAt": {
808
2541
  "type": "datetime",
809
2542
  "required": false
810
2543
  },
811
- "rejectedByProfileId": {
2544
+ "confirmedByProfileId": {
812
2545
  "type": "crossPackageRef",
813
2546
  "required": false,
814
2547
  "related": "@happyvertical/smrt-profiles:Profile",
815
2548
  "_meta": {
816
- "nullable": true
2549
+ "nullable": true,
2550
+ "onDelete": "RESTRICT"
817
2551
  }
818
- },
819
- "rejectionReason": {
820
- "type": "text",
821
- "required": false,
822
- "_meta": {}
823
- },
824
- "correctionOfId": {
825
- "type": "foreignKey",
826
- "required": false,
827
- "related": "ServiceTimeEntry"
828
- },
829
- "metadata": {
830
- "type": "text",
831
- "required": false,
832
- "_meta": {}
833
2552
  }
834
2553
  },
835
2554
  "methods": {
836
- "getEvidence": {
837
- "name": "getEvidence",
838
- "async": false,
839
- "parameters": [],
840
- "returnType": "ServiceEvidence[]",
841
- "isStatic": false,
842
- "isPublic": true
843
- },
844
- "setEvidence": {
845
- "name": "setEvidence",
846
- "async": false,
847
- "parameters": [
848
- {
849
- "name": "value",
850
- "type": "ServiceEvidence[]",
851
- "optional": false
852
- }
853
- ],
854
- "returnType": "void",
855
- "isStatic": false,
856
- "isPublic": true
857
- },
858
- "getMetadata": {
859
- "name": "getMetadata",
2555
+ "getSources": {
2556
+ "name": "getSources",
860
2557
  "async": false,
861
2558
  "parameters": [],
862
- "returnType": "Record<string, unknown>",
2559
+ "returnType": "TimecardSource[]",
863
2560
  "isStatic": false,
864
2561
  "isPublic": true
865
2562
  },
866
- "setMetadata": {
867
- "name": "setMetadata",
868
- "async": false,
869
- "parameters": [
870
- {
871
- "name": "value",
872
- "type": "Record<string, unknown>",
873
- "optional": false
874
- }
875
- ],
876
- "returnType": "void",
877
- "isStatic": false,
878
- "isPublic": true
879
- },
880
- "durationHours": {
881
- "name": "durationHours",
2563
+ "getRules": {
2564
+ "name": "getRules",
882
2565
  "async": false,
883
2566
  "parameters": [],
884
- "returnType": "number",
2567
+ "returnType": "Record<string, unknown>",
885
2568
  "isStatic": false,
886
2569
  "isPublic": true
887
2570
  },
888
- "initialize": {
889
- "name": "initialize",
2571
+ "save": {
2572
+ "name": "save",
890
2573
  "async": true,
891
2574
  "parameters": [],
892
2575
  "returnType": "Promise<this>",
893
2576
  "isStatic": false,
894
2577
  "isPublic": true
895
2578
  },
896
- "save": {
897
- "name": "save",
2579
+ "delete": {
2580
+ "name": "delete",
898
2581
  "async": true,
899
2582
  "parameters": [],
900
- "returnType": "Promise<this>",
2583
+ "returnType": "Promise<void>",
901
2584
  "isStatic": false,
902
2585
  "isPublic": true
903
2586
  }
904
2587
  },
905
2588
  "decoratorConfig": {
906
- "tableName": "service_time_entries",
907
- "previousQualifiedNames": [
908
- "@happyvertical/smrt-projects:ServiceTimeEntry"
909
- ],
2589
+ "tableName": "period_timecards",
2590
+ "sensitive": true,
910
2591
  "api": {
911
- "include": [
912
- "list",
913
- "get"
914
- ]
2592
+ "include": []
915
2593
  },
916
2594
  "cli": {
917
- "include": [
918
- "list",
919
- "get"
920
- ]
2595
+ "include": []
921
2596
  },
922
2597
  "mcp": {
923
- "include": [
924
- "list",
925
- "get"
926
- ]
2598
+ "include": []
927
2599
  },
928
2600
  "tenantScoped": {
929
- "mode": "optional"
2601
+ "mode": "required"
930
2602
  },
931
2603
  "conflictColumns": [
932
2604
  "tenant_id",
@@ -935,11 +2607,28 @@
935
2607
  ]
936
2608
  },
937
2609
  "extends": "SmrtObject",
938
- "exportName": "ServiceTimeEntry",
939
- "collectionExportName": "ServiceTimeEntryCollection",
2610
+ "exportName": "PeriodTimecard",
2611
+ "collectionExportName": "PeriodTimecardCollection",
2612
+ "validationRules": [
2613
+ {
2614
+ "field": "regularSeconds",
2615
+ "rule": "required",
2616
+ "fieldType": "integer"
2617
+ },
2618
+ {
2619
+ "field": "overtimeSeconds",
2620
+ "rule": "required",
2621
+ "fieldType": "integer"
2622
+ },
2623
+ {
2624
+ "field": "totalSeconds",
2625
+ "rule": "required",
2626
+ "fieldType": "integer"
2627
+ }
2628
+ ],
940
2629
  "schema": {
941
- "tableName": "service_time_entries",
942
- "ddl": "CREATE TABLE IF NOT EXISTS \"service_time_entries\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"work_ref_type\" TEXT,\n \"work_ref_id\" TEXT,\n \"participant_kind\" TEXT,\n \"participant_profile_id\" UUID,\n \"agent_ref\" TEXT,\n \"source\" TEXT,\n \"description\" TEXT,\n \"started_at\" TIMESTAMP,\n \"ended_at\" TIMESTAMP,\n \"duration_seconds\" INTEGER DEFAULT 0,\n \"evidence\" TEXT,\n \"status\" TEXT,\n \"submitted_at\" TIMESTAMP,\n \"submitted_by_profile_id\" UUID,\n \"approved_at\" TIMESTAMP,\n \"approved_by_profile_id\" UUID,\n \"approval_path\" TEXT,\n \"rejected_at\" TIMESTAMP,\n \"rejected_by_profile_id\" UUID,\n \"rejection_reason\" TEXT,\n \"correction_of_id\" UUID,\n \"metadata\" TEXT\n);",
2630
+ "tableName": "period_timecards",
2631
+ "ddl": "CREATE TABLE IF NOT EXISTS \"period_timecards\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"profile_id\" UUID,\n \"starts_at\" TIMESTAMP,\n \"ends_at\" TIMESTAMP,\n \"timezone\" TEXT,\n \"rules_version\" TEXT,\n \"rules_snapshot\" TEXT,\n \"source_snapshot\" TEXT,\n \"regular_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"overtime_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"total_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"status\" TEXT,\n \"confirmed_at\" TIMESTAMP,\n \"confirmed_by_profile_id\" UUID\n);",
943
2632
  "columns": {
944
2633
  "id": {
945
2634
  "type": "UUID",
@@ -969,127 +2658,313 @@
969
2658
  "tenant_id": {
970
2659
  "type": "UUID",
971
2660
  "referenceKind": "tenantId",
972
- "notNull": false,
973
- "unique": false
974
- },
975
- "work_ref_type": {
976
- "type": "TEXT",
977
- "notNull": false,
2661
+ "notNull": true,
978
2662
  "unique": false
979
2663
  },
980
- "work_ref_id": {
981
- "type": "TEXT",
2664
+ "profile_id": {
2665
+ "type": "UUID",
2666
+ "referenceKind": "crossPackageRef",
982
2667
  "notNull": false,
983
2668
  "unique": false
984
2669
  },
985
- "participant_kind": {
986
- "type": "TEXT",
2670
+ "starts_at": {
2671
+ "type": "TIMESTAMP",
987
2672
  "notNull": false,
988
2673
  "unique": false
989
2674
  },
990
- "participant_profile_id": {
991
- "type": "UUID",
992
- "referenceKind": "crossPackageRef",
2675
+ "ends_at": {
2676
+ "type": "TIMESTAMP",
993
2677
  "notNull": false,
994
2678
  "unique": false
995
2679
  },
996
- "agent_ref": {
2680
+ "timezone": {
997
2681
  "type": "TEXT",
998
2682
  "notNull": false,
999
2683
  "unique": false
1000
2684
  },
1001
- "source": {
2685
+ "rules_version": {
1002
2686
  "type": "TEXT",
1003
2687
  "notNull": false,
1004
2688
  "unique": false
1005
2689
  },
1006
- "description": {
2690
+ "rules_snapshot": {
1007
2691
  "type": "TEXT",
1008
2692
  "notNull": false,
1009
2693
  "unique": false
1010
2694
  },
1011
- "started_at": {
1012
- "type": "TIMESTAMP",
2695
+ "source_snapshot": {
2696
+ "type": "TEXT",
1013
2697
  "notNull": false,
1014
2698
  "unique": false
1015
2699
  },
1016
- "ended_at": {
1017
- "type": "TIMESTAMP",
1018
- "notNull": false,
1019
- "unique": false
2700
+ "regular_seconds": {
2701
+ "type": "INTEGER",
2702
+ "notNull": true,
2703
+ "unique": false,
2704
+ "default": 0
1020
2705
  },
1021
- "duration_seconds": {
2706
+ "overtime_seconds": {
1022
2707
  "type": "INTEGER",
1023
- "notNull": false,
2708
+ "notNull": true,
1024
2709
  "unique": false,
1025
2710
  "default": 0
1026
2711
  },
1027
- "evidence": {
1028
- "type": "TEXT",
1029
- "notNull": false,
1030
- "unique": false
2712
+ "total_seconds": {
2713
+ "type": "INTEGER",
2714
+ "notNull": true,
2715
+ "unique": false,
2716
+ "default": 0
1031
2717
  },
1032
2718
  "status": {
1033
2719
  "type": "TEXT",
1034
2720
  "notNull": false,
1035
2721
  "unique": false
1036
2722
  },
1037
- "submitted_at": {
2723
+ "confirmed_at": {
1038
2724
  "type": "TIMESTAMP",
1039
2725
  "notNull": false,
1040
2726
  "unique": false
1041
2727
  },
1042
- "submitted_by_profile_id": {
2728
+ "confirmed_by_profile_id": {
1043
2729
  "type": "UUID",
1044
2730
  "referenceKind": "crossPackageRef",
1045
2731
  "notNull": false,
1046
2732
  "unique": false
2733
+ }
2734
+ },
2735
+ "indexes": [
2736
+ {
2737
+ "name": "period_timecards_slug_context_idx",
2738
+ "columns": [
2739
+ "tenant_id",
2740
+ "slug",
2741
+ "context"
2742
+ ],
2743
+ "unique": true
1047
2744
  },
1048
- "approved_at": {
1049
- "type": "TIMESTAMP",
1050
- "notNull": false,
1051
- "unique": false
2745
+ {
2746
+ "name": "period_timecards_tenant_id_created_at_idx",
2747
+ "columns": [
2748
+ "tenant_id",
2749
+ "created_at"
2750
+ ]
1052
2751
  },
1053
- "approved_by_profile_id": {
2752
+ {
2753
+ "name": "period_timecards_profile_id_idx",
2754
+ "columns": [
2755
+ "profile_id"
2756
+ ]
2757
+ },
2758
+ {
2759
+ "name": "period_timecards_confirmed_by_profile_id_idx",
2760
+ "columns": [
2761
+ "confirmed_by_profile_id"
2762
+ ]
2763
+ }
2764
+ ],
2765
+ "version": "8153dc2a"
2766
+ },
2767
+ "importPath": "@happyvertical/smrt-timesheets/rollup"
2768
+ },
2769
+ "@happyvertical/smrt-timesheets:TimecardAdjustment": {
2770
+ "name": "timecardadjustment",
2771
+ "className": "TimecardAdjustment",
2772
+ "qualifiedName": "@happyvertical/smrt-timesheets:TimecardAdjustment",
2773
+ "collection": "timecardadjustments",
2774
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/rollup/models.ts",
2775
+ "packageName": "@happyvertical/smrt-timesheets",
2776
+ "fields": {
2777
+ "tenantId": {
2778
+ "type": "text",
2779
+ "required": true,
2780
+ "_meta": {
2781
+ "sqlType": "UUID",
2782
+ "__tenancy": {
2783
+ "isTenantIdField": true,
2784
+ "autoFilter": true,
2785
+ "required": true,
2786
+ "autoPopulate": true,
2787
+ "nullable": false,
2788
+ "mode": "required",
2789
+ "field": "tenantId",
2790
+ "allowSuperAdminBypass": false
2791
+ }
2792
+ }
2793
+ },
2794
+ "timecardId": {
2795
+ "type": "foreignKey",
2796
+ "required": false,
2797
+ "related": "PeriodTimecard",
2798
+ "_meta": {
2799
+ "onDelete": "RESTRICT"
2800
+ }
2801
+ },
2802
+ "profileId": {
2803
+ "type": "crossPackageRef",
2804
+ "required": false,
2805
+ "related": "@happyvertical/smrt-profiles:Profile",
2806
+ "_meta": {
2807
+ "onDelete": "RESTRICT"
2808
+ }
2809
+ },
2810
+ "actorProfileId": {
2811
+ "type": "crossPackageRef",
2812
+ "required": false,
2813
+ "related": "@happyvertical/smrt-profiles:Profile",
2814
+ "_meta": {
2815
+ "onDelete": "RESTRICT"
2816
+ }
2817
+ },
2818
+ "operationId": {
2819
+ "type": "text",
2820
+ "required": false
2821
+ },
2822
+ "regularSeconds": {
2823
+ "type": "integer",
2824
+ "required": true,
2825
+ "default": 0
2826
+ },
2827
+ "overtimeSeconds": {
2828
+ "type": "integer",
2829
+ "required": true,
2830
+ "default": 0
2831
+ },
2832
+ "reason": {
2833
+ "type": "text",
2834
+ "required": false
2835
+ }
2836
+ },
2837
+ "methods": {
2838
+ "save": {
2839
+ "name": "save",
2840
+ "async": true,
2841
+ "parameters": [],
2842
+ "returnType": "Promise<this>",
2843
+ "isStatic": false,
2844
+ "isPublic": true
2845
+ },
2846
+ "delete": {
2847
+ "name": "delete",
2848
+ "async": true,
2849
+ "parameters": [],
2850
+ "returnType": "Promise<void>",
2851
+ "isStatic": false,
2852
+ "isPublic": true
2853
+ }
2854
+ },
2855
+ "decoratorConfig": {
2856
+ "tableName": "timecard_adjustments",
2857
+ "sensitive": true,
2858
+ "api": {
2859
+ "include": []
2860
+ },
2861
+ "cli": {
2862
+ "include": []
2863
+ },
2864
+ "mcp": {
2865
+ "include": []
2866
+ },
2867
+ "tenantScoped": {
2868
+ "mode": "required"
2869
+ },
2870
+ "conflictColumns": [
2871
+ "tenant_id",
2872
+ "slug",
2873
+ "context"
2874
+ ]
2875
+ },
2876
+ "extends": "SmrtObject",
2877
+ "exportName": "TimecardAdjustment",
2878
+ "collectionExportName": "TimecardAdjustmentCollection",
2879
+ "validationRules": [
2880
+ {
2881
+ "field": "regularSeconds",
2882
+ "rule": "required",
2883
+ "fieldType": "integer"
2884
+ },
2885
+ {
2886
+ "field": "overtimeSeconds",
2887
+ "rule": "required",
2888
+ "fieldType": "integer"
2889
+ }
2890
+ ],
2891
+ "schema": {
2892
+ "tableName": "timecard_adjustments",
2893
+ "ddl": "CREATE TABLE IF NOT EXISTS \"timecard_adjustments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"timecard_id\" UUID,\n \"profile_id\" UUID,\n \"actor_profile_id\" UUID,\n \"operation_id\" TEXT,\n \"regular_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"overtime_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"reason\" TEXT\n);",
2894
+ "columns": {
2895
+ "id": {
1054
2896
  "type": "UUID",
1055
- "referenceKind": "crossPackageRef",
1056
- "notNull": false,
1057
- "unique": false
2897
+ "primaryKey": true,
2898
+ "referenceKind": "id",
2899
+ "notNull": true
1058
2900
  },
1059
- "approval_path": {
2901
+ "slug": {
1060
2902
  "type": "TEXT",
1061
- "notNull": false,
1062
- "unique": false
2903
+ "notNull": true
1063
2904
  },
1064
- "rejected_at": {
2905
+ "context": {
2906
+ "type": "TEXT",
2907
+ "notNull": true,
2908
+ "default": ""
2909
+ },
2910
+ "created_at": {
1065
2911
  "type": "TIMESTAMP",
1066
- "notNull": false,
2912
+ "notNull": true,
2913
+ "default": "current_timestamp"
2914
+ },
2915
+ "updated_at": {
2916
+ "type": "TIMESTAMP",
2917
+ "notNull": true,
2918
+ "default": "current_timestamp"
2919
+ },
2920
+ "tenant_id": {
2921
+ "type": "UUID",
2922
+ "referenceKind": "tenantId",
2923
+ "notNull": true,
1067
2924
  "unique": false
1068
2925
  },
1069
- "rejected_by_profile_id": {
2926
+ "timecard_id": {
2927
+ "type": "UUID",
2928
+ "referenceKind": "foreignKey",
2929
+ "notNull": false,
2930
+ "unique": false,
2931
+ "foreignKey": {
2932
+ "table": "period_timecards",
2933
+ "column": "id",
2934
+ "onDelete": "RESTRICT",
2935
+ "onUpdate": "CASCADE"
2936
+ }
2937
+ },
2938
+ "profile_id": {
1070
2939
  "type": "UUID",
1071
2940
  "referenceKind": "crossPackageRef",
1072
2941
  "notNull": false,
1073
2942
  "unique": false
1074
2943
  },
1075
- "rejection_reason": {
1076
- "type": "TEXT",
2944
+ "actor_profile_id": {
2945
+ "type": "UUID",
2946
+ "referenceKind": "crossPackageRef",
1077
2947
  "notNull": false,
1078
2948
  "unique": false
1079
2949
  },
1080
- "correction_of_id": {
1081
- "type": "UUID",
1082
- "referenceKind": "foreignKey",
2950
+ "operation_id": {
2951
+ "type": "TEXT",
1083
2952
  "notNull": false,
2953
+ "unique": false
2954
+ },
2955
+ "regular_seconds": {
2956
+ "type": "INTEGER",
2957
+ "notNull": true,
1084
2958
  "unique": false,
1085
- "foreignKey": {
1086
- "table": "service_time_entries",
1087
- "column": "id",
1088
- "onDelete": "NO ACTION",
1089
- "onUpdate": "CASCADE"
1090
- }
2959
+ "default": 0
1091
2960
  },
1092
- "metadata": {
2961
+ "overtime_seconds": {
2962
+ "type": "INTEGER",
2963
+ "notNull": true,
2964
+ "unique": false,
2965
+ "default": 0
2966
+ },
2967
+ "reason": {
1093
2968
  "type": "TEXT",
1094
2969
  "notNull": false,
1095
2970
  "unique": false
@@ -1097,104 +2972,63 @@
1097
2972
  },
1098
2973
  "indexes": [
1099
2974
  {
1100
- "name": "service_time_entries_slug_context_idx",
2975
+ "name": "timecard_adjustments_slug_context_idx",
1101
2976
  "columns": [
1102
2977
  "tenant_id",
1103
2978
  "slug",
1104
2979
  "context"
1105
2980
  ],
1106
- "unique": true,
1107
- "nullsNotDistinct": true
2981
+ "unique": true
1108
2982
  },
1109
2983
  {
1110
- "name": "service_time_entries_tenant_id_created_at_idx",
2984
+ "name": "timecard_adjustments_tenant_id_created_at_idx",
1111
2985
  "columns": [
1112
2986
  "tenant_id",
1113
2987
  "created_at"
1114
2988
  ]
1115
2989
  },
1116
2990
  {
1117
- "name": "service_time_entries_participant_profile_id_idx",
1118
- "columns": [
1119
- "participant_profile_id"
1120
- ]
1121
- },
1122
- {
1123
- "name": "service_time_entries_submitted_by_profile_id_idx",
1124
- "columns": [
1125
- "submitted_by_profile_id"
1126
- ]
1127
- },
1128
- {
1129
- "name": "service_time_entries_approved_by_profile_id_idx",
2991
+ "name": "timecard_adjustments_timecard_id_idx",
1130
2992
  "columns": [
1131
- "approved_by_profile_id"
2993
+ "timecard_id"
1132
2994
  ]
1133
2995
  },
1134
2996
  {
1135
- "name": "service_time_entries_rejected_by_profile_id_idx",
2997
+ "name": "timecard_adjustments_profile_id_idx",
1136
2998
  "columns": [
1137
- "rejected_by_profile_id"
2999
+ "profile_id"
1138
3000
  ]
1139
3001
  },
1140
3002
  {
1141
- "name": "service_time_entries_correction_of_id_idx",
3003
+ "name": "timecard_adjustments_actor_profile_id_idx",
1142
3004
  "columns": [
1143
- "correction_of_id"
3005
+ "actor_profile_id"
1144
3006
  ]
1145
3007
  }
1146
3008
  ],
1147
- "version": "16c0d6c8"
3009
+ "version": "582afe16"
1148
3010
  },
1149
- "importPath": "@happyvertical/smrt-timesheets"
3011
+ "importPath": "@happyvertical/smrt-timesheets/rollup"
1150
3012
  },
1151
- "@happyvertical/smrt-timesheets:ServiceTimeEntryCollection": {
1152
- "name": "servicetimeentrycollection",
1153
- "className": "ServiceTimeEntryCollection",
1154
- "qualifiedName": "@happyvertical/smrt-timesheets:ServiceTimeEntryCollection",
1155
- "collection": "servicetimeentries",
1156
- "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/models/service-time-entry.ts",
3013
+ "@happyvertical/smrt-timesheets:PeriodTimecardCollection": {
3014
+ "name": "periodtimecardcollection",
3015
+ "className": "PeriodTimecardCollection",
3016
+ "qualifiedName": "@happyvertical/smrt-timesheets:PeriodTimecardCollection",
3017
+ "collection": "periodtimecards",
3018
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/rollup/models.ts",
1157
3019
  "packageName": "@happyvertical/smrt-timesheets",
1158
3020
  "fields": {},
1159
- "methods": {
1160
- "forWork": {
1161
- "name": "forWork",
1162
- "async": true,
1163
- "parameters": [
1164
- {
1165
- "name": "workRefType",
1166
- "type": "string",
1167
- "optional": false
1168
- },
1169
- {
1170
- "name": "workRefId",
1171
- "type": "string",
1172
- "optional": false
1173
- }
1174
- ],
1175
- "returnType": "Promise<ServiceTimeEntry[]>",
1176
- "isStatic": false,
1177
- "isPublic": true
1178
- },
1179
- "pendingApproval": {
1180
- "name": "pendingApproval",
1181
- "async": true,
1182
- "parameters": [],
1183
- "returnType": "Promise<ServiceTimeEntry[]>",
1184
- "isStatic": false,
1185
- "isPublic": true
1186
- }
1187
- },
3021
+ "methods": {},
1188
3022
  "decoratorConfig": {
1189
- "tableName": "service_time_entries"
3023
+ "tableName": "period_timecards"
1190
3024
  },
1191
3025
  "extends": "SmrtCollection",
1192
- "extendsTypeArg": "ServiceTimeEntry",
1193
- "exportName": "ServiceTimeEntryCollection",
1194
- "collectionExportName": "ServiceTimeEntryCollectionCollection",
3026
+ "extendsTypeArg": "PeriodTimecard",
3027
+ "exportName": "PeriodTimecardCollection",
3028
+ "collectionExportName": "PeriodTimecardCollectionCollection",
1195
3029
  "schema": {
1196
- "tableName": "service_time_entries",
1197
- "ddl": "CREATE TABLE IF NOT EXISTS \"service_time_entries\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"work_ref_type\" TEXT,\n \"work_ref_id\" TEXT,\n \"participant_kind\" TEXT,\n \"participant_profile_id\" UUID,\n \"agent_ref\" TEXT,\n \"source\" TEXT,\n \"description\" TEXT,\n \"started_at\" TIMESTAMP,\n \"ended_at\" TIMESTAMP,\n \"duration_seconds\" INTEGER DEFAULT 0,\n \"evidence\" TEXT,\n \"status\" TEXT,\n \"submitted_at\" TIMESTAMP,\n \"submitted_by_profile_id\" UUID,\n \"approved_at\" TIMESTAMP,\n \"approved_by_profile_id\" UUID,\n \"approval_path\" TEXT,\n \"rejected_at\" TIMESTAMP,\n \"rejected_by_profile_id\" UUID,\n \"rejection_reason\" TEXT,\n \"correction_of_id\" UUID,\n \"metadata\" TEXT\n);",
3030
+ "tableName": "period_timecards",
3031
+ "ddl": "CREATE TABLE IF NOT EXISTS \"period_timecards\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"profile_id\" UUID,\n \"starts_at\" TIMESTAMP,\n \"ends_at\" TIMESTAMP,\n \"timezone\" TEXT,\n \"rules_version\" TEXT,\n \"rules_snapshot\" TEXT,\n \"source_snapshot\" TEXT,\n \"regular_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"overtime_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"total_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"status\" TEXT,\n \"confirmed_at\" TIMESTAMP,\n \"confirmed_by_profile_id\" UUID\n);",
1198
3032
  "columns": {
1199
3033
  "id": {
1200
3034
  "type": "UUID",
@@ -1224,127 +3058,207 @@
1224
3058
  "tenant_id": {
1225
3059
  "type": "UUID",
1226
3060
  "referenceKind": "tenantId",
1227
- "notNull": false,
1228
- "unique": false
1229
- },
1230
- "work_ref_type": {
1231
- "type": "TEXT",
1232
- "notNull": false,
3061
+ "notNull": true,
1233
3062
  "unique": false
1234
3063
  },
1235
- "work_ref_id": {
1236
- "type": "TEXT",
3064
+ "profile_id": {
3065
+ "type": "UUID",
3066
+ "referenceKind": "crossPackageRef",
1237
3067
  "notNull": false,
1238
3068
  "unique": false
1239
3069
  },
1240
- "participant_kind": {
1241
- "type": "TEXT",
3070
+ "starts_at": {
3071
+ "type": "TIMESTAMP",
1242
3072
  "notNull": false,
1243
3073
  "unique": false
1244
3074
  },
1245
- "participant_profile_id": {
1246
- "type": "UUID",
1247
- "referenceKind": "crossPackageRef",
3075
+ "ends_at": {
3076
+ "type": "TIMESTAMP",
1248
3077
  "notNull": false,
1249
3078
  "unique": false
1250
3079
  },
1251
- "agent_ref": {
3080
+ "timezone": {
1252
3081
  "type": "TEXT",
1253
3082
  "notNull": false,
1254
3083
  "unique": false
1255
3084
  },
1256
- "source": {
3085
+ "rules_version": {
1257
3086
  "type": "TEXT",
1258
3087
  "notNull": false,
1259
3088
  "unique": false
1260
3089
  },
1261
- "description": {
3090
+ "rules_snapshot": {
1262
3091
  "type": "TEXT",
1263
3092
  "notNull": false,
1264
3093
  "unique": false
1265
3094
  },
1266
- "started_at": {
1267
- "type": "TIMESTAMP",
3095
+ "source_snapshot": {
3096
+ "type": "TEXT",
1268
3097
  "notNull": false,
1269
3098
  "unique": false
1270
3099
  },
1271
- "ended_at": {
1272
- "type": "TIMESTAMP",
1273
- "notNull": false,
1274
- "unique": false
3100
+ "regular_seconds": {
3101
+ "type": "INTEGER",
3102
+ "notNull": true,
3103
+ "unique": false,
3104
+ "default": 0
1275
3105
  },
1276
- "duration_seconds": {
3106
+ "overtime_seconds": {
1277
3107
  "type": "INTEGER",
1278
- "notNull": false,
3108
+ "notNull": true,
1279
3109
  "unique": false,
1280
3110
  "default": 0
1281
3111
  },
1282
- "evidence": {
1283
- "type": "TEXT",
1284
- "notNull": false,
1285
- "unique": false
3112
+ "total_seconds": {
3113
+ "type": "INTEGER",
3114
+ "notNull": true,
3115
+ "unique": false,
3116
+ "default": 0
1286
3117
  },
1287
3118
  "status": {
1288
3119
  "type": "TEXT",
1289
3120
  "notNull": false,
1290
3121
  "unique": false
1291
3122
  },
1292
- "submitted_at": {
3123
+ "confirmed_at": {
1293
3124
  "type": "TIMESTAMP",
1294
3125
  "notNull": false,
1295
3126
  "unique": false
1296
3127
  },
1297
- "submitted_by_profile_id": {
3128
+ "confirmed_by_profile_id": {
1298
3129
  "type": "UUID",
1299
3130
  "referenceKind": "crossPackageRef",
1300
3131
  "notNull": false,
1301
3132
  "unique": false
3133
+ }
3134
+ },
3135
+ "indexes": [
3136
+ {
3137
+ "name": "period_timecards_slug_context_idx",
3138
+ "columns": [
3139
+ "tenant_id",
3140
+ "slug",
3141
+ "context"
3142
+ ],
3143
+ "unique": true
1302
3144
  },
1303
- "approved_at": {
3145
+ {
3146
+ "name": "period_timecards_tenant_id_created_at_idx",
3147
+ "columns": [
3148
+ "tenant_id",
3149
+ "created_at"
3150
+ ]
3151
+ },
3152
+ {
3153
+ "name": "period_timecards_profile_id_idx",
3154
+ "columns": [
3155
+ "profile_id"
3156
+ ]
3157
+ },
3158
+ {
3159
+ "name": "period_timecards_confirmed_by_profile_id_idx",
3160
+ "columns": [
3161
+ "confirmed_by_profile_id"
3162
+ ]
3163
+ }
3164
+ ],
3165
+ "version": "8153dc2a"
3166
+ },
3167
+ "importPath": "@happyvertical/smrt-timesheets/rollup"
3168
+ },
3169
+ "@happyvertical/smrt-timesheets:TimecardAdjustmentCollection": {
3170
+ "name": "timecardadjustmentcollection",
3171
+ "className": "TimecardAdjustmentCollection",
3172
+ "qualifiedName": "@happyvertical/smrt-timesheets:TimecardAdjustmentCollection",
3173
+ "collection": "timecardadjustments",
3174
+ "filePath": "/home/runner/work/smrt/smrt/packages/timesheets/src/rollup/models.ts",
3175
+ "packageName": "@happyvertical/smrt-timesheets",
3176
+ "fields": {},
3177
+ "methods": {},
3178
+ "decoratorConfig": {
3179
+ "tableName": "timecard_adjustments"
3180
+ },
3181
+ "extends": "SmrtCollection",
3182
+ "extendsTypeArg": "TimecardAdjustment",
3183
+ "exportName": "TimecardAdjustmentCollection",
3184
+ "collectionExportName": "TimecardAdjustmentCollectionCollection",
3185
+ "schema": {
3186
+ "tableName": "timecard_adjustments",
3187
+ "ddl": "CREATE TABLE IF NOT EXISTS \"timecard_adjustments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"timecard_id\" UUID,\n \"profile_id\" UUID,\n \"actor_profile_id\" UUID,\n \"operation_id\" TEXT,\n \"regular_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"overtime_seconds\" INTEGER NOT NULL DEFAULT 0,\n \"reason\" TEXT\n);",
3188
+ "columns": {
3189
+ "id": {
3190
+ "type": "UUID",
3191
+ "primaryKey": true,
3192
+ "referenceKind": "id",
3193
+ "notNull": true
3194
+ },
3195
+ "slug": {
3196
+ "type": "TEXT",
3197
+ "notNull": true
3198
+ },
3199
+ "context": {
3200
+ "type": "TEXT",
3201
+ "notNull": true,
3202
+ "default": ""
3203
+ },
3204
+ "created_at": {
1304
3205
  "type": "TIMESTAMP",
1305
- "notNull": false,
1306
- "unique": false
3206
+ "notNull": true,
3207
+ "default": "current_timestamp"
1307
3208
  },
1308
- "approved_by_profile_id": {
3209
+ "updated_at": {
3210
+ "type": "TIMESTAMP",
3211
+ "notNull": true,
3212
+ "default": "current_timestamp"
3213
+ },
3214
+ "tenant_id": {
1309
3215
  "type": "UUID",
1310
- "referenceKind": "crossPackageRef",
1311
- "notNull": false,
3216
+ "referenceKind": "tenantId",
3217
+ "notNull": true,
1312
3218
  "unique": false
1313
3219
  },
1314
- "approval_path": {
1315
- "type": "TEXT",
3220
+ "timecard_id": {
3221
+ "type": "UUID",
3222
+ "referenceKind": "foreignKey",
1316
3223
  "notNull": false,
1317
- "unique": false
3224
+ "unique": false,
3225
+ "foreignKey": {
3226
+ "table": "period_timecards",
3227
+ "column": "id",
3228
+ "onDelete": "RESTRICT",
3229
+ "onUpdate": "CASCADE"
3230
+ }
1318
3231
  },
1319
- "rejected_at": {
1320
- "type": "TIMESTAMP",
3232
+ "profile_id": {
3233
+ "type": "UUID",
3234
+ "referenceKind": "crossPackageRef",
1321
3235
  "notNull": false,
1322
3236
  "unique": false
1323
3237
  },
1324
- "rejected_by_profile_id": {
3238
+ "actor_profile_id": {
1325
3239
  "type": "UUID",
1326
3240
  "referenceKind": "crossPackageRef",
1327
3241
  "notNull": false,
1328
3242
  "unique": false
1329
3243
  },
1330
- "rejection_reason": {
3244
+ "operation_id": {
1331
3245
  "type": "TEXT",
1332
3246
  "notNull": false,
1333
3247
  "unique": false
1334
3248
  },
1335
- "correction_of_id": {
1336
- "type": "UUID",
1337
- "referenceKind": "foreignKey",
1338
- "notNull": false,
3249
+ "regular_seconds": {
3250
+ "type": "INTEGER",
3251
+ "notNull": true,
1339
3252
  "unique": false,
1340
- "foreignKey": {
1341
- "table": "service_time_entries",
1342
- "column": "id",
1343
- "onDelete": "NO ACTION",
1344
- "onUpdate": "CASCADE"
1345
- }
3253
+ "default": 0
1346
3254
  },
1347
- "metadata": {
3255
+ "overtime_seconds": {
3256
+ "type": "INTEGER",
3257
+ "notNull": true,
3258
+ "unique": false,
3259
+ "default": 0
3260
+ },
3261
+ "reason": {
1348
3262
  "type": "TEXT",
1349
3263
  "notNull": false,
1350
3264
  "unique": false
@@ -1352,56 +3266,43 @@
1352
3266
  },
1353
3267
  "indexes": [
1354
3268
  {
1355
- "name": "service_time_entries_slug_context_idx",
3269
+ "name": "timecard_adjustments_slug_context_idx",
1356
3270
  "columns": [
1357
3271
  "tenant_id",
1358
3272
  "slug",
1359
3273
  "context"
1360
3274
  ],
1361
- "unique": true,
1362
- "nullsNotDistinct": true
3275
+ "unique": true
1363
3276
  },
1364
3277
  {
1365
- "name": "service_time_entries_tenant_id_created_at_idx",
3278
+ "name": "timecard_adjustments_tenant_id_created_at_idx",
1366
3279
  "columns": [
1367
3280
  "tenant_id",
1368
3281
  "created_at"
1369
3282
  ]
1370
3283
  },
1371
3284
  {
1372
- "name": "service_time_entries_participant_profile_id_idx",
1373
- "columns": [
1374
- "participant_profile_id"
1375
- ]
1376
- },
1377
- {
1378
- "name": "service_time_entries_submitted_by_profile_id_idx",
1379
- "columns": [
1380
- "submitted_by_profile_id"
1381
- ]
1382
- },
1383
- {
1384
- "name": "service_time_entries_approved_by_profile_id_idx",
3285
+ "name": "timecard_adjustments_timecard_id_idx",
1385
3286
  "columns": [
1386
- "approved_by_profile_id"
3287
+ "timecard_id"
1387
3288
  ]
1388
3289
  },
1389
3290
  {
1390
- "name": "service_time_entries_rejected_by_profile_id_idx",
3291
+ "name": "timecard_adjustments_profile_id_idx",
1391
3292
  "columns": [
1392
- "rejected_by_profile_id"
3293
+ "profile_id"
1393
3294
  ]
1394
3295
  },
1395
3296
  {
1396
- "name": "service_time_entries_correction_of_id_idx",
3297
+ "name": "timecard_adjustments_actor_profile_id_idx",
1397
3298
  "columns": [
1398
- "correction_of_id"
3299
+ "actor_profile_id"
1399
3300
  ]
1400
3301
  }
1401
3302
  ],
1402
- "version": "16c0d6c8"
3303
+ "version": "582afe16"
1403
3304
  },
1404
- "importPath": "@happyvertical/smrt-timesheets"
3305
+ "importPath": "@happyvertical/smrt-timesheets/rollup"
1405
3306
  }
1406
3307
  },
1407
3308
  "moduleType": "smrt",