Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Components] clicktime #13379 #15657

Merged
merged 6 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 0 additions & 3 deletions components/clicktime/.gitignore

This file was deleted.

82 changes: 82 additions & 0 deletions components/clicktime/actions/create-client/create-client.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import app from "../../clicktime.app.mjs";

export default {
key: "clicktime-create-client",
name: "Create Client",
description: "Create a Client on ClickTime [See the documentation](https://developer.clicktime.com/docs/api/#/Clients)",
version: "0.0.1",
type: "action",
props: {
app,
clientNumber: {
propDefinition: [
app,
"clientNumber",
],
},
accountingPackageId: {
propDefinition: [
app,
"accountingPackageId",
],
},
billingRate: {
propDefinition: [
app,
"billingRate",
],
description: "The billing rate for the client",
},
isActive: {
propDefinition: [
app,
"isActive",
],
description: "Indicates whether the client is currently active",
},
isEligibleTimeOffAllocation: {
propDefinition: [
app,
"isEligibleTimeOffAllocation",
],
description: "Determines if the client is eligible for time-off allocation",
},
name: {
propDefinition: [
app,
"name",
],
description: "The name of the client",
},
notes: {
propDefinition: [
app,
"notes",
],
description: "Additional information related to the client",
},
shortName: {
propDefinition: [
app,
"shortName",
],
},
},
async run({ $ }) {
const response = await this.app.createClient({
$,
data: {
AccountingPackageID: this.accountingPackageId,
BillingRate: this.billingRate,
ClientNumber: this.clientNumber,
IsActive: this.isActive,
IsEligibleTimeOffAllocation: this.isEligibleTimeOffAllocation,
Name: this.name,
Notes: this.notes,
ShortName: this.shortName,
},
});
$.export("$summary", `Successfully created Client with the ID: ${response.data.ID}`);
return response;
},
};
125 changes: 125 additions & 0 deletions components/clicktime/actions/create-job/create-job.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import app from "../../clicktime.app.mjs";

export default {
key: "clicktime-create-job",
name: "Create Job",
description: "Create a Job on Clicktime. [See the documentation](https://developer.clicktime.com/docs/api/#/operations/Jobs/CreateJob)",
version: "0.0.1",
type: "action",
props: {
app,
accountingPackageId: {
propDefinition: [
app,
"accountingPackageId",
],
},
billingRate: {
propDefinition: [
app,
"billingRate",
],
description: "The billing rate for the job",
},
isActive: {
propDefinition: [
app,
"isActive",
],
description: "Indicates whether the job is currently active",
},
isEligibleTimeOffAllocation: {
propDefinition: [
app,
"isEligibleTimeOffAllocation",
],
description: "Determines if the client is eligible for time-off allocation",
},
name: {
propDefinition: [
app,
"name",
],
description: "The name of the job",
},
notes: {
propDefinition: [
app,
"notes",
],
description: "Additional information related to the job",
},
clientId: {
propDefinition: [
app,
"clientId",
],
},
includeInRm: {
propDefinition: [
app,
"includeInRm",
],
},
isBillable: {
propDefinition: [
app,
"isBillable",
],
},
jobNumber: {
propDefinition: [
app,
"jobNumber",
],
},
startDate: {
propDefinition: [
app,
"startDate",
],
description: "The start date of the job, i.e.: `2020-01-01`",
},
endDate: {
propDefinition: [
app,
"endDate",
],
},
timeRequiresApproval: {
propDefinition: [
app,
"timeRequiresApproval",
],
},
useCompanyBillingRate: {
propDefinition: [
app,
"useCompanyBillingRate",
],
},
},
async run({ $ }) {
const response = await this.app.createJob({
$,
data: {
AccountingPackageID: this.accountingPackageId,
BillingRate: this.billingRate,
IsActive: this.isActive,
IsEligibleTimeOffAllocation: this.isEligibleTimeOffAllocation,
Name: this.name,
Notes: this.notes,
ClientID: this.clientId,
EndDate: this.endDate,
IncludeInRM: this.includeInRm,
IsBillable: this.isBillable,
JobNumber: this.jobNumber,
StartDate: this.startDate,
TimeRequiresApproval: this.timeRequiresApproval,
UseCompanyBillingRate: this.useCompanyBillingRate,
},
});
$.export("$summary", `Successfully created Job with ID: ${response.data.ID}`);
return response;
},
};
88 changes: 88 additions & 0 deletions components/clicktime/actions/create-user/create-user.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import app from "../../clicktime.app.mjs";

export default {
key: "clicktime-create-user",
name: "Create User",
description: "Create an User on ClickTime. [See the documentation](https://developer.clicktime.com/docs/api/#/operations/Users/CreateManagedUser)",
version: "0.0.1",
type: "action",
props: {
app,
billingRate: {
propDefinition: [
app,
"billingRate",
],
description: "The billing rate for the user",
},
isActive: {
propDefinition: [
app,
"isActive",
],
description: "Indicates whether the user is currently active",
},
name: {
propDefinition: [
app,
"name",
],
description: "The name of the user",
},
startDate: {
propDefinition: [
app,
"startDate",
],
description: "The start date of the user, i.e.: `2020-01-01`",
},
costModel: {
propDefinition: [
app,
"costModel",
],
},
costRate: {
propDefinition: [
app,
"costRate",
],
},
email: {
propDefinition: [
app,
"email",
],
},
employmentTypeId: {
propDefinition: [
app,
"employmentTypeId",
],
},
role: {
propDefinition: [
app,
"role",
],
},
},
async run({ $ }) {
const response = await this.app.createUser({
$,
data: {
BillingRate: this.billingRate,
IsActive: this.isActive,
Name: this.name,
StartDate: this.startDate,
CostModel: this.costModel,
CostRate: this.costRate,
Email: this.email,
EmploymentTypeID: this.employmentTypeId,
Role: this.role,
},
});
$.export("$summary", `Successfully created User with the ID: ${response.data.ID}`);
return response;
},
};
13 changes: 0 additions & 13 deletions components/clicktime/app/clicktime.app.ts

This file was deleted.

Loading
Loading