@hed-hog/operations 0.0.300 → 0.0.302

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 (73) hide show
  1. package/dist/operations.controller.d.ts +713 -31
  2. package/dist/operations.controller.d.ts.map +1 -1
  3. package/dist/operations.controller.js +157 -0
  4. package/dist/operations.controller.js.map +1 -1
  5. package/dist/operations.module.d.ts.map +1 -1
  6. package/dist/operations.module.js +5 -1
  7. package/dist/operations.module.js.map +1 -1
  8. package/dist/operations.proposal.subscriber.d.ts +11 -0
  9. package/dist/operations.proposal.subscriber.d.ts.map +1 -0
  10. package/dist/operations.proposal.subscriber.js +80 -0
  11. package/dist/operations.proposal.subscriber.js.map +1 -0
  12. package/dist/operations.proposal.subscriber.spec.d.ts +2 -0
  13. package/dist/operations.proposal.subscriber.spec.d.ts.map +1 -0
  14. package/dist/operations.proposal.subscriber.spec.js +88 -0
  15. package/dist/operations.proposal.subscriber.spec.js.map +1 -0
  16. package/dist/operations.service.d.ts +491 -46
  17. package/dist/operations.service.d.ts.map +1 -1
  18. package/dist/operations.service.js +2484 -121
  19. package/dist/operations.service.js.map +1 -1
  20. package/dist/operations.service.spec.d.ts +2 -0
  21. package/dist/operations.service.spec.d.ts.map +1 -0
  22. package/dist/operations.service.spec.js +159 -0
  23. package/dist/operations.service.spec.js.map +1 -0
  24. package/hedhog/data/menu.yaml +35 -22
  25. package/hedhog/data/role_route.yaml +39 -0
  26. package/hedhog/data/route.yaml +130 -0
  27. package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +8 -6
  28. package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +1163 -327
  29. package/hedhog/frontend/app/_components/collaborator-select-with-create.tsx.ejs +256 -0
  30. package/hedhog/frontend/app/_components/contract-content-editor.tsx.ejs +258 -0
  31. package/hedhog/frontend/app/_components/contract-creation-wizard.tsx.ejs +631 -0
  32. package/hedhog/frontend/app/_components/contract-details-screen.tsx.ejs +353 -27
  33. package/hedhog/frontend/app/_components/contract-form-screen.tsx.ejs +1926 -87
  34. package/hedhog/frontend/app/_components/contract-template-form-screen.tsx.ejs +526 -0
  35. package/hedhog/frontend/app/_components/contract-template-select-with-create.tsx.ejs +247 -0
  36. package/hedhog/frontend/app/_components/contract-wizard-sheet.tsx.ejs +3520 -0
  37. package/hedhog/frontend/app/_components/department-select-with-create.tsx.ejs +370 -0
  38. package/hedhog/frontend/app/_components/person-select-with-create.tsx.ejs +826 -0
  39. package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +1251 -364
  40. package/hedhog/frontend/app/_components/section-card.tsx.ejs +48 -13
  41. package/hedhog/frontend/app/_lib/api.ts.ejs +2 -5
  42. package/hedhog/frontend/app/_lib/types.ts.ejs +76 -33
  43. package/hedhog/frontend/app/_lib/utils/format.ts.ejs +85 -8
  44. package/hedhog/frontend/app/approvals/page.tsx.ejs +90 -54
  45. package/hedhog/frontend/app/collaborators/[id]/edit/page.tsx.ejs +2 -2
  46. package/hedhog/frontend/app/collaborators/[id]/page.tsx.ejs +2 -2
  47. package/hedhog/frontend/app/collaborators/page.tsx.ejs +597 -140
  48. package/hedhog/frontend/app/contracts/[id]/edit/page.tsx.ejs +2 -2
  49. package/hedhog/frontend/app/contracts/[id]/page.tsx.ejs +2 -2
  50. package/hedhog/frontend/app/contracts/page.tsx.ejs +941 -262
  51. package/hedhog/frontend/app/contracts/templates/page.tsx.ejs +384 -0
  52. package/hedhog/frontend/app/departments/page.tsx.ejs +442 -0
  53. package/hedhog/frontend/app/page.tsx.ejs +3 -317
  54. package/hedhog/frontend/app/projects/[id]/edit/page.tsx.ejs +2 -2
  55. package/hedhog/frontend/app/projects/new/page.tsx.ejs +2 -2
  56. package/hedhog/frontend/app/projects/page.tsx.ejs +264 -102
  57. package/hedhog/frontend/app/schedule-adjustments/page.tsx.ejs +50 -28
  58. package/hedhog/frontend/app/time-off/page.tsx.ejs +57 -31
  59. package/hedhog/frontend/app/timesheets/page.tsx.ejs +85 -42
  60. package/hedhog/frontend/messages/en.json +473 -12
  61. package/hedhog/frontend/messages/pt.json +528 -66
  62. package/hedhog/table/operations_collaborator.yaml +20 -0
  63. package/hedhog/table/operations_contract.yaml +22 -1
  64. package/hedhog/table/operations_contract_document.yaml +33 -16
  65. package/hedhog/table/operations_contract_template.yaml +58 -0
  66. package/hedhog/table/operations_department.yaml +24 -0
  67. package/package.json +7 -5
  68. package/src/operations.controller.ts +122 -0
  69. package/src/operations.module.ts +6 -2
  70. package/src/operations.proposal.subscriber.spec.ts +121 -0
  71. package/src/operations.proposal.subscriber.ts +86 -0
  72. package/src/operations.service.spec.ts +210 -0
  73. package/src/operations.service.ts +4026 -241
