@nuxt-customer-portal/timesheets 0.3.0

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 (141) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +21 -0
  3. package/README.md +5 -0
  4. package/app/assets/timesheets.css +368 -0
  5. package/app/components/TimesheetsActivityForm.vue +61 -0
  6. package/app/components/TimesheetsAdminActivities.vue +323 -0
  7. package/app/components/TimesheetsAdminApprovals.vue +449 -0
  8. package/app/components/TimesheetsAdminEmptyState.vue +28 -0
  9. package/app/components/TimesheetsAdminListToolbar.vue +19 -0
  10. package/app/components/TimesheetsAdminPaginatedList.vue +95 -0
  11. package/app/components/TimesheetsAdminProjects.vue +234 -0
  12. package/app/components/TimesheetsAdminRates.vue +83 -0
  13. package/app/components/TimesheetsAdminReports.vue +123 -0
  14. package/app/components/TimesheetsAdminSectionPage.vue +135 -0
  15. package/app/components/TimesheetsAdminSettings.vue +15 -0
  16. package/app/components/TimesheetsAdministrationOrganizationPanel.vue +26 -0
  17. package/app/components/TimesheetsClientSettingsPanel.vue +52 -0
  18. package/app/components/TimesheetsClientTimesheetBrowser.vue +439 -0
  19. package/app/components/TimesheetsDashboardCard.vue +260 -0
  20. package/app/components/TimesheetsDashboardClientApprovals.vue +1 -0
  21. package/app/components/TimesheetsDashboardInternalApprovals.vue +1 -0
  22. package/app/components/TimesheetsDashboardMyTimesheets.vue +1 -0
  23. package/app/components/TimesheetsDashboardMyWeek.vue +1 -0
  24. package/app/components/TimesheetsDashboardSupplierTimesheets.vue +47 -0
  25. package/app/components/TimesheetsOrganizationFeaturesCard.vue +66 -0
  26. package/app/components/TimesheetsPageShell.vue +48 -0
  27. package/app/components/TimesheetsProjectDetail.vue +338 -0
  28. package/app/components/TimesheetsProjectForm.vue +215 -0
  29. package/app/components/TimesheetsSetupChecklist.vue +48 -0
  30. package/app/components/TimesheetsSubmissionMessages.vue +30 -0
  31. package/app/components/TimesheetsSubmissionTimeline.vue +89 -0
  32. package/app/components/TimesheetsWorkspaceSettingsForm.vue +80 -0
  33. package/app/composables/useTimesheetMenu.ts +69 -0
  34. package/app/composables/useTimesheetMutationError.ts +35 -0
  35. package/app/composables/useTimesheets.ts +248 -0
  36. package/app/composables/useTimesheetsAdminList.ts +165 -0
  37. package/app/composables/useTimesheetsDashboard.ts +8 -0
  38. package/app/pages/admin/timesheets/activities.vue +3 -0
  39. package/app/pages/admin/timesheets/approvals.vue +3 -0
  40. package/app/pages/admin/timesheets/index.vue +7 -0
  41. package/app/pages/admin/timesheets/internal-approvals.vue +131 -0
  42. package/app/pages/admin/timesheets/projects/[id].vue +57 -0
  43. package/app/pages/admin/timesheets/projects.vue +8 -0
  44. package/app/pages/admin/timesheets/rates.vue +3 -0
  45. package/app/pages/admin/timesheets/reports.vue +3 -0
  46. package/app/pages/admin/timesheets/settings.vue +3 -0
  47. package/app/pages/timesheets/approvals/reviewers.vue +96 -0
  48. package/app/pages/timesheets/approvals.vue +11 -0
  49. package/app/pages/timesheets/client-approvals.vue +108 -0
  50. package/app/pages/timesheets/client.vue +17 -0
  51. package/app/pages/timesheets/index.vue +1458 -0
  52. package/app/pages/timesheets/internal-approvals.vue +100 -0
  53. package/app/pages/timesheets/suppliers.vue +23 -0
  54. package/app/plugins/timesheets-feature.ts +122 -0
  55. package/i18n/locales/en.json +455 -0
  56. package/i18n/locales/nl.json +455 -0
  57. package/migrations/0000_baseline.sql +409 -0
  58. package/migrations/0001_remove_unused_legacy_invoice_schema.sql +31 -0
  59. package/migrations/0002_submission_batches.sql +47 -0
  60. package/migrations/0003_sync_provider_clients.sql +26 -0
  61. package/migrations/0004_client_reply.sql +1 -0
  62. package/migrations/0005_timer_rounding.sql +1 -0
  63. package/migrations/meta/0000_snapshot.json +3178 -0
  64. package/migrations/meta/_journal.json +13 -0
  65. package/nuxt.config.ts +20 -0
  66. package/package.json +61 -0
  67. package/portal.manifest.mjs +10 -0
  68. package/server/api/timesheets/admin/activities/[id]/deletion.get.ts +18 -0
  69. package/server/api/timesheets/admin/activities/[id].delete.ts +20 -0
  70. package/server/api/timesheets/admin/activities/[id].patch.ts +19 -0
  71. package/server/api/timesheets/admin/activities/index.get.ts +19 -0
  72. package/server/api/timesheets/admin/activities/index.post.ts +19 -0
  73. package/server/api/timesheets/admin/approvals/[id].post.ts +19 -0
  74. package/server/api/timesheets/admin/bootstrap.get.ts +73 -0
  75. package/server/api/timesheets/admin/client-settings/[clientId]/index.get.ts +25 -0
  76. package/server/api/timesheets/admin/client-settings/[clientId]/index.put.ts +28 -0
  77. package/server/api/timesheets/admin/clients/[id]/deletion.get.ts +18 -0
  78. package/server/api/timesheets/admin/clients/[id].delete.ts +20 -0
  79. package/server/api/timesheets/admin/clients/[id].patch.ts +14 -0
  80. package/server/api/timesheets/admin/clients/index.get.ts +18 -0
  81. package/server/api/timesheets/admin/clients/index.post.ts +25 -0
  82. package/server/api/timesheets/admin/internal-approvals/[userId].put.ts +11 -0
  83. package/server/api/timesheets/admin/internal-approvals/index.get.ts +8 -0
  84. package/server/api/timesheets/admin/internal-approvals/index.patch.ts +11 -0
  85. package/server/api/timesheets/admin/organization-capabilities/[organizationId].get.ts +19 -0
  86. package/server/api/timesheets/admin/organization-capabilities/[organizationId].patch.ts +23 -0
  87. package/server/api/timesheets/admin/projects/[id]/deletion.get.ts +18 -0
  88. package/server/api/timesheets/admin/projects/[id].delete.ts +20 -0
  89. package/server/api/timesheets/admin/projects/[id].get.ts +22 -0
  90. package/server/api/timesheets/admin/projects/[id].patch.ts +19 -0
  91. package/server/api/timesheets/admin/projects/index.get.ts +18 -0
  92. package/server/api/timesheets/admin/projects/index.post.ts +19 -0
  93. package/server/api/timesheets/admin/report.get.ts +26 -0
  94. package/server/api/timesheets/admin/settings.patch.ts +19 -0
  95. package/server/api/timesheets/admin/tariffs/index.put.ts +20 -0
  96. package/server/api/timesheets/admin/team/[userId].put.ts +24 -0
  97. package/server/api/timesheets/bootstrap.get.ts +24 -0
  98. package/server/api/timesheets/capabilities.get.ts +58 -0
  99. package/server/api/timesheets/client/[workspaceClientId]/index.get.ts +12 -0
  100. package/server/api/timesheets/client/[workspaceClientId]/reviewers.get.ts +10 -0
  101. package/server/api/timesheets/client/[workspaceClientId]/reviewers.put.ts +18 -0
  102. package/server/api/timesheets/client/[workspaceClientId]/reviews/[submissionId].post.ts +18 -0
  103. package/server/api/timesheets/client/approval-members.get.ts +11 -0
  104. package/server/api/timesheets/client/approval-suppliers.get.ts +8 -0
  105. package/server/api/timesheets/client/approvals.get.ts +14 -0
  106. package/server/api/timesheets/client/reviewer-suppliers.get.ts +10 -0
  107. package/server/api/timesheets/client/supplier-options.get.ts +14 -0
  108. package/server/api/timesheets/client/supplier-timesheets.get.ts +17 -0
  109. package/server/api/timesheets/client/workspaces.get.ts +11 -0
  110. package/server/api/timesheets/client-approvals.get.ts +18 -0
  111. package/server/api/timesheets/dashboard.get.ts +191 -0
  112. package/server/api/timesheets/entries/[id].delete.ts +18 -0
  113. package/server/api/timesheets/entries/[id].patch.ts +23 -0
  114. package/server/api/timesheets/entries/index.post.ts +22 -0
  115. package/server/api/timesheets/internal-approvals/[id].post.ts +9 -0
  116. package/server/api/timesheets/internal-approvals/index.get.ts +37 -0
  117. package/server/api/timesheets/internal-approvals/list.get.ts +12 -0
  118. package/server/api/timesheets/setup-status.get.ts +21 -0
  119. package/server/api/timesheets/submissions/[id]/client-reply.post.ts +20 -0
  120. package/server/api/timesheets/submissions/[id]/request-client-approval.post.ts +21 -0
  121. package/server/api/timesheets/submissions/[id]/resubmit.post.ts +10 -0
  122. package/server/api/timesheets/timer/index.delete.ts +18 -0
  123. package/server/api/timesheets/timer/index.post.ts +23 -0
  124. package/server/api/timesheets/weeks/[id]/submissions.post.ts +19 -0
  125. package/server/db/schema/timesheets.ts +383 -0
  126. package/server/plugins/client-sync.ts +30 -0
  127. package/server/plugins/openapi-contracts.ts +57 -0
  128. package/server/utils/timesheet-admin-listing.ts +281 -0
  129. package/server/utils/timesheet-email.ts +221 -0
  130. package/server/utils/timesheet-repository.ts +3096 -0
  131. package/server/utils/timesheet-validation.ts +231 -0
  132. package/shared/client-approval-dashboard.ts +17 -0
  133. package/shared/emails.ts +403 -0
  134. package/shared/feature.ts +184 -0
  135. package/shared/period-lock.ts +8 -0
  136. package/shared/submission-reply.ts +3 -0
  137. package/shared/timer-rounding.ts +2 -0
  138. package/shared/timesheet-dates.ts +23 -0
  139. package/shared/timesheet-errors.ts +13 -0
  140. package/shared/types/timesheet.ts +424 -0
  141. package/tokens.css +25 -0
