@hed-hog/operations 0.0.306 → 0.0.310

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 (123) hide show
  1. package/dist/controllers/operations-approvals.controller.d.ts +114 -1
  2. package/dist/controllers/operations-approvals.controller.d.ts.map +1 -1
  3. package/dist/controllers/operations-approvals.controller.js +16 -3
  4. package/dist/controllers/operations-approvals.controller.js.map +1 -1
  5. package/dist/controllers/operations-collaborators.controller.d.ts +16 -1
  6. package/dist/controllers/operations-collaborators.controller.d.ts.map +1 -1
  7. package/dist/controllers/operations-collaborators.controller.js +16 -3
  8. package/dist/controllers/operations-collaborators.controller.js.map +1 -1
  9. package/dist/controllers/operations-contracts.controller.d.ts +14 -453
  10. package/dist/controllers/operations-contracts.controller.d.ts.map +1 -1
  11. package/dist/controllers/operations-contracts.controller.js +11 -112
  12. package/dist/controllers/operations-contracts.controller.js.map +1 -1
  13. package/dist/controllers/operations-org-structure.controller.d.ts +65 -2
  14. package/dist/controllers/operations-org-structure.controller.d.ts.map +1 -1
  15. package/dist/controllers/operations-org-structure.controller.js +18 -5
  16. package/dist/controllers/operations-org-structure.controller.js.map +1 -1
  17. package/dist/controllers/operations-projects.controller.d.ts +28 -4
  18. package/dist/controllers/operations-projects.controller.d.ts.map +1 -1
  19. package/dist/controllers/operations-projects.controller.js +17 -5
  20. package/dist/controllers/operations-projects.controller.js.map +1 -1
  21. package/dist/controllers/operations-timesheets.controller.d.ts +31 -4
  22. package/dist/controllers/operations-timesheets.controller.d.ts.map +1 -1
  23. package/dist/controllers/operations-timesheets.controller.js +16 -11
  24. package/dist/controllers/operations-timesheets.controller.js.map +1 -1
  25. package/dist/dto/list-approvals.dto.d.ts +6 -0
  26. package/dist/dto/list-approvals.dto.d.ts.map +1 -0
  27. package/dist/dto/list-approvals.dto.js +28 -0
  28. package/dist/dto/list-approvals.dto.js.map +1 -0
  29. package/dist/dto/list-collaborator-types.dto.d.ts +3 -1
  30. package/dist/dto/list-collaborator-types.dto.d.ts.map +1 -1
  31. package/dist/dto/list-collaborator-types.dto.js +7 -1
  32. package/dist/dto/list-collaborator-types.dto.js.map +1 -1
  33. package/dist/dto/list-collaborators.dto.d.ts +1 -0
  34. package/dist/dto/list-collaborators.dto.d.ts.map +1 -1
  35. package/dist/dto/list-collaborators.dto.js +5 -0
  36. package/dist/dto/list-collaborators.dto.js.map +1 -1
  37. package/dist/dto/list-contracts.dto.d.ts +8 -0
  38. package/dist/dto/list-contracts.dto.d.ts.map +1 -0
  39. package/dist/dto/list-contracts.dto.js +38 -0
  40. package/dist/dto/list-contracts.dto.js.map +1 -0
  41. package/dist/dto/list-departments.dto.d.ts +5 -0
  42. package/dist/dto/list-departments.dto.d.ts.map +1 -0
  43. package/dist/dto/list-departments.dto.js +23 -0
  44. package/dist/dto/list-departments.dto.js.map +1 -0
  45. package/dist/dto/list-projects.dto.d.ts +5 -0
  46. package/dist/dto/list-projects.dto.d.ts.map +1 -0
  47. package/dist/dto/list-projects.dto.js +23 -0
  48. package/dist/dto/list-projects.dto.js.map +1 -0
  49. package/dist/dto/list-schedule-adjustments.dto.d.ts +5 -0
  50. package/dist/dto/list-schedule-adjustments.dto.d.ts.map +1 -0
  51. package/dist/dto/list-schedule-adjustments.dto.js +23 -0
  52. package/dist/dto/list-schedule-adjustments.dto.js.map +1 -0
  53. package/dist/dto/list-time-off-requests.dto.d.ts +5 -0
  54. package/dist/dto/list-time-off-requests.dto.d.ts.map +1 -0
  55. package/dist/dto/list-time-off-requests.dto.js +23 -0
  56. package/dist/dto/list-time-off-requests.dto.js.map +1 -0
  57. package/dist/dto/list-timesheets.dto.d.ts +5 -0
  58. package/dist/dto/list-timesheets.dto.d.ts.map +1 -0
  59. package/dist/dto/list-timesheets.dto.js +23 -0
  60. package/dist/dto/list-timesheets.dto.js.map +1 -0
  61. package/dist/dto/reorder-collaborator-types.dto.d.ts +4 -0
  62. package/dist/dto/reorder-collaborator-types.dto.d.ts.map +1 -0
  63. package/dist/dto/reorder-collaborator-types.dto.js +25 -0
  64. package/dist/dto/reorder-collaborator-types.dto.js.map +1 -0
  65. package/dist/operations.service.d.ts +340 -271
  66. package/dist/operations.service.d.ts.map +1 -1
  67. package/dist/operations.service.js +1007 -1043
  68. package/dist/operations.service.js.map +1 -1
  69. package/dist/operations.service.spec.js +0 -22
  70. package/dist/operations.service.spec.js.map +1 -1
  71. package/hedhog/data/menu.yaml +0 -36
  72. package/hedhog/data/route.yaml +42 -73
  73. package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +8 -1
  74. package/hedhog/frontend/app/_components/collaborator-select-with-create.tsx.ejs +15 -10
  75. package/hedhog/frontend/app/_components/contract-details-screen.tsx.ejs +108 -213
  76. package/hedhog/frontend/app/_components/contract-form-screen.tsx.ejs +251 -2039
  77. package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +167 -60
  78. package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +70 -301
  79. package/hedhog/frontend/app/_components/system-user-select-with-create.tsx.ejs +102 -51
  80. package/hedhog/frontend/app/_lib/types.ts.ejs +19 -24
  81. package/hedhog/frontend/app/_lib/utils/format.ts.ejs +14 -9
  82. package/hedhog/frontend/app/approvals/page.tsx.ejs +842 -150
  83. package/hedhog/frontend/app/collaborator-types/page.tsx.ejs +445 -153
  84. package/hedhog/frontend/app/collaborators/page.tsx.ejs +118 -49
  85. package/hedhog/frontend/app/contracts/[id]/page.tsx.ejs +2 -2
  86. package/hedhog/frontend/app/contracts/page.tsx.ejs +215 -617
  87. package/hedhog/frontend/app/departments/page.tsx.ejs +257 -113
  88. package/hedhog/frontend/app/projects/page.tsx.ejs +90 -51
  89. package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +412 -147
  90. package/hedhog/frontend/app/time-off/page.tsx.ejs +400 -123
  91. package/hedhog/frontend/app/timesheets/page.tsx.ejs +460 -365
  92. package/hedhog/frontend/messages/en.json +143 -14
  93. package/hedhog/frontend/messages/pt.json +192 -54
  94. package/hedhog/table/operations_contract.yaml +0 -9
  95. package/package.json +4 -4
  96. package/src/controllers/operations-approvals.controller.ts +9 -3
  97. package/src/controllers/operations-collaborators.controller.ts +15 -2
  98. package/src/controllers/operations-contracts.controller.ts +8 -92
  99. package/src/controllers/operations-org-structure.controller.ts +17 -4
  100. package/src/controllers/operations-projects.controller.ts +10 -4
  101. package/src/controllers/operations-timesheets.controller.ts +17 -8
  102. package/src/dto/list-approvals.dto.ts +12 -0
  103. package/src/dto/list-collaborator-types.dto.ts +7 -2
  104. package/src/dto/list-collaborators.dto.ts +4 -0
  105. package/src/dto/list-contracts.dto.ts +20 -0
  106. package/src/dto/list-departments.dto.ts +8 -0
  107. package/src/dto/list-projects.dto.ts +8 -0
  108. package/src/dto/list-schedule-adjustments.dto.ts +8 -0
  109. package/src/dto/list-time-off-requests.dto.ts +8 -0
  110. package/src/dto/list-timesheets.dto.ts +8 -0
  111. package/src/dto/reorder-collaborator-types.dto.ts +10 -0
  112. package/src/operations.service.spec.ts +0 -30
  113. package/src/operations.service.ts +1557 -1806
  114. package/hedhog/frontend/app/_components/contract-creation-wizard.tsx.ejs +0 -631
  115. package/hedhog/frontend/app/_components/contract-template-form-screen.tsx.ejs +0 -526
  116. package/hedhog/frontend/app/_components/contract-template-select-with-create.tsx.ejs +0 -247
  117. package/hedhog/frontend/app/_components/contract-wizard-sheet.tsx.ejs +0 -3520
  118. package/hedhog/frontend/app/contracts/templates/page.tsx.ejs +0 -380
  119. package/hedhog/frontend/app/team/page.tsx.ejs +0 -352
  120. package/hedhog/table/operations_contract_financial_term.yaml +0 -40
  121. package/hedhog/table/operations_contract_revision.yaml +0 -38
  122. package/hedhog/table/operations_contract_signature.yaml +0 -38
  123. package/hedhog/table/operations_contract_template.yaml +0 -58
