This repository has been archived on 2026-04-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
core/packages/employee-onboarding/script.star
Jeffrey Smith d91ec02dd7
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m36s
CI/CD / test-sqlite (push) Successful in 2m41s
CI/CD / build-and-deploy (push) Successful in 1m13s
Feat v0.3.7 package audit (#20)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
2026-03-28 21:22:39 +00:00

50 lines
1.4 KiB
Plaintext

def on_provision(ctx):
"""Automated provisioning: record in ext_data, notify HR."""
data = ctx["stage_data"]
name = data.get("full_name", "unknown")
dept = data.get("department", "general")
# Record provision in ext_data table
db.insert("provisions", {
"employee_name": name,
"department": dept,
"needs_vpn": str(data.get("needs_vpn", "false")),
"needs_admin": str(data.get("needs_admin", "false")),
"equipment": data.get("equipment", "standard laptop"),
"status": "provisioned",
})
# Notify the HR user who started this workflow
notifications.send(
ctx["started_by"],
"Accounts provisioned for " + name,
"Department: " + dept + ". Ready for manager review.",
)
return {"advance": True, "data": {
"provision_status": "complete",
"provisioned_for": name,
}}
def on_welcome(ctx):
"""Completion logging: record onboarding and send welcome."""
data = ctx["stage_data"]
name = data.get("full_name", "")
dept = data.get("department", "")
db.insert("onboarding_log", {
"employee_name": name,
"department": dept,
"completed_by": ctx["started_by"],
"status": "complete",
})
notifications.send(
ctx["started_by"],
"Onboarding complete: " + name,
"All stages finished. Welcome aboard!",
)
return {"advance": True, "data": {"onboarding_complete": True}}