@t4dhg/mcp-factorial 9.0.0 → 10.1.0
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.
- package/README.md +84 -14
- package/dist/api/attendance.d.ts +37 -13
- package/dist/api/attendance.d.ts.map +1 -1
- package/dist/api/attendance.js +161 -31
- package/dist/api/attendance.js.map +1 -1
- package/dist/api/documents.d.ts +4 -3
- package/dist/api/documents.d.ts.map +1 -1
- package/dist/api/documents.js +4 -3
- package/dist/api/documents.js.map +1 -1
- package/dist/api/employees.d.ts +5 -3
- package/dist/api/employees.d.ts.map +1 -1
- package/dist/api/employees.js +5 -3
- package/dist/api/employees.js.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/time-off.d.ts +6 -1
- package/dist/api/time-off.d.ts.map +1 -1
- package/dist/api/time-off.js +20 -16
- package/dist/api/time-off.js.map +1 -1
- package/dist/attendance/backfill.d.ts +38 -0
- package/dist/attendance/backfill.d.ts.map +1 -0
- package/dist/attendance/backfill.js +109 -0
- package/dist/attendance/backfill.js.map +1 -0
- package/dist/attendance/gate.d.ts +40 -0
- package/dist/attendance/gate.d.ts.map +1 -0
- package/dist/attendance/gate.js +63 -0
- package/dist/attendance/gate.js.map +1 -0
- package/dist/attendance/identity.d.ts +27 -0
- package/dist/attendance/identity.d.ts.map +1 -0
- package/dist/attendance/identity.js +73 -0
- package/dist/attendance/identity.js.map +1 -0
- package/dist/attendance/planner.d.ts +189 -0
- package/dist/attendance/planner.d.ts.map +1 -0
- package/dist/attendance/planner.js +427 -0
- package/dist/attendance/planner.js.map +1 -0
- package/dist/endpoints.d.ts +5 -0
- package/dist/endpoints.d.ts.map +1 -1
- package/dist/endpoints.js +5 -0
- package/dist/endpoints.js.map +1 -1
- package/dist/http-client.d.ts +14 -1
- package/dist/http-client.d.ts.map +1 -1
- package/dist/http-client.js +36 -7
- package/dist/http-client.js.map +1 -1
- package/dist/schemas/ats.d.ts +4 -4
- package/dist/schemas/attendance.d.ts +367 -0
- package/dist/schemas/attendance.d.ts.map +1 -0
- package/dist/schemas/attendance.js +159 -0
- package/dist/schemas/attendance.js.map +1 -0
- package/dist/schemas/documents.d.ts +2 -2
- package/dist/schemas/index.d.ts +2 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +3 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/projects.d.ts +4 -4
- package/dist/schemas/time-off.d.ts +59 -148
- package/dist/schemas/time-off.d.ts.map +1 -1
- package/dist/schemas/time-off.js +22 -53
- package/dist/schemas/time-off.js.map +1 -1
- package/dist/schemas/training.d.ts +2 -2
- package/dist/tools/attendance.d.ts +9 -1
- package/dist/tools/attendance.d.ts.map +1 -1
- package/dist/tools/attendance.js +364 -24
- package/dist/tools/attendance.js.map +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/shared.d.ts +2 -2
- package/dist/tools/shared.d.ts.map +1 -1
- package/dist/tools/shared.js +15 -2
- package/dist/tools/shared.js.map +1 -1
- package/dist/tools/time-off.d.ts.map +1 -1
- package/dist/tools/time-off.js +15 -6
- package/dist/tools/time-off.js.map +1 -1
- package/dist/types.d.ts +28 -13
- package/dist/types.d.ts.map +1 -1
- package/dist/write-safety.d.ts +18 -0
- package/dist/write-safety.d.ts.map +1 -1
- package/dist/write-safety.js +19 -0
- package/dist/write-safety.js.map +1 -1
- package/llms.txt +7 -4
- package/package.json +1 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attendance schemas: Shift, OpenShift, EstimatedTime, WorkedTime, and the
|
|
3
|
+
* write inputs for shifts, clocking and bulk time entry.
|
|
4
|
+
*
|
|
5
|
+
* Response shapes were captured from the live API on version 2026-07-01 on
|
|
6
|
+
* 2026-09-06 with read-only requests. All response schemas are declared with
|
|
7
|
+
* passthrough so a field Factorial adds later does not break parsing.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { dateString, resourceId } from './shared.js';
|
|
11
|
+
/** "HH:MM", 24-hour, company local wall-clock time */
|
|
12
|
+
export const hhmm = z
|
|
13
|
+
.string()
|
|
14
|
+
.regex(/^([01]\d|2[0-3]):[0-5]\d$/, 'Time must be HH:MM in 24-hour company local time');
|
|
15
|
+
/** ISO 8601 date-time with an explicit offset, e.g. 2026-09-05T09:12:00+02:00 */
|
|
16
|
+
export const isoWithOffset = z
|
|
17
|
+
.string()
|
|
18
|
+
.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/, 'Date-time must be ISO 8601 with an explicit offset');
|
|
19
|
+
// Known `source` values: desktop | mobile | face_recognition | qr_code |
|
|
20
|
+
// mobile_geolocation | shared_device | api | system. This server always writes `api`.
|
|
21
|
+
export const LOCATION_TYPES = ['office', 'business_trip', 'work_from_home'];
|
|
22
|
+
export const HALF_DAY_VALUES = ['beggining_of_day', 'end_of_day'];
|
|
23
|
+
/**
|
|
24
|
+
* Shift record as /attendance/shifts returns it. Times are HH:MM strings, not
|
|
25
|
+
* ISO 8601; `date` carries the day. `minutes` is the worked duration.
|
|
26
|
+
*/
|
|
27
|
+
export const ShiftSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
id: resourceId,
|
|
30
|
+
employee_id: resourceId,
|
|
31
|
+
date: z.string(),
|
|
32
|
+
reference_date: z.string().nullable(),
|
|
33
|
+
clock_in: z.string().nullable(),
|
|
34
|
+
clock_out: z.string().nullable(),
|
|
35
|
+
clock_in_with_seconds: z.string().nullable().optional(),
|
|
36
|
+
in_source: z.string().nullable(),
|
|
37
|
+
out_source: z.string().nullable(),
|
|
38
|
+
observations: z.string().nullable(),
|
|
39
|
+
location_type: z.string().nullable(),
|
|
40
|
+
half_day: z.string().nullable(),
|
|
41
|
+
workable: z.boolean().nullable(),
|
|
42
|
+
minutes: z.number().nullable(),
|
|
43
|
+
workplace_id: resourceId.nullable(),
|
|
44
|
+
time_settings_break_configuration_id: resourceId.nullable(),
|
|
45
|
+
company_id: resourceId.nullable().optional(),
|
|
46
|
+
in_location_latitude: z.number().nullable().optional(),
|
|
47
|
+
in_location_longitude: z.number().nullable().optional(),
|
|
48
|
+
in_location_accuracy: z.number().nullable().optional(),
|
|
49
|
+
out_location_latitude: z.number().nullable().optional(),
|
|
50
|
+
out_location_longitude: z.number().nullable().optional(),
|
|
51
|
+
out_location_accuracy: z.number().nullable().optional(),
|
|
52
|
+
created_at: z.string().nullable().optional(),
|
|
53
|
+
updated_at: z.string().nullable().optional(),
|
|
54
|
+
})
|
|
55
|
+
.passthrough();
|
|
56
|
+
/**
|
|
57
|
+
* Currently open shift as /attendance/open_shifts returns it. This is a
|
|
58
|
+
* different object from Shift: clock_in is a date-time on the placeholder
|
|
59
|
+
* date 2000-01-01 and there is a `status` field.
|
|
60
|
+
*/
|
|
61
|
+
export const OpenShiftSchema = z
|
|
62
|
+
.object({
|
|
63
|
+
id: resourceId,
|
|
64
|
+
employee_id: resourceId,
|
|
65
|
+
date: z.string(),
|
|
66
|
+
reference_date: z.string().nullable(),
|
|
67
|
+
clock_in: z.string(),
|
|
68
|
+
clock_out: z.string().nullable(),
|
|
69
|
+
status: z.string(),
|
|
70
|
+
workable: z.boolean().nullable(),
|
|
71
|
+
automatic_clock_in: z.boolean().nullable().optional(),
|
|
72
|
+
location_type: z.string().nullable(),
|
|
73
|
+
workplace_id: resourceId.nullable(),
|
|
74
|
+
time_settings_break_configuration_id: resourceId.nullable(),
|
|
75
|
+
})
|
|
76
|
+
.passthrough();
|
|
77
|
+
/**
|
|
78
|
+
* Expected minutes per day from the weekly contract pattern
|
|
79
|
+
* (/attendance/estimated_times). Knows nothing about bank holidays or leave.
|
|
80
|
+
*/
|
|
81
|
+
export const EstimatedTimeSchema = z
|
|
82
|
+
.object({
|
|
83
|
+
id: z.string(),
|
|
84
|
+
employee_id: resourceId,
|
|
85
|
+
company_id: resourceId.nullable().optional(),
|
|
86
|
+
date: z.string(),
|
|
87
|
+
expected_minutes: z.number(),
|
|
88
|
+
regular_minutes: z.number().nullable().optional(),
|
|
89
|
+
overtime_minutes: z.number().nullable().optional(),
|
|
90
|
+
minutes: z.number().nullable().optional(),
|
|
91
|
+
estimated_half_days: z.number().nullable().optional(),
|
|
92
|
+
source: z.string().nullable().optional(),
|
|
93
|
+
time_unit: z.string().nullable().optional(),
|
|
94
|
+
breaks: z.array(z.unknown()).optional(),
|
|
95
|
+
shifts: z.array(z.unknown()).optional(),
|
|
96
|
+
})
|
|
97
|
+
.passthrough();
|
|
98
|
+
// Known `day_type` values: workday | saturday | sunday | bank_holiday.
|
|
99
|
+
/**
|
|
100
|
+
* Tracked minutes per day plus the day type (/attendance/worked_times). The
|
|
101
|
+
* company's holiday calendar surfaces here as day_type "bank_holiday".
|
|
102
|
+
*/
|
|
103
|
+
export const WorkedTimeSchema = z
|
|
104
|
+
.object({
|
|
105
|
+
id: z.string(),
|
|
106
|
+
employee_id: resourceId,
|
|
107
|
+
company_id: resourceId.nullable().optional(),
|
|
108
|
+
date: z.string(),
|
|
109
|
+
day_type: z.string(),
|
|
110
|
+
tracked_minutes: z.number(),
|
|
111
|
+
multiplied_minutes: z.number().nullable().optional(),
|
|
112
|
+
pending_minutes: z.number().nullable().optional(),
|
|
113
|
+
minutes: z.number().nullable().optional(),
|
|
114
|
+
time_unit: z.string().nullable().optional(),
|
|
115
|
+
worked_time_blocks: z.array(z.unknown()).optional(),
|
|
116
|
+
})
|
|
117
|
+
.passthrough();
|
|
118
|
+
// ============================================================================
|
|
119
|
+
// Write Input Schemas
|
|
120
|
+
// ============================================================================
|
|
121
|
+
/** Either HH:MM (company local) or ISO 8601 with an explicit offset */
|
|
122
|
+
const shiftTime = z.union([hhmm, isoWithOffset]);
|
|
123
|
+
/**
|
|
124
|
+
* Shift create input. `date` is the only field the API requires, but with a
|
|
125
|
+
* company-scoped key a missing employee_id is answered with a misleading 404,
|
|
126
|
+
* so it is required here too.
|
|
127
|
+
*/
|
|
128
|
+
export const CreateShiftInputSchema = z.object({
|
|
129
|
+
employee_id: z.number().int().positive(),
|
|
130
|
+
date: dateString,
|
|
131
|
+
clock_in: shiftTime.optional(),
|
|
132
|
+
clock_out: shiftTime.optional(),
|
|
133
|
+
reference_date: dateString.optional(),
|
|
134
|
+
observations: z.string().max(500).optional(),
|
|
135
|
+
location_type: z.enum(LOCATION_TYPES).optional(),
|
|
136
|
+
workplace_id: z.number().int().positive().optional(),
|
|
137
|
+
half_day: z.enum(HALF_DAY_VALUES).optional(),
|
|
138
|
+
workable: z.boolean().optional(),
|
|
139
|
+
});
|
|
140
|
+
/** Shift update input: any subset of the create fields except the employee */
|
|
141
|
+
export const UpdateShiftInputSchema = CreateShiftInputSchema.partial().omit({ employee_id: true });
|
|
142
|
+
/** Clock in / clock out input; `now` is supplied by the server */
|
|
143
|
+
export const ClockInputSchema = z.object({
|
|
144
|
+
employee_id: z.number().int().positive(),
|
|
145
|
+
location_type: z.enum(LOCATION_TYPES).optional(),
|
|
146
|
+
workplace_id: z.number().int().positive().optional(),
|
|
147
|
+
observations: z.string().max(500).optional(),
|
|
148
|
+
});
|
|
149
|
+
/** One working segment of a day for the bulk actions; HH:MM only */
|
|
150
|
+
export const SegmentInputSchema = z.object({
|
|
151
|
+
clock_in: hhmm,
|
|
152
|
+
clock_out: hhmm,
|
|
153
|
+
});
|
|
154
|
+
/** One explicit day for log_days */
|
|
155
|
+
export const DayInputSchema = z.object({
|
|
156
|
+
date: dateString,
|
|
157
|
+
segments: z.array(SegmentInputSchema).min(1),
|
|
158
|
+
});
|
|
159
|
+
//# sourceMappingURL=attendance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attendance.js","sourceRoot":"","sources":["../../src/schemas/attendance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC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,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAIH,oEAAoE;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAIH,oCAAoC;AACpC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7C,CAAC,CAAC"}
|
|
@@ -80,7 +80,7 @@ export declare const DocumentSchema: z.ZodObject<{
|
|
|
80
80
|
is_company_document?: boolean | undefined;
|
|
81
81
|
is_management_document?: boolean | undefined;
|
|
82
82
|
is_pending_assignment?: boolean | undefined;
|
|
83
|
-
signature_status?: "pending" | "
|
|
83
|
+
signature_status?: "pending" | "partially_signed" | "declined" | "completed" | "bounced_email" | "cancelled" | "error" | "expired" | null | undefined;
|
|
84
84
|
signees?: string[] | undefined;
|
|
85
85
|
}, {
|
|
86
86
|
id: string;
|
|
@@ -101,7 +101,7 @@ export declare const DocumentSchema: z.ZodObject<{
|
|
|
101
101
|
is_company_document?: boolean | undefined;
|
|
102
102
|
is_management_document?: boolean | undefined;
|
|
103
103
|
is_pending_assignment?: boolean | undefined;
|
|
104
|
-
signature_status?: "pending" | "
|
|
104
|
+
signature_status?: "pending" | "partially_signed" | "declined" | "completed" | "bounced_email" | "cancelled" | "error" | "expired" | null | undefined;
|
|
105
105
|
signees?: string[] | undefined;
|
|
106
106
|
}>;
|
|
107
107
|
export type Document = z.infer<typeof DocumentSchema>;
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export { resourceId, dateString, createApiResponseSchema, createApiListResponseSchema, parseData, safeParseData, parseArray, } from './shared.js';
|
|
9
9
|
export { EmployeeSchema, type Employee, TeamSchema, type Team, LocationSchema, type Location, ContractSchema, type Contract, ContractSummarySchema, type ContractSummary, CreateEmployeeInputSchema, type CreateEmployeeInput, UpdateEmployeeInputSchema, type UpdateEmployeeInput, TerminateEmployeeInputSchema, type TerminateEmployeeInput, CreateTeamInputSchema, type CreateTeamInput, UpdateTeamInputSchema, type UpdateTeamInput, CreateLocationInputSchema, type CreateLocationInput, UpdateLocationInputSchema, type UpdateLocationInput, } from './employees.js';
|
|
10
|
-
export { LeaveSchema, type Leave, LeaveTypeSchema, type LeaveType, AllowanceSchema, type Allowance,
|
|
10
|
+
export { LeaveSchema, type Leave, LeaveTypeSchema, type LeaveType, AllowanceSchema, type Allowance, CreateLeaveInputSchema, type CreateLeaveInput, UpdateLeaveInputSchema, type UpdateLeaveInput, LeaveDecisionInputSchema, type LeaveDecisionInput, } from './time-off.js';
|
|
11
|
+
export { ShiftSchema, type Shift, OpenShiftSchema, type OpenShift, EstimatedTimeSchema, type EstimatedTime, WorkedTimeSchema, type WorkedTime, CreateShiftInputSchema, type CreateShiftInput, UpdateShiftInputSchema, type UpdateShiftInput, ClockInputSchema, type ClockInput, SegmentInputSchema, type SegmentInput, DayInputSchema, type DayInput, hhmm, isoWithOffset, LOCATION_TYPES, HALF_DAY_VALUES, } from './attendance.js';
|
|
11
12
|
export { FolderSchema, type Folder, DocumentSchema, type Document } from './documents.js';
|
|
12
13
|
export { JobRoleSchema, type JobRole, JobLevelSchema, type JobLevel } from './job-catalog.js';
|
|
13
14
|
export { ProjectSchema, type Project, CreateProjectInputSchema, type CreateProjectInput, UpdateProjectInputSchema, type UpdateProjectInput, ProjectTaskSchema, type ProjectTask, CreateProjectTaskInputSchema, type CreateProjectTaskInput, UpdateProjectTaskInputSchema, type UpdateProjectTaskInput, ProjectWorkerSchema, type ProjectWorker, AssignProjectWorkerInputSchema, type AssignProjectWorkerInput, TimeRecordSchema, type TimeRecord, CreateTimeRecordInputSchema, type CreateTimeRecordInput, UpdateTimeRecordInputSchema, type UpdateTimeRecordInput, } from './projects.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,SAAS,EACT,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,cAAc,EACd,KAAK,QAAQ,EACb,UAAU,EACV,KAAK,IAAI,EACT,cAAc,EACd,KAAK,QAAQ,EACb,cAAc,EACd,KAAK,QAAQ,EACb,qBAAqB,EACrB,KAAK,eAAe,EACpB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,qBAAqB,EACrB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,eAAe,EACpB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,WAAW,EACX,KAAK,KAAK,EACV,eAAe,EACf,KAAK,SAAS,EACd,eAAe,EACf,KAAK,SAAS,EACd,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,SAAS,EACT,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,cAAc,EACd,KAAK,QAAQ,EACb,UAAU,EACV,KAAK,IAAI,EACT,cAAc,EACd,KAAK,QAAQ,EACb,cAAc,EACd,KAAK,QAAQ,EACb,qBAAqB,EACrB,KAAK,eAAe,EACpB,yBAAyB,EACzB,KAAK,mBA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ourceId, dateString, createApiResponseSchema, createApiListResponseS
|
|
|
10
10
|
// Employee, Team, Location, Contract
|
|
11
11
|
export { EmployeeSchema, TeamSchema, LocationSchema, ContractSchema, ContractSummarySchema, CreateEmployeeInputSchema, UpdateEmployeeInputSchema, TerminateEmployeeInputSchema, CreateTeamInputSchema, UpdateTeamInputSchema, CreateLocationInputSchema, UpdateLocationInputSchema, } from './employees.js';
|
|
12
12
|
// Time Off: Leave, LeaveType, Allowance, Shift
|
|
13
|
-
export { LeaveSchema, LeaveTypeSchema, AllowanceSchema,
|
|
13
|
+
export { LeaveSchema, LeaveTypeSchema, AllowanceSchema, CreateLeaveInputSchema, UpdateLeaveInputSchema, LeaveDecisionInputSchema, } from './time-off.js';
|
|
14
|
+
// Attendance: Shift, OpenShift, EstimatedTime, WorkedTime
|
|
15
|
+
export { ShiftSchema, OpenShiftSchema, EstimatedTimeSchema, WorkedTimeSchema, CreateShiftInputSchema, UpdateShiftInputSchema, ClockInputSchema, SegmentInputSchema, DayInputSchema, hhmm, isoWithOffset, LOCATION_TYPES, HALF_DAY_VALUES, } from './attendance.js';
|
|
14
16
|
// Documents: Folder, Document
|
|
15
17
|
export { FolderSchema, DocumentSchema } from './documents.js';
|
|
16
18
|
// Job Catalog: JobRole, JobLevel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,mBAAmB;AACnB,OAAO,EACL,UAAU,EACV,UAAU,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,SAAS,EACT,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,qCAAqC;AACrC,OAAO,EACL,cAAc,EAEd,UAAU,EAEV,cAAc,EAEd,cAAc,EAEd,qBAAqB,EAErB,yBAAyB,EAEzB,yBAAyB,EAEzB,4BAA4B,EAE5B,qBAAqB,EAErB,qBAAqB,EAErB,yBAAyB,EAEzB,yBAAyB,GA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B,2BAA2B,EAE3B,2BAA2B,GAE5B,MAAM,eAAe,CAAC;AAEvB,0DAA0D;AAC1D,OAAO,EACL,cAAc,EAEd,yBAAyB,EAEzB,yBAAyB,EAEzB,qBAAqB,EAErB,gCAAgC,EAEhC,gCAAgC,EAEhC,wBAAwB,EAExB,yBAAyB,GAE1B,MAAM,eAAe,CAAC;AAEvB,aAAa;AACb,OAAO,EACL,cAAc,EAEd,yBAAyB,EAEzB,yBAAyB,GAE1B,MAAM,iBAAiB,CAAC;AAEzB,uDAAuD;AACvD,OAAO,EACL,gBAAgB,EAEhB,2BAA2B,EAE3B,2BAA2B,EAE3B,eAAe,EAEf,0BAA0B,EAE1B,0BAA0B,EAE1B,iBAAiB,EAEjB,4BAA4B,EAE5B,4BAA4B,EAE5B,iBAAiB,GAElB,MAAM,UAAU,CAAC;AAElB,6DAA6D;AAC7D,OAAO,EACL,uBAAuB,EAEvB,mBAAmB,EAEnB,qBAAqB,GAEtB,MAAM,cAAc,CAAC"}
|
|
@@ -246,20 +246,20 @@ export declare const TimeRecordSchema: z.ZodObject<{
|
|
|
246
246
|
date?: string | null | undefined;
|
|
247
247
|
clock_in?: string | null | undefined;
|
|
248
248
|
clock_out?: string | null | undefined;
|
|
249
|
+
observations?: string | null | undefined;
|
|
249
250
|
subproject_id?: string | null | undefined;
|
|
250
251
|
attendance_shift_id?: string | null | undefined;
|
|
251
252
|
imputed_minutes?: number | null | undefined;
|
|
252
|
-
observations?: string | null | undefined;
|
|
253
253
|
}, {
|
|
254
254
|
id: string;
|
|
255
255
|
project_worker_id: string;
|
|
256
256
|
date?: string | null | undefined;
|
|
257
257
|
clock_in?: string | null | undefined;
|
|
258
258
|
clock_out?: string | null | undefined;
|
|
259
|
+
observations?: string | null | undefined;
|
|
259
260
|
subproject_id?: string | null | undefined;
|
|
260
261
|
attendance_shift_id?: string | null | undefined;
|
|
261
262
|
imputed_minutes?: number | null | undefined;
|
|
262
|
-
observations?: string | null | undefined;
|
|
263
263
|
}>;
|
|
264
264
|
export type TimeRecord = z.infer<typeof TimeRecordSchema>;
|
|
265
265
|
/**
|
|
@@ -272,13 +272,13 @@ export declare const CreateTimeRecordInputSchema: z.ZodObject<{
|
|
|
272
272
|
description: z.ZodOptional<z.ZodString>;
|
|
273
273
|
}, "strip", z.ZodTypeAny, {
|
|
274
274
|
date: string;
|
|
275
|
-
project_worker_id: number;
|
|
276
275
|
minutes: number;
|
|
276
|
+
project_worker_id: number;
|
|
277
277
|
description?: string | undefined;
|
|
278
278
|
}, {
|
|
279
279
|
date: string;
|
|
280
|
-
project_worker_id: number;
|
|
281
280
|
minutes: number;
|
|
281
|
+
project_worker_id: number;
|
|
282
282
|
description?: string | undefined;
|
|
283
283
|
}>;
|
|
284
284
|
export type CreateTimeRecordInput = z.infer<typeof CreateTimeRecordInputSchema>;
|
|
@@ -1,74 +1,77 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Time Off schemas: Leave, LeaveType, Allowance
|
|
2
|
+
* Time Off schemas: Leave, LeaveType, Allowance
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
/**
|
|
6
6
|
* Leave schema
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* Field set verified against live /timeoff/leaves responses on API version
|
|
9
|
+
* 2026-07-01 (2026-09-06). There is no `status` field: approval is the
|
|
10
|
+
* boolean `approved`, null while pending. `half_day` is null for a full day,
|
|
11
|
+
* or `beggining_of_day` / `end_of_day` (Factorial's spelling). Declared with
|
|
12
|
+
* passthrough so a new field does not break parsing.
|
|
13
13
|
*/
|
|
14
14
|
export declare const LeaveSchema: z.ZodObject<{
|
|
15
15
|
id: z.ZodString;
|
|
16
|
+
company_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
17
|
employee_id: z.ZodString;
|
|
18
|
+
employee_full_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
19
|
leave_type_id: z.ZodString;
|
|
20
|
+
leave_type_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
21
|
start_on: z.ZodString;
|
|
19
22
|
finish_on: z.ZodString;
|
|
20
|
-
half_day: z.ZodNullable<z.
|
|
21
|
-
|
|
23
|
+
half_day: z.ZodNullable<z.ZodString>;
|
|
24
|
+
approved: z.ZodNullable<z.ZodBoolean>;
|
|
22
25
|
description: z.ZodNullable<z.ZodString>;
|
|
26
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
start_time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
hours_amount_in_cents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
23
29
|
deleted_at: z.ZodNullable<z.ZodString>;
|
|
24
|
-
duration_attributes: z.ZodNullable<z.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
description:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} | null;
|
|
70
|
-
days_taken?: number | undefined;
|
|
71
|
-
}>;
|
|
30
|
+
duration_attributes: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
31
|
+
days_taken: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
32
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
35
|
+
id: z.ZodString;
|
|
36
|
+
company_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
employee_id: z.ZodString;
|
|
38
|
+
employee_full_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
leave_type_id: z.ZodString;
|
|
40
|
+
leave_type_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
start_on: z.ZodString;
|
|
42
|
+
finish_on: z.ZodString;
|
|
43
|
+
half_day: z.ZodNullable<z.ZodString>;
|
|
44
|
+
approved: z.ZodNullable<z.ZodBoolean>;
|
|
45
|
+
description: z.ZodNullable<z.ZodString>;
|
|
46
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
start_time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
|
+
hours_amount_in_cents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
49
|
+
deleted_at: z.ZodNullable<z.ZodString>;
|
|
50
|
+
duration_attributes: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
51
|
+
days_taken: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
52
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
company_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
|
+
employee_id: z.ZodString;
|
|
58
|
+
employee_full_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
leave_type_id: z.ZodString;
|
|
60
|
+
leave_type_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
start_on: z.ZodString;
|
|
62
|
+
finish_on: z.ZodString;
|
|
63
|
+
half_day: z.ZodNullable<z.ZodString>;
|
|
64
|
+
approved: z.ZodNullable<z.ZodBoolean>;
|
|
65
|
+
description: z.ZodNullable<z.ZodString>;
|
|
66
|
+
reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
start_time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
|
+
hours_amount_in_cents: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
69
|
+
deleted_at: z.ZodNullable<z.ZodString>;
|
|
70
|
+
duration_attributes: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
71
|
+
days_taken: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
72
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
72
75
|
export type Leave = z.infer<typeof LeaveSchema>;
|
|
73
76
|
/**
|
|
74
77
|
* Leave type schema
|
|
@@ -276,48 +279,6 @@ export declare const AllowanceSchema: z.ZodObject<{
|
|
|
276
279
|
position?: number | null | undefined;
|
|
277
280
|
}>;
|
|
278
281
|
export type Allowance = z.infer<typeof AllowanceSchema>;
|
|
279
|
-
/**
|
|
280
|
-
* Shift schema
|
|
281
|
-
*
|
|
282
|
-
* Only the identifier types were changed for API version 2026-07-01. The
|
|
283
|
-
* remaining fields are known not to match what the live API returns; that
|
|
284
|
-
* rework belongs to the attendance feature and is deliberately left out here.
|
|
285
|
-
*/
|
|
286
|
-
export declare const ShiftSchema: z.ZodObject<{
|
|
287
|
-
id: z.ZodString;
|
|
288
|
-
employee_id: z.ZodString;
|
|
289
|
-
clock_in: z.ZodString;
|
|
290
|
-
clock_out: z.ZodNullable<z.ZodString>;
|
|
291
|
-
worked_hours: z.ZodNullable<z.ZodNumber>;
|
|
292
|
-
break_minutes: z.ZodNullable<z.ZodNumber>;
|
|
293
|
-
location: z.ZodNullable<z.ZodString>;
|
|
294
|
-
notes: z.ZodNullable<z.ZodString>;
|
|
295
|
-
created_at: z.ZodNullable<z.ZodString>;
|
|
296
|
-
updated_at: z.ZodNullable<z.ZodString>;
|
|
297
|
-
}, "strip", z.ZodTypeAny, {
|
|
298
|
-
id: string;
|
|
299
|
-
created_at: string | null;
|
|
300
|
-
updated_at: string | null;
|
|
301
|
-
employee_id: string;
|
|
302
|
-
clock_in: string;
|
|
303
|
-
clock_out: string | null;
|
|
304
|
-
worked_hours: number | null;
|
|
305
|
-
break_minutes: number | null;
|
|
306
|
-
location: string | null;
|
|
307
|
-
notes: string | null;
|
|
308
|
-
}, {
|
|
309
|
-
id: string;
|
|
310
|
-
created_at: string | null;
|
|
311
|
-
updated_at: string | null;
|
|
312
|
-
employee_id: string;
|
|
313
|
-
clock_in: string;
|
|
314
|
-
clock_out: string | null;
|
|
315
|
-
worked_hours: number | null;
|
|
316
|
-
break_minutes: number | null;
|
|
317
|
-
location: string | null;
|
|
318
|
-
notes: string | null;
|
|
319
|
-
}>;
|
|
320
|
-
export type Shift = z.infer<typeof ShiftSchema>;
|
|
321
282
|
/**
|
|
322
283
|
* Leave create input schema
|
|
323
284
|
*/
|
|
@@ -379,54 +340,4 @@ export declare const LeaveDecisionInputSchema: z.ZodObject<{
|
|
|
379
340
|
reason?: string | undefined;
|
|
380
341
|
}>;
|
|
381
342
|
export type LeaveDecisionInput = z.infer<typeof LeaveDecisionInputSchema>;
|
|
382
|
-
/**
|
|
383
|
-
* Shift create input schema
|
|
384
|
-
*/
|
|
385
|
-
export declare const CreateShiftInputSchema: z.ZodObject<{
|
|
386
|
-
employee_id: z.ZodNumber;
|
|
387
|
-
clock_in: z.ZodString;
|
|
388
|
-
clock_out: z.ZodOptional<z.ZodString>;
|
|
389
|
-
break_minutes: z.ZodOptional<z.ZodNumber>;
|
|
390
|
-
location: z.ZodOptional<z.ZodString>;
|
|
391
|
-
notes: z.ZodOptional<z.ZodString>;
|
|
392
|
-
}, "strip", z.ZodTypeAny, {
|
|
393
|
-
employee_id: number;
|
|
394
|
-
clock_in: string;
|
|
395
|
-
clock_out?: string | undefined;
|
|
396
|
-
break_minutes?: number | undefined;
|
|
397
|
-
location?: string | undefined;
|
|
398
|
-
notes?: string | undefined;
|
|
399
|
-
}, {
|
|
400
|
-
employee_id: number;
|
|
401
|
-
clock_in: string;
|
|
402
|
-
clock_out?: string | undefined;
|
|
403
|
-
break_minutes?: number | undefined;
|
|
404
|
-
location?: string | undefined;
|
|
405
|
-
notes?: string | undefined;
|
|
406
|
-
}>;
|
|
407
|
-
export type CreateShiftInput = z.infer<typeof CreateShiftInputSchema>;
|
|
408
|
-
/**
|
|
409
|
-
* Shift update input schema
|
|
410
|
-
*/
|
|
411
|
-
export declare const UpdateShiftInputSchema: z.ZodObject<Omit<{
|
|
412
|
-
employee_id: z.ZodOptional<z.ZodNumber>;
|
|
413
|
-
clock_in: z.ZodOptional<z.ZodString>;
|
|
414
|
-
clock_out: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
415
|
-
break_minutes: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
416
|
-
location: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
417
|
-
notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
418
|
-
}, "employee_id">, "strip", z.ZodTypeAny, {
|
|
419
|
-
clock_in?: string | undefined;
|
|
420
|
-
clock_out?: string | undefined;
|
|
421
|
-
break_minutes?: number | undefined;
|
|
422
|
-
location?: string | undefined;
|
|
423
|
-
notes?: string | undefined;
|
|
424
|
-
}, {
|
|
425
|
-
clock_in?: string | undefined;
|
|
426
|
-
clock_out?: string | undefined;
|
|
427
|
-
break_minutes?: number | undefined;
|
|
428
|
-
location?: string | undefined;
|
|
429
|
-
notes?: string | undefined;
|
|
430
|
-
}>;
|
|
431
|
-
export type UpdateShiftInput = z.infer<typeof UpdateShiftInputSchema>;
|
|
432
343
|
//# sourceMappingURL=time-off.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-off.d.ts","sourceRoot":"","sources":["../../src/schemas/time-off.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"time-off.d.ts","sourceRoot":"","sources":["../../src/schemas/time-off.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAuBR,CAAC;AAEjB,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;IAI1B,gHAAgH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBhH,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqC1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAMxD;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;EAOjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;EAA+D,CAAC;AAEnG,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;EAEnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
package/dist/schemas/time-off.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Time Off schemas: Leave, LeaveType, Allowance
|
|
2
|
+
* Time Off schemas: Leave, LeaveType, Allowance
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { dateString, resourceId } from './shared.js';
|
|
6
6
|
/**
|
|
7
7
|
* Leave schema
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* Field set verified against live /timeoff/leaves responses on API version
|
|
10
|
+
* 2026-07-01 (2026-09-06). There is no `status` field: approval is the
|
|
11
|
+
* boolean `approved`, null while pending. `half_day` is null for a full day,
|
|
12
|
+
* or `beggining_of_day` / `end_of_day` (Factorial's spelling). Declared with
|
|
13
|
+
* passthrough so a new field does not break parsing.
|
|
14
14
|
*/
|
|
15
|
-
export const LeaveSchema = z
|
|
15
|
+
export const LeaveSchema = z
|
|
16
|
+
.object({
|
|
16
17
|
id: resourceId,
|
|
18
|
+
company_id: resourceId.nullable().optional(),
|
|
17
19
|
employee_id: resourceId,
|
|
20
|
+
employee_full_name: z.string().nullable().optional(),
|
|
18
21
|
leave_type_id: resourceId,
|
|
22
|
+
leave_type_name: z.string().nullable().optional(),
|
|
19
23
|
start_on: z.string(),
|
|
20
24
|
finish_on: z.string(),
|
|
21
|
-
half_day: z.
|
|
22
|
-
|
|
25
|
+
half_day: z.string().nullable(),
|
|
26
|
+
approved: z.boolean().nullable(),
|
|
23
27
|
description: z.string().nullable(),
|
|
28
|
+
reason: z.string().nullable().optional(),
|
|
29
|
+
start_time: z.string().nullable().optional(),
|
|
30
|
+
hours_amount_in_cents: z.number().nullable().optional(),
|
|
24
31
|
deleted_at: z.string().nullable(),
|
|
25
|
-
duration_attributes: z
|
|
26
|
-
.object({
|
|
27
|
-
days: z.number(),
|
|
28
|
-
hours: z.number(),
|
|
29
|
-
})
|
|
30
|
-
.nullable(),
|
|
32
|
+
duration_attributes: z.unknown().nullable().optional(),
|
|
31
33
|
// Added in API 2026-01-01: number of days taken for paid leave
|
|
32
|
-
days_taken: z.number().optional(),
|
|
33
|
-
created_at: z.string().nullable(),
|
|
34
|
-
updated_at: z.string().nullable(),
|
|
35
|
-
})
|
|
34
|
+
days_taken: z.number().nullable().optional(),
|
|
35
|
+
created_at: z.string().nullable().optional(),
|
|
36
|
+
updated_at: z.string().nullable().optional(),
|
|
37
|
+
})
|
|
38
|
+
.passthrough();
|
|
36
39
|
/**
|
|
37
40
|
* Leave type schema
|
|
38
41
|
*
|
|
@@ -114,25 +117,6 @@ export const AllowanceSchema = z.object({
|
|
|
114
117
|
tenure_period_transition: z.string().nullable().optional(),
|
|
115
118
|
position: z.number().nullable().optional(),
|
|
116
119
|
});
|
|
117
|
-
/**
|
|
118
|
-
* Shift schema
|
|
119
|
-
*
|
|
120
|
-
* Only the identifier types were changed for API version 2026-07-01. The
|
|
121
|
-
* remaining fields are known not to match what the live API returns; that
|
|
122
|
-
* rework belongs to the attendance feature and is deliberately left out here.
|
|
123
|
-
*/
|
|
124
|
-
export const ShiftSchema = z.object({
|
|
125
|
-
id: resourceId,
|
|
126
|
-
employee_id: resourceId,
|
|
127
|
-
clock_in: z.string(),
|
|
128
|
-
clock_out: z.string().nullable(),
|
|
129
|
-
worked_hours: z.number().nullable(),
|
|
130
|
-
break_minutes: z.number().nullable(),
|
|
131
|
-
location: z.string().nullable(),
|
|
132
|
-
notes: z.string().nullable(),
|
|
133
|
-
created_at: z.string().nullable(),
|
|
134
|
-
updated_at: z.string().nullable(),
|
|
135
|
-
});
|
|
136
120
|
// ============================================================================
|
|
137
121
|
// Write Input Schemas
|
|
138
122
|
// ============================================================================
|
|
@@ -157,19 +141,4 @@ export const UpdateLeaveInputSchema = CreateLeaveInputSchema.partial().omit({ em
|
|
|
157
141
|
export const LeaveDecisionInputSchema = z.object({
|
|
158
142
|
reason: z.string().max(500).optional(),
|
|
159
143
|
});
|
|
160
|
-
/**
|
|
161
|
-
* Shift create input schema
|
|
162
|
-
*/
|
|
163
|
-
export const CreateShiftInputSchema = z.object({
|
|
164
|
-
employee_id: z.number().positive(),
|
|
165
|
-
clock_in: z.string().datetime(),
|
|
166
|
-
clock_out: z.string().datetime().optional(),
|
|
167
|
-
break_minutes: z.number().min(0).max(480).optional(),
|
|
168
|
-
location: z.string().max(200).optional(),
|
|
169
|
-
notes: z.string().max(500).optional(),
|
|
170
|
-
});
|
|
171
|
-
/**
|
|
172
|
-
* Shift update input schema
|
|
173
|
-
*/
|
|
174
|
-
export const UpdateShiftInputSchema = CreateShiftInputSchema.partial().omit({ employee_id: true });
|
|
175
144
|
//# sourceMappingURL=time-off.js.map
|