@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.
Files changed (167) hide show
  1. package/README.md +200 -43
  2. package/dist/controllers/operations-approvals.controller.d.ts +9 -0
  3. package/dist/controllers/operations-approvals.controller.d.ts.map +1 -0
  4. package/dist/controllers/operations-approvals.controller.js +64 -0
  5. package/dist/controllers/operations-approvals.controller.js.map +1 -0
  6. package/dist/controllers/operations-collaborators.controller.d.ts +223 -0
  7. package/dist/controllers/operations-collaborators.controller.d.ts.map +1 -0
  8. package/dist/controllers/operations-collaborators.controller.js +96 -0
  9. package/dist/controllers/operations-collaborators.controller.js.map +1 -0
  10. package/dist/controllers/operations-contracts.controller.d.ts +683 -0
  11. package/dist/controllers/operations-contracts.controller.d.ts.map +1 -0
  12. package/dist/controllers/operations-contracts.controller.js +198 -0
  13. package/dist/controllers/operations-contracts.controller.js.map +1 -0
  14. package/dist/controllers/operations-org-structure.controller.d.ts +108 -0
  15. package/dist/controllers/operations-org-structure.controller.d.ts.map +1 -0
  16. package/dist/controllers/operations-org-structure.controller.js +143 -0
  17. package/dist/controllers/operations-org-structure.controller.js.map +1 -0
  18. package/dist/controllers/operations-projects.controller.d.ts +169 -0
  19. package/dist/controllers/operations-projects.controller.d.ts.map +1 -0
  20. package/dist/controllers/operations-projects.controller.js +87 -0
  21. package/dist/controllers/operations-projects.controller.js.map +1 -0
  22. package/dist/controllers/operations-tasks.controller.d.ts +54 -0
  23. package/dist/controllers/operations-tasks.controller.d.ts.map +1 -0
  24. package/dist/controllers/operations-tasks.controller.js +79 -0
  25. package/dist/controllers/operations-tasks.controller.js.map +1 -0
  26. package/dist/controllers/operations-timesheets.controller.d.ts +99 -0
  27. package/dist/controllers/operations-timesheets.controller.d.ts.map +1 -0
  28. package/dist/controllers/operations-timesheets.controller.js +154 -0
  29. package/dist/controllers/operations-timesheets.controller.js.map +1 -0
  30. package/dist/dto/create-collaborator-type.dto.d.ts +10 -0
  31. package/dist/dto/create-collaborator-type.dto.d.ts.map +1 -0
  32. package/dist/dto/create-collaborator-type.dto.js +56 -0
  33. package/dist/dto/create-collaborator-type.dto.js.map +1 -0
  34. package/dist/dto/create-collaborator.dto.d.ts +42 -0
  35. package/dist/dto/create-collaborator.dto.d.ts.map +1 -0
  36. package/dist/dto/create-collaborator.dto.js +228 -0
  37. package/dist/dto/create-collaborator.dto.js.map +1 -0
  38. package/dist/dto/create-schedule-adjustment-request.dto.d.ts +17 -0
  39. package/dist/dto/create-schedule-adjustment-request.dto.d.ts.map +1 -0
  40. package/dist/dto/create-schedule-adjustment-request.dto.js +89 -0
  41. package/dist/dto/create-schedule-adjustment-request.dto.js.map +1 -0
  42. package/dist/dto/create-task.dto.d.ts +8 -0
  43. package/dist/dto/create-task.dto.d.ts.map +1 -0
  44. package/dist/dto/create-task.dto.js +50 -0
  45. package/dist/dto/create-task.dto.js.map +1 -0
  46. package/dist/dto/create-time-off-request.dto.d.ts +9 -0
  47. package/dist/dto/create-time-off-request.dto.d.ts.map +1 -0
  48. package/dist/dto/create-time-off-request.dto.js +54 -0
  49. package/dist/dto/create-time-off-request.dto.js.map +1 -0
  50. package/dist/dto/create-timesheet-entry.dto.d.ts +12 -0
  51. package/dist/dto/create-timesheet-entry.dto.d.ts.map +1 -0
  52. package/dist/dto/create-timesheet-entry.dto.js +75 -0
  53. package/dist/dto/create-timesheet-entry.dto.js.map +1 -0
  54. package/dist/dto/list-collaborator-types.dto.d.ts +4 -0
  55. package/dist/dto/list-collaborator-types.dto.d.ts.map +1 -0
  56. package/dist/dto/list-collaborator-types.dto.js +29 -0
  57. package/dist/dto/list-collaborator-types.dto.js.map +1 -0
  58. package/dist/dto/list-collaborators.dto.d.ts +8 -0
  59. package/dist/dto/list-collaborators.dto.d.ts.map +1 -0
  60. package/dist/dto/list-collaborators.dto.js +42 -0
  61. package/dist/dto/list-collaborators.dto.js.map +1 -0
  62. package/dist/dto/list-project-options.dto.d.ts +4 -0
  63. package/dist/dto/list-project-options.dto.d.ts.map +1 -0
  64. package/dist/dto/list-project-options.dto.js +8 -0
  65. package/dist/dto/list-project-options.dto.js.map +1 -0
  66. package/dist/dto/list-tasks.dto.d.ts +7 -0
  67. package/dist/dto/list-tasks.dto.d.ts.map +1 -0
  68. package/dist/dto/list-tasks.dto.js +38 -0
  69. package/dist/dto/list-tasks.dto.js.map +1 -0
  70. package/dist/dto/list-timesheet-entries.dto.d.ts +10 -0
  71. package/dist/dto/list-timesheet-entries.dto.d.ts.map +1 -0
  72. package/dist/dto/list-timesheet-entries.dto.js +54 -0
  73. package/dist/dto/list-timesheet-entries.dto.js.map +1 -0
  74. package/dist/dto/update-collaborator-type.dto.d.ts +4 -0
  75. package/dist/dto/update-collaborator-type.dto.d.ts.map +1 -0
  76. package/dist/dto/update-collaborator-type.dto.js +8 -0
  77. package/dist/dto/update-collaborator-type.dto.js.map +1 -0
  78. package/dist/dto/update-collaborator.dto.d.ts +4 -0
  79. package/dist/dto/update-collaborator.dto.d.ts.map +1 -0
  80. package/dist/dto/update-collaborator.dto.js +8 -0
  81. package/dist/dto/update-collaborator.dto.js.map +1 -0
  82. package/dist/dto/update-task.dto.d.ts +8 -0
  83. package/dist/dto/update-task.dto.d.ts.map +1 -0
  84. package/dist/dto/update-task.dto.js +51 -0
  85. package/dist/dto/update-task.dto.js.map +1 -0
  86. package/dist/operations.controller.d.ts +0 -1045
  87. package/dist/operations.controller.d.ts.map +1 -1
  88. package/dist/operations.controller.js +0 -429
  89. package/dist/operations.controller.js.map +1 -1
  90. package/dist/operations.module.d.ts.map +1 -1
  91. package/dist/operations.module.js +23 -2
  92. package/dist/operations.module.js.map +1 -1
  93. package/dist/operations.service.d.ts +373 -8
  94. package/dist/operations.service.d.ts.map +1 -1
  95. package/dist/operations.service.js +1598 -111
  96. package/dist/operations.service.js.map +1 -1
  97. package/dist/operations.service.spec.js +315 -1
  98. package/dist/operations.service.spec.js.map +1 -1
  99. package/dist/services/shared/operations-access.service.d.ts +16 -0
  100. package/dist/services/shared/operations-access.service.d.ts.map +1 -0
  101. package/dist/services/shared/operations-access.service.js +48 -0
  102. package/dist/services/shared/operations-access.service.js.map +1 -0
  103. package/hedhog/data/dashboard.yaml +20 -0
  104. package/hedhog/data/dashboard_component.yaml +274 -0
  105. package/hedhog/data/dashboard_component_role.yaml +174 -0
  106. package/hedhog/data/dashboard_item.yaml +299 -0
  107. package/hedhog/data/dashboard_role.yaml +20 -0
  108. package/hedhog/data/menu.yaml +30 -13
  109. package/hedhog/data/operations_collaborator_type.yaml +76 -0
  110. package/hedhog/data/route.yaml +183 -0
  111. package/hedhog/frontend/app/_components/async-options-combobox.tsx.ejs +231 -0
  112. package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +134 -49
  113. package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +772 -93
  114. package/hedhog/frontend/app/_components/department-select-with-create.tsx.ejs +38 -16
  115. package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +875 -632
  116. package/hedhog/frontend/app/_components/timesheet-task-create-sheet.tsx.ejs +213 -0
  117. package/hedhog/frontend/app/_lib/api.ts.ejs +30 -1
  118. package/hedhog/frontend/app/_lib/types.ts.ejs +142 -39
  119. package/hedhog/frontend/app/_lib/utils/format.ts.ejs +33 -2
  120. package/hedhog/frontend/app/approvals/page.tsx.ejs +116 -98
  121. package/hedhog/frontend/app/collaborator-types/page.tsx.ejs +502 -0
  122. package/hedhog/frontend/app/collaborators/page.tsx.ejs +109 -68
  123. package/hedhog/frontend/app/contracts/page.tsx.ejs +99 -102
  124. package/hedhog/frontend/app/contracts/templates/page.tsx.ejs +98 -102
  125. package/hedhog/frontend/app/departments/page.tsx.ejs +96 -75
  126. package/hedhog/frontend/app/projects/page.tsx.ejs +137 -127
  127. package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +244 -120
  128. package/hedhog/frontend/app/team/page.tsx.ejs +15 -2
  129. package/hedhog/frontend/app/time-off/page.tsx.ejs +158 -82
  130. package/hedhog/frontend/app/timesheets/page.tsx.ejs +814 -357
  131. package/hedhog/frontend/messages/en.json +243 -51
  132. package/hedhog/frontend/messages/pt.json +458 -268
  133. package/hedhog/table/operations_collaborator.yaml +26 -13
  134. package/hedhog/table/operations_collaborator_equity_participation.yaml +43 -0
  135. package/hedhog/table/operations_collaborator_type.yaml +33 -0
  136. package/hedhog/table/operations_job_title.yaml +24 -0
  137. package/hedhog/table/operations_project_assignment.yaml +9 -0
  138. package/hedhog/table/operations_project_role.yaml +39 -0
  139. package/hedhog/table/operations_task.yaml +30 -0
  140. package/hedhog/table/operations_timesheet_entry.yaml +12 -0
  141. package/package.json +6 -6
  142. package/src/controllers/operations-approvals.controller.ts +24 -0
  143. package/src/controllers/operations-collaborators.controller.ts +60 -0
  144. package/src/controllers/operations-contracts.controller.ts +138 -0
  145. package/src/controllers/operations-org-structure.controller.ts +92 -0
  146. package/src/controllers/operations-projects.controller.ts +50 -0
  147. package/src/controllers/operations-tasks.controller.ts +52 -0
  148. package/src/controllers/operations-timesheets.controller.ts +100 -0
  149. package/src/dto/create-collaborator-type.dto.ts +43 -0
  150. package/src/dto/create-collaborator.dto.ts +223 -0
  151. package/src/dto/create-schedule-adjustment-request.dto.ts +91 -0
  152. package/src/dto/create-task.dto.ts +35 -0
  153. package/src/dto/create-time-off-request.dto.ts +53 -0
  154. package/src/dto/create-timesheet-entry.dto.ts +67 -0
  155. package/src/dto/list-collaborator-types.dto.ts +15 -0
  156. package/src/dto/list-collaborators.dto.ts +30 -0
  157. package/src/dto/list-project-options.dto.ts +3 -0
  158. package/src/dto/list-tasks.dto.ts +25 -0
  159. package/src/dto/list-timesheet-entries.dto.ts +40 -0
  160. package/src/dto/update-collaborator-type.dto.ts +3 -0
  161. package/src/dto/update-collaborator.dto.ts +3 -0
  162. package/src/dto/update-task.dto.ts +36 -0
  163. package/src/operations.controller.ts +1 -278
  164. package/src/operations.module.ts +23 -2
  165. package/src/operations.service.spec.ts +450 -0
  166. package/src/operations.service.ts +4641 -2163
  167. package/src/services/shared/operations-access.service.ts +52 -0
