@hed-hog/operations 0.0.332 → 0.0.338

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 (109) hide show
  1. package/dist/controllers/operations-collaborators.controller.d.ts +0 -54
  2. package/dist/controllers/operations-collaborators.controller.d.ts.map +1 -1
  3. package/dist/controllers/operations-collaborators.controller.js +0 -100
  4. package/dist/controllers/operations-collaborators.controller.js.map +1 -1
  5. package/dist/controllers/operations-contracts.controller.d.ts +12 -12
  6. package/dist/operations.service.d.ts +0 -76
  7. package/dist/operations.service.d.ts.map +1 -1
  8. package/dist/operations.service.js +7 -230
  9. package/dist/operations.service.js.map +1 -1
  10. package/dist/operations.service.spec.js +6 -0
  11. package/dist/operations.service.spec.js.map +1 -1
  12. package/hedhog/data/menu.yaml +8 -27
  13. package/hedhog/data/route.yaml +0 -72
  14. package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +476 -0
  15. package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +3 -39
  16. package/hedhog/frontend/app/_components/collaborator-select-with-create.tsx.ejs +261 -0
  17. package/hedhog/frontend/app/_components/collaborator-tasks-tab.tsx.ejs +358 -358
  18. package/hedhog/frontend/app/_components/collaborator-timesheets-tab.tsx.ejs +6 -6
  19. package/hedhog/frontend/app/_components/contract-content-editor.tsx.ejs +258 -0
  20. package/hedhog/frontend/app/_components/my-project-summary-screen.tsx.ejs +5 -4
  21. package/hedhog/frontend/app/_components/person-select-with-create.tsx.ejs +1 -0
  22. package/hedhog/frontend/app/_components/project-assignments-tab.tsx.ejs +10 -218
  23. package/hedhog/frontend/app/_components/project-cost-report-screen.tsx.ejs +23 -23
  24. package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +24 -708
  25. package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +38 -158
  26. package/hedhog/frontend/app/_components/task-detail-sheet.tsx.ejs +1 -5
  27. package/hedhog/frontend/app/_components/task-form-sheet.tsx.ejs +629 -629
  28. package/hedhog/frontend/app/_lib/api.ts.ejs +0 -151
  29. package/hedhog/frontend/app/_lib/types.ts.ejs +0 -1
  30. package/hedhog/frontend/app/_lib/utils/task-ui.ts.ejs +0 -18
  31. package/hedhog/frontend/app/my-projects/page.tsx.ejs +2 -16
  32. package/hedhog/frontend/app/my-tasks/page.tsx.ejs +86 -24
  33. package/hedhog/frontend/app/projects/page.tsx.ejs +6 -42
  34. package/hedhog/frontend/messages/en.json +2 -96
  35. package/hedhog/frontend/messages/operations/operations/en.json +2100 -0
  36. package/hedhog/frontend/messages/operations/operations/pt.json +2111 -0
  37. package/hedhog/frontend/messages/pt.json +2 -96
  38. package/hedhog/frontend/widgets/capacity-distribution.tsx.ejs +16 -16
  39. package/hedhog/frontend/widgets/effort-by-project.tsx.ejs +16 -16
  40. package/hedhog/frontend/widgets/headcount-by-area.tsx.ejs +16 -16
  41. package/hedhog/frontend/widgets/index.ts.ejs +25 -25
  42. package/hedhog/frontend/widgets/managed-projects-status.tsx.ejs +16 -16
  43. package/hedhog/frontend/widgets/my-hours-period-kpi.tsx.ejs +16 -16
  44. package/hedhog/frontend/widgets/my-open-requests-kpi.tsx.ejs +16 -16
  45. package/hedhog/frontend/widgets/my-pending-requests-list.tsx.ejs +16 -16
  46. package/hedhog/frontend/widgets/my-project-allocations-kpi.tsx.ejs +16 -16
  47. package/hedhog/frontend/widgets/my-quick-actions.tsx.ejs +16 -16
  48. package/hedhog/frontend/widgets/my-relevant-deadlines.tsx.ejs +16 -16
  49. package/hedhog/frontend/widgets/my-timesheet-status-kpi.tsx.ejs +16 -16
  50. package/hedhog/frontend/widgets/my-weekly-journey.tsx.ejs +16 -16
  51. package/hedhog/frontend/widgets/portfolio-costs-kpi.tsx.ejs +16 -16
  52. package/hedhog/frontend/widgets/portfolio-effort-kpi.tsx.ejs +16 -16
  53. package/hedhog/frontend/widgets/portfolio-projects-kpi.tsx.ejs +16 -16
  54. package/hedhog/frontend/widgets/portfolio-risk-kpi.tsx.ejs +16 -16
  55. package/hedhog/frontend/widgets/project-status-overview.tsx.ejs +16 -16
  56. package/hedhog/frontend/widgets/shared-operations-widget.tsx.ejs +169 -169
  57. package/hedhog/frontend/widgets/strategic-deadlines.tsx.ejs +16 -16
  58. package/hedhog/frontend/widgets/team-approval-queue.tsx.ejs +16 -16
  59. package/hedhog/frontend/widgets/team-capacity-kpi.tsx.ejs +16 -16
  60. package/hedhog/frontend/widgets/team-headcount-kpi.tsx.ejs +16 -16
  61. package/hedhog/frontend/widgets/team-hours-kpi.tsx.ejs +16 -16
  62. package/hedhog/frontend/widgets/team-pending-approvals-kpi.tsx.ejs +16 -16
  63. package/hedhog/frontend/widgets/team-utilization-overview.tsx.ejs +16 -16
  64. package/hedhog/frontend/widgets/team-workload-alerts.tsx.ejs +16 -16
  65. package/hedhog/table/operations_collaborator.yaml +8 -8
  66. package/hedhog/table/operations_task.yaml +76 -76
  67. package/hedhog/table/operations_task_activity.yaml +51 -51
  68. package/package.json +6 -6
  69. package/src/controllers/operations-collaborators.controller.ts +8 -117
  70. package/src/controllers/operations-tasks.controller.ts +156 -156
  71. package/src/dashboard/widgets/MyQuickActions.tsx +22 -22
  72. package/src/dto/create-collaborator.dto.ts +4 -4
  73. package/src/operations.service.spec.ts +1006 -988
  74. package/src/operations.service.ts +7 -323
  75. package/dist/dto/create-collaborator-invoice.dto.d.ts +0 -11
  76. package/dist/dto/create-collaborator-invoice.dto.d.ts.map +0 -1
  77. package/dist/dto/create-collaborator-invoice.dto.js +0 -55
  78. package/dist/dto/create-collaborator-invoice.dto.js.map +0 -1
  79. package/dist/dto/create-collaborator-payment.dto.d.ts +0 -10
  80. package/dist/dto/create-collaborator-payment.dto.d.ts.map +0 -1
  81. package/dist/dto/create-collaborator-payment.dto.js +0 -50
  82. package/dist/dto/create-collaborator-payment.dto.js.map +0 -1
  83. package/dist/dto/list-collaborator-invoice.dto.d.ts +0 -4
  84. package/dist/dto/list-collaborator-invoice.dto.d.ts.map +0 -1
  85. package/dist/dto/list-collaborator-invoice.dto.js +0 -8
  86. package/dist/dto/list-collaborator-invoice.dto.js.map +0 -1
  87. package/dist/dto/list-collaborator-payment.dto.d.ts +0 -4
  88. package/dist/dto/list-collaborator-payment.dto.d.ts.map +0 -1
  89. package/dist/dto/list-collaborator-payment.dto.js +0 -8
  90. package/dist/dto/list-collaborator-payment.dto.js.map +0 -1
  91. package/dist/dto/update-collaborator-invoice.dto.d.ts +0 -6
  92. package/dist/dto/update-collaborator-invoice.dto.d.ts.map +0 -1
  93. package/dist/dto/update-collaborator-invoice.dto.js +0 -9
  94. package/dist/dto/update-collaborator-invoice.dto.js.map +0 -1
  95. package/dist/dto/update-collaborator-payment.dto.d.ts +0 -6
  96. package/dist/dto/update-collaborator-payment.dto.d.ts.map +0 -1
  97. package/dist/dto/update-collaborator-payment.dto.js +0 -9
  98. package/dist/dto/update-collaborator-payment.dto.js.map +0 -1
  99. package/hedhog/frontend/app/_components/collaborator-invoices-tab.tsx.ejs +0 -443
  100. package/hedhog/frontend/app/_components/collaborator-payment-history-tab.tsx.ejs +0 -429
  101. package/hedhog/frontend/app/tasks-gantt/page.tsx.ejs +0 -953
  102. package/hedhog/table/operations_collaborator_invoice.yaml +0 -35
  103. package/hedhog/table/operations_collaborator_payment.yaml +0 -32
  104. package/src/dto/create-collaborator-invoice.dto.ts +0 -39
  105. package/src/dto/create-collaborator-payment.dto.ts +0 -35
  106. package/src/dto/list-collaborator-invoice.dto.ts +0 -3
  107. package/src/dto/list-collaborator-payment.dto.ts +0 -3
  108. package/src/dto/update-collaborator-invoice.dto.ts +0 -6
  109. package/src/dto/update-collaborator-payment.dto.ts +0 -6