@@ -0,0 +1,3178 @@
1
+ {
2
+ "id": "0720f9d8-f26f-44c1-973b-3e7095a81798",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "timesheets.activity_type": {
8
+ "name": "activity_type",
9
+ "schema": "timesheets",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "organization_id": {
18
+ "name": "organization_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "name": {
24
+ "name": "name",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "billable": {
30
+ "name": "billable",
31
+ "type": "boolean",
32
+ "primaryKey": false,
33
+ "notNull": true,
34
+ "default": true
35
+ },
36
+ "active": {
37
+ "name": "active",
38
+ "type": "boolean",
39
+ "primaryKey": false,
40
+ "notNull": true,
41
+ "default": true
42
+ },
43
+ "created_at": {
44
+ "name": "created_at",
45
+ "type": "timestamp",
46
+ "primaryKey": false,
47
+ "notNull": true,
48
+ "default": "now()"
49
+ },
50
+ "updated_at": {
51
+ "name": "updated_at",
52
+ "type": "timestamp",
53
+ "primaryKey": false,
54
+ "notNull": true,
55
+ "default": "now()"
56
+ }
57
+ },
58
+ "indexes": {
59
+ "activity_type_org_name_uidx": {
60
+ "name": "activity_type_org_name_uidx",
61
+ "columns": [
62
+ {
63
+ "expression": "organization_id",
64
+ "isExpression": false,
65
+ "asc": true,
66
+ "nulls": "last"
67
+ },
68
+ {
69
+ "expression": "name",
70
+ "isExpression": false,
71
+ "asc": true,
72
+ "nulls": "last"
73
+ }
74
+ ],
75
+ "isUnique": true,
76
+ "concurrently": false,
77
+ "method": "btree",
78
+ "with": {}
79
+ },
80
+ "activity_type_org_idx": {
81
+ "name": "activity_type_org_idx",
82
+ "columns": [
83
+ {
84
+ "expression": "organization_id",
85
+ "isExpression": false,
86
+ "asc": true,
87
+ "nulls": "last"
88
+ }
89
+ ],
90
+ "isUnique": false,
91
+ "concurrently": false,
92
+ "method": "btree",
93
+ "with": {}
94
+ }
95
+ },
96
+ "foreignKeys": {
97
+ "activity_type_organization_id_organization_id_fk": {
98
+ "name": "activity_type_organization_id_organization_id_fk",
99
+ "tableFrom": "activity_type",
100
+ "tableTo": "organization",
101
+ "columnsFrom": ["organization_id"],
102
+ "columnsTo": ["id"],
103
+ "onDelete": "cascade",
104
+ "onUpdate": "no action"
105
+ }
106
+ },
107
+ "compositePrimaryKeys": {},
108
+ "uniqueConstraints": {},
109
+ "policies": {},
110
+ "checkConstraints": {},
111
+ "isRLSEnabled": false
112
+ },
113
+ "timesheets.internal_approver_assignment": {
114
+ "name": "internal_approver_assignment",
115
+ "schema": "timesheets",
116
+ "columns": {
117
+ "id": {
118
+ "name": "id",
119
+ "type": "text",
120
+ "primaryKey": true,
121
+ "notNull": true
122
+ },
123
+ "organization_id": {
124
+ "name": "organization_id",
125
+ "type": "text",
126
+ "primaryKey": false,
127
+ "notNull": true
128
+ },
129
+ "submitter_user_id": {
130
+ "name": "submitter_user_id",
131
+ "type": "text",
132
+ "primaryKey": false,
133
+ "notNull": true
134
+ },
135
+ "approver_user_id": {
136
+ "name": "approver_user_id",
137
+ "type": "text",
138
+ "primaryKey": false,
139
+ "notNull": true
140
+ },
141
+ "created_by_id": {
142
+ "name": "created_by_id",
143
+ "type": "text",
144
+ "primaryKey": false,
145
+ "notNull": true
146
+ },
147
+ "created_at": {
148
+ "name": "created_at",
149
+ "type": "timestamp",
150
+ "primaryKey": false,
151
+ "notNull": true,
152
+ "default": "now()"
153
+ }
154
+ },
155
+ "indexes": {
156
+ "internal_approver_assignment_org_submitter_approver_uidx": {
157
+ "name": "internal_approver_assignment_org_submitter_approver_uidx",
158
+ "columns": [
159
+ {
160
+ "expression": "organization_id",
161
+ "isExpression": false,
162
+ "asc": true,
163
+ "nulls": "last"
164
+ },
165
+ {
166
+ "expression": "submitter_user_id",
167
+ "isExpression": false,
168
+ "asc": true,
169
+ "nulls": "last"
170
+ },
171
+ {
172
+ "expression": "approver_user_id",
173
+ "isExpression": false,
174
+ "asc": true,
175
+ "nulls": "last"
176
+ }
177
+ ],
178
+ "isUnique": true,
179
+ "concurrently": false,
180
+ "method": "btree",
181
+ "with": {}
182
+ },
183
+ "internal_approver_assignment_approver_idx": {
184
+ "name": "internal_approver_assignment_approver_idx",
185
+ "columns": [
186
+ {
187
+ "expression": "organization_id",
188
+ "isExpression": false,
189
+ "asc": true,
190
+ "nulls": "last"
191
+ },
192
+ {
193
+ "expression": "approver_user_id",
194
+ "isExpression": false,
195
+ "asc": true,
196
+ "nulls": "last"
197
+ }
198
+ ],
199
+ "isUnique": false,
200
+ "concurrently": false,
201
+ "method": "btree",
202
+ "with": {}
203
+ },
204
+ "internal_approver_assignment_submitter_idx": {
205
+ "name": "internal_approver_assignment_submitter_idx",
206
+ "columns": [
207
+ {
208
+ "expression": "organization_id",
209
+ "isExpression": false,
210
+ "asc": true,
211
+ "nulls": "last"
212
+ },
213
+ {
214
+ "expression": "submitter_user_id",
215
+ "isExpression": false,
216
+ "asc": true,
217
+ "nulls": "last"
218
+ }
219
+ ],
220
+ "isUnique": false,
221
+ "concurrently": false,
222
+ "method": "btree",
223
+ "with": {}
224
+ }
225
+ },
226
+ "foreignKeys": {
227
+ "internal_approver_assignment_organization_id_organization_id_fk": {
228
+ "name": "internal_approver_assignment_organization_id_organization_id_fk",
229
+ "tableFrom": "internal_approver_assignment",
230
+ "tableTo": "organization",
231
+ "columnsFrom": ["organization_id"],
232
+ "columnsTo": ["id"],
233
+ "onDelete": "cascade",
234
+ "onUpdate": "no action"
235
+ },
236
+ "internal_approver_assignment_submitter_user_id_user_id_fk": {
237
+ "name": "internal_approver_assignment_submitter_user_id_user_id_fk",
238
+ "tableFrom": "internal_approver_assignment",
239
+ "tableTo": "user",
240
+ "columnsFrom": ["submitter_user_id"],
241
+ "columnsTo": ["id"],
242
+ "onDelete": "cascade",
243
+ "onUpdate": "no action"
244
+ },
245
+ "internal_approver_assignment_approver_user_id_user_id_fk": {
246
+ "name": "internal_approver_assignment_approver_user_id_user_id_fk",
247
+ "tableFrom": "internal_approver_assignment",
248
+ "tableTo": "user",
249
+ "columnsFrom": ["approver_user_id"],
250
+ "columnsTo": ["id"],
251
+ "onDelete": "cascade",
252
+ "onUpdate": "no action"
253
+ },
254
+ "internal_approver_assignment_created_by_id_user_id_fk": {
255
+ "name": "internal_approver_assignment_created_by_id_user_id_fk",
256
+ "tableFrom": "internal_approver_assignment",
257
+ "tableTo": "user",
258
+ "columnsFrom": ["created_by_id"],
259
+ "columnsTo": ["id"],
260
+ "onDelete": "restrict",
261
+ "onUpdate": "no action"
262
+ }
263
+ },
264
+ "compositePrimaryKeys": {},
265
+ "uniqueConstraints": {},
266
+ "policies": {},
267
+ "checkConstraints": {},
268
+ "isRLSEnabled": false
269
+ },
270
+ "timesheets.invoice": {
271
+ "name": "invoice",
272
+ "schema": "timesheets",
273
+ "columns": {
274
+ "id": {
275
+ "name": "id",
276
+ "type": "text",
277
+ "primaryKey": true,
278
+ "notNull": true
279
+ },
280
+ "organization_id": {
281
+ "name": "organization_id",
282
+ "type": "text",
283
+ "primaryKey": false,
284
+ "notNull": true
285
+ },
286
+ "client_organization_id": {
287
+ "name": "client_organization_id",
288
+ "type": "text",
289
+ "primaryKey": false,
290
+ "notNull": false
291
+ },
292
+ "number": {
293
+ "name": "number",
294
+ "type": "text",
295
+ "primaryKey": false,
296
+ "notNull": true
297
+ },
298
+ "status": {
299
+ "name": "status",
300
+ "type": "invoice_status",
301
+ "typeSchema": "timesheets",
302
+ "primaryKey": false,
303
+ "notNull": true,
304
+ "default": "'DRAFT'"
305
+ },
306
+ "currency": {
307
+ "name": "currency",
308
+ "type": "text",
309
+ "primaryKey": false,
310
+ "notNull": true
311
+ },
312
+ "issue_date": {
313
+ "name": "issue_date",
314
+ "type": "date",
315
+ "primaryKey": false,
316
+ "notNull": true
317
+ },
318
+ "due_date": {
319
+ "name": "due_date",
320
+ "type": "date",
321
+ "primaryKey": false,
322
+ "notNull": true
323
+ },
324
+ "subject": {
325
+ "name": "subject",
326
+ "type": "text",
327
+ "primaryKey": false,
328
+ "notNull": false
329
+ },
330
+ "notes": {
331
+ "name": "notes",
332
+ "type": "text",
333
+ "primaryKey": false,
334
+ "notNull": false
335
+ },
336
+ "sender_name": {
337
+ "name": "sender_name",
338
+ "type": "text",
339
+ "primaryKey": false,
340
+ "notNull": true
341
+ },
342
+ "sender_logo": {
343
+ "name": "sender_logo",
344
+ "type": "text",
345
+ "primaryKey": false,
346
+ "notNull": false
347
+ },
348
+ "sender_address": {
349
+ "name": "sender_address",
350
+ "type": "text",
351
+ "primaryKey": false,
352
+ "notNull": true
353
+ },
354
+ "sender_registration": {
355
+ "name": "sender_registration",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": false
359
+ },
360
+ "sender_vat_number": {
361
+ "name": "sender_vat_number",
362
+ "type": "text",
363
+ "primaryKey": false,
364
+ "notNull": false
365
+ },
366
+ "sender_iban": {
367
+ "name": "sender_iban",
368
+ "type": "text",
369
+ "primaryKey": false,
370
+ "notNull": false
371
+ },
372
+ "sender_bic": {
373
+ "name": "sender_bic",
374
+ "type": "text",
375
+ "primaryKey": false,
376
+ "notNull": false
377
+ },
378
+ "recipient_name": {
379
+ "name": "recipient_name",
380
+ "type": "text",
381
+ "primaryKey": false,
382
+ "notNull": true
383
+ },
384
+ "recipient_address": {
385
+ "name": "recipient_address",
386
+ "type": "text",
387
+ "primaryKey": false,
388
+ "notNull": true
389
+ },
390
+ "recipient_contact_name": {
391
+ "name": "recipient_contact_name",
392
+ "type": "text",
393
+ "primaryKey": false,
394
+ "notNull": false
395
+ },
396
+ "recipient_email": {
397
+ "name": "recipient_email",
398
+ "type": "text",
399
+ "primaryKey": false,
400
+ "notNull": false
401
+ },
402
+ "recipient_locale": {
403
+ "name": "recipient_locale",
404
+ "type": "text",
405
+ "primaryKey": false,
406
+ "notNull": true,
407
+ "default": "'nl'"
408
+ },
409
+ "created_by_id": {
410
+ "name": "created_by_id",
411
+ "type": "text",
412
+ "primaryKey": false,
413
+ "notNull": true
414
+ },
415
+ "issued_at": {
416
+ "name": "issued_at",
417
+ "type": "timestamp",
418
+ "primaryKey": false,
419
+ "notNull": false
420
+ },
421
+ "created_at": {
422
+ "name": "created_at",
423
+ "type": "timestamp",
424
+ "primaryKey": false,
425
+ "notNull": true,
426
+ "default": "now()"
427
+ },
428
+ "updated_at": {
429
+ "name": "updated_at",
430
+ "type": "timestamp",
431
+ "primaryKey": false,
432
+ "notNull": true,
433
+ "default": "now()"
434
+ }
435
+ },
436
+ "indexes": {
437
+ "invoice_org_number_uidx": {
438
+ "name": "invoice_org_number_uidx",
439
+ "columns": [
440
+ {
441
+ "expression": "organization_id",
442
+ "isExpression": false,
443
+ "asc": true,
444
+ "nulls": "last"
445
+ },
446
+ {
447
+ "expression": "number",
448
+ "isExpression": false,
449
+ "asc": true,
450
+ "nulls": "last"
451
+ }
452
+ ],
453
+ "isUnique": true,
454
+ "concurrently": false,
455
+ "method": "btree",
456
+ "with": {}
457
+ },
458
+ "invoice_org_status_idx": {
459
+ "name": "invoice_org_status_idx",
460
+ "columns": [
461
+ {
462
+ "expression": "organization_id",
463
+ "isExpression": false,
464
+ "asc": true,
465
+ "nulls": "last"
466
+ },
467
+ {
468
+ "expression": "status",
469
+ "isExpression": false,
470
+ "asc": true,
471
+ "nulls": "last"
472
+ }
473
+ ],
474
+ "isUnique": false,
475
+ "concurrently": false,
476
+ "method": "btree",
477
+ "with": {}
478
+ },
479
+ "invoice_client_idx": {
480
+ "name": "invoice_client_idx",
481
+ "columns": [
482
+ {
483
+ "expression": "client_organization_id",
484
+ "isExpression": false,
485
+ "asc": true,
486
+ "nulls": "last"
487
+ }
488
+ ],
489
+ "isUnique": false,
490
+ "concurrently": false,
491
+ "method": "btree",
492
+ "with": {}
493
+ }
494
+ },
495
+ "foreignKeys": {
496
+ "invoice_organization_id_organization_id_fk": {
497
+ "name": "invoice_organization_id_organization_id_fk",
498
+ "tableFrom": "invoice",
499
+ "tableTo": "organization",
500
+ "columnsFrom": ["organization_id"],
501
+ "columnsTo": ["id"],
502
+ "onDelete": "cascade",
503
+ "onUpdate": "no action"
504
+ },
505
+ "invoice_client_organization_id_organization_id_fk": {
506
+ "name": "invoice_client_organization_id_organization_id_fk",
507
+ "tableFrom": "invoice",
508
+ "tableTo": "organization",
509
+ "columnsFrom": ["client_organization_id"],
510
+ "columnsTo": ["id"],
511
+ "onDelete": "restrict",
512
+ "onUpdate": "no action"
513
+ },
514
+ "invoice_created_by_id_user_id_fk": {
515
+ "name": "invoice_created_by_id_user_id_fk",
516
+ "tableFrom": "invoice",
517
+ "tableTo": "user",
518
+ "columnsFrom": ["created_by_id"],
519
+ "columnsTo": ["id"],
520
+ "onDelete": "restrict",
521
+ "onUpdate": "no action"
522
+ }
523
+ },
524
+ "compositePrimaryKeys": {},
525
+ "uniqueConstraints": {},
526
+ "policies": {},
527
+ "checkConstraints": {},
528
+ "isRLSEnabled": false
529
+ },
530
+ "timesheets.invoice_attachment": {
531
+ "name": "invoice_attachment",
532
+ "schema": "timesheets",
533
+ "columns": {
534
+ "id": {
535
+ "name": "id",
536
+ "type": "text",
537
+ "primaryKey": true,
538
+ "notNull": true
539
+ },
540
+ "invoice_id": {
541
+ "name": "invoice_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true
545
+ },
546
+ "file_name": {
547
+ "name": "file_name",
548
+ "type": "text",
549
+ "primaryKey": false,
550
+ "notNull": true
551
+ },
552
+ "content_type": {
553
+ "name": "content_type",
554
+ "type": "text",
555
+ "primaryKey": false,
556
+ "notNull": true
557
+ },
558
+ "size": {
559
+ "name": "size",
560
+ "type": "integer",
561
+ "primaryKey": false,
562
+ "notNull": true
563
+ },
564
+ "content_base64": {
565
+ "name": "content_base64",
566
+ "type": "text",
567
+ "primaryKey": false,
568
+ "notNull": true
569
+ },
570
+ "uploaded_by_id": {
571
+ "name": "uploaded_by_id",
572
+ "type": "text",
573
+ "primaryKey": false,
574
+ "notNull": true
575
+ },
576
+ "created_at": {
577
+ "name": "created_at",
578
+ "type": "timestamp",
579
+ "primaryKey": false,
580
+ "notNull": true,
581
+ "default": "now()"
582
+ }
583
+ },
584
+ "indexes": {
585
+ "invoice_attachment_invoice_idx": {
586
+ "name": "invoice_attachment_invoice_idx",
587
+ "columns": [
588
+ {
589
+ "expression": "invoice_id",
590
+ "isExpression": false,
591
+ "asc": true,
592
+ "nulls": "last"
593
+ }
594
+ ],
595
+ "isUnique": false,
596
+ "concurrently": false,
597
+ "method": "btree",
598
+ "with": {}
599
+ }
600
+ },
601
+ "foreignKeys": {
602
+ "invoice_attachment_invoice_id_invoice_id_fk": {
603
+ "name": "invoice_attachment_invoice_id_invoice_id_fk",
604
+ "tableFrom": "invoice_attachment",
605
+ "tableTo": "invoice",
606
+ "schemaTo": "timesheets",
607
+ "columnsFrom": ["invoice_id"],
608
+ "columnsTo": ["id"],
609
+ "onDelete": "cascade",
610
+ "onUpdate": "no action"
611
+ },
612
+ "invoice_attachment_uploaded_by_id_user_id_fk": {
613
+ "name": "invoice_attachment_uploaded_by_id_user_id_fk",
614
+ "tableFrom": "invoice_attachment",
615
+ "tableTo": "user",
616
+ "columnsFrom": ["uploaded_by_id"],
617
+ "columnsTo": ["id"],
618
+ "onDelete": "restrict",
619
+ "onUpdate": "no action"
620
+ }
621
+ },
622
+ "compositePrimaryKeys": {},
623
+ "uniqueConstraints": {},
624
+ "policies": {},
625
+ "checkConstraints": {},
626
+ "isRLSEnabled": false
627
+ },
628
+ "timesheets.invoice_email_delivery": {
629
+ "name": "invoice_email_delivery",
630
+ "schema": "timesheets",
631
+ "columns": {
632
+ "id": {
633
+ "name": "id",
634
+ "type": "text",
635
+ "primaryKey": true,
636
+ "notNull": true
637
+ },
638
+ "invoice_id": {
639
+ "name": "invoice_id",
640
+ "type": "text",
641
+ "primaryKey": false,
642
+ "notNull": true
643
+ },
644
+ "status": {
645
+ "name": "status",
646
+ "type": "invoice_email_delivery_status",
647
+ "typeSchema": "timesheets",
648
+ "primaryKey": false,
649
+ "notNull": true,
650
+ "default": "'PENDING'"
651
+ },
652
+ "purpose": {
653
+ "name": "purpose",
654
+ "type": "invoice_email_purpose",
655
+ "typeSchema": "timesheets",
656
+ "primaryKey": false,
657
+ "notNull": true,
658
+ "default": "'INVOICE'"
659
+ },
660
+ "recipient_email": {
661
+ "name": "recipient_email",
662
+ "type": "text",
663
+ "primaryKey": false,
664
+ "notNull": true
665
+ },
666
+ "cc_emails": {
667
+ "name": "cc_emails",
668
+ "type": "text",
669
+ "primaryKey": false,
670
+ "notNull": true,
671
+ "default": "'[]'"
672
+ },
673
+ "locale": {
674
+ "name": "locale",
675
+ "type": "text",
676
+ "primaryKey": false,
677
+ "notNull": true
678
+ },
679
+ "subject": {
680
+ "name": "subject",
681
+ "type": "text",
682
+ "primaryKey": false,
683
+ "notNull": true
684
+ },
685
+ "body": {
686
+ "name": "body",
687
+ "type": "text",
688
+ "primaryKey": false,
689
+ "notNull": true
690
+ },
691
+ "actor_user_id": {
692
+ "name": "actor_user_id",
693
+ "type": "text",
694
+ "primaryKey": false,
695
+ "notNull": true
696
+ },
697
+ "provider_message_id": {
698
+ "name": "provider_message_id",
699
+ "type": "text",
700
+ "primaryKey": false,
701
+ "notNull": false
702
+ },
703
+ "provider_last_event": {
704
+ "name": "provider_last_event",
705
+ "type": "text",
706
+ "primaryKey": false,
707
+ "notNull": false
708
+ },
709
+ "provider_status_checked_at": {
710
+ "name": "provider_status_checked_at",
711
+ "type": "timestamp",
712
+ "primaryKey": false,
713
+ "notNull": false
714
+ },
715
+ "error_message": {
716
+ "name": "error_message",
717
+ "type": "text",
718
+ "primaryKey": false,
719
+ "notNull": false
720
+ },
721
+ "payload_hash": {
722
+ "name": "payload_hash",
723
+ "type": "text",
724
+ "primaryKey": false,
725
+ "notNull": true
726
+ },
727
+ "created_at": {
728
+ "name": "created_at",
729
+ "type": "timestamp",
730
+ "primaryKey": false,
731
+ "notNull": true,
732
+ "default": "now()"
733
+ },
734
+ "updated_at": {
735
+ "name": "updated_at",
736
+ "type": "timestamp",
737
+ "primaryKey": false,
738
+ "notNull": true,
739
+ "default": "now()"
740
+ },
741
+ "sent_at": {
742
+ "name": "sent_at",
743
+ "type": "timestamp",
744
+ "primaryKey": false,
745
+ "notNull": false
746
+ }
747
+ },
748
+ "indexes": {
749
+ "invoice_email_delivery_invoice_idx": {
750
+ "name": "invoice_email_delivery_invoice_idx",
751
+ "columns": [
752
+ {
753
+ "expression": "invoice_id",
754
+ "isExpression": false,
755
+ "asc": true,
756
+ "nulls": "last"
757
+ },
758
+ {
759
+ "expression": "created_at",
760
+ "isExpression": false,
761
+ "asc": true,
762
+ "nulls": "last"
763
+ }
764
+ ],
765
+ "isUnique": false,
766
+ "concurrently": false,
767
+ "method": "btree",
768
+ "with": {}
769
+ },
770
+ "invoice_email_delivery_pending_invoice_uidx": {
771
+ "name": "invoice_email_delivery_pending_invoice_uidx",
772
+ "columns": [
773
+ {
774
+ "expression": "invoice_id",
775
+ "isExpression": false,
776
+ "asc": true,
777
+ "nulls": "last"
778
+ }
779
+ ],
780
+ "isUnique": true,
781
+ "where": "\"timesheets\".\"invoice_email_delivery\".\"status\" = 'PENDING'",
782
+ "concurrently": false,
783
+ "method": "btree",
784
+ "with": {}
785
+ }
786
+ },
787
+ "foreignKeys": {
788
+ "invoice_email_delivery_invoice_id_invoice_id_fk": {
789
+ "name": "invoice_email_delivery_invoice_id_invoice_id_fk",
790
+ "tableFrom": "invoice_email_delivery",
791
+ "tableTo": "invoice",
792
+ "schemaTo": "timesheets",
793
+ "columnsFrom": ["invoice_id"],
794
+ "columnsTo": ["id"],
795
+ "onDelete": "cascade",
796
+ "onUpdate": "no action"
797
+ },
798
+ "invoice_email_delivery_actor_user_id_user_id_fk": {
799
+ "name": "invoice_email_delivery_actor_user_id_user_id_fk",
800
+ "tableFrom": "invoice_email_delivery",
801
+ "tableTo": "user",
802
+ "columnsFrom": ["actor_user_id"],
803
+ "columnsTo": ["id"],
804
+ "onDelete": "restrict",
805
+ "onUpdate": "no action"
806
+ }
807
+ },
808
+ "compositePrimaryKeys": {},
809
+ "uniqueConstraints": {},
810
+ "policies": {},
811
+ "checkConstraints": {},
812
+ "isRLSEnabled": false
813
+ },
814
+ "timesheets.invoice_history": {
815
+ "name": "invoice_history",
816
+ "schema": "timesheets",
817
+ "columns": {
818
+ "id": {
819
+ "name": "id",
820
+ "type": "text",
821
+ "primaryKey": true,
822
+ "notNull": true
823
+ },
824
+ "invoice_id": {
825
+ "name": "invoice_id",
826
+ "type": "text",
827
+ "primaryKey": false,
828
+ "notNull": true
829
+ },
830
+ "action": {
831
+ "name": "action",
832
+ "type": "text",
833
+ "primaryKey": false,
834
+ "notNull": true
835
+ },
836
+ "actor_user_id": {
837
+ "name": "actor_user_id",
838
+ "type": "text",
839
+ "primaryKey": false,
840
+ "notNull": true
841
+ },
842
+ "amount_minor": {
843
+ "name": "amount_minor",
844
+ "type": "integer",
845
+ "primaryKey": false,
846
+ "notNull": false
847
+ },
848
+ "attachment_name": {
849
+ "name": "attachment_name",
850
+ "type": "text",
851
+ "primaryKey": false,
852
+ "notNull": false
853
+ },
854
+ "created_at": {
855
+ "name": "created_at",
856
+ "type": "timestamp",
857
+ "primaryKey": false,
858
+ "notNull": true,
859
+ "default": "now()"
860
+ }
861
+ },
862
+ "indexes": {
863
+ "invoice_history_invoice_idx": {
864
+ "name": "invoice_history_invoice_idx",
865
+ "columns": [
866
+ {
867
+ "expression": "invoice_id",
868
+ "isExpression": false,
869
+ "asc": true,
870
+ "nulls": "last"
871
+ }
872
+ ],
873
+ "isUnique": false,
874
+ "concurrently": false,
875
+ "method": "btree",
876
+ "with": {}
877
+ }
878
+ },
879
+ "foreignKeys": {
880
+ "invoice_history_invoice_id_invoice_id_fk": {
881
+ "name": "invoice_history_invoice_id_invoice_id_fk",
882
+ "tableFrom": "invoice_history",
883
+ "tableTo": "invoice",
884
+ "schemaTo": "timesheets",
885
+ "columnsFrom": ["invoice_id"],
886
+ "columnsTo": ["id"],
887
+ "onDelete": "cascade",
888
+ "onUpdate": "no action"
889
+ },
890
+ "invoice_history_actor_user_id_user_id_fk": {
891
+ "name": "invoice_history_actor_user_id_user_id_fk",
892
+ "tableFrom": "invoice_history",
893
+ "tableTo": "user",
894
+ "columnsFrom": ["actor_user_id"],
895
+ "columnsTo": ["id"],
896
+ "onDelete": "restrict",
897
+ "onUpdate": "no action"
898
+ }
899
+ },
900
+ "compositePrimaryKeys": {},
901
+ "uniqueConstraints": {},
902
+ "policies": {},
903
+ "checkConstraints": {},
904
+ "isRLSEnabled": false
905
+ },
906
+ "timesheets.invoice_line": {
907
+ "name": "invoice_line",
908
+ "schema": "timesheets",
909
+ "columns": {
910
+ "id": {
911
+ "name": "id",
912
+ "type": "text",
913
+ "primaryKey": true,
914
+ "notNull": true
915
+ },
916
+ "invoice_id": {
917
+ "name": "invoice_id",
918
+ "type": "text",
919
+ "primaryKey": false,
920
+ "notNull": true
921
+ },
922
+ "position": {
923
+ "name": "position",
924
+ "type": "integer",
925
+ "primaryKey": false,
926
+ "notNull": true
927
+ },
928
+ "description": {
929
+ "name": "description",
930
+ "type": "text",
931
+ "primaryKey": false,
932
+ "notNull": true
933
+ },
934
+ "quantity_milli": {
935
+ "name": "quantity_milli",
936
+ "type": "integer",
937
+ "primaryKey": false,
938
+ "notNull": true
939
+ },
940
+ "unit": {
941
+ "name": "unit",
942
+ "type": "text",
943
+ "primaryKey": false,
944
+ "notNull": true,
945
+ "default": "'hour'"
946
+ },
947
+ "unit_price_minor": {
948
+ "name": "unit_price_minor",
949
+ "type": "integer",
950
+ "primaryKey": false,
951
+ "notNull": true
952
+ },
953
+ "vat_rate_basis_points": {
954
+ "name": "vat_rate_basis_points",
955
+ "type": "integer",
956
+ "primaryKey": false,
957
+ "notNull": true,
958
+ "default": 2100
959
+ }
960
+ },
961
+ "indexes": {
962
+ "invoice_line_invoice_idx": {
963
+ "name": "invoice_line_invoice_idx",
964
+ "columns": [
965
+ {
966
+ "expression": "invoice_id",
967
+ "isExpression": false,
968
+ "asc": true,
969
+ "nulls": "last"
970
+ }
971
+ ],
972
+ "isUnique": false,
973
+ "concurrently": false,
974
+ "method": "btree",
975
+ "with": {}
976
+ }
977
+ },
978
+ "foreignKeys": {
979
+ "invoice_line_invoice_id_invoice_id_fk": {
980
+ "name": "invoice_line_invoice_id_invoice_id_fk",
981
+ "tableFrom": "invoice_line",
982
+ "tableTo": "invoice",
983
+ "schemaTo": "timesheets",
984
+ "columnsFrom": ["invoice_id"],
985
+ "columnsTo": ["id"],
986
+ "onDelete": "cascade",
987
+ "onUpdate": "no action"
988
+ }
989
+ },
990
+ "compositePrimaryKeys": {},
991
+ "uniqueConstraints": {},
992
+ "policies": {},
993
+ "checkConstraints": {},
994
+ "isRLSEnabled": false
995
+ },
996
+ "timesheets.invoice_payment": {
997
+ "name": "invoice_payment",
998
+ "schema": "timesheets",
999
+ "columns": {
1000
+ "id": {
1001
+ "name": "id",
1002
+ "type": "text",
1003
+ "primaryKey": true,
1004
+ "notNull": true
1005
+ },
1006
+ "invoice_id": {
1007
+ "name": "invoice_id",
1008
+ "type": "text",
1009
+ "primaryKey": false,
1010
+ "notNull": true
1011
+ },
1012
+ "paid_on": {
1013
+ "name": "paid_on",
1014
+ "type": "date",
1015
+ "primaryKey": false,
1016
+ "notNull": true
1017
+ },
1018
+ "amount_minor": {
1019
+ "name": "amount_minor",
1020
+ "type": "integer",
1021
+ "primaryKey": false,
1022
+ "notNull": true
1023
+ },
1024
+ "reference": {
1025
+ "name": "reference",
1026
+ "type": "text",
1027
+ "primaryKey": false,
1028
+ "notNull": false
1029
+ },
1030
+ "note": {
1031
+ "name": "note",
1032
+ "type": "text",
1033
+ "primaryKey": false,
1034
+ "notNull": false
1035
+ },
1036
+ "created_by_id": {
1037
+ "name": "created_by_id",
1038
+ "type": "text",
1039
+ "primaryKey": false,
1040
+ "notNull": true
1041
+ },
1042
+ "created_at": {
1043
+ "name": "created_at",
1044
+ "type": "timestamp",
1045
+ "primaryKey": false,
1046
+ "notNull": true,
1047
+ "default": "now()"
1048
+ }
1049
+ },
1050
+ "indexes": {
1051
+ "invoice_payment_invoice_idx": {
1052
+ "name": "invoice_payment_invoice_idx",
1053
+ "columns": [
1054
+ {
1055
+ "expression": "invoice_id",
1056
+ "isExpression": false,
1057
+ "asc": true,
1058
+ "nulls": "last"
1059
+ }
1060
+ ],
1061
+ "isUnique": false,
1062
+ "concurrently": false,
1063
+ "method": "btree",
1064
+ "with": {}
1065
+ }
1066
+ },
1067
+ "foreignKeys": {
1068
+ "invoice_payment_invoice_id_invoice_id_fk": {
1069
+ "name": "invoice_payment_invoice_id_invoice_id_fk",
1070
+ "tableFrom": "invoice_payment",
1071
+ "tableTo": "invoice",
1072
+ "schemaTo": "timesheets",
1073
+ "columnsFrom": ["invoice_id"],
1074
+ "columnsTo": ["id"],
1075
+ "onDelete": "cascade",
1076
+ "onUpdate": "no action"
1077
+ },
1078
+ "invoice_payment_created_by_id_user_id_fk": {
1079
+ "name": "invoice_payment_created_by_id_user_id_fk",
1080
+ "tableFrom": "invoice_payment",
1081
+ "tableTo": "user",
1082
+ "columnsFrom": ["created_by_id"],
1083
+ "columnsTo": ["id"],
1084
+ "onDelete": "restrict",
1085
+ "onUpdate": "no action"
1086
+ }
1087
+ },
1088
+ "compositePrimaryKeys": {},
1089
+ "uniqueConstraints": {},
1090
+ "policies": {},
1091
+ "checkConstraints": {},
1092
+ "isRLSEnabled": false
1093
+ },
1094
+ "timesheets.invoice_time_entry": {
1095
+ "name": "invoice_time_entry",
1096
+ "schema": "timesheets",
1097
+ "columns": {
1098
+ "id": {
1099
+ "name": "id",
1100
+ "type": "text",
1101
+ "primaryKey": true,
1102
+ "notNull": true
1103
+ },
1104
+ "invoice_id": {
1105
+ "name": "invoice_id",
1106
+ "type": "text",
1107
+ "primaryKey": false,
1108
+ "notNull": true
1109
+ },
1110
+ "invoice_line_id": {
1111
+ "name": "invoice_line_id",
1112
+ "type": "text",
1113
+ "primaryKey": false,
1114
+ "notNull": true
1115
+ },
1116
+ "time_entry_id": {
1117
+ "name": "time_entry_id",
1118
+ "type": "text",
1119
+ "primaryKey": false,
1120
+ "notNull": true
1121
+ }
1122
+ },
1123
+ "indexes": {
1124
+ "invoice_time_entry_entry_idx": {
1125
+ "name": "invoice_time_entry_entry_idx",
1126
+ "columns": [
1127
+ {
1128
+ "expression": "time_entry_id",
1129
+ "isExpression": false,
1130
+ "asc": true,
1131
+ "nulls": "last"
1132
+ }
1133
+ ],
1134
+ "isUnique": false,
1135
+ "concurrently": false,
1136
+ "method": "btree",
1137
+ "with": {}
1138
+ },
1139
+ "invoice_time_entry_invoice_idx": {
1140
+ "name": "invoice_time_entry_invoice_idx",
1141
+ "columns": [
1142
+ {
1143
+ "expression": "invoice_id",
1144
+ "isExpression": false,
1145
+ "asc": true,
1146
+ "nulls": "last"
1147
+ }
1148
+ ],
1149
+ "isUnique": false,
1150
+ "concurrently": false,
1151
+ "method": "btree",
1152
+ "with": {}
1153
+ }
1154
+ },
1155
+ "foreignKeys": {
1156
+ "invoice_time_entry_invoice_id_invoice_id_fk": {
1157
+ "name": "invoice_time_entry_invoice_id_invoice_id_fk",
1158
+ "tableFrom": "invoice_time_entry",
1159
+ "tableTo": "invoice",
1160
+ "schemaTo": "timesheets",
1161
+ "columnsFrom": ["invoice_id"],
1162
+ "columnsTo": ["id"],
1163
+ "onDelete": "cascade",
1164
+ "onUpdate": "no action"
1165
+ },
1166
+ "invoice_time_entry_invoice_line_id_invoice_line_id_fk": {
1167
+ "name": "invoice_time_entry_invoice_line_id_invoice_line_id_fk",
1168
+ "tableFrom": "invoice_time_entry",
1169
+ "tableTo": "invoice_line",
1170
+ "schemaTo": "timesheets",
1171
+ "columnsFrom": ["invoice_line_id"],
1172
+ "columnsTo": ["id"],
1173
+ "onDelete": "cascade",
1174
+ "onUpdate": "no action"
1175
+ },
1176
+ "invoice_time_entry_time_entry_id_time_entry_id_fk": {
1177
+ "name": "invoice_time_entry_time_entry_id_time_entry_id_fk",
1178
+ "tableFrom": "invoice_time_entry",
1179
+ "tableTo": "time_entry",
1180
+ "schemaTo": "timesheets",
1181
+ "columnsFrom": ["time_entry_id"],
1182
+ "columnsTo": ["id"],
1183
+ "onDelete": "restrict",
1184
+ "onUpdate": "no action"
1185
+ }
1186
+ },
1187
+ "compositePrimaryKeys": {},
1188
+ "uniqueConstraints": {},
1189
+ "policies": {},
1190
+ "checkConstraints": {},
1191
+ "isRLSEnabled": false
1192
+ },
1193
+ "timesheets.organization_contact": {
1194
+ "name": "organization_contact",
1195
+ "schema": "timesheets",
1196
+ "columns": {
1197
+ "id": {
1198
+ "name": "id",
1199
+ "type": "text",
1200
+ "primaryKey": true,
1201
+ "notNull": true
1202
+ },
1203
+ "organization_id": {
1204
+ "name": "organization_id",
1205
+ "type": "text",
1206
+ "primaryKey": false,
1207
+ "notNull": true
1208
+ },
1209
+ "user_id": {
1210
+ "name": "user_id",
1211
+ "type": "text",
1212
+ "primaryKey": false,
1213
+ "notNull": false
1214
+ },
1215
+ "name": {
1216
+ "name": "name",
1217
+ "type": "text",
1218
+ "primaryKey": false,
1219
+ "notNull": true
1220
+ },
1221
+ "email": {
1222
+ "name": "email",
1223
+ "type": "text",
1224
+ "primaryKey": false,
1225
+ "notNull": true
1226
+ },
1227
+ "phone": {
1228
+ "name": "phone",
1229
+ "type": "text",
1230
+ "primaryKey": false,
1231
+ "notNull": false
1232
+ },
1233
+ "job_title": {
1234
+ "name": "job_title",
1235
+ "type": "text",
1236
+ "primaryKey": false,
1237
+ "notNull": false
1238
+ },
1239
+ "created_at": {
1240
+ "name": "created_at",
1241
+ "type": "timestamp",
1242
+ "primaryKey": false,
1243
+ "notNull": true,
1244
+ "default": "now()"
1245
+ },
1246
+ "updated_at": {
1247
+ "name": "updated_at",
1248
+ "type": "timestamp",
1249
+ "primaryKey": false,
1250
+ "notNull": true,
1251
+ "default": "now()"
1252
+ }
1253
+ },
1254
+ "indexes": {
1255
+ "organization_contact_org_idx": {
1256
+ "name": "organization_contact_org_idx",
1257
+ "columns": [
1258
+ {
1259
+ "expression": "organization_id",
1260
+ "isExpression": false,
1261
+ "asc": true,
1262
+ "nulls": "last"
1263
+ }
1264
+ ],
1265
+ "isUnique": false,
1266
+ "concurrently": false,
1267
+ "method": "btree",
1268
+ "with": {}
1269
+ },
1270
+ "organization_contact_org_email_uidx": {
1271
+ "name": "organization_contact_org_email_uidx",
1272
+ "columns": [
1273
+ {
1274
+ "expression": "organization_id",
1275
+ "isExpression": false,
1276
+ "asc": true,
1277
+ "nulls": "last"
1278
+ },
1279
+ {
1280
+ "expression": "email",
1281
+ "isExpression": false,
1282
+ "asc": true,
1283
+ "nulls": "last"
1284
+ }
1285
+ ],
1286
+ "isUnique": true,
1287
+ "concurrently": false,
1288
+ "method": "btree",
1289
+ "with": {}
1290
+ }
1291
+ },
1292
+ "foreignKeys": {
1293
+ "organization_contact_organization_id_organization_id_fk": {
1294
+ "name": "organization_contact_organization_id_organization_id_fk",
1295
+ "tableFrom": "organization_contact",
1296
+ "tableTo": "organization",
1297
+ "columnsFrom": ["organization_id"],
1298
+ "columnsTo": ["id"],
1299
+ "onDelete": "cascade",
1300
+ "onUpdate": "no action"
1301
+ },
1302
+ "organization_contact_user_id_user_id_fk": {
1303
+ "name": "organization_contact_user_id_user_id_fk",
1304
+ "tableFrom": "organization_contact",
1305
+ "tableTo": "user",
1306
+ "columnsFrom": ["user_id"],
1307
+ "columnsTo": ["id"],
1308
+ "onDelete": "set null",
1309
+ "onUpdate": "no action"
1310
+ }
1311
+ },
1312
+ "compositePrimaryKeys": {},
1313
+ "uniqueConstraints": {},
1314
+ "policies": {},
1315
+ "checkConstraints": {},
1316
+ "isRLSEnabled": false
1317
+ },
1318
+ "timesheets.organization_invoice_profile": {
1319
+ "name": "organization_invoice_profile",
1320
+ "schema": "timesheets",
1321
+ "columns": {
1322
+ "organization_id": {
1323
+ "name": "organization_id",
1324
+ "type": "text",
1325
+ "primaryKey": true,
1326
+ "notNull": true
1327
+ },
1328
+ "address": {
1329
+ "name": "address",
1330
+ "type": "text",
1331
+ "primaryKey": false,
1332
+ "notNull": true,
1333
+ "default": "''"
1334
+ },
1335
+ "registration_number": {
1336
+ "name": "registration_number",
1337
+ "type": "text",
1338
+ "primaryKey": false,
1339
+ "notNull": false
1340
+ },
1341
+ "vat_number": {
1342
+ "name": "vat_number",
1343
+ "type": "text",
1344
+ "primaryKey": false,
1345
+ "notNull": false
1346
+ },
1347
+ "iban": {
1348
+ "name": "iban",
1349
+ "type": "text",
1350
+ "primaryKey": false,
1351
+ "notNull": false
1352
+ },
1353
+ "bic": {
1354
+ "name": "bic",
1355
+ "type": "text",
1356
+ "primaryKey": false,
1357
+ "notNull": false
1358
+ },
1359
+ "invoice_email": {
1360
+ "name": "invoice_email",
1361
+ "type": "text",
1362
+ "primaryKey": false,
1363
+ "notNull": false
1364
+ },
1365
+ "invoice_email_template": {
1366
+ "name": "invoice_email_template",
1367
+ "type": "text",
1368
+ "primaryKey": false,
1369
+ "notNull": false
1370
+ },
1371
+ "preferred_locale": {
1372
+ "name": "preferred_locale",
1373
+ "type": "text",
1374
+ "primaryKey": false,
1375
+ "notNull": true,
1376
+ "default": "'nl'"
1377
+ },
1378
+ "created_at": {
1379
+ "name": "created_at",
1380
+ "type": "timestamp",
1381
+ "primaryKey": false,
1382
+ "notNull": true,
1383
+ "default": "now()"
1384
+ },
1385
+ "updated_at": {
1386
+ "name": "updated_at",
1387
+ "type": "timestamp",
1388
+ "primaryKey": false,
1389
+ "notNull": true,
1390
+ "default": "now()"
1391
+ }
1392
+ },
1393
+ "indexes": {},
1394
+ "foreignKeys": {
1395
+ "organization_invoice_profile_organization_id_organization_id_fk": {
1396
+ "name": "organization_invoice_profile_organization_id_organization_id_fk",
1397
+ "tableFrom": "organization_invoice_profile",
1398
+ "tableTo": "organization",
1399
+ "columnsFrom": ["organization_id"],
1400
+ "columnsTo": ["id"],
1401
+ "onDelete": "cascade",
1402
+ "onUpdate": "no action"
1403
+ }
1404
+ },
1405
+ "compositePrimaryKeys": {},
1406
+ "uniqueConstraints": {},
1407
+ "policies": {},
1408
+ "checkConstraints": {},
1409
+ "isRLSEnabled": false
1410
+ },
1411
+ "timesheets.project": {
1412
+ "name": "project",
1413
+ "schema": "timesheets",
1414
+ "columns": {
1415
+ "id": {
1416
+ "name": "id",
1417
+ "type": "text",
1418
+ "primaryKey": true,
1419
+ "notNull": true
1420
+ },
1421
+ "organization_id": {
1422
+ "name": "organization_id",
1423
+ "type": "text",
1424
+ "primaryKey": false,
1425
+ "notNull": true
1426
+ },
1427
+ "client_organization_id": {
1428
+ "name": "client_organization_id",
1429
+ "type": "text",
1430
+ "primaryKey": false,
1431
+ "notNull": true
1432
+ },
1433
+ "name": {
1434
+ "name": "name",
1435
+ "type": "text",
1436
+ "primaryKey": false,
1437
+ "notNull": true
1438
+ },
1439
+ "code": {
1440
+ "name": "code",
1441
+ "type": "text",
1442
+ "primaryKey": false,
1443
+ "notNull": false
1444
+ },
1445
+ "status": {
1446
+ "name": "status",
1447
+ "type": "project_status",
1448
+ "typeSchema": "timesheets",
1449
+ "primaryKey": false,
1450
+ "notNull": true,
1451
+ "default": "'ACTIVE'"
1452
+ },
1453
+ "starts_on": {
1454
+ "name": "starts_on",
1455
+ "type": "date",
1456
+ "primaryKey": false,
1457
+ "notNull": false
1458
+ },
1459
+ "ends_on": {
1460
+ "name": "ends_on",
1461
+ "type": "date",
1462
+ "primaryKey": false,
1463
+ "notNull": false
1464
+ },
1465
+ "budget_minutes": {
1466
+ "name": "budget_minutes",
1467
+ "type": "integer",
1468
+ "primaryKey": false,
1469
+ "notNull": false
1470
+ },
1471
+ "budget_minor": {
1472
+ "name": "budget_minor",
1473
+ "type": "integer",
1474
+ "primaryKey": false,
1475
+ "notNull": false
1476
+ },
1477
+ "created_at": {
1478
+ "name": "created_at",
1479
+ "type": "timestamp",
1480
+ "primaryKey": false,
1481
+ "notNull": true,
1482
+ "default": "now()"
1483
+ },
1484
+ "updated_at": {
1485
+ "name": "updated_at",
1486
+ "type": "timestamp",
1487
+ "primaryKey": false,
1488
+ "notNull": true,
1489
+ "default": "now()"
1490
+ }
1491
+ },
1492
+ "indexes": {
1493
+ "project_org_name_uidx": {
1494
+ "name": "project_org_name_uidx",
1495
+ "columns": [
1496
+ {
1497
+ "expression": "organization_id",
1498
+ "isExpression": false,
1499
+ "asc": true,
1500
+ "nulls": "last"
1501
+ },
1502
+ {
1503
+ "expression": "name",
1504
+ "isExpression": false,
1505
+ "asc": true,
1506
+ "nulls": "last"
1507
+ }
1508
+ ],
1509
+ "isUnique": true,
1510
+ "concurrently": false,
1511
+ "method": "btree",
1512
+ "with": {}
1513
+ },
1514
+ "project_org_status_idx": {
1515
+ "name": "project_org_status_idx",
1516
+ "columns": [
1517
+ {
1518
+ "expression": "organization_id",
1519
+ "isExpression": false,
1520
+ "asc": true,
1521
+ "nulls": "last"
1522
+ },
1523
+ {
1524
+ "expression": "status",
1525
+ "isExpression": false,
1526
+ "asc": true,
1527
+ "nulls": "last"
1528
+ }
1529
+ ],
1530
+ "isUnique": false,
1531
+ "concurrently": false,
1532
+ "method": "btree",
1533
+ "with": {}
1534
+ },
1535
+ "project_client_idx": {
1536
+ "name": "project_client_idx",
1537
+ "columns": [
1538
+ {
1539
+ "expression": "client_organization_id",
1540
+ "isExpression": false,
1541
+ "asc": true,
1542
+ "nulls": "last"
1543
+ }
1544
+ ],
1545
+ "isUnique": false,
1546
+ "concurrently": false,
1547
+ "method": "btree",
1548
+ "with": {}
1549
+ }
1550
+ },
1551
+ "foreignKeys": {
1552
+ "project_organization_id_organization_id_fk": {
1553
+ "name": "project_organization_id_organization_id_fk",
1554
+ "tableFrom": "project",
1555
+ "tableTo": "organization",
1556
+ "columnsFrom": ["organization_id"],
1557
+ "columnsTo": ["id"],
1558
+ "onDelete": "cascade",
1559
+ "onUpdate": "no action"
1560
+ },
1561
+ "project_client_organization_id_organization_id_fk": {
1562
+ "name": "project_client_organization_id_organization_id_fk",
1563
+ "tableFrom": "project",
1564
+ "tableTo": "organization",
1565
+ "columnsFrom": ["client_organization_id"],
1566
+ "columnsTo": ["id"],
1567
+ "onDelete": "restrict",
1568
+ "onUpdate": "no action"
1569
+ }
1570
+ },
1571
+ "compositePrimaryKeys": {},
1572
+ "uniqueConstraints": {},
1573
+ "policies": {},
1574
+ "checkConstraints": {},
1575
+ "isRLSEnabled": false
1576
+ },
1577
+ "timesheets.project_activity": {
1578
+ "name": "project_activity",
1579
+ "schema": "timesheets",
1580
+ "columns": {
1581
+ "id": {
1582
+ "name": "id",
1583
+ "type": "text",
1584
+ "primaryKey": true,
1585
+ "notNull": true
1586
+ },
1587
+ "project_id": {
1588
+ "name": "project_id",
1589
+ "type": "text",
1590
+ "primaryKey": false,
1591
+ "notNull": true
1592
+ },
1593
+ "activity_type_id": {
1594
+ "name": "activity_type_id",
1595
+ "type": "text",
1596
+ "primaryKey": false,
1597
+ "notNull": true
1598
+ }
1599
+ },
1600
+ "indexes": {
1601
+ "project_activity_project_activity_uidx": {
1602
+ "name": "project_activity_project_activity_uidx",
1603
+ "columns": [
1604
+ {
1605
+ "expression": "project_id",
1606
+ "isExpression": false,
1607
+ "asc": true,
1608
+ "nulls": "last"
1609
+ },
1610
+ {
1611
+ "expression": "activity_type_id",
1612
+ "isExpression": false,
1613
+ "asc": true,
1614
+ "nulls": "last"
1615
+ }
1616
+ ],
1617
+ "isUnique": true,
1618
+ "concurrently": false,
1619
+ "method": "btree",
1620
+ "with": {}
1621
+ }
1622
+ },
1623
+ "foreignKeys": {
1624
+ "project_activity_project_id_project_id_fk": {
1625
+ "name": "project_activity_project_id_project_id_fk",
1626
+ "tableFrom": "project_activity",
1627
+ "tableTo": "project",
1628
+ "schemaTo": "timesheets",
1629
+ "columnsFrom": ["project_id"],
1630
+ "columnsTo": ["id"],
1631
+ "onDelete": "cascade",
1632
+ "onUpdate": "no action"
1633
+ },
1634
+ "project_activity_activity_type_id_activity_type_id_fk": {
1635
+ "name": "project_activity_activity_type_id_activity_type_id_fk",
1636
+ "tableFrom": "project_activity",
1637
+ "tableTo": "activity_type",
1638
+ "schemaTo": "timesheets",
1639
+ "columnsFrom": ["activity_type_id"],
1640
+ "columnsTo": ["id"],
1641
+ "onDelete": "cascade",
1642
+ "onUpdate": "no action"
1643
+ }
1644
+ },
1645
+ "compositePrimaryKeys": {},
1646
+ "uniqueConstraints": {},
1647
+ "policies": {},
1648
+ "checkConstraints": {},
1649
+ "isRLSEnabled": false
1650
+ },
1651
+ "timesheets.project_person_tariff": {
1652
+ "name": "project_person_tariff",
1653
+ "schema": "timesheets",
1654
+ "columns": {
1655
+ "id": {
1656
+ "name": "id",
1657
+ "type": "text",
1658
+ "primaryKey": true,
1659
+ "notNull": true
1660
+ },
1661
+ "project_id": {
1662
+ "name": "project_id",
1663
+ "type": "text",
1664
+ "primaryKey": false,
1665
+ "notNull": true
1666
+ },
1667
+ "user_id": {
1668
+ "name": "user_id",
1669
+ "type": "text",
1670
+ "primaryKey": false,
1671
+ "notNull": true
1672
+ },
1673
+ "hourly_rate_minor": {
1674
+ "name": "hourly_rate_minor",
1675
+ "type": "integer",
1676
+ "primaryKey": false,
1677
+ "notNull": true
1678
+ },
1679
+ "created_at": {
1680
+ "name": "created_at",
1681
+ "type": "timestamp",
1682
+ "primaryKey": false,
1683
+ "notNull": true,
1684
+ "default": "now()"
1685
+ },
1686
+ "updated_at": {
1687
+ "name": "updated_at",
1688
+ "type": "timestamp",
1689
+ "primaryKey": false,
1690
+ "notNull": true,
1691
+ "default": "now()"
1692
+ }
1693
+ },
1694
+ "indexes": {
1695
+ "project_person_tariff_project_user_uidx": {
1696
+ "name": "project_person_tariff_project_user_uidx",
1697
+ "columns": [
1698
+ {
1699
+ "expression": "project_id",
1700
+ "isExpression": false,
1701
+ "asc": true,
1702
+ "nulls": "last"
1703
+ },
1704
+ {
1705
+ "expression": "user_id",
1706
+ "isExpression": false,
1707
+ "asc": true,
1708
+ "nulls": "last"
1709
+ }
1710
+ ],
1711
+ "isUnique": true,
1712
+ "concurrently": false,
1713
+ "method": "btree",
1714
+ "with": {}
1715
+ }
1716
+ },
1717
+ "foreignKeys": {
1718
+ "project_person_tariff_project_id_project_id_fk": {
1719
+ "name": "project_person_tariff_project_id_project_id_fk",
1720
+ "tableFrom": "project_person_tariff",
1721
+ "tableTo": "project",
1722
+ "schemaTo": "timesheets",
1723
+ "columnsFrom": ["project_id"],
1724
+ "columnsTo": ["id"],
1725
+ "onDelete": "cascade",
1726
+ "onUpdate": "no action"
1727
+ },
1728
+ "project_person_tariff_user_id_user_id_fk": {
1729
+ "name": "project_person_tariff_user_id_user_id_fk",
1730
+ "tableFrom": "project_person_tariff",
1731
+ "tableTo": "user",
1732
+ "columnsFrom": ["user_id"],
1733
+ "columnsTo": ["id"],
1734
+ "onDelete": "cascade",
1735
+ "onUpdate": "no action"
1736
+ }
1737
+ },
1738
+ "compositePrimaryKeys": {},
1739
+ "uniqueConstraints": {},
1740
+ "policies": {},
1741
+ "checkConstraints": {},
1742
+ "isRLSEnabled": false
1743
+ },
1744
+ "timesheets.team_member_settings": {
1745
+ "name": "team_member_settings",
1746
+ "schema": "timesheets",
1747
+ "columns": {
1748
+ "id": {
1749
+ "name": "id",
1750
+ "type": "text",
1751
+ "primaryKey": true,
1752
+ "notNull": true
1753
+ },
1754
+ "organization_id": {
1755
+ "name": "organization_id",
1756
+ "type": "text",
1757
+ "primaryKey": false,
1758
+ "notNull": true
1759
+ },
1760
+ "user_id": {
1761
+ "name": "user_id",
1762
+ "type": "text",
1763
+ "primaryKey": false,
1764
+ "notNull": true
1765
+ },
1766
+ "can_enter_time": {
1767
+ "name": "can_enter_time",
1768
+ "type": "boolean",
1769
+ "primaryKey": false,
1770
+ "notNull": true,
1771
+ "default": true
1772
+ },
1773
+ "internal_approval_required": {
1774
+ "name": "internal_approval_required",
1775
+ "type": "boolean",
1776
+ "primaryKey": false,
1777
+ "notNull": true,
1778
+ "default": true
1779
+ },
1780
+ "created_at": {
1781
+ "name": "created_at",
1782
+ "type": "timestamp",
1783
+ "primaryKey": false,
1784
+ "notNull": true,
1785
+ "default": "now()"
1786
+ },
1787
+ "updated_at": {
1788
+ "name": "updated_at",
1789
+ "type": "timestamp",
1790
+ "primaryKey": false,
1791
+ "notNull": true,
1792
+ "default": "now()"
1793
+ }
1794
+ },
1795
+ "indexes": {
1796
+ "team_member_settings_org_user_uidx": {
1797
+ "name": "team_member_settings_org_user_uidx",
1798
+ "columns": [
1799
+ {
1800
+ "expression": "organization_id",
1801
+ "isExpression": false,
1802
+ "asc": true,
1803
+ "nulls": "last"
1804
+ },
1805
+ {
1806
+ "expression": "user_id",
1807
+ "isExpression": false,
1808
+ "asc": true,
1809
+ "nulls": "last"
1810
+ }
1811
+ ],
1812
+ "isUnique": true,
1813
+ "concurrently": false,
1814
+ "method": "btree",
1815
+ "with": {}
1816
+ }
1817
+ },
1818
+ "foreignKeys": {
1819
+ "team_member_settings_organization_id_organization_id_fk": {
1820
+ "name": "team_member_settings_organization_id_organization_id_fk",
1821
+ "tableFrom": "team_member_settings",
1822
+ "tableTo": "organization",
1823
+ "columnsFrom": ["organization_id"],
1824
+ "columnsTo": ["id"],
1825
+ "onDelete": "cascade",
1826
+ "onUpdate": "no action"
1827
+ },
1828
+ "team_member_settings_user_id_user_id_fk": {
1829
+ "name": "team_member_settings_user_id_user_id_fk",
1830
+ "tableFrom": "team_member_settings",
1831
+ "tableTo": "user",
1832
+ "columnsFrom": ["user_id"],
1833
+ "columnsTo": ["id"],
1834
+ "onDelete": "cascade",
1835
+ "onUpdate": "no action"
1836
+ }
1837
+ },
1838
+ "compositePrimaryKeys": {},
1839
+ "uniqueConstraints": {},
1840
+ "policies": {},
1841
+ "checkConstraints": {},
1842
+ "isRLSEnabled": false
1843
+ },
1844
+ "timesheets.team_tariff": {
1845
+ "name": "team_tariff",
1846
+ "schema": "timesheets",
1847
+ "columns": {
1848
+ "id": {
1849
+ "name": "id",
1850
+ "type": "text",
1851
+ "primaryKey": true,
1852
+ "notNull": true
1853
+ },
1854
+ "organization_id": {
1855
+ "name": "organization_id",
1856
+ "type": "text",
1857
+ "primaryKey": false,
1858
+ "notNull": true
1859
+ },
1860
+ "user_id": {
1861
+ "name": "user_id",
1862
+ "type": "text",
1863
+ "primaryKey": false,
1864
+ "notNull": true
1865
+ },
1866
+ "hourly_rate_minor": {
1867
+ "name": "hourly_rate_minor",
1868
+ "type": "integer",
1869
+ "primaryKey": false,
1870
+ "notNull": true
1871
+ },
1872
+ "created_at": {
1873
+ "name": "created_at",
1874
+ "type": "timestamp",
1875
+ "primaryKey": false,
1876
+ "notNull": true,
1877
+ "default": "now()"
1878
+ },
1879
+ "updated_at": {
1880
+ "name": "updated_at",
1881
+ "type": "timestamp",
1882
+ "primaryKey": false,
1883
+ "notNull": true,
1884
+ "default": "now()"
1885
+ }
1886
+ },
1887
+ "indexes": {
1888
+ "team_tariff_org_user_uidx": {
1889
+ "name": "team_tariff_org_user_uidx",
1890
+ "columns": [
1891
+ {
1892
+ "expression": "organization_id",
1893
+ "isExpression": false,
1894
+ "asc": true,
1895
+ "nulls": "last"
1896
+ },
1897
+ {
1898
+ "expression": "user_id",
1899
+ "isExpression": false,
1900
+ "asc": true,
1901
+ "nulls": "last"
1902
+ }
1903
+ ],
1904
+ "isUnique": true,
1905
+ "concurrently": false,
1906
+ "method": "btree",
1907
+ "with": {}
1908
+ }
1909
+ },
1910
+ "foreignKeys": {
1911
+ "team_tariff_organization_id_organization_id_fk": {
1912
+ "name": "team_tariff_organization_id_organization_id_fk",
1913
+ "tableFrom": "team_tariff",
1914
+ "tableTo": "organization",
1915
+ "columnsFrom": ["organization_id"],
1916
+ "columnsTo": ["id"],
1917
+ "onDelete": "cascade",
1918
+ "onUpdate": "no action"
1919
+ },
1920
+ "team_tariff_user_id_user_id_fk": {
1921
+ "name": "team_tariff_user_id_user_id_fk",
1922
+ "tableFrom": "team_tariff",
1923
+ "tableTo": "user",
1924
+ "columnsFrom": ["user_id"],
1925
+ "columnsTo": ["id"],
1926
+ "onDelete": "cascade",
1927
+ "onUpdate": "no action"
1928
+ }
1929
+ },
1930
+ "compositePrimaryKeys": {},
1931
+ "uniqueConstraints": {},
1932
+ "policies": {},
1933
+ "checkConstraints": {},
1934
+ "isRLSEnabled": false
1935
+ },
1936
+ "timesheets.time_entry": {
1937
+ "name": "time_entry",
1938
+ "schema": "timesheets",
1939
+ "columns": {
1940
+ "id": {
1941
+ "name": "id",
1942
+ "type": "text",
1943
+ "primaryKey": true,
1944
+ "notNull": true
1945
+ },
1946
+ "organization_id": {
1947
+ "name": "organization_id",
1948
+ "type": "text",
1949
+ "primaryKey": false,
1950
+ "notNull": true
1951
+ },
1952
+ "weekly_timesheet_id": {
1953
+ "name": "weekly_timesheet_id",
1954
+ "type": "text",
1955
+ "primaryKey": false,
1956
+ "notNull": true
1957
+ },
1958
+ "user_id": {
1959
+ "name": "user_id",
1960
+ "type": "text",
1961
+ "primaryKey": false,
1962
+ "notNull": true
1963
+ },
1964
+ "project_id": {
1965
+ "name": "project_id",
1966
+ "type": "text",
1967
+ "primaryKey": false,
1968
+ "notNull": true
1969
+ },
1970
+ "client_organization_id": {
1971
+ "name": "client_organization_id",
1972
+ "type": "text",
1973
+ "primaryKey": false,
1974
+ "notNull": true
1975
+ },
1976
+ "activity_type_id": {
1977
+ "name": "activity_type_id",
1978
+ "type": "text",
1979
+ "primaryKey": false,
1980
+ "notNull": true
1981
+ },
1982
+ "entry_date": {
1983
+ "name": "entry_date",
1984
+ "type": "date",
1985
+ "primaryKey": false,
1986
+ "notNull": true
1987
+ },
1988
+ "duration_minutes": {
1989
+ "name": "duration_minutes",
1990
+ "type": "integer",
1991
+ "primaryKey": false,
1992
+ "notNull": true,
1993
+ "default": 0
1994
+ },
1995
+ "note": {
1996
+ "name": "note",
1997
+ "type": "text",
1998
+ "primaryKey": false,
1999
+ "notNull": false
2000
+ },
2001
+ "billable_snapshot": {
2002
+ "name": "billable_snapshot",
2003
+ "type": "boolean",
2004
+ "primaryKey": false,
2005
+ "notNull": true
2006
+ },
2007
+ "hourly_rate_minor_snapshot": {
2008
+ "name": "hourly_rate_minor_snapshot",
2009
+ "type": "integer",
2010
+ "primaryKey": false,
2011
+ "notNull": true
2012
+ },
2013
+ "currency_snapshot": {
2014
+ "name": "currency_snapshot",
2015
+ "type": "text",
2016
+ "primaryKey": false,
2017
+ "notNull": true
2018
+ },
2019
+ "timer_started_at": {
2020
+ "name": "timer_started_at",
2021
+ "type": "timestamp",
2022
+ "primaryKey": false,
2023
+ "notNull": false
2024
+ },
2025
+ "created_at": {
2026
+ "name": "created_at",
2027
+ "type": "timestamp",
2028
+ "primaryKey": false,
2029
+ "notNull": true,
2030
+ "default": "now()"
2031
+ },
2032
+ "updated_at": {
2033
+ "name": "updated_at",
2034
+ "type": "timestamp",
2035
+ "primaryKey": false,
2036
+ "notNull": true,
2037
+ "default": "now()"
2038
+ }
2039
+ },
2040
+ "indexes": {
2041
+ "time_entry_org_user_date_idx": {
2042
+ "name": "time_entry_org_user_date_idx",
2043
+ "columns": [
2044
+ {
2045
+ "expression": "organization_id",
2046
+ "isExpression": false,
2047
+ "asc": true,
2048
+ "nulls": "last"
2049
+ },
2050
+ {
2051
+ "expression": "user_id",
2052
+ "isExpression": false,
2053
+ "asc": true,
2054
+ "nulls": "last"
2055
+ },
2056
+ {
2057
+ "expression": "entry_date",
2058
+ "isExpression": false,
2059
+ "asc": true,
2060
+ "nulls": "last"
2061
+ }
2062
+ ],
2063
+ "isUnique": false,
2064
+ "concurrently": false,
2065
+ "method": "btree",
2066
+ "with": {}
2067
+ },
2068
+ "time_entry_week_idx": {
2069
+ "name": "time_entry_week_idx",
2070
+ "columns": [
2071
+ {
2072
+ "expression": "weekly_timesheet_id",
2073
+ "isExpression": false,
2074
+ "asc": true,
2075
+ "nulls": "last"
2076
+ }
2077
+ ],
2078
+ "isUnique": false,
2079
+ "concurrently": false,
2080
+ "method": "btree",
2081
+ "with": {}
2082
+ },
2083
+ "time_entry_project_idx": {
2084
+ "name": "time_entry_project_idx",
2085
+ "columns": [
2086
+ {
2087
+ "expression": "project_id",
2088
+ "isExpression": false,
2089
+ "asc": true,
2090
+ "nulls": "last"
2091
+ }
2092
+ ],
2093
+ "isUnique": false,
2094
+ "concurrently": false,
2095
+ "method": "btree",
2096
+ "with": {}
2097
+ },
2098
+ "time_entry_client_idx": {
2099
+ "name": "time_entry_client_idx",
2100
+ "columns": [
2101
+ {
2102
+ "expression": "client_organization_id",
2103
+ "isExpression": false,
2104
+ "asc": true,
2105
+ "nulls": "last"
2106
+ }
2107
+ ],
2108
+ "isUnique": false,
2109
+ "concurrently": false,
2110
+ "method": "btree",
2111
+ "with": {}
2112
+ }
2113
+ },
2114
+ "foreignKeys": {
2115
+ "time_entry_organization_id_organization_id_fk": {
2116
+ "name": "time_entry_organization_id_organization_id_fk",
2117
+ "tableFrom": "time_entry",
2118
+ "tableTo": "organization",
2119
+ "columnsFrom": ["organization_id"],
2120
+ "columnsTo": ["id"],
2121
+ "onDelete": "cascade",
2122
+ "onUpdate": "no action"
2123
+ },
2124
+ "time_entry_weekly_timesheet_id_weekly_timesheet_id_fk": {
2125
+ "name": "time_entry_weekly_timesheet_id_weekly_timesheet_id_fk",
2126
+ "tableFrom": "time_entry",
2127
+ "tableTo": "weekly_timesheet",
2128
+ "schemaTo": "timesheets",
2129
+ "columnsFrom": ["weekly_timesheet_id"],
2130
+ "columnsTo": ["id"],
2131
+ "onDelete": "cascade",
2132
+ "onUpdate": "no action"
2133
+ },
2134
+ "time_entry_user_id_user_id_fk": {
2135
+ "name": "time_entry_user_id_user_id_fk",
2136
+ "tableFrom": "time_entry",
2137
+ "tableTo": "user",
2138
+ "columnsFrom": ["user_id"],
2139
+ "columnsTo": ["id"],
2140
+ "onDelete": "cascade",
2141
+ "onUpdate": "no action"
2142
+ },
2143
+ "time_entry_project_id_project_id_fk": {
2144
+ "name": "time_entry_project_id_project_id_fk",
2145
+ "tableFrom": "time_entry",
2146
+ "tableTo": "project",
2147
+ "schemaTo": "timesheets",
2148
+ "columnsFrom": ["project_id"],
2149
+ "columnsTo": ["id"],
2150
+ "onDelete": "restrict",
2151
+ "onUpdate": "no action"
2152
+ },
2153
+ "time_entry_client_organization_id_organization_id_fk": {
2154
+ "name": "time_entry_client_organization_id_organization_id_fk",
2155
+ "tableFrom": "time_entry",
2156
+ "tableTo": "organization",
2157
+ "columnsFrom": ["client_organization_id"],
2158
+ "columnsTo": ["id"],
2159
+ "onDelete": "restrict",
2160
+ "onUpdate": "no action"
2161
+ },
2162
+ "time_entry_activity_type_id_activity_type_id_fk": {
2163
+ "name": "time_entry_activity_type_id_activity_type_id_fk",
2164
+ "tableFrom": "time_entry",
2165
+ "tableTo": "activity_type",
2166
+ "schemaTo": "timesheets",
2167
+ "columnsFrom": ["activity_type_id"],
2168
+ "columnsTo": ["id"],
2169
+ "onDelete": "restrict",
2170
+ "onUpdate": "no action"
2171
+ }
2172
+ },
2173
+ "compositePrimaryKeys": {},
2174
+ "uniqueConstraints": {},
2175
+ "policies": {},
2176
+ "checkConstraints": {},
2177
+ "isRLSEnabled": false
2178
+ },
2179
+ "timesheets.approval_history": {
2180
+ "name": "approval_history",
2181
+ "schema": "timesheets",
2182
+ "columns": {
2183
+ "id": {
2184
+ "name": "id",
2185
+ "type": "text",
2186
+ "primaryKey": true,
2187
+ "notNull": true
2188
+ },
2189
+ "weekly_timesheet_id": {
2190
+ "name": "weekly_timesheet_id",
2191
+ "type": "text",
2192
+ "primaryKey": false,
2193
+ "notNull": true
2194
+ },
2195
+ "action": {
2196
+ "name": "action",
2197
+ "type": "approval_action",
2198
+ "typeSchema": "timesheets",
2199
+ "primaryKey": false,
2200
+ "notNull": true
2201
+ },
2202
+ "actor_user_id": {
2203
+ "name": "actor_user_id",
2204
+ "type": "text",
2205
+ "primaryKey": false,
2206
+ "notNull": true
2207
+ },
2208
+ "comment": {
2209
+ "name": "comment",
2210
+ "type": "text",
2211
+ "primaryKey": false,
2212
+ "notNull": false
2213
+ },
2214
+ "created_at": {
2215
+ "name": "created_at",
2216
+ "type": "timestamp",
2217
+ "primaryKey": false,
2218
+ "notNull": true,
2219
+ "default": "now()"
2220
+ }
2221
+ },
2222
+ "indexes": {
2223
+ "approval_history_week_idx": {
2224
+ "name": "approval_history_week_idx",
2225
+ "columns": [
2226
+ {
2227
+ "expression": "weekly_timesheet_id",
2228
+ "isExpression": false,
2229
+ "asc": true,
2230
+ "nulls": "last"
2231
+ }
2232
+ ],
2233
+ "isUnique": false,
2234
+ "concurrently": false,
2235
+ "method": "btree",
2236
+ "with": {}
2237
+ }
2238
+ },
2239
+ "foreignKeys": {
2240
+ "approval_history_weekly_timesheet_id_weekly_timesheet_id_fk": {
2241
+ "name": "approval_history_weekly_timesheet_id_weekly_timesheet_id_fk",
2242
+ "tableFrom": "approval_history",
2243
+ "tableTo": "weekly_timesheet",
2244
+ "schemaTo": "timesheets",
2245
+ "columnsFrom": ["weekly_timesheet_id"],
2246
+ "columnsTo": ["id"],
2247
+ "onDelete": "cascade",
2248
+ "onUpdate": "no action"
2249
+ },
2250
+ "approval_history_actor_user_id_user_id_fk": {
2251
+ "name": "approval_history_actor_user_id_user_id_fk",
2252
+ "tableFrom": "approval_history",
2253
+ "tableTo": "user",
2254
+ "columnsFrom": ["actor_user_id"],
2255
+ "columnsTo": ["id"],
2256
+ "onDelete": "restrict",
2257
+ "onUpdate": "no action"
2258
+ }
2259
+ },
2260
+ "compositePrimaryKeys": {},
2261
+ "uniqueConstraints": {},
2262
+ "policies": {},
2263
+ "checkConstraints": {},
2264
+ "isRLSEnabled": false
2265
+ },
2266
+ "timesheets.client_review": {
2267
+ "name": "client_review",
2268
+ "schema": "timesheets",
2269
+ "columns": {
2270
+ "id": {
2271
+ "name": "id",
2272
+ "type": "text",
2273
+ "primaryKey": true,
2274
+ "notNull": true
2275
+ },
2276
+ "weekly_timesheet_id": {
2277
+ "name": "weekly_timesheet_id",
2278
+ "type": "text",
2279
+ "primaryKey": false,
2280
+ "notNull": true
2281
+ },
2282
+ "client_organization_id": {
2283
+ "name": "client_organization_id",
2284
+ "type": "text",
2285
+ "primaryKey": false,
2286
+ "notNull": true
2287
+ },
2288
+ "status": {
2289
+ "name": "status",
2290
+ "type": "client_review_status",
2291
+ "typeSchema": "timesheets",
2292
+ "primaryKey": false,
2293
+ "notNull": true,
2294
+ "default": "'PENDING'"
2295
+ },
2296
+ "reviewer_user_id": {
2297
+ "name": "reviewer_user_id",
2298
+ "type": "text",
2299
+ "primaryKey": false,
2300
+ "notNull": false
2301
+ },
2302
+ "comment": {
2303
+ "name": "comment",
2304
+ "type": "text",
2305
+ "primaryKey": false,
2306
+ "notNull": false
2307
+ },
2308
+ "version": {
2309
+ "name": "version",
2310
+ "type": "integer",
2311
+ "primaryKey": false,
2312
+ "notNull": true,
2313
+ "default": 1
2314
+ },
2315
+ "reviewed_at": {
2316
+ "name": "reviewed_at",
2317
+ "type": "timestamp",
2318
+ "primaryKey": false,
2319
+ "notNull": false
2320
+ },
2321
+ "created_at": {
2322
+ "name": "created_at",
2323
+ "type": "timestamp",
2324
+ "primaryKey": false,
2325
+ "notNull": true,
2326
+ "default": "now()"
2327
+ },
2328
+ "updated_at": {
2329
+ "name": "updated_at",
2330
+ "type": "timestamp",
2331
+ "primaryKey": false,
2332
+ "notNull": true,
2333
+ "default": "now()"
2334
+ }
2335
+ },
2336
+ "indexes": {
2337
+ "client_review_week_client_uidx": {
2338
+ "name": "client_review_week_client_uidx",
2339
+ "columns": [
2340
+ {
2341
+ "expression": "weekly_timesheet_id",
2342
+ "isExpression": false,
2343
+ "asc": true,
2344
+ "nulls": "last"
2345
+ },
2346
+ {
2347
+ "expression": "client_organization_id",
2348
+ "isExpression": false,
2349
+ "asc": true,
2350
+ "nulls": "last"
2351
+ }
2352
+ ],
2353
+ "isUnique": true,
2354
+ "concurrently": false,
2355
+ "method": "btree",
2356
+ "with": {}
2357
+ },
2358
+ "client_review_client_status_idx": {
2359
+ "name": "client_review_client_status_idx",
2360
+ "columns": [
2361
+ {
2362
+ "expression": "client_organization_id",
2363
+ "isExpression": false,
2364
+ "asc": true,
2365
+ "nulls": "last"
2366
+ },
2367
+ {
2368
+ "expression": "status",
2369
+ "isExpression": false,
2370
+ "asc": true,
2371
+ "nulls": "last"
2372
+ }
2373
+ ],
2374
+ "isUnique": false,
2375
+ "concurrently": false,
2376
+ "method": "btree",
2377
+ "with": {}
2378
+ }
2379
+ },
2380
+ "foreignKeys": {
2381
+ "client_review_weekly_timesheet_id_weekly_timesheet_id_fk": {
2382
+ "name": "client_review_weekly_timesheet_id_weekly_timesheet_id_fk",
2383
+ "tableFrom": "client_review",
2384
+ "tableTo": "weekly_timesheet",
2385
+ "schemaTo": "timesheets",
2386
+ "columnsFrom": ["weekly_timesheet_id"],
2387
+ "columnsTo": ["id"],
2388
+ "onDelete": "cascade",
2389
+ "onUpdate": "no action"
2390
+ },
2391
+ "client_review_client_organization_id_organization_id_fk": {
2392
+ "name": "client_review_client_organization_id_organization_id_fk",
2393
+ "tableFrom": "client_review",
2394
+ "tableTo": "organization",
2395
+ "columnsFrom": ["client_organization_id"],
2396
+ "columnsTo": ["id"],
2397
+ "onDelete": "restrict",
2398
+ "onUpdate": "no action"
2399
+ },
2400
+ "client_review_reviewer_user_id_user_id_fk": {
2401
+ "name": "client_review_reviewer_user_id_user_id_fk",
2402
+ "tableFrom": "client_review",
2403
+ "tableTo": "user",
2404
+ "columnsFrom": ["reviewer_user_id"],
2405
+ "columnsTo": ["id"],
2406
+ "onDelete": "set null",
2407
+ "onUpdate": "no action"
2408
+ }
2409
+ },
2410
+ "compositePrimaryKeys": {},
2411
+ "uniqueConstraints": {},
2412
+ "policies": {},
2413
+ "checkConstraints": {},
2414
+ "isRLSEnabled": false
2415
+ },
2416
+ "timesheets.client_review_history": {
2417
+ "name": "client_review_history",
2418
+ "schema": "timesheets",
2419
+ "columns": {
2420
+ "id": {
2421
+ "name": "id",
2422
+ "type": "text",
2423
+ "primaryKey": true,
2424
+ "notNull": true
2425
+ },
2426
+ "weekly_timesheet_id": {
2427
+ "name": "weekly_timesheet_id",
2428
+ "type": "text",
2429
+ "primaryKey": false,
2430
+ "notNull": true
2431
+ },
2432
+ "client_organization_id": {
2433
+ "name": "client_organization_id",
2434
+ "type": "text",
2435
+ "primaryKey": false,
2436
+ "notNull": true
2437
+ },
2438
+ "action": {
2439
+ "name": "action",
2440
+ "type": "client_review_action",
2441
+ "typeSchema": "timesheets",
2442
+ "primaryKey": false,
2443
+ "notNull": true
2444
+ },
2445
+ "actor_user_id": {
2446
+ "name": "actor_user_id",
2447
+ "type": "text",
2448
+ "primaryKey": false,
2449
+ "notNull": true
2450
+ },
2451
+ "comment": {
2452
+ "name": "comment",
2453
+ "type": "text",
2454
+ "primaryKey": false,
2455
+ "notNull": false
2456
+ },
2457
+ "created_at": {
2458
+ "name": "created_at",
2459
+ "type": "timestamp",
2460
+ "primaryKey": false,
2461
+ "notNull": true,
2462
+ "default": "now()"
2463
+ }
2464
+ },
2465
+ "indexes": {
2466
+ "client_review_history_week_client_idx": {
2467
+ "name": "client_review_history_week_client_idx",
2468
+ "columns": [
2469
+ {
2470
+ "expression": "weekly_timesheet_id",
2471
+ "isExpression": false,
2472
+ "asc": true,
2473
+ "nulls": "last"
2474
+ },
2475
+ {
2476
+ "expression": "client_organization_id",
2477
+ "isExpression": false,
2478
+ "asc": true,
2479
+ "nulls": "last"
2480
+ },
2481
+ {
2482
+ "expression": "created_at",
2483
+ "isExpression": false,
2484
+ "asc": true,
2485
+ "nulls": "last"
2486
+ }
2487
+ ],
2488
+ "isUnique": false,
2489
+ "concurrently": false,
2490
+ "method": "btree",
2491
+ "with": {}
2492
+ }
2493
+ },
2494
+ "foreignKeys": {
2495
+ "client_review_history_weekly_timesheet_id_weekly_timesheet_id_fk": {
2496
+ "name": "client_review_history_weekly_timesheet_id_weekly_timesheet_id_fk",
2497
+ "tableFrom": "client_review_history",
2498
+ "tableTo": "weekly_timesheet",
2499
+ "schemaTo": "timesheets",
2500
+ "columnsFrom": ["weekly_timesheet_id"],
2501
+ "columnsTo": ["id"],
2502
+ "onDelete": "cascade",
2503
+ "onUpdate": "no action"
2504
+ },
2505
+ "client_review_history_client_organization_id_organization_id_fk": {
2506
+ "name": "client_review_history_client_organization_id_organization_id_fk",
2507
+ "tableFrom": "client_review_history",
2508
+ "tableTo": "organization",
2509
+ "columnsFrom": ["client_organization_id"],
2510
+ "columnsTo": ["id"],
2511
+ "onDelete": "restrict",
2512
+ "onUpdate": "no action"
2513
+ },
2514
+ "client_review_history_actor_user_id_user_id_fk": {
2515
+ "name": "client_review_history_actor_user_id_user_id_fk",
2516
+ "tableFrom": "client_review_history",
2517
+ "tableTo": "user",
2518
+ "columnsFrom": ["actor_user_id"],
2519
+ "columnsTo": ["id"],
2520
+ "onDelete": "restrict",
2521
+ "onUpdate": "no action"
2522
+ }
2523
+ },
2524
+ "compositePrimaryKeys": {},
2525
+ "uniqueConstraints": {},
2526
+ "policies": {},
2527
+ "checkConstraints": {},
2528
+ "isRLSEnabled": false
2529
+ },
2530
+ "timesheets.weekly_timesheet": {
2531
+ "name": "weekly_timesheet",
2532
+ "schema": "timesheets",
2533
+ "columns": {
2534
+ "id": {
2535
+ "name": "id",
2536
+ "type": "text",
2537
+ "primaryKey": true,
2538
+ "notNull": true
2539
+ },
2540
+ "organization_id": {
2541
+ "name": "organization_id",
2542
+ "type": "text",
2543
+ "primaryKey": false,
2544
+ "notNull": true
2545
+ },
2546
+ "user_id": {
2547
+ "name": "user_id",
2548
+ "type": "text",
2549
+ "primaryKey": false,
2550
+ "notNull": true
2551
+ },
2552
+ "week_starts_on": {
2553
+ "name": "week_starts_on",
2554
+ "type": "date",
2555
+ "primaryKey": false,
2556
+ "notNull": true
2557
+ },
2558
+ "status": {
2559
+ "name": "status",
2560
+ "type": "timesheet_status",
2561
+ "typeSchema": "timesheets",
2562
+ "primaryKey": false,
2563
+ "notNull": true,
2564
+ "default": "'DRAFT'"
2565
+ },
2566
+ "submitted_at": {
2567
+ "name": "submitted_at",
2568
+ "type": "timestamp",
2569
+ "primaryKey": false,
2570
+ "notNull": false
2571
+ },
2572
+ "reviewed_at": {
2573
+ "name": "reviewed_at",
2574
+ "type": "timestamp",
2575
+ "primaryKey": false,
2576
+ "notNull": false
2577
+ },
2578
+ "reviewed_by_id": {
2579
+ "name": "reviewed_by_id",
2580
+ "type": "text",
2581
+ "primaryKey": false,
2582
+ "notNull": false
2583
+ },
2584
+ "rejection_comment": {
2585
+ "name": "rejection_comment",
2586
+ "type": "text",
2587
+ "primaryKey": false,
2588
+ "notNull": false
2589
+ },
2590
+ "created_at": {
2591
+ "name": "created_at",
2592
+ "type": "timestamp",
2593
+ "primaryKey": false,
2594
+ "notNull": true,
2595
+ "default": "now()"
2596
+ },
2597
+ "updated_at": {
2598
+ "name": "updated_at",
2599
+ "type": "timestamp",
2600
+ "primaryKey": false,
2601
+ "notNull": true,
2602
+ "default": "now()"
2603
+ }
2604
+ },
2605
+ "indexes": {
2606
+ "weekly_timesheet_org_user_week_uidx": {
2607
+ "name": "weekly_timesheet_org_user_week_uidx",
2608
+ "columns": [
2609
+ {
2610
+ "expression": "organization_id",
2611
+ "isExpression": false,
2612
+ "asc": true,
2613
+ "nulls": "last"
2614
+ },
2615
+ {
2616
+ "expression": "user_id",
2617
+ "isExpression": false,
2618
+ "asc": true,
2619
+ "nulls": "last"
2620
+ },
2621
+ {
2622
+ "expression": "week_starts_on",
2623
+ "isExpression": false,
2624
+ "asc": true,
2625
+ "nulls": "last"
2626
+ }
2627
+ ],
2628
+ "isUnique": true,
2629
+ "concurrently": false,
2630
+ "method": "btree",
2631
+ "with": {}
2632
+ },
2633
+ "weekly_timesheet_org_status_idx": {
2634
+ "name": "weekly_timesheet_org_status_idx",
2635
+ "columns": [
2636
+ {
2637
+ "expression": "organization_id",
2638
+ "isExpression": false,
2639
+ "asc": true,
2640
+ "nulls": "last"
2641
+ },
2642
+ {
2643
+ "expression": "status",
2644
+ "isExpression": false,
2645
+ "asc": true,
2646
+ "nulls": "last"
2647
+ }
2648
+ ],
2649
+ "isUnique": false,
2650
+ "concurrently": false,
2651
+ "method": "btree",
2652
+ "with": {}
2653
+ }
2654
+ },
2655
+ "foreignKeys": {
2656
+ "weekly_timesheet_organization_id_organization_id_fk": {
2657
+ "name": "weekly_timesheet_organization_id_organization_id_fk",
2658
+ "tableFrom": "weekly_timesheet",
2659
+ "tableTo": "organization",
2660
+ "columnsFrom": ["organization_id"],
2661
+ "columnsTo": ["id"],
2662
+ "onDelete": "cascade",
2663
+ "onUpdate": "no action"
2664
+ },
2665
+ "weekly_timesheet_user_id_user_id_fk": {
2666
+ "name": "weekly_timesheet_user_id_user_id_fk",
2667
+ "tableFrom": "weekly_timesheet",
2668
+ "tableTo": "user",
2669
+ "columnsFrom": ["user_id"],
2670
+ "columnsTo": ["id"],
2671
+ "onDelete": "cascade",
2672
+ "onUpdate": "no action"
2673
+ },
2674
+ "weekly_timesheet_reviewed_by_id_user_id_fk": {
2675
+ "name": "weekly_timesheet_reviewed_by_id_user_id_fk",
2676
+ "tableFrom": "weekly_timesheet",
2677
+ "tableTo": "user",
2678
+ "columnsFrom": ["reviewed_by_id"],
2679
+ "columnsTo": ["id"],
2680
+ "onDelete": "set null",
2681
+ "onUpdate": "no action"
2682
+ }
2683
+ },
2684
+ "compositePrimaryKeys": {},
2685
+ "uniqueConstraints": {},
2686
+ "policies": {},
2687
+ "checkConstraints": {},
2688
+ "isRLSEnabled": false
2689
+ },
2690
+ "timesheets.workspace_client": {
2691
+ "name": "workspace_client",
2692
+ "schema": "timesheets",
2693
+ "columns": {
2694
+ "id": {
2695
+ "name": "id",
2696
+ "type": "text",
2697
+ "primaryKey": true,
2698
+ "notNull": true
2699
+ },
2700
+ "workspace_organization_id": {
2701
+ "name": "workspace_organization_id",
2702
+ "type": "text",
2703
+ "primaryKey": false,
2704
+ "notNull": true
2705
+ },
2706
+ "client_organization_id": {
2707
+ "name": "client_organization_id",
2708
+ "type": "text",
2709
+ "primaryKey": false,
2710
+ "notNull": true
2711
+ },
2712
+ "access_mode": {
2713
+ "name": "access_mode",
2714
+ "type": "client_access_mode",
2715
+ "typeSchema": "timesheets",
2716
+ "primaryKey": false,
2717
+ "notNull": true,
2718
+ "default": "'DISABLED'"
2719
+ },
2720
+ "invoice_access_enabled": {
2721
+ "name": "invoice_access_enabled",
2722
+ "type": "boolean",
2723
+ "primaryKey": false,
2724
+ "notNull": true,
2725
+ "default": false
2726
+ },
2727
+ "created_at": {
2728
+ "name": "created_at",
2729
+ "type": "timestamp",
2730
+ "primaryKey": false,
2731
+ "notNull": true,
2732
+ "default": "now()"
2733
+ },
2734
+ "updated_at": {
2735
+ "name": "updated_at",
2736
+ "type": "timestamp",
2737
+ "primaryKey": false,
2738
+ "notNull": true,
2739
+ "default": "now()"
2740
+ }
2741
+ },
2742
+ "indexes": {
2743
+ "workspace_client_workspace_client_uidx": {
2744
+ "name": "workspace_client_workspace_client_uidx",
2745
+ "columns": [
2746
+ {
2747
+ "expression": "workspace_organization_id",
2748
+ "isExpression": false,
2749
+ "asc": true,
2750
+ "nulls": "last"
2751
+ },
2752
+ {
2753
+ "expression": "client_organization_id",
2754
+ "isExpression": false,
2755
+ "asc": true,
2756
+ "nulls": "last"
2757
+ }
2758
+ ],
2759
+ "isUnique": true,
2760
+ "concurrently": false,
2761
+ "method": "btree",
2762
+ "with": {}
2763
+ },
2764
+ "workspace_client_workspace_idx": {
2765
+ "name": "workspace_client_workspace_idx",
2766
+ "columns": [
2767
+ {
2768
+ "expression": "workspace_organization_id",
2769
+ "isExpression": false,
2770
+ "asc": true,
2771
+ "nulls": "last"
2772
+ }
2773
+ ],
2774
+ "isUnique": false,
2775
+ "concurrently": false,
2776
+ "method": "btree",
2777
+ "with": {}
2778
+ }
2779
+ },
2780
+ "foreignKeys": {
2781
+ "workspace_client_workspace_organization_id_organization_id_fk": {
2782
+ "name": "workspace_client_workspace_organization_id_organization_id_fk",
2783
+ "tableFrom": "workspace_client",
2784
+ "tableTo": "organization",
2785
+ "columnsFrom": ["workspace_organization_id"],
2786
+ "columnsTo": ["id"],
2787
+ "onDelete": "cascade",
2788
+ "onUpdate": "no action"
2789
+ },
2790
+ "workspace_client_client_organization_id_organization_id_fk": {
2791
+ "name": "workspace_client_client_organization_id_organization_id_fk",
2792
+ "tableFrom": "workspace_client",
2793
+ "tableTo": "organization",
2794
+ "columnsFrom": ["client_organization_id"],
2795
+ "columnsTo": ["id"],
2796
+ "onDelete": "restrict",
2797
+ "onUpdate": "no action"
2798
+ }
2799
+ },
2800
+ "compositePrimaryKeys": {},
2801
+ "uniqueConstraints": {},
2802
+ "policies": {},
2803
+ "checkConstraints": {},
2804
+ "isRLSEnabled": false
2805
+ },
2806
+ "timesheets.workspace_client_invoice_viewer": {
2807
+ "name": "workspace_client_invoice_viewer",
2808
+ "schema": "timesheets",
2809
+ "columns": {
2810
+ "id": {
2811
+ "name": "id",
2812
+ "type": "text",
2813
+ "primaryKey": true,
2814
+ "notNull": true
2815
+ },
2816
+ "workspace_client_id": {
2817
+ "name": "workspace_client_id",
2818
+ "type": "text",
2819
+ "primaryKey": false,
2820
+ "notNull": true
2821
+ },
2822
+ "user_id": {
2823
+ "name": "user_id",
2824
+ "type": "text",
2825
+ "primaryKey": false,
2826
+ "notNull": true
2827
+ },
2828
+ "created_by_id": {
2829
+ "name": "created_by_id",
2830
+ "type": "text",
2831
+ "primaryKey": false,
2832
+ "notNull": true
2833
+ },
2834
+ "created_at": {
2835
+ "name": "created_at",
2836
+ "type": "timestamp",
2837
+ "primaryKey": false,
2838
+ "notNull": true,
2839
+ "default": "now()"
2840
+ }
2841
+ },
2842
+ "indexes": {
2843
+ "workspace_client_invoice_viewer_link_user_uidx": {
2844
+ "name": "workspace_client_invoice_viewer_link_user_uidx",
2845
+ "columns": [
2846
+ {
2847
+ "expression": "workspace_client_id",
2848
+ "isExpression": false,
2849
+ "asc": true,
2850
+ "nulls": "last"
2851
+ },
2852
+ {
2853
+ "expression": "user_id",
2854
+ "isExpression": false,
2855
+ "asc": true,
2856
+ "nulls": "last"
2857
+ }
2858
+ ],
2859
+ "isUnique": true,
2860
+ "concurrently": false,
2861
+ "method": "btree",
2862
+ "with": {}
2863
+ },
2864
+ "workspace_client_invoice_viewer_user_idx": {
2865
+ "name": "workspace_client_invoice_viewer_user_idx",
2866
+ "columns": [
2867
+ {
2868
+ "expression": "user_id",
2869
+ "isExpression": false,
2870
+ "asc": true,
2871
+ "nulls": "last"
2872
+ }
2873
+ ],
2874
+ "isUnique": false,
2875
+ "concurrently": false,
2876
+ "method": "btree",
2877
+ "with": {}
2878
+ }
2879
+ },
2880
+ "foreignKeys": {
2881
+ "workspace_client_invoice_viewer_workspace_client_id_workspace_client_id_fk": {
2882
+ "name": "workspace_client_invoice_viewer_workspace_client_id_workspace_client_id_fk",
2883
+ "tableFrom": "workspace_client_invoice_viewer",
2884
+ "tableTo": "workspace_client",
2885
+ "schemaTo": "timesheets",
2886
+ "columnsFrom": ["workspace_client_id"],
2887
+ "columnsTo": ["id"],
2888
+ "onDelete": "cascade",
2889
+ "onUpdate": "no action"
2890
+ },
2891
+ "workspace_client_invoice_viewer_user_id_user_id_fk": {
2892
+ "name": "workspace_client_invoice_viewer_user_id_user_id_fk",
2893
+ "tableFrom": "workspace_client_invoice_viewer",
2894
+ "tableTo": "user",
2895
+ "columnsFrom": ["user_id"],
2896
+ "columnsTo": ["id"],
2897
+ "onDelete": "cascade",
2898
+ "onUpdate": "no action"
2899
+ },
2900
+ "workspace_client_invoice_viewer_created_by_id_user_id_fk": {
2901
+ "name": "workspace_client_invoice_viewer_created_by_id_user_id_fk",
2902
+ "tableFrom": "workspace_client_invoice_viewer",
2903
+ "tableTo": "user",
2904
+ "columnsFrom": ["created_by_id"],
2905
+ "columnsTo": ["id"],
2906
+ "onDelete": "restrict",
2907
+ "onUpdate": "no action"
2908
+ }
2909
+ },
2910
+ "compositePrimaryKeys": {},
2911
+ "uniqueConstraints": {},
2912
+ "policies": {},
2913
+ "checkConstraints": {},
2914
+ "isRLSEnabled": false
2915
+ },
2916
+ "timesheets.workspace_client_reviewer": {
2917
+ "name": "workspace_client_reviewer",
2918
+ "schema": "timesheets",
2919
+ "columns": {
2920
+ "id": {
2921
+ "name": "id",
2922
+ "type": "text",
2923
+ "primaryKey": true,
2924
+ "notNull": true
2925
+ },
2926
+ "workspace_client_id": {
2927
+ "name": "workspace_client_id",
2928
+ "type": "text",
2929
+ "primaryKey": false,
2930
+ "notNull": true
2931
+ },
2932
+ "user_id": {
2933
+ "name": "user_id",
2934
+ "type": "text",
2935
+ "primaryKey": false,
2936
+ "notNull": true
2937
+ },
2938
+ "created_by_id": {
2939
+ "name": "created_by_id",
2940
+ "type": "text",
2941
+ "primaryKey": false,
2942
+ "notNull": true
2943
+ },
2944
+ "created_at": {
2945
+ "name": "created_at",
2946
+ "type": "timestamp",
2947
+ "primaryKey": false,
2948
+ "notNull": true,
2949
+ "default": "now()"
2950
+ }
2951
+ },
2952
+ "indexes": {
2953
+ "workspace_client_reviewer_link_user_uidx": {
2954
+ "name": "workspace_client_reviewer_link_user_uidx",
2955
+ "columns": [
2956
+ {
2957
+ "expression": "workspace_client_id",
2958
+ "isExpression": false,
2959
+ "asc": true,
2960
+ "nulls": "last"
2961
+ },
2962
+ {
2963
+ "expression": "user_id",
2964
+ "isExpression": false,
2965
+ "asc": true,
2966
+ "nulls": "last"
2967
+ }
2968
+ ],
2969
+ "isUnique": true,
2970
+ "concurrently": false,
2971
+ "method": "btree",
2972
+ "with": {}
2973
+ },
2974
+ "workspace_client_reviewer_user_idx": {
2975
+ "name": "workspace_client_reviewer_user_idx",
2976
+ "columns": [
2977
+ {
2978
+ "expression": "user_id",
2979
+ "isExpression": false,
2980
+ "asc": true,
2981
+ "nulls": "last"
2982
+ }
2983
+ ],
2984
+ "isUnique": false,
2985
+ "concurrently": false,
2986
+ "method": "btree",
2987
+ "with": {}
2988
+ }
2989
+ },
2990
+ "foreignKeys": {
2991
+ "workspace_client_reviewer_workspace_client_id_workspace_client_id_fk": {
2992
+ "name": "workspace_client_reviewer_workspace_client_id_workspace_client_id_fk",
2993
+ "tableFrom": "workspace_client_reviewer",
2994
+ "tableTo": "workspace_client",
2995
+ "schemaTo": "timesheets",
2996
+ "columnsFrom": ["workspace_client_id"],
2997
+ "columnsTo": ["id"],
2998
+ "onDelete": "cascade",
2999
+ "onUpdate": "no action"
3000
+ },
3001
+ "workspace_client_reviewer_user_id_user_id_fk": {
3002
+ "name": "workspace_client_reviewer_user_id_user_id_fk",
3003
+ "tableFrom": "workspace_client_reviewer",
3004
+ "tableTo": "user",
3005
+ "columnsFrom": ["user_id"],
3006
+ "columnsTo": ["id"],
3007
+ "onDelete": "cascade",
3008
+ "onUpdate": "no action"
3009
+ },
3010
+ "workspace_client_reviewer_created_by_id_user_id_fk": {
3011
+ "name": "workspace_client_reviewer_created_by_id_user_id_fk",
3012
+ "tableFrom": "workspace_client_reviewer",
3013
+ "tableTo": "user",
3014
+ "columnsFrom": ["created_by_id"],
3015
+ "columnsTo": ["id"],
3016
+ "onDelete": "restrict",
3017
+ "onUpdate": "no action"
3018
+ }
3019
+ },
3020
+ "compositePrimaryKeys": {},
3021
+ "uniqueConstraints": {},
3022
+ "policies": {},
3023
+ "checkConstraints": {},
3024
+ "isRLSEnabled": false
3025
+ },
3026
+ "timesheets.workspace_settings": {
3027
+ "name": "workspace_settings",
3028
+ "schema": "timesheets",
3029
+ "columns": {
3030
+ "organization_id": {
3031
+ "name": "organization_id",
3032
+ "type": "text",
3033
+ "primaryKey": true,
3034
+ "notNull": true
3035
+ },
3036
+ "currency": {
3037
+ "name": "currency",
3038
+ "type": "text",
3039
+ "primaryKey": false,
3040
+ "notNull": true,
3041
+ "default": "'EUR'"
3042
+ },
3043
+ "timezone": {
3044
+ "name": "timezone",
3045
+ "type": "text",
3046
+ "primaryKey": false,
3047
+ "notNull": true,
3048
+ "default": "'Europe/Amsterdam'"
3049
+ },
3050
+ "default_vat_rate_basis_points": {
3051
+ "name": "default_vat_rate_basis_points",
3052
+ "type": "integer",
3053
+ "primaryKey": false,
3054
+ "notNull": true,
3055
+ "default": 2100
3056
+ },
3057
+ "week_starts_on": {
3058
+ "name": "week_starts_on",
3059
+ "type": "integer",
3060
+ "primaryKey": false,
3061
+ "notNull": true,
3062
+ "default": 1
3063
+ },
3064
+ "workspace_enabled": {
3065
+ "name": "workspace_enabled",
3066
+ "type": "boolean",
3067
+ "primaryKey": false,
3068
+ "notNull": true,
3069
+ "default": false
3070
+ },
3071
+ "invoicing_enabled": {
3072
+ "name": "invoicing_enabled",
3073
+ "type": "boolean",
3074
+ "primaryKey": false,
3075
+ "notNull": true,
3076
+ "default": false
3077
+ },
3078
+ "internal_approvals_enabled": {
3079
+ "name": "internal_approvals_enabled",
3080
+ "type": "boolean",
3081
+ "primaryKey": false,
3082
+ "notNull": true,
3083
+ "default": true
3084
+ },
3085
+ "created_at": {
3086
+ "name": "created_at",
3087
+ "type": "timestamp",
3088
+ "primaryKey": false,
3089
+ "notNull": true,
3090
+ "default": "now()"
3091
+ },
3092
+ "updated_at": {
3093
+ "name": "updated_at",
3094
+ "type": "timestamp",
3095
+ "primaryKey": false,
3096
+ "notNull": true,
3097
+ "default": "now()"
3098
+ }
3099
+ },
3100
+ "indexes": {},
3101
+ "foreignKeys": {
3102
+ "workspace_settings_organization_id_organization_id_fk": {
3103
+ "name": "workspace_settings_organization_id_organization_id_fk",
3104
+ "tableFrom": "workspace_settings",
3105
+ "tableTo": "organization",
3106
+ "columnsFrom": ["organization_id"],
3107
+ "columnsTo": ["id"],
3108
+ "onDelete": "cascade",
3109
+ "onUpdate": "no action"
3110
+ }
3111
+ },
3112
+ "compositePrimaryKeys": {},
3113
+ "uniqueConstraints": {},
3114
+ "policies": {},
3115
+ "checkConstraints": {},
3116
+ "isRLSEnabled": false
3117
+ }
3118
+ },
3119
+ "enums": {
3120
+ "timesheets.approval_action": {
3121
+ "name": "approval_action",
3122
+ "schema": "timesheets",
3123
+ "values": ["SUBMITTED", "APPROVED", "REJECTED", "REOPENED"]
3124
+ },
3125
+ "timesheets.client_access_mode": {
3126
+ "name": "client_access_mode",
3127
+ "schema": "timesheets",
3128
+ "values": ["DISABLED", "VIEW", "REVIEW"]
3129
+ },
3130
+ "timesheets.client_review_action": {
3131
+ "name": "client_review_action",
3132
+ "schema": "timesheets",
3133
+ "values": ["APPROVED", "DISPUTED"]
3134
+ },
3135
+ "timesheets.client_review_status": {
3136
+ "name": "client_review_status",
3137
+ "schema": "timesheets",
3138
+ "values": ["PENDING", "APPROVED", "DISPUTED"]
3139
+ },
3140
+ "timesheets.invoice_email_delivery_status": {
3141
+ "name": "invoice_email_delivery_status",
3142
+ "schema": "timesheets",
3143
+ "values": ["PENDING", "SENT", "FAILED"]
3144
+ },
3145
+ "timesheets.invoice_email_purpose": {
3146
+ "name": "invoice_email_purpose",
3147
+ "schema": "timesheets",
3148
+ "values": ["INVOICE", "REMINDER"]
3149
+ },
3150
+ "timesheets.invoice_status": {
3151
+ "name": "invoice_status",
3152
+ "schema": "timesheets",
3153
+ "values": ["DRAFT", "ISSUED", "PAID", "VOID"]
3154
+ },
3155
+ "timesheets.project_status": {
3156
+ "name": "project_status",
3157
+ "schema": "timesheets",
3158
+ "values": ["ACTIVE", "ARCHIVED"]
3159
+ },
3160
+ "timesheets.timesheet_status": {
3161
+ "name": "timesheet_status",
3162
+ "schema": "timesheets",
3163
+ "values": ["DRAFT", "SUBMITTED", "APPROVED", "REJECTED"]
3164
+ }
3165
+ },
3166
+ "schemas": {
3167
+ "timesheets": "timesheets"
3168
+ },
3169
+ "sequences": {},
3170
+ "roles": {},
3171
+ "policies": {},
3172
+ "views": {},
3173
+ "_meta": {
3174
+ "columns": {},
3175
+ "schemas": {},
3176
+ "tables": {}
3177
+ }
3178
+ }