@hed-hog/operations 0.0.304 → 0.0.305

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 (52) hide show
  1. package/dist/controllers/operations-projects.controller.d.ts +15 -0
  2. package/dist/controllers/operations-projects.controller.d.ts.map +1 -1
  3. package/dist/controllers/operations-tasks.controller.d.ts +41 -10
  4. package/dist/controllers/operations-tasks.controller.d.ts.map +1 -1
  5. package/dist/controllers/operations-tasks.controller.js +11 -0
  6. package/dist/controllers/operations-tasks.controller.js.map +1 -1
  7. package/dist/dto/create-task.dto.d.ts +7 -1
  8. package/dist/dto/create-task.dto.d.ts.map +1 -1
  9. package/dist/dto/create-task.dto.js +38 -5
  10. package/dist/dto/create-task.dto.js.map +1 -1
  11. package/dist/dto/list-tasks.dto.d.ts +1 -1
  12. package/dist/dto/list-tasks.dto.d.ts.map +1 -1
  13. package/dist/dto/list-tasks.dto.js +2 -2
  14. package/dist/dto/list-tasks.dto.js.map +1 -1
  15. package/dist/dto/update-task.dto.d.ts +7 -1
  16. package/dist/dto/update-task.dto.d.ts.map +1 -1
  17. package/dist/dto/update-task.dto.js +38 -5
  18. package/dist/dto/update-task.dto.js.map +1 -1
  19. package/dist/operations.service.d.ts +68 -12
  20. package/dist/operations.service.d.ts.map +1 -1
  21. package/dist/operations.service.js +380 -101
  22. package/dist/operations.service.js.map +1 -1
  23. package/hedhog/data/route.yaml +13 -0
  24. package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +44 -44
  25. package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +168 -213
  26. package/hedhog/frontend/app/_components/collaborator-select-with-create.tsx.ejs +256 -256
  27. package/hedhog/frontend/app/_components/contract-form-screen.tsx.ejs +7 -7
  28. package/hedhog/frontend/app/_components/contract-template-form-screen.tsx.ejs +306 -306
  29. package/hedhog/frontend/app/_components/contract-template-select-with-create.tsx.ejs +247 -247
  30. package/hedhog/frontend/app/_components/contract-wizard-sheet.tsx.ejs +3520 -3520
  31. package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +1504 -52
  32. package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +528 -403
  33. package/hedhog/frontend/app/_components/section-card.tsx.ejs +25 -18
  34. package/hedhog/frontend/app/_components/system-user-select-with-create.tsx.ejs +609 -0
  35. package/hedhog/frontend/app/_lib/types.ts.ejs +5 -0
  36. package/hedhog/frontend/app/_lib/utils/format.ts.ejs +7 -7
  37. package/hedhog/frontend/app/_lib/utils/forms.ts.ejs +48 -1
  38. package/hedhog/frontend/app/collaborator-types/page.tsx.ejs +502 -502
  39. package/hedhog/frontend/app/collaborators/page.tsx.ejs +10 -7
  40. package/hedhog/frontend/app/contracts/page.tsx.ejs +938 -938
  41. package/hedhog/frontend/app/projects/[id]/edit/page.tsx.ejs +1 -1
  42. package/hedhog/frontend/app/projects/page.tsx.ejs +360 -133
  43. package/hedhog/frontend/messages/en.json +27 -4
  44. package/hedhog/frontend/messages/pt.json +27 -4
  45. package/hedhog/table/operations_project.yaml +9 -0
  46. package/hedhog/table/operations_task.yaml +43 -4
  47. package/package.json +5 -5
  48. package/src/controllers/operations-tasks.controller.ts +11 -0
  49. package/src/dto/create-task.dto.ts +47 -7
  50. package/src/dto/list-tasks.dto.ts +3 -3
  51. package/src/dto/update-task.dto.ts +47 -7
  52. package/src/operations.service.ts +556 -88
@@ -41,10 +41,15 @@
41
41
  "contract": "Contract",
42
42
  "contractStatus": "Contract status",
43
43
  "contractCategory": "Contract category",