@@ -44,10 +44,14 @@ export declare class OperationsController {
44
44
  };
45
45
  scheduleAdjustmentRequests: Record<string, unknown>[];
46
46
  id: number;
47
- userId: number;
47
+ userId: number | null;
48
+ personId: number | null;
49
+ personName: string | null;
50
+ personAvatarId: number | null;
48
51
  code: string;
49
52
  collaboratorType: string;
50
53
  displayName: string;
54
+ departmentId: number | null;
51
55
  department: string | null;
52
56
  title: string | null;
53
57
  levelLabel: string | null;
@@ -78,10 +82,14 @@ export declare class OperationsController {
78
82
  };
79
83
  scheduleAdjustmentRequests: Record<string, unknown>[];
80
84
  id: number;
81
- userId: number;
85
+ userId: number | null;
86
+ personId: number | null;
87
+ personName: string | null;
88
+ personAvatarId: number | null;
82
89
  code: string;
83
90
  collaboratorType: string;
84
91
  displayName: string;
92
+ departmentId: number | null;
85
93
  department: string | null;
86
94
  title: string | null;
87
95
  levelLabel: string | null;
@@ -126,10 +134,14 @@ export declare class OperationsController {
126
134
  };
127
135
  scheduleAdjustmentRequests: Record<string, unknown>[];
128
136
  id: number;
129
- userId: number;
137
+ userId: number | null;
138
+ personId: number | null;
139
+ personName: string | null;
140
+ personAvatarId: number | null;
130
141
  code: string;
131
142
  collaboratorType: string;
132
143
  displayName: string;
144
+ departmentId: number | null;
133
145
  department: string | null;
134
146
  title: string | null;
135
147
  levelLabel: string | null;
@@ -160,10 +172,14 @@ export declare class OperationsController {
160
172
  };
161
173
  scheduleAdjustmentRequests: Record<string, unknown>[];
162
174
  id: number;
163
- userId: number;
175
+ userId: number | null;
176
+ personId: number | null;
177
+ personName: string | null;
178
+ personAvatarId: number | null;
164
179
  code: string;
165
180
  collaboratorType: string;
166
181
  displayName: string;
182
+ departmentId: number | null;
167
183
  department: string | null;
168
184
  title: string | null;
169
185
  levelLabel: string | null;
@@ -178,6 +194,29 @@ export declare class OperationsController {
178
194
  contractStatus: string | null;
179
195
  activeAssignments: number;
180
196
  }>;
197
+ listDepartments(user: any): Promise<Record<string, unknown>[]>;
198
+ createDepartment(user: any, data: any): Promise<{
199
+ id: number;
200
+ slug: string;
201
+ code: string | null;
202
+ name: string;
203
+ description: string | null;
204
+ createdAt: string | null;
205
+ updatedAt: string | null;
206
+ deletedAt: string | null;
207
+ status: "active" | "inactive";
208
+ }>;
209
+ updateDepartment(user: any, id: number, data: any): Promise<{
210
+ id: number;
211
+ slug: string;
212
+ code: string | null;
213
+ name: string;
214
+ description: string | null;
215
+ createdAt: string | null;
216
+ updatedAt: string | null;
217
+ deletedAt: string | null;
218
+ status: "active" | "inactive";
219
+ }>;
181
220
  listProjects(user: any): Promise<Record<string, unknown>[]>;
