@codihaus/odp-app-hr 0.1.0 → 0.1.2
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/data/hr-schema.ts +49 -45
- package/app/plugins/hr-setup.ts +35 -1
- package/package.json +2 -2
package/app/data/hr-schema.ts
CHANGED
|
@@ -2560,49 +2560,53 @@ export const hrSchema: ModuleSchema = {
|
|
|
2560
2560
|
},
|
|
2561
2561
|
],
|
|
2562
2562
|
|
|
2563
|
-
// Seed data runs after collections are created
|
|
2564
|
-
seed: [
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2563
|
+
// Seed data runs after collections are created.
|
|
2564
|
+
// Shape must match ModuleSchema.seed: { required?: SeedDef[], sample?: SeedDef[] }
|
|
2565
|
+
// and each SeedDef is { collection, items } (NOT a bare array / `data`).
|
|
2566
|
+
seed: {
|
|
2567
|
+
required: [
|
|
2568
|
+
{
|
|
2569
|
+
collection: "hr_employment_types",
|
|
2570
|
+
items: [
|
|
2571
|
+
{ key: "full_time", label: "Full-time" },
|
|
2572
|
+
{ key: "part_time", label: "Part-time" },
|
|
2573
|
+
{ key: "contractor", label: "Contractor" },
|
|
2574
|
+
{ key: "intern", label: "Intern" },
|
|
2575
|
+
],
|
|
2576
|
+
},
|
|
2577
|
+
{
|
|
2578
|
+
collection: "hr_leave_types",
|
|
2579
|
+
items: [
|
|
2580
|
+
{ key: "annual", label: "Annual Leave", default_days: 12, paid: true },
|
|
2581
|
+
{ key: "sick", label: "Sick Leave", default_days: 5, paid: true },
|
|
2582
|
+
{ key: "unpaid", label: "Unpaid Leave", default_days: 0, paid: false },
|
|
2583
|
+
{ key: "maternity", label: "Maternity Leave", default_days: 180, paid: true },
|
|
2584
|
+
{ key: "paternity", label: "Paternity Leave", default_days: 5, paid: true },
|
|
2585
|
+
],
|
|
2586
|
+
},
|
|
2587
|
+
{
|
|
2588
|
+
collection: "hr_settings",
|
|
2589
|
+
items: [
|
|
2590
|
+
{
|
|
2591
|
+
company_name: "My Company",
|
|
2592
|
+
currency: "VND",
|
|
2593
|
+
fiscal_year_start: 1,
|
|
2594
|
+
probation_months_default: 2,
|
|
2595
|
+
leave_year_start: 1,
|
|
2596
|
+
},
|
|
2597
|
+
],
|
|
2598
|
+
},
|
|
2599
|
+
{
|
|
2600
|
+
collection: "hr_document_triggers",
|
|
2601
|
+
items: [
|
|
2602
|
+
{ event: "talent_created", label: "Talent Created", auto: false },
|
|
2603
|
+
{ event: "offer_sent", label: "Offer Sent", auto: false },
|
|
2604
|
+
{ event: "offer_accepted", label: "Offer Accepted", auto: false },
|
|
2605
|
+
{ event: "hired", label: "Employee Hired", auto: false },
|
|
2606
|
+
{ event: "probation_confirmed", label: "Probation Confirmed", auto: false },
|
|
2607
|
+
{ event: "resigned", label: "Employee Resigned", auto: false },
|
|
2608
|
+
],
|
|
2609
|
+
},
|
|
2610
|
+
],
|
|
2611
|
+
},
|
|
2608
2612
|
}
|
package/app/plugins/hr-setup.ts
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
export default defineNuxtPlugin(() => {
|
|
2
2
|
const { registerSchema, extendSchema } = useSetupWizard("hr")
|
|
3
3
|
registerSchema(hrSchema)
|
|
4
|
-
extendSchema({
|
|
4
|
+
extendSchema({
|
|
5
|
+
steps: [
|
|
6
|
+
// Verify-only: the `hr` permission module is registered by the backend
|
|
7
|
+
// extension manifest (odp-extension.permissions in @codihaus/odp-extension-hr),
|
|
8
|
+
// not via API. This step just confirms it landed in the registry.
|
|
9
|
+
// (Do NOT use createPermissionStep — it POSTs /app-permissions/modules,
|
|
10
|
+
// an endpoint the backend doesn't expose, which 404s.)
|
|
11
|
+
{
|
|
12
|
+
key: "permissions",
|
|
13
|
+
title: "Register Permissions",
|
|
14
|
+
icon: "i-ph-shield-check-light",
|
|
15
|
+
after: "seed",
|
|
16
|
+
handler: async (ctx): Promise<StepResult[]> => {
|
|
17
|
+
try {
|
|
18
|
+
const modules = await ctx.api<any[]>("/app-permissions/modules")
|
|
19
|
+
const found = (modules ?? []).find((m: any) => m.id === "hr")
|
|
20
|
+
return [{
|
|
21
|
+
type: "seed" as const,
|
|
22
|
+
name: "module:hr",
|
|
23
|
+
status: found ? "skipped" : "error",
|
|
24
|
+
...(found ? {} : { error: "Module not registered on backend — check extension package.json permissions config" }),
|
|
25
|
+
}]
|
|
26
|
+
} catch {
|
|
27
|
+
return [{
|
|
28
|
+
type: "seed" as const,
|
|
29
|
+
name: "module:hr",
|
|
30
|
+
status: "error",
|
|
31
|
+
error: "Failed to verify app permissions module",
|
|
32
|
+
}]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
createHrPolicySeedStep(),
|
|
37
|
+
],
|
|
38
|
+
})
|
|
5
39
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codihaus/odp-app-hr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "ODP HR module — Nuxt layer for human resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"nuxt": "^4.0.0",
|
|
23
|
-
"@odp/core": ">=0.
|
|
23
|
+
"@odp/core": ">=0.6.1",
|
|
24
24
|
"@odp/sdk": ">=0.1.0",
|
|
25
25
|
"@odp/workflow": ">=0.5.0"
|
|
26
26
|
}
|