44
+ "contractType": "Contract type",
45
+ "signatureStatus": "Signature status",
44
46
  "manager": "Manager",
45
47
  "progress": "Progress",
46
48
  "timeline": "Timeline",
47
49
  "budget": "Budget",
50
+ "code": "Code",
51
+ "deliveryModel": "Delivery model",
52
+ "allocationPercent": "Allocation %",
48
53
  "teamSize": "Team size",
49
54
  "client": "Client",
50
55
  "billingModel": "Billing model",
@@ -246,6 +251,7 @@
246
251
  "basicInfoDescription": "Core identity and profile data used across operations.",
247
252
  "employmentInfo": "Relationship details",
248
253
  "employmentInfoDescription": "Choose the nature of the relationship with the company, lifecycle status, and key dates.",
254
+ "employmentInfoCreateDescription": "Choose the relationship type and initial dates. Weekly capacity and compensation can be adjusted after creation.",
249
255
  "equity": "Equity details",
250
256
  "equityDescription": "Fill this section only when the selected relationship requires ownership or governance data.",
251
257
  "supervisor": "Supervisor assignment",
@@ -284,7 +290,11 @@
284
290
  "breakMinutes": "Break (min)",
285
291
  "breakMinutesDescription": "The last numeric field defines the daily break in minutes. Example: 60 = a 1-hour lunch break.",
286
292
  "autoGenerateContractDraft": "Generate contract draft automatically",
287
- "autoGenerateContractDraftDescription": "Creates a related draft contract classified from the relationship type and linked to the hiring origin."
293
+ "autoGenerateContractDraftDescription": "Creates a related draft contract classified from the relationship type and linked to the hiring origin.",
294
+ "createUserDescription": "Enter the new system user's credentials. The account will be created immediately and linked to this collaborator.",
295
+ "createUserName": "Full name",
296
+ "createUserEmail": "Email",
297
+ "createUserPassword": "Password"
288
298
  },
289
299
  "options": {
290
300
  "collaboratorTypes": {
@@ -327,7 +337,13 @@
327
337
  "equityNotes": "Notes about quotas, shares, term, or powers",
328
338
  "levelLabel": "Select a level",
329
339
  "supervisor": "Search a collaborator",
330
- "userIdOptional": "Select a system user"
340
+ "userIdOptional": "Select a system user",
341
+ "createUserName": "Full name",
342
+ "createUserEmail": "user@example.com",
343
+ "createUserPassword": "Strong password"
344
+ },
345
+ "actions": {
346
+ "createUser": "Create system user"
331
347
  },
332
348
  "states": {
333
349
  "loadingCollaboratorTypes": "Loading relationship types..."
@@ -340,7 +356,9 @@
340
356
  "createSuccess": "Collaborator created successfully.",
341
357
  "createError": "Unable to create the collaborator.",
342
358
  "updateSuccess": "Collaborator updated successfully.",
343
- "updateError": "Unable to update the collaborator."
359
+ "updateError": "Unable to update the collaborator.",
360
+ "createUserSuccess": "User created and linked successfully.",
361
+ "createUserError": "Failed to create the system user."
344
362
  }
345
363
  },
346
364
  "CollaboratorTypesPage": {
@@ -432,6 +450,9 @@
432
450
  "upcomingDeliveries": "With deadline",
433
451
  "upcomingDeliveriesDescription": "Projects that have an end date defined."
434
452
  },
453
+ "viewMode": "View mode",
454
+ "viewModeTable": "Table",
455
+ "viewModeCards": "Cards",
435
456
  "actions": {
436
457
  "archive": "Archive"
437
458
  },
@@ -526,7 +547,9 @@
526
547
  "monthlyHourCap": "Monthly hour cap",
527
548
  "contractCode": "Used only when creating a draft contract",
528
549
  "contractName": "Visible name for the generated draft",
529
- "contractDescription": "Add commercial notes or delivery clauses"
550
+ "contractDescription": "Add commercial notes or delivery clauses",
551
+ "roleLabel": "Select or type a role...",
552
+ "roleLabelCreate": "New role or responsibility"
530
553
  },
