@hed-hog/operations 0.0.295 → 0.0.296

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 (126) hide show
  1. package/dist/operations.controller.d.ts +415 -0
  2. package/dist/operations.controller.d.ts.map +1 -0
  3. package/dist/operations.controller.js +333 -0
  4. package/dist/operations.controller.js.map +1 -0
  5. package/dist/operations.module.d.ts.map +1 -1
  6. package/dist/operations.module.js +4 -3
  7. package/dist/operations.module.js.map +1 -1
  8. package/dist/operations.service.d.ts +589 -153
  9. package/dist/operations.service.d.ts.map +1 -1
  10. package/dist/operations.service.js +2229 -100
  11. package/dist/operations.service.js.map +1 -1
  12. package/hedhog/data/menu.yaml +198 -251
  13. package/hedhog/data/role.yaml +23 -14
  14. package/hedhog/data/route.yaml +317 -143
  15. package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +310 -0
  16. package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +631 -0
  17. package/hedhog/frontend/app/_components/contract-details-screen.tsx.ejs +132 -0
  18. package/hedhog/frontend/app/_components/contract-form-screen.tsx.ejs +558 -0
  19. package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +291 -0
  20. package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +689 -0
  21. package/hedhog/frontend/app/_lib/api.ts.ejs +32 -0
  22. package/hedhog/frontend/app/_lib/hooks/use-operations-access.ts.ejs +44 -0
  23. package/hedhog/frontend/app/_lib/types.ts.ejs +360 -0
  24. package/hedhog/frontend/app/_lib/utils/format.ts.ejs +129 -25
  25. package/hedhog/frontend/app/_lib/utils/forms.ts.ejs +14 -0
  26. package/hedhog/frontend/app/approvals/page.tsx.ejs +386 -147
  27. package/hedhog/frontend/app/collaborators/[id]/edit/page.tsx.ejs +11 -0
  28. package/hedhog/frontend/app/collaborators/[id]/page.tsx.ejs +11 -0
  29. package/hedhog/frontend/app/collaborators/new/page.tsx.ejs +5 -0
  30. package/hedhog/frontend/app/collaborators/page.tsx.ejs +261 -0
  31. package/hedhog/frontend/app/contracts/[id]/edit/page.tsx.ejs +11 -0
  32. package/hedhog/frontend/app/contracts/[id]/page.tsx.ejs +11 -108
  33. package/hedhog/frontend/app/contracts/new/page.tsx.ejs +17 -0
  34. package/hedhog/frontend/app/contracts/page.tsx.ejs +262 -181
  35. package/hedhog/frontend/app/page.tsx.ejs +319 -177
  36. package/hedhog/frontend/app/projects/[id]/edit/page.tsx.ejs +11 -0
  37. package/hedhog/frontend/app/projects/[id]/page.tsx.ejs +11 -936
  38. package/hedhog/frontend/app/projects/new/page.tsx.ejs +5 -0
  39. package/hedhog/frontend/app/projects/page.tsx.ejs +236 -1074
  40. package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +418 -0
  41. package/hedhog/frontend/app/team/page.tsx.ejs +339 -0
  42. package/hedhog/frontend/app/time-off/page.tsx.ejs +328 -0
  43. package/hedhog/frontend/app/timesheets/page.tsx.ejs +636 -126
  44. package/hedhog/frontend/messages/en.json +648 -454
  45. package/hedhog/frontend/messages/pt.json +647 -454
  46. package/hedhog/table/operations_approval.yaml +49 -0
  47. package/hedhog/table/operations_approval_history.yaml +29 -0
  48. package/hedhog/table/{operations_employee.yaml → operations_collaborator.yaml} +67 -64
  49. package/hedhog/table/operations_collaborator_schedule_day.yaml +34 -0
  50. package/hedhog/table/operations_contract.yaml +100 -48
  51. package/hedhog/table/operations_contract_document.yaml +39 -0
  52. package/hedhog/table/operations_contract_financial_term.yaml +40 -0
  53. package/hedhog/table/operations_contract_history.yaml +27 -0
  54. package/hedhog/table/operations_contract_party.yaml +46 -0
  55. package/hedhog/table/operations_contract_revision.yaml +38 -0
  56. package/hedhog/table/operations_contract_signature.yaml +38 -0
  57. package/hedhog/table/operations_project.yaml +54 -50
  58. package/hedhog/table/{operations_allocation.yaml → operations_project_assignment.yaml} +55 -52
  59. package/hedhog/table/operations_schedule_adjustment_day.yaml +34 -0
  60. package/hedhog/table/operations_schedule_adjustment_request.yaml +53 -0
  61. package/hedhog/table/operations_time_off_request.yaml +57 -0
  62. package/hedhog/table/operations_timesheet.yaml +41 -36
  63. package/hedhog/table/operations_timesheet_entry.yaml +40 -50
  64. package/package.json +8 -7
  65. package/src/operations.controller.ts +182 -0
  66. package/src/operations.module.ts +22 -21
  67. package/src/operations.service.ts +3595 -137
  68. package/hedhog/data/operations_career_level.yaml +0 -102
  69. package/hedhog/data/operations_career_track.yaml +0 -8
  70. package/hedhog/data/operations_certification.yaml +0 -38
  71. package/hedhog/data/operations_evaluation_cycle.yaml +0 -18
  72. package/hedhog/data/operations_performance_criterion.yaml +0 -48
  73. package/hedhog/frontend/app/_components/allocation-calendar.tsx.ejs +0 -56
  74. package/hedhog/frontend/app/_components/kanban-board.tsx.ejs +0 -626
  75. package/hedhog/frontend/app/_components/timesheet-entry-dialog.tsx.ejs +0 -142
  76. package/hedhog/frontend/app/_lib/hooks/use-operations-data.ts.ejs +0 -41
  77. package/hedhog/frontend/app/_lib/hooks/use-operations-growth-data.ts.ejs +0 -63
  78. package/hedhog/frontend/app/_lib/mocks/allocations.mock.ts.ejs +0 -74
  79. package/hedhog/frontend/app/_lib/mocks/contracts.mock.ts.ejs +0 -74
  80. package/hedhog/frontend/app/_lib/mocks/operations-growth.mock.ts.ejs +0 -824
  81. package/hedhog/frontend/app/_lib/mocks/projects.mock.ts.ejs +0 -455
  82. package/hedhog/frontend/app/_lib/mocks/tasks.mock.ts.ejs +0 -117
  83. package/hedhog/frontend/app/_lib/mocks/timesheets.mock.ts.ejs +0 -84
  84. package/hedhog/frontend/app/_lib/mocks/users.mock.ts.ejs +0 -67
  85. package/hedhog/frontend/app/_lib/services/contracts.service.ts.ejs +0 -10
  86. package/hedhog/frontend/app/_lib/services/operations-growth.service.ts.ejs +0 -31
  87. package/hedhog/frontend/app/_lib/services/projects.service.ts.ejs +0 -10
  88. package/hedhog/frontend/app/_lib/services/tasks.service.ts.ejs +0 -10
  89. package/hedhog/frontend/app/_lib/services/timesheets.service.ts.ejs +0 -10
  90. package/hedhog/frontend/app/_lib/types/operations-growth.ts.ejs +0 -209
  91. package/hedhog/frontend/app/_lib/types/operations.ts.ejs +0 -156
  92. package/hedhog/frontend/app/_lib/utils/growth.ts.ejs +0 -62
  93. package/hedhog/frontend/app/_lib/utils/metrics.ts.ejs +0 -103
  94. package/hedhog/frontend/app/_lib/utils/status.ts.ejs +0 -80
  95. package/hedhog/frontend/app/allocations/page.tsx.ejs +0 -155
  96. package/hedhog/frontend/app/career/page.tsx.ejs +0 -143
  97. package/hedhog/frontend/app/certifications/page.tsx.ejs +0 -202
  98. package/hedhog/frontend/app/evaluations/page.tsx.ejs +0 -278
  99. package/hedhog/frontend/app/goals/page.tsx.ejs +0 -171
  100. package/hedhog/frontend/app/growth/page.tsx.ejs +0 -288
  101. package/hedhog/frontend/app/manager/page.tsx.ejs +0 -175
  102. package/hedhog/frontend/app/rewards/page.tsx.ejs +0 -196
  103. package/hedhog/frontend/app/tasks/page.tsx.ejs +0 -999
  104. package/hedhog/table/operations_calibration_item.yaml +0 -61
  105. package/hedhog/table/operations_calibration_session.yaml +0 -25
  106. package/hedhog/table/operations_career_level.yaml +0 -75
  107. package/hedhog/table/operations_career_track.yaml +0 -21
  108. package/hedhog/table/operations_certification.yaml +0 -48
  109. package/hedhog/table/operations_employee_certification.yaml +0 -43
  110. package/hedhog/table/operations_employee_connect.yaml +0 -61
  111. package/hedhog/table/operations_employee_evaluation.yaml +0 -113
  112. package/hedhog/table/operations_employee_evaluation_item.yaml +0 -39
  113. package/hedhog/table/operations_employee_profile.yaml +0 -80
  114. package/hedhog/table/operations_employee_skill_matrix.yaml +0 -30
  115. package/hedhog/table/operations_evaluation_cycle.yaml +0 -31
  116. package/hedhog/table/operations_goal.yaml +0 -67
  117. package/hedhog/table/operations_goal_progress.yaml +0 -31
  118. package/hedhog/table/operations_performance_criterion.yaml +0 -29
  119. package/hedhog/table/operations_promotion_readiness.yaml +0 -49
  120. package/hedhog/table/operations_promotion_recommendation.yaml +0 -63
  121. package/hedhog/table/operations_public_recognition.yaml +0 -46
  122. package/hedhog/table/operations_reward.yaml +0 -100
  123. package/hedhog/table/operations_score_event.yaml +0 -81
  124. package/hedhog/table/operations_task.yaml +0 -60
  125. package/src/operations-data.controller.ts +0 -54
  126. package/src/operations-growth.controller.ts +0 -44
