@codihaus/odp-app-hr 0.1.0 → 0.1.1

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.
@@ -1,5 +1,39 @@
1
1
  export default defineNuxtPlugin(() => {
2
2
  const { registerSchema, extendSchema } = useSetupWizard("hr")
3
3
  registerSchema(hrSchema)
4
- extendSchema({ steps: [createPermissionStep(hrPermissions), createHrPolicySeedStep()] })
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.0",
3
+ "version": "0.1.1",
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.2.0",
23
+ "@odp/core": ">=0.6.1",
24
24
  "@odp/sdk": ">=0.1.0",
25
25
  "@odp/workflow": ">=0.5.0"
26
26
  }