@hed-hog/operations 0.0.305 → 0.0.309

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 (138) 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 +52 -4
  22. package/dist/controllers/operations-timesheets.controller.d.ts.map +1 -1
  23. package/dist/controllers/operations-timesheets.controller.js +28 -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/dto/update-collaborator-type.dto.d.ts +3 -1
  66. package/dist/dto/update-collaborator-type.dto.d.ts.map +1 -1
  67. package/dist/dto/update-collaborator-type.dto.js +2 -1
  68. package/dist/dto/update-collaborator-type.dto.js.map +1 -1
  69. package/dist/operations.service.d.ts +362 -271
  70. package/dist/operations.service.d.ts.map +1 -1
  71. package/dist/operations.service.js +1195 -1098
  72. package/dist/operations.service.js.map +1 -1
  73. package/dist/operations.service.spec.js +73 -22
  74. package/dist/operations.service.spec.js.map +1 -1
  75. package/hedhog/data/menu.yaml +19 -55
  76. package/hedhog/data/operations_collaborator_type.yaml +76 -76
  77. package/hedhog/data/route.yaml +52 -70
  78. package/hedhog/frontend/app/_components/async-options-combobox.tsx.ejs +5 -3
  79. package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +8 -1
  80. package/hedhog/frontend/app/_components/collaborator-select-with-create.tsx.ejs +15 -10
  81. package/hedhog/frontend/app/_components/contract-details-screen.tsx.ejs +108 -213
  82. package/hedhog/frontend/app/_components/contract-form-screen.tsx.ejs +251 -2039
  83. package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +167 -60
  84. package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +70 -301
  85. package/hedhog/frontend/app/_components/system-user-select-with-create.tsx.ejs +102 -51
  86. package/hedhog/frontend/app/_components/timesheet-task-create-sheet.tsx.ejs +1 -0
  87. package/hedhog/frontend/app/_lib/types.ts.ejs +19 -24
  88. package/hedhog/frontend/app/_lib/utils/format.ts.ejs +14 -9
  89. package/hedhog/frontend/app/approvals/page.tsx.ejs +843 -151
  90. package/hedhog/frontend/app/collaborator-types/page.tsx.ejs +457 -154
  91. package/hedhog/frontend/app/collaborators/page.tsx.ejs +118 -49
  92. package/hedhog/frontend/app/contracts/[id]/page.tsx.ejs +2 -2
  93. package/hedhog/frontend/app/contracts/page.tsx.ejs +215 -617
  94. package/hedhog/frontend/app/departments/page.tsx.ejs +257 -113
  95. package/hedhog/frontend/app/projects/page.tsx.ejs +90 -51
  96. package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +546 -118
  97. package/hedhog/frontend/app/time-off/page.tsx.ejs +400 -123
  98. package/hedhog/frontend/app/timesheets/page.tsx.ejs +647 -342
  99. package/hedhog/frontend/messages/en.json +148 -14
  100. package/hedhog/frontend/messages/pt.json +199 -56
  101. package/hedhog/table/operations_collaborator.yaml +18 -18
  102. package/hedhog/table/operations_collaborator_equity_participation.yaml +43 -43
  103. package/hedhog/table/operations_collaborator_type.yaml +33 -33
  104. package/hedhog/table/operations_contract.yaml +0 -9
  105. package/hedhog/table/operations_contract_document.yaml +33 -33
  106. package/package.json +4 -4
  107. package/src/controllers/operations-approvals.controller.ts +9 -3
  108. package/src/controllers/operations-collaborators.controller.ts +15 -2
  109. package/src/controllers/operations-contracts.controller.ts +8 -92
  110. package/src/controllers/operations-org-structure.controller.ts +17 -4
  111. package/src/controllers/operations-projects.controller.ts +10 -4
  112. package/src/controllers/operations-timesheets.controller.ts +30 -8
  113. package/src/dto/create-collaborator-type.dto.ts +43 -43
  114. package/src/dto/create-collaborator.dto.ts +223 -223
  115. package/src/dto/list-approvals.dto.ts +12 -0
  116. package/src/dto/list-collaborator-types.dto.ts +20 -15
  117. package/src/dto/list-collaborators.dto.ts +34 -30
  118. package/src/dto/list-contracts.dto.ts +20 -0
  119. package/src/dto/list-departments.dto.ts +8 -0
  120. package/src/dto/list-projects.dto.ts +8 -0
  121. package/src/dto/list-schedule-adjustments.dto.ts +8 -0
  122. package/src/dto/list-time-off-requests.dto.ts +8 -0
  123. package/src/dto/list-timesheets.dto.ts +8 -0
  124. package/src/dto/reorder-collaborator-types.dto.ts +10 -0
  125. package/src/dto/update-collaborator-type.dto.ts +4 -3
  126. package/src/dto/update-collaborator.dto.ts +3 -3
  127. package/src/operations.service.spec.ts +96 -30
  128. package/src/operations.service.ts +1738 -1777
  129. package/hedhog/frontend/app/_components/contract-creation-wizard.tsx.ejs +0 -631
  130. package/hedhog/frontend/app/_components/contract-template-form-screen.tsx.ejs +0 -526
  131. package/hedhog/frontend/app/_components/contract-template-select-with-create.tsx.ejs +0 -247
  132. package/hedhog/frontend/app/_components/contract-wizard-sheet.tsx.ejs +0 -3520
  133. package/hedhog/frontend/app/contracts/templates/page.tsx.ejs +0 -380
  134. package/hedhog/frontend/app/team/page.tsx.ejs +0 -352
  135. package/hedhog/table/operations_contract_financial_term.yaml +0 -40
  136. package/hedhog/table/operations_contract_revision.yaml +0 -38
  137. package/hedhog/table/operations_contract_signature.yaml +0 -38
  138. package/hedhog/table/operations_contract_template.yaml +0 -58
