Skip to content

Commit 2fdbcaf

Browse files
committed
Added actions
1 parent b38f664 commit 2fdbcaf

File tree

8 files changed

+482
-20
lines changed

8 files changed

+482
-20
lines changed

components/clicktime/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import app from "../../clicktime.app.mjs";
2+
3+
export default {
4+
key: "clicktime-create-client",
5+
name: "Create Client",
6+
description: "Create a Client on ClickTime [See the documentation](https://developer.clicktime.com/docs/api/#/Clients)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
accountingPackageId: {
12+
propDefinition: [
13+
app,
14+
"accountingPackageId",
15+
],
16+
},
17+
billingRate: {
18+
propDefinition: [
19+
app,
20+
"billingRate",
21+
],
22+
},
23+
clientNumber: {
24+
propDefinition: [
25+
app,
26+
"clientNumber",
27+
],
28+
},
29+
isActive: {
30+
propDefinition: [
31+
app,
32+
"isActive",
33+
],
34+
},
35+
isEligibleTimeOffAllocation: {
36+
propDefinition: [
37+
app,
38+
"isEligibleTimeOffAllocation",
39+
],
40+
},
41+
name: {
42+
propDefinition: [
43+
app,
44+
"name",
45+
],
46+
},
47+
notes: {
48+
propDefinition: [
49+
app,
50+
"notes",
51+
],
52+
},
53+
shortName: {
54+
propDefinition: [
55+
app,
56+
"shortName",
57+
],
58+
},
59+
},
60+
async run({ $ }) {
61+
const response = await this.app.createClient({
62+
$,
63+
data: {
64+
AccountingPackageID: this.accountingPackageId,
65+
BillingRate: this.billingRate,
66+
ClientNumber: this.clientNumber,
67+
IsActive: this.isActive,
68+
IsEligibleTimeOffAllocation: this.isEligibleTimeOffAllocation,
69+
Name: this.name,
70+
Notes: this.notes,
71+
ShortName: this.shortName,
72+
},
73+
});
74+
$.export("$summary", `Successfully created Client with the ID: ${response.data.ID}`);
75+
return response;
76+
},
77+
};
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
import app from "../../clicktime.app.mjs";
2+
3+
export default {
4+
key: "clicktime-create-job",
5+
name: "Create Job",
6+
description: "Create a Job on Clicktime. [See the documentation](https://developer.clicktime.com/docs/api/#/operations/Jobs/CreateJob)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
accountingPackageId: {
12+
propDefinition: [
13+
app,
14+
"accountingPackageId",
15+
],
16+
},
17+
billingRate: {
18+
propDefinition: [
19+
app,
20+
"billingRate",
21+
],
22+
},
23+
isActive: {
24+
propDefinition: [
25+
app,
26+
"isActive",
27+
],
28+
},
29+
isEligibleTimeOffAllocation: {
30+
propDefinition: [
31+
app,
32+
"isEligibleTimeOffAllocation",
33+
],
34+
},
35+
name: {
36+
propDefinition: [
37+
app,
38+
"name",
39+
],
40+
},
41+
notes: {
42+
propDefinition: [
43+
app,
44+
"notes",
45+
],
46+
},
47+
clientId: {
48+
propDefinition: [
49+
app,
50+
"clientId",
51+
],
52+
},
53+
endDate: {
54+
propDefinition: [
55+
app,
56+
"endDate",
57+
],
58+
},
59+
includeInRm: {
60+
propDefinition: [
61+
app,
62+
"includeInRm",
63+
],
64+
},
65+
isBillable: {
66+
propDefinition: [
67+
app,
68+
"isBillable",
69+
],
70+
},
71+
jobNumber: {
72+
propDefinition: [
73+
app,
74+
"jobNumber",
75+
],
76+
},
77+
startDate: {
78+
propDefinition: [
79+
app,
80+
"startDate",
81+
],
82+
},
83+
timeRequiresApproval: {
84+
propDefinition: [
85+
app,
86+
"timeRequiresApproval",
87+
],
88+
},
89+
useCompanyBillingRate: {
90+
propDefinition: [
91+
app,
92+
"useCompanyBillingRate",
93+
],
94+
},
95+
},
96+
async run({ $ }) {
97+
const response = await this.app.createJob({
98+
$,
99+
data: {
100+
AccountingPackageID: this.accountingPackageId,
101+
BillingRate: this.billingRate,
102+
IsActive: this.isActive,
103+
IsEligibleTimeOffAllocation: this.isEligibleTimeOffAllocation,
104+
Name: this.name,
105+
Notes: this.notes,
106+
ClientID: this.clientId,
107+
EndDate: this.endDate,
108+
IncludeInRM: this.includeInRm,
109+
IsBillable: this.isBillable,
110+
JobNumber: this.jobNumber,
111+
StartDate: this.startDate,
112+
TimeRequiresApproval: this.timeRequiresApproval,
113+
UseCompanyBillingRate: this.useCompanyBillingRate,
114+
},
115+
});
116+
$.export("$summary", `Successfully created Job with ID: ${response.data.ID}`);
117+
return response;
118+
},
119+
};
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import app from "../../clicktime.app.mjs";
2+
3+
export default {
4+
key: "clicktime-create-user",
5+
name: "Create User",
6+
description: "Create an User on ClickTime. [See the documentation](https://developer.clicktime.com/docs/api/#/operations/Users/CreateManagedUser)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
billingRate: {
12+
propDefinition: [
13+
app,
14+
"billingRate",
15+
],
16+
},
17+
isActive: {
18+
propDefinition: [
19+
app,
20+
"isActive",
21+
],
22+
},
23+
name: {
24+
propDefinition: [
25+
app,
26+
"name",
27+
],
28+
},
29+
startDate: {
30+
propDefinition: [
31+
app,
32+
"startDate",
33+
],
34+
},
35+
costModel: {
36+
propDefinition: [
37+
app,
38+
"costModel",
39+
],
40+
},
41+
costRate: {
42+
propDefinition: [
43+
app,
44+
"costRate",
45+
],
46+
},
47+
email: {
48+
propDefinition: [
49+
app,
50+
"email",
51+
],
52+
},
53+
employmentTypeId: {
54+
propDefinition: [
55+
app,
56+
"employmentTypeId",
57+
],
58+
},
59+
role: {
60+
propDefinition: [
61+
app,
62+
"role",
63+
],
64+
},
65+
},
66+
async run({ $ }) {
67+
const response = await this.app.createUser({
68+
$,
69+
data: {
70+
BillingRate: this.billingRate,
71+
IsActive: this.isActive,
72+
Name: this.name,
73+
StartDate: this.startDate,
74+
CostModel: this.costModel,
75+
CostRate: this.costRate,
76+
Email: this.email,
77+
EmploymentTypeID: this.employmentTypeId,
78+
Role: this.role,
79+
},
80+
});
81+
$.export("$summary", `Successfully created User with the ID: ${response.data.ID}`);
82+
return response;
83+
},
84+
};

components/clicktime/app/clicktime.app.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)