@codihaus/odp-app-hr 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/components/hr/contact/tab.vue +238 -0
- package/app/components/hr/department/card.vue +141 -0
- package/app/components/hr/department/form-modal.vue +90 -0
- package/app/components/hr/employees/assets/tab.vue +432 -0
- package/app/components/hr/employees/compensation.vue +136 -0
- package/app/components/hr/employees/contract.vue +77 -0
- package/app/components/hr/employees/insurance.vue +164 -0
- package/app/components/hr/employees/leave/tab.vue +180 -0
- package/app/components/hr/employees/provisioning/form-modal.vue +219 -0
- package/app/components/hr/employees/provisioning/tab.vue +187 -0
- package/app/components/hr/employees/tab.vue +38 -0
- package/app/components/hr/leave/calendar-tab.vue +649 -0
- package/app/components/hr/leave/override-modal.vue +62 -0
- package/app/components/hr/leave/request-modal.vue +185 -0
- package/app/components/hr/leave/requests-tab.vue +289 -0
- package/app/components/hr/leave/timeline-tab.vue +259 -0
- package/app/components/hr/offboarding/tab.vue +303 -0
- package/app/components/hr/person/activity/tab.vue +65 -0
- package/app/components/hr/person/activity/timeline.vue +119 -0
- package/app/components/hr/person/detail.vue +303 -0
- package/app/components/hr/person/document/tab-documents.vue +120 -0
- package/app/components/hr/person/document/template-edit-drawer.vue +215 -0
- package/app/components/hr/person/document/template-preview-card.vue +39 -0
- package/app/components/hr/person/document/trigger-modal.vue +121 -0
- package/app/components/hr/person/employee-form-modal.vue +78 -0
- package/app/components/hr/person/form-modal.vue +78 -0
- package/app/components/hr/person/list-row.vue +40 -0
- package/app/components/hr/person/profile/tab.vue +231 -0
- package/app/components/hr/settings/automation.vue +113 -0
- package/app/components/hr/settings/documents.vue +200 -0
- package/app/components/hr/settings/general.vue +87 -0
- package/app/components/hr/settings/holidays.vue +171 -0
- package/app/components/hr/settings/integrations.vue +185 -0
- package/app/components/hr/settings/policies.vue +83 -0
- package/app/components/hr/settings/policy/benefit-override-modal.vue +59 -0
- package/app/components/hr/settings/policy/editor-eligibility.vue +27 -0
- package/app/components/hr/settings/policy/editor-leave-base.vue +37 -0
- package/app/components/hr/settings/policy/editor-tenure-bonus.vue +61 -0
- package/app/components/hr/settings/recruitment.vue +128 -0
- package/app/components/hr/settings/taxonomies.vue +170 -0
- package/app/components/hr/shared/row.vue +21 -0
- package/app/components/hr/shared/section.vue +20 -0
- package/app/components/hr/shared/source-badge.vue +42 -0
- package/app/components/hr/shared/stage-badge.vue +24 -0
- package/app/components/hr/shared/workflow-timeline.vue +27 -0
- package/app/components/hr/talents/app-sidebar.vue +54 -0
- package/app/components/hr/talents/application-form-modal.vue +114 -0
- package/app/components/hr/talents/pipeline-picker.vue +56 -0
- package/app/components/hr/talents/step-detail.vue +133 -0
- package/app/components/hr/talents/step-stepper.vue +85 -0
- package/app/components/hr/talents/tab.vue +263 -0
- package/app/composables/use-departments.ts +59 -0
- package/app/composables/use-employee-detail.ts +24 -0
- package/app/composables/use-holidays.ts +48 -0
- package/app/composables/use-hr-api.ts +210 -0
- package/app/composables/use-hr-field-registry.ts +76 -0
- package/app/composables/use-hr-policies.ts +66 -0
- package/app/composables/use-hr-settings.ts +118 -0
- package/app/composables/use-leave.ts +71 -0
- package/app/composables/use-offboarding.ts +49 -0
- package/app/composables/use-people.ts +149 -0
- package/app/composables/use-providers.ts +44 -0
- package/app/composables/use-recruitment-workflow.ts +173 -0
- package/app/composables/use-templates.ts +44 -0
- package/app/composables/use-triggers.ts +26 -0
- package/app/config/column-renderers.ts +4 -0
- package/app/config/form-layouts.ts +193 -0
- package/app/data/hr-schema.ts +2608 -0
- package/app/lib/policy-engine.ts +116 -0
- package/app/pages/hr/departments.vue +114 -0
- package/app/pages/hr/employees/[id]/activity.vue +10 -0
- package/app/pages/hr/employees/[id]/assets.vue +14 -0
- package/app/pages/hr/employees/[id]/employment.vue +14 -0
- package/app/pages/hr/employees/[id]/index.vue +9 -0
- package/app/pages/hr/employees/[id]/offboarding.vue +7 -0
- package/app/pages/hr/employees/[id]/profile.vue +11 -0
- package/app/pages/hr/employees/[id]/provisioning.vue +17 -0
- package/app/pages/hr/employees/[id].vue +313 -0
- package/app/pages/hr/employees/index.vue +291 -0
- package/app/pages/hr/index.vue +3 -0
- package/app/pages/hr/leave.vue +79 -0
- package/app/pages/hr/settings.vue +43 -0
- package/app/pages/hr/setup.vue +3 -0
- package/app/pages/hr/talents/[id]/interview/[stepId].vue +231 -0
- package/app/pages/hr/talents/[id].vue +52 -0
- package/app/pages/hr/talents/index.vue +224 -0
- package/app/pages/hr.vue +129 -0
- package/app/plugins/hr-contacts-sync.client.ts +3 -0
- package/app/plugins/hr-extensions.ts +36 -0
- package/app/plugins/hr-setup.ts +5 -0
- package/app/plugins/navigations.ts +22 -0
- package/app/utils/hr-permissions.ts +27 -0
- package/app/utils/hr-policy-seed-step.ts +110 -0
- package/i18n/locales/en.json +726 -0
- package/i18n/locales/vi.json +688 -0
- package/nuxt.config.ts +19 -0
- package/package.json +27 -0
- package/server/api/hr/departments/[id].delete.ts +12 -0
- package/server/api/hr/departments/[id].patch.ts +14 -0
- package/server/api/hr/departments/index.get.ts +11 -0
- package/server/api/hr/departments/index.post.ts +13 -0
- package/server/api/hr/documents/templates/[id]/preview.post.ts +16 -0
- package/server/api/hr/documents/templates/[id].delete.ts +14 -0
- package/server/api/hr/documents/templates/[id].patch.ts +16 -0
- package/server/api/hr/documents/templates/index.get.ts +15 -0
- package/server/api/hr/documents/templates/index.post.ts +15 -0
- package/server/api/hr/documents/triggers/[id].patch.ts +16 -0
- package/server/api/hr/documents/triggers/index.get.ts +13 -0
- package/server/api/hr/fields/[collection].get.ts +14 -0
- package/server/api/hr/holidays/[id].delete.ts +14 -0
- package/server/api/hr/holidays/[id].patch.ts +16 -0
- package/server/api/hr/holidays/copy.post.ts +15 -0
- package/server/api/hr/holidays/index.get.ts +15 -0
- package/server/api/hr/holidays/index.post.ts +15 -0
- package/server/api/hr/leave/requests/[id].patch.ts +22 -0
- package/server/api/hr/leave/requests.get.ts +15 -0
- package/server/api/hr/leave/types.get.ts +13 -0
- package/server/api/hr/offboarding/[id]/cancel.post.ts +8 -0
- package/server/api/hr/offboarding/[id]/deprovision.post.ts +8 -0
- package/server/api/hr/offboarding/[id]/finalize.post.ts +8 -0
- package/server/api/hr/offboarding/[id]/return-assets.post.ts +8 -0
- package/server/api/hr/offboarding/[id]/settlement.get.ts +8 -0
- package/server/api/hr/offboarding/[id]/tasks/[taskId].patch.ts +10 -0
- package/server/api/hr/offboarding/[id].get.ts +8 -0
- package/server/api/hr/offboarding/[id].patch.ts +9 -0
- package/server/api/hr/offboarding/index.get.ts +7 -0
- package/server/api/hr/people/[id]/applications/[appId]/interviews/[iid].delete.ts +16 -0
- package/server/api/hr/people/[id]/applications/[appId]/interviews/[iid].patch.ts +18 -0
- package/server/api/hr/people/[id]/applications/[appId]/interviews/index.get.ts +15 -0
- package/server/api/hr/people/[id]/applications/[appId]/interviews/index.post.ts +17 -0
- package/server/api/hr/people/[id]/applications/[appId].patch.ts +17 -0
- package/server/api/hr/people/[id]/applications/index.get.ts +14 -0
- package/server/api/hr/people/[id]/applications/index.post.ts +16 -0
- package/server/api/hr/people/[id]/assets/[aid].delete.ts +13 -0
- package/server/api/hr/people/[id]/assets/[aid].patch.ts +15 -0
- package/server/api/hr/people/[id]/assets/index.get.ts +12 -0
- package/server/api/hr/people/[id]/assets/index.post.ts +14 -0
- package/server/api/hr/people/[id]/compensations.get.ts +14 -0
- package/server/api/hr/people/[id]/compensations.patch.ts +16 -0
- package/server/api/hr/people/[id]/contracts.get.ts +14 -0
- package/server/api/hr/people/[id]/contracts.patch.ts +16 -0
- package/server/api/hr/people/[id]/documents/[did].delete.ts +15 -0
- package/server/api/hr/people/[id]/documents/index.get.ts +14 -0
- package/server/api/hr/people/[id]/documents/index.post.ts +16 -0
- package/server/api/hr/people/[id]/insurances.get.ts +14 -0
- package/server/api/hr/people/[id]/insurances.patch.ts +16 -0
- package/server/api/hr/people/[id]/leave-balances/[bid].patch.ts +17 -0
- package/server/api/hr/people/[id]/leave-balances/index.get.ts +14 -0
- package/server/api/hr/people/[id]/leave-requests/index.get.ts +14 -0
- package/server/api/hr/people/[id]/leave-requests/index.post.ts +16 -0
- package/server/api/hr/people/[id]/link-user.post.ts +16 -0
- package/server/api/hr/people/[id]/notes/[nid].delete.ts +15 -0
- package/server/api/hr/people/[id]/notes/index.get.ts +14 -0
- package/server/api/hr/people/[id]/notes/index.post.ts +16 -0
- package/server/api/hr/people/[id]/offboarding/cases.get.ts +12 -0
- package/server/api/hr/people/[id]/offboarding.get.ts +12 -0
- package/server/api/hr/people/[id]/offboarding.post.ts +14 -0
- package/server/api/hr/people/[id]/provisioning/[logId]/retry.post.ts +7 -0
- package/server/api/hr/people/[id]/provisioning/index.get.ts +6 -0
- package/server/api/hr/people/[id]/provisioning/index.post.ts +7 -0
- package/server/api/hr/people/[id]/transition.post.ts +19 -0
- package/server/api/hr/people/[id]/transitions.get.ts +14 -0
- package/server/api/hr/people/[id].delete.ts +15 -0
- package/server/api/hr/people/[id].get.ts +14 -0
- package/server/api/hr/people/[id].patch.ts +17 -0
- package/server/api/hr/people/index.get.ts +15 -0
- package/server/api/hr/people/index.post.ts +19 -0
- package/server/api/hr/policies/[id].patch.ts +16 -0
- package/server/api/hr/policies/index.get.ts +13 -0
- package/server/api/hr/providers/[id]/test.post.ts +6 -0
- package/server/api/hr/providers/[id].delete.ts +6 -0
- package/server/api/hr/providers/[id].patch.ts +7 -0
- package/server/api/hr/providers/index.get.ts +5 -0
- package/server/api/hr/providers/index.post.ts +6 -0
- package/server/api/hr/settings/employment-types/[id].delete.ts +14 -0
- package/server/api/hr/settings/employment-types/[id].patch.ts +16 -0
- package/server/api/hr/settings/employment-types/index.get.ts +13 -0
- package/server/api/hr/settings/employment-types/index.post.ts +15 -0
- package/server/api/hr/settings/index.get.ts +13 -0
- package/server/api/hr/settings/index.patch.ts +15 -0
- package/server/api/hr/settings/leave-types/[id].delete.ts +14 -0
- package/server/api/hr/settings/leave-types/[id].patch.ts +16 -0
- package/server/api/hr/settings/leave-types/index.get.ts +13 -0
- package/server/api/hr/settings/leave-types/index.post.ts +15 -0
- package/shared/types/form-layout.ts +30 -0
- package/shared/types/index.ts +2 -0
- package/shared/types/integration.ts +41 -0
- package/shared/types/leave.ts +53 -0
- package/shared/types/offboarding.ts +46 -0
- package/shared/types/person.ts +54 -0
- package/shared/types/settings.ts +16 -0
- package/shared/utils/template-render.ts +155 -0
package/nuxt.config.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
|
|
3
|
+
export default defineNuxtConfig({
|
|
4
|
+
compatibilityDate: "2025-01-15",
|
|
5
|
+
|
|
6
|
+
imports: {
|
|
7
|
+
dirs: [
|
|
8
|
+
resolve(__dirname, "app/data"),
|
|
9
|
+
resolve(__dirname, "app/config"),
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
i18n: {
|
|
14
|
+
locales: [
|
|
15
|
+
{ code: "en", file: "en.json" },
|
|
16
|
+
{ code: "vi", file: "vi.json" },
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codihaus/odp-app-hr",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "ODP HR module — Nuxt layer for human resources",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./nuxt.config.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"app",
|
|
9
|
+
"server",
|
|
10
|
+
"shared",
|
|
11
|
+
"i18n",
|
|
12
|
+
"nuxt.config.ts"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"markdown-it": "^14",
|
|
16
|
+
"slugify": "^1.6"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/markdown-it": "^14"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"nuxt": "^4.0.0",
|
|
23
|
+
"@odp/core": ">=0.2.0",
|
|
24
|
+
"@odp/sdk": ">=0.1.0",
|
|
25
|
+
"@odp/workflow": ">=0.5.0"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
|
|
8
|
+
return userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/departments/${id}`,
|
|
10
|
+
method: 'DELETE',
|
|
11
|
+
}))
|
|
12
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const body = await readBody(event)
|
|
8
|
+
|
|
9
|
+
return userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/departments/${id}`,
|
|
11
|
+
method: 'PATCH',
|
|
12
|
+
body: JSON.stringify(body),
|
|
13
|
+
}))
|
|
14
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
|
|
7
|
+
return userApi.request(customEndpoint({
|
|
8
|
+
path: '/hr/departments',
|
|
9
|
+
method: 'GET',
|
|
10
|
+
}))
|
|
11
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const body = await readBody(event)
|
|
7
|
+
|
|
8
|
+
return userApi.request(customEndpoint({
|
|
9
|
+
path: '/hr/departments',
|
|
10
|
+
method: 'POST',
|
|
11
|
+
body: JSON.stringify(body),
|
|
12
|
+
}))
|
|
13
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const body = await readBody(event)
|
|
8
|
+
|
|
9
|
+
const result = await userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/documents/templates/${id}/preview`,
|
|
11
|
+
method: "POST",
|
|
12
|
+
body: JSON.stringify(body),
|
|
13
|
+
}))
|
|
14
|
+
|
|
15
|
+
return result
|
|
16
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
|
|
8
|
+
await userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/documents/templates/${id}`,
|
|
10
|
+
method: "DELETE",
|
|
11
|
+
}))
|
|
12
|
+
|
|
13
|
+
return { success: true }
|
|
14
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const body = await readBody(event)
|
|
8
|
+
|
|
9
|
+
const result = await userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/documents/templates/${id}`,
|
|
11
|
+
method: "PATCH",
|
|
12
|
+
body: JSON.stringify(body),
|
|
13
|
+
}))
|
|
14
|
+
|
|
15
|
+
return result
|
|
16
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const query = getQuery(event)
|
|
7
|
+
|
|
8
|
+
const qs = query.include_archived === '1' ? '?include_archived=1' : ''
|
|
9
|
+
const result = await userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/documents/templates${qs}`,
|
|
11
|
+
method: "GET",
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const body = await readBody(event)
|
|
7
|
+
|
|
8
|
+
const result = await userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/documents/templates`,
|
|
10
|
+
method: "POST",
|
|
11
|
+
body: JSON.stringify(body),
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const body = await readBody(event)
|
|
8
|
+
|
|
9
|
+
const result = await userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/documents/triggers/${id}`,
|
|
11
|
+
method: "PATCH",
|
|
12
|
+
body: JSON.stringify(body),
|
|
13
|
+
}))
|
|
14
|
+
|
|
15
|
+
return result
|
|
16
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
|
|
7
|
+
const result = await userApi.request(customEndpoint({
|
|
8
|
+
path: `/hr/documents/triggers`,
|
|
9
|
+
method: "GET",
|
|
10
|
+
}))
|
|
11
|
+
|
|
12
|
+
return result
|
|
13
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const collection = getRouterParam(event, 'collection')
|
|
7
|
+
|
|
8
|
+
const result = await userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/fields/${collection}`,
|
|
10
|
+
method: "GET",
|
|
11
|
+
}))
|
|
12
|
+
|
|
13
|
+
return result
|
|
14
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
|
|
8
|
+
const result = await userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/holidays/${id}`,
|
|
10
|
+
method: "DELETE",
|
|
11
|
+
}))
|
|
12
|
+
|
|
13
|
+
return result
|
|
14
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const body = await readBody(event)
|
|
8
|
+
|
|
9
|
+
const result = await userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/holidays/${id}`,
|
|
11
|
+
method: "PATCH",
|
|
12
|
+
body: JSON.stringify(body),
|
|
13
|
+
}))
|
|
14
|
+
|
|
15
|
+
return result
|
|
16
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const body = await readBody(event)
|
|
7
|
+
|
|
8
|
+
const result = await userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/holidays/copy`,
|
|
10
|
+
method: "POST",
|
|
11
|
+
body: JSON.stringify(body),
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const query = getQuery(event)
|
|
7
|
+
|
|
8
|
+
const result = await userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/holidays`,
|
|
10
|
+
method: "GET",
|
|
11
|
+
params: query as Record<string, string>,
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'admin' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const body = await readBody(event)
|
|
7
|
+
|
|
8
|
+
const result = await userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/holidays`,
|
|
10
|
+
method: "POST",
|
|
11
|
+
body: JSON.stringify(body),
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
})
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
// Allow global approvers OR department managers (backend verifies dept ownership)
|
|
5
|
+
try {
|
|
6
|
+
assertPermission(event, { module: 'hr', action: 'leave.approve' })
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
assertPermission(event, { module: 'hr', action: 'leave.approve.dept' })
|
|
10
|
+
}
|
|
11
|
+
const userApi = event.context.userApi
|
|
12
|
+
const id = getRouterParam(event, 'id')
|
|
13
|
+
const body = await readBody(event)
|
|
14
|
+
|
|
15
|
+
const result = await userApi.request(customEndpoint({
|
|
16
|
+
path: `/hr/leave/requests/${id}`,
|
|
17
|
+
method: "PATCH",
|
|
18
|
+
body: JSON.stringify(body),
|
|
19
|
+
}))
|
|
20
|
+
|
|
21
|
+
return result
|
|
22
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const query = getQuery(event)
|
|
7
|
+
|
|
8
|
+
const result = await userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/leave/requests`,
|
|
10
|
+
method: "GET",
|
|
11
|
+
params: query as Record<string, string>,
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
|
|
7
|
+
const result = await userApi.request(customEndpoint({
|
|
8
|
+
path: `/hr/leave/types`,
|
|
9
|
+
method: "GET",
|
|
10
|
+
}))
|
|
11
|
+
|
|
12
|
+
return result
|
|
13
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'update' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
return userApi.request(customEndpoint({ path: `/hr/offboarding/${id}/cancel`, method: "POST", body: "{}" }))
|
|
8
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'update' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
return userApi.request(customEndpoint({ path: `/hr/offboarding/${id}/deprovision`, method: "POST", body: "{}" }))
|
|
8
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'update' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
return userApi.request(customEndpoint({ path: `/hr/offboarding/${id}/finalize`, method: "POST", body: "{}" }))
|
|
8
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'update' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
return userApi.request(customEndpoint({ path: `/hr/offboarding/${id}/return-assets`, method: "POST", body: "{}" }))
|
|
8
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'sensitive.read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
return userApi.request(customEndpoint({ path: `/hr/offboarding/${id}/settlement`, method: "GET" }))
|
|
8
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'update' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const taskId = getRouterParam(event, 'taskId')
|
|
8
|
+
const body = await readBody(event)
|
|
9
|
+
return userApi.request(customEndpoint({ path: `/hr/offboarding/${id}/tasks/${taskId}`, method: "PATCH", body: JSON.stringify(body) }))
|
|
10
|
+
})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
return userApi.request(customEndpoint({ path: `/hr/offboarding/${id}`, method: "GET" }))
|
|
8
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'update' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const body = await readBody(event)
|
|
8
|
+
return userApi.request(customEndpoint({ path: `/hr/offboarding/${id}`, method: "PATCH", body: JSON.stringify(body) }))
|
|
9
|
+
})
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
return userApi.request(customEndpoint({ path: `/hr/offboarding`, method: "GET" }))
|
|
7
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'recruitment.write' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const appId = getRouterParam(event, 'appId')
|
|
8
|
+
const iid = getRouterParam(event, 'iid')
|
|
9
|
+
|
|
10
|
+
const result = await userApi.request(customEndpoint({
|
|
11
|
+
path: `/hr/people/${id}/applications/${appId}/interviews/${iid}`,
|
|
12
|
+
method: "DELETE",
|
|
13
|
+
}))
|
|
14
|
+
|
|
15
|
+
return result ?? { data: { id: iid } }
|
|
16
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'recruitment.write' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const appId = getRouterParam(event, 'appId')
|
|
8
|
+
const iid = getRouterParam(event, 'iid')
|
|
9
|
+
const body = await readBody(event)
|
|
10
|
+
|
|
11
|
+
const result = await userApi.request(customEndpoint({
|
|
12
|
+
path: `/hr/people/${id}/applications/${appId}/interviews/${iid}`,
|
|
13
|
+
method: "PATCH",
|
|
14
|
+
body: JSON.stringify(body),
|
|
15
|
+
}))
|
|
16
|
+
|
|
17
|
+
return { data: result }
|
|
18
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'recruitment.read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const appId = getRouterParam(event, 'appId')
|
|
8
|
+
|
|
9
|
+
const result = await userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/people/${id}/applications/${appId}/interviews`,
|
|
11
|
+
method: "GET",
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
return { data: result ?? [] }
|
|
15
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'recruitment.write' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const appId = getRouterParam(event, 'appId')
|
|
8
|
+
const body = await readBody(event)
|
|
9
|
+
|
|
10
|
+
const result = await userApi.request(customEndpoint({
|
|
11
|
+
path: `/hr/people/${id}/applications/${appId}/interviews`,
|
|
12
|
+
method: "POST",
|
|
13
|
+
body: JSON.stringify(body),
|
|
14
|
+
}))
|
|
15
|
+
|
|
16
|
+
return { data: result }
|
|
17
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'recruitment.write' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const appId = getRouterParam(event, 'appId')
|
|
8
|
+
const body = await readBody(event)
|
|
9
|
+
|
|
10
|
+
const result = await userApi.request(customEndpoint({
|
|
11
|
+
path: `/hr/people/${id}/applications/${appId}`,
|
|
12
|
+
method: "PATCH",
|
|
13
|
+
body: JSON.stringify(body),
|
|
14
|
+
}))
|
|
15
|
+
|
|
16
|
+
return { data: result }
|
|
17
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'recruitment.read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
|
|
8
|
+
const result = await userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/people/${id}/applications`,
|
|
10
|
+
method: "GET",
|
|
11
|
+
}))
|
|
12
|
+
|
|
13
|
+
return { data: result ?? [] }
|
|
14
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'recruitment.write' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const body = await readBody(event)
|
|
8
|
+
|
|
9
|
+
const result = await userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/people/${id}/applications`,
|
|
11
|
+
method: "POST",
|
|
12
|
+
body: JSON.stringify(body),
|
|
13
|
+
}))
|
|
14
|
+
|
|
15
|
+
return { data: result }
|
|
16
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'delete' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const aid = getRouterParam(event, 'aid')
|
|
8
|
+
|
|
9
|
+
return userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/people/${id}/assets/${aid}`,
|
|
11
|
+
method: 'DELETE',
|
|
12
|
+
}))
|
|
13
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'update' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const aid = getRouterParam(event, 'aid')
|
|
8
|
+
const body = await readBody(event)
|
|
9
|
+
|
|
10
|
+
return userApi.request(customEndpoint({
|
|
11
|
+
path: `/hr/people/${id}/assets/${aid}`,
|
|
12
|
+
method: 'PATCH',
|
|
13
|
+
body: JSON.stringify(body),
|
|
14
|
+
}))
|
|
15
|
+
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'read' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
|
|
8
|
+
return userApi.request(customEndpoint({
|
|
9
|
+
path: `/hr/people/${id}/assets`,
|
|
10
|
+
method: 'GET',
|
|
11
|
+
}))
|
|
12
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { customEndpoint } from "@odp/sdk"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
assertPermission(event, { module: 'hr', action: 'create' })
|
|
5
|
+
const userApi = event.context.userApi
|
|
6
|
+
const id = getRouterParam(event, 'id')
|
|
7
|
+
const body = await readBody(event)
|
|
8
|
+
|
|
9
|
+
return userApi.request(customEndpoint({
|
|
10
|
+
path: `/hr/people/${id}/assets`,
|
|
11
|
+
method: 'POST',
|
|
12
|
+
body: JSON.stringify(body),
|
|
13
|
+
}))
|
|
14
|
+
})
|