@@ -1,352 +0,0 @@
1
- 'use client';
2
-
3
- import { EmptyState, Page } from '@/components/entity-list';
4
- import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
5
- import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
6
- import {
7
- Table,
8
- TableBody,
9
- TableCell,
10
- TableHead,
11
- TableHeader,
12
- TableRow,
13
- } from '@/components/ui/table';
14
- import { useApp, useQuery } from '@hed-hog/next-app-provider';
15
- import { Users } from 'lucide-react';
16
- import { useTranslations } from 'next-intl';
17
- import { OperationsHeader } from '../_components/operations-header';
18
- import { StatusBadge } from '../_components/status-badge';
19
- import { fetchOperations } from '../_lib/api';
20
- import { useOperationsAccess } from '../_lib/hooks/use-operations-access';
21
- import type { OperationsTeamOverview } from '../_lib/types';
22
- import {
23
- formatDateRange,
24
- formatEnumLabel,
25
- formatHours,
26
- getStatusBadgeClass,
27
- } from '../_lib/utils/format';
28
-
29
- export default function OperationsTeamPage() {
30
- const t = useTranslations('operations.TeamPage');
31
- const commonT = useTranslations('operations.Common');
32
- const { request, currentLocaleCode } = useApp();
33
- const access = useOperationsAccess();
34
-
35
- const { data: team, refetch } = useQuery<OperationsTeamOverview>({
36
- queryKey: ['operations-team-page', currentLocaleCode],
37
- enabled: access.isSupervisor,
38
- queryFn: () => fetchOperations<OperationsTeamOverview>(request, '/operations/team'),
39
- });
40
-
41
- if (!access.isSupervisor && !access.isLoading) {
42
- return (
43
- <Page>
44
- <OperationsHeader
45
- title={t('title')}
46
- description={t('description')}
47
- current={t('breadcrumb')}
48
- />
49
- <EmptyState
50
- icon={<Users className="size-12" />}
51
- title={commonT('states.noAccessTitle')}
52
- description={t('noAccessDescription')}
53
- actionLabel={commonT('actions.refresh')}
54
- onAction={() => void refetch()}
55
- />
56
- </Page>
57
- );
58
- }
59
-
60
- const items = [
61
- {
62
- key: 'members',
63
- title: t('cards.members'),
64
- description: t('cards.membersDescription'),
65
- value: team?.teamMembers.length ?? 0,
66
- },
67
- {
68
- key: 'projects',
69
- title: t('cards.projects'),
70
- description: t('cards.projectsDescription'),
71
- value: team?.projectCount ?? 0,
72
- },
73
- {
74
- key: 'approvals',
75
- title: t('cards.pendingApprovals'),
76
- description: t('cards.pendingApprovalsDescription'),
77
- value: team?.pendingApprovals ?? 0,
78
- },
79
- {
80
- key: 'timeOff',
81
- title: t('cards.timeOff'),
82
- description: t('cards.timeOffDescription'),
83
- value: team?.pendingItems?.timeOffRequests ?? 0,
84
- },
85
- {
86
- key: 'schedule',
87
- title: t('cards.scheduleAdjustments'),
88
- description: t('cards.scheduleAdjustmentsDescription'),
89
- value: team?.pendingItems?.scheduleAdjustmentRequests ?? 0,
90
- },
91
- {
92
- key: 'timesheets',
93
- title: t('cards.timesheets'),
94
- description: t('cards.timesheetsDescription'),
95
- value: team?.pendingItems?.timesheets ?? 0,
96
- },
97
- ];
98
-
99
- return (
100
- <Page>
101
- <OperationsHeader
102
- title={t('title')}
103
- description={t('description')}
104
- current={t('breadcrumb')}
105
- />
106
-
107
- <KpiCardsGrid items={items} columns={4} />
108
-
109
- {team?.teamMembers?.length ? (
110
- <div className="space-y-6">
111
- <div className="overflow-x-auto rounded-md border">
112
- <Table>
113
- <TableHeader>
114
- <TableRow>
115
- <TableHead>{commonT('labels.collaborator')}</TableHead>
116
- <TableHead>{commonT('labels.department')}</TableHead>
117
- <TableHead>{commonT('labels.status')}</TableHead>
118
- <TableHead>{commonT('labels.activeAssignments')}</TableHead>
119
- <TableHead>{commonT('labels.pendingApprovals')}</TableHead>
120
- <TableHead>{t('sections.requests')}</TableHead>
121
- </TableRow>
122
- </TableHeader>
123
- <TableBody>
124
- {team.teamMembers.map((member) => (
125
- <TableRow key={member.id}>
126
- <TableCell>
127
- <div className="font-medium">{member.displayName}</div>
128
- <div className="text-xs text-muted-foreground">
129
- {[
130
- member.code,
131
- member.collaboratorType ||
132
- formatEnumLabel(
133
- member.collaboratorTypeSlug ??
134
- member.collaboratorType
135
- ),
136
- ]
137
- .filter(Boolean)
138
- .join(' • ')}
139
- </div>
140
- </TableCell>
141
- <TableCell>
142
- {[member.department, member.title]
143
- .filter(Boolean)
144
- .join(' • ') || commonT('labels.notAvailable')}
145
- </TableCell>
146
- <TableCell>
147
- <StatusBadge
148
- label={formatEnumLabel(member.status)}
149
- className={getStatusBadgeClass(member.status)}
150
- />
151
- </TableCell>
152
- <TableCell>{member.activeAssignments ?? 0}</TableCell>
153
- <TableCell>{member.pendingApprovals ?? 0}</TableCell>
154
- <TableCell>
155
- <div className="text-sm">
156
- {t('labels.timeOffRequestsCount', {
157
- count: member.pendingTimeOffRequests ?? 0,
158
- })}
159
- </div>
160
- <div className="text-xs text-muted-foreground">
161
- {t('labels.scheduleRequestsCount', {
162
- count: member.pendingScheduleAdjustmentRequests ?? 0,
163
- })}
164
- </div>
165
- </TableCell>
166
- </TableRow>
167
- ))}
168
- </TableBody>
169
- </Table>
170
- </div>
171
-
172
- <div className="grid gap-6 xl:grid-cols-2">
173
- <Card>
174
- <CardHeader>
175
- <CardTitle>{t('sections.pendingApprovals')}</CardTitle>
176
- </CardHeader>
177
- <CardContent>
178
- {team.pendingApprovalQueue.length ? (
179
- <div className="space-y-3">
180
- {team.pendingApprovalQueue.map((approval) => (
181
- <div key={approval.id} className="rounded-lg border p-3">
182
- <div className="flex items-center justify-between gap-3">
183
- <div>
184
- <div className="font-medium">{approval.requesterName}</div>
185
- <div className="text-xs text-muted-foreground">
186
- {formatEnumLabel(approval.targetType)}
187
- </div>
188
- </div>
189
- <StatusBadge
190
- label={formatEnumLabel(approval.status)}
191
- className={getStatusBadgeClass(approval.status)}
192
- />
193
- </div>
194
- <div className="mt-2 text-sm text-muted-foreground">
195
- {approval.targetType === 'timesheet'
196
- ? [
197
- formatDateRange(
198
- approval.timesheetWeekStartDate,
199
- approval.timesheetWeekEndDate
200
- ),
201
- approval.timesheetProjectNames,
202
- formatHours(approval.timesheetTotalHours),
203
- ]
204
- .filter(Boolean)
205
- .join(' • ')
206
- : approval.targetType === 'time_off_request'
207
- ? [
208
- formatEnumLabel(approval.timeOffType),
209
- formatDateRange(
210
- approval.timeOffStartDate,
211
- approval.timeOffEndDate
212
- ),
213
- ]
214
- .filter(Boolean)
215
- .join(' • ')
216
- : [
217
- formatEnumLabel(approval.scheduleRequestScope),
218
- formatDateRange(
219
- approval.scheduleStartDate,
220
- approval.scheduleEndDate
221
- ),
222
- ]
223
- .filter(Boolean)
224
- .join(' • ')}
225
- </div>
226
- </div>
227
- ))}
228
- </div>
229
- ) : (
230
- <div className="text-sm text-muted-foreground">
231
- {t('states.noPendingApprovals')}
232
- </div>
233
- )}
234
- </CardContent>
235
- </Card>
236
-
237
- <Card>
238
- <CardHeader>
239
- <CardTitle>{t('sections.projects')}</CardTitle>
240
- </CardHeader>
241
- <CardContent>
242
- {team.teamProjects.length ? (
243
- <div className="space-y-3">
244
- {team.teamProjects.map((project) => (
245
- <div key={project.id} className="rounded-lg border p-3">
246
- <div className="flex items-center justify-between gap-3">
247
- <div>
248
- <div className="font-medium">{project.name}</div>
249
- <div className="text-xs text-muted-foreground">
250
- {[project.code, project.clientName]
251
- .filter(Boolean)
252
- .join(' • ')}
253
- </div>
254
- </div>
255
- <StatusBadge
256
- label={formatEnumLabel(project.status)}
257
- className={getStatusBadgeClass(project.status)}
258
- />
259
- </div>
260
- <div className="mt-2 text-sm text-muted-foreground">
261
- {t('labels.projectSummary', {
262
- teamSize: project.teamSize,
263
- pendingTimesheets: project.pendingTimesheets,
264
- })}
265
- </div>
266
- </div>
267
- ))}
268
- </div>
269
- ) : (
270
- <div className="text-sm text-muted-foreground">
271
- {t('states.noProjects')}
272
- </div>
273
- )}
274
- </CardContent>
275
- </Card>
276
- </div>
277
-
278
- <div className="grid gap-6 xl:grid-cols-2">
279
- <Card>
280
- <CardHeader>
281
- <CardTitle>{t('sections.timeOff')}</CardTitle>
282
- </CardHeader>
283
- <CardContent>
284
- {team.pendingTimeOffRequests.length ? (
285
- <div className="space-y-3">
286
- {team.pendingTimeOffRequests.map((requestItem) => (
287
- <div key={requestItem.id} className="rounded-lg border p-3">
288
- <div className="font-medium">{requestItem.collaboratorName}</div>
289
- <div className="text-sm text-muted-foreground">
290
- {[
291
- formatEnumLabel(requestItem.requestType),
292
- formatDateRange(requestItem.startDate, requestItem.endDate),
293
- ]
294
- .filter(Boolean)
295
- .join(' • ')}
296
- </div>
297
- </div>
298
- ))}
299
- </div>
300
- ) : (
301
- <div className="text-sm text-muted-foreground">
302
- {t('states.noTimeOff')}
303
- </div>
304
- )}
305
- </CardContent>
306
- </Card>
307
-
308
- <Card>
309
- <CardHeader>
310
- <CardTitle>{t('sections.scheduleAdjustments')}</CardTitle>
311
- </CardHeader>
312
- <CardContent>
313
- {team.pendingScheduleAdjustmentRequests.length ? (
314
- <div className="space-y-3">
315
- {team.pendingScheduleAdjustmentRequests.map((requestItem) => (
316
- <div key={requestItem.id} className="rounded-lg border p-3">
317
- <div className="font-medium">{requestItem.collaboratorName}</div>
318
- <div className="text-sm text-muted-foreground">
319
- {[
320
- formatEnumLabel(requestItem.requestScope),
321
- formatDateRange(
322
- requestItem.effectiveStartDate,
323
- requestItem.effectiveEndDate
324
- ),
325
- ]
326
- .filter(Boolean)
327
- .join(' • ')}
328
- </div>
329
- </div>
330
- ))}
331
- </div>
332
- ) : (
333
- <div className="text-sm text-muted-foreground">
334
- {t('states.noScheduleAdjustments')}
335
- </div>
336
- )}
337
- </CardContent>
338
- </Card>
339
- </div>
340
- </div>
341
- ) : (
342
- <EmptyState
343
- icon={<Users className="size-12" />}
344
- title={commonT('states.emptyTitle')}
345
- description={t('emptyDescription')}
346
- actionLabel={commonT('actions.refresh')}
347
- onAction={() => void refetch()}
348
- />
349
- )}
350
- </Page>
351
- );
352
- }
@@ -1,40 +0,0 @@
1
- columns:
2
- - type: pk
3
- - name: contract_id
4
- type: fk
5
- references:
6
- table: operations_contract
7
- column: id
8
- onDelete: CASCADE
9
- onUpdate: CASCADE
10
- - name: term_type
11
- type: enum
12
- values: [value, payment, revenue, fine, other]
13
- default: value
14
- - name: label
15
- type: varchar
16
- length: 180
17
- - name: amount
18
- type: decimal
19
- precision: 12
20
- scale: 2
21
- - name: recurrence
22
- type: enum
23
- values: [one_time, monthly, quarterly, yearly, other]
24
- default: one_time
25
- - name: due_day
26
- type: int
27
- isNullable: true
28
- - name: notes
29
- type: text
30
- isNullable: true
31
- - name: deleted_at
32
- type: datetime
33
- isNullable: true
34
- - type: created_at
35
- - type: updated_at
36
-
37
- indices:
38
- - columns: [contract_id]
39
- - columns: [term_type]
40
- - columns: [deleted_at]
@@ -1,38 +0,0 @@
1
- columns:
2
- - type: pk
3
- - name: contract_id
4
- type: fk
5
- references:
6
- table: operations_contract
7
- column: id
8
- onDelete: CASCADE
9
- onUpdate: CASCADE
10
- - name: revision_type
11
- type: enum
12
- values: [amendment, renewal, revision, addendum, other]
13
- default: revision
14
- - name: title
15
- type: varchar
16
- length: 180
17
- - name: effective_date
18
- type: date
19
- isNullable: true
20
- - name: status
21
- type: enum
22
- values: [draft, active, completed, cancelled]
23
- default: draft
24
- - name: summary
25
- type: text
26
- isNullable: true
27
- - name: deleted_at
28
- type: datetime
29
- isNullable: true
30
- - type: created_at
31
- - type: updated_at
32
-
33
- indices:
34
- - columns: [contract_id]
35
- - columns: [revision_type]
36
- - columns: [status]
37
- - columns: [effective_date]
38
- - columns: [deleted_at]
@@ -1,38 +0,0 @@
1
- columns:
2
- - type: pk
3
- - name: contract_id
4
- type: fk
5
- references:
6
- table: operations_contract
7
- column: id
8
- onDelete: CASCADE
9
- onUpdate: CASCADE
10
- - name: signer_name
11
- type: varchar
12
- length: 180
13
- - name: signer_role
14
- type: varchar
15
- length: 120
16
- isNullable: true
17
- - name: signer_email
18
- type: varchar
19
- length: 180
20
- isNullable: true
21
- - name: signer_status
22
- type: enum
23
- values: [pending, signed, rejected]
24
- default: pending
25
- - name: signed_at
26
- type: datetime
27
- isNullable: true
28
- - name: deleted_at
29
- type: datetime
30
- isNullable: true
31
- - type: created_at
32
- - type: updated_at
33
-
34
- indices:
35
- - columns: [contract_id]
36
- - columns: [signer_status]
37
- - columns: [signed_at]
38
- - columns: [deleted_at]
@@ -1,58 +0,0 @@
1
- columns:
2
- - type: pk
3
- - type: slug
4
- - name: code
5
- type: varchar
6
- length: 40
7
- isNullable: true
8
- - name: name
9
- type: varchar
10
- length: 180
11
- - name: description
12
- type: text
13
- isNullable: true
14
- - name: contract_category
15
- type: enum
16
- values: [employee, contractor, client, supplier, vendor, partner, internal, other]
17
- default: client
18
- - name: contract_type
19
- type: enum
20
- values: [clt, pj, freelancer_agreement, service_agreement, fixed_term, recurring_service, nda, amendment, addendum, other]
21
- default: service_agreement
22
- - name: billing_model
23
- type: enum
24
- values: [time_and_material, monthly_retainer, fixed_price]
25
- default: time_and_material
26
- - name: signature_status
27
- type: enum
28
- values: [not_started, pending, partially_signed, signed, expired]
29
- default: not_started
30
- - name: is_active
31
- type: boolean
32
- default: true
33
- - name: status
34
- type: enum
35
- values: [draft, active, inactive, archived]
36
- default: active
37
- - name: content_html
38
- type: text
39
- isNullable: true
40
- - name: deleted_at
41
- type: datetime
42
- isNullable: true
43
- - type: created_at
44
- - type: updated_at
45
-
46
- indices:
47
- - columns: [slug]
48
- isUnique: true
49
- - columns: [code]
50
- isUnique: true
51
- - columns: [name]
52
- - columns: [contract_category]
53
- - columns: [contract_type]
54
- - columns: [billing_model]
55
- - columns: [signature_status]
56
- - columns: [is_active]
57
- - columns: [status]
58
- - columns: [deleted_at]