@@ -84,7 +84,6 @@ type ContractPayload = {
84
84
  isActive?: boolean;
85
85
  accountManagerCollaboratorId?: number | null;
86
86
  relatedCollaboratorId?: number | null;
87
- contractTemplateId?: number | null;
88
87
  originType?: 'manual' | 'employee_hiring' | 'client_project' | 'crm_proposal';
89
88
  originId?: number | null;
90
89
  startDate?: string | null;
@@ -107,28 +106,6 @@ type ContractPayload = {
107
106
  phone?: string | null;
108
107
  isPrimary?: boolean;
109
108
  }>;
110
- signatures?: Array<{
111
- signerName: string;
112
- signerRole?: string | null;
113
- signerEmail?: string | null;
114
- status?: 'pending' | 'signed' | 'rejected';
115
- signedAt?: string | null;
116
- }>;
117
- financialTerms?: Array<{
118
- termType?: 'value' | 'payment' | 'revenue' | 'fine' | 'other';
119
- label: string;
120
- amount: number;
121
- recurrence?: 'one_time' | 'monthly' | 'quarterly' | 'yearly' | 'other';
122
- dueDay?: number | null;
123
- notes?: string | null;
124
- }>;
125
- revisions?: Array<{
126
- revisionType?: 'amendment' | 'renewal' | 'revision' | 'addendum' | 'other';
127
- title: string;
128
- effectiveDate?: string | null;
129
- status?: 'draft' | 'active' | 'completed' | 'cancelled';
130
- summary?: string | null;
131
- }>;
132
109
  replaceUploadedPdfDocument?: {
133
110
  fileId?: number | null;
134
111
  fileName: string;
@@ -139,14 +116,6 @@ type ContractPayload = {
139
116
  extractionSummary?: string | null;
140
117
  } | null;
141
118
  };
142
- type ContractDraftPayload = {
143
- creationMode?: 'blank' | 'template' | 'upload' | 'duplicate' | null;
144
- templateId?: number | null;
145
- duplicateFromId?: number | null;
146
- sourceFileId?: number | null;
147
- sourceFileName?: string | null;
148
- sourceMimeType?: string | null;
149
- };
150
119
  type ProposalApprovedEventPayload = {
151
120
  proposalId?: number;
152
121
  proposalRevisionId?: number | null;
@@ -206,50 +175,13 @@ type ProposalApprovedEventPayload = {
206
175
  items?: Array<{
207
176
  name?: string | null;
208
177
  description?: string | null;
209
- termType?: ContractPayload['financialTerms'][number]['termType'];
210
- recurrence?: ContractPayload['financialTerms'][number]['recurrence'];
178
+ termType?: 'value' | 'payment' | 'revenue' | 'fine' | 'other';
179
+ recurrence?: 'one_time' | 'monthly' | 'quarterly' | 'yearly' | 'other';
211
180
  dueDay?: number | null;
212
181
  amount?: number | null;
213
182
  totalAmountCents?: number | null;
214
183
  }>;
215
184
  };
216
- type ContractTemplatePayload = {
217
- code?: string | null;
218
- name?: string | null;
219
- description?: string | null;
220
- contractCategory?: 'employee' | 'contractor' | 'client' | 'supplier' | 'vendor' | 'partner' | 'internal' | 'other';
221
- contractType?: 'clt' | 'pj' | 'freelancer_agreement' | 'service_agreement' | 'fixed_term' | 'recurring_service' | 'nda' | 'amendment' | 'addendum' | 'other';
222
- billingModel?: 'time_and_material' | 'monthly_retainer' | 'fixed_price';
223
- signatureStatus?: 'not_started' | 'pending' | 'partially_signed' | 'signed' | 'expired';
224
- isActive?: boolean;
225
- status?: 'draft' | 'active' | 'inactive' | 'archived';
226
- contentHtml?: string | null;
227
- };
228
- type ContractExtractDraftPayload = {
229
- contractId?: number | null;
230
- fileName?: string | null;
231
- mimeType?: string | null;
232
- fileContentBase64?: string | null;
233
- provider?: 'openai' | 'gemini' | null;
234
- promptMessage?: string | null;
235
- };
236
- type ContractGenerateContentPayload = {
237
- provider?: 'openai' | 'gemini' | null;
238
- promptMessage?: string | null;
239
- overwrite?: boolean;
240
- };
241
- type ContractLegalReviewPayload = {
242
- provider?: 'openai' | 'gemini' | null;
243
- promptMessage?: string | null;
244
- };
245
- type ContractLegalReviewResult = {
246
- summary: string;
247
- missingFields: string[];
248
- warnings: string[];
249
- checklist: string[];
250
- status: 'ready_for_revision' | 'attention_required';
251
- reviewedAt: string;
252
- };
253
185
  type ContractProjectSummary = {
254
186
  id: number;
255
187
  code: string;
@@ -296,10 +228,6 @@ type ContractDetailRecord = {
296
228
  billingModel: (typeof BILLING_MODEL_VALUES)[number];
297
229
  accountManagerCollaboratorId: number | null;
298
230
  relatedCollaboratorId: number | null;
299
- contractTemplateId: number | null;
300
- contractTemplateName: string | null;
301
- contractTemplateSlug: string | null;
302
- contractTemplateCode: string | null;
303
231
  originType: (typeof ORIGIN_TYPE_VALUES)[number];
304
232
  originId: number | null;
305
233
  startDate: string | null;
@@ -321,15 +249,11 @@ type ContractDetailsRecord = ContractDetailRecord & {
321
249
  projects: ContractProjectSummary[];
322
250
  scheduleSummary: ContractScheduleDay[];
323
251
  parties: NonNullable<ContractPayload['parties']>;
324
- signatures: NonNullable<ContractPayload['signatures']>;
325
- financialTerms: NonNullable<ContractPayload['financialTerms']>;
326
252
  documents: ContractDocumentRecord[];
327
- revisions: NonNullable<ContractPayload['revisions']>;
328
253
  history: ContractHistoryRecord[];
329
254
  };
330
255
  type ProjectPayload = {
331
256
  contractId?: number | null;
332
- contractTemplateId?: number | null;
333
257
  managerCollaboratorId?: number | null;
334
258
  clientPersonId?: number | null;
335
259
  code: string;
@@ -347,7 +271,6 @@ type ProjectPayload = {
347
271
  contractCode?: string | null;
348
272
  contractName?: string | null;
349
273
  contractDescription?: string | null;
350
- autoGenerateContractDraft?: boolean;
351
274
  teamAssignments?: Array<{
352
275
  collaboratorId: number;
353
276
  projectRoleId?: number | null;
@@ -455,7 +378,13 @@ export declare class OperationsService {
455
378
  private normalizeLocaleCode;
456
379
  private resolvePreferredLocaleId;
457
380
  listCollaboratorTypes(userId: number, filters?: {
381
+ page?: number;
382
+ pageSize?: number;
383
+ search?: string;
384
+ sortField?: string;
385
+ sortOrder?: string;
458
386
  active?: boolean;
387
+ status?: string;
459
388
  }): Promise<{
460
389
  id: number;
461
390
  slug: string;
@@ -468,7 +397,27 @@ export declare class OperationsService {
468
397
  collaboratorCount: number;
469
398
  createdAt: string;
470
399
  updatedAt: string;
471
- }[]>;
400
+ }[] | {
401
+ total: number;
402
+ lastPage: number;
403
+ page: number;
404
+ pageSize: number;
405
+ prev: number;
406
+ next: number;
407
+ data: {
408
+ id: number;
409
+ slug: string;
410
+ name: string;
411
+ description: string | null;
412
+ category: string | null;
413
+ isActive: boolean;
414
+ sortOrder: number;
415
+ status: "active" | "inactive";
416
+ collaboratorCount: number;
417
+ createdAt: string;
418
+ updatedAt: string;
419
+ }[];
420
+ }>;
472
421
  createCollaboratorType(userId: number, data: CollaboratorTypePayload): Promise<{
473
422
  id: number;
474
423
  slug: string;
@@ -497,6 +446,39 @@ export declare class OperationsService {
497
446
  updatedAt: string | null;
498
447
  deletedAt: string | null;
499
448
  }>;
449
+ reorderCollaboratorTypes(userId: number, ids: number[]): Promise<{
450
+ id: number;
451
+ slug: string;
452
+ name: string;
453
+ description: string | null;
454
+ category: string | null;
455
+ isActive: boolean;
456
+ sortOrder: number;
457
+ status: "active" | "inactive";
458
+ collaboratorCount: number;
459
+ createdAt: string;
460
+ updatedAt: string;
461
+ }[] | {
462
+ total: number;
463
+ lastPage: number;
464
+ page: number;
465
+ pageSize: number;
466
+ prev: number;
467
+ next: number;
468
+ data: {
469
+ id: number;
470
+ slug: string;
471
+ name: string;
472
+ description: string | null;
473
+ category: string | null;
474
+ isActive: boolean;
475
+ sortOrder: number;
476
+ status: "active" | "inactive";
477
+ collaboratorCount: number;
478
+ createdAt: string;
479
+ updatedAt: string;
480
+ }[];
481
+ }>;
500
482
  listProjectRoles(userId: number): Promise<{
501
483
  id: number;
502
484
  slug: string;
@@ -545,7 +527,39 @@ export declare class OperationsService {
545
527
  status: string;
546
528
  }[];
547
529
  }>;
548
- listCollaborators(userId: number): Promise<Record<string, unknown>[]>;
530
+ listCollaborators(userId: number, filters?: {
531
+ page?: number;
532
+ pageSize?: number;
533
+ search?: string;
534
+ sortField?: string;
535
+ sortOrder?: string;
536
+ status?: string;
537
+ collaboratorType?: string;
538
+ collaboratorTypeId?: number;
539
+ departmentId?: number;
540
+ jobTitleId?: number;
541
+ }): Promise<Record<string, unknown>[] | {
542
+ total: number;
543
+ lastPage: number;
544
+ page: number;
545
+ pageSize: number;
546
+ prev: number;
547
+ next: number;
548
+ data: Record<string, unknown>[];
549
+ }>;
550
+ getCollaboratorStats(userId: number, filters?: {
551
+ search?: string;
552
+ status?: string;
553
+ collaboratorType?: string;
554
+ collaboratorTypeId?: number;
555
+ departmentId?: number;
556
+ jobTitleId?: number;
557
+ }): Promise<{
558
+ total: number;
559
+ active: number;
560
+ onLeave: number;
561
+ withContracts: number;
562
+ }>;
549
563
  getMyCollaborator(userId: number): Promise<{
550
564
  assignedProjects: Record<string, unknown>[];
551
565
  relatedContracts: Record<string, unknown>[];
@@ -760,7 +774,22 @@ export declare class OperationsService {
760
774
  compensationAmount: number | null;
761
775
  activeAssignments: number;
762
776
  }>;
763
- listDepartments(userId: number): Promise<Record<string, unknown>[]>;
777
+ listDepartments(userId: number, filters?: {
778
+ page?: number;
779
+ pageSize?: number;
780
+ search?: string;
781
+ sortField?: string;
782
+ sortOrder?: string;
783
+ status?: string;
784
+ }): Promise<Record<string, unknown>[] | {
785
+ total: number;
786
+ lastPage: number;
787
+ page: number;
788
+ pageSize: number;
789
+ prev: number;
790
+ next: number;
791
+ data: Record<string, unknown>[];
792
+ }>;
764
793
  listJobTitles(userId: number): Promise<Record<string, unknown>[]>;
765
794
  createJobTitle(userId: number, data: JobTitlePayload): Promise<{
766
795
  id: number;
@@ -795,7 +824,22 @@ export declare class OperationsService {
795
824
  deletedAt: string | null;
796
825
  status: "active" | "inactive";
797
826
  }>;
798
- listProjects(userId: number): Promise<Record<string, unknown>[]>;
827
+ listProjects(userId: number, filters?: {
828
+ page?: number;
829
+ pageSize?: number;
830
+ search?: string;
831
+ sortField?: string;
832
+ sortOrder?: string;
833
+ status?: string;
834
+ }): Promise<Record<string, unknown>[] | {
835
+ total: number;
836
+ lastPage: number;
837
+ page: number;
838
+ pageSize: number;
839
+ prev: number;
840
+ next: number;
841
+ data: Record<string, unknown>[];
842
+ }>;
799
843
  listProjectOptions(userId: number, paginationParams: {
800
844
  page?: number;
801
845
  pageSize?: number;
@@ -952,6 +996,27 @@ export declare class OperationsService {
952
996
  weekEndDate: string;
953
997
  createdAt: string;
954
998
  }>;
999
+ updateTimesheetEntry(userId: number, entryId: number, data: QuickTimesheetEntryPayload): Promise<{
1000
+ label: string;
1001
+ id: number;
1002
+ timesheetId: number;
1003
+ collaboratorId: number;
1004
+ projectId: number | null;
1005
+ projectAssignmentId: number | null;
1006
+ projectCode: string | null;
1007
+ projectName: string | null;
1008
+ taskId: number | null;
1009
+ taskName: string | null;
1010
+ activityLabel: string | null;
1011
+ workDate: string;
1012
+ durationMinutes: number | null;
1013
+ hours: number | null;
1014
+ description: string | null;
1015
+ status: string;
1016
+ weekStartDate: string;
1017
+ weekEndDate: string;
1018
+ createdAt: string;
1019
+ }>;
955
1020
  removeTimesheetEntry(userId: number, entryId: number): Promise<{
956
1021
  success: boolean;
957
1022
  }>;
@@ -980,7 +1045,7 @@ export declare class OperationsService {
980
1045
  };
981
1046
  operationalIndicators: {
982
1047
  activeAssignments: number;
983
- billableAssignments: number;
1048
+ completedAssignments: number;
984
1049
  averageAllocation: number;
985
1050
  totalWeeklyHours: number;
986
1051
  };
@@ -1032,7 +1097,7 @@ export declare class OperationsService {
1032
1097
  };
1033
1098
  operationalIndicators: {
1034
1099
  activeAssignments: number;
1035
- billableAssignments: number;
1100
+ completedAssignments: number;
1036
1101
  averageAllocation: number;
1037
1102
  totalWeeklyHours: number;
1038
1103
  };
@@ -1084,7 +1149,7 @@ export declare class OperationsService {
1084
1149
  };
1085
1150
  operationalIndicators: {
1086
1151
  activeAssignments: number;
1087
- billableAssignments: number;
1152
+ completedAssignments: number;
1088
1153
  averageAllocation: number;
1089
1154
  totalWeeklyHours: number;
1090
1155
  };
@@ -1111,182 +1176,33 @@ export declare class OperationsService {
1111
1176
  myRoleLabel: string | null;
1112
1177
  teamSize: number;
1113
1178
  }>;
1114
- listContractTemplates(userId: number): Promise<Record<string, unknown>[]>;
1115
- getContractTemplateById(userId: number, templateId: number): Promise<{
1116
- id: number;
1117
- slug: string;
1118
- code: string | null;
1119
- name: string;
1120
- description: string | null;
1121
- contractCategory: string | null;
1122
- contractType: string | null;
1123
- billingModel: string | null;
1124
- signatureStatus: string | null;
1125
- isActive: boolean;
1126
- status: string | null;
1127
- contentHtml: string | null;
1128
- usageCount: number;
1129
- createdAt: Date;
1130
- updatedAt: Date;
1131
- }>;
1132
- createContractTemplate(userId: number, data: ContractTemplatePayload): Promise<{
1133
- id: number;
1134
- slug: string;
1135
- code: string | null;
1136
- name: string;
1137
- description: string | null;
1138
- contractCategory: string | null;
1139
- contractType: string | null;
1140
- billingModel: string | null;
1141
- signatureStatus: string | null;
1142
- isActive: boolean;
1143
- status: string | null;
1144
- contentHtml: string | null;
1145
- usageCount: number;
1146
- createdAt: Date;
1147
- updatedAt: Date;
1179
+ listContracts(userId: number, filters?: {
1180
+ page?: number;
1181
+ pageSize?: number;
1182
+ search?: string;
1183
+ sortField?: string;
1184
+ sortOrder?: string;
1185
+ status?: string;
1186
+ contractCategory?: string;
1187
+ originType?: string;
1188
+ isActive?: string;
1189
+ }): Promise<Record<string, unknown>[] | {
1190
+ total: number;
1191
+ lastPage: number;
1192
+ page: number;
1193
+ pageSize: number;
1194
+ prev: number;
1195
+ next: number;
1196
+ data: Record<string, unknown>[];
1148
1197
  }>;
1149
- updateContractTemplate(userId: number, templateId: number, data: Partial<ContractTemplatePayload>): Promise<{
1150
- id: number;
1151
- slug: string;
1152
- code: string | null;
1153
- name: string;
1154
- description: string | null;
1155
- contractCategory: string | null;
1156
- contractType: string | null;
1157
- billingModel: string | null;
1158
- signatureStatus: string | null;
1159
- isActive: boolean;
1160
- status: string | null;
1161
- contentHtml: string | null;
1162
- usageCount: number;
1163
- createdAt: Date;
1164
- updatedAt: Date;
1198
+ getContractStats(userId: number): Promise<{
1199
+ total: number;
1200
+ active: number;
1201
+ inactive: number;
1202
+ withFile: number;
1165
1203
  }>;
1166
- listContracts(userId: number): Promise<Record<string, unknown>[]>;
1167
1204
  getContractById(userId: number, contractId: number): Promise<ContractDetailsRecord>;
1168
1205
  createContract(userId: number, data: ContractPayload): Promise<ContractDetailsRecord>;
1169
- createContractDraft(userId: number, data: ContractDraftPayload): Promise<ContractDetailsRecord>;
1170
- extractContractSource(userId: number, contractId: number, data: Omit<ContractExtractDraftPayload, 'fileName' | 'mimeType' | 'fileContentBase64' | 'contractId'>): Promise<{
1171
- warnings: string[];
1172
- summary: string;
1173
- missingFields: string[];
1174
- code: string;
1175
- name: string;
1176
- clientName: string;
1177
- contractCategory: "other" | "client" | "internal" | "employee" | "contractor" | "supplier" | "vendor" | "partner";
1178
- contractType: "other" | "clt" | "pj" | "freelancer_agreement" | "service_agreement" | "fixed_term" | "recurring_service" | "nda" | "amendment" | "addendum";
1179
- signatureStatus: "pending" | "expired" | "not_started" | "partially_signed" | "signed";
1180
- isActive: boolean;
1181
- billingModel: "time_and_material" | "monthly_retainer" | "fixed_price";
1182
- originType: "manual" | "employee_hiring" | "client_project" | "crm_proposal";
1183
- originId: string;
1184
- startDate: string;
1185
- endDate: string;
1186
- signedAt: string;
1187
- effectiveDate: string;
1188
- budgetAmount: string | number;
1189
- monthlyHourCap: string | number;
1190
- status: "active" | "draft" | "expired" | "archived" | "closed" | "under_review" | "renewal";
1191
- description: string;
1192
- contentHtml: string;
1193
- parties: {
1194
- displayName: string;
1195
- partyRole: "other" | "client" | "employee" | "supplier" | "vendor" | "partner" | "employer" | "witness" | "internal_owner";
1196
- partyType: "other" | "individual" | "company" | "internal_team";
1197
- documentNumber: string;
1198
- email: string;
1199
- phone: string;
1200
- isPrimary: boolean;
1201
- }[];
1202
- signatures: {
1203
- signerName: string;
1204
- signerRole: string;
1205
- signerEmail: string;
1206
- status: "rejected" | "pending" | "signed";
1207
- signedAt: string;
1208
- }[];
1209
- financialTerms: {
1210
- label: string;
1211
- termType: "value" | "other" | "revenue" | "payment" | "fine";
1212
- amount: string | number;
1213
- recurrence: "other" | "one_time" | "monthly" | "quarterly" | "yearly";
1214
- dueDay: string | number;
1215
- notes: string;
1216
- }[];
1217
- revisions: {
1218
- title: string;
1219
- revisionType: "other" | "amendment" | "addendum" | "renewal" | "revision";
1220
- effectiveDate: string;
1221
- status: "active" | "draft" | "completed" | "cancelled";
1222
- summary: string;
1223
- }[];
1224
- }>;
1225
- generateContractContent(userId: number, contractId: number, data?: ContractGenerateContentPayload): Promise<ContractDetailsRecord>;
1226
- reviewContractLegally(userId: number, contractId: number, data?: ContractLegalReviewPayload): Promise<ContractLegalReviewResult>;
1227
- generateContractPdf(userId: number, contractId: number): Promise<{
1228
- contractId: number;
1229
- fileId: number;
1230
- fileName: string;
1231
- mimeType: string;
1232
- documentType: string;
1233
- downloadUrl: string;
1234
- }>;
1235
- extractContractDraft(userId: number, data: ContractExtractDraftPayload): Promise<{
1236
- warnings: string[];
1237
- summary: string;
1238
- missingFields: string[];
1239
- code: string;
1240
- name: string;
1241
- clientName: string;
1242
- contractCategory: "other" | "client" | "internal" | "employee" | "contractor" | "supplier" | "vendor" | "partner";
1243
- contractType: "other" | "clt" | "pj" | "freelancer_agreement" | "service_agreement" | "fixed_term" | "recurring_service" | "nda" | "amendment" | "addendum";
1244
- signatureStatus: "pending" | "expired" | "not_started" | "partially_signed" | "signed";
1245
- isActive: boolean;
1246
- billingModel: "time_and_material" | "monthly_retainer" | "fixed_price";
1247
- originType: "manual" | "employee_hiring" | "client_project" | "crm_proposal";
1248
- originId: string;
1249
- startDate: string;
1250
- endDate: string;
1251
- signedAt: string;
1252
- effectiveDate: string;
1253
- budgetAmount: string | number;
1254
- monthlyHourCap: string | number;
1255
- status: "active" | "draft" | "expired" | "archived" | "closed" | "under_review" | "renewal";
1256
- description: string;
1257
- contentHtml: string;
1258
- parties: {
1259
- displayName: string;
1260
- partyRole: "other" | "client" | "employee" | "supplier" | "vendor" | "partner" | "employer" | "witness" | "internal_owner";
1261
- partyType: "other" | "individual" | "company" | "internal_team";
1262
- documentNumber: string;
1263
- email: string;
1264
- phone: string;
1265
- isPrimary: boolean;
1266
- }[];
1267
- signatures: {
1268
- signerName: string;
1269
- signerRole: string;
1270
- signerEmail: string;
1271
- status: "rejected" | "pending" | "signed";
1272
- signedAt: string;
1273
- }[];
1274
- financialTerms: {
1275
- label: string;
1276
- termType: "value" | "other" | "revenue" | "payment" | "fine";
1277
- amount: string | number;
1278
- recurrence: "other" | "one_time" | "monthly" | "quarterly" | "yearly";
1279
- dueDay: string | number;
1280
- notes: string;
1281
- }[];
1282
- revisions: {
1283
- title: string;
1284
- revisionType: "other" | "amendment" | "addendum" | "renewal" | "revision";
1285
- effectiveDate: string;
1286
- status: "active" | "draft" | "completed" | "cancelled";
1287
- summary: string;
1288
- }[];
1289
- }>;
1290
1206
  createContractFromProposalIntegration(payload: ProposalApprovedEventPayload): Promise<{
1291
1207
  id: number;
1292
1208
  code: string;
@@ -1297,7 +1213,14 @@ export declare class OperationsService {
1297
1213
  removeContract(userId: number, contractId: number): Promise<{
1298
1214
  success: boolean;
1299
1215
  }>;
1300
- listTimesheets(userId: number): Promise<{
1216
+ listTimesheets(userId: number, filters?: {
1217
+ page?: number;
1218
+ pageSize?: number;
1219
+ search?: string;
1220
+ sortField?: string;
1221
+ sortOrder?: string;
1222
+ status?: string;
1223
+ }): Promise<{
1301
1224
  id: number;
1302
1225
  collaboratorId: number;
1303
1226
  collaboratorName: string;
@@ -1311,13 +1234,51 @@ export declare class OperationsService {
1311
1234
  reviewedAt: string | null;
1312
1235
  notes: string | null;
1313
1236
  decisionNote: string | null;
1314
- }[]>;
1237
+ }[] | {
1238
+ total: number;
1239
+ lastPage: number;
1240
+ page: number;
1241
+ pageSize: number;
1242
+ prev: number;
1243
+ next: number;
1244
+ data: any[];
1245
+ }>;
1315
1246
  createTimesheet(userId: number, data: TimesheetPayload): Promise<any>;
1316
1247
  updateTimesheet(userId: number, timesheetId: number, data: Partial<TimesheetPayload>): Promise<any>;
1317
1248
  submitTimesheet(userId: number, timesheetId: number): Promise<any>;
1318
- listTimeOffRequests(userId: number): Promise<Record<string, unknown>[]>;
1249
+ listTimeOffRequests(userId: number, filters?: {
1250
+ page?: number;
1251
+ pageSize?: number;
1252
+ search?: string;
1253
+ sortField?: string;
1254
+ sortOrder?: string;
1255
+ status?: string;
1256
+ }): Promise<Record<string, unknown>[] | {
1257
+ total: number;
1258
+ lastPage: number;
1259
+ page: number;
1260
+ pageSize: number;
1261
+ prev: number;
1262
+ next: number;
1263
+ data: Record<string, unknown>[];
1264
+ }>;
1319
1265
  createTimeOffRequest(userId: number, data: TimeOffPayload): Promise<Record<string, unknown>>;
1320
- listScheduleAdjustments(userId: number): Promise<{
1266
+ listScheduleAdjustments(userId: number, filters?: {
1267
+ page?: number;
1268
+ pageSize?: number;
1269
+ search?: string;
1270
+ sortField?: string;
1271
+ sortOrder?: string;
1272
+ status?: string;
1273
+ }): Promise<{
1274
+ total: number;
1275
+ lastPage: number;
1276
+ page: number;
1277
+ pageSize: number;
1278
+ prev: number;
1279
+ next: number;
1280
+ data: any[];
1281
+ } | {
1321
1282
  id: number;
1322
1283
  collaboratorId: number;
1323
1284
  collaboratorName: string;
@@ -1333,9 +1294,129 @@ export declare class OperationsService {
1333
1294
  approverNote: string | null;
1334
1295
  }[]>;
1335
1296
  createScheduleAdjustmentRequest(userId: number, data: ScheduleAdjustmentPayload): Promise<Record<string, unknown>>;
1336
- listApprovals(userId: number): Promise<Record<string, unknown>[]>;
1297
+ listApprovals(userId: number, filters?: {
1298
+ page?: number;
1299
+ pageSize?: number;
1300
+ search?: string;
1301
+ sortField?: string;
1302
+ sortOrder?: string;
1303
+ status?: string;
1304
+ targetType?: string;
1305
+ }): Promise<Record<string, unknown>[] | {
1306
+ total: number;
1307
+ lastPage: number;
1308
+ page: number;
1309
+ pageSize: number;
1310
+ prev: number;
1311
+ next: number;
1312
+ data: Record<string, unknown>[];
1313
+ }>;
1337
1314
  approve(userId: number, approvalId: number, data: DecisionPayload): Promise<Record<string, unknown>>;
1338
1315
  reject(userId: number, approvalId: number, data: DecisionPayload): Promise<Record<string, unknown>>;
1316
+ getApprovalDetail(userId: number, approvalId: number): Promise<{
1317
+ id: number;
1318
+ targetType: string;
1319
+ targetId: number;
1320
+ requesterCollaboratorId: number;
1321
+ requesterName: string;
1322
+ approverCollaboratorId: number | null;
1323
+ approverName: string | null;
1324
+ status: string;
1325
+ submittedAt: string | null;
1326
+ decidedAt: string | null;
1327
+ decisionNote: string | null;
1328
+ timesheetWeekStartDate: string | null;
1329
+ timesheetWeekEndDate: string | null;
1330
+ timesheetTotalHours: number | null;
1331
+ timesheetProjectNames: string | null;
1332
+ timeOffType: string | null;
1333
+ timeOffStartDate: string | null;
1334
+ timeOffEndDate: string | null;
1335
+ timeOffReason: string | null;
1336
+ scheduleRequestScope: string | null;
1337
+ scheduleStartDate: string | null;
1338
+ scheduleEndDate: string | null;
1339
+ scheduleReason: string | null;
1340
+ } | {
1341
+ entries: {
1342
+ id: number;
1343
+ timesheetId: number;
1344
+ projectAssignmentId: number | null;
1345
+ projectId: number | null;
1346
+ projectName: string | null;
1347
+ roleLabel: string | null;
1348
+ taskId: number | null;
1349
+ taskName: string | null;
1350
+ activityLabel: string | null;
1351
+ workDate: string;
1352
+ durationMinutes: number | null;
1353
+ hours: number;
1354
+ description: string | null;
1355
+ }[];
1356
+ id: number;
1357
+ targetType: string;
1358
+ targetId: number;
1359
+ requesterCollaboratorId: number;
1360
+ requesterName: string;
1361
+ approverCollaboratorId: number | null;
1362
+ approverName: string | null;
1363
+ status: string;
1364
+ submittedAt: string | null;
1365
+ decidedAt: string | null;
1366
+ decisionNote: string | null;
1367
+ timesheetWeekStartDate: string | null;
1368
+ timesheetWeekEndDate: string | null;
1369
+ timesheetTotalHours: number | null;
1370
+ timesheetProjectNames: string | null;
1371
+ timeOffType: string | null;
1372
+ timeOffStartDate: string | null;
1373
+ timeOffEndDate: string | null;
1374
+ timeOffReason: string | null;
1375
+ scheduleRequestScope: string | null;
1376
+ scheduleStartDate: string | null;
1377
+ scheduleEndDate: string | null;
1378
+ scheduleReason: string | null;
1379
+ } | {
1380
+ days: {
1381
+ requestId: number;
1382
+ weekday: string;
1383
+ isWorkingDay: boolean;
1384
+ startTime: string | null;
1385
+ endTime: string | null;
1386
+ breakMinutes: number | null;
1387
+ }[];
1388
+ currentSchedule: {
1389
+ collaboratorId: number;
1390
+ weekday: string;
1391
+ isWorkingDay: boolean;
1392
+ startTime: string | null;
1393
+ endTime: string | null;
1394
+ breakMinutes: number | null;
1395
+ }[];
1396
+ id: number;
1397
+ targetType: string;
1398
+ targetId: number;
1399
+ requesterCollaboratorId: number;
1400
+ requesterName: string;
1401
+ approverCollaboratorId: number | null;
1402
+ approverName: string | null;
1403
+ status: string;
1404
+ submittedAt: string | null;
1405
+ decidedAt: string | null;
1406
+ decisionNote: string | null;
1407
+ timesheetWeekStartDate: string | null;
1408
+ timesheetWeekEndDate: string | null;
1409
+ timesheetTotalHours: number | null;
1410
+ timesheetProjectNames: string | null;
1411
+ timeOffType: string | null;
1412
+ timeOffStartDate: string | null;
1413
+ timeOffEndDate: string | null;
1414
+ timeOffReason: string | null;
1415
+ scheduleRequestScope: string | null;
1416
+ scheduleStartDate: string | null;
1417
+ scheduleEndDate: string | null;
1418
+ scheduleReason: string | null;
1419
+ }>;
1339
1420
  publishAccountsPayableReference(userId: number, data: PublishAccountsPayableReferencePayload): Promise<{
1340
1421
  queued: boolean;
1341
1422
  eventId: string;
@@ -1368,13 +1449,24 @@ export declare class OperationsService {
1368
1449
  private assertProjectRoleCodeAvailable;
1369
1450
  private generateUniqueProjectRoleSlug;
1370
1451
  private resolveCollaboratorTypeReference;
1371
- private getContractTemplateRecord;
1372
- private assertContractTemplateNameAvailable;
1373
- private assertContractTemplateCodeAvailable;
1374
- private generateUniqueContractTemplateSlug;
1375
1452
  private slugifyValue;
1376
1453
  private normalizeOptionalText;
1377
1454
  private getProjectDetails;
1455
+ getProjectStats(userId: number, projectId: number): Promise<{
1456
+ weeklyVelocity: {
1457
+ weekLabel: string;
1458
+ loggedHours: number;
1459
+ }[];
1460
+ allocationByCollaborator: {
1461
+ name: string;
1462
+ allocation: number;
1463
+ }[];
1464
+ quickRadar: {
1465
+ activeAssignments: number;
1466
+ pendingTimesheets: number;
1467
+ totalWeeklyHours: number;
1468
+ };
1469
+ }>;
1378
1470
  private getCollaboratorDetails;
1379
1471
  private getDirectReportIds;
1380
1472
  private getAssignedProjectIds;
@@ -1405,6 +1497,7 @@ export declare class OperationsService {
1405
1497
  private getTimesheetById;
1406
1498
  private replaceTimesheetEntries;
1407
1499
  private refreshTimesheetTotal;
1500
+ private cleanupEmptyEditableTimesheet;
1408
1501
  private upsertApproval;
1409
1502
  private applyApprovedScheduleAdjustmentIfNeeded;
1410
1503
  private insertApprovalHistory;
@@ -1425,11 +1518,7 @@ export declare class OperationsService {
1425
1518
  private buildHiringContractName;
1426
1519
  private createHiringContractDraft;
1427
1520
  private syncHiringContractDraft;
1428
- private createProjectContractDraft;
1429
1521
  private replaceContractParties;
1430
- private replaceContractSignatures;
1431
- private replaceContractFinancialTerms;
1432
- private replaceContractRevisions;
1433
1522
  private replaceContractDocument;
1434
1523
  private resolveContractExtractionFile;
1435
1524
  private buildContractExtractionFile;
@@ -1457,6 +1546,7 @@ export declare class OperationsService {
1457
1546
  private formatDateOnly;
1458
1547
  private getWorkWeekRange;
1459
1548
  private normalizePaginationParams;
1549
+ private shouldPaginate;
1460
1550
  private buildPaginationResult;
1461
1551
  private normalizeExtractionBoolean;
1462
1552
  private normalizeExtractionNumber;
@@ -1475,6 +1565,7 @@ export declare class OperationsService {
1475
1565
  private queryRows;
1476
1566
  private querySingle;
1477
1567
  private execute;
1568
+ private getNextCollaboratorTypeSortOrder;
1478
1569
  }
1479
1570
  export {};
1480
1571
  //# sourceMappingURL=operations.service.d.ts.map