Skip to content

Commit aa7fabb

Browse files
fix: relax zod types to avoid breaking everytime
1 parent aa87937 commit aa7fabb

File tree

7 files changed

+2
-113
lines changed

7 files changed

+2
-113
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "factorial-cli",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"type": "module",
55
"description": "Fill your factorial shifts with ease",
66
"main": "dist/src/infrastructure/cli/main.js",
@@ -33,4 +33,4 @@
3333
"yargs": "^17.7.2",
3434
"zod": "^3.22.4"
3535
}
36-
}
36+
}

src/infrastructure/factorial-client/schema/CalendarDay.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ import { z } from "zod";
22
import { Leave } from "./Leave.js";
33

44
export const CalendarDay = z.object({
5-
id: z.string(),
65
day: z.number(),
7-
date: z.string(),
86
isLaborable: z.boolean(),
9-
isLeave: z.boolean(),
107
leaves: z.array(Leave),
118
});
129

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,7 @@
11
import { z } from "zod";
22

33
export const Employee = z.object({
4-
accessId: z.number(),
5-
attendable: z.boolean(),
6-
attendanceEmployeesPolicyId: z.number(),
7-
attendanceEmployeesSettingId: z.number(),
8-
contractId: z.string().nullable(),
9-
employeeGroupId: z.number(),
10-
fiscalCountry: z.string(),
11-
hasRegularAccess: z.boolean(),
124
id: z.number(),
13-
irpf: z.number().nullable(),
14-
isEligibleForPayroll: z.boolean(),
15-
isTerminating: z.boolean(),
16-
jobTitle: z.string().nullable(),
17-
legalEntityCurrency: z.enum(["EUR"]),
18-
locationId: z.number(),
19-
managedByCurrent: z.boolean(),
20-
managerId: z.number().nullable(),
21-
paymentFrequency: z.enum(["monthly"]),
22-
payrollHiringId: z.number(),
23-
preferredName: z.string().nullable(),
24-
pronouns: z.string().nullable(),
25-
regularAccessStartsOn: z.string().nullable(),
26-
showBirthday: z.boolean().optional(),
27-
supervisedByCurrent: z.boolean(),
28-
tenureStartDate: z.string().nullable(),
29-
terminatedOn: z.string().nullable(),
30-
terminationReasonType: z.string().nullable(),
31-
terminationTypeDescription: z.string().nullable(),
32-
timeoffManagerId: z.number().nullable(),
33-
timeoffPolicyId: z.number(),
34-
timeoffSupervisedByCurrent: z.boolean(),
355
});
366

377
export type Employee = z.infer<typeof Employee>;

src/infrastructure/factorial-client/schema/Leave.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { z } from "zod";
22

33
export const Leave = z.object({
4-
halfDay: z.null(),
5-
color: z.string(),
64
name: z.string(),
75
});
86

src/infrastructure/factorial-client/schema/MySelf.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,7 @@ import { Employee } from "./Employee.js";
22
import { z } from "zod";
33

44
export const MySelf = Employee.extend({
5-
country: z.enum(["es"]),
6-
state: z.string(),
7-
postalCode: z.string(),
8-
city: z.string(),
9-
addressLine1: z.string(),
10-
addressLine2: z.string().nullable(),
11-
countryMetadata: z.object({
12-
id: z.number(),
13-
irpfInCents: z.number().nullable(),
14-
socialSecurityNumber: z.string().nullable(),
15-
hasWorkPermit: z.boolean().nullable(),
16-
}),
17-
contactName: z.string().nullable(),
18-
contactNumber: z.string().nullable(),
19-
phoneNumber: z.string(),
20-
hiredOn: z.string().nullable(),
21-
identifier: z.string(),
22-
identifierType: z.enum(["dni"]),
23-
gender: z.string(),
24-
nationality: z.enum(["es"]),
255
birthdayOn: z.string(),
26-
bankNumber: z.string(),
27-
swiftBic: z.string().nullable(),
28-
bankNumberFormat: z.string().nullable(),
29-
companyIdentifier: z.string().nullable(),
30-
baseCompensationType: z.string().nullable(),
31-
baseCompensationAmountInCents: z.number().nullable(),
32-
terminatedOn: z.string().nullable(),
33-
isTerminating: z.boolean(),
34-
terminationReasonType: z.string().nullable(),
35-
terminationTypeDescription: z.string().nullable(),
366
});
377

388
export type MySelf = z.infer<typeof MySelf>;

src/infrastructure/factorial-client/schema/Period.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,4 @@ import { z } from "zod";
22

33
export const Period = z.object({
44
id: z.number(),
5-
employeeId: z.number(),
6-
year: z.number(),
7-
month: z.number(),
8-
startOn: z.string(),
9-
endOn: z.string(),
10-
state: z.string(),
11-
timeUnitsDistibution: z.array(z.string()),
12-
workedMinutes: z.number(),
13-
trackedMinutes: z.number(),
14-
trackedMinutesDistribution: z.array(z.number()),
15-
distribution: z.array(z.number()),
16-
workedMinutesNotApprovedDistribution: z.array(z.number()),
17-
totalBreakTaken: z.array(z.boolean()).optional(),
18-
balanceMinutes: z.string(),
19-
balanceMinutesDistribution: z.array(z.number()),
20-
estimatedMinutes: z.number(),
21-
estimatedRegularMinutes: z.number(),
22-
estimatedRegularMinutesDistribution: z.array(z.number()),
23-
estimatedOvertimeMinutes: z.number(),
24-
estimatedMinutesUntilToday: z.number(),
25-
estimatedMinutesDistribution: z.array(z.number()),
26-
estimatedOvertimeMinutesDistribution: z.array(z.number()),
27-
estimatedOvertimeRequestMinutesDistribution: z.array(z.number()),
28-
workedHalfDays: z.number(),
29-
permissions: z.object({
30-
read: z.boolean(),
31-
edit: z.boolean(),
32-
approve: z.boolean(),
33-
delete: z.boolean(),
34-
}),
35-
reviews: z.array(z.unknown()),
365
});

src/infrastructure/factorial-client/schema/Shift.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@ export const Shift = z.object({
44
id: z.number(),
55
periodId: z.number(),
66
day: z.number(),
7-
clockIn: z.string(),
8-
clockOut: z.string(),
9-
minutes: z.number(),
10-
history: z.array(z.unknown()),
11-
observations: z.null(),
12-
date: z.string(),
13-
halfDay: z.null(),
14-
workable: z.boolean(),
15-
automaticClockIn: z.boolean(),
16-
automaticClockOut: z.boolean(),
17-
clockInWithSeconds: z.string(),
18-
employeeId: z.number(),
19-
permissions: z.object({ history: z.boolean() }),
20-
locationType: z.null(),
21-
timeSettingsBreakConfigurationId: z.null(),
227
});
238

249
export type Shift = z.infer<typeof Shift>;

0 commit comments

Comments
 (0)