@@ -1,156 +1,156 @@
1
- import { Role, User } from "@hed-hog/api";
2
- import {
3
- Body,
4
- Controller,
5
- Delete,
6
- Get,
7
- Param,
8
- ParseIntPipe,
9
- Patch,
10
- Post,
11
- Query,
12
- UploadedFile,
13
- UseInterceptors,
14
- } from "@nestjs/common";
15
- import { FileInterceptor } from "@nestjs/platform-express";
16
- import { CreateOperationsTaskDto } from "../dto/create-task.dto";
17
- import { ListMyTasksDto } from "../dto/list-my-tasks.dto";
18
- import { ListOperationsTasksDto } from "../dto/list-tasks.dto";
19
- import { UpdateOperationsTaskDto } from "../dto/update-task.dto";
20
- import { OperationsService } from "../operations.service";
21
-
22
- @Role()
23
- @Controller("operations")
24
- export class OperationsTasksController {
25
- constructor(private readonly operationsService: OperationsService) {}
26
-
27
- @Get("tasks")
28
- listTasks(@User() user, @Query() paginationParams: ListOperationsTasksDto) {
29
- return this.operationsService.listTasks(
30
- Number(user?.id || 0),
31
- paginationParams,
32
- );
33
- }
34
-
35
- @Get("my-tasks")
36
- listMyTasks(@User() user, @Query() paginationParams: ListMyTasksDto) {
37
- return this.operationsService.listMyTasks(
38
- Number(user?.id || 0),
39
- paginationParams,
40
- );
41
- }
42
-
43
- @Get("projects/:id/tasks")
44
- listProjectBoardTasks(@User() user, @Param("id", ParseIntPipe) id: number) {
45
- return this.operationsService.listProjectBoardTasks(
46
- Number(user?.id || 0),
47
- id,
48
- );
49
- }
50
-
51
- @Post("tasks")
52
- createTask(@User() user, @Body() data: CreateOperationsTaskDto) {
53
- return this.operationsService.createTask(Number(user?.id || 0), data);
54
- }
55
-
56
- @Patch("tasks/:id")
57
- updateTask(
58
- @User() user,
59
- @Param("id", ParseIntPipe) id: number,
60
- @Body() data: UpdateOperationsTaskDto,
61
- ) {
62
- return this.operationsService.updateTask(Number(user?.id || 0), id, data);
63
- }
64
-
65
- @Delete("tasks/:id")
66
- removeTask(
67
- @User() user,
68
- @Param("id", ParseIntPipe) id: number,
69
- @Query("permanent") permanent?: string,
70
- ) {
71
- return this.operationsService.removeTask(
72
- Number(user?.id || 0),
73
- id,
74
- permanent === "true",
75
- );
76
- }
77
-
78
- @Get("tasks/:id/files")
79
- listTaskFiles(@User() user, @Param("id", ParseIntPipe) id: number) {
80
- return this.operationsService.listTaskFiles(Number(user?.id || 0), id);
81
- }
82
-
83
- @Post("tasks/:id/files")
84
- @UseInterceptors(FileInterceptor("file"))
85
- addTaskFile(
86
- @User() user,
87
- @Param("id", ParseIntPipe) id: number,
88
- @UploadedFile() file: MulterFile,
89
- ) {
90
- return this.operationsService.addTaskFile(Number(user?.id || 0), id, file);
91
- }
92
-
93
- @Delete("tasks/:id/files/:fileRelationId")
94
- removeTaskFile(
95
- @User() user,
96
- @Param("id", ParseIntPipe) id: number,
97
- @Param("fileRelationId", ParseIntPipe) fileRelationId: number,
98
- ) {
99
- return this.operationsService.removeTaskFile(
100
- Number(user?.id || 0),
101
- id,
102
- fileRelationId,
103
- );
104
- }
105
-
106
- @Get("tasks/:id/comments")
107
- listTaskComments(@User() user, @Param("id", ParseIntPipe) id: number) {
108
- return this.operationsService.listTaskComments(Number(user?.id || 0), id);
109
- }
110
-
111
- @Get("tasks/:id/activities")
112
- listTaskActivities(@User() user, @Param("id", ParseIntPipe) id: number) {
113
- return this.operationsService.listTaskActivities(Number(user?.id || 0), id);
114
- }
115
-
116
- @Post("tasks/:id/comments")
117
- addTaskComment(
118
- @User() user,
119
- @Param("id", ParseIntPipe) id: number,
120
- @Body("content") content: string,
121
- ) {
122
- return this.operationsService.addTaskComment(
123
- Number(user?.id || 0),
124
- id,
125
- content,
126
- );
127
- }
128
-
129
- @Patch("tasks/:taskId/comments/:commentId")
130
- updateTaskComment(
131
- @User() user,
132
- @Param("taskId", ParseIntPipe) taskId: number,
133
- @Param("commentId", ParseIntPipe) commentId: number,
134
- @Body("content") content: string,
135
- ) {
136
- return this.operationsService.updateTaskComment(
137
- Number(user?.id || 0),
138
- taskId,
139
- commentId,
140
- content,
141
- );
142
- }
143
-
144
- @Delete("tasks/:taskId/comments/:commentId")
145
- removeTaskComment(
146
- @User() user,
147
- @Param("taskId", ParseIntPipe) taskId: number,
148
- @Param("commentId", ParseIntPipe) commentId: number,
149
- ) {
150
- return this.operationsService.removeTaskComment(
151
- Number(user?.id || 0),
152
- taskId,
153
- commentId,
154
- );
155
- }
156
- }
1
+ import { Role, User } from "@hed-hog/api";
2
+ import {
3
+ Body,
4
+ Controller,
5
+ Delete,
6
+ Get,
7
+ Param,
8
+ ParseIntPipe,
9
+ Patch,
10
+ Post,
11
+ Query,
12
+ UploadedFile,
13
+ UseInterceptors,
14
+ } from "@nestjs/common";
15
+ import { FileInterceptor } from "@nestjs/platform-express";
16
+ import { CreateOperationsTaskDto } from "../dto/create-task.dto";
17
+ import { ListMyTasksDto } from "../dto/list-my-tasks.dto";
18
+ import { ListOperationsTasksDto } from "../dto/list-tasks.dto";
19
+ import { UpdateOperationsTaskDto } from "../dto/update-task.dto";
20
+ import { OperationsService } from "../operations.service";
21
+
22
+ @Role()
23
+ @Controller("operations")
24
+ export class OperationsTasksController {
25
+ constructor(private readonly operationsService: OperationsService) {}
26
+
27
+ @Get("tasks")
28
+ listTasks(@User() user, @Query() paginationParams: ListOperationsTasksDto) {
29
+ return this.operationsService.listTasks(
30
+ Number(user?.id || 0),
31
+ paginationParams,
32
+ );
33
+ }
34
+
35
+ @Get("my-tasks")
36
+ listMyTasks(@User() user, @Query() paginationParams: ListMyTasksDto) {
37
+ return this.operationsService.listMyTasks(
38
+ Number(user?.id || 0),
39
+ paginationParams,
40
+ );
41
+ }
42
+
43
+ @Get("projects/:id/tasks")
44
+ listProjectBoardTasks(@User() user, @Param("id", ParseIntPipe) id: number) {
45
+ return this.operationsService.listProjectBoardTasks(
46
+ Number(user?.id || 0),
47
+ id,
48
+ );
49
+ }
50
+
51
+ @Post("tasks")
52
+ createTask(@User() user, @Body() data: CreateOperationsTaskDto) {
53
+ return this.operationsService.createTask(Number(user?.id || 0), data);
54
+ }
55
+
56
+ @Patch("tasks/:id")
57
+ updateTask(
58
+ @User() user,
59
+ @Param("id", ParseIntPipe) id: number,
60
+ @Body() data: UpdateOperationsTaskDto,
61
+ ) {
62
+ return this.operationsService.updateTask(Number(user?.id || 0), id, data);
63
+ }
64
+
65
+ @Delete("tasks/:id")
66
+ removeTask(
67
+ @User() user,
68
+ @Param("id", ParseIntPipe) id: number,
69
+ @Query("permanent") permanent?: string,
70
+ ) {
71
+ return this.operationsService.removeTask(
72
+ Number(user?.id || 0),
73
+ id,
74
+ permanent === "true",
75
+ );
76
+ }
77
+
78
+ @Get("tasks/:id/files")
79
+ listTaskFiles(@User() user, @Param("id", ParseIntPipe) id: number) {
80
+ return this.operationsService.listTaskFiles(Number(user?.id || 0), id);
81
+ }
82
+
83
+ @Post("tasks/:id/files")
84
+ @UseInterceptors(FileInterceptor("file"))
85
+ addTaskFile(
86
+ @User() user,
87
+ @Param("id", ParseIntPipe) id: number,
88
+ @UploadedFile() file: MulterFile,
89
+ ) {
90
+ return this.operationsService.addTaskFile(Number(user?.id || 0), id, file);
91
+ }
92
+
93
+ @Delete("tasks/:id/files/:fileRelationId")
94
+ removeTaskFile(
95
+ @User() user,
96
+ @Param("id", ParseIntPipe) id: number,
97
+ @Param("fileRelationId", ParseIntPipe) fileRelationId: number,
98
+ ) {
99
+ return this.operationsService.removeTaskFile(
100
+ Number(user?.id || 0),
101
+ id,
102
+ fileRelationId,
103
+ );
104
+ }
105
+
106
+ @Get("tasks/:id/comments")
107
+ listTaskComments(@User() user, @Param("id", ParseIntPipe) id: number) {
108
+ return this.operationsService.listTaskComments(Number(user?.id || 0), id);
109
+ }
110
+
111
+ @Get("tasks/:id/activities")
112
+ listTaskActivities(@User() user, @Param("id", ParseIntPipe) id: number) {
113
+ return this.operationsService.listTaskActivities(Number(user?.id || 0), id);
114
+ }
115
+
116
+ @Post("tasks/:id/comments")
117
+ addTaskComment(
118
+ @User() user,
119
+ @Param("id", ParseIntPipe) id: number,
120
+ @Body("content") content: string,
121
+ ) {
122
+ return this.operationsService.addTaskComment(
123
+ Number(user?.id || 0),
124
+ id,
125
+ content,
126
+ );
127
+ }
128
+
129
+ @Patch("tasks/:taskId/comments/:commentId")
130
+ updateTaskComment(
131
+ @User() user,
132
+ @Param("taskId", ParseIntPipe) taskId: number,
133
+ @Param("commentId", ParseIntPipe) commentId: number,
134
+ @Body("content") content: string,
135
+ ) {
136
+ return this.operationsService.updateTaskComment(
137
+ Number(user?.id || 0),
138
+ taskId,
139
+ commentId,
140
+ content,
141
+ );
142
+ }
143
+
144
+ @Delete("tasks/:taskId/comments/:commentId")
145
+ removeTaskComment(
146
+ @User() user,
147
+ @Param("taskId", ParseIntPipe) taskId: number,
148
+ @Param("commentId", ParseIntPipe) commentId: number,
149
+ ) {
150
+ return this.operationsService.removeTaskComment(
151
+ Number(user?.id || 0),
152
+ taskId,
153
+ commentId,
154
+ );
155
+ }
156
+ }
@@ -12,35 +12,35 @@ interface QuickAction {
12
12
  onClick?: () => void;
13
13
  }
