Skip to content

Commit 8e08e28

Browse files
committed
Merge branch 'master' into 18314-twilio
2 parents 28e4c98 + cc9213d commit 8e08e28

File tree

239 files changed

+9515
-1630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+9515
-1630
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import buddee from "../../buddee.app.mjs";
2+
3+
export default {
4+
name: "Create Employee",
5+
description: "Create a new employee record. [See the documentation](https://developers.buddee.nl/#d08b1399-6333-4f08-a17b-26b2d8485d7e)",
6+
key: "buddee-create-employee",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
buddee,
11+
companyId: {
12+
propDefinition: [
13+
buddee,
14+
"companyId",
15+
],
16+
},
17+
employmentDate: {
18+
type: "string",
19+
label: "Employment Date",
20+
description: "Employee's employment date (Format: YYYY-MM-DD)",
21+
},
22+
firstDayAtWorkDate: {
23+
type: "string",
24+
label: "First Day at Work Date",
25+
description: "Employee's first day at work date (Format: YYYY-MM-DD)",
26+
},
27+
firstName: {
28+
type: "string",
29+
label: "First Name",
30+
description: "Employee's first name",
31+
},
32+
initials: {
33+
type: "string",
34+
label: "Initials",
35+
description: "Employee's initials",
36+
optional: true,
37+
},
38+
lastName: {
39+
type: "string",
40+
label: "Last Name",
41+
description: "Employee's last name",
42+
},
43+
lastNamePrefix: {
44+
type: "string",
45+
label: "Last Name Prefix",
46+
description: "Employee's last name prefix",
47+
optional: true,
48+
},
49+
workEmail: {
50+
type: "string",
51+
label: "Work Email",
52+
description: "The work email of the employee",
53+
optional: true,
54+
},
55+
personalEmail: {
56+
type: "string",
57+
label: "Personal Email",
58+
description: "The personal email of the employee",
59+
optional: true,
60+
},
61+
managerId: {
62+
propDefinition: [
63+
buddee,
64+
"employeeId",
65+
],
66+
label: "Manager ID",
67+
description: "The ID of the manager to create the employee for",
68+
optional: true,
69+
},
70+
indirectManagerId: {
71+
propDefinition: [
72+
buddee,
73+
"employeeId",
74+
],
75+
label: "Indirect Manager ID",
76+
description: "The ID of the indirect manager to create the employee for",
77+
optional: true,
78+
},
79+
hrManagerId: {
80+
propDefinition: [
81+
buddee,
82+
"employeeId",
83+
],
84+
label: "HR Manager ID",
85+
description: "The ID of the HR manager to create the employee for",
86+
optional: true,
87+
},
88+
buddyId: {
89+
propDefinition: [
90+
buddee,
91+
"employeeId",
92+
],
93+
label: "Buddee ID",
94+
description: "A buddy is an existing employee who guides the new employee through the first few weeks or months on the job.",
95+
optional: true,
96+
},
97+
},
98+
async run({ $ }) {
99+
const response = await this.buddee.createEmployee({
100+
$,
101+
data: {
102+
company_id: this.companyId,
103+
employment_date: this.employmentDate,
104+
first_day_at_work_date: this.firstDayAtWorkDate,
105+
first_name: this.firstName,
106+
initials: this.initials,
107+
last_name: this.lastName,
108+
last_name_prefix: this.lastNamePrefix,
109+
work_email: this.workEmail,
110+
personal_email: this.personalEmail,
111+
manager_id: this.managerId,
112+
indirect_manager_id: this.indirectManagerId,
113+
hr_manager_id: this.hrManagerId,
114+
buddy_id: this.buddyId,
115+
},
116+
});
117+
118+
$.export("$summary", `Successfully created employee with ID ${response.data.id}`);
119+
return response.data;
120+
},
121+
};
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import buddee from "../../buddee.app.mjs";
2+
3+
export default {
4+
name: "Create Leave Request",
5+
description: "Creates a new leave request. [See the documentation](https://developers.buddee.nl/#b5a0cea5-e416-4521-8bc1-46cc4c3d95cb)",
6+
key: "buddee-create-leave-request",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
buddee,
11+
employeeId: {
12+
propDefinition: [
13+
buddee,
14+
"employeeId",
15+
],
16+
},
17+
leaveTypeId: {
18+
propDefinition: [
19+
buddee,
20+
"leaveTypeId",
21+
],
22+
},
23+
hours: {
24+
type: "string",
25+
label: "Hours",
26+
description: "Number of leave hours",
27+
optional: true,
28+
},
29+
reason: {
30+
type: "string",
31+
label: "Reason",
32+
description: "Reason for the leave",
33+
optional: true,
34+
},
35+
startDate: {
36+
type: "string",
37+
label: "Start Date",
38+
description: "Start date of the leave request (YYYY-MM-DD)",
39+
},
40+
startTime: {
41+
type: "string",
42+
label: "Start Time",
43+
description: "Start time of the leave request (HH:MM)",
44+
optional: true,
45+
},
46+
endDate: {
47+
type: "string",
48+
label: "End Date",
49+
description: "End date of the leave request (YYYY-MM-DD)",
50+
},
51+
endTime: {
52+
type: "string",
53+
label: "End Time",
54+
description: "End time of the leave request (HH:MM)",
55+
optional: true,
56+
},
57+
},
58+
async run({ $ }) {
59+
const response = await this.buddee.createLeaveRequest({
60+
$,
61+
data: {
62+
employee_id: this.employeeId,
63+
leave_type_id: this.leaveTypeId,
64+
hours: this.hours && parseFloat(this.hours),
65+
reason: this.reason,
66+
start_date: this.startDate,
67+
start_time: this.startTime,
68+
end_date: this.endDate,
69+
end_time: this.endTime,
70+
},
71+
});
72+
73+
$.export("$summary", `Successfully created leave request with ID: ${response.data.id}`);
74+
return response.data;
75+
},
76+
};

0 commit comments

Comments
 (0)