@hed-hog/operations 0.0.302 → 0.0.304
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.
- package/README.md +200 -43
- package/dist/controllers/operations-approvals.controller.d.ts +9 -0
- package/dist/controllers/operations-approvals.controller.d.ts.map +1 -0
- package/dist/controllers/operations-approvals.controller.js +64 -0
- package/dist/controllers/operations-approvals.controller.js.map +1 -0
- package/dist/controllers/operations-collaborators.controller.d.ts +223 -0
- package/dist/controllers/operations-collaborators.controller.d.ts.map +1 -0
- package/dist/controllers/operations-collaborators.controller.js +96 -0
- package/dist/controllers/operations-collaborators.controller.js.map +1 -0
- package/dist/controllers/operations-contracts.controller.d.ts +683 -0
- package/dist/controllers/operations-contracts.controller.d.ts.map +1 -0
- package/dist/controllers/operations-contracts.controller.js +198 -0
- package/dist/controllers/operations-contracts.controller.js.map +1 -0
- package/dist/controllers/operations-org-structure.controller.d.ts +108 -0
- package/dist/controllers/operations-org-structure.controller.d.ts.map +1 -0
- package/dist/controllers/operations-org-structure.controller.js +143 -0
- package/dist/controllers/operations-org-structure.controller.js.map +1 -0
- package/dist/controllers/operations-projects.controller.d.ts +169 -0
- package/dist/controllers/operations-projects.controller.d.ts.map +1 -0
- package/dist/controllers/operations-projects.controller.js +87 -0
- package/dist/controllers/operations-projects.controller.js.map +1 -0
- package/dist/controllers/operations-tasks.controller.d.ts +54 -0
- package/dist/controllers/operations-tasks.controller.d.ts.map +1 -0
- package/dist/controllers/operations-tasks.controller.js +79 -0
- package/dist/controllers/operations-tasks.controller.js.map +1 -0
- package/dist/controllers/operations-timesheets.controller.d.ts +99 -0
- package/dist/controllers/operations-timesheets.controller.d.ts.map +1 -0
- package/dist/controllers/operations-timesheets.controller.js +154 -0
- package/dist/controllers/operations-timesheets.controller.js.map +1 -0
- package/dist/dto/create-collaborator-type.dto.d.ts +10 -0
- package/dist/dto/create-collaborator-type.dto.d.ts.map +1 -0
- package/dist/dto/create-collaborator-type.dto.js +56 -0
- package/dist/dto/create-collaborator-type.dto.js.map +1 -0
- package/dist/dto/create-collaborator.dto.d.ts +42 -0
- package/dist/dto/create-collaborator.dto.d.ts.map +1 -0
- package/dist/dto/create-collaborator.dto.js +228 -0
- package/dist/dto/create-collaborator.dto.js.map +1 -0
- package/dist/dto/create-schedule-adjustment-request.dto.d.ts +17 -0
- package/dist/dto/create-schedule-adjustment-request.dto.d.ts.map +1 -0
- package/dist/dto/create-schedule-adjustment-request.dto.js +89 -0
- package/dist/dto/create-schedule-adjustment-request.dto.js.map +1 -0
- package/dist/dto/create-task.dto.d.ts +8 -0
- package/dist/dto/create-task.dto.d.ts.map +1 -0
- package/dist/dto/create-task.dto.js +50 -0
- package/dist/dto/create-task.dto.js.map +1 -0
- package/dist/dto/create-time-off-request.dto.d.ts +9 -0
- package/dist/dto/create-time-off-request.dto.d.ts.map +1 -0
- package/dist/dto/create-time-off-request.dto.js +54 -0
- package/dist/dto/create-time-off-request.dto.js.map +1 -0
- package/dist/dto/create-timesheet-entry.dto.d.ts +12 -0
- package/dist/dto/create-timesheet-entry.dto.d.ts.map +1 -0
- package/dist/dto/create-timesheet-entry.dto.js +75 -0
- package/dist/dto/create-timesheet-entry.dto.js.map +1 -0
- package/dist/dto/list-collaborator-types.dto.d.ts +4 -0
- package/dist/dto/list-collaborator-types.dto.d.ts.map +1 -0
- package/dist/dto/list-collaborator-types.dto.js +29 -0
- package/dist/dto/list-collaborator-types.dto.js.map +1 -0
- package/dist/dto/list-collaborators.dto.d.ts +8 -0
- package/dist/dto/list-collaborators.dto.d.ts.map +1 -0
- package/dist/dto/list-collaborators.dto.js +42 -0
- package/dist/dto/list-collaborators.dto.js.map +1 -0
- package/dist/dto/list-project-options.dto.d.ts +4 -0
- package/dist/dto/list-project-options.dto.d.ts.map +1 -0
- package/dist/dto/list-project-options.dto.js +8 -0
- package/dist/dto/list-project-options.dto.js.map +1 -0
- package/dist/dto/list-tasks.dto.d.ts +7 -0
- package/dist/dto/list-tasks.dto.d.ts.map +1 -0
- package/dist/dto/list-tasks.dto.js +38 -0
- package/dist/dto/list-tasks.dto.js.map +1 -0
- package/dist/dto/list-timesheet-entries.dto.d.ts +10 -0
- package/dist/dto/list-timesheet-entries.dto.d.ts.map +1 -0
- package/dist/dto/list-timesheet-entries.dto.js +54 -0
- package/dist/dto/list-timesheet-entries.dto.js.map +1 -0
- package/dist/dto/update-collaborator-type.dto.d.ts +4 -0
- package/dist/dto/update-collaborator-type.dto.d.ts.map +1 -0
- package/dist/dto/update-collaborator-type.dto.js +8 -0
- package/dist/dto/update-collaborator-type.dto.js.map +1 -0
- package/dist/dto/update-collaborator.dto.d.ts +4 -0
- package/dist/dto/update-collaborator.dto.d.ts.map +1 -0
- package/dist/dto/update-collaborator.dto.js +8 -0
- package/dist/dto/update-collaborator.dto.js.map +1 -0
- package/dist/dto/update-task.dto.d.ts +8 -0
- package/dist/dto/update-task.dto.d.ts.map +1 -0
- package/dist/dto/update-task.dto.js +51 -0
- package/dist/dto/update-task.dto.js.map +1 -0
- package/dist/operations.controller.d.ts +0 -1045
- package/dist/operations.controller.d.ts.map +1 -1
- package/dist/operations.controller.js +0 -429
- package/dist/operations.controller.js.map +1 -1
- package/dist/operations.module.d.ts.map +1 -1
- package/dist/operations.module.js +23 -2
- package/dist/operations.module.js.map +1 -1
- package/dist/operations.service.d.ts +373 -8
- package/dist/operations.service.d.ts.map +1 -1
- package/dist/operations.service.js +1598 -111
- package/dist/operations.service.js.map +1 -1
- package/dist/operations.service.spec.js +315 -1
- package/dist/operations.service.spec.js.map +1 -1
- package/dist/services/shared/operations-access.service.d.ts +16 -0
- package/dist/services/shared/operations-access.service.d.ts.map +1 -0
- package/dist/services/shared/operations-access.service.js +48 -0
- package/dist/services/shared/operations-access.service.js.map +1 -0
- package/hedhog/data/dashboard.yaml +20 -0
- package/hedhog/data/dashboard_component.yaml +274 -0
- package/hedhog/data/dashboard_component_role.yaml +174 -0
- package/hedhog/data/dashboard_item.yaml +299 -0
- package/hedhog/data/dashboard_role.yaml +20 -0
- package/hedhog/data/menu.yaml +30 -13
- package/hedhog/data/operations_collaborator_type.yaml +76 -0
- package/hedhog/data/route.yaml +183 -0
- package/hedhog/frontend/app/_components/async-options-combobox.tsx.ejs +231 -0
- package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +134 -49
- package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +772 -93
- package/hedhog/frontend/app/_components/department-select-with-create.tsx.ejs +38 -16
- package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +875 -632
- package/hedhog/frontend/app/_components/timesheet-task-create-sheet.tsx.ejs +213 -0
- package/hedhog/frontend/app/_lib/api.ts.ejs +30 -1
- package/hedhog/frontend/app/_lib/types.ts.ejs +142 -39
- package/hedhog/frontend/app/_lib/utils/format.ts.ejs +33 -2
- package/hedhog/frontend/app/approvals/page.tsx.ejs +116 -98
- package/hedhog/frontend/app/collaborator-types/page.tsx.ejs +502 -0
- package/hedhog/frontend/app/collaborators/page.tsx.ejs +109 -68
- package/hedhog/frontend/app/contracts/page.tsx.ejs +99 -102
- package/hedhog/frontend/app/contracts/templates/page.tsx.ejs +98 -102
- package/hedhog/frontend/app/departments/page.tsx.ejs +96 -75
- package/hedhog/frontend/app/projects/page.tsx.ejs +137 -127
- package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +244 -120
- package/hedhog/frontend/app/team/page.tsx.ejs +15 -2
- package/hedhog/frontend/app/time-off/page.tsx.ejs +158 -82
- package/hedhog/frontend/app/timesheets/page.tsx.ejs +814 -357
- package/hedhog/frontend/messages/en.json +243 -51
- package/hedhog/frontend/messages/pt.json +458 -268
- package/hedhog/table/operations_collaborator.yaml +26 -13
- package/hedhog/table/operations_collaborator_equity_participation.yaml +43 -0
- package/hedhog/table/operations_collaborator_type.yaml +33 -0
- package/hedhog/table/operations_job_title.yaml +24 -0
- package/hedhog/table/operations_project_assignment.yaml +9 -0
- package/hedhog/table/operations_project_role.yaml +39 -0
- package/hedhog/table/operations_task.yaml +30 -0
- package/hedhog/table/operations_timesheet_entry.yaml +12 -0
- package/package.json +6 -6
- package/src/controllers/operations-approvals.controller.ts +24 -0
- package/src/controllers/operations-collaborators.controller.ts +60 -0
- package/src/controllers/operations-contracts.controller.ts +138 -0
- package/src/controllers/operations-org-structure.controller.ts +92 -0
- package/src/controllers/operations-projects.controller.ts +50 -0
- package/src/controllers/operations-tasks.controller.ts +52 -0
- package/src/controllers/operations-timesheets.controller.ts +100 -0
- package/src/dto/create-collaborator-type.dto.ts +43 -0
- package/src/dto/create-collaborator.dto.ts +223 -0
- package/src/dto/create-schedule-adjustment-request.dto.ts +91 -0
- package/src/dto/create-task.dto.ts +35 -0
- package/src/dto/create-time-off-request.dto.ts +53 -0
- package/src/dto/create-timesheet-entry.dto.ts +67 -0
- package/src/dto/list-collaborator-types.dto.ts +15 -0
- package/src/dto/list-collaborators.dto.ts +30 -0
- package/src/dto/list-project-options.dto.ts +3 -0
- package/src/dto/list-tasks.dto.ts +25 -0
- package/src/dto/list-timesheet-entries.dto.ts +40 -0
- package/src/dto/update-collaborator-type.dto.ts +3 -0
- package/src/dto/update-collaborator.dto.ts +3 -0
- package/src/dto/update-task.dto.ts +36 -0
- package/src/operations.controller.ts +1 -278
- package/src/operations.module.ts +23 -2
- package/src/operations.service.spec.ts +450 -0
- package/src/operations.service.ts +4641 -2163
- package/src/services/shared/operations-access.service.ts +52 -0
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group';
|
|
24
24
|
import { useApp, useQuery } from '@hed-hog/next-app-provider';
|
|
25
25
|
import {
|
|
26
|
-
Building2,
|
|
27
26
|
CalendarDays,
|
|
28
27
|
FileText,
|
|
29
28
|
LayoutGrid,
|
|
@@ -43,8 +42,12 @@ import { OperationsHeader } from '../_components/operations-header';
|
|
|
43
42
|
import { StatusBadge } from '../_components/status-badge';
|
|
44
43
|
import { fetchOperations, mutateOperations } from '../_lib/api';
|
|
45
44
|
import { useOperationsAccess } from '../_lib/hooks/use-operations-access';
|
|
46
|
-
import type {
|
|
45
|
+
import type {
|
|
46
|
+
OperationsCollaborator,
|
|
47
|
+
OperationsCollaboratorType,
|
|
48
|
+
} from '../_lib/types';
|
|
47
49
|
import {
|
|
50
|
+
formatCurrency,
|
|
48
51
|
formatDate,
|
|
49
52
|
formatEnumLabel,
|
|
50
53
|
formatHours,
|
|
@@ -136,23 +139,6 @@ export default function OperationsCollaboratorsPage() {
|
|
|
136
139
|
}
|
|
137
140
|
};
|
|
138
141
|
|
|
139
|
-
const getCollaboratorTypeLabel = (value?: string | null) => {
|
|
140
|
-
switch (value) {
|
|
141
|
-
case 'clt':
|
|
142
|
-
return formT('options.collaboratorTypes.clt');
|
|
143
|
-
case 'pj':
|
|
144
|
-
return formT('options.collaboratorTypes.pj');
|
|
145
|
-
case 'freelancer':
|
|
146
|
-
return formT('options.collaboratorTypes.freelancer');
|
|
147
|
-
case 'intern':
|
|
148
|
-
return formT('options.collaboratorTypes.intern');
|
|
149
|
-
case 'other':
|
|
150
|
-
return formT('options.collaboratorTypes.other');
|
|
151
|
-
default:
|
|
152
|
-
return formatEnumLabel(value);
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
|
|
156
142
|
const getStatusLabel = (value?: string | null) => {
|
|
157
143
|
switch (value) {
|
|
158
144
|
case 'active':
|
|
@@ -180,6 +166,28 @@ export default function OperationsCollaboratorsPage() {
|
|
|
180
166
|
),
|
|
181
167
|
});
|
|
182
168
|
|
|
169
|
+
const { data: collaboratorTypes = [] } = useQuery<OperationsCollaboratorType[]>({
|
|
170
|
+
queryKey: ['operations-collaborator-types-list', currentLocaleCode],
|
|
171
|
+
enabled: access.isCollaborator,
|
|
172
|
+
queryFn: () =>
|
|
173
|
+
fetchOperations<OperationsCollaboratorType[]>(
|
|
174
|
+
request,
|
|
175
|
+
'/operations/collaborator-types?active=true'
|
|
176
|
+
),
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const getCollaboratorTypeLabel = (
|
|
180
|
+
slug?: string | null,
|
|
181
|
+
fallbackName?: string | null
|
|
182
|
+
) => {
|
|
183
|
+
if (fallbackName) {
|
|
184
|
+
return fallbackName;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const matchedType = collaboratorTypes.find((item) => item.slug === slug);
|
|
188
|
+
return matchedType?.name ?? formatEnumLabel(slug);
|
|
189
|
+
};
|
|
190
|
+
|
|
183
191
|
const filteredRows = useMemo(
|
|
184
192
|
() =>
|
|
185
193
|
collaborators.filter((item) => {
|
|
@@ -201,7 +209,10 @@ export default function OperationsCollaboratorsPage() {
|
|
|
201
209
|
const matchesStatus =
|
|
202
210
|
statusFilter === 'all' ? true : item.status === statusFilter;
|
|
203
211
|
const matchesType =
|
|
204
|
-
typeFilter === 'all'
|
|
212
|
+
typeFilter === 'all'
|
|
213
|
+
? true
|
|
214
|
+
: item.collaboratorTypeSlug === typeFilter ||
|
|
215
|
+
item.collaboratorType === typeFilter;
|
|
205
216
|
return matchesSearch && matchesStatus && matchesType;
|
|
206
217
|
}),
|
|
207
218
|
[collaborators, search, statusFilter, typeFilter]
|
|
@@ -212,18 +223,21 @@ export default function OperationsCollaboratorsPage() {
|
|
|
212
223
|
{
|
|
213
224
|
key: 'total',
|
|
214
225
|
title: t('cards.total'),
|
|
226
|
+
description: t('cards.totalDescription'),
|
|
215
227
|
value: collaborators.length,
|
|
216
228
|
icon: Users,
|
|
217
229
|
},
|
|
218
230
|
{
|
|
219
231
|
key: 'active',
|
|
220
232
|
title: t('cards.active'),
|
|
233
|
+
description: t('cards.activeDescription'),
|
|
221
234
|
value: collaborators.filter((item) => item.status === 'active').length,
|
|
222
235
|
icon: UserCheck,
|
|
223
236
|
},
|
|
224
237
|
{
|
|
225
238
|
key: 'onLeave',
|
|
226
239
|
title: t('cards.onLeave'),
|
|
240
|
+
description: t('cards.onLeaveDescription'),
|
|
227
241
|
value: collaborators.filter((item) => item.status === 'on_leave')
|
|
228
242
|
.length,
|
|
229
243
|
icon: CalendarDays,
|
|
@@ -231,6 +245,7 @@ export default function OperationsCollaboratorsPage() {
|
|
|
231
245
|
{
|
|
232
246
|
key: 'withContracts',
|
|
233
247
|
title: t('cards.withContracts'),
|
|
248
|
+
description: t('cards.withContractsDescription'),
|
|
234
249
|
value: collaborators.filter((item) => Boolean(item.contractId)).length,
|
|
235
250
|
icon: FileText,
|
|
236
251
|
},
|
|
@@ -277,12 +292,6 @@ export default function OperationsCollaboratorsPage() {
|
|
|
277
292
|
actions={
|
|
278
293
|
access.isDirector ? (
|
|
279
294
|
<div className="flex flex-wrap gap-2">
|
|
280
|
-
<Button variant="outline" size="sm" asChild>
|
|
281
|
-
<Link href="/operations/departments">
|
|
282
|
-
<Building2 className="size-4" />
|
|
283
|
-
{commonT('actions.manageDepartments')}
|
|
284
|
-
</Link>
|
|
285
|
-
</Button>
|
|
286
295
|
<Button size="sm" onClick={openCreateSheet}>
|
|
287
296
|
{commonT('actions.create')}
|
|
288
297
|
</Button>
|
|
@@ -309,17 +318,10 @@ export default function OperationsCollaboratorsPage() {
|
|
|
309
318
|
placeholder: commonT('labels.collaboratorType'),
|
|
310
319
|
options: [
|
|
311
320
|
{ value: 'all', label: commonT('filters.allTypes') },
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
label: getCollaboratorTypeLabel('freelancer'),
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
value: 'intern',
|
|
320
|
-
label: getCollaboratorTypeLabel('intern'),
|
|
321
|
-
},
|
|
322
|
-
{ value: 'other', label: getCollaboratorTypeLabel('other') },
|
|
321
|
+
...collaboratorTypes.map((item) => ({
|
|
322
|
+
value: item.slug,
|
|
323
|
+
label: item.name,
|
|
324
|
+
})),
|
|
323
325
|
],
|
|
324
326
|
},
|
|
325
327
|
{
|
|
@@ -377,7 +379,8 @@ export default function OperationsCollaboratorsPage() {
|
|
|
377
379
|
{filteredRows.map((collaborator) => (
|
|
378
380
|
<Card
|
|
379
381
|
key={collaborator.id}
|
|
380
|
-
className="overflow-hidden border-border/60 py-0 shadow-sm transition-all hover:-translate-y-0.5 hover:shadow-md"
|
|
382
|
+
className="cursor-pointer overflow-hidden border-border/60 py-0 shadow-sm transition-all hover:-translate-y-0.5 hover:shadow-md"
|
|
383
|
+
onClick={() => openEditSheet(collaborator.id)}
|
|
381
384
|
>
|
|
382
385
|
<CardContent className="space-y-4 p-4">
|
|
383
386
|
<div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
|
|
@@ -410,7 +413,11 @@ export default function OperationsCollaboratorsPage() {
|
|
|
410
413
|
|
|
411
414
|
<div className="flex flex-wrap gap-2">
|
|
412
415
|
<span className="inline-flex items-center rounded-full bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary">
|
|
413
|
-
{getCollaboratorTypeLabel(
|
|
416
|
+
{getCollaboratorTypeLabel(
|
|
417
|
+
collaborator.collaboratorTypeSlug ??
|
|
418
|
+
collaborator.collaboratorType,
|
|
419
|
+
collaborator.collaboratorTypeName
|
|
420
|
+
)}
|
|
414
421
|
</span>
|
|
415
422
|
{collaborator.department ? (
|
|
416
423
|
<span className="inline-flex items-center rounded-full bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground">
|
|
@@ -433,6 +440,14 @@ export default function OperationsCollaboratorsPage() {
|
|
|
433
440
|
</span>{' '}
|
|
434
441
|
{formatHours(collaborator.weeklyCapacityHours)}
|
|
435
442
|
</div>
|
|
443
|
+
<div>
|
|
444
|
+
<span className="font-medium text-foreground">
|
|
445
|
+
{formT('fields.compensationAmount')}:
|
|
446
|
+
</span>{' '}
|
|
447
|
+
{collaborator.compensationAmount != null
|
|
448
|
+
? formatCurrency(collaborator.compensationAmount)
|
|
449
|
+
: commonT('labels.notAvailable')}
|
|
450
|
+
</div>
|
|
436
451
|
<div>
|
|
437
452
|
<span className="font-medium text-foreground">
|
|
438
453
|
{commonT('labels.startDate')}:
|
|
@@ -443,22 +458,21 @@ export default function OperationsCollaboratorsPage() {
|
|
|
443
458
|
currentLocaleCode
|
|
444
459
|
)}
|
|
445
460
|
</div>
|
|
446
|
-
|
|
461
|
+
</div>
|
|
462
|
+
|
|
463
|
+
{collaborator.contractStatus ? (
|
|
464
|
+
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
|
447
465
|
<span className="font-medium text-foreground">
|
|
448
466
|
{commonT('labels.contractStatus')}:
|
|
449
467
|
</span>
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
/>
|
|
457
|
-
) : (
|
|
458
|
-
<span>{commonT('labels.notAssigned')}</span>
|
|
459
|
-
)}
|
|
468
|
+
<StatusBadge
|
|
469
|
+
label={getStatusLabel(collaborator.contractStatus)}
|
|
470
|
+
className={getStatusBadgeClass(
|
|
471
|
+
collaborator.contractStatus
|
|
472
|
+
)}
|
|
473
|
+
/>
|
|
460
474
|
</div>
|
|
461
|
-
|
|
475
|
+
) : null}
|
|
462
476
|
|
|
463
477
|
<div className="flex flex-wrap justify-end gap-2 border-t border-border/60 pt-3">
|
|
464
478
|
{access.isDirector ? (
|
|
@@ -530,9 +544,9 @@ export default function OperationsCollaboratorsPage() {
|
|
|
530
544
|
{commonT('labels.weeklyCapacity')}
|
|
531
545
|
</TableHead>
|
|
532
546
|
<TableHead className="hidden 2xl:table-cell">
|
|
533
|
-
{
|
|
547
|
+
{formT('fields.compensationAmount')}
|
|
534
548
|
</TableHead>
|
|
535
|
-
<TableHead className="hidden
|
|
549
|
+
<TableHead className="hidden xl:table-cell">
|
|
536
550
|
{commonT('labels.startDate')}
|
|
537
551
|
</TableHead>
|
|
538
552
|
<TableHead className="w-30 text-right sm:w-42.5">
|
|
@@ -542,7 +556,11 @@ export default function OperationsCollaboratorsPage() {
|
|
|
542
556
|
</TableHeader>
|
|
543
557
|
<TableBody>
|
|
544
558
|
{filteredRows.map((collaborator) => (
|
|
545
|
-
<TableRow
|
|
559
|
+
<TableRow
|
|
560
|
+
key={collaborator.id}
|
|
561
|
+
className="cursor-pointer hover:bg-muted/30"
|
|
562
|
+
onClick={() => openEditSheet(collaborator.id)}
|
|
563
|
+
>
|
|
546
564
|
<TableCell>
|
|
547
565
|
<div className="flex items-center gap-3">
|
|
548
566
|
<Avatar className="h-9 w-9 border border-border/60 bg-muted">
|
|
@@ -564,16 +582,46 @@ export default function OperationsCollaboratorsPage() {
|
|
|
564
582
|
{[
|
|
565
583
|
collaborator.code,
|
|
566
584
|
collaborator.department,
|
|
567
|
-
collaborator.title,
|
|
568
585
|
]
|
|
569
586
|
.filter(Boolean)
|
|
570
|
-
.join(' • ')
|
|
587
|
+
.join(' • ') ||
|
|
588
|
+
collaborator.title ||
|
|
589
|
+
commonT('labels.notAvailable')}
|
|
590
|
+
</div>
|
|
591
|
+
<div className="mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-muted-foreground lg:hidden">
|
|
592
|
+
<span>
|
|
593
|
+
<span className="font-medium text-foreground/80">
|
|
594
|
+
{commonT('labels.supervisor')}:
|
|
595
|
+
</span>{' '}
|
|
596
|
+
{collaborator.supervisorName ||
|
|
597
|
+
commonT('labels.notAssigned')}
|
|
598
|
+
</span>
|
|
599
|
+
<span>
|
|
600
|
+
<span className="font-medium text-foreground/80">
|
|
601
|
+
{commonT('labels.weeklyCapacity')}:
|
|
602
|
+
</span>{' '}
|
|
603
|
+
{formatHours(collaborator.weeklyCapacityHours)}
|
|
604
|
+
</span>
|
|
605
|
+
<span>
|
|
606
|
+
<span className="font-medium text-foreground/80">
|
|
607
|
+
{commonT('labels.startDate')}:
|
|
608
|
+
</span>{' '}
|
|
609
|
+
{formatDate(
|
|
610
|
+
collaborator.joinedAt,
|
|
611
|
+
getSettingValue,
|
|
612
|
+
currentLocaleCode
|
|
613
|
+
)}
|
|
614
|
+
</span>
|
|
571
615
|
</div>
|
|
572
616
|
</div>
|
|
573
617
|
</div>
|
|
574
618
|
</TableCell>
|
|
575
619
|
<TableCell className="hidden md:table-cell">
|
|
576
|
-
{getCollaboratorTypeLabel(
|
|
620
|
+
{getCollaboratorTypeLabel(
|
|
621
|
+
collaborator.collaboratorTypeSlug ??
|
|
622
|
+
collaborator.collaboratorType,
|
|
623
|
+
collaborator.collaboratorTypeName
|
|
624
|
+
)}
|
|
577
625
|
</TableCell>
|
|
578
626
|
<TableCell className="hidden max-w-55 sm:table-cell">
|
|
579
627
|
<div className="truncate">
|
|
@@ -598,18 +646,11 @@ export default function OperationsCollaboratorsPage() {
|
|
|
598
646
|
{formatHours(collaborator.weeklyCapacityHours)}
|
|
599
647
|
</TableCell>
|
|
600
648
|
<TableCell className="hidden 2xl:table-cell">
|
|
601
|
-
{collaborator.
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
className={getStatusBadgeClass(
|
|
605
|
-
collaborator.contractStatus
|
|
606
|
-
)}
|
|
607
|
-
/>
|
|
608
|
-
) : (
|
|
609
|
-
commonT('labels.notAssigned')
|
|
610
|
-
)}
|
|
649
|
+
{collaborator.compensationAmount != null
|
|
650
|
+
? formatCurrency(collaborator.compensationAmount)
|
|
651
|
+
: commonT('labels.notAvailable')}
|
|
611
652
|
</TableCell>
|
|
612
|
-
<TableCell className="hidden
|
|
653
|
+
<TableCell className="hidden xl:table-cell">
|
|
613
654
|
{formatDate(
|
|
614
655
|
collaborator.joinedAt,
|
|
615
656
|
getSettingValue,
|
|
@@ -722,111 +722,108 @@ export default function OperationsContractsPage() {
|
|
|
722
722
|
})}
|
|
723
723
|
</div>
|
|
724
724
|
) : (
|
|
725
|
-
<
|
|
726
|
-
<
|
|
727
|
-
<
|
|
728
|
-
<
|
|
729
|
-
<
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
{contract.name ||
|
|
763
|
-
contract.code ||
|
|
764
|
-
commonT('labels.notAvailable')}
|
|
765
|
-
</div>
|
|
766
|
-
<div className="truncate text-xs text-muted-foreground">
|
|
767
|
-
{[
|
|
768
|
-
contract.code,
|
|
769
|
-
contract.contractTemplateName,
|
|
770
|
-
contract.mainRelatedPartyName,
|
|
771
|
-
getContractOptionLabel(
|
|
772
|
-
'originTypes',
|
|
773
|
-
contract.originType
|
|
774
|
-
),
|
|
775
|
-
]
|
|
776
|
-
.filter(Boolean)
|
|
777
|
-
.join(' • ') || commonT('labels.notAvailable')}
|
|
778
|
-
</div>
|
|
779
|
-
</div>
|
|
780
|
-
</TableCell>
|
|
781
|
-
<TableCell>
|
|
782
|
-
<StatusBadge
|
|
783
|
-
label={getContractOptionLabel(
|
|
784
|
-
'statuses',
|
|
785
|
-
contract.status
|
|
786
|
-
)}
|
|
787
|
-
className={getStatusBadgeClass(contract.status)}
|
|
788
|
-
/>
|
|
789
|
-
</TableCell>
|
|
790
|
-
<TableCell className="hidden md:table-cell">
|
|
791
|
-
<StatusBadge
|
|
792
|
-
label={getContractOptionLabel(
|
|
793
|
-
'signatureStatuses',
|
|
794
|
-
contract.signatureStatus
|
|
795
|
-
)}
|
|
796
|
-
className={getStatusBadgeClass(
|
|
797
|
-
contract.signatureStatus
|
|
798
|
-
)}
|
|
799
|
-
/>
|
|
800
|
-
</TableCell>
|
|
801
|
-
<TableCell className="hidden lg:table-cell">
|
|
802
|
-
<div className="truncate">
|
|
803
|
-
{getContractOptionLabel(
|
|
804
|
-
'contractTypes',
|
|
805
|
-
contract.contractType
|
|
806
|
-
)}
|
|
807
|
-
</div>
|
|
808
|
-
</TableCell>
|
|
809
|
-
<TableCell className="hidden xl:table-cell">
|
|
810
|
-
<div className="truncate">
|
|
811
|
-
{contract.clientName ||
|
|
725
|
+
<div className="overflow-x-auto rounded-md border">
|
|
726
|
+
<Table className="table-fixed">
|
|
727
|
+
<TableHeader>
|
|
728
|
+
<TableRow>
|
|
729
|
+
<TableHead className="w-[34%]">
|
|
730
|
+
{t('columns.title')}
|
|
731
|
+
</TableHead>
|
|
732
|
+
<TableHead>{commonT('labels.status')}</TableHead>
|
|
733
|
+
<TableHead className="hidden md:table-cell">
|
|
734
|
+
{t('columns.signatureStatus')}
|
|
735
|
+
</TableHead>
|
|
736
|
+
<TableHead className="hidden lg:table-cell">
|
|
737
|
+
{t('columns.type')}
|
|
738
|
+
</TableHead>
|
|
739
|
+
<TableHead className="hidden xl:table-cell">
|
|
740
|
+
{commonT('labels.client')}
|
|
741
|
+
</TableHead>
|
|
742
|
+
<TableHead className="hidden 2xl:table-cell">
|
|
743
|
+
{t('columns.financials')}
|
|
744
|
+
</TableHead>
|
|
745
|
+
<TableHead className="w-30 text-right sm:w-42.5">
|
|
746
|
+
{commonT('labels.actions')}
|
|
747
|
+
</TableHead>
|
|
748
|
+
</TableRow>
|
|
749
|
+
</TableHeader>
|
|
750
|
+
<TableBody>
|
|
751
|
+
{filteredRows.map((contract) => {
|
|
752
|
+
const financialTotal =
|
|
753
|
+
(contract.valueAmount ?? 0) + (contract.revenueAmount ?? 0);
|
|
754
|
+
|
|
755
|
+
return (
|
|
756
|
+
<TableRow key={contract.id} className="hover:bg-muted/30">
|
|
757
|
+
<TableCell>
|
|
758
|
+
<div className="min-w-0">
|
|
759
|
+
<div className="truncate font-medium">
|
|
760
|
+
{contract.name ||
|
|
761
|
+
contract.code ||
|
|
812
762
|
commonT('labels.notAvailable')}
|
|
813
763
|
</div>
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
764
|
+
<div className="truncate text-xs text-muted-foreground">
|
|
765
|
+
{[
|
|
766
|
+
contract.code,
|
|
767
|
+
contract.contractTemplateName,
|
|
768
|
+
contract.mainRelatedPartyName,
|
|
769
|
+
getContractOptionLabel(
|
|
770
|
+
'originTypes',
|
|
771
|
+
contract.originType
|
|
772
|
+
),
|
|
773
|
+
]
|
|
774
|
+
.filter(Boolean)
|
|
775
|
+
.join(' • ') || commonT('labels.notAvailable')}
|
|
821
776
|
</div>
|
|
822
|
-
</
|
|
823
|
-
</
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
777
|
+
</div>
|
|
778
|
+
</TableCell>
|
|
779
|
+
<TableCell>
|
|
780
|
+
<StatusBadge
|
|
781
|
+
label={getContractOptionLabel(
|
|
782
|
+
'statuses',
|
|
783
|
+
contract.status
|
|
784
|
+
)}
|
|
785
|
+
className={getStatusBadgeClass(contract.status)}
|
|
786
|
+
/>
|
|
787
|
+
</TableCell>
|
|
788
|
+
<TableCell className="hidden md:table-cell">
|
|
789
|
+
<StatusBadge
|
|
790
|
+
label={getContractOptionLabel(
|
|
791
|
+
'signatureStatuses',
|
|
792
|
+
contract.signatureStatus
|
|
793
|
+
)}
|
|
794
|
+
className={getStatusBadgeClass(
|
|
795
|
+
contract.signatureStatus
|
|
796
|
+
)}
|
|
797
|
+
/>
|
|
798
|
+
</TableCell>
|
|
799
|
+
<TableCell className="hidden lg:table-cell">
|
|
800
|
+
<div className="truncate">
|
|
801
|
+
{getContractOptionLabel(
|
|
802
|
+
'contractTypes',
|
|
803
|
+
contract.contractType
|
|
804
|
+
)}
|
|
805
|
+
</div>
|
|
806
|
+
</TableCell>
|
|
807
|
+
<TableCell className="hidden xl:table-cell">
|
|
808
|
+
<div className="truncate">
|
|
809
|
+
{contract.clientName ||
|
|
810
|
+
commonT('labels.notAvailable')}
|
|
811
|
+
</div>
|
|
812
|
+
</TableCell>
|
|
813
|
+
<TableCell className="hidden 2xl:table-cell">
|
|
814
|
+
{formatCurrency(financialTotal)}
|
|
815
|
+
</TableCell>
|
|
816
|
+
<TableCell>
|
|
817
|
+
<div className="flex justify-end">
|
|
818
|
+
{renderContractActions(contract, 'end')}
|
|
819
|
+
</div>
|
|
820
|
+
</TableCell>
|
|
821
|
+
</TableRow>
|
|
822
|
+
);
|
|
823
|
+
})}
|
|
824
|
+
</TableBody>
|
|
825
|
+
</Table>
|
|
826
|
+
</div>
|
|
830
827
|
)
|
|
831
828
|
) : (
|
|
832
829
|
<EmptyState
|