14
14
 
15
- interface MyQuickActionsProps {
16
- slug: string;
17
- title: string;
15
+ interface MyQuickActionsProps {
16
+ slug: string;
17
+ title: string;
18
18
  roleSlug: string;
19
19
  width?: number;
20
20
  height?: number;
21
21
  data?: { actions?: QuickAction[] };
22
- style?: React.CSSProperties;
23
- }
24
-
25
- const defaultActions: QuickAction[] = [
26
- { id: 'timesheet', label: 'Registrar Timesheet', icon: <Clock className="w-5 h-5" />, color: 'text-blue-600', bgColor: 'bg-blue-50 hover:bg-blue-100 border-blue-200' },
27
- { id: 'request', label: 'Nova Solicitação', icon: <Plus className="w-5 h-5" />, color: 'text-green-600', bgColor: 'bg-green-50 hover:bg-green-100 border-green-200' },
28
- { id: 'vacation', label: 'Solicitar Férias', icon: <Send className="w-5 h-5" />, color: 'text-purple-600', bgColor: 'bg-purple-50 hover:bg-purple-100 border-purple-200' },
29
- { id: 'expense', label: 'Lançar Despesa', icon: <FileText className="w-5 h-5" />, color: 'text-orange-600', bgColor: 'bg-orange-50 hover:bg-orange-100 border-orange-200' },
30
- ];
31
-
32
- const MyQuickActions: React.FC<MyQuickActionsProps> = ({
33
- title,
34
- data,
35
- style,
36
- }) => {
37
- const actions = data?.actions ?? defaultActions;
38
-
39
- return (
22
+ style?: React.CSSProperties;
23
+ }
24
+
25
+ const defaultActions: QuickAction[] = [
26
+ { id: 'timesheet', label: 'Registrar Timesheet', icon: <Clock className="w-5 h-5" />, color: 'text-blue-600', bgColor: 'bg-blue-50 hover:bg-blue-100 border-blue-200' },
27
+ { id: 'request', label: 'Nova Solicitação', icon: <Plus className="w-5 h-5" />, color: 'text-green-600', bgColor: 'bg-green-50 hover:bg-green-100 border-green-200' },
28
+ { id: 'vacation', label: 'Solicitar Férias', icon: <Send className="w-5 h-5" />, color: 'text-purple-600', bgColor: 'bg-purple-50 hover:bg-purple-100 border-purple-200' },
29
+ { id: 'expense', label: 'Lançar Despesa', icon: <FileText className="w-5 h-5" />, color: 'text-orange-600', bgColor: 'bg-orange-50 hover:bg-orange-100 border-orange-200' },
30
+ ];
31
+
32
+ const MyQuickActions: React.FC<MyQuickActionsProps> = ({
33
+ title,
34
+ data,
35
+ style,
36
+ }) => {
37
+ const actions = data?.actions ?? defaultActions;
38
+
39
+ return (
40
40
  <div className="bg-linear-to-br from-white to-emerald-50 rounded-lg shadow-sm p-4 border border-emerald-100" style={style}>
41
41
  <h3 className="text-sm font-medium text-gray-700 mb-4">{title}</h3>
42
42
  <div className="grid grid-cols-2 gap-2">
43
- {actions.map((action) => (
43
+ {actions.map((action) => (
44
44
  <button key={action.id} onClick={action.onClick} className={`${action.bgColor} border rounded-lg p-3 transition-all transform hover:scale-105 hover:shadow-md active:scale-95`}>
45
45
  <div className={`${action.color} mb-2 transition-transform hover:scale-110`}>{action.icon}</div>
46
46
  <p className="text-xs font-medium text-gray-900 text-left">{action.label}</p>
@@ -94,10 +94,10 @@ export class CollaboratorEquityParticipationDto {
94
94
  notes?: string | null;
95
95
  }
96
96
 
97
- export class CreateCollaboratorDto {
98
- @IsOptional()
99
- @Transform(({ value }) =>
100
- value === '' || value === undefined || value === null ? undefined : Number(value)
97
+ export class CreateCollaboratorDto {
98
+ @IsOptional()
99
+ @Transform(({ value }) =>
100
+ value === '' || value === undefined || value === null ? undefined : Number(value)
101
101
  )
102
102
  @IsInt()
103
103
  personId?: number | null;