@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
@@ -7,8 +7,10 @@ import {
7
7
  ParseIntPipe,
8
8
  Patch,
9
9
  Post,
10
+ Query,
10
11
  } from '@nestjs/common';
11
12
  import { CreateCollaboratorDto } from '../dto/create-collaborator.dto';
13
+ import { ListCollaboratorsDto } from '../dto/list-collaborators.dto';
12
14
  import { UpdateCollaboratorDto } from '../dto/update-collaborator.dto';
13
15
  import { OperationsService } from '../operations.service';
14
16
 
@@ -18,8 +20,19 @@ export class OperationsCollaboratorsController {
18
20
  constructor(private readonly operationsService: OperationsService) {}
19
21
 
20
22
  @Get('collaborators')
21
- listCollaborators(@User() user) {
22
- return this.operationsService.listCollaborators(Number(user?.id || 0));
23
+ listCollaborators(@User() user, @Query() filters: ListCollaboratorsDto) {
24
+ return this.operationsService.listCollaborators(
25
+ Number(user?.id || 0),
26
+ filters,
27
+ );
28
+ }
29
+
30
+ @Get('collaborators/stats')
31
+ listCollaboratorStats(@User() user, @Query() filters: ListCollaboratorsDto) {
32
+ return this.operationsService.getCollaboratorStats(
33
+ Number(user?.id || 0),
34
+ filters,
35
+ );
23
36
  }
24
37
 
25
38
  @Get('collaborators/me')
@@ -8,7 +8,9 @@ import {
8
8
  ParseIntPipe,
9
9
  Patch,
10
10
  Post,
11
+ Query,
11
12
  } from '@nestjs/common';
13
+ import { ListContractsDto } from '../dto/list-contracts.dto';
12
14
  import { OperationsService } from '../operations.service';
13
15
 
14
16
  @Role()
@@ -16,43 +18,14 @@ import { OperationsService } from '../operations.service';
16
18
  export class OperationsContractsController {
17
19
  constructor(private readonly operationsService: OperationsService) {}
18
20
 
19
- @Get('contract-templates')
20
- listContractTemplates(@User() user) {
21
- return this.operationsService.listContractTemplates(Number(user?.id || 0));
22
- }
23
-
24
- @Get('contract-templates/:id')
25
- getContractTemplate(@User() user, @Param('id', ParseIntPipe) id: number) {
26
- return this.operationsService.getContractTemplateById(
27
- Number(user?.id || 0),
28
- id,
29
- );
30
- }
31
-
32
- @Post('contract-templates')
33
- createContractTemplate(@User() user, @Body() data) {
34
- return this.operationsService.createContractTemplate(
35
- Number(user?.id || 0),
36
- data,
37
- );
38
- }
39
-
40
- @Patch('contract-templates/:id')
41
- updateContractTemplate(
42
- @User() user,
43
- @Param('id', ParseIntPipe) id: number,
44
- @Body() data,
45
- ) {
46
- return this.operationsService.updateContractTemplate(
47
- Number(user?.id || 0),
48
- id,
49
- data,
50
- );
21
+ @Get('contracts')
22
+ listContracts(@User() user, @Query() filters: ListContractsDto) {
23
+ return this.operationsService.listContracts(Number(user?.id || 0), filters);
51
24
  }
52
25
 
53
- @Get('contracts')
54
- listContracts(@User() user) {
55
- return this.operationsService.listContracts(Number(user?.id || 0));
26
+ @Get('contracts/stats')
27
+ getContractStats(@User() user) {
28
+ return this.operationsService.getContractStats(Number(user?.id || 0));
56
29
  }
57
30
 
58
31
  @Get('contracts/:id')
@@ -60,63 +33,11 @@ export class OperationsContractsController {
60
33
  return this.operationsService.getContractById(Number(user?.id || 0), id);
61
34
  }
62
35
 
63
- @Post('contracts/drafts')
64
- createContractDraft(@User() user, @Body() data) {
65
- return this.operationsService.createContractDraft(Number(user?.id || 0), data);
66
- }
67
-
68
36
  @Post('contracts')
69
37
  createContract(@User() user, @Body() data) {
70
38
  return this.operationsService.createContract(Number(user?.id || 0), data);
71
39
  }
72
40
 
73
- @Post('contracts/extract-draft')
74
- extractContractDraft(@User() user, @Body() data) {
75
- return this.operationsService.extractContractDraft(
76
- Number(user?.id || 0),
77
- data,
78
- );
79
- }
80
-
81
- @Post('contracts/:id/extract-source')
82
- extractContractSource(
83
- @User() user,
84
- @Param('id', ParseIntPipe) id: number,
85
- @Body() data,
86
- ) {
87
- return this.operationsService.extractContractSource(
88
- Number(user?.id || 0),
89
- id,
90
- data,
91
- );
92
- }
93
-
94
- @Post('contracts/:id/generate-content')
95
- generateContractContent(
96
- @User() user,
97
- @Param('id', ParseIntPipe) id: number,
98
- @Body() data,
99
- ) {
100
- return this.operationsService.generateContractContent(
101
- Number(user?.id || 0),
102
- id,
103
- data,
104
- );
105
- }
106
-
107
- @Post('contracts/:id/legal-review')
108
- reviewContractLegally(
109
- @User() user,
110
- @Param('id', ParseIntPipe) id: number,
111
- @Body() data,
112
- ) {
113
- return this.operationsService.reviewContractLegally(
114
- Number(user?.id || 0),
115
- id,
116
- data,
117
- );
118
- }
119
-
120
41
  @Patch('contracts/:id')
121
42
  updateContract(
122
43
  @User() user,
@@ -130,9 +51,4 @@ export class OperationsContractsController {
130
51
  removeContract(@User() user, @Param('id', ParseIntPipe) id: number) {
131
52
  return this.operationsService.removeContract(Number(user?.id || 0), id);
132
53
  }
133
-
134
- @Post('contracts/:id/generate-pdf')
135
- generateContractPdf(@User() user, @Param('id', ParseIntPipe) id: number) {
136
- return this.operationsService.generateContractPdf(Number(user?.id || 0), id);
137
- }
138
54
  }
@@ -1,5 +1,4 @@
1
1
  import { Role, User } from '@hed-hog/api';
2
- import { Pagination } from '@hed-hog/api-pagination';
3
2
  import {
4
3
  Body,
5
4
  Controller,
@@ -8,9 +7,12 @@ import {
8
7
  ParseIntPipe,
9
8
  Patch,
10
9
  Post,
10
+ Query,
11
11
  } from '@nestjs/common';
12
12
  import { CreateCollaboratorTypeDto } from '../dto/create-collaborator-type.dto';
13
13
  import { ListCollaboratorTypesDto } from '../dto/list-collaborator-types.dto';
14
+ import { ListDepartmentsDto } from '../dto/list-departments.dto';
15
+ import { ReorderCollaboratorTypesDto } from '../dto/reorder-collaborator-types.dto';
14
16
  import { UpdateCollaboratorTypeDto } from '../dto/update-collaborator-type.dto';
15
17
  import { OperationsService } from '../operations.service';
16
18
 
@@ -22,7 +24,7 @@ export class OperationsOrgStructureController {
22
24
  @Get('collaborator-types')
23
25
  listCollaboratorTypes(
24
26
  @User() user,
25
- @Pagination() filters: ListCollaboratorTypesDto,
27
+ @Query() filters: ListCollaboratorTypesDto,
26
28
  ) {
27
29
  return this.operationsService.listCollaboratorTypes(
28
30
  Number(user?.id || 0),
@@ -38,6 +40,17 @@ export class OperationsOrgStructureController {
38
40
  );
39
41
  }
40
42
 
43
+ @Patch('collaborator-types/reorder')
44
+ reorderCollaboratorTypes(
45
+ @User() user,
46
+ @Body() data: ReorderCollaboratorTypesDto,
47
+ ) {
48
+ return this.operationsService.reorderCollaboratorTypes(
49
+ Number(user?.id || 0),
50
+ data.ids,
51
+ );
52
+ }
53
+
41
54
  @Patch('collaborator-types/:id')
42
55
  updateCollaboratorType(
43
56
  @User() user,
@@ -62,8 +75,8 @@ export class OperationsOrgStructureController {
62
75
  }
63
76
 
64
77
  @Get('departments')
65
- listDepartments(@User() user) {
66
- return this.operationsService.listDepartments(Number(user?.id || 0));
78
+ listDepartments(@User() user, @Query() filters: ListDepartmentsDto) {
79
+ return this.operationsService.listDepartments(Number(user?.id || 0), filters);
67
80
  }
68
81
 
69
82
  @Post('departments')
@@ -1,5 +1,4 @@
1
1
  import { Role, User } from '@hed-hog/api';
2
- import { Pagination } from '@hed-hog/api-pagination';
3
2
  import {
4
3
  Body,
5
4
  Controller,
@@ -8,8 +7,10 @@ import {
8
7
  ParseIntPipe,
9
8
  Patch,
10
9
  Post,
10
+ Query,
11
11
  } from '@nestjs/common';
12
12
  import { ListOperationsProjectOptionsDto } from '../dto/list-project-options.dto';
13
+ import { ListProjectsDto } from '../dto/list-projects.dto';
13
14
  import { OperationsService } from '../operations.service';
14
15
 
15
16
  @Role()
@@ -20,7 +21,7 @@ export class OperationsProjectsController {
20
21
  @Get('projects/options')
21
22
  listProjectOptions(
22
23
  @User() user,
23
- @Pagination() paginationParams: ListOperationsProjectOptionsDto,
24
+ @Query() paginationParams: ListOperationsProjectOptionsDto,
24
25
  ) {
25
26
  return this.operationsService.listProjectOptions(
26
27
  Number(user?.id || 0),
@@ -29,8 +30,13 @@ export class OperationsProjectsController {
29
30
  }
30
31
 
31
32
  @Get('projects')
32
- listProjects(@User() user) {
33
- return this.operationsService.listProjects(Number(user?.id || 0));
33
+ listProjects(@User() user, @Query() filters: ListProjectsDto) {
34
+ return this.operationsService.listProjects(Number(user?.id || 0), filters);
35
+ }
36
+
37
+ @Get('projects/:id/stats')
38
+ getProjectStats(@User() user, @Param('id', ParseIntPipe) id: number) {
39
+ return this.operationsService.getProjectStats(Number(user?.id || 0), id);
34
40
  }
35
41
 
36
42
  @Get('projects/:id')
@@ -1,5 +1,4 @@
1
1
  import { Role, User } from '@hed-hog/api';
2
- import { Pagination } from '@hed-hog/api-pagination';
3
2
  import {
4
3
  Body,
5
4
  Controller,
@@ -9,11 +8,15 @@ import {
9
8
  ParseIntPipe,
10
9
  Patch,
11
10
  Post,
11
+ Query,
12
12
  } from '@nestjs/common';
13
13
  import { CreateScheduleAdjustmentRequestDto } from '../dto/create-schedule-adjustment-request.dto';
14
14
  import { CreateTimeOffRequestDto } from '../dto/create-time-off-request.dto';
15
15
  import { CreateTimesheetEntryDto } from '../dto/create-timesheet-entry.dto';
16
+ import { ListScheduleAdjustmentsDto } from '../dto/list-schedule-adjustments.dto';
17
+ import { ListTimeOffRequestsDto } from '../dto/list-time-off-requests.dto';
16
18
  import { ListTimesheetEntriesDto } from '../dto/list-timesheet-entries.dto';
19
+ import { ListTimesheetsDto } from '../dto/list-timesheets.dto';
17
20
  import { OperationsService } from '../operations.service';
18
21
 
19
22
  @Role()
@@ -22,14 +25,14 @@ export class OperationsTimesheetsController {
22
25
  constructor(private readonly operationsService: OperationsService) {}
23
26
 
24
27
  @Get('timesheets')
25
- listTimesheets(@User() user) {
26
- return this.operationsService.listTimesheets(Number(user?.id || 0));
28
+ listTimesheets(@User() user, @Query() filters: ListTimesheetsDto) {
29
+ return this.operationsService.listTimesheets(Number(user?.id || 0), filters);
27
30
  }
28
31
 
29
32
  @Get('timesheet-entries')
30
33
  listTimesheetEntries(
31
34
  @User() user,
32
- @Pagination() paginationParams: ListTimesheetEntriesDto,
35
+ @Query() paginationParams: ListTimesheetEntriesDto,
33
36
  ) {
34
37
  return this.operationsService.listTimesheetEntries(
35
38
  Number(user?.id || 0),
@@ -83,8 +86,8 @@ export class OperationsTimesheetsController {
83
86
  }
84
87
 
85
88
  @Get('time-off')
86
- listTimeOffRequests(@User() user) {
87
- return this.operationsService.listTimeOffRequests(Number(user?.id || 0));
89
+ listTimeOffRequests(@User() user, @Query() filters: ListTimeOffRequestsDto) {
90
+ return this.operationsService.listTimeOffRequests(Number(user?.id || 0), filters);
88
91
  }
89
92
 
90
93
  @Post('time-off')
@@ -96,8 +99,14 @@ export class OperationsTimesheetsController {
96
99
  }
97
100
 
98
101
  @Get('schedule-adjustments')
99
- listScheduleAdjustments(@User() user) {
100
- return this.operationsService.listScheduleAdjustments(Number(user?.id || 0));
102
+ listScheduleAdjustments(
103
+ @User() user,
104
+ @Query() filters: ListScheduleAdjustmentsDto,
105
+ ) {
106
+ return this.operationsService.listScheduleAdjustments(
107
+ Number(user?.id || 0),
108
+ filters,
109
+ );
101
110
  }
102
111
 
103
112
  @Post('schedule-adjustments')
@@ -0,0 +1,12 @@
1
+ import { PaginationDTO } from '@hed-hog/api-pagination';
2
+ import { IsOptional, IsString } from 'class-validator';
3
+
4
+ export class ListApprovalsDto extends PaginationDTO {
5
+ @IsOptional()
6
+ @IsString()
7
+ status?: string;
8
+
9
+ @IsOptional()
10
+ @IsString()
11
+ targetType?: string;
12
+ }
@@ -1,7 +1,8 @@
1
+ import { PaginationDTO } from '@hed-hog/api-pagination';
1
2
  import { Transform } from 'class-transformer';
2
- import { IsBoolean, IsOptional } from 'class-validator';
3
+ import { IsBoolean, IsOptional, IsString } from 'class-validator';
3
4
 
4
- export class ListCollaboratorTypesDto {
5
+ export class ListCollaboratorTypesDto extends PaginationDTO {
5
6
  @IsOptional()
6
7
  @Transform(({ value }) => {
7
8
  if (value === '' || value === undefined || value === null) {
@@ -12,4 +13,8 @@ export class ListCollaboratorTypesDto {
12
13
  })
13
14
  @IsBoolean()
14
15
  active?: boolean;
16
+
17
+ @IsOptional()
18
+ @IsString()
19
+ status?: string;
15
20
  }
@@ -7,6 +7,10 @@ export class ListCollaboratorsDto extends PaginationDTO {
7
7
  @IsString()
8
8
  status?: string;
9
9
 
10
+ @IsOptional()
11
+ @IsString()
12
+ collaboratorType?: string;
13
+
10
14
  @IsOptional()
11
15
  @Transform(({ value }) =>
12
16
  value === '' || value === undefined || value === null ? undefined : Number(value)
@@ -0,0 +1,20 @@
1
+ import { PaginationDTO } from '@hed-hog/api-pagination';
2
+ import { IsBooleanString, IsOptional, IsString } from 'class-validator';
3
+
4
+ export class ListContractsDto extends PaginationDTO {
5
+ @IsOptional()
6
+ @IsString()
7
+ status?: string;
8
+
9
+ @IsOptional()
10
+ @IsString()
11
+ contractCategory?: string;
12
+
13
+ @IsOptional()
14
+ @IsString()
15
+ originType?: string;
16
+
17
+ @IsOptional()
18
+ @IsBooleanString()
19
+ isActive?: string;
20
+ }
@@ -0,0 +1,8 @@
1
+ import { PaginationDTO } from '@hed-hog/api-pagination';
2
+ import { IsOptional, IsString } from 'class-validator';
3
+
4
+ export class ListDepartmentsDto extends PaginationDTO {
5
+ @IsOptional()
6
+ @IsString()
7
+ status?: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { PaginationDTO } from '@hed-hog/api-pagination';
2
+ import { IsOptional, IsString } from 'class-validator';
3
+
4
+ export class ListProjectsDto extends PaginationDTO {
5
+ @IsOptional()
6
+ @IsString()
7
+ status?: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { PaginationDTO } from '@hed-hog/api-pagination';
2
+ import { IsOptional, IsString } from 'class-validator';
3
+
4
+ export class ListScheduleAdjustmentsDto extends PaginationDTO {
5
+ @IsOptional()
6
+ @IsString()
7
+ status?: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { PaginationDTO } from '@hed-hog/api-pagination';
2
+ import { IsOptional, IsString } from 'class-validator';
3
+
4
+ export class ListTimeOffRequestsDto extends PaginationDTO {
5
+ @IsOptional()
6
+ @IsString()
7
+ status?: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { PaginationDTO } from '@hed-hog/api-pagination';
2
+ import { IsOptional, IsString } from 'class-validator';
3
+
4
+ export class ListTimesheetsDto extends PaginationDTO {
5
+ @IsOptional()
6
+ @IsString()
7
+ status?: string;
8
+ }
@@ -0,0 +1,10 @@
1
+ import { Type } from 'class-transformer';
2
+ import { ArrayMinSize, IsArray, IsInt } from 'class-validator';
3
+
4
+ export class ReorderCollaboratorTypesDto {
5
+ @IsArray()
6
+ @ArrayMinSize(1)
7
+ @Type(() => Number)
8
+ @IsInt({ each: true })
9
+ ids!: number[];
10
+ }
@@ -29,10 +29,6 @@ describe('OperationsService proposal integration', () => {
29
29
 
30
30
  jest.spyOn(service as any, 'generateContractCode').mockResolvedValue('CTR-001');
31
31
  jest.spyOn(service as any, 'replaceContractParties').mockResolvedValue(undefined);
32
- jest
33
- .spyOn(service as any, 'replaceContractFinancialTerms')
34
- .mockResolvedValue(undefined);
35
- jest.spyOn(service as any, 'replaceContractRevisions').mockResolvedValue(undefined);
36
32
  jest.spyOn(service as any, 'insertContractHistory').mockResolvedValue(undefined);
37
33
  });
38
34
 
@@ -156,32 +152,6 @@ describe('OperationsService proposal integration', () => {
156
152
  }),
157
153
  ],
158
154
  );
159
- expect((service as any).replaceContractFinancialTerms).toHaveBeenCalledWith(
160
- tx,
161
- 77,
162
- expect.arrayContaining([
163
- expect.objectContaining({
164
- label: 'Monthly retainer',
165
- amount: 1000,
166
- recurrence: 'monthly',
167
- }),
168
- expect.objectContaining({
169
- label: 'Setup fee',
170
- amount: 234,
171
- recurrence: 'one_time',
172
- }),
173
- ]),
174
- );
175
- expect((service as any).replaceContractRevisions).toHaveBeenCalledWith(
176
- tx,
177
- 77,
178
- [
179
- expect.objectContaining({
180
- title: 'Revision 1',
181
- status: 'draft',
182
- }),
183
- ],
184
- );
185
155
  expect((service as any).insertContractHistory).toHaveBeenCalledWith(
186
156
  tx,
187
157
  77,