@@ -1,67 +0,0 @@
1
- import type { OperationsUser } from '../types/operations';
2
-
3
- export const operationsUsersMock: OperationsUser[] = [
4
- {
5
- id: 'usr-ana',
6
- name: 'Ana Silva',
7
- role: 'Delivery Manager',
8
- seniority: 'Lead',
9
- department: 'Operations',
10
- hourlyRate: 220,
11
- utilizationTarget: 78,
12
- },
13
- {
14
- id: 'usr-bruno',
15
- name: 'Bruno Costa',
16
- role: 'Technical Lead',
17
- seniority: 'Senior',
18
- department: 'Engineering',
19
- hourlyRate: 210,
20
- utilizationTarget: 82,
21
- },
22
- {
23
- id: 'usr-carla',
24
- name: 'Carla Mendes',
25
- role: 'Project Manager',
26
- seniority: 'Senior',
27
- department: 'PMO',
28
- hourlyRate: 180,
29
- utilizationTarget: 80,
30
- },
31
- {
32
- id: 'usr-diego',
33
- name: 'Diego Alves',
34
- role: 'Backend Engineer',
35
- seniority: 'Mid-level',
36
- department: 'Engineering',
37
- hourlyRate: 145,
38
- utilizationTarget: 85,
39
- },
40
- {
41
- id: 'usr-elisa',
42
- name: 'Elisa Rocha',
43
- role: 'Frontend Engineer',
44
- seniority: 'Mid-level',
45
- department: 'Engineering',
46
- hourlyRate: 140,
47
- utilizationTarget: 84,
48
- },
49
- {
50
- id: 'usr-fabio',
51
- name: 'Fabio Lima',
52
- role: 'QA Analyst',
53
- seniority: 'Mid-level',
54
- department: 'Quality',
55
- hourlyRate: 110,
56
- utilizationTarget: 76,
57
- },
58
- {
59
- id: 'usr-gabi',
60
- name: 'Gabriela Torres',
61
- role: 'UX Designer',
62
- seniority: 'Senior',
63
- department: 'Design',
64
- hourlyRate: 150,
65
- utilizationTarget: 72,
66
- },
67
- ];
@@ -1,10 +0,0 @@
1
- import { contractsMock } from '../mocks/contracts.mock';
2
-
3
- export const contractsService = {
4
- list() {
5
- return contractsMock;
6
- },
7
- getById(id: string) {
8
- return contractsMock.find((contract) => contract.id === id) ?? null;
9
- },
10
- };
@@ -1,31 +0,0 @@
1
- import {
2
- careerLevelsMock,
3
- careerTracksMock,
4
- certificationsCatalogMock,
5
- employeeCertificationsMock,
6
- employeeEvaluationsMock,
7
- employeeGrowthProfilesMock,
8
- evaluationCyclesMock,
9
- goalsMock,
10
- performanceCriteriaMock,
11
- promotionRecommendationsMock,
12
- recognitionsMock,
13
- rewardsMock,
14
- scoreEventsMock,
15
- } from '../mocks/operations-growth.mock';
16
-
17
- export const operationsGrowthService = {
18
- listCareerTracks: () => careerTracksMock,
19
- listCareerLevels: () => careerLevelsMock,
20
- listProfiles: () => employeeGrowthProfilesMock,
21
- listEvaluationCycles: () => evaluationCyclesMock,
22
- listPerformanceCriteria: () => performanceCriteriaMock,
23
- listEvaluations: () => employeeEvaluationsMock,
24
- listGoals: () => goalsMock,
25
- listCertificationCatalog: () => certificationsCatalogMock,
26
- listEmployeeCertifications: () => employeeCertificationsMock,
27
- listRewards: () => rewardsMock,
28
- listRecognitions: () => recognitionsMock,
29
- listScoreEvents: () => scoreEventsMock,
30
- listPromotionRecommendations: () => promotionRecommendationsMock,
31
- };
@@ -1,10 +0,0 @@
1
- import { projectsMock } from '../mocks/projects.mock';
2
-
3
- export const projectsService = {
4
- list() {
5
- return projectsMock;
6
- },
7
- getById(id: string) {
8
- return projectsMock.find((project) => project.id === id) ?? null;
9
- },
10
- };
@@ -1,10 +0,0 @@
1
- import { tasksMock } from '../mocks/tasks.mock';
2
-
3
- export const tasksService = {
4
- list() {
5
- return tasksMock;
6
- },
7
- byProject(projectId: string) {
8
- return tasksMock.filter((task) => task.projectId === projectId);
9
- },
10
- };
@@ -1,10 +0,0 @@
1
- import { timesheetsMock } from '../mocks/timesheets.mock';
2
-
3
- export const timesheetsService = {
4
- list() {
5
- return timesheetsMock;
6
- },
7
- byProject(projectId: string) {
8
- return timesheetsMock.filter((entry) => entry.projectId === projectId);
9
- },
10
- };
@@ -1,209 +0,0 @@
1
- export type GrowthPromotionStatus =
2
- | 'not_ready'
3
- | 'developing'
4
- | 'eligible'
5
- | 'recommended';
6
-
7
- export type GrowthEvaluationStatus =
8
- | 'draft'
9
- | 'submitted'
10
- | 'acknowledged'
11
- | 'finalized';
12
-
13
- export type GrowthGoalStatus =
14
- | 'draft'
15
- | 'active'
16
- | 'at_risk'
17
- | 'completed'
18
- | 'canceled';
19
-
20
- export type GrowthRewardStatus = 'planned' | 'granted' | 'canceled';
21
-
22
- export type GrowthRewardType =
23
- | 'financial'
24
- | 'bonus'
25
- | 'recognition'
26
- | 'badge'
27
- | 'gift'
28
- | 'other';
29
-
30
- export type GrowthRewardOrigin =
31
- | 'goal'
32
- | 'evaluation'
33
- | 'certification'
34
- | 'spot'
35
- | 'manual'
36
- | 'project';
37
-
38
- export type GrowthCertificationStatus =
39
- | 'planned'
40
- | 'in_progress'
41
- | 'achieved'
42
- | 'expired';
43
-
44
- export interface CareerTrackSummary {
45
- id: string;
46
- slug: string;
47
- name: string;
48
- description: string;
49
- }
50
-
51
- export interface CareerLevelPlan {
52
- id: string;
53
- trackId: string;
54
- slug: string;
55
- name: string;
56
- code: string;
57
- order: number;
58
- minScore: number;
59
- maxScore: number;
60
- salaryMin: number;
61
- salaryMax: number;
62
- summaryCriteria: string[];
63
- }
64
-
65
- export interface EmployeeGrowthProfile {
66
- employeeId: string;
67
- trackId: string;
68
- currentLevelId: string;
69
- nextLevelId?: string;
70
- currentScore: number;
71
- nextLevelScore: number;
72
- promotionProgress: number;
73
- promotionStatus: GrowthPromotionStatus;
74
- admissionDate: string;
75
- story: string;
76
- strengths: string[];
77
- gaps: string[];
78
- }
79
-
80
- export interface EvaluationCycleSummary {
81
- id: string;
82
- name: string;
83
- type: 'monthly' | 'quarterly' | 'semiannual' | 'annual' | 'custom';
84
- startDate: string;
85
- endDate: string;
86
- status: 'draft' | 'active' | 'closed' | 'archived';
87
- }
88
-
89
- export interface PerformanceCriterionSummary {
90
- id: string;
91
- slug: string;
92
- name: string;
93
- weight: number;
94
- }
95
-
96
- export interface EvaluationCriterionScore {
97
- criterionId: string;
98
- rating: number;
99
- appliedWeight: number;
100
- generatedScore: number;
101
- notes?: string;
102
- }
103
-
104
- export interface EmployeeEvaluationRecord {
105
- id: string;
106
- employeeId: string;
107
- evaluatorId: string;
108
- projectId?: string;
109
- taskId?: string;
110
- timesheetId?: string;
111
- cycleId: string;
112
- evaluationDate: string;
113
- totalRating: number;
114
- generatedScore: number;
115
- publicComment: string;
116
- privateComment: string;
117
- status: GrowthEvaluationStatus;
118
- criteria: EvaluationCriterionScore[];
119
- }
120
-
121
- export interface GoalRecord {
122
- id: string;
123
- employeeId?: string;
124
- projectId?: string;
125
- teamName?: string;
126
- title: string;
127
- description: string;
128
- type: 'individual' | 'team' | 'cycle' | 'project';
129
- periodLabel: string;
130
- targetScore: number;
131
- currentScore: number;
132
- progressPercent: number;
133
- completionRule: string;
134
- status: GrowthGoalStatus;
135
- }
136
-
137
- export interface CertificationCatalogItem {
138
- id: string;
139
- slug: string;
140
- name: string;
141
- provider: string;
142
- category: string;
143
- defaultScore: number;
144
- requiredLevelId?: string;
145
- description: string;
146
- }
147
-
148
- export interface EmployeeCertificationRecord {
149
- id: string;
150
- employeeId: string;
151
- certificationId: string;
152
- obtainedAt?: string;
153
- validUntil?: string;
154
- grantedScore: number;
155
- status: GrowthCertificationStatus;
156
- }
157
-
158
- export interface RewardRecord {
159
- id: string;
160
- employeeId: string;
161
- type: GrowthRewardType;
162
- origin: GrowthRewardOrigin;
163
- amount?: number;
164
- currency?: string;
165
- relatedScore?: number;
166
- description: string;
167
- rewardDate: string;
168
- status: GrowthRewardStatus;
169
- }
170
-
171
- export interface RecognitionRecord {
172
- id: string;
173
- employeeId: string;
174
- authorId: string;
175
- projectId?: string;
176
- message: string;
177
- relatedScore?: number;
178
- date: string;
179
- visible: boolean;
180
- }
181
-
182
- export interface ScoreEventRecord {
183
- id: string;
184
- employeeId: string;
185
- sourceType:
186
- | 'evaluation'
187
- | 'certification'
188
- | 'goal'
189
- | 'recognition'
190
- | 'manual_adjustment'
191
- | 'project';
192
- sourceId: string;
193
- scoreDelta: number;
194
- description: string;
195
- referenceDate: string;
196
- }
197
-
198
- export interface PromotionRecommendationRecord {
199
- id: string;
200
- employeeId: string;
201
- currentLevelId: string;
202
- suggestedLevelId: string;
203
- cycleId: string;
204
- currentScore: number;
205
- requiredScore: number;
206
- eligible: boolean;
207
- justification: string;
208
- status: 'draft' | 'under_review' | 'approved' | 'rejected';
209
- }
@@ -1,156 +0,0 @@
1
- export type ApprovalStatus = 'approved' | 'pending' | 'rejected';
2
-
3
- export type ProjectStatus =
4
- | 'planning'
5
- | 'active'
6
- | 'at-risk'
7
- | 'paused'
8
- | 'completed';
9
-
10
- export type ProjectHealthStatus =
11
- | 'excellent'
12
- | 'stable'
13
- | 'attention'
14
- | 'critical';
15
-
16
- export type ProjectRiskSeverity = 'low' | 'medium' | 'high';
17
-
18
- export type ProjectRiskStatus = 'open' | 'mitigated' | 'accepted';
19
-
20
- export type ProjectMilestoneStatus = 'done' | 'next' | 'delayed';
21
-
22
- export type ProjectDependencyType = 'internal' | 'client' | 'vendor';
23
-
24
- export type ProjectDependencyStatus = 'on-track' | 'watch' | 'blocked';
25
-
26
- export type ContractType = 'tm' | 'monthly' | 'fixed';
27
-
28
- export type ContractStatus = 'active' | 'draft' | 'expired' | 'renewal';
29
-
30
- export type TaskStatus = 'backlog' | 'todo' | 'in-progress' | 'review' | 'done';
31
-
32
- export type TaskPriority = 'low' | 'medium' | 'high' | 'critical';
33
-
34
- export interface OperationsUser {
35
- id: string;
36
- name: string;
37
- role: string;
38
- seniority: string;
39
- department: string;
40
- hourlyRate: number;
41
- utilizationTarget: number;
42
- }
43
-
44
- export interface Contract {
45
- id: string;
46
- name: string;
47
- client: string;
48
- type: ContractType;
49
- startDate: string;
50
- endDate: string;
51
- hourlyRate: number;
52
- hourLimit: number;
53
- status: ContractStatus;
54
- billingRules: string[];
55
- sla: string;
56
- revisions: string[];
57
- linkedProjectIds: string[];
58
- }
59
-
60
- export interface Project {
61
- id: string;
62
- name: string;
63
- client: string;
64
- progress: number;
65
- status: ProjectStatus;
66
- teamMemberIds: string[];
67
- hoursLogged: number;
68
- startDate: string;
69
- endDate: string;
70
- description: string;
71
- contractId: string;
72
- budget: number;
73
- health?: {
74
- overall: ProjectHealthStatus;
75
- scope: ProjectHealthStatus;
76
- schedule: ProjectHealthStatus;
77
- budget: ProjectHealthStatus;
78
- quality: ProjectHealthStatus;
79
- };
80
- milestones?: {
81
- id: string;
82
- title: string;
83
- date: string;
84
- status: ProjectMilestoneStatus;
85
- description: string;
86
- }[];
87
- risks?: {
88
- id: string;
89
- title: string;
90
- ownerUserId: string;
91
- severity: ProjectRiskSeverity;
92
- status: ProjectRiskStatus;
93
- impact: string;
94
- mitigation: string;
95
- }[];
96
- dependencies?: {
97
- id: string;
98
- title: string;
99
- owner: string;
100
- type: ProjectDependencyType;
101
- status: ProjectDependencyStatus;
102
- }[];
103
- decisions?: {
104
- id: string;
105
- date: string;
106
- title: string;
107
- ownerUserId: string;
108
- summary: string;
109
- }[];
110
- nextActions?: string[];
111
- monthlyForecast?: {
112
- month: string;
113
- plannedCost: number;
114
- actualCost: number;
115
- plannedProgress: number;
116
- actualProgress: number;
117
- }[];
118
- }
119
-
120
- export interface Task {
121
- id: string;
122
- title: string;
123
- projectId: string;
124
- projectName: string;
125
- status: TaskStatus;
126
- priority: TaskPriority;
127
- labels: string[];
128
- assignedUserId: string;
129
- dueDate: string;
130
- estimatedHours: number;
131
- order: number;
132
- archived?: boolean;
133
- description: string;
134
- }
135
-
136
- export interface TimesheetEntry {
137
- id: string;
138
- date: string;
139
- userId: string;
140
- projectId: string;
141
- taskId: string;
142
- hours: number;
143
- description: string;
144
- status: ApprovalStatus;
145
- }
146
-
147
- export interface Allocation {
148
- id: string;
149
- userId: string;
150
- role: string;
151
- projectId: string;
152
- weeklyHours: number;
153
- allocationPercent: number;
154
- startDate: string;
155
- endDate: string;
156
- }
@@ -1,62 +0,0 @@
1
- import type {
2
- GrowthCertificationStatus,
3
- GrowthEvaluationStatus,
4
- GrowthGoalStatus,
5
- GrowthPromotionStatus,
6
- GrowthRewardStatus,
7
- } from '../types/operations-growth';
8
-
9
- export function getGrowthPromotionBadgeClasses(status: GrowthPromotionStatus) {
10
- return {
11
- not_ready: 'bg-slate-100 text-slate-700',
12
- developing: 'bg-cyan-100 text-cyan-700',
13
- eligible: 'bg-amber-100 text-amber-700',
14
- recommended: 'bg-emerald-100 text-emerald-700',
15
- }[status];
16
- }
17
-
18
- export function getGrowthGoalBadgeClasses(status: GrowthGoalStatus) {
19
- return {
20
- draft: 'bg-slate-100 text-slate-700',
21
- active: 'bg-blue-100 text-blue-700',
22
- at_risk: 'bg-orange-100 text-orange-700',
23
- completed: 'bg-emerald-100 text-emerald-700',
24
- canceled: 'bg-zinc-200 text-zinc-700',
25
- }[status];
26
- }
27
-
28
- export function getGrowthEvaluationBadgeClasses(
29
- status: GrowthEvaluationStatus
30
- ) {
31
- return {
32
- draft: 'bg-slate-100 text-slate-700',
33
- submitted: 'bg-blue-100 text-blue-700',
34
- acknowledged: 'bg-violet-100 text-violet-700',
35
- finalized: 'bg-emerald-100 text-emerald-700',
36
- }[status];
37
- }
38
-
39
- export function getGrowthCertificationBadgeClasses(
40
- status: GrowthCertificationStatus
41
- ) {
42
- return {
43
- planned: 'bg-slate-100 text-slate-700',
44
- in_progress: 'bg-amber-100 text-amber-700',
45
- achieved: 'bg-emerald-100 text-emerald-700',
46
- expired: 'bg-rose-100 text-rose-700',
47
- }[status];
48
- }
49
-
50
- export function getGrowthRewardBadgeClasses(status: GrowthRewardStatus) {
51
- return {
52
- planned: 'bg-slate-100 text-slate-700',
53
- granted: 'bg-emerald-100 text-emerald-700',
54
- canceled: 'bg-rose-100 text-rose-700',
55
- }[status];
56
- }
57
-
58
- export function humanizeGrowthStatus(value: string) {
59
- return value
60
- .replace(/_/g, ' ')
61
- .replace(/\b\w/g, (char) => char.toUpperCase());
62
- }
@@ -1,103 +0,0 @@
1
- import { allocationsMock } from '../mocks/allocations.mock';
2
- import { contractsMock } from '../mocks/contracts.mock';
3
- import { projectsMock } from '../mocks/projects.mock';
4
- import { tasksMock } from '../mocks/tasks.mock';
5
- import { timesheetsMock } from '../mocks/timesheets.mock';
6
- import { operationsUsersMock } from '../mocks/users.mock';
7
- import { getApprovalLabel } from './status';
8
-
9
- export function getDashboardMetrics() {
10
- const totalActiveProjects = projectsMock.filter(
11
- (project) => project.status === 'active'
12
- ).length;
13
- const hoursLoggedThisMonth = timesheetsMock.reduce(
14
- (total, entry) => total + entry.hours,
15
- 0
16
- );
17
- const hoursPendingApproval = timesheetsMock
18
- .filter((entry) => entry.status === 'pending')
19
- .reduce((total, entry) => total + entry.hours, 0);
20
- const revenue = contractsMock
21
- .filter((contract) => contract.status === 'active')
22
- .reduce((total, contract) => total + contract.hourlyRate * 160, 0);
23
- const utilization =
24
- allocationsMock.reduce(
25
- (total, allocation) => total + allocation.allocationPercent,
26
- 0
27
- ) / allocationsMock.length;
28
-
29
- return {
30
- totalActiveProjects,
31
- hoursLoggedThisMonth,
32
- hoursPendingApproval,
33
- revenue,
34
- utilization,
35
- };
36
- }
37
-
38
- export function getHoursByProject() {
39
- return projectsMock.map((project) => ({
40
- name: project.name,
41
- hours: timesheetsMock
42
- .filter((entry) => entry.projectId === project.id)
43
- .reduce((total, entry) => total + entry.hours, 0),
44
- }));
45
- }
46
-
47
- export function getHoursByUser() {
48
- return operationsUsersMock.map((user) => ({
49
- name: user.name.split(' ')[0],
50
- hours: timesheetsMock
51
- .filter((entry) => entry.userId === user.id)
52
- .reduce((total, entry) => total + entry.hours, 0),
53
- }));
54
- }
55
-
56
- export function getApprovalStatusData() {
57
- return ['approved', 'pending', 'rejected'].map((status) => ({
58
- name: getApprovalLabel(status as 'approved' | 'pending' | 'rejected'),
59
- value: timesheetsMock.filter((entry) => entry.status === status).length,
60
- }));
61
- }
62
-
63
- export function getWeeklyTrend() {
64
- return [
65
- { week: 'W1', hours: 32 },
66
- { week: 'W2', hours: 36 },
67
- { week: 'W3', hours: 29 },
68
- { week: 'W4', hours: 41 },
69
- ];
70
- }
71
-
72
- export function getRecentTimesheetEntries() {
73
- return [...timesheetsMock]
74
- .sort((a, b) => b.date.localeCompare(a.date))
75
- .slice(0, 6);
76
- }
77
-
78
- export function getDailyTotals() {
79
- return timesheetsMock.reduce<Record<string, number>>((acc, entry) => {
80
- acc[entry.date] = (acc[entry.date] || 0) + entry.hours;
81
- return acc;
82
- }, {});
83
- }
84
-
85
- export function getPendingApprovalsSummary() {
86
- return {
87
- pending: timesheetsMock.filter((entry) => entry.status === 'pending').length,
88
- approved: timesheetsMock.filter((entry) => entry.status === 'approved').length,
89
- rejected: timesheetsMock.filter((entry) => entry.status === 'rejected').length,
90
- };
91
- }
92
-
93
- export function getProjectTeam(projectId: string) {
94
- const project = projectsMock.find((item) => item.id === projectId);
95
-
96
- return operationsUsersMock.filter((user) =>
97
- project?.teamMemberIds.includes(user.id)
98
- );
99
- }
100
-
101
- export function getProjectTasks(projectId: string) {
102
- return tasksMock.filter((task) => task.projectId === projectId);
103
- }