@@ -0,0 +1,52 @@
1
+ import { Role, User } from '@hed-hog/api';
2
+ import { Pagination } from '@hed-hog/api-pagination';
3
+ import {
4
+ Body,
5
+ Controller,
6
+ Delete,
7
+ Get,
8
+ Param,
9
+ ParseIntPipe,
10
+ Patch,
11
+ Post,
12
+ } from '@nestjs/common';
13
+ import { CreateOperationsTaskDto } from '../dto/create-task.dto';
14
+ import { ListOperationsTasksDto } from '../dto/list-tasks.dto';
15
+ import { UpdateOperationsTaskDto } from '../dto/update-task.dto';
16
+ import { OperationsService } from '../operations.service';
17
+
18
+ @Role()
19
+ @Controller('operations')
20
+ export class OperationsTasksController {
21
+ constructor(private readonly operationsService: OperationsService) {}
22
+
23
+ @Get('tasks')
24
+ listTasks(
25
+ @User() user,
26
+ @Pagination() paginationParams: ListOperationsTasksDto,
27
+ ) {
28
+ return this.operationsService.listTasks(
29
+ Number(user?.id || 0),
30
+ paginationParams,
31
+ );
32
+ }
33
+
34
+ @Post('tasks')
35
+ createTask(@User() user, @Body() data: CreateOperationsTaskDto) {
36
+ return this.operationsService.createTask(Number(user?.id || 0), data);
37
+ }
38
+
39
+ @Patch('tasks/:id')
40
+ updateTask(
41
+ @User() user,
42
+ @Param('id', ParseIntPipe) id: number,
43
+ @Body() data: UpdateOperationsTaskDto,
44
+ ) {
45
+ return this.operationsService.updateTask(Number(user?.id || 0), id, data);
46
+ }
47
+
48
+ @Delete('tasks/:id')
49
+ removeTask(@User() user, @Param('id', ParseIntPipe) id: number) {
50
+ return this.operationsService.removeTask(Number(user?.id || 0), id);
51
+ }
52
+ }
@@ -0,0 +1,100 @@
1
+ import { Role, User } from '@hed-hog/api';
2
+ import { Pagination } from '@hed-hog/api-pagination';
3
+ import {
4
+ Body,
5
+ Controller,
6
+ Delete,
7
+ Get,
8
+ Param,
9
+ ParseIntPipe,
10
+ Patch,
11
+ Post,
12
+ } from '@nestjs/common';
13
+ import { CreateScheduleAdjustmentRequestDto } from '../dto/create-schedule-adjustment-request.dto';
14
+ import { CreateTimeOffRequestDto } from '../dto/create-time-off-request.dto';
15
+ import { CreateTimesheetEntryDto } from '../dto/create-timesheet-entry.dto';
16
+ import { ListTimesheetEntriesDto } from '../dto/list-timesheet-entries.dto';
17
+ import { OperationsService } from '../operations.service';
18
+
19
+ @Role()
20
+ @Controller('operations')
21
+ export class OperationsTimesheetsController {
22
+ constructor(private readonly operationsService: OperationsService) {}
23
+
24
+ @Get('timesheets')
25
+ listTimesheets(@User() user) {
26
+ return this.operationsService.listTimesheets(Number(user?.id || 0));
27
+ }
28
+
29
+ @Get('timesheet-entries')
30
+ listTimesheetEntries(
31
+ @User() user,
32
+ @Pagination() paginationParams: ListTimesheetEntriesDto,
33
+ ) {
34
+ return this.operationsService.listTimesheetEntries(
35
+ Number(user?.id || 0),
36
+ paginationParams,
37
+ );
38
+ }
39
+
40
+ @Post('timesheet-entries')
41
+ createTimesheetEntry(@User() user, @Body() data: CreateTimesheetEntryDto) {
42
+ return this.operationsService.createTimesheetEntry(
43
+ Number(user?.id || 0),
44
+ data,
45
+ );
46
+ }
47
+
48
+ @Delete('timesheet-entries/:id')
49
+ removeTimesheetEntry(@User() user, @Param('id', ParseIntPipe) id: number) {
50
+ return this.operationsService.removeTimesheetEntry(Number(user?.id || 0), id);
51
+ }
52
+
53
+ @Post('timesheets')
54
+ createTimesheet(@User() user, @Body() data) {
55
+ return this.operationsService.createTimesheet(Number(user?.id || 0), data);
56
+ }
57
+
58
+ @Patch('timesheets/:id')
59
+ updateTimesheet(
60
+ @User() user,
61
+ @Param('id', ParseIntPipe) id: number,
62
+ @Body() data,
63
+ ) {
64
+ return this.operationsService.updateTimesheet(Number(user?.id || 0), id, data);
65
+ }
66
+
67
+ @Post('timesheets/:id/submit')
68
+ submitTimesheet(@User() user, @Param('id', ParseIntPipe) id: number) {
69
+ return this.operationsService.submitTimesheet(Number(user?.id || 0), id);
70
+ }
71
+
72
+ @Get('time-off')
73
+ listTimeOffRequests(@User() user) {
74
+ return this.operationsService.listTimeOffRequests(Number(user?.id || 0));
75
+ }
76
+
77
+ @Post('time-off')
78
+ createTimeOffRequest(
79
+ @User() user,
80
+ @Body() data: CreateTimeOffRequestDto,
81
+ ) {
82
+ return this.operationsService.createTimeOffRequest(Number(user?.id || 0), data);
83
+ }
84
+
85
+ @Get('schedule-adjustments')
86
+ listScheduleAdjustments(@User() user) {
87
+ return this.operationsService.listScheduleAdjustments(Number(user?.id || 0));
88
+ }
89
+
90
+ @Post('schedule-adjustments')
91
+ createScheduleAdjustmentRequest(
92
+ @User() user,
93
+ @Body() data: CreateScheduleAdjustmentRequestDto,
94
+ ) {
95
+ return this.operationsService.createScheduleAdjustmentRequest(
96
+ Number(user?.id || 0),
97
+ data,
98
+ );
99
+ }
100
+ }
@@ -0,0 +1,43 @@
1
+ import { Transform } from 'class-transformer';
2
+ import {
3
+ IsBoolean,
4
+ IsInt,
5
+ IsOptional,
6
+ IsString,
7
+ MaxLength,
8
+ } from 'class-validator';
9
+
10
+ export class CreateCollaboratorTypeDto {
11
+ @IsString()
12
+ @MaxLength(120)
13
+ name!: string;
14
+
15
+ @IsOptional()
16
+ @IsString()
17
+ @MaxLength(80)
18
+ slug?: string | null;
19
+
20
+ @IsOptional()
21
+ @IsString()
22
+ description?: string | null;
23
+
24
+ @IsOptional()
25
+ @IsString()
26
+ @MaxLength(60)
27
+ category?: string | null;
28
+
29
+ @IsOptional()
30
+ @IsBoolean()
31
+ isActive?: boolean;
32
+
33
+ @IsOptional()
34
+ @Transform(({ value }) =>
35
+ value === '' || value === undefined || value === null ? undefined : Number(value)
36
+ )
37
+ @IsInt()
38
+ sortOrder?: number | null;
39
+
40
+ @IsOptional()
41
+ @IsString()
42
+ status?: 'active' | 'inactive';
43
+ }
@@ -0,0 +1,223 @@
1
+ import { Transform, Type } from 'class-transformer';
2
+ import {
3
+ IsBoolean,
4
+ IsIn,
5
+ IsInt,
6
+ IsNumber,
7
+ IsObject,
8
+ IsOptional,
9
+ IsString,
10
+ MaxLength,
11
+ ValidateNested,
12
+ } from 'class-validator';
13
+
14
+ class CollaboratorWeeklyScheduleDayDto {
15
+ @IsString()
16
+ @IsIn([
17
+ 'monday',
18
+ 'tuesday',
19
+ 'wednesday',
20
+ 'thursday',
21
+ 'friday',
22
+ 'saturday',
23
+ 'sunday',
24
+ ])
25
+ weekday!:
26
+ | 'monday'
27
+ | 'tuesday'
28
+ | 'wednesday'
29
+ | 'thursday'
30
+ | 'friday'
31
+ | 'saturday'
32
+ | 'sunday';
33
+
34
+ @IsOptional()
35
+ @IsBoolean()
36
+ isWorkingDay?: boolean;
37
+
38
+ @IsOptional()
39
+ @IsString()
40
+ startTime?: string | null;
41
+
42
+ @IsOptional()
43
+ @IsString()
44
+ endTime?: string | null;
45
+
46
+ @IsOptional()
47
+ @Transform(({ value }) =>
48
+ value === '' || value === undefined || value === null ? undefined : Number(value)
49
+ )
50
+ @IsNumber()
51
+ breakMinutes?: number | null;
52
+ }
53
+
54
+ export class CollaboratorEquityParticipationDto {
55
+ @IsOptional()
56
+ @IsIn([
57
+ 'partner_quota_holder',
58
+ 'common_shareholder',
59
+ 'preferred_shareholder',
60
+ 'administrator',
61
+ 'other',
62
+ ])
63
+ participationType?:
64
+ | 'partner_quota_holder'
65
+ | 'common_shareholder'
66
+ | 'preferred_shareholder'
67
+ | 'administrator'
68
+ | 'other';
69
+
70
+ @IsOptional()
71
+ @Transform(({ value }) =>
72
+ value === '' || value === undefined || value === null ? undefined : Number(value)
73
+ )
74
+ @IsNumber()
75
+ percentage?: number | null;
76
+
77
+ @IsOptional()
78
+ @Transform(({ value }) =>
79
+ value === '' || value === undefined || value === null ? undefined : Number(value)
80
+ )
81
+ @IsNumber()
82
+ votingPower?: number | null;
83
+
84
+ @IsOptional()
85
+ @IsString()
86
+ startDate?: string | null;
87
+
88
+ @IsOptional()
89
+ @IsString()
90
+ endDate?: string | null;
91
+
92
+ @IsOptional()
93
+ @IsString()
94
+ notes?: string | null;
95
+ }
96
+
97
+ export class CreateCollaboratorDto {
98
+ @IsOptional()
99
+ @Transform(({ value }) =>
100
+ value === '' || value === undefined || value === null ? undefined : Number(value)
101
+ )
102
+ @IsInt()
103
+ userId?: number | null;
104
+
105
+ @IsOptional()
106
+ @Transform(({ value }) =>
107
+ value === '' || value === undefined || value === null ? undefined : Number(value)
108
+ )
109
+ @IsInt()
110
+ personId?: number | null;
111
+
112
+ @IsOptional()
113
+ @IsString()
114
+ @MaxLength(32)
115
+ code?: string | null;
116
+
117
+ @IsOptional()
118
+ @IsString()
119
+ @MaxLength(180)
120
+ displayName?: string | null;
121
+
122
+ @IsOptional()
123
+ @Transform(({ value }) =>
124
+ value === '' || value === undefined || value === null ? undefined : Number(value)
125
+ )
126
+ @IsInt()
127
+ collaboratorTypeId?: number | null;
128
+
129
+ @IsOptional()
130
+ @IsString()
131
+ @MaxLength(80)
132
+ collaboratorTypeSlug?: string | null;
133
+
134
+ @IsOptional()
135
+ @IsString()
136
+ @MaxLength(80)
137
+ collaboratorType?: string | null;
138
+
139
+ @IsOptional()
140
+ @IsString()
141
+ @MaxLength(120)
142
+ department?: string | null;
143
+
144
+ @IsOptional()
145
+ @Transform(({ value }) =>
146
+ value === '' || value === undefined || value === null ? undefined : Number(value)
147
+ )
148
+ @IsInt()
149
+ departmentId?: number | null;
150
+
151
+ @IsOptional()
152
+ @Transform(({ value }) =>
153
+ value === '' || value === undefined || value === null ? undefined : Number(value)
154
+ )
155
+ @IsInt()
156
+ jobTitleId?: number | null;
157
+
158
+ @IsOptional()
159
+ @IsString()
160
+ @MaxLength(120)
161
+ title?: string | null;
162
+
163
+ @IsOptional()
164
+ @IsString()
165
+ @MaxLength(120)
166
+ levelLabel?: string | null;
167
+
168
+ @IsOptional()
169
+ @Transform(({ value }) =>
170
+ value === '' || value === undefined || value === null ? undefined : Number(value)
171
+ )
172
+ @IsInt()
173
+ supervisorCollaboratorId?: number | null;
174
+
175
+ @IsOptional()
176
+ @Transform(({ value }) =>
177
+ value === '' || value === undefined || value === null ? undefined : Number(value)
178
+ )
179
+ @IsNumber()
180
+ weeklyCapacityHours?: number | null;
181
+
182
+ @IsOptional()
183
+ @IsIn(['draft', 'active', 'on_leave', 'inactive'])
184
+ status?: 'draft' | 'active' | 'on_leave' | 'inactive';
185
+
186
+ @IsOptional()
187
+ @IsString()
188
+ joinedAt?: string | null;
189
+
190
+ @IsOptional()
191
+ @IsString()
192
+ leftAt?: string | null;
193
+
194
+ @IsOptional()
195
+ @Transform(({ value }) =>
196
+ value === '' || value === undefined || value === null ? undefined : Number(value)
197
+ )
198
+ @IsNumber()
199
+ compensationAmount?: number | null;
200
+
201
+ @IsOptional()
202
+ @IsString()
203
+ contractDescription?: string | null;
204
+
205
+ @IsOptional()
206
+ @IsBoolean()
207
+ autoGenerateContractDraft?: boolean;
208
+
209
+ @IsOptional()
210
+ @ValidateNested({ each: true })
211
+ @Type(() => CollaboratorWeeklyScheduleDayDto)
212
+ weeklySchedule?: CollaboratorWeeklyScheduleDayDto[];
213
+
214
+ @IsOptional()
215
+ @IsObject()
216
+ @ValidateNested()
217
+ @Type(() => CollaboratorEquityParticipationDto)
218
+ equityParticipation?: CollaboratorEquityParticipationDto | null;
219
+
220
+ @IsOptional()
221
+ @IsString()
222
+ notes?: string | null;
223
+ }
@@ -0,0 +1,91 @@
1
+ import { Transform, Type } from 'class-transformer';
2
+ import {
3
+ ArrayMinSize,
4
+ IsBoolean,
5
+ IsDateString,
6
+ IsIn,
7
+ IsInt,
8
+ IsNumber,
9
+ IsOptional,
10
+ IsString,
11
+ MaxLength,
12
+ Min,
13
+ ValidateNested,
14
+ } from 'class-validator';
15
+
16
+ class ScheduleAdjustmentDayDto {
17
+ @IsString({ message: 'weekday must be a string' })
18
+ @IsIn(
19
+ ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'],
20
+ {
21
+ message:
22
+ 'weekday must be monday, tuesday, wednesday, thursday, friday, saturday, or sunday',
23
+ }
24
+ )
25
+ weekday!:
26
+ | 'monday'
27
+ | 'tuesday'
28
+ | 'wednesday'
29
+ | 'thursday'
30
+ | 'friday'
31
+ | 'saturday'
32
+ | 'sunday';
33
+
34
+ @IsOptional()
35
+ @IsBoolean({ message: 'isWorkingDay must be a boolean' })
36
+ isWorkingDay?: boolean;
37
+
38
+ @IsOptional()
39
+ @IsString({ message: 'startTime must be a string' })
40
+ startTime?: string | null;
41
+
42
+ @IsOptional()
43
+ @IsString({ message: 'endTime must be a string' })
44
+ endTime?: string | null;
45
+
46
+ @IsOptional()
47
+ @Transform(({ value }) =>
48
+ value === '' || value === undefined || value === null ? undefined : Number(value)
49
+ )
50
+ @IsNumber({}, { message: 'breakMinutes must be a number' })
51
+ @Min(0, { message: 'breakMinutes must be 0 or greater' })
52
+ breakMinutes?: number | null;
53
+ }
54
+
55
+ export class CreateScheduleAdjustmentRequestDto {
56
+ @IsOptional()
57
+ @Transform(({ value }) =>
58
+ value === '' || value === undefined || value === null ? undefined : Number(value)
59
+ )
60
+ @IsInt({ message: 'collaboratorId must be an integer' })
61
+ collaboratorId?: number;
62
+
63
+ @IsOptional()
64
+ @IsIn(['temporary', 'permanent'], {
65
+ message: 'requestScope must be temporary or permanent',
66
+ })
67
+ requestScope?: 'temporary' | 'permanent';
68
+
69
+ @IsDateString({}, {
70
+ message: 'effectiveStartDate must be a valid ISO date string',
71
+ })
72
+ effectiveStartDate!: string;
73
+
74
+ @IsOptional()
75
+ @IsDateString({}, {
76
+ message: 'effectiveEndDate must be a valid ISO date string',
77
+ })
78
+ effectiveEndDate?: string | null;
79
+
80
+ @IsOptional()
81
+ @IsString({ message: 'reason must be a string' })
82
+ @MaxLength(500, {
83
+ message: 'reason must have at most 500 characters',
84
+ })
85
+ reason?: string;
86
+
87
+ @ValidateNested({ each: true })
88
+ @Type(() => ScheduleAdjustmentDayDto)
89
+ @ArrayMinSize(1, { message: 'days must contain at least one schedule day' })
90
+ days!: ScheduleAdjustmentDayDto[];
91
+ }
@@ -0,0 +1,35 @@
1
+ import { Transform } from 'class-transformer';
2
+ import { IsIn, IsInt, IsOptional, IsString, MaxLength } from 'class-validator';
3
+
4
+ export class CreateOperationsTaskDto {
5
+ @IsOptional()
6
+ @Transform(({ value }) =>
7
+ value === '' || value === undefined || value === null ? undefined : Number(value)
8
+ )
9
+ @IsInt({ message: 'projectId must be an integer' })
10
+ projectId?: number;
11
+
12
+ @IsOptional()
13
+ @Transform(({ value }) =>
14
+ value === '' || value === undefined || value === null ? undefined : Number(value)
15
+ )
16
+ @IsInt({ message: 'projectAssignmentId must be an integer' })
17
+ projectAssignmentId?: number;
18
+
19
+ @IsString({ message: 'name must be a string' })
20
+ @MaxLength(180, { message: 'name must have at most 180 characters' })
21
+ name!: string;
22
+
23
+ @IsOptional()
24
+ @IsString({ message: 'description must be a string' })
25
+ @MaxLength(500, {
26
+ message: 'description must have at most 500 characters',
27
+ })
28
+ description?: string;
29
+
30
+ @IsOptional()
31
+ @IsIn(['active', 'completed', 'archived'], {
32
+ message: 'status must be active, completed, or archived',
33
+ })
34
+ status?: 'active' | 'completed' | 'archived';
35
+ }
@@ -0,0 +1,53 @@
1
+ import { Transform } from 'class-transformer';
2
+ import {
3
+ IsDateString,
4
+ IsIn,
5
+ IsInt,
6
+ IsNumber,
7
+ IsOptional,
8
+ IsString,
9
+ MaxLength,
10
+ Min,
11
+ } from 'class-validator';
12
+
13
+ export class CreateTimeOffRequestDto {
14
+ @IsOptional()
15
+ @Transform(({ value }) =>
16
+ value === '' || value === undefined || value === null ? undefined : Number(value)
17
+ )
18
+ @IsInt({ message: 'collaboratorId must be an integer' })
19
+ collaboratorId?: number;
20
+
21
+ @IsOptional()
22
+ @IsIn(['vacation', 'personal_time', 'sick_leave', 'unpaid_leave', 'other'], {
23
+ message:
24
+ 'requestType must be vacation, personal_time, sick_leave, unpaid_leave, or other',
25
+ })
26
+ requestType?:
27
+ | 'vacation'
28
+ | 'personal_time'
29
+ | 'sick_leave'
30
+ | 'unpaid_leave'
31
+ | 'other';
32
+
33
+ @IsDateString({}, { message: 'startDate must be a valid ISO date string' })
34
+ startDate!: string;
35
+
36
+ @IsDateString({}, { message: 'endDate must be a valid ISO date string' })
37
+ endDate!: string;
38
+
39
+ @IsOptional()
40
+ @Transform(({ value }) =>
41
+ value === '' || value === undefined || value === null ? undefined : Number(value)
42
+ )
43
+ @IsNumber({}, { message: 'totalDays must be a number' })
44
+ @Min(0.01, { message: 'totalDays must be greater than 0' })
45
+ totalDays?: number | null;
46
+
47
+ @IsOptional()
48
+ @IsString({ message: 'reason must be a string' })
49
+ @MaxLength(500, {
50
+ message: 'reason must have at most 500 characters',
51
+ })
52
+ reason?: string;
53
+ }
@@ -0,0 +1,67 @@
1
+ import { Transform } from 'class-transformer';
2
+ import {
3
+ IsDateString,
4
+ IsIn,
5
+ IsInt,
6
+ IsNumber,
7
+ IsOptional,
8
+ IsString,
9
+ MaxLength,
10
+ Min,
11
+ } from 'class-validator';
12
+
13
+ export class CreateTimesheetEntryDto {
14
+ @IsOptional()
15
+ @Transform(({ value }) =>
16
+ value === '' || value === undefined || value === null ? undefined : Number(value)
17
+ )
18
+ @IsInt({ message: 'projectId must be an integer' })
19
+ projectId?: number;
20
+
21
+ @IsOptional()
22
+ @Transform(({ value }) =>
23
+ value === '' || value === undefined || value === null ? undefined : Number(value)
24
+ )
25
+ @IsInt({ message: 'projectAssignmentId must be an integer' })
26
+ projectAssignmentId?: number;
27
+
28
+ @IsOptional()
29
+ @Transform(({ value }) =>
30
+ value === '' || value === undefined || value === null ? undefined : Number(value)
31
+ )
32
+ @IsInt({ message: 'taskId must be an integer' })
33
+ taskId?: number;
34
+
35
+ @IsOptional()
36
+ @IsString({ message: 'taskName must be a string' })
37
+ @MaxLength(180, { message: 'taskName must have at most 180 characters' })
38
+ taskName?: string;
39
+
40
+ @IsOptional()
41
+ @IsString({ message: 'activityLabel must be a string' })
42
+ @MaxLength(180, {
43
+ message: 'activityLabel must have at most 180 characters',
44
+ })
45
+ activityLabel?: string;
46
+
47
+ @IsDateString({}, { message: 'workDate must be a valid ISO date string' })
48
+ workDate!: string;
49
+
50
+ @Transform(({ value }) => Number(value))
51
+ @IsNumber({}, { message: 'duration must be a number' })
52
+ @Min(0.01, { message: 'duration must be greater than 0' })
53
+ duration!: number;
54
+
55
+ @IsOptional()
56
+ @IsIn(['hours', 'minutes'], {
57
+ message: 'unit must be either hours or minutes',
58
+ })
59
+ unit?: 'hours' | 'minutes';
60
+
61
+ @IsOptional()
62
+ @IsString({ message: 'description must be a string' })
63
+ @MaxLength(500, {
64
+ message: 'description must have at most 500 characters',
65
+ })
66
+ description?: string;
67
+ }
@@ -0,0 +1,15 @@
1
+ import { Transform } from 'class-transformer';
2
+ import { IsBoolean, IsOptional } from 'class-validator';
3
+
4
+ export class ListCollaboratorTypesDto {
5
+ @IsOptional()
6
+ @Transform(({ value }) => {
7
+ if (value === '' || value === undefined || value === null) {
8
+ return undefined;
9
+ }
10
+
11
+ return value === true || value === 'true' || value === '1';
12
+ })
13
+ @IsBoolean()
14
+ active?: boolean;
15
+ }