531
554
  "options": {
532
555
  "deliveryModels": {
@@ -41,10 +41,15 @@
41
41
  "contract": "Contrato",
42
42
  "contractStatus": "Status do contrato",
43
43
  "contractCategory": "Categoria do contrato",
44
+ "contractType": "Tipo do contrato",
45
+ "signatureStatus": "Status da assinatura",
44
46
  "manager": "Gestor",
45
47
  "progress": "Progresso",
46
48
  "timeline": "Período",
47
49
  "budget": "Orçamento",
50
+ "code": "Código",
51
+ "deliveryModel": "Modelo de entrega",
52
+ "allocationPercent": "Alocação %",
48
53
  "teamSize": "Tamanho da equipe",
49
54
  "client": "Cliente",
50
55
  "billingModel": "Modelo de faturamento",
@@ -244,6 +249,7 @@
244
249
  "basicInfoDescription": "Dados principais de identificação usados em toda a operação.",
245
250
  "employmentInfo": "Informações de contratação",
246
251
  "employmentInfoDescription": "Defina o tipo do colaborador, o status do ciclo e as datas principais.",
252
+ "employmentInfoCreateDescription": "Escolha o tipo de vínculo e as datas iniciais. Capacidade semanal e remuneração podem ser ajustadas após a criação.",
247
253
  "equity": "Detalhes de participação societária",
248
254
  "equityDescription": "Preencha esta seção apenas quando a relação selecionada exigir dados de propriedade ou governança.",
249
255
  "supervisor": "Vínculo de supervisor",
@@ -282,7 +288,11 @@
282
288
  "breakMinutes": "Intervalo (min)",
283
289
  "breakMinutesDescription": "O último campo numérico define o intervalo/pausa diária em minutos. Ex.: 60 = 1 hora de almoço.",
284
290
  "autoGenerateContractDraft": "Gerar contrato rascunho automaticamente",
285
- "autoGenerateContractDraftDescription": "Cria um contrato rascunho relacionado, classificado pelo tipo de colaborador e vinculado à origem de contratação."
291
+ "autoGenerateContractDraftDescription": "Cria um contrato rascunho relacionado, classificado pelo tipo de colaborador e vinculado à origem de contratação.",
292
+ "createUserDescription": "Informe as credenciais do novo usuário do sistema. A conta será criada imediatamente e vinculada a este colaborador.",
293
+ "createUserName": "Nome completo",
294
+ "createUserEmail": "E-mail",
295
+ "createUserPassword": "Senha"
286
296
  },
287
297
  "options": {
288
298
  "collaboratorTypes": {
@@ -325,7 +335,13 @@
325
335
  "equityNotes": "Observações sobre cotas, ações, prazo ou poderes",
326
336
  "levelLabel": "Selecione um nível",
327
337
  "supervisor": "Busque um colaborador",
328
- "userIdOptional": "Selecione um usuário do sistema"
338
+ "userIdOptional": "Selecione um usuário do sistema",
339
+ "createUserName": "Nome completo",
340
+ "createUserEmail": "usuario@exemplo.com",
341
+ "createUserPassword": "Senha forte"
342
+ },
343
+ "actions": {
344
+ "createUser": "Criar usuário do sistema"
329
345
  },
330
346
  "states": {
331
347
  "loadingCollaboratorTypes": "Carregando tipos de colaborador..."
@@ -338,7 +354,9 @@
338
354
  "createSuccess": "Colaborador criado com sucesso.",
339
355
  "createError": "Não foi possível criar o colaborador.",
340
356
  "updateSuccess": "Colaborador atualizado com sucesso.",
341
- "updateError": "Não foi possível atualizar o colaborador."
357
+ "updateError": "Não foi possível atualizar o colaborador.",
358
+ "createUserSuccess": "Usuário criado e vinculado com sucesso.",
359
+ "createUserError": "Não foi possível criar o usuário do sistema."
342
360
  }
343
361
  },
344
362
  "CollaboratorTypesPage": {
@@ -430,6 +448,9 @@
430
448
  "upcomingDeliveries": "Com prazo",
431
449
  "upcomingDeliveriesDescription": "Projetos com data de entrega definida."
432
450
  },
451
+ "viewMode": "Visualização",
452
+ "viewModeTable": "Tabela",
453
+ "viewModeCards": "Cards",
433
454
  "actions": {
434
455
  "archive": "Arquivar"
435
456
  },
@@ -524,7 +545,9 @@
524
545
  "monthlyHourCap": "Limite mensal de horas",
525
546
  "contractCode": "Usado apenas ao criar contrato rascunho",
526
547
  "contractName": "Nome visivel do contrato gerado",
527
- "contractDescription": "Adicione observacoes comerciais ou clausulas da entrega"
548
+ "contractDescription": "Adicione observacoes comerciais ou clausulas da entrega",
549
+ "roleLabel": "Selecione ou informe o papel...",
550
+ "roleLabelCreate": "Novo papel ou responsabilidade"
528
551
  },
