@sparkerp/plugin-sdk 0.1.0 → 1.0.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.
Files changed (174) hide show
  1. package/bundle/blocks.json +169 -0
  2. package/bundle/catalog.json +614 -5
  3. package/bundle/docs/applications/hcm/admin-access-policies.md +38 -0
  4. package/bundle/docs/applications/hcm/admin-approval-hierarchies.md +33 -0
  5. package/bundle/docs/applications/hcm/admin-data-transfer.md +40 -0
  6. package/bundle/docs/applications/hcm/admin-hcm-users.md +35 -0
  7. package/bundle/docs/applications/hcm/admin-logs.md +57 -0
  8. package/bundle/docs/applications/hcm/admin-permissions-catalog.md +64 -0
  9. package/bundle/docs/applications/hcm/ai-intelligence-overview.md +37 -0
  10. package/bundle/docs/applications/hcm/ai-intelligence-people-risk.md +33 -0
  11. package/bundle/docs/applications/hcm/ai-intelligence-recruitment.md +37 -0
  12. package/bundle/docs/applications/hcm/ai-intelligence-tools.md +39 -0
  13. package/bundle/docs/applications/hcm/analytics-operations.md +31 -0
  14. package/bundle/docs/applications/hcm/analytics-overview.md +31 -0
  15. package/bundle/docs/applications/hcm/analytics-people.md +36 -0
  16. package/bundle/docs/applications/hcm/analytics-tools.md +35 -0
  17. package/bundle/docs/applications/hcm/assets-audits.md +30 -0
  18. package/bundle/docs/applications/hcm/assets-custody.md +36 -0
  19. package/bundle/docs/applications/hcm/assets-inventory.md +34 -0
  20. package/bundle/docs/applications/hcm/assets-maintenance.md +25 -0
  21. package/bundle/docs/applications/hcm/assets-software-licenses.md +27 -0
  22. package/bundle/docs/applications/hcm/attendance-core.md +46 -0
  23. package/bundle/docs/applications/hcm/attendance-exceptions.md +33 -0
  24. package/bundle/docs/applications/hcm/attendance-location.md +25 -0
  25. package/bundle/docs/applications/hcm/attendance-policies.md +23 -0
  26. package/bundle/docs/applications/hcm/attendance-reports.md +20 -0
  27. package/bundle/docs/applications/hcm/benefits-allowances.md +39 -0
  28. package/bundle/docs/applications/hcm/benefits-analytics.md +25 -0
  29. package/bundle/docs/applications/hcm/benefits-employee-processes.md +44 -0
  30. package/bundle/docs/applications/hcm/benefits-plans.md +60 -0
  31. package/bundle/docs/applications/hcm/communications-announcements.md +31 -0
  32. package/bundle/docs/applications/hcm/communications-history.md +23 -0
  33. package/bundle/docs/applications/hcm/communications-notifications.md +31 -0
  34. package/bundle/docs/applications/hcm/communications-templates.md +35 -0
  35. package/bundle/docs/applications/hcm/compensation-allowances-benefits.md +44 -0
  36. package/bundle/docs/applications/hcm/compensation-analytics.md +30 -0
  37. package/bundle/docs/applications/hcm/compensation-bonus-incentive.md +35 -0
  38. package/bundle/docs/applications/hcm/compensation-cycles.md +49 -0
  39. package/bundle/docs/applications/hcm/compensation-equity.md +36 -0
  40. package/bundle/docs/applications/hcm/compensation-salary.md +47 -0
  41. package/bundle/docs/applications/hcm/compliance-analytics.md +25 -0
  42. package/bundle/docs/applications/hcm/compliance-audits-calendar.md +52 -0
  43. package/bundle/docs/applications/hcm/compliance-employee-tracking.md +41 -0
  44. package/bundle/docs/applications/hcm/compliance-regulatory.md +31 -0
  45. package/bundle/docs/applications/hcm/country-packs-admin.md +33 -0
  46. package/bundle/docs/applications/hcm/country-packs-compliance.md +31 -0
  47. package/bundle/docs/applications/hcm/country-packs-localization.md +37 -0
  48. package/bundle/docs/applications/hcm/country-packs.md +102 -0
  49. package/bundle/docs/applications/hcm/dashboard.md +38 -0
  50. package/bundle/docs/applications/hcm/designations.md +32 -0
  51. package/bundle/docs/applications/hcm/emp-documents-analytics.md +27 -0
  52. package/bundle/docs/applications/hcm/emp-documents-core.md +33 -0
  53. package/bundle/docs/applications/hcm/emp-documents-letters.md +40 -0
  54. package/bundle/docs/applications/hcm/emp-documents-signatures.md +24 -0
  55. package/bundle/docs/applications/hcm/emp-documents-workflow.md +32 -0
  56. package/bundle/docs/applications/hcm/employee-directory.md +55 -0
  57. package/bundle/docs/applications/hcm/employee-documents.md +51 -0
  58. package/bundle/docs/applications/hcm/employee-info-background.md +41 -0
  59. package/bundle/docs/applications/hcm/employee-info-core.md +32 -0
  60. package/bundle/docs/applications/hcm/employee-info-documents.md +31 -0
  61. package/bundle/docs/applications/hcm/employee-info-other.md +21 -0
  62. package/bundle/docs/applications/hcm/employee-movements.md +46 -0
  63. package/bundle/docs/applications/hcm/employee-reference-data.md +40 -0
  64. package/bundle/docs/applications/hcm/employee-relations-analytics.md +23 -0
  65. package/bundle/docs/applications/hcm/employee-relations-cases.md +26 -0
  66. package/bundle/docs/applications/hcm/employee-relations-conflicts-feedback.md +25 -0
  67. package/bundle/docs/applications/hcm/employee-relations-processes.md +34 -0
  68. package/bundle/docs/applications/hcm/employee-services-daily.md +32 -0
  69. package/bundle/docs/applications/hcm/employee-services-manager.md +21 -0
  70. package/bundle/docs/applications/hcm/employee-services-more.md +41 -0
  71. package/bundle/docs/applications/hcm/employee-services-overview.md +43 -0
  72. package/bundle/docs/applications/hcm/expenses-analytics.md +26 -0
  73. package/bundle/docs/applications/hcm/expenses-claims.md +47 -0
  74. package/bundle/docs/applications/hcm/expenses-self-service.md +30 -0
  75. package/bundle/docs/applications/hcm/expenses-setup.md +43 -0
  76. package/bundle/docs/applications/hcm/health-safety-analytics.md +26 -0
  77. package/bundle/docs/applications/hcm/health-safety-incidents.md +44 -0
  78. package/bundle/docs/applications/hcm/health-safety-medical.md +25 -0
  79. package/bundle/docs/applications/hcm/health-safety-training.md +29 -0
  80. package/bundle/docs/applications/hcm/helpdesk.md +28 -0
  81. package/bundle/docs/applications/hcm/holiday-calendar.md +69 -0
  82. package/bundle/docs/applications/hcm/hr-policies.md +64 -0
  83. package/bundle/docs/applications/hcm/hr-settings.md +98 -0
  84. package/bundle/docs/applications/hcm/index.md +272 -0
  85. package/bundle/docs/applications/hcm/industry-it-software.md +52 -0
  86. package/bundle/docs/applications/hcm/job-classifications.md +48 -0
  87. package/bundle/docs/applications/hcm/learning-analytics.md +21 -0
  88. package/bundle/docs/applications/hcm/learning-assessments.md +22 -0
  89. package/bundle/docs/applications/hcm/learning-catalog.md +25 -0
  90. package/bundle/docs/applications/hcm/learning-certifications.md +27 -0
  91. package/bundle/docs/applications/hcm/learning-enrollment.md +26 -0
  92. package/bundle/docs/applications/hcm/learning-instructors-providers.md +21 -0
  93. package/bundle/docs/applications/hcm/leave-accrual-and-carryforward.md +30 -0
  94. package/bundle/docs/applications/hcm/leave-balance.md +26 -0
  95. package/bundle/docs/applications/hcm/leave-dashboard-and-reports.md +32 -0
  96. package/bundle/docs/applications/hcm/leave-encashment.md +27 -0
  97. package/bundle/docs/applications/hcm/leave-requests.md +26 -0
  98. package/bundle/docs/applications/hcm/leave-setup.md +30 -0
  99. package/bundle/docs/applications/hcm/leave-team-and-calendar.md +25 -0
  100. package/bundle/docs/applications/hcm/navigation-and-approvals.md +61 -0
  101. package/bundle/docs/applications/hcm/offboarding-and-exit.md +71 -0
  102. package/bundle/docs/applications/hcm/onboarding-documents-verification.md +43 -0
  103. package/bundle/docs/applications/hcm/onboarding-orientation-probation.md +65 -0
  104. package/bundle/docs/applications/hcm/onboarding-overview.md +47 -0
  105. package/bundle/docs/applications/hcm/onboarding-provisioning-assets.md +48 -0
  106. package/bundle/docs/applications/hcm/onboarding-reports.md +38 -0
  107. package/bundle/docs/applications/hcm/onboarding-templates-checklists.md +38 -0
  108. package/bundle/docs/applications/hcm/onboarding-to-confirmation.md +45 -0
  109. package/bundle/docs/applications/hcm/org-structure.md +53 -0
  110. package/bundle/docs/applications/hcm/org-units.md +86 -0
  111. package/bundle/docs/applications/hcm/organizations.md +81 -0
  112. package/bundle/docs/applications/hcm/payroll-analytics.md +31 -0
  113. package/bundle/docs/applications/hcm/payroll-post-run.md +40 -0
  114. package/bundle/docs/applications/hcm/payroll-runs.md +30 -0
  115. package/bundle/docs/applications/hcm/payroll-setup.md +38 -0
  116. package/bundle/docs/applications/hcm/payroll-tax.md +21 -0
  117. package/bundle/docs/applications/hcm/payroll-transactions.md +43 -0
  118. package/bundle/docs/applications/hcm/performance-analytics.md +23 -0
  119. package/bundle/docs/applications/hcm/performance-appraisals.md +50 -0
  120. package/bundle/docs/applications/hcm/performance-continuous-feedback.md +23 -0
  121. package/bundle/docs/applications/hcm/performance-cycles-and-goals.md +54 -0
  122. package/bundle/docs/applications/hcm/performance-okrs.md +33 -0
  123. package/bundle/docs/applications/hcm/performance-pips.md +29 -0
  124. package/bundle/docs/applications/hcm/performance-ratings.md +25 -0
  125. package/bundle/docs/applications/hcm/positions.md +67 -0
  126. package/bundle/docs/applications/hcm/recruitment-agencies-and-sources.md +26 -0
  127. package/bundle/docs/applications/hcm/recruitment-analytics.md +25 -0
  128. package/bundle/docs/applications/hcm/recruitment-candidates.md +33 -0
  129. package/bundle/docs/applications/hcm/recruitment-offers.md +32 -0
  130. package/bundle/docs/applications/hcm/recruitment-pipeline.md +46 -0
  131. package/bundle/docs/applications/hcm/recruitment-requisitions-and-openings.md +33 -0
  132. package/bundle/docs/applications/hcm/roles-permissions.md +129 -0
  133. package/bundle/docs/applications/hcm/separation-clearance.md +33 -0
  134. package/bundle/docs/applications/hcm/separation-documents.md +28 -0
  135. package/bundle/docs/applications/hcm/separation-final-settlement.md +24 -0
  136. package/bundle/docs/applications/hcm/separation-reports.md +23 -0
  137. package/bundle/docs/applications/hcm/separation-resignation.md +43 -0
  138. package/bundle/docs/applications/hcm/settings-extensibility.md +31 -0
  139. package/bundle/docs/applications/hcm/settings-general.md +29 -0
  140. package/bundle/docs/applications/hcm/settings-integrations.md +14 -0
  141. package/bundle/docs/applications/hcm/settings-module-defaults.md +41 -0
  142. package/bundle/docs/applications/hcm/settings-process.md +28 -0
  143. package/bundle/docs/applications/hcm/shift-scheduling.md +33 -0
  144. package/bundle/docs/applications/hcm/talent-analytics.md +26 -0
  145. package/bundle/docs/applications/hcm/talent-career.md +31 -0
  146. package/bundle/docs/applications/hcm/talent-competencies-skills.md +30 -0
  147. package/bundle/docs/applications/hcm/talent-profiles.md +40 -0
  148. package/bundle/docs/applications/hcm/talent-succession.md +42 -0
  149. package/bundle/docs/applications/hcm/teams-and-tags.md +46 -0
  150. package/bundle/docs/applications/hcm/timesheets.md +33 -0
  151. package/bundle/docs/applications/hcm/travel-advances-expenses.md +34 -0
  152. package/bundle/docs/applications/hcm/travel-analytics.md +28 -0
  153. package/bundle/docs/applications/hcm/travel-bookings.md +35 -0
  154. package/bundle/docs/applications/hcm/travel-requests.md +38 -0
  155. package/bundle/docs/applications/hcm/workforce-org-design.md +22 -0
  156. package/bundle/docs/applications/hcm/workforce-planning-analytics.md +26 -0
  157. package/bundle/docs/applications/hcm/workforce-planning-core.md +36 -0
  158. package/bundle/docs/applications/hcm/workforce-planning-scenarios.md +29 -0
  159. package/bundle/docs/guides/add-app-owned-roles-and-permissions.md +144 -0
  160. package/bundle/docs/guides/extend-a-shipped-application.md +132 -0
  161. package/bundle/docs/guides/index.md +2 -0
  162. package/bundle/docs/reference/entity-aggregation-config.md +1 -1
  163. package/bundle/docs/reference/entity-document-generator-config.md +1 -1
  164. package/bundle/docs/tutorial/01-create-the-plugin.md +7 -1
  165. package/bundle/docs/tutorial/07-return-due-reminder-job.md +28 -5
  166. package/bundle/docs/tutorial/08-menus-i18n-publish.md +5 -5
  167. package/bundle/manifest.json +4 -4
  168. package/bundle/schemas/page.schema.json +13 -0
  169. package/bundle/schemas/plugin-manifest.schema.json +13 -0
  170. package/bundle/validators/block-engine.mjs +167 -7
  171. package/bundle/validators/page-engine.mjs +226 -21
  172. package/erp-cli/authoring-root.mjs +12 -1
  173. package/erp-cli/erp.mjs +334 -4
  174. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ ---
