Skip to content

Commit dbbb7d4

Browse files
Merging pull request #15657
* Added actions * Done requests changes * Done requests changes * prop pagination * pnpm-lock.yaml --------- Co-authored-by: michelle0927 <[email protected]>
1 parent c9ebbc2 commit dbbb7d4

File tree

9 files changed

+537
-20
lines changed

9 files changed

+537
-20
lines changed

components/clicktime/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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+
clientNumber: {
12+
propDefinition: [
13+
app,
14+
"clientNumber",
15+
],
16+
optional: true,
17+
},
18+
accountingPackageId: {
19+
propDefinition: [
20+
app,
21+
"accountingPackageId",
22+
],
23+
optional: true,
24+
},
25+
billingRate: {
26+
propDefinition: [
27+
app,
28+
"billingRate",
29+
],
30+
description: "The billing rate for the client",
31+
optional: true,
32+
},
33+
isActive: {
34+
propDefinition: [
35+
app,
36+
"isActive",
37+
],
38+
description: "Indicates whether the client is currently active",
39+
optional: true,
40+
},
41+
isEligibleTimeOffAllocation: {
42+
propDefinition: [
43+
app,
44+
"isEligibleTimeOffAllocation",
45+
],
46+
description: "Determines if the client is eligible for time-off allocation",
47+
optional: true,
48+
},
49+
name: {
50+
propDefinition: [
51+
app,
52+
"name",
53+
],
54+
description: "The name of the client",
55+
},
56+
notes: {
57+
propDefinition: [
58+
app,
59+
"notes",
60+
],
61+
description: "Additional information related to the client",
62+
optional: true,
63+
},
64+
shortName: {
65+
propDefinition: [
66+
app,
67+
"shortName",
68+
],
69+
},
70+
},
71+
async run({ $ }) {
72+
const response = await this.app.createClient({
73+
$,
74+
data: {
75+
AccountingPackageID: this.accountingPackageId,
76+
BillingRate: this.billingRate,
77+
ClientNumber: this.clientNumber,
78+
IsActive: this.isActive,
79+
IsEligibleTimeOffAllocation: this.isEligibleTimeOffAllocation,
80+
Name: this.name,
81+
Notes: this.notes,
82+
ShortName: this.shortName,
83+
},
84+
});
85+
$.export("$summary", `Successfully created Client with the ID: ${response.data.ID}`);
86+
return response;
87+
},
88+
};
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
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+
optional: true,
17+
},
18+
billingRate: {
19+
propDefinition: [
20+
app,
21+
"billingRate",
22+
],
23+
description: "The billing rate for the job",
24+
optional: true,
25+
},
26+
isActive: {
27+
propDefinition: [
28+
app,
29+
"isActive",
30+
],
31+
description: "Indicates whether the job is currently active",
32+
optional: true,
33+
},
34+
isEligibleTimeOffAllocation: {
35+
propDefinition: [
36+
app,
37+
"isEligibleTimeOffAllocation",
38+
],
39+
description: "Determines if the job is eligible for time-off allocation",
40+
optional: true,
41+
},
42+
name: {
43+
propDefinition: [
44+
app,
45+
"name",
46+
],
47+
description: "The name of the job",
48+
},
49+
notes: {
50+
propDefinition: [
51+
app,
52+
"notes",
53+
],
54+
description: "Additional information related to the job",
55+
optional: true,
56+
},
57+
clientId: {
58+
propDefinition: [
59+
app,
60+
"clientId",
61+
],
62+
},
63+
includeInRm: {
64+
propDefinition: [
65+
app,
66+
"includeInRm",
67+
],
68+
optional: true,
69+
},
70+
isBillable: {
71+
propDefinition: [
72+
app,
73+
"isBillable",
74+
],
75+
optional: true,
76+
},
77+
jobNumber: {
78+
propDefinition: [
79+
app,
80+
"jobNumber",
81+
],
82+
},
83+
startDate: {
84+
propDefinition: [
85+
app,
86+
"startDate",
87+
],
88+
description: "The start date of the job, i.e.: `2020-01-01`",
89+
optional: true,
90+
},
91+
endDate: {
92+
propDefinition: [
93+
app,
94+
"endDate",
95+
],
96+
optional: true,
97+
},
98+
timeRequiresApproval: {
99+
propDefinition: [
100+
app,
101+
"timeRequiresApproval",
102+
],
103+
optional: true,
104+
},
105+
useCompanyBillingRate: {
106+
propDefinition: [
107+
app,
108+
"useCompanyBillingRate",
109+
],
110+
optional: true,
111+
},
112+
},
113+
async run({ $ }) {
114+
const response = await this.app.createJob({
115+
$,
116+
data: {
117+
AccountingPackageID: this.accountingPackageId,
118+
BillingRate: this.billingRate,
119+
IsActive: this.isActive,
120+
IsEligibleTimeOffAllocation: this.isEligibleTimeOffAllocation,
121+
Name: this.name,
122+
Notes: this.notes,
123+
ClientID: this.clientId,
124+
EndDate: this.endDate,
125+
IncludeInRM: this.includeInRm,
126+
IsBillable: this.isBillable,
127+
JobNumber: this.jobNumber,
128+
StartDate: this.startDate,
129+
TimeRequiresApproval: this.timeRequiresApproval,
130+
UseCompanyBillingRate: this.useCompanyBillingRate,
131+
},
132+
});
133+
$.export("$summary", `Successfully created Job with ID: ${response.data.ID}`);
134+
return response;
135+
},
136+
};
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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+
description: "The billing rate for the user",
17+
optional: true,
18+
},
19+
isActive: {
20+
propDefinition: [
21+
app,
22+
"isActive",
23+
],
24+
description: "Indicates whether the user is currently active",
25+
optional: true,
26+
},
27+
name: {
28+
propDefinition: [
29+
app,
30+
"name",
31+
],
32+
description: "The name of the user",
33+
},
34+
startDate: {
35+
propDefinition: [
36+
app,
37+
"startDate",
38+
],
39+
description: "The start date of the user, i.e.: `2020-01-01`",
40+
optional: true,
41+
},
42+
costModel: {
43+
propDefinition: [
44+
app,
45+
"costModel",
46+
],
47+
optional: true,
48+
},
49+
costRate: {
50+
propDefinition: [
51+
app,
52+
"costRate",
53+
],
54+
optional: true,
55+
},
56+
email: {
57+
propDefinition: [
58+
app,
59+
"email",
60+
],
61+
},
62+
employmentTypeId: {
63+
propDefinition: [
64+
app,
65+
"employmentTypeId",
66+
],
67+
optional: true,
68+
},
69+
role: {
70+
propDefinition: [
71+
app,
72+
"role",
73+
],
74+
optional: true,
75+
},
76+
},
77+
async run({ $ }) {
78+
const response = await this.app.createUser({
79+
$,
80+
data: {
81+
BillingRate: this.billingRate,
82+
IsActive: this.isActive,
83+
Name: this.name,
84+
StartDate: this.startDate,
85+
CostModel: this.costModel,
86+
CostRate: this.costRate,
87+
Email: this.email,
88+
EmploymentTypeID: this.employmentTypeId,
89+
Role: this.role,
90+
},
91+
});
92+
$.export("$summary", `Successfully created User with the ID: ${response.data.ID}`);
93+
return response;
94+
},
95+
};

components/clicktime/app/clicktime.app.ts

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

0 commit comments

Comments
 (0)