hvp-shared 3.2.0 → 3.2.1

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.
@@ -3,3 +3,4 @@
3
3
  * Request and Response types for Collaborator endpoints
4
4
  */
5
5
  export * from './responses';
6
+ export * from './requests';
@@ -19,4 +19,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  __exportStar(require("./responses"), exports);
22
- // export * from './requests'; // TODO: Create when needed
22
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,132 @@
1
+ import { WebAppRole } from '../../constants/collaborator.constants';
2
+ import { AddressValidationProps } from '../../validation/address.validation';
3
+ /**
4
+ * Create Collaborator Request
5
+ *
6
+ * Data required to create a new collaborator.
7
+ * Used by admin/manager roles.
8
+ *
9
+ * @example POST /api/collaborators/create
10
+ */
11
+ export interface CreateCollaboratorRequest {
12
+ first_name: string;
13
+ last_name: string;
14
+ col_code: string;
15
+ role: WebAppRole;
16
+ isActive: boolean;
17
+ isDisplayedWeb: boolean;
18
+ isRegistered: boolean;
19
+ second_last_name?: string;
20
+ email?: string;
21
+ phone?: string;
22
+ photoURL?: string;
23
+ birthDate?: string;
24
+ job?: string;
25
+ branch?: string;
26
+ startDate?: string;
27
+ hireDate?: string;
28
+ endDate?: string;
29
+ address?: AddressValidationProps;
30
+ facebook?: string;
31
+ instagram?: string;
32
+ rfcCode?: string;
33
+ curp?: string;
34
+ imssNumber?: string;
35
+ useFiscalAddressSameAsMain?: boolean;
36
+ fiscalAddress?: AddressValidationProps;
37
+ taxZipCode?: string;
38
+ contractType?: string;
39
+ regimeType?: string;
40
+ fiscalRegime?: string;
41
+ bank?: string;
42
+ bankAccount?: string;
43
+ baseSalary?: number;
44
+ dailySalary?: number;
45
+ accessCode?: string;
46
+ password?: string;
47
+ }
48
+ /**
49
+ * Update Collaborator Request
50
+ *
51
+ * Partial data to update an existing collaborator.
52
+ * All fields optional - only provided fields will be updated.
53
+ *
54
+ * @example PATCH /api/collaborators/:id
55
+ */
56
+ export interface UpdateCollaboratorRequest {
57
+ first_name?: string;
58
+ last_name?: string;
59
+ second_last_name?: string;
60
+ email?: string;
61
+ phone?: string;
62
+ photoURL?: string;
63
+ birthDate?: string;
64
+ role?: WebAppRole;
65
+ isActive?: boolean;
66
+ isDisplayedWeb?: boolean;
67
+ isRegistered?: boolean;
68
+ job?: string;
69
+ branch?: string;
70
+ startDate?: string;
71
+ hireDate?: string;
72
+ endDate?: string;
73
+ address?: AddressValidationProps;
74
+ facebook?: string;
75
+ instagram?: string;
76
+ rfcCode?: string;
77
+ curp?: string;
78
+ imssNumber?: string;
79
+ useFiscalAddressSameAsMain?: boolean;
80
+ fiscalAddress?: AddressValidationProps;
81
+ taxZipCode?: string;
82
+ contractType?: string;
83
+ regimeType?: string;
84
+ fiscalRegime?: string;
85
+ bank?: string;
86
+ bankAccount?: string;
87
+ baseSalary?: number;
88
+ dailySalary?: number;
89
+ accessCode?: string;
90
+ password?: string;
91
+ }
92
+ /**
93
+ * Register Collaborator Request
94
+ *
95
+ * Public registration flow for collaborators.
96
+ * Collaborator provides col_code, accessCode, email and password to register.
97
+ *
98
+ * @example PATCH /api/collaborators/register
99
+ */
100
+ export interface RegisterCollaboratorRequest {
101
+ col_code: string;
102
+ accessCode: string;
103
+ email: string;
104
+ password: string;
105
+ }
106
+ /**
107
+ * Update Many Collaborators Request
108
+ *
109
+ * Batch update multiple collaborators.
110
+ * Each item must include id + fields to update.
111
+ *
112
+ * @example PATCH /api/collaborators
113
+ */
114
+ export interface UpdateManyCollaboratorsRequest {
115
+ collaborators: Array<{
116
+ id: string;
117
+ } & Partial<UpdateCollaboratorRequest>>;
118
+ }
119
+ /**
120
+ * Collaborator Query Filters
121
+ *
122
+ * Query parameters for filtering collaborators list.
123
+ *
124
+ * @example GET /api/collaborators?isActive=true&role=Colaborador
125
+ */
126
+ export interface CollaboratorQueryFilters {
127
+ isActive?: boolean;
128
+ role?: WebAppRole;
129
+ branch?: string;
130
+ isRegistered?: boolean;
131
+ isDisplayedWeb?: boolean;
132
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -27,27 +27,22 @@ export interface PublicCollaboratorResponse {
27
27
  *
28
28
  * @example GET /api/collaborators/:id (authenticated collaborator)
29
29
  */
30
- export interface CollaboratorViewResponse {
31
- id: string;
32
- col_code: string;
33
- first_name: string;
34
- last_name: string;
30
+ export interface CollaboratorViewResponse extends PublicCollaboratorResponse {
35
31
  email?: string;
36
32
  phone?: string;
37
- photoURL?: string;
38
- birthDate?: Date;
39
- role: WebAppRole;
40
- isActive: boolean;
33
+ birthDate?: string;
41
34
  isDisplayedWeb: boolean;
42
35
  isRegistered: boolean;
43
36
  job?: string;
44
37
  branch?: string;
45
- hireDate?: Date;
38
+ startDate?: string;
39
+ hireDate?: string;
40
+ endDate?: string;
46
41
  address?: AddressValidationProps;
47
42
  facebook?: string;
48
43
  instagram?: string;
49
- createdAt?: Date;
50
- updatedAt?: Date;
44
+ createdAt?: string;
45
+ updatedAt?: string;
51
46
  }
52
47
  /**
53
48
  * Admin Collaborator Response
@@ -59,28 +54,9 @@ export interface CollaboratorViewResponse {
59
54
  *
60
55
  * @example GET /api/collaborators/:id (admin authenticated)
61
56
  */
62
- export interface AdminCollaboratorResponse {
63
- id: string;
64
- col_code: string;
65
- first_name: string;
66
- last_name: string;
57
+ export interface AdminCollaboratorResponse extends CollaboratorViewResponse {
67
58
  second_last_name?: string;
68
- email?: string;
69
- phone?: string;
70
- photoURL?: string;
71
- birthDate?: Date;
72
- role: WebAppRole;
73
- isActive: boolean;
74
- isDisplayedWeb: boolean;
75
- isRegistered: boolean;
76
- registeredDate?: Date;
77
- job?: string;
78
- branch?: string;
79
- hireDate?: Date;
80
- endDate?: Date;
81
- address?: AddressValidationProps;
82
- facebook?: string;
83
- instagram?: string;
59
+ registeredDate?: string;
84
60
  rfcCode?: string;
85
61
  curp?: string;
86
62
  imssNumber?: string;
@@ -97,8 +73,6 @@ export interface AdminCollaboratorResponse {
97
73
  accessCode?: string;
98
74
  createdBy?: string;
99
75
  updatedBy?: string;
100
- createdAt?: Date;
101
- updatedAt?: Date;
102
76
  }
103
77
  /**
104
78
  * Union type for all collaborator response types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hvp-shared",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "Shared types and utilities for HVP backend and frontend",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",