Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions components/hr_cloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Overview

HR Cloud is a human resources management system (HRMS) that helps businesses manage their employee data, payroll, benefits, time tracking, and more. This integration enables you to automate your HR workflows by connecting HR Cloud with thousands of other apps on Pipedream.

# Getting Started

To use this integration, you'll need an HR Cloud account and an API key. To get started,

1. Log in to your HR Cloud account
2. Navigate to Settings > API Settings
3. Create a new API key or use an existing one

# API URL Structure

This integration uses the HR Cloud API. If you encounter 404 errors, please confirm the correct API URL structure with your HR Cloud documentation, as it may vary depending on your account setup. The integration supports the following formats:

- https://api.hrcloud.com/api/... (default)
- https://api.hrcloud.com/v1/api/... (older accounts)
- https://api.hrcloud.com/v2/api/... (newer accounts)

If you continue to encounter 404 errors, please contact HR Cloud support to confirm your API URL structure.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import hrCloud from "../../hr_cloud.app.mjs";

export default {
key: "hr_cloud-approve-leave-request",
name: "Approve Leave Request",
description: "Approve a pending employee leave request. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)",
version: "0.0.1",
type: "action",
props: {
hrCloud,
leaveRequestId: {
propDefinition: [
hrCloud,
"leaveRequestId",
],
},
approvalNote: {
propDefinition: [
hrCloud,
"approvalNote",
],
},
},
async run({ $ }) {
const response = await this.hrCloud.approveLeaveRequest(this.leaveRequestId, {
$,
data: {
note: this.approvalNote,
},
});

$.export("$summary", `Successfully approved leave request (ID: ${this.leaveRequestId})`);
return response;
},
};
64 changes: 64 additions & 0 deletions components/hr_cloud/actions/create-employee/create-employee.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import hrCloud from "../../hr_cloud.app.mjs";

export default {
key: "hr_cloud-create-employee",
name: "Create Employee",
description: "Create a new employee record in the system. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)",
version: "0.0.1",
type: "action",
props: {
hrCloud,
firstName: {
propDefinition: [
hrCloud,
"firstName",
],
},
lastName: {
propDefinition: [
hrCloud,
"lastName",
],
},
email: {
propDefinition: [
hrCloud,
"email",
],
},
jobTitle: {
propDefinition: [
hrCloud,
"jobTitle",
],
},
departmentId: {
propDefinition: [
hrCloud,
"departmentId",
],
},
startDate: {
propDefinition: [
hrCloud,
"startDate",
],
},
},
async run({ $ }) {
const response = await this.hrCloud.createEmployee({
$,
data: {
first_name: this.firstName,
last_name: this.lastName,
email: this.email,
job_title_id: this.jobTitle,
department_id: this.departmentId,
start_date: this.startDate,
},
});

$.export("$summary", `Successfully created employee: ${this.firstName} ${this.lastName}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import hrCloud from "../../hr_cloud.app.mjs";

export default {
key: "hr_cloud-log-timesheet-entry",
name: "Log Timesheet Entry",
description: "Log a new timesheet entry for an employee. [See the documentation](https://help.hrcloud.com/api/#/introduction#top)",
version: "0.0.1",
type: "action",
props: {
hrCloud,
employeeId: {
propDefinition: [
hrCloud,
"employeeId",
],
},
hours: {
propDefinition: [
hrCloud,
"hours",
],
},
date: {
propDefinition: [
hrCloud,
"date",
],
},
projectId: {
propDefinition: [
hrCloud,
"projectId",
],
},
notes: {
propDefinition: [
hrCloud,
"notes",
],
},
},
async run({ $ }) {
const response = await this.hrCloud.createTimesheetEntry({
$,
data: {
employee_id: this.employeeId,
hours: this.hours,
date: this.date,
project_id: this.projectId,
notes: this.notes,
},
});

const employee = await this.hrCloud.getEmployee(this.employeeId, {
$,
});
const employeeName = `${employee.first_name} ${employee.last_name}`;

$.export("$summary", `Successfully logged ${this.hours} hours for ${employeeName}`);
return response;
},
};
Loading
Loading