Skip to content

Commit d6cd96b

Browse files
committed
some adjusts
1 parent d5350df commit d6cd96b

File tree

5 files changed

+61
-9
lines changed

5 files changed

+61
-9
lines changed

components/lucca/actions/update-user-info/update-user-info.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ export default {
3939
optional: true,
4040
},
4141
legalEntityId: {
42-
type: "integer",
43-
label: "Legal Entity ID",
44-
description: "The ID of the legal entity",
42+
propDefinition: [
43+
lucca,
44+
"legalEntityId",
45+
],
4546
optional: true,
4647
},
4748
cspId: {
@@ -69,9 +70,10 @@ export default {
6970
optional: true,
7071
},
7172
departmentId: {
72-
type: "integer",
73-
label: "Department ID",
74-
description: "The ID of the department",
73+
propDefinition: [
74+
lucca,
75+
"departmentId",
76+
],
7577
optional: true,
7678
},
7779
managerId: {

components/lucca/lucca.app.mjs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,44 @@ export default {
4343
}));
4444
},
4545
},
46+
legalEntityId: {
47+
type: "integer",
48+
label: "Legal Entity ID",
49+
description: "The ID of the legal entity",
50+
async options({ page }) {
51+
const { data: { items } } = await this.listEstablishments({
52+
params: {
53+
paging: `${LIMIT * page},${LIMIT}`,
54+
status: 0,
55+
},
56+
});
57+
return items.map(({
58+
id: value, name: label,
59+
}) => ({
60+
label,
61+
value,
62+
}));
63+
},
64+
},
65+
departmentId: {
66+
type: "integer",
67+
label: "Department ID",
68+
description: "The ID of the department",
69+
async options({ page }) {
70+
const { data: { items } } = await this.listDepartments({
71+
params: {
72+
paging: `${LIMIT * page},${LIMIT}`,
73+
status: 0,
74+
},
75+
});
76+
return items.map(({
77+
id: value, name: label,
78+
}) => ({
79+
label,
80+
value,
81+
}));
82+
},
83+
},
4684
},
4785
methods: {
4886
_baseUrl() {
@@ -80,6 +118,18 @@ export default {
80118
...opts,
81119
});
82120
},
121+
listEstablishments(opts = {}) {
122+
return this._makeRequest({
123+
path: "/establishments",
124+
...opts,
125+
});
126+
},
127+
listDepartments(opts = {}) {
128+
return this._makeRequest({
129+
path: "/departments",
130+
...opts,
131+
});
132+
},
83133
approveLeaveRequest({
84134
leaveRequestId, ...opts
85135
}) {

components/lucca/sources/new-expense-report/new-expense-report.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
...common,
66
key: "lucca-new-expense-report",
77
name: "New Expense Report Created",
8-
description: "Emit new event when a new expense report is created by an employee. Useful for automating approval or finance workflows.",
8+
description: "Emit new event when a new expense report is created by an employee. Useful for automating approval or finance workflows. [See the documentation](https://developers.lucca.fr/api-reference/legacy/cleemy-expenses/expenseclaims/list-expenseclaims)",
99
version: "0.0.1",
1010
type: "source",
1111
dedupe: "unique",

components/lucca/sources/new-leave-request/new-leave-request.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
...common,
66
key: "lucca-new-leave-request",
77
name: "New Leave Request",
8-
description: "Emit new event when a new leave request is submitted by an employee.",
8+
description: "Emit new event when a new leave request is submitted by an employee. [See the documentation](https://developers.lucca.fr/api-reference/legacy/timmi-absences/leave-requests/list-leave-requests)",
99
version: "0.0.1",
1010
type: "source",
1111
dedupe: "unique",

components/lucca/sources/new-user/new-user.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
...common,
66
key: "lucca-new-user",
77
name: "New User Created",
8-
description: "Emit new event when a new user (employee) is created in Lucca.",
8+
description: "Emit new event when a new user (employee) is created in Lucca. [See the documentation](https://developers.lucca.fr/api-reference/legacy/directory/list-users)",
99
version: "0.0.1",
1010
type: "source",
1111
dedupe: "unique",

0 commit comments

Comments
 (0)