182
221
  getProject(user: any, id: number): Promise<{
183
222
  assignments: {
@@ -317,39 +356,682 @@ export declare class OperationsController {
317
356
  myRoleLabel: string | null;
318
357
  teamSize: number;
319
358
  }>;
359
+ listContractTemplates(user: any): Promise<Record<string, unknown>[]>;
360
+ getContractTemplate(user: any, id: number): Promise<{
361
+ id: number;
362
+ slug: string;
363
+ code: string | null;
364
+ name: string;
365
+ description: string | null;
366
+ contractCategory: string | null;
367
+ contractType: string | null;
368
+ billingModel: string | null;
369
+ signatureStatus: string | null;
370
+ isActive: boolean;
371
+ status: string | null;
372
+ contentHtml: string | null;
373
+ usageCount: number;
374
+ createdAt: Date;
375
+ updatedAt: Date;
376
+ }>;
377
+ createContractTemplate(user: any, data: any): Promise<{
378
+ id: number;
379
+ slug: string;
380
+ code: string | null;
381
+ name: string;
382
+ description: string | null;
383
+ contractCategory: string | null;
384
+ contractType: string | null;
385
+ billingModel: string | null;
386
+ signatureStatus: string | null;
387
+ isActive: boolean;
388
+ status: string | null;
389
+ contentHtml: string | null;
390
+ usageCount: number;
391
+ createdAt: Date;
392
+ updatedAt: Date;
393
+ }>;
394
+ updateContractTemplate(user: any, id: number, data: any): Promise<{
395
+ id: number;
396
+ slug: string;
397
+ code: string | null;
398
+ name: string;
399
+ description: string | null;
400
+ contractCategory: string | null;
401
+ contractType: string | null;
402
+ billingModel: string | null;
403
+ signatureStatus: string | null;
404
+ isActive: boolean;
405
+ status: string | null;
406
+ contentHtml: string | null;
407
+ usageCount: number;
408
+ createdAt: Date;
409
+ updatedAt: Date;
410
+ }>;
320
411
  listContracts(user: any): Promise<Record<string, unknown>[]>;
321
412
  getContract(user: any, id: number): Promise<{
322
- mainRelatedPartyName: unknown;
323
- projects: Record<string, unknown>[];
324
- scheduleSummary: any[];
325
- parties: Record<string, unknown>[];
326
- signatures: Record<string, unknown>[];
327
- financialTerms: Record<string, unknown>[];
328
- documents: Record<string, unknown>[];
329
- revisions: Record<string, unknown>[];
330
- history: Record<string, unknown>[];
413
+ id: number;
414
+ code: string;
415
+ name: string | null;
416
+ contractCategory: "other" | "client" | "internal" | "employee" | "contractor" | "supplier" | "vendor" | "partner";
417
+ contractType: "other" | "clt" | "pj" | "freelancer_agreement" | "service_agreement" | "fixed_term" | "recurring_service" | "nda" | "amendment" | "addendum";
418
+ clientName: string | null;
419
+ signatureStatus: "pending" | "expired" | "not_started" | "partially_signed" | "signed";
420
+ isActive: boolean;
421
+ billingModel: "time_and_material" | "monthly_retainer" | "fixed_price";
422
+ accountManagerCollaboratorId: number | null;
423
+ relatedCollaboratorId: number | null;
424
+ contractTemplateId: number | null;
425
+ contractTemplateName: string | null;
426
+ contractTemplateSlug: string | null;
427
+ contractTemplateCode: string | null;
428
+ originType: "manual" | "employee_hiring" | "client_project" | "crm_proposal";
429
+ originId: number | null;
430
+ startDate: string | null;
431
+ endDate: string | null;
432
+ signedAt: string | null;
433
+ effectiveDate: string | null;
434
+ budgetAmount: number | null;
435
+ monthlyHourCap: number | null;
436
+ status: "active" | "draft" | "expired" | "archived" | "closed" | "under_review" | "renewal";
437
+ creationMode: ("blank" | "template" | "upload" | "duplicate") | null;
438
+ wizardStep: number | null;
439
+ description: string | null;
440
+ contentHtml: string | null;
441
+ accountManagerName: string | null;
442
+ relatedCollaboratorName: string | null;
443
+ } & {
444
+ mainRelatedPartyName: string | null;
445
+ projects: {
446
+ id: number;
447
+ code: string;
448
+ name: string;
449
+ status: string;
450
+ }[];
451
+ scheduleSummary: {
452
+ weekday: string;
453
+ isWorkingDay: boolean;
454
+ startTime: string | null;
455
+ endTime: string | null;
456
+ breakMinutes: number | null;
457
+ }[];
458
+ parties: NonNullable<{
459
+ partyRole?: "employee" | "employer" | "client" | "supplier" | "vendor" | "partner" | "witness" | "internal_owner" | "other";
460
+ partyType?: "individual" | "company" | "internal_team" | "other";
461
+ displayName: string;
462
+ documentNumber?: string | null;
463
+ email?: string | null;
464
+ phone?: string | null;
465
+ isPrimary?: boolean;
466
+ }[]>;
467
+ signatures: NonNullable<{
468
+ signerName: string;
469
+ signerRole?: string | null;
470
+ signerEmail?: string | null;
471
+ status?: "pending" | "signed" | "rejected";
472
+ signedAt?: string | null;
473
+ }[]>;
474
+ financialTerms: NonNullable<{
475
+ termType?: "value" | "payment" | "revenue" | "fine" | "other";
476
+ label: string;
477
+ amount: number;
478
+ recurrence?: "one_time" | "monthly" | "quarterly" | "yearly" | "other";
479
+ dueDay?: number | null;
480
+ notes?: string | null;
481
+ }[]>;
482
+ documents: {
483
+ id: number;
484
+ documentType: "other" | "source_upload" | "generated_pdf" | "attachment";
485
+ fileId: number | null;
486
+ fileName: string;
487
+ mimeType: string;
488
+ fileContentBase64: string | null;
489
+ isCurrent: boolean;
490
+ extractionStatus: ("pending" | "processing" | "failed" | "completed" | "skipped") | null;
491
+ extractionSummary: string | null;
492
+ notes: string | null;
493
+ createdAt: string;
494
+ }[];
495
+ revisions: NonNullable<{
496
+ revisionType?: "amendment" | "renewal" | "revision" | "addendum" | "other";
497
+ title: string;
498
+ effectiveDate?: string | null;
499
+ status?: "draft" | "active" | "completed" | "cancelled";
500
+ summary?: string | null;
501
+ }[]>;
502
+ history: {
503
+ id: number;
504
+ actorUserId: number | null;
505
+ action: string;
506
+ note: string | null;
507
+ metadataJson: string | null;
508
+ createdAt: string;
509
+ }[];
510
+ }>;
511
+ createContractDraft(user: any, data: any): Promise<{
512
+ id: number;
513
+ code: string;
514
+ name: string | null;
515
+ contractCategory: "other" | "client" | "internal" | "employee" | "contractor" | "supplier" | "vendor" | "partner";
516
+ contractType: "other" | "clt" | "pj" | "freelancer_agreement" | "service_agreement" | "fixed_term" | "recurring_service" | "nda" | "amendment" | "addendum";
517
+ clientName: string | null;
518
+ signatureStatus: "pending" | "expired" | "not_started" | "partially_signed" | "signed";
519
+ isActive: boolean;
520
+ billingModel: "time_and_material" | "monthly_retainer" | "fixed_price";
521
+ accountManagerCollaboratorId: number | null;
522
+ relatedCollaboratorId: number | null;
523
+ contractTemplateId: number | null;
524
+ contractTemplateName: string | null;
525
+ contractTemplateSlug: string | null;
526
+ contractTemplateCode: string | null;
527
+ originType: "manual" | "employee_hiring" | "client_project" | "crm_proposal";
528
+ originId: number | null;
529
+ startDate: string | null;
530
+ endDate: string | null;
531
+ signedAt: string | null;
532
+ effectiveDate: string | null;
533
+ budgetAmount: number | null;
534
+ monthlyHourCap: number | null;
535
+ status: "active" | "draft" | "expired" | "archived" | "closed" | "under_review" | "renewal";
536
+ creationMode: ("blank" | "template" | "upload" | "duplicate") | null;
537
+ wizardStep: number | null;
538
+ description: string | null;
539
+ contentHtml: string | null;
540
+ accountManagerName: string | null;
541
+ relatedCollaboratorName: string | null;
542
+ } & {
543
+ mainRelatedPartyName: string | null;
544
+ projects: {
545
+ id: number;
546
+ code: string;
547
+ name: string;
548
+ status: string;
549
+ }[];
550
+ scheduleSummary: {
551
+ weekday: string;
552
+ isWorkingDay: boolean;
553
+ startTime: string | null;
554
+ endTime: string | null;
555
+ breakMinutes: number | null;
556
+ }[];
557
+ parties: NonNullable<{
558
+ partyRole?: "employee" | "employer" | "client" | "supplier" | "vendor" | "partner" | "witness" | "internal_owner" | "other";
559
+ partyType?: "individual" | "company" | "internal_team" | "other";
560
+ displayName: string;
561
+ documentNumber?: string | null;
562
+ email?: string | null;
563
+ phone?: string | null;
564
+ isPrimary?: boolean;
565
+ }[]>;
566
+ signatures: NonNullable<{
567
+ signerName: string;
568
+ signerRole?: string | null;
569
+ signerEmail?: string | null;
570
+ status?: "pending" | "signed" | "rejected";
571
+ signedAt?: string | null;
572
+ }[]>;
573
+ financialTerms: NonNullable<{
574
+ termType?: "value" | "payment" | "revenue" | "fine" | "other";
575
+ label: string;
576
+ amount: number;
577
+ recurrence?: "one_time" | "monthly" | "quarterly" | "yearly" | "other";
578
+ dueDay?: number | null;
579
+ notes?: string | null;
580
+ }[]>;
581
+ documents: {
582
+ id: number;
583
+ documentType: "other" | "source_upload" | "generated_pdf" | "attachment";
584
+ fileId: number | null;
585
+ fileName: string;
586
+ mimeType: string;
587
+ fileContentBase64: string | null;
588
+ isCurrent: boolean;
589
+ extractionStatus: ("pending" | "processing" | "failed" | "completed" | "skipped") | null;
590
+ extractionSummary: string | null;
591
+ notes: string | null;
592
+ createdAt: string;
593
+ }[];
594
+ revisions: NonNullable<{
595
+ revisionType?: "amendment" | "renewal" | "revision" | "addendum" | "other";
596
+ title: string;
597
+ effectiveDate?: string | null;
598
+ status?: "draft" | "active" | "completed" | "cancelled";
599
+ summary?: string | null;
600
+ }[]>;
601
+ history: {
602
+ id: number;
603
+ actorUserId: number | null;
604
+ action: string;
605
+ note: string | null;
606
+ metadataJson: string | null;
607
+ createdAt: string;
608
+ }[];
331
609
  }>;
332
610
  createContract(user: any, data: any): Promise<{
333
- mainRelatedPartyName: unknown;
334
- projects: Record<string, unknown>[];
335
- scheduleSummary: any[];
336
- parties: Record<string, unknown>[];
337
- signatures: Record<string, unknown>[];
338
- financialTerms: Record<string, unknown>[];
339
- documents: Record<string, unknown>[];
340
- revisions: Record<string, unknown>[];
341
- history: Record<string, unknown>[];
611
+ id: number;
612
+ code: string;
613
+ name: string | null;
614
+ contractCategory: "other" | "client" | "internal" | "employee" | "contractor" | "supplier" | "vendor" | "partner";
615
+ contractType: "other" | "clt" | "pj" | "freelancer_agreement" | "service_agreement" | "fixed_term" | "recurring_service" | "nda" | "amendment" | "addendum";
616
+ clientName: string | null;
617
+ signatureStatus: "pending" | "expired" | "not_started" | "partially_signed" | "signed";
618
+ isActive: boolean;
619
+ billingModel: "time_and_material" | "monthly_retainer" | "fixed_price";
620
+ accountManagerCollaboratorId: number | null;
621
+ relatedCollaboratorId: number | null;
622
+ contractTemplateId: number | null;
623
+ contractTemplateName: string | null;
624
+ contractTemplateSlug: string | null;
625
+ contractTemplateCode: string | null;
626
+ originType: "manual" | "employee_hiring" | "client_project" | "crm_proposal";
627
+ originId: number | null;
628
+ startDate: string | null;
629
+ endDate: string | null;
630
+ signedAt: string | null;
631
+ effectiveDate: string | null;
632
+ budgetAmount: number | null;
633
+ monthlyHourCap: number | null;
634
+ status: "active" | "draft" | "expired" | "archived" | "closed" | "under_review" | "renewal";
635
+ creationMode: ("blank" | "template" | "upload" | "duplicate") | null;
636
+ wizardStep: number | null;
637
+ description: string | null;
638
+ contentHtml: string | null;
639
+ accountManagerName: string | null;
640
+ relatedCollaboratorName: string | null;
641
+ } & {
642
+ mainRelatedPartyName: string | null;
643
+ projects: {
644
+ id: number;
645
+ code: string;
646
+ name: string;
647
+ status: string;
648
+ }[];
649
+ scheduleSummary: {
650
+ weekday: string;
651
+ isWorkingDay: boolean;
652
+ startTime: string | null;
653
+ endTime: string | null;
654
+ breakMinutes: number | null;
655
+ }[];
656
+ parties: NonNullable<{
657
+ partyRole?: "employee" | "employer" | "client" | "supplier" | "vendor" | "partner" | "witness" | "internal_owner" | "other";
658
+ partyType?: "individual" | "company" | "internal_team" | "other";
659
+ displayName: string;
660
+ documentNumber?: string | null;
661
+ email?: string | null;
662
+ phone?: string | null;
663
+ isPrimary?: boolean;
664
+ }[]>;
665
+ signatures: NonNullable<{
666
+ signerName: string;
667
+ signerRole?: string | null;
668
+ signerEmail?: string | null;
669
+ status?: "pending" | "signed" | "rejected";
670
+ signedAt?: string | null;
671
+ }[]>;
672
+ financialTerms: NonNullable<{
673
+ termType?: "value" | "payment" | "revenue" | "fine" | "other";
674
+ label: string;
675
+ amount: number;
676
+ recurrence?: "one_time" | "monthly" | "quarterly" | "yearly" | "other";
677
+ dueDay?: number | null;
678
+ notes?: string | null;
679
+ }[]>;
680
+ documents: {
681
+ id: number;
682
+ documentType: "other" | "source_upload" | "generated_pdf" | "attachment";
683
+ fileId: number | null;
684
+ fileName: string;
685
+ mimeType: string;
686
+ fileContentBase64: string | null;
687
+ isCurrent: boolean;
688
+ extractionStatus: ("pending" | "processing" | "failed" | "completed" | "skipped") | null;
689
+ extractionSummary: string | null;
690
+ notes: string | null;
691
+ createdAt: string;
692
+ }[];
693
+ revisions: NonNullable<{
694
+ revisionType?: "amendment" | "renewal" | "revision" | "addendum" | "other";
695
+ title: string;
696
+ effectiveDate?: string | null;
697
+ status?: "draft" | "active" | "completed" | "cancelled";
698
+ summary?: string | null;
699
+ }[]>;
700
+ history: {
701
+ id: number;
702
+ actorUserId: number | null;
703
+ action: string;
704
+ note: string | null;
705
+ metadataJson: string | null;
706
+ createdAt: string;
707
+ }[];
708
+ }>;
709
+ extractContractDraft(user: any, data: any): Promise<{
710
+ warnings: string[];
711
+ summary: string;
712
+ missingFields: string[];
713
+ code: string;
714
+ name: string;
715
+ clientName: string;
716
+ contractCategory: "other" | "client" | "internal" | "employee" | "contractor" | "supplier" | "vendor" | "partner";
717
+ contractType: "other" | "clt" | "pj" | "freelancer_agreement" | "service_agreement" | "fixed_term" | "recurring_service" | "nda" | "amendment" | "addendum";
718
+ signatureStatus: "pending" | "expired" | "not_started" | "partially_signed" | "signed";
719
+ isActive: boolean;
720
+ billingModel: "time_and_material" | "monthly_retainer" | "fixed_price";
721
+ originType: "manual" | "employee_hiring" | "client_project" | "crm_proposal";
722
+ originId: string;
723
+ startDate: string;
724
+ endDate: string;
725
+ signedAt: string;
726
+ effectiveDate: string;
727
+ budgetAmount: string | number;
728
+ monthlyHourCap: string | number;
729
+ status: "active" | "draft" | "expired" | "archived" | "closed" | "under_review" | "renewal";
730
+ description: string;
731
+ contentHtml: string;
732
+ parties: {
733
+ displayName: string;
734
+ partyRole: "other" | "client" | "employee" | "supplier" | "vendor" | "partner" | "employer" | "witness" | "internal_owner";
735
+ partyType: "other" | "individual" | "company" | "internal_team";
736
+ documentNumber: string;
737
+ email: string;
738
+ phone: string;
739
+ isPrimary: boolean;
740
+ }[];
741
+ signatures: {
742
+ signerName: string;
743
+ signerRole: string;
744
+ signerEmail: string;
745
+ status: "rejected" | "pending" | "signed";
746
+ signedAt: string;
747
+ }[];
748
+ financialTerms: {
749
+ label: string;
750
+ termType: "value" | "other" | "revenue" | "payment" | "fine";
751
+ amount: string | number;
752
+ recurrence: "other" | "one_time" | "monthly" | "quarterly" | "yearly";
753
+ dueDay: string | number;
754
+ notes: string;
755
+ }[];
756
+ revisions: {
757
+ title: string;
758
+ revisionType: "other" | "amendment" | "addendum" | "renewal" | "revision";
759
+ effectiveDate: string;
760
+ status: "active" | "draft" | "completed" | "cancelled";
761
+ summary: string;
762
+ }[];
763
+ }>;
764
+ extractContractSource(user: any, id: number, data: any): Promise<{
765
+ warnings: string[];
766
+ summary: string;
767
+ missingFields: string[];
768
+ code: string;
769
+ name: string;
770
+ clientName: string;
771
+ contractCategory: "other" | "client" | "internal" | "employee" | "contractor" | "supplier" | "vendor" | "partner";
772
+ contractType: "other" | "clt" | "pj" | "freelancer_agreement" | "service_agreement" | "fixed_term" | "recurring_service" | "nda" | "amendment" | "addendum";
773
+ signatureStatus: "pending" | "expired" | "not_started" | "partially_signed" | "signed";
774
+ isActive: boolean;
775
+ billingModel: "time_and_material" | "monthly_retainer" | "fixed_price";
776
+ originType: "manual" | "employee_hiring" | "client_project" | "crm_proposal";
777
+ originId: string;
778
+ startDate: string;
779
+ endDate: string;
780
+ signedAt: string;
781
+ effectiveDate: string;
782
+ budgetAmount: string | number;
783
+ monthlyHourCap: string | number;
784
+ status: "active" | "draft" | "expired" | "archived" | "closed" | "under_review" | "renewal";
785
+ description: string;
786
+ contentHtml: string;
787
+ parties: {
788
+ displayName: string;
789
+ partyRole: "other" | "client" | "employee" | "supplier" | "vendor" | "partner" | "employer" | "witness" | "internal_owner";
790
+ partyType: "other" | "individual" | "company" | "internal_team";
791
+ documentNumber: string;
792
+ email: string;
793
+ phone: string;
794
+ isPrimary: boolean;
795
+ }[];
796
+ signatures: {
797
+ signerName: string;
798
+ signerRole: string;
799
+ signerEmail: string;
800
+ status: "rejected" | "pending" | "signed";
801
+ signedAt: string;
802
+ }[];
803
+ financialTerms: {
804
+ label: string;
805
+ termType: "value" | "other" | "revenue" | "payment" | "fine";
806
+ amount: string | number;
807
+ recurrence: "other" | "one_time" | "monthly" | "quarterly" | "yearly";
808
+ dueDay: string | number;
809
+ notes: string;
810
+ }[];
811
+ revisions: {
812
+ title: string;
813
+ revisionType: "other" | "amendment" | "addendum" | "renewal" | "revision";
814
+ effectiveDate: string;
815
+ status: "active" | "draft" | "completed" | "cancelled";
816
+ summary: string;
817
+ }[];
818
+ }>;
819
+ generateContractContent(user: any, id: number, data: any): Promise<{
820
+ id: number;
821
+ code: string;
822
+ name: string | null;
823
+ contractCategory: "other" | "client" | "internal" | "employee" | "contractor" | "supplier" | "vendor" | "partner";
824
+ contractType: "other" | "clt" | "pj" | "freelancer_agreement" | "service_agreement" | "fixed_term" | "recurring_service" | "nda" | "amendment" | "addendum";
825
+ clientName: string | null;
826
+ signatureStatus: "pending" | "expired" | "not_started" | "partially_signed" | "signed";
827
+ isActive: boolean;
828
+ billingModel: "time_and_material" | "monthly_retainer" | "fixed_price";
829
+ accountManagerCollaboratorId: number | null;
830
+ relatedCollaboratorId: number | null;
831
+ contractTemplateId: number | null;
832
+ contractTemplateName: string | null;
833
+ contractTemplateSlug: string | null;
834
+ contractTemplateCode: string | null;
835
+ originType: "manual" | "employee_hiring" | "client_project" | "crm_proposal";
836
+ originId: number | null;
837
+ startDate: string | null;
838
+ endDate: string | null;
839
+ signedAt: string | null;
840
+ effectiveDate: string | null;
841
+ budgetAmount: number | null;
842
+ monthlyHourCap: number | null;
843
+ status: "active" | "draft" | "expired" | "archived" | "closed" | "under_review" | "renewal";
844
+ creationMode: ("blank" | "template" | "upload" | "duplicate") | null;
845
+ wizardStep: number | null;
846
+ description: string | null;
847
+ contentHtml: string | null;
848
+ accountManagerName: string | null;
849
+ relatedCollaboratorName: string | null;
850
+ } & {
851
+ mainRelatedPartyName: string | null;
852
+ projects: {
853
+ id: number;
854
+ code: string;
855
+ name: string;
856
+ status: string;
857
+ }[];
858
+ scheduleSummary: {
859
+ weekday: string;
860
+ isWorkingDay: boolean;
861
+ startTime: string | null;
862
+ endTime: string | null;
863
+ breakMinutes: number | null;
864
+ }[];
865
+ parties: NonNullable<{
866
+ partyRole?: "employee" | "employer" | "client" | "supplier" | "vendor" | "partner" | "witness" | "internal_owner" | "other";
867
+ partyType?: "individual" | "company" | "internal_team" | "other";
868
+ displayName: string;
869
+ documentNumber?: string | null;
870
+ email?: string | null;
871
+ phone?: string | null;
872
+ isPrimary?: boolean;
873
+ }[]>;
874
+ signatures: NonNullable<{
875
+ signerName: string;
876
+ signerRole?: string | null;
877
+ signerEmail?: string | null;
878
+ status?: "pending" | "signed" | "rejected";
879
+ signedAt?: string | null;
880
+ }[]>;
881
+ financialTerms: NonNullable<{
882
+ termType?: "value" | "payment" | "revenue" | "fine" | "other";
883
+ label: string;
884
+ amount: number;
885
+ recurrence?: "one_time" | "monthly" | "quarterly" | "yearly" | "other";
886
+ dueDay?: number | null;
887
+ notes?: string | null;
888
+ }[]>;
889
+ documents: {
890
+ id: number;
891
+ documentType: "other" | "source_upload" | "generated_pdf" | "attachment";
892
+ fileId: number | null;
893
+ fileName: string;
894
+ mimeType: string;
895
+ fileContentBase64: string | null;
896
+ isCurrent: boolean;
897
+ extractionStatus: ("pending" | "processing" | "failed" | "completed" | "skipped") | null;
898
+ extractionSummary: string | null;
899
+ notes: string | null;
900
+ createdAt: string;
901
+ }[];
902
+ revisions: NonNullable<{
903
+ revisionType?: "amendment" | "renewal" | "revision" | "addendum" | "other";
904
+ title: string;
905
+ effectiveDate?: string | null;
906
+ status?: "draft" | "active" | "completed" | "cancelled";
907
+ summary?: string | null;
908
+ }[]>;
909
+ history: {
910
+ id: number;
911
+ actorUserId: number | null;
912
+ action: string;
913
+ note: string | null;
914
+ metadataJson: string | null;
915
+ createdAt: string;
916
+ }[];
917
+ }>;
918
+ reviewContractLegally(user: any, id: number, data: any): Promise<{
919
+ summary: string;
920
+ missingFields: string[];
921
+ warnings: string[];
922
+ checklist: string[];
923
+ status: "ready_for_revision" | "attention_required";
924
+ reviewedAt: string;
342
925
  }>;
343
926
  updateContract(user: any, id: number, data: any): Promise<{
344
- mainRelatedPartyName: unknown;
345
- projects: Record<string, unknown>[];
346
- scheduleSummary: any[];
347
- parties: Record<string, unknown>[];
348
- signatures: Record<string, unknown>[];
349
- financialTerms: Record<string, unknown>[];
350
- documents: Record<string, unknown>[];
351
- revisions: Record<string, unknown>[];
352
- history: Record<string, unknown>[];
927
+ id: number;
928
+ code: string;
929
+ name: string | null;
930
+ contractCategory: "other" | "client" | "internal" | "employee" | "contractor" | "supplier" | "vendor" | "partner";
931
+ contractType: "other" | "clt" | "pj" | "freelancer_agreement" | "service_agreement" | "fixed_term" | "recurring_service" | "nda" | "amendment" | "addendum";
932
+ clientName: string | null;
933
+ signatureStatus: "pending" | "expired" | "not_started" | "partially_signed" | "signed";
934
+ isActive: boolean;
935
+ billingModel: "time_and_material" | "monthly_retainer" | "fixed_price";
936
+ accountManagerCollaboratorId: number | null;
937
+ relatedCollaboratorId: number | null;
938
+ contractTemplateId: number | null;
939
+ contractTemplateName: string | null;
940
+ contractTemplateSlug: string | null;
941
+ contractTemplateCode: string | null;
942
+ originType: "manual" | "employee_hiring" | "client_project" | "crm_proposal";
943
+ originId: number | null;
944
+ startDate: string | null;
945
+ endDate: string | null;
946
+ signedAt: string | null;
947
+ effectiveDate: string | null;
948
+ budgetAmount: number | null;
949
+ monthlyHourCap: number | null;
950
+ status: "active" | "draft" | "expired" | "archived" | "closed" | "under_review" | "renewal";
951
+ creationMode: ("blank" | "template" | "upload" | "duplicate") | null;
952
+ wizardStep: number | null;
953
+ description: string | null;
954
+ contentHtml: string | null;
955
+ accountManagerName: string | null;
956
+ relatedCollaboratorName: string | null;
957
+ } & {
958
+ mainRelatedPartyName: string | null;
959
+ projects: {
960
+ id: number;
961
+ code: string;
962
+ name: string;
963
+ status: string;
964
+ }[];
965
+ scheduleSummary: {
966
+ weekday: string;
967
+ isWorkingDay: boolean;
968
+ startTime: string | null;
969
+ endTime: string | null;
970
+ breakMinutes: number | null;
971
+ }[];
972
+ parties: NonNullable<{
973
+ partyRole?: "employee" | "employer" | "client" | "supplier" | "vendor" | "partner" | "witness" | "internal_owner" | "other";
974
+ partyType?: "individual" | "company" | "internal_team" | "other";
975
+ displayName: string;
976
+ documentNumber?: string | null;
977
+ email?: string | null;
978
+ phone?: string | null;
979
+ isPrimary?: boolean;
980
+ }[]>;
981
+ signatures: NonNullable<{
982
+ signerName: string;
983
+ signerRole?: string | null;
984
+ signerEmail?: string | null;
985
+ status?: "pending" | "signed" | "rejected";
986
+ signedAt?: string | null;
987
+ }[]>;
988
+ financialTerms: NonNullable<{
989
+ termType?: "value" | "payment" | "revenue" | "fine" | "other";
990
+ label: string;
991
+ amount: number;
992
+ recurrence?: "one_time" | "monthly" | "quarterly" | "yearly" | "other";
993
+ dueDay?: number | null;
994
+ notes?: string | null;
995
+ }[]>;
996
+ documents: {
997
+ id: number;
998
+ documentType: "other" | "source_upload" | "generated_pdf" | "attachment";
999
+ fileId: number | null;
1000
+ fileName: string;
1001
+ mimeType: string;
1002
+ fileContentBase64: string | null;
1003
+ isCurrent: boolean;
1004
+ extractionStatus: ("pending" | "processing" | "failed" | "completed" | "skipped") | null;
1005
+ extractionSummary: string | null;
1006
+ notes: string | null;
1007
+ createdAt: string;
1008
+ }[];
1009
+ revisions: NonNullable<{
1010
+ revisionType?: "amendment" | "renewal" | "revision" | "addendum" | "other";
1011
+ title: string;
1012
+ effectiveDate?: string | null;
1013
+ status?: "draft" | "active" | "completed" | "cancelled";
1014
+ summary?: string | null;
1015
+ }[]>;
1016
+ history: {
1017
+ id: number;
1018
+ actorUserId: number | null;
1019
+ action: string;
1020
+ note: string | null;
1021
+ metadataJson: string | null;
1022
+ createdAt: string;
1023
+ }[];
1024
+ }>;
1025
+ removeContract(user: any, id: number): Promise<{
1026
+ success: boolean;
1027
+ }>;
1028
+ generateContractPdf(user: any, id: number): Promise<{
1029
+ contractId: number;
1030
+ fileId: number;
1031
+ fileName: string;
1032
+ mimeType: string;
1033
+ documentType: string;
1034
+ downloadUrl: string;
353
1035
  }>;
354
1036
  listTimesheets(user: any): Promise<{
355
1037
  id: number;