529
552
  "options": {
530
553
  "deliveryModels": {
@@ -16,6 +16,14 @@ columns:
16
16
  column: id
17
17
  onDelete: SET NULL
18
18
  onUpdate: CASCADE
19
+ - name: client_person_id
20
+ type: fk
21
+ isNullable: true
22
+ references:
23
+ table: person
24
+ column: id
25
+ onDelete: SET NULL
26
+ onUpdate: CASCADE
19
27
  - name: code
20
28
  type: varchar
21
29
  length: 40
@@ -64,6 +72,7 @@ indices:
64
72
  isUnique: true
65
73
  - columns: [contract_id]
66
74
  - columns: [manager_collaborator_id]
75
+ - columns: [client_person_id]
67
76
  - columns: [status]
68
77
  - columns: [start_date]
69
78
  - columns: [end_date]
@@ -1,11 +1,28 @@
1
1
  columns:
2
2
  - type: pk
3
+ - name: project_id
4
+ type: fk
5
+ isNullable: true
6
+ references:
7
+ table: operations_project
8
+ column: id
9
+ onDelete: CASCADE
10
+ onUpdate: CASCADE
3
11
  - name: project_assignment_id
4
12
  type: fk
13
+ isNullable: true
5
14
  references:
6
15
  table: operations_project_assignment
7
16
  column: id
8
- onDelete: CASCADE
17
+ onDelete: SET NULL
18
+ onUpdate: CASCADE
19
+ - name: assignee_collaborator_id
20
+ type: fk
21
+ isNullable: true
22
+ references:
23
+ table: operations_collaborator
24
+ column: id
25
+ onDelete: SET NULL
9
26
  onUpdate: CASCADE
10
27
  - name: name
11
28
  type: varchar
@@ -13,10 +30,28 @@ columns:
13
30
  - name: description
14
31
  type: text
15
32
  isNullable: true
33
+ - name: priority
34
+ type: enum
35
+ values: [low, medium, high]
36
+ default: medium
16
37
  - name: status
17
38
  type: enum
18
- values: [active, completed, archived]
19
- default: active
39
+ values: [todo, doing, review, done]
40
+ default: todo
41
+ - name: due_date
42
+ type: date
43
+ isNullable: true
44
+ - name: estimate_hours
45
+ type: decimal
46
+ precision: 6
47
+ scale: 2
48
+ isNullable: true
49
+ - name: position
50
+ type: int
51
+ default: 0
52
+ - name: tags
53
+ type: text
54
+ isNullable: true
20
55
  - name: deleted_at
21
56
  type: datetime
22
57
  isNullable: true
@@ -24,7 +59,11 @@ columns:
24
59
  - type: updated_at
25
60
 
26
61
  indices:
62
+ - columns: [project_id]
27
63
  - columns: [project_assignment_id]
64
+ - columns: [assignee_collaborator_id]
28
65
  - columns: [status]
29
- - columns: [project_assignment_id, status]
66
+ - columns: [priority]
67
+ - columns: [due_date]
68
+ - columns: [project_id, status]
30
69
  - columns: [deleted_at]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/operations",
3
- "version": "0.0.304",
3
+ "version": "0.0.305",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -9,13 +9,13 @@
9
9
  "@nestjs/core": "^11",
10
10
  "@nestjs/jwt": "^11",
11
11
  "@nestjs/mapped-types": "*",
12
- "@hed-hog/api-locale": "0.0.14",
13
- "@hed-hog/core": "0.0.304",
14
12
  "@hed-hog/api": "0.0.6",
13
+ "@hed-hog/api-prisma": "0.0.6",
15
14
  "@hed-hog/api-pagination": "0.0.7",
15
+ "@hed-hog/api-locale": "0.0.14",
16
16
  "@hed-hog/api-types": "0.0.1",
17
- "@hed-hog/api-prisma": "0.0.6",
18
- "@hed-hog/contact": "0.0.304"
17
+ "@hed-hog/core": "0.0.305",
18
+ "@hed-hog/contact": "0.0.305"
19
19
  },
20
20
  "exports": {
21
21
  ".": {
@@ -31,6 +31,17 @@ export class OperationsTasksController {
31
31
  );
32
32
  }
33
33
 
34
+ @Get('projects/:id/tasks')
35
+ listProjectBoardTasks(
36
+ @User() user,
37
+ @Param('id', ParseIntPipe) id: number,
38
+ ) {
39
+ return this.operationsService.listProjectBoardTasks(
40
+ Number(user?.id || 0),
41
+ id,
42
+ );
43
+ }
44
+
34
45
  @Post('tasks')
35
46
  createTask(@User() user, @Body() data: CreateOperationsTaskDto) {
36
47
  return this.operationsService.createTask(Number(user?.id || 0), data);
@@ -1,5 +1,12 @@
1
1
  import { Transform } from 'class-transformer';
2
- import { IsIn, IsInt, IsOptional, IsString, MaxLength } from 'class-validator';
2
+ import {
3
+ IsIn,
4
+ IsInt,
5
+ IsNumber,
6
+ IsOptional,
7
+ IsString,
8
+ MaxLength,
9
+ } from 'class-validator';
3
10
 
4
11
  export class CreateOperationsTaskDto {
5
12
  @IsOptional()
@@ -16,20 +23,53 @@ export class CreateOperationsTaskDto {
16
23
  @IsInt({ message: 'projectAssignmentId must be an integer' })
17
24
  projectAssignmentId?: number;
18
25
 
26
+ @IsOptional()
27
+ @Transform(({ value }) =>
28
+ value === '' || value === undefined || value === null ? undefined : Number(value)
29
+ )
30
+ @IsInt({ message: 'assigneeCollaboratorId must be an integer' })
31
+ assigneeCollaboratorId?: number;
32
+
19
33
  @IsString({ message: 'name must be a string' })
20
34
  @MaxLength(180, { message: 'name must have at most 180 characters' })
21
35
  name!: string;
22
36
 
23
37
  @IsOptional()
24
38
  @IsString({ message: 'description must be a string' })
25
- @MaxLength(500, {
26
- message: 'description must have at most 500 characters',
27
- })
39
+ @MaxLength(2000, { message: 'description must have at most 2000 characters' })
28
40
  description?: string;
29
41
 
30
42
  @IsOptional()
31
- @IsIn(['active', 'completed', 'archived'], {
32
- message: 'status must be active, completed, or archived',
43
+ @IsIn(['low', 'medium', 'high'], {
44
+ message: 'priority must be low, medium, or high',
33
45
  })
34
- status?: 'active' | 'completed' | 'archived';
46
+ priority?: 'low' | 'medium' | 'high';
47
+
48
+ @IsOptional()
49
+ @IsIn(['todo', 'doing', 'review', 'done'], {
50
+ message: 'status must be todo, doing, review, or done',
51
+ })
52
+ status?: 'todo' | 'doing' | 'review' | 'done';
53
+
54
+ @IsOptional()
55
+ @IsString({ message: 'dueDate must be a string' })
56
+ dueDate?: string;
57
+
58
+ @IsOptional()
59
+ @Transform(({ value }) =>
60
+ value === '' || value === undefined || value === null ? undefined : Number(value)
61
+ )
62
+ @IsNumber({}, { message: 'estimateHours must be a number' })
63
+ estimateHours?: number;
64
+
65
+ @IsOptional()
66
+ @Transform(({ value }) =>
67
+ value === '' || value === undefined || value === null ? undefined : Number(value)
68
+ )
69
+ @IsInt({ message: 'position must be an integer' })
70
+ position?: number;
71
+
72
+ @IsOptional()
73
+ @IsString({ message: 'tags must be a string' })
74
+ tags?: string;
35
75
  }
@@ -18,8 +18,8 @@ export class ListOperationsTasksDto extends PaginationDTO {
18
18
  projectAssignmentId?: number;
19
19
 
20
20
  @IsOptional()
21
- @IsIn(['active', 'completed', 'archived'], {
22
- message: 'status must be active, completed, or archived',
21
+ @IsIn(['todo', 'doing', 'review', 'done'], {
22
+ message: 'status must be todo, doing, review, or done',
23
23
  })
24
- status?: 'active' | 'completed' | 'archived';
24
+ status?: 'todo' | 'doing' | 'review' | 'done';
25
25
  }
@@ -1,5 +1,12 @@
1
1
  import { Transform } from 'class-transformer';
2
- import { IsIn, IsInt, IsOptional, IsString, MaxLength } from 'class-validator';
2
+ import {
3
+ IsIn,
4
+ IsInt,
5
+ IsNumber,
6
+ IsOptional,
7
+ IsString,
8
+ MaxLength,
9
+ } from 'class-validator';
3
10
 
4
11
  export class UpdateOperationsTaskDto {
5
12
  @IsOptional()
@@ -16,6 +23,13 @@ export class UpdateOperationsTaskDto {
16
23
  @IsInt({ message: 'projectAssignmentId must be an integer' })
17
24
  projectAssignmentId?: number;
18
25
 
26
+ @IsOptional()
27
+ @Transform(({ value }) =>
28
+ value === '' || value === undefined || value === null ? undefined : Number(value)
29
+ )
30
+ @IsInt({ message: 'assigneeCollaboratorId must be an integer' })
31
+ assigneeCollaboratorId?: number;
32
+
19
33
  @IsOptional()
20
34
  @IsString({ message: 'name must be a string' })
21
35
  @MaxLength(180, { message: 'name must have at most 180 characters' })
@@ -23,14 +37,40 @@ export class UpdateOperationsTaskDto {
23
37
 
24
38
  @IsOptional()
25
39
  @IsString({ message: 'description must be a string' })
26
- @MaxLength(500, {
27
- message: 'description must have at most 500 characters',
28
- })
40
+ @MaxLength(2000, { message: 'description must have at most 2000 characters' })
29
41
  description?: string;
30
42
 
31
43
  @IsOptional()
32
- @IsIn(['active', 'completed', 'archived'], {
33
- message: 'status must be active, completed, or archived',
44
+ @IsIn(['low', 'medium', 'high'], {
45
+ message: 'priority must be low, medium, or high',
34
46
  })
35
- status?: 'active' | 'completed' | 'archived';
47
+ priority?: 'low' | 'medium' | 'high';
48
+
49
+ @IsOptional()
50
+ @IsIn(['todo', 'doing', 'review', 'done'], {
51
+ message: 'status must be todo, doing, review, or done',
52
+ })
53
+ status?: 'todo' | 'doing' | 'review' | 'done';
54
+
55
+ @IsOptional()
56
+ @IsString({ message: 'dueDate must be a string' })
57
+ dueDate?: string;
58
+
59
+ @IsOptional()
60
+ @Transform(({ value }) =>
61
+ value === '' || value === undefined || value === null ? undefined : Number(value)
62
+ )
63
+ @IsNumber({}, { message: 'estimateHours must be a number' })
64
+ estimateHours?: number;
65
+
66
+ @IsOptional()
67
+ @Transform(({ value }) =>
68
+ value === '' || value === undefined || value === null ? undefined : Number(value)
69
+ )
70
+ @IsInt({ message: 'position must be an integer' })
71
+ position?: number;
72
+
73
+ @IsOptional()
74
+ @IsString({ message: 'tags must be a string' })
75
+ tags?: string;
36
76
  }