2
+ title: Competencies & Skills
3
+ audience: tenant
4
+ ---
5
+
6
+ # Competencies & Skills (HCM)
7
+
8
+ This page documents two shipped **Talent** screens (`hcm-talent`). Not for
9
+ plugin developers.
10
+
11
+ ## Competencies
12
+
13
+ Define and manage the competency catalog talent processes reference. New
14
+ competencies go through a real publish approval before they're usable
15
+ elsewhere.
16
+
17
+ ## Skills
18
+
19
+ This screen doesn't maintain its own separate skill master — it points at
20
+ the same real skill catalog the [Learning module](./learning-certifications.md)
21
+ owns, and adds talent-specific classification on top: whether a skill is
22
+ **Critical** (talent's own judgment call, independent of Learning's own
23
+ criticality rating), whether it's an **Emerging** skill (and since when),
24
+ its business relevance, and talent-specific notes. The underlying skill
25
+ itself (its name, category, publish status) is still managed in Learning
26
+ — this screen only adds the talent lens on top of it.
27
+
28
+ ## Related
29
+
30
+ - [Talent Profiles, High Potential Employees & Talent Pools](./talent-profiles.md)
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: Talent Profiles, High Potential Employees & Talent Pools
3
+ audience: tenant
4
+ ---
5
+
6
+ # Talent Profiles, High Potential Employees & Talent Pools (HCM)
7
+
8
+ This page documents three shipped **Talent** screens (`hcm-talent`). Not
9
+ for plugin developers.
10
+
11
+ **Who this is for:** `TALENT_ADMINISTRATOR` has full control; `TALENT_MANAGER_ROLE`
12
+ can view and create but not see potential/risk ratings or
13
+ activate/delete/admin — talent classification is confidential by default,
14
+ not visible to every manager.
15
+
16
+ ## Talent Profiles
17
+
18
+ A talent-focused profile per employee. Its **talent category** — Default,
19
+ High-Performer, High-Potential, or both High-Potential + High-Performer —
20
+ is calculated automatically from underlying data as you create or update
21
+ the profile, not something you set by hand.
22
+
23
+ ## High Potential Employees
24
+
25
+ This isn't a separate list you maintain — it's Talent Profiles, filtered
26
+ to `talent_category = HIGH_POTENTIAL` (you can change the filter). If it
27
+ shows zero rows, that means no profile has actually been classified as
28
+ high-potential yet, not a broken screen.
29
+
30
+ ## Talent Pools
31
+
32
+ Group employees into talent pools for future opportunities. Both the pool
33
+ itself and each membership go through a real, two-step approval
34
+ (activate the pool; approve someone's membership in it) — this isn't just
35
+ a status flag you flip.
36
+
37
+ ## Related
38
+
39
+ - [Career Development & Career Paths](./talent-career.md)
40
+ - [Succession Planning, Successor Candidates & Talent Reviews](./talent-succession.md)
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: Succession Planning, Successor Candidates & Talent Reviews
3
+ audience: tenant
4
+ ---
5
+
6
+ # Succession Planning, Successor Candidates & Talent Reviews (HCM)
7
+
8
+ This page documents three shipped **Talent** screens (`hcm-talent`). Not
9
+ for plugin developers.
10
+
11
+ ## Succession Planning
12
+
13
+ Plan succession for a critical role — role name/code, department,
14
+ criticality, business impact if it goes unfilled, vacancy risk, the
15
+ current incumbent, and a plan owner. Activating a plan is the one
16
+ genuinely two-step approval in this whole module: **Talent Manager, then
17
+ Talent Administrator** must both sign off — reflecting that a critical-role
18
+ succession plan needs more scrutiny than an everyday talent record.
19
+
20
+ ## Successor Candidates
21
+
22
+ A separate, tenant-wide pool of people being considered as potential
23
+ successors for one or more roles — each candidate can be linked to
24
+ multiple succession plans, and each of those pairings tracks its own
25
+ readiness, priority, and match score, so the same person can be "ready
26
+ now" for one role and "developing" for another.
27
+
28
+ ## Talent Reviews
29
+
30
+ Run a calibration cycle — name, type, period — with each employee being
31
+ reviewed as their own row inside the cycle, not a separate screen per
32
+ person.
33
+
34
+ ## Known gaps
35
+
36
+ - **Talent Reports has no real report builder or export engine** — it's a
37
+ catalog of labeled links, each one taking you into the relevant
38
+ screen's own grid (already filtered), not a bespoke rendering system.
39
+
40
+ ## Related
41
+
42
+ - [Talent Profiles, High Potential Employees & Talent Pools](./talent-profiles.md)
@@ -0,0 +1,46 @@
1
+ ---
2
+ title: Teams & Organization Tags
3
+ audience: tenant
4
+ ---
5
+
6
+ # Teams & Organization Tags (HCM)
7
+
8
+ This page documents two shipped, standalone **Organization** screens
9
+ (`hcm-organization`). Not for plugin developers.
10
+
11
+ ## Teams
12
+
13
+ Unlike Departments/Divisions/etc. (one employee belongs to one org unit),
14
+ Teams support **many-to-many, percentage-allocated** membership — an
15
+ employee can belong to more than one team at once, each with a percentage
16
+ of their time/allocation, useful for matrix or project-based structures.
17
+
18
+ ### What you see
19
+
20
+ Search, plus filters for Department, Team Type, and Status. The grid:
21
+ Team Name, Type, Department, Team Lead, Members (count), End Date,
22
+ Status, Actions.
23
+
24
+ ### Creating or editing a team
25
+
26
+ The form covers Team Name, Team Code, Department, Team Lead, Deputy Team
27
+ Lead, Parent Team, Max Members, Effective From/To, and Description.
28
+
29
+ ### Team detail
30
+
31
+ Click a team to see its full detail — Code, Type, Department, Team Lead,
32
+ Deputy Team Lead, Parent Team, Max Members, Visibility, Effective
33
+ From/To, Status — plus its **Members** section: **Add Member**, and for
34
+ each existing member, **Change Role / Allocation** or **Remove**.
35
+ **Deactivate** retires the team.
36
+
37
+ ## Organization Tags
38
+
39
+ A small, tenant-extensible tagging system for organizational entities,
40
+ built on the platform's generic Entity Engine — attach free-form tags for
41
+ your own categorization needs beyond the built-in hierarchy. **New Tag**
42
+ opens a simple form: Name, Code, Color.
43
+
44
+ ## Related
45
+
46
+ - [Org Units, Legal Entities, Business Units & more](./org-units.md)
@@ -0,0 +1,33 @@
1
+ ---
2
+ title: Timesheets
3
+ audience: tenant
4
+ ---
5
+
6
+ # Timesheets (HCM)
7
+
8
+ This page documents the shipped **Timesheets** screen (`hcm-timesheets`).
9
+ Not for plugin developers.
10
+
11
+ ## What it does
12
+
13
+ Log a timesheet for a pay/reporting period, with line entries per
14
+ project/task/cost-center. Each employee can only have one timesheet per
15
+ period — the platform enforces this for real, not just by convention.
16
+ **Submit for Approval** starts a real approval workflow; **Approve** and
17
+ **Reject** decide it for real, the same way every other approval in HCM
18
+ works.
19
+
20
+ ## Known gaps
21
+
22
+ - **Total hours (regular/overtime) are entered or summed by hand**, not
23
+ automatically calculated from the line entries.
24
+ - **Entries don't auto-populate from your real attendance data** — you
25
+ fill in a timesheet's lines yourself, they aren't pulled from
26
+ [Attendance](./attendance-core.md) automatically.
27
+ - **No separate approval-history table beyond the workflow engine's own
28
+ history**, no exception detection, no tenant-defined pay-period
29
+ templates, no dedicated audit trail beyond the platform's standard one.
30
+
31
+ ## Related
32
+
33
+ - [Attendance — Dashboard, Daily Attendance, Register, Biometric & Devices](./attendance-core.md)
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: Travel Advances & Travel Expenses
3
+ audience: tenant
4
+ ---
5
+
6
+ # Travel Advances & Travel Expenses (HCM)
7
+
8
+ This page documents two shipped **Travel** screens (`hcm-travel`). Not for
9
+ plugin developers.
10
+
11
+ ## Travel Advances
12
+
13
+ **Travel Advance** — link to the Travel Request, set an Advance Type,
14
+ Purpose, Destination, Travel Start/End dates, Required By Date, Payment
15
+ Method, Currency, and a real breakdown of **Advance Components** (e.g.
16
+ separate amounts for meals, lodging, incidentals) rather than one flat
17
+ figure, plus the total Requested Amount. Status: Pending Approval →
18
+ Approved → Disbursed → Settled. KPIs: Total Advances, Pending, Approved,
19
+ Disbursed, Settled, and a real **Outstanding Amount** sum across
20
+ unsettled advances.
21
+
22
+ ## Travel Expenses
23
+
24
+ **Travel Expense Claim** — link to the Travel Request (and, if
25
+ applicable, the specific Advance it should offset), Expense Date, and
26
+ real Expense Lines making up the Gross Amount and Tax Amount. The KPI row
27
+ calls out **Missing Receipts** specifically — a real count of claim lines
28
+ still needing a receipt attached, not just buried in the grid. Status:
29
+ Submitted → Approved (or Rejected) → Reimbursed. KPIs: Total Claims,
30
+ Submitted, Approved, Rejected, Reimbursed, Missing Receipts.
31
+
32
+ ## Related
33
+
34
+ - [Travel Bookings & Accommodation](./travel-bookings.md)
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: Travel Dashboard & Reports
3
+ audience: tenant
4
+ ---
5
+
6
+ # Travel Dashboard & Reports (HCM)
7
+
8
+ This page documents two shipped **Travel** analytics screens
9
+ (`hcm-travel`). Not for plugin developers.
10
+
11
+ ## Travel Dashboard
12
+
13
+ An operational view: Total Travel Requests, Pending Approvals, Rejected
14
+ Requests, Active Policies, Active/Upcoming/Completed Trips, Approved
15
+ Travel Spend, Outstanding Advances, and Policy Exceptions — a real
16
+ at-a-glance read on who's traveling right now and what still needs your
17
+ attention.
18
+
19
+ ## Travel Reports
20
+
21
+ A cost-focused view: Total Trips (split into Domestic and International),
22
+ Total Bookings, Booking Spend, Accommodation Spend, Total Travel Expenses,
23
+ Approved Travel Spend, Outstanding Advances, and Policy Exceptions — for
24
+ understanding where your travel budget is actually going.
25
+
26
+ ## Related
27
+
28
+ - [Travel Policies, Travel Requests & Travel Approval](./travel-requests.md)
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: Travel Bookings & Accommodation
3
+ audience: tenant
4
+ ---
5
+
6
+ # Travel Bookings & Accommodation (HCM)
7
+
8
+ This page documents two shipped **Travel** screens (`hcm-travel`),
9
+ covering the logistics of an approved trip. Not for plugin developers.
10
+
11
+ ## Travel Bookings
12
+
13
+ **Travel Booking** — link it to the approved Travel Request, pick a
14
+ Booking Type (Flight/Train/Bus/Car Rental/Ground Transport), Provider/
15
+ Airline, Booking Agency, Origin/Destination, Departure/Return Dates, and
16
+ real itinerary segments for multi-leg trips. The cost breaks down into
17
+ Base Amount, Tax Amount, Fee Amount, and Discount Amount separately, not
18
+ one lump sum — useful when reconciling against what the airline actually
19
+ charged. Status moves through Draft → Confirmed → Ticketed → Completed
20
+ (or Cancelled). KPIs: Total Bookings, Draft, Confirmed, Ticketed,
21
+ Completed, Cancelled.
22
+
23
+ ## Accommodation
24
+
25
+ **Accommodation** — link to the Travel Request, set Hotel Name/Address,
26
+ City/Country, Room Type, number of Rooms, Guests, Meal Plan, Check-In/
27
+ Check-Out dates, and Rate Per Night — Nights and Room Subtotal are worked
28
+ out for you. Same cost breakdown (Tax/Fee/Discount) as Bookings. Status:
29
+ Requested → Reserved → Confirmed → Checked In → (Cancelled). KPIs: Total
30
+ Stays, Requested, Reserved, Confirmed, Checked In, Cancelled.
31
+
32
+ ## Related
33
+
34
+ - [Travel Policies, Travel Requests & Travel Approval](./travel-requests.md)
35
+ - [Travel Advances & Expenses](./travel-advances-expenses.md)
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: Travel Policies, Travel Requests & Travel Approval
3
+ audience: tenant
4
+ ---
5
+
6
+ # Travel Policies, Travel Requests & Travel Approval (HCM)
7
+
8
+ This page documents three shipped **Travel** screens (`hcm-travel`)
9
+ covering how a business trip gets requested and approved. Not for plugin
10
+ developers.
11
+
12
+ ## Travel Policies
13
+
14
+ Define your company's travel policies through a single, straightforward
15
+ create/edit form. KPIs: Total Policies, Draft, Pending Approval,
16
+ Scheduled, Active, Expired — so you can see at a glance which policies
17
+ are actually live vs. still being drafted.
18
+
19
+ ## Travel Requests
20
+
21
+ Request a trip — destination, dates, itinerary — through a single-form
22
+ create/edit. Each request is checked against your active Travel Policy as
23
+ it moves through Draft → Pending Approval → Approved → Active Trips →
24
+ Completed (or Rejected). The KPI row includes a genuinely useful
25
+ **Policy Exceptions** count — requests that fell outside policy, worth
26
+ reviewing specifically rather than hunting through the full list.
27
+
28
+ ## Travel Approval
29
+
30
+ A focused approver workspace for reviewing and approving travel requests
31
+ inline, without needing to leave for the general approvals inbox. KPIs:
32
+ Pending Approvals, Approved This Period, Rejected This Period, Policy
33
+ Exceptions — a real per-period view of your own approval activity, not
34
+ just a static backlog count.
35
+
36
+ ## Related
37
+
38
+ - [Travel Bookings & Accommodation](./travel-bookings.md)
@@ -0,0 +1,22 @@
1
+ ---
2
+ title: Org Design
3
+ audience: tenant
4
+ ---
5
+
6
+ # Org Design (HCM)
7
+
8
+ This page documents the shipped **Org Design** screen
9
+ (`hcm-workforce-planning`) — a live editing view over your real
10
+ Organization Unit data. Not for plugin developers.
11
+
12
+ ## What it does
13
+
14
+ **Select Org Unit**, then edit its Department/Unit Notes, its Reporting
15
+ Line (which parent unit it sits under), and Status — **Save Changes**
16
+ writes back to the same real org unit data
17
+ [Org Units](./org-units.md) manages, deliberately built on top of your
18
+ existing structure rather than a separate, duplicate one to maintain.
19
+
20
+ ## Related
21
+
22
+ - [Reporting Structure & Organization Structure](./org-structure.md)
@@ -0,0 +1,26 @@
1
+ ---
2
+ title: Workforce Dashboard & Reports
3
+ audience: tenant
4
+ ---
5
+
6
+ # Workforce Dashboard & Reports (HCM)
7
+
8
+ This page documents two shipped **Workforce Planning** analytics screens
9
+ (`hcm-workforce-planning`). Not for plugin developers.
10
+
11
+ ## Workforce Dashboard
12
+
13
+ Real live KPIs pulled from across the module — active headcount, org
14
+ units, positions, and more.
15
+
16
+ ## Workforce Reports
17
+
18
+ A department-level rollup: Current Headcount vs. Planned Headcount, a
19
+ real **Gap Capacity** figure, Skill and its Coverage %, Risk Level, and
20
+ which Scenario the numbers are drawn from — the one screen that pulls
21
+ Headcount Planning and Skill Gap Analysis together into a single
22
+ per-department view.
23
+
24
+ ## Related
25
+
26
+ - [Headcount Planning, Demand Forecasting & Budget Planning](./workforce-planning-core.md)
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: Headcount Planning, Demand Forecasting & Budget Planning
3
+ audience: tenant
4
+ ---
5
+
6
+ # Headcount Planning, Demand Forecasting & Budget Planning (HCM)
7
+
8
+ This page documents three shipped **Workforce Planning** screens
9
+ (`hcm-workforce-planning`). Not for plugin developers.
10
+
11
+ ## Headcount Planning
12
+
13
+ Plan headcount by Department, Fiscal Year, and Scenario: enter Current HC
14
+ (headcount), Planned HC, Planned Hiring, Planned Reduction, and Estimated
15
+ Cost/Currency. New plans go through **Submit for Approval** →
16
+ **Approve**/**Reject**.
17
+
18
+ ## Demand Forecasting
19
+
20
+ Forecast the headcount you'll need, by department and period: Forecast
21
+ Name/Code, Forecast Type, Current HC, Required HC, and a Growth Rate % —
22
+ the screen calculates a **Suggested HC** for you from that growth rate
23
+ rather than making you do the math, alongside a Confidence % and Cost
24
+ Amount for the forecast. Same submit → approve/reject flow as Headcount
25
+ Planning.
26
+
27
+ ## Budget Planning
28
+
29
+ Plan workforce budget lines: Budget Type, Fiscal Year, Department, Budget
30
+ Amount, Forecast Amount, and (once actuals come in) Actual Amount — so
31
+ you can compare planned vs. forecast vs. actual spend in one place. Same
32
+ submit → approve/reject flow.
33
+
34
+ ## Related
35
+
36
+ - [Scenario Planning & Skill Gap Analysis](./workforce-planning-scenarios.md)
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: Scenario Planning & Skill Gap Analysis
3
+ audience: tenant
4
+ ---
5
+
6
+ # Scenario Planning & Skill Gap Analysis (HCM)
7
+
8
+ This page documents two shipped **Workforce Planning** screens
9
+ (`hcm-workforce-planning`). Not for plugin developers.
10
+
11
+ ## Scenario Planning
12
+
13
+ Model a workforce scenario: Scenario Name/Code, Scenario Type, Org Scope,
14
+ Planning Period, and a Projected HC/Cost — the screen shows a real
15
+ **Variance %** comparing your scenario against the baseline from
16
+ [Headcount Planning](./workforce-planning-core.md). Same submit → approve/
17
+ reject flow as the other planning screens.
18
+
19
+ ## Skill Gap Analysis
20
+
21
+ For a given Skill, Job Family, and Department, record the Required Level
22
+ vs. the Available Level you currently have — the screen calculates a
23
+ **Gap Level**, **Gap Severity**, **Coverage %**, and a **Risk Level** from
24
+ those two numbers, and you can record a **Recommended Action** against
25
+ each gap. Same submit → approve/reject flow.
26
+
27
+ ## Related
28
+
29
+ - [Headcount Planning, Demand Forecasting & Budget Planning](./workforce-planning-core.md)
@@ -0,0 +1,144 @@
1
+ ---
2
+ title: Add your own app-owned roles & permissions
3
+ audience: tenant
4
+ ---
5
+
6
+ # Add your own app-owned roles & permissions
7
+
8
+ If your plugin needs its own admin-configurable roles (not the tenant-wide
9
+ Roles Studio designer, and not a hand-rolled permission check scattered
10
+ across your controllers), the platform has a small, reusable, already-proven
11
+ shape for it: **your own `role`/`permission`/`role_permission`/`user_role`
12
+ tables, one real Java repository + REST controller, and two shared
13
+ enforcement classes** (`ApplicationRoleChecker`, `ApplicationAccessGate`)
14
+ every app using this pattern instantiates against its own schema. `hcm-foundation`
15
+ and `crm-foundation` both ship a real copy of this — read either one's
16
+ `ApplicationRoleRestContribution.java` alongside this guide.
17
+
18
+ This is **not** the tenant-wide `erp_core.role`/`actor_role` system the
19
+ Permission Designer manages — that's a separate, generic mechanism. Build
20
+ this pattern when your plugin wants its *own* concept of roles that only
21
+ make sense inside your own application (e.g. "Payroll Administrator" only
22
+ means something in `hcm-payroll`).
23
+
24
+ ## 1. Ship the four tables
25
+
26
+ A migration in your plugin's own `spk-assembly/database/`:
27
+
28
+ ```sql
29
+ create table role (
30
+ id bigserial primary key,
31
+ tenant_id bigint not null,
32
+ name text not null,
33
+ description text,
34
+ is_system boolean not null default false,
35
+ is_admin boolean not null default false,
36
+ created_by text,
37
+ unique (tenant_id, name)
38
+ );
39
+
40
+ create table permission (
41
+ id bigserial primary key,
42
+ tenant_id bigint not null,
43
+ role_id bigint not null references role(id),
44
+ resource text not null,
45
+ action text not null,
46
+ scope text not null default 'ALL',
47
+ scope_field text
48
+ );
49
+
50
+ create table user_role (
51
+ id bigserial primary key,
52
+ tenant_id bigint not null,
53
+ tenant_user_id bigint not null,
54
+ role_id bigint not null references role(id),
55
+ assigned_by text,
56
+ assigned_at timestamptz not null default now(),
57
+ unique (tenant_id, tenant_user_id, role_id)
58
+ );
59
+ ```
60
+
61
+ (`role_permission` is folded into `permission` above — one row per
62
+ resource+action grant, same shape `hcm-foundation`'s own V7 migration uses.)
63
+
64
+ ## 2. Wire the two shared enforcement classes
65
+
66
+ In your REST controller (a PF4J `@Extension` + `@RestController`):
67
+
68
+ ```java
69
+ public MyRestContribution(JdbcTemplate jdbcTemplate,
70
+ @Qualifier("platformRegistryJdbcTemplate") JdbcTemplate platformRegistryJdbcTemplate) {
71
+ this.roles = new MyRoleRepository(jdbcTemplate);
72
+ this.accessGate = new ApplicationAccessGate(
73
+ jdbcTemplate.getDataSource(), platformRegistryJdbcTemplate.getDataSource(), "my-app-code");
74
+ }
75
+ ```
76
+
77
+ Then gate every mutation:
78
+
79
+ ```java
80
+ if (!accessGate.allowsAdmin(tenantId, actor)) {
81
+ throw new ResponseStatusException(HttpStatus.FORBIDDEN, "administrator role required");
82
+ }
83
+ ```
84
+
85
+ `ApplicationRoleChecker` (used internally by the gate) is what actually
86
+ answers "can this user do `resource`+`action`" for read/write checks that
87
+ aren't admin-only — see `ApplicationRoleChecker.resolveGrant`'s own doc
88
+ comment for the real query, including role-hierarchy inheritance and
89
+ `status='ACTIVE'` enforcement.
90
+
91
+ ## 3. The bootstrap problem — read this before you hit it live
92
+
93
+ Every admin-surface endpoint (create role, assign, grant/revoke) calls
94
+ `accessGate.allowsAdmin(...)`, which requires the caller to **already** hold
95
+ an `is_admin` role. On a brand-new tenant+application, nobody does — so
96
+ nobody can ever create the first one through your own REST surface. This
97
+ is not a bug to work around ad hoc; it's a real chicken-and-egg problem
98
+ every app using this pattern hits, and the platform already has a correct,
99
+ narrow fix for it: **ship a one-time seed migration that grandfathers
100
+ whoever already holds this tenant's own `TENANT_ADMIN`/`"Tenant Owner"`
101
+ role onto your app's `is_admin` role.**
102
+
103
+ ```sql
104
+ -- V10__my_app_admin_role_bootstrap.sql (adjust the version number)
105
+ insert into role (tenant_id, name, description, is_system, is_admin, created_by)
106
+ select distinct u.tenant_id, 'My App Administrator',
107
+ 'Full administrative access to My App roles, permissions, and configuration.',
108
+ true, true, 'system-migration'
109
+ from erp_core.users u
110
+ join erp_core.actor_role ar on ar.tenant_id = u.tenant_id and ar.actor = u.username
111
+ where ar.role in ('TENANT_ADMIN', 'Tenant Owner')
112
+ on conflict (tenant_id, name) do update set is_admin = true, is_system = true;
113
+
114
+ insert into user_role (tenant_id, tenant_user_id, role_id, assigned_by)
115
+ select distinct u.tenant_id, u.platform_user_id, r.id, 'system-migration'
116
+ from erp_core.users u
117
+ join erp_core.actor_role ar on ar.tenant_id = u.tenant_id and ar.actor = u.username
118
+ join role r on r.tenant_id = u.tenant_id and r.name = 'My App Administrator'
119
+ where ar.role in ('TENANT_ADMIN', 'Tenant Owner')
120
+ and u.platform_user_id is not null
121
+ on conflict (tenant_id, tenant_user_id, role_id) do nothing;
122
+ ```
123
+
124
+ **Do not** "fix" this by widening `ApplicationAccessGate.hasAdminRole` itself
125
+ (e.g. "any authenticated user is admin while none exists yet") — that was
126
+ tried and reverted the same day it shipped (2026-09-22): it's a strictly
127
+ broader security change than the migration above, it's a shared class every
128
+ app using this pattern depends on, and it duplicates a mechanism that
129
+ already existed. If a real tenant somehow still has zero `is_admin` rows
130
+ despite shipping this migration, the fix is to confirm that user actually
131
+ holds `TENANT_ADMIN`/`"Tenant Owner"` in `erp_core.actor_role` (grant it
132
+ there), not to loosen the app-level gate.
133
+
134
+ ## Where the real code lives
135
+
136
+ - `backend/platform-runtime/common/.../schema/ApplicationRoleChecker.java` —
137
+ shared grant-resolution, hierarchy, status enforcement.
138
+ - `backend/platform-runtime/common/.../schema/ApplicationAccessGate.java` —
139
+ identity resolution + application-access denial + the admin gate.
140
+ - `backend/modules/hcm-foundation/.../ApplicationRoleRestContribution.java`
141
+ and its `V10__hcm_admin_role_bootstrap.sql` — a complete, working example.
142
+ - `backend/modules/crm-foundation/` ships an independent second copy of the
143
+ exact same shape, for a second application — proof this is meant to be
144
+ copied per-app, not shared/inherited.