@happyvertical/smrt-human-resources 0.57.33 → 0.57.35
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/AGENTS.md +2 -0
- package/dist/employment/models.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +175 -19
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +322 -17
- package/dist/qualifications/models.d.ts.map +1 -1
- package/dist/recipes.d.ts +200 -0
- package/dist/recipes.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +292 -25
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EMPLOYMENT_STATUS_TRANSITIONS, HrError, SUGGESTED_WORKER_TYPES } from "./types.js";
|
|
2
2
|
import { HUMAN_RESOURCES_MODULE_META, HUMAN_RESOURCES_UI_SLOTS } from "./ui.js";
|
|
3
|
-
import { ObjectRegistry, SmrtCollection, SmrtObject, crossPackageRef, field, foreignKey, isEmbeddedDatabase, isPostgresDatabase, smrt, withEmbeddedWriteQueue } from "@happyvertical/smrt-core";
|
|
3
|
+
import { ObjectRegistry, SmrtCollection, SmrtObject, SmrtRecipe, crossPackageRef, field, foreignKey, isEmbeddedDatabase, isPostgresDatabase, smrt, withEmbeddedWriteQueue } from "@happyvertical/smrt-core";
|
|
4
4
|
import { TenantScoped, getTenantId, tenantId, withTenant } from "@happyvertical/smrt-tenancy";
|
|
5
5
|
import { createLogger } from "@happyvertical/logger";
|
|
6
6
|
//#region src/__smrt-register__.ts
|
|
7
|
-
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-human-resources","packageVersion":"0.57.33","objects":{"@happyvertical/smrt-human-resources:Employment":{"name":"employment","className":"Employment","qualifiedName":"@happyvertical/smrt-human-resources:Employment","collection":"employments","description":"One person's employment with a tenant: the stable record applications and payroll key on. There is one per tenant and profile; a rehire adds an EmploymentTerm to the same row.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"profileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"onDelete":"RESTRICT"}},"userId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-users:User","_meta":{"nullable":true}},"employerProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"employeeNumber":{"type":"text","required":false},"workerType":{"type":"text","required":false,"_meta":{}},"position":{"type":"text","required":false,"_meta":{"nullable":true}},"status":{"type":"text","required":false,"_meta":{},"enum":["active","on-leave","ended"]}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"employments","sensitive":true,"conflictColumns":["tenant_id","employee_number"],"indexes":[{"name":"employments_tenant_profile_uq","columns":["tenantId","profileId"],"unique":true},{"name":"employments_tenant_user_idx","columns":["tenantId","userId"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"}},"extends":"SmrtObject","exportName":"Employment","collectionExportName":"EmploymentCollection","validationRules":[],"schema":{"tableName":"employments","ddl":"CREATE TABLE IF NOT EXISTS \\"employments\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"profile_id\\" UUID,\\n \\"user_id\\" UUID,\\n \\"employer_profile_id\\" UUID,\\n \\"employee_number\\" TEXT,\\n \\"worker_type\\" TEXT,\\n \\"position\\" TEXT,\\n \\"status\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employer_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employee_number":{"type":"TEXT","notNull":false,"unique":false},"worker_type":{"type":"TEXT","notNull":false,"unique":false},"position":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"employments_tenant_id_employee_number_idx","columns":["tenant_id","employee_number"],"unique":true,"nullsNotDistinct":true},{"name":"employments_slug_context_idx","columns":["slug","context"]},{"name":"employments_tenant_profile_uq","columns":["tenant_id","profile_id"],"unique":true},{"name":"employments_tenant_user_idx","columns":["tenant_id","user_id"]},{"name":"employments_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employments_profile_id_idx","columns":["profile_id"]},{"name":"employments_user_id_idx","columns":["user_id"]},{"name":"employments_employer_profile_id_idx","columns":["employer_profile_id"]}],"version":"ff7ef7a8"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentTerm":{"name":"employmentterm","className":"EmploymentTerm","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentTerm","collection":"employmentterms","description":"One continuous period of employment. endedOn is the last day employed (inclusive); null means the term is open. \\"Employed on a date\\" is answered from terms, never from Employment.status.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"employmentId":{"type":"foreignKey","required":false,"related":"Employment","_meta":{"onDelete":"RESTRICT"}},"startedOn":{"type":"text","required":false,"_meta":{}},"endedOn":{"type":"text","required":false,"_meta":{"nullable":true}},"endReason":{"type":"text","required":false}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"employment_terms","sensitive":true,"indexes":[{"name":"employment_terms_employment_idx","columns":["tenantId","employmentId","startedOn"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"EmploymentTerm","collectionExportName":"EmploymentTermCollection","validationRules":[],"schema":{"tableName":"employment_terms","ddl":"CREATE TABLE IF NOT EXISTS \\"employment_terms\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"employment_id\\" UUID,\\n \\"started_on\\" TEXT,\\n \\"ended_on\\" TEXT,\\n \\"end_reason\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"started_on":{"type":"TEXT","notNull":false,"unique":false},"ended_on":{"type":"TEXT","notNull":false,"unique":false},"end_reason":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"employment_terms_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"employment_terms_employment_idx","columns":["tenant_id","employment_id","started_on"]},{"name":"employment_terms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employment_terms_employment_id_idx","columns":["employment_id"]}],"version":"165d209b"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentChange":{"name":"employmentchange","className":"EmploymentChange","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentChange","collection":"employmentchanges","description":"Append-only dated change to an employment, attributed to an actor.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"employmentId":{"type":"foreignKey","required":false,"related":"Employment","_meta":{"onDelete":"RESTRICT"}},"kind":{"type":"text","required":false,"_meta":{},"enum":["hired","ended","rehired","position-changed","worker-type-changed","leave-started","leave-ended","login-linked","login-unlinked"]},"effectiveOn":{"type":"text","required":false,"_meta":{}},"fromValue":{"type":"text","required":false,"_meta":{"nullable":true}},"toValue":{"type":"text","required":false,"_meta":{"nullable":true}},"note":{"type":"text","required":false},"actorProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"onDelete":"RESTRICT"}}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"employment_changes","sensitive":true,"indexes":[{"name":"employment_changes_employment_idx","columns":["tenantId","employmentId","effectiveOn"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"EmploymentChange","collectionExportName":"EmploymentChangeCollection","validationRules":[],"schema":{"tableName":"employment_changes","ddl":"CREATE TABLE IF NOT EXISTS \\"employment_changes\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"employment_id\\" UUID,\\n \\"kind\\" TEXT,\\n \\"effective_on\\" TEXT,\\n \\"from_value\\" TEXT,\\n \\"to_value\\" TEXT,\\n \\"note\\" TEXT,\\n \\"actor_profile_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"effective_on":{"type":"TEXT","notNull":false,"unique":false},"from_value":{"type":"TEXT","notNull":false,"unique":false},"to_value":{"type":"TEXT","notNull":false,"unique":false},"note":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"employment_changes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"employment_changes_employment_idx","columns":["tenant_id","employment_id","effective_on"]},{"name":"employment_changes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employment_changes_employment_id_idx","columns":["employment_id"]},{"name":"employment_changes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"5d93422f"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentCollection":{"name":"employmentcollection","className":"EmploymentCollection","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentCollection","collection":"employments","description":"Scoped persistence collection; mutations must use EmploymentService.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"employments"},"extends":"SmrtCollection","extendsTypeArg":"Employment","exportName":"EmploymentCollection","collectionExportName":"EmploymentCollectionCollection","schema":{"tableName":"employments","ddl":"CREATE TABLE IF NOT EXISTS \\"employments\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"profile_id\\" UUID,\\n \\"user_id\\" UUID,\\n \\"employer_profile_id\\" UUID,\\n \\"employee_number\\" TEXT,\\n \\"worker_type\\" TEXT,\\n \\"position\\" TEXT,\\n \\"status\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employer_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employee_number":{"type":"TEXT","notNull":false,"unique":false},"worker_type":{"type":"TEXT","notNull":false,"unique":false},"position":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"employments_tenant_id_employee_number_idx","columns":["tenant_id","employee_number"],"unique":true,"nullsNotDistinct":true},{"name":"employments_slug_context_idx","columns":["slug","context"]},{"name":"employments_tenant_profile_uq","columns":["tenant_id","profile_id"],"unique":true},{"name":"employments_tenant_user_idx","columns":["tenant_id","user_id"]},{"name":"employments_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employments_profile_id_idx","columns":["profile_id"]},{"name":"employments_user_id_idx","columns":["user_id"]},{"name":"employments_employer_profile_id_idx","columns":["employer_profile_id"]}],"version":"ff7ef7a8"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentTermCollection":{"name":"employmenttermcollection","className":"EmploymentTermCollection","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentTermCollection","collection":"employmentterms","description":"Scoped term collection; closed like its model.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"employment_terms"},"extends":"SmrtCollection","extendsTypeArg":"EmploymentTerm","exportName":"EmploymentTermCollection","collectionExportName":"EmploymentTermCollectionCollection","schema":{"tableName":"employment_terms","ddl":"CREATE TABLE IF NOT EXISTS \\"employment_terms\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"employment_id\\" UUID,\\n \\"started_on\\" TEXT,\\n \\"ended_on\\" TEXT,\\n \\"end_reason\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"started_on":{"type":"TEXT","notNull":false,"unique":false},"ended_on":{"type":"TEXT","notNull":false,"unique":false},"end_reason":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"employment_terms_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"employment_terms_employment_idx","columns":["tenant_id","employment_id","started_on"]},{"name":"employment_terms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employment_terms_employment_id_idx","columns":["employment_id"]}],"version":"165d209b"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentChangeCollection":{"name":"employmentchangecollection","className":"EmploymentChangeCollection","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentChangeCollection","collection":"employmentchanges","description":"Scoped append-only change collection; closed like its model.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"employment_changes"},"extends":"SmrtCollection","extendsTypeArg":"EmploymentChange","exportName":"EmploymentChangeCollection","collectionExportName":"EmploymentChangeCollectionCollection","schema":{"tableName":"employment_changes","ddl":"CREATE TABLE IF NOT EXISTS \\"employment_changes\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"employment_id\\" UUID,\\n \\"kind\\" TEXT,\\n \\"effective_on\\" TEXT,\\n \\"from_value\\" TEXT,\\n \\"to_value\\" TEXT,\\n \\"note\\" TEXT,\\n \\"actor_profile_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"effective_on":{"type":"TEXT","notNull":false,"unique":false},"from_value":{"type":"TEXT","notNull":false,"unique":false},"to_value":{"type":"TEXT","notNull":false,"unique":false},"note":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"employment_changes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"employment_changes_employment_idx","columns":["tenant_id","employment_id","effective_on"]},{"name":"employment_changes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employment_changes_employment_id_idx","columns":["employment_id"]},{"name":"employment_changes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"5d93422f"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:Qualification":{"name":"qualification","className":"Qualification","qualifiedName":"@happyvertical/smrt-human-resources:Qualification","collection":"qualifications","description":"A qualification definition: a managed list per tenant. Other packages gate work by referencing its id (@happyvertical/smrt-human-resources:Qualification).","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"key":{"type":"text","required":false},"name":{"type":"text","required":false},"kind":{"type":"text","required":false,"_meta":{},"enum":["ticket","certification","authorization","training","restriction"]},"issuingBody":{"type":"text","required":false},"expires":{"type":"boolean","required":true,"default":false},"validityMonths":{"type":"integer","required":false,"_meta":{"nullable":true}},"scope":{"type":"text","required":false,"_meta":{},"enum":["person","employment"]},"isActive":{"type":"boolean","required":true,"default":true}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"qualifications","sensitive":true,"conflictColumns":["tenant_id","key"],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"}},"extends":"SmrtObject","exportName":"Qualification","collectionExportName":"QualificationCollection","displayLabelField":"name","validationRules":[{"field":"expires","rule":"required","fieldType":"boolean"},{"field":"isActive","rule":"required","fieldType":"boolean"}],"schema":{"tableName":"qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"qualifications\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"key\\" TEXT,\\n \\"name\\" TEXT,\\n \\"kind\\" TEXT,\\n \\"issuing_body\\" TEXT,\\n \\"expires\\" BOOLEAN NOT NULL DEFAULT FALSE,\\n \\"validity_months\\" INTEGER,\\n \\"scope\\" TEXT,\\n \\"is_active\\" BOOLEAN NOT NULL DEFAULT TRUE\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"key":{"type":"TEXT","notNull":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false},"kind":{"type":"TEXT","notNull":false,"unique":false},"issuing_body":{"type":"TEXT","notNull":false,"unique":false},"expires":{"type":"BOOLEAN","notNull":true,"unique":false,"default":false},"validity_months":{"type":"INTEGER","notNull":false,"unique":false},"scope":{"type":"TEXT","notNull":false,"unique":false},"is_active":{"type":"BOOLEAN","notNull":true,"unique":false,"default":true}},"indexes":[{"name":"qualifications_tenant_id_key_idx","columns":["tenant_id","key"],"unique":true,"nullsNotDistinct":true},{"name":"qualifications_slug_context_idx","columns":["slug","context"]},{"name":"qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9fa3721"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:HeldQualification":{"name":"heldqualification","className":"HeldQualification","qualifiedName":"@happyvertical/smrt-human-resources:HeldQualification","collection":"heldqualifications","description":"A person holds a qualification. employmentId is set when the definition's scope is employment; such a row is revoked when that employment ends.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"qualificationId":{"type":"foreignKey","required":false,"related":"Qualification","_meta":{"onDelete":"RESTRICT"}},"profileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"onDelete":"RESTRICT"}},"employmentId":{"type":"foreignKey","required":false,"related":"Employment","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"issuedOn":{"type":"text","required":false,"_meta":{}},"expiresOn":{"type":"text","required":false,"_meta":{"nullable":true}},"certificateNumber":{"type":"text","required":false},"status":{"type":"text","required":false,"_meta":{},"enum":["valid","expired","suspended","revoked"]},"verifiedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"verifiedAt":{"type":"datetime","required":false},"documentAssetId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-assets:Asset","_meta":{"nullable":true}},"renewalOfId":{"type":"foreignKey","required":false,"related":"HeldQualification","_meta":{"nullable":true,"onDelete":"RESTRICT"}}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"held_qualifications","sensitive":true,"indexes":[{"name":"held_qualifications_profile_idx","columns":["tenantId","profileId","qualificationId"]},{"name":"held_qualifications_expiry_idx","columns":["tenantId","status","expiresOn"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"HeldQualification","collectionExportName":"HeldQualificationCollection","validationRules":[],"schema":{"tableName":"held_qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"held_qualifications\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"qualification_id\\" UUID,\\n \\"profile_id\\" UUID,\\n \\"employment_id\\" UUID,\\n \\"issued_on\\" TEXT,\\n \\"expires_on\\" TEXT,\\n \\"certificate_number\\" TEXT,\\n \\"status\\" TEXT,\\n \\"verified_by_profile_id\\" UUID,\\n \\"verified_at\\" TIMESTAMP,\\n \\"document_asset_id\\" UUID,\\n \\"renewal_of_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"qualification_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"issued_on":{"type":"TEXT","notNull":false,"unique":false},"expires_on":{"type":"TEXT","notNull":false,"unique":false},"certificate_number":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"verified_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"verified_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"document_asset_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"renewal_of_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"held_qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}}},"indexes":[{"name":"held_qualifications_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"held_qualifications_profile_idx","columns":["tenant_id","profile_id","qualification_id"]},{"name":"held_qualifications_expiry_idx","columns":["tenant_id","status","expires_on"]},{"name":"held_qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"held_qualifications_qualification_id_idx","columns":["qualification_id"]},{"name":"held_qualifications_profile_id_idx","columns":["profile_id"]},{"name":"held_qualifications_employment_id_idx","columns":["employment_id"]},{"name":"held_qualifications_verified_by_profile_id_idx","columns":["verified_by_profile_id"]},{"name":"held_qualifications_document_asset_id_idx","columns":["document_asset_id"]},{"name":"held_qualifications_renewal_of_id_idx","columns":["renewal_of_id"]}],"version":"fafbe37f"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:HeldQualificationChange":{"name":"heldqualificationchange","className":"HeldQualificationChange","qualifiedName":"@happyvertical/smrt-human-resources:HeldQualificationChange","collection":"heldqualificationchanges","description":"Append-only dated change to a held qualification, attributed to an actor.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"heldQualificationId":{"type":"foreignKey","required":false,"related":"HeldQualification","_meta":{"onDelete":"RESTRICT"}},"kind":{"type":"text","required":false,"_meta":{},"enum":["granted","renewed","suspended","reinstated","revoked","expired"]},"effectiveOn":{"type":"text","required":false,"_meta":{}},"reason":{"type":"text","required":false},"actorProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"onDelete":"RESTRICT"}}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"held_qualification_changes","sensitive":true,"indexes":[{"name":"held_qualification_changes_held_idx","columns":["tenantId","heldQualificationId","effectiveOn"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"HeldQualificationChange","collectionExportName":"HeldQualificationChangeCollection","validationRules":[],"schema":{"tableName":"held_qualification_changes","ddl":"CREATE TABLE IF NOT EXISTS \\"held_qualification_changes\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"held_qualification_id\\" UUID,\\n \\"kind\\" TEXT,\\n \\"effective_on\\" TEXT,\\n \\"reason\\" TEXT,\\n \\"actor_profile_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"held_qualification_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"held_qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"effective_on":{"type":"TEXT","notNull":false,"unique":false},"reason":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"held_qualification_changes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"held_qualification_changes_held_idx","columns":["tenant_id","held_qualification_id","effective_on"]},{"name":"held_qualification_changes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"held_qualification_changes_held_qualification_id_idx","columns":["held_qualification_id"]},{"name":"held_qualification_changes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"ed9ed5e1"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:QualificationCollection":{"name":"qualificationcollection","className":"QualificationCollection","qualifiedName":"@happyvertical/smrt-human-resources:QualificationCollection","collection":"qualifications","description":"Scoped definition collection; mutations must use QualificationService.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"qualifications"},"extends":"SmrtCollection","extendsTypeArg":"Qualification","exportName":"QualificationCollection","collectionExportName":"QualificationCollectionCollection","schema":{"tableName":"qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"qualifications\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"key\\" TEXT,\\n \\"name\\" TEXT,\\n \\"kind\\" TEXT,\\n \\"issuing_body\\" TEXT,\\n \\"expires\\" BOOLEAN NOT NULL DEFAULT FALSE,\\n \\"validity_months\\" INTEGER,\\n \\"scope\\" TEXT,\\n \\"is_active\\" BOOLEAN NOT NULL DEFAULT TRUE\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"key":{"type":"TEXT","notNull":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false},"kind":{"type":"TEXT","notNull":false,"unique":false},"issuing_body":{"type":"TEXT","notNull":false,"unique":false},"expires":{"type":"BOOLEAN","notNull":true,"unique":false,"default":false},"validity_months":{"type":"INTEGER","notNull":false,"unique":false},"scope":{"type":"TEXT","notNull":false,"unique":false},"is_active":{"type":"BOOLEAN","notNull":true,"unique":false,"default":true}},"indexes":[{"name":"qualifications_tenant_id_key_idx","columns":["tenant_id","key"],"unique":true,"nullsNotDistinct":true},{"name":"qualifications_slug_context_idx","columns":["slug","context"]},{"name":"qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9fa3721"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:HeldQualificationCollection":{"name":"heldqualificationcollection","className":"HeldQualificationCollection","qualifiedName":"@happyvertical/smrt-human-resources:HeldQualificationCollection","collection":"heldqualifications","description":"Scoped held-qualification collection; closed like its model.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"held_qualifications"},"extends":"SmrtCollection","extendsTypeArg":"HeldQualification","exportName":"HeldQualificationCollection","collectionExportName":"HeldQualificationCollectionCollection","schema":{"tableName":"held_qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"held_qualifications\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"qualification_id\\" UUID,\\n \\"profile_id\\" UUID,\\n \\"employment_id\\" UUID,\\n \\"issued_on\\" TEXT,\\n \\"expires_on\\" TEXT,\\n \\"certificate_number\\" TEXT,\\n \\"status\\" TEXT,\\n \\"verified_by_profile_id\\" UUID,\\n \\"verified_at\\" TIMESTAMP,\\n \\"document_asset_id\\" UUID,\\n \\"renewal_of_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"qualification_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"issued_on":{"type":"TEXT","notNull":false,"unique":false},"expires_on":{"type":"TEXT","notNull":false,"unique":false},"certificate_number":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"verified_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"verified_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"document_asset_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"renewal_of_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"held_qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}}},"indexes":[{"name":"held_qualifications_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"held_qualifications_profile_idx","columns":["tenant_id","profile_id","qualification_id"]},{"name":"held_qualifications_expiry_idx","columns":["tenant_id","status","expires_on"]},{"name":"held_qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"held_qualifications_qualification_id_idx","columns":["qualification_id"]},{"name":"held_qualifications_profile_id_idx","columns":["profile_id"]},{"name":"held_qualifications_employment_id_idx","columns":["employment_id"]},{"name":"held_qualifications_verified_by_profile_id_idx","columns":["verified_by_profile_id"]},{"name":"held_qualifications_document_asset_id_idx","columns":["document_asset_id"]},{"name":"held_qualifications_renewal_of_id_idx","columns":["renewal_of_id"]}],"version":"fafbe37f"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:HeldQualificationChangeCollection":{"name":"heldqualificationchangecollection","className":"HeldQualificationChangeCollection","qualifiedName":"@happyvertical/smrt-human-resources:HeldQualificationChangeCollection","collection":"heldqualificationchanges","description":"Scoped append-only change collection; closed like its model.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"held_qualification_changes"},"extends":"SmrtCollection","extendsTypeArg":"HeldQualificationChange","exportName":"HeldQualificationChangeCollection","collectionExportName":"HeldQualificationChangeCollectionCollection","schema":{"tableName":"held_qualification_changes","ddl":"CREATE TABLE IF NOT EXISTS \\"held_qualification_changes\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"held_qualification_id\\" UUID,\\n \\"kind\\" TEXT,\\n \\"effective_on\\" TEXT,\\n \\"reason\\" TEXT,\\n \\"actor_profile_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"held_qualification_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"held_qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"effective_on":{"type":"TEXT","notNull":false,"unique":false},"reason":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"held_qualification_changes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"held_qualification_changes_held_idx","columns":["tenant_id","held_qualification_id","effective_on"]},{"name":"held_qualification_changes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"held_qualification_changes_held_qualification_id_idx","columns":["held_qualification_id"]},{"name":"held_qualification_changes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"ed9ed5e1"},"importPath":"@happyvertical/smrt-human-resources"}},"moduleType":"smrt","smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3624"],"via":["@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
|
|
7
|
+
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-human-resources","packageVersion":"0.57.35","objects":{"@happyvertical/smrt-human-resources:Employment":{"name":"employment","className":"Employment","qualifiedName":"@happyvertical/smrt-human-resources:Employment","collection":"employments","description":"One person's employment with a tenant: the stable record applications and payroll key on. There is one per tenant and profile; a rehire adds an EmploymentTerm to the same row.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"profileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","description":"The person who works for you.","_meta":{"description":"The person who works for you.","onDelete":"RESTRICT"}},"userId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-users:User","_meta":{"nullable":true}},"employerProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"employeeNumber":{"type":"text","required":false,"description":"Your own reference for this person, such as a staff number.","_meta":{"description":"Your own reference for this person, such as a staff number."}},"workerType":{"type":"text","required":false,"description":"Whether they are an employee, contractor or another kind of worker.","_meta":{"description":"Whether they are an employee, contractor or another kind of worker."}},"position":{"type":"text","required":false,"description":"Their role or trade.","_meta":{"nullable":true,"description":"Their role or trade."}},"status":{"type":"text","required":false,"description":"Whether they currently work for you.","_meta":{"description":"Whether they currently work for you."},"enum":["active","on-leave","ended"]}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"employments","sensitive":true,"conflictColumns":["tenant_id","employee_number"],"indexes":[{"name":"employments_tenant_profile_uq","columns":["tenantId","profileId"],"unique":true},{"name":"employments_tenant_user_idx","columns":["tenantId","userId"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"}},"extends":"SmrtObject","exportName":"Employment","collectionExportName":"EmploymentCollection","validationRules":[],"schema":{"tableName":"employments","ddl":"CREATE TABLE IF NOT EXISTS \\"employments\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"profile_id\\" UUID,\\n \\"user_id\\" UUID,\\n \\"employer_profile_id\\" UUID,\\n \\"employee_number\\" TEXT,\\n \\"worker_type\\" TEXT,\\n \\"position\\" TEXT,\\n \\"status\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employer_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employee_number":{"type":"TEXT","notNull":false,"unique":false},"worker_type":{"type":"TEXT","notNull":false,"unique":false},"position":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"employments_tenant_id_employee_number_idx","columns":["tenant_id","employee_number"],"unique":true,"nullsNotDistinct":true},{"name":"employments_slug_context_idx","columns":["slug","context"]},{"name":"employments_tenant_profile_uq","columns":["tenant_id","profile_id"],"unique":true},{"name":"employments_tenant_user_idx","columns":["tenant_id","user_id"]},{"name":"employments_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employments_profile_id_idx","columns":["profile_id"]},{"name":"employments_user_id_idx","columns":["user_id"]},{"name":"employments_employer_profile_id_idx","columns":["employer_profile_id"]}],"version":"ff7ef7a8"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentTerm":{"name":"employmentterm","className":"EmploymentTerm","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentTerm","collection":"employmentterms","description":"One continuous period of employment. endedOn is the last day employed (inclusive); null means the term is open. \\"Employed on a date\\" is answered from terms, never from Employment.status.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"employmentId":{"type":"foreignKey","required":false,"related":"Employment","description":"The person this period of work belongs to.","_meta":{"description":"The person this period of work belongs to.","onDelete":"RESTRICT"}},"startedOn":{"type":"text","required":false,"description":"The first day of this period of work.","_meta":{"description":"The first day of this period of work."}},"endedOn":{"type":"text","required":false,"description":"The last day of this period of work. Empty while it continues.","_meta":{"nullable":true,"description":"The last day of this period of work. Empty while it continues."}},"endReason":{"type":"text","required":false,"description":"Why the period of work ended.","_meta":{"description":"Why the period of work ended."}}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"employment_terms","sensitive":true,"indexes":[{"name":"employment_terms_employment_idx","columns":["tenantId","employmentId","startedOn"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"EmploymentTerm","collectionExportName":"EmploymentTermCollection","validationRules":[],"schema":{"tableName":"employment_terms","ddl":"CREATE TABLE IF NOT EXISTS \\"employment_terms\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"employment_id\\" UUID,\\n \\"started_on\\" TEXT,\\n \\"ended_on\\" TEXT,\\n \\"end_reason\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"started_on":{"type":"TEXT","notNull":false,"unique":false},"ended_on":{"type":"TEXT","notNull":false,"unique":false},"end_reason":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"employment_terms_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"employment_terms_employment_idx","columns":["tenant_id","employment_id","started_on"]},{"name":"employment_terms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employment_terms_employment_id_idx","columns":["employment_id"]}],"version":"165d209b"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentChange":{"name":"employmentchange","className":"EmploymentChange","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentChange","collection":"employmentchanges","description":"Append-only dated change to an employment, attributed to an actor.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"employmentId":{"type":"foreignKey","required":false,"related":"Employment","_meta":{"onDelete":"RESTRICT"}},"kind":{"type":"text","required":false,"_meta":{},"enum":["hired","ended","rehired","position-changed","worker-type-changed","leave-started","leave-ended","login-linked","login-unlinked"]},"effectiveOn":{"type":"text","required":false,"_meta":{}},"fromValue":{"type":"text","required":false,"_meta":{"nullable":true}},"toValue":{"type":"text","required":false,"_meta":{"nullable":true}},"note":{"type":"text","required":false},"actorProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"onDelete":"RESTRICT"}}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"employment_changes","sensitive":true,"indexes":[{"name":"employment_changes_employment_idx","columns":["tenantId","employmentId","effectiveOn"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"EmploymentChange","collectionExportName":"EmploymentChangeCollection","validationRules":[],"schema":{"tableName":"employment_changes","ddl":"CREATE TABLE IF NOT EXISTS \\"employment_changes\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"employment_id\\" UUID,\\n \\"kind\\" TEXT,\\n \\"effective_on\\" TEXT,\\n \\"from_value\\" TEXT,\\n \\"to_value\\" TEXT,\\n \\"note\\" TEXT,\\n \\"actor_profile_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"effective_on":{"type":"TEXT","notNull":false,"unique":false},"from_value":{"type":"TEXT","notNull":false,"unique":false},"to_value":{"type":"TEXT","notNull":false,"unique":false},"note":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"employment_changes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"employment_changes_employment_idx","columns":["tenant_id","employment_id","effective_on"]},{"name":"employment_changes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employment_changes_employment_id_idx","columns":["employment_id"]},{"name":"employment_changes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"5d93422f"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentCollection":{"name":"employmentcollection","className":"EmploymentCollection","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentCollection","collection":"employments","description":"Scoped persistence collection; mutations must use EmploymentService.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"employments"},"extends":"SmrtCollection","extendsTypeArg":"Employment","exportName":"EmploymentCollection","collectionExportName":"EmploymentCollectionCollection","schema":{"tableName":"employments","ddl":"CREATE TABLE IF NOT EXISTS \\"employments\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"profile_id\\" UUID,\\n \\"user_id\\" UUID,\\n \\"employer_profile_id\\" UUID,\\n \\"employee_number\\" TEXT,\\n \\"worker_type\\" TEXT,\\n \\"position\\" TEXT,\\n \\"status\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"user_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employer_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employee_number":{"type":"TEXT","notNull":false,"unique":false},"worker_type":{"type":"TEXT","notNull":false,"unique":false},"position":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"employments_tenant_id_employee_number_idx","columns":["tenant_id","employee_number"],"unique":true,"nullsNotDistinct":true},{"name":"employments_slug_context_idx","columns":["slug","context"]},{"name":"employments_tenant_profile_uq","columns":["tenant_id","profile_id"],"unique":true},{"name":"employments_tenant_user_idx","columns":["tenant_id","user_id"]},{"name":"employments_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employments_profile_id_idx","columns":["profile_id"]},{"name":"employments_user_id_idx","columns":["user_id"]},{"name":"employments_employer_profile_id_idx","columns":["employer_profile_id"]}],"version":"ff7ef7a8"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentTermCollection":{"name":"employmenttermcollection","className":"EmploymentTermCollection","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentTermCollection","collection":"employmentterms","description":"Scoped term collection; closed like its model.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"employment_terms"},"extends":"SmrtCollection","extendsTypeArg":"EmploymentTerm","exportName":"EmploymentTermCollection","collectionExportName":"EmploymentTermCollectionCollection","schema":{"tableName":"employment_terms","ddl":"CREATE TABLE IF NOT EXISTS \\"employment_terms\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"employment_id\\" UUID,\\n \\"started_on\\" TEXT,\\n \\"ended_on\\" TEXT,\\n \\"end_reason\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"started_on":{"type":"TEXT","notNull":false,"unique":false},"ended_on":{"type":"TEXT","notNull":false,"unique":false},"end_reason":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"employment_terms_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"employment_terms_employment_idx","columns":["tenant_id","employment_id","started_on"]},{"name":"employment_terms_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employment_terms_employment_id_idx","columns":["employment_id"]}],"version":"165d209b"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:EmploymentChangeCollection":{"name":"employmentchangecollection","className":"EmploymentChangeCollection","qualifiedName":"@happyvertical/smrt-human-resources:EmploymentChangeCollection","collection":"employmentchanges","description":"Scoped append-only change collection; closed like its model.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/employment/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"employment_changes"},"extends":"SmrtCollection","extendsTypeArg":"EmploymentChange","exportName":"EmploymentChangeCollection","collectionExportName":"EmploymentChangeCollectionCollection","schema":{"tableName":"employment_changes","ddl":"CREATE TABLE IF NOT EXISTS \\"employment_changes\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"employment_id\\" UUID,\\n \\"kind\\" TEXT,\\n \\"effective_on\\" TEXT,\\n \\"from_value\\" TEXT,\\n \\"to_value\\" TEXT,\\n \\"note\\" TEXT,\\n \\"actor_profile_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"effective_on":{"type":"TEXT","notNull":false,"unique":false},"from_value":{"type":"TEXT","notNull":false,"unique":false},"to_value":{"type":"TEXT","notNull":false,"unique":false},"note":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"employment_changes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"employment_changes_employment_idx","columns":["tenant_id","employment_id","effective_on"]},{"name":"employment_changes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"employment_changes_employment_id_idx","columns":["employment_id"]},{"name":"employment_changes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"5d93422f"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:Qualification":{"name":"qualification","className":"Qualification","qualifiedName":"@happyvertical/smrt-human-resources:Qualification","collection":"qualifications","description":"A qualification definition: a managed list per tenant. Other packages gate work by referencing its id (@happyvertical/smrt-human-resources:Qualification).","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"key":{"type":"text","required":false},"name":{"type":"text","required":false,"description":"What the qualification is called, such as First aid.","_meta":{"description":"What the qualification is called, such as First aid."}},"kind":{"type":"text","required":false,"description":"The sort of qualification, such as a certificate or a licence.","_meta":{"description":"The sort of qualification, such as a certificate or a licence."},"enum":["ticket","certification","authorization","training","restriction"]},"issuingBody":{"type":"text","required":false,"description":"Who gives it out.","_meta":{"description":"Who gives it out."}},"expires":{"type":"boolean","required":true,"default":false,"description":"Whether it has to be renewed.","_meta":{"description":"Whether it has to be renewed."}},"validityMonths":{"type":"integer","required":false,"description":"How many months it lasts once given.","_meta":{"nullable":true,"description":"How many months it lasts once given."}},"scope":{"type":"text","required":false,"_meta":{},"enum":["person","employment"]},"isActive":{"type":"boolean","required":true,"default":true}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"qualifications","sensitive":true,"conflictColumns":["tenant_id","key"],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"}},"extends":"SmrtObject","exportName":"Qualification","collectionExportName":"QualificationCollection","displayLabelField":"name","validationRules":[{"field":"expires","rule":"required","fieldType":"boolean"},{"field":"isActive","rule":"required","fieldType":"boolean"}],"schema":{"tableName":"qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"qualifications\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"key\\" TEXT,\\n \\"name\\" TEXT,\\n \\"kind\\" TEXT,\\n \\"issuing_body\\" TEXT,\\n \\"expires\\" BOOLEAN NOT NULL DEFAULT FALSE,\\n \\"validity_months\\" INTEGER,\\n \\"scope\\" TEXT,\\n \\"is_active\\" BOOLEAN NOT NULL DEFAULT TRUE\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"key":{"type":"TEXT","notNull":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false},"kind":{"type":"TEXT","notNull":false,"unique":false},"issuing_body":{"type":"TEXT","notNull":false,"unique":false},"expires":{"type":"BOOLEAN","notNull":true,"unique":false,"default":false},"validity_months":{"type":"INTEGER","notNull":false,"unique":false},"scope":{"type":"TEXT","notNull":false,"unique":false},"is_active":{"type":"BOOLEAN","notNull":true,"unique":false,"default":true}},"indexes":[{"name":"qualifications_tenant_id_key_idx","columns":["tenant_id","key"],"unique":true,"nullsNotDistinct":true},{"name":"qualifications_slug_context_idx","columns":["slug","context"]},{"name":"qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9fa3721"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:HeldQualification":{"name":"heldqualification","className":"HeldQualification","qualifiedName":"@happyvertical/smrt-human-resources:HeldQualification","collection":"heldqualifications","description":"A person holds a qualification. employmentId is set when the definition's scope is employment; such a row is revoked when that employment ends.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"qualificationId":{"type":"foreignKey","required":false,"related":"Qualification","description":"The qualification this person holds.","_meta":{"description":"The qualification this person holds.","onDelete":"RESTRICT"}},"profileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","description":"The person who holds it.","_meta":{"description":"The person who holds it.","onDelete":"RESTRICT"}},"employmentId":{"type":"foreignKey","required":false,"related":"Employment","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"issuedOn":{"type":"text","required":false,"description":"The day it was given.","_meta":{"description":"The day it was given."}},"expiresOn":{"type":"text","required":false,"description":"The day it runs out. Empty if it does not.","_meta":{"nullable":true,"description":"The day it runs out. Empty if it does not."}},"certificateNumber":{"type":"text","required":false,"description":"The number printed on the certificate.","_meta":{"description":"The number printed on the certificate."}},"status":{"type":"text","required":false,"description":"Whether it is valid, expired, suspended or revoked.","_meta":{"description":"Whether it is valid, expired, suspended or revoked."},"enum":["valid","expired","suspended","revoked"]},"verifiedByProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"nullable":true,"onDelete":"RESTRICT"}},"verifiedAt":{"type":"datetime","required":false},"documentAssetId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-assets:Asset","_meta":{"nullable":true}},"renewalOfId":{"type":"foreignKey","required":false,"related":"HeldQualification","_meta":{"nullable":true,"onDelete":"RESTRICT"}}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"held_qualifications","sensitive":true,"indexes":[{"name":"held_qualifications_profile_idx","columns":["tenantId","profileId","qualificationId"]},{"name":"held_qualifications_expiry_idx","columns":["tenantId","status","expiresOn"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"HeldQualification","collectionExportName":"HeldQualificationCollection","validationRules":[],"schema":{"tableName":"held_qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"held_qualifications\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"qualification_id\\" UUID,\\n \\"profile_id\\" UUID,\\n \\"employment_id\\" UUID,\\n \\"issued_on\\" TEXT,\\n \\"expires_on\\" TEXT,\\n \\"certificate_number\\" TEXT,\\n \\"status\\" TEXT,\\n \\"verified_by_profile_id\\" UUID,\\n \\"verified_at\\" TIMESTAMP,\\n \\"document_asset_id\\" UUID,\\n \\"renewal_of_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"qualification_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"issued_on":{"type":"TEXT","notNull":false,"unique":false},"expires_on":{"type":"TEXT","notNull":false,"unique":false},"certificate_number":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"verified_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"verified_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"document_asset_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"renewal_of_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"held_qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}}},"indexes":[{"name":"held_qualifications_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"held_qualifications_profile_idx","columns":["tenant_id","profile_id","qualification_id"]},{"name":"held_qualifications_expiry_idx","columns":["tenant_id","status","expires_on"]},{"name":"held_qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"held_qualifications_qualification_id_idx","columns":["qualification_id"]},{"name":"held_qualifications_profile_id_idx","columns":["profile_id"]},{"name":"held_qualifications_employment_id_idx","columns":["employment_id"]},{"name":"held_qualifications_verified_by_profile_id_idx","columns":["verified_by_profile_id"]},{"name":"held_qualifications_document_asset_id_idx","columns":["document_asset_id"]},{"name":"held_qualifications_renewal_of_id_idx","columns":["renewal_of_id"]}],"version":"fafbe37f"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:HeldQualificationChange":{"name":"heldqualificationchange","className":"HeldQualificationChange","qualifiedName":"@happyvertical/smrt-human-resources:HeldQualificationChange","collection":"heldqualificationchanges","description":"Append-only dated change to a held qualification, attributed to an actor.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"heldQualificationId":{"type":"foreignKey","required":false,"related":"HeldQualification","_meta":{"onDelete":"RESTRICT"}},"kind":{"type":"text","required":false,"_meta":{},"enum":["granted","renewed","suspended","reinstated","revoked","expired"]},"effectiveOn":{"type":"text","required":false,"_meta":{}},"reason":{"type":"text","required":false},"actorProfileId":{"type":"crossPackageRef","required":false,"related":"@happyvertical/smrt-profiles:Profile","_meta":{"onDelete":"RESTRICT"}}},"methods":{"save":{"name":"save","async":true,"parameters":[],"returnType":"Promise<this>","isStatic":false,"isPublic":true},"delete":{"name":"delete","async":true,"parameters":[],"returnType":"Promise<void>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"held_qualification_changes","sensitive":true,"indexes":[{"name":"held_qualification_changes_held_idx","columns":["tenantId","heldQualificationId","effectiveOn"]}],"api":{"include":[]},"cli":{"include":[]},"mcp":{"include":[]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"HeldQualificationChange","collectionExportName":"HeldQualificationChangeCollection","validationRules":[],"schema":{"tableName":"held_qualification_changes","ddl":"CREATE TABLE IF NOT EXISTS \\"held_qualification_changes\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"held_qualification_id\\" UUID,\\n \\"kind\\" TEXT,\\n \\"effective_on\\" TEXT,\\n \\"reason\\" TEXT,\\n \\"actor_profile_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"held_qualification_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"held_qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"effective_on":{"type":"TEXT","notNull":false,"unique":false},"reason":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"held_qualification_changes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"held_qualification_changes_held_idx","columns":["tenant_id","held_qualification_id","effective_on"]},{"name":"held_qualification_changes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"held_qualification_changes_held_qualification_id_idx","columns":["held_qualification_id"]},{"name":"held_qualification_changes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"ed9ed5e1"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:QualificationCollection":{"name":"qualificationcollection","className":"QualificationCollection","qualifiedName":"@happyvertical/smrt-human-resources:QualificationCollection","collection":"qualifications","description":"Scoped definition collection; mutations must use QualificationService.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"qualifications"},"extends":"SmrtCollection","extendsTypeArg":"Qualification","exportName":"QualificationCollection","collectionExportName":"QualificationCollectionCollection","schema":{"tableName":"qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"qualifications\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"key\\" TEXT,\\n \\"name\\" TEXT,\\n \\"kind\\" TEXT,\\n \\"issuing_body\\" TEXT,\\n \\"expires\\" BOOLEAN NOT NULL DEFAULT FALSE,\\n \\"validity_months\\" INTEGER,\\n \\"scope\\" TEXT,\\n \\"is_active\\" BOOLEAN NOT NULL DEFAULT TRUE\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"key":{"type":"TEXT","notNull":false,"unique":false},"name":{"type":"TEXT","notNull":false,"unique":false},"kind":{"type":"TEXT","notNull":false,"unique":false},"issuing_body":{"type":"TEXT","notNull":false,"unique":false},"expires":{"type":"BOOLEAN","notNull":true,"unique":false,"default":false},"validity_months":{"type":"INTEGER","notNull":false,"unique":false},"scope":{"type":"TEXT","notNull":false,"unique":false},"is_active":{"type":"BOOLEAN","notNull":true,"unique":false,"default":true}},"indexes":[{"name":"qualifications_tenant_id_key_idx","columns":["tenant_id","key"],"unique":true,"nullsNotDistinct":true},{"name":"qualifications_slug_context_idx","columns":["slug","context"]},{"name":"qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9fa3721"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:HeldQualificationCollection":{"name":"heldqualificationcollection","className":"HeldQualificationCollection","qualifiedName":"@happyvertical/smrt-human-resources:HeldQualificationCollection","collection":"heldqualifications","description":"Scoped held-qualification collection; closed like its model.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"held_qualifications"},"extends":"SmrtCollection","extendsTypeArg":"HeldQualification","exportName":"HeldQualificationCollection","collectionExportName":"HeldQualificationCollectionCollection","schema":{"tableName":"held_qualifications","ddl":"CREATE TABLE IF NOT EXISTS \\"held_qualifications\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"qualification_id\\" UUID,\\n \\"profile_id\\" UUID,\\n \\"employment_id\\" UUID,\\n \\"issued_on\\" TEXT,\\n \\"expires_on\\" TEXT,\\n \\"certificate_number\\" TEXT,\\n \\"status\\" TEXT,\\n \\"verified_by_profile_id\\" UUID,\\n \\"verified_at\\" TIMESTAMP,\\n \\"document_asset_id\\" UUID,\\n \\"renewal_of_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"qualification_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"employment_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"employments","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"issued_on":{"type":"TEXT","notNull":false,"unique":false},"expires_on":{"type":"TEXT","notNull":false,"unique":false},"certificate_number":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":false,"unique":false},"verified_by_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"verified_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"document_asset_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false},"renewal_of_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"held_qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}}},"indexes":[{"name":"held_qualifications_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"held_qualifications_profile_idx","columns":["tenant_id","profile_id","qualification_id"]},{"name":"held_qualifications_expiry_idx","columns":["tenant_id","status","expires_on"]},{"name":"held_qualifications_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"held_qualifications_qualification_id_idx","columns":["qualification_id"]},{"name":"held_qualifications_profile_id_idx","columns":["profile_id"]},{"name":"held_qualifications_employment_id_idx","columns":["employment_id"]},{"name":"held_qualifications_verified_by_profile_id_idx","columns":["verified_by_profile_id"]},{"name":"held_qualifications_document_asset_id_idx","columns":["document_asset_id"]},{"name":"held_qualifications_renewal_of_id_idx","columns":["renewal_of_id"]}],"version":"fafbe37f"},"importPath":"@happyvertical/smrt-human-resources"},"@happyvertical/smrt-human-resources:HeldQualificationChangeCollection":{"name":"heldqualificationchangecollection","className":"HeldQualificationChangeCollection","qualifiedName":"@happyvertical/smrt-human-resources:HeldQualificationChangeCollection","collection":"heldqualificationchanges","description":"Scoped append-only change collection; closed like its model.","filePath":"/home/runner/work/smrt/smrt/packages/human-resources/src/qualifications/models.ts","packageName":"@happyvertical/smrt-human-resources","fields":{},"methods":{},"decoratorConfig":{"api":{"include":[]},"mcp":{"include":[]},"cli":false,"tableName":"held_qualification_changes"},"extends":"SmrtCollection","extendsTypeArg":"HeldQualificationChange","exportName":"HeldQualificationChangeCollection","collectionExportName":"HeldQualificationChangeCollectionCollection","schema":{"tableName":"held_qualification_changes","ddl":"CREATE TABLE IF NOT EXISTS \\"held_qualification_changes\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID NOT NULL,\\n \\"held_qualification_id\\" UUID,\\n \\"kind\\" TEXT,\\n \\"effective_on\\" TEXT,\\n \\"reason\\" TEXT,\\n \\"actor_profile_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"held_qualification_id":{"type":"UUID","referenceKind":"foreignKey","notNull":false,"unique":false,"foreignKey":{"table":"held_qualifications","column":"id","onDelete":"RESTRICT","onUpdate":"CASCADE"}},"kind":{"type":"TEXT","notNull":false,"unique":false},"effective_on":{"type":"TEXT","notNull":false,"unique":false},"reason":{"type":"TEXT","notNull":false,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":false,"unique":false}},"indexes":[{"name":"held_qualification_changes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"held_qualification_changes_held_idx","columns":["tenant_id","held_qualification_id","effective_on"]},{"name":"held_qualification_changes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"held_qualification_changes_held_qualification_id_idx","columns":["held_qualification_id"]},{"name":"held_qualification_changes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"ed9ed5e1"},"importPath":"@happyvertical/smrt-human-resources"}},"moduleType":"smrt","recipes":[{"id":"human-resources.people","className":"HumanResourcesPeopleRecipe","label":"Employees","summary":"Keep a record of who works for you and in what role. Only people can see it; agents cannot read it.","synonyms":["hr","human resources","staff","people","team","workers"],"models":["@happyvertical/smrt-human-resources:Employment","@happyvertical/smrt-human-resources:EmploymentTerm"],"nav":[{"label":"Employees","model":"@happyvertical/smrt-human-resources:Employment","icon":"users","description":"Everyone who works for you, with their role and status.","noun":"employee"}],"requires":[],"section":{"id":"staff","label":"Staff","icon":"users","description":"The people who work for you."},"options":{"@happyvertical/smrt-human-resources:Employment":{"fields":{"profileId":{"label":"Person","order":1},"employeeNumber":{"order":2},"position":{"order":3},"workerType":{"order":4},"status":{"order":5},"tenantId":{"visibility":"hidden"},"userId":{"visibility":"advanced"},"employerProfileId":{"visibility":"advanced"}}},"@happyvertical/smrt-human-resources:EmploymentTerm":{"fields":{"employmentId":{"label":"Person","order":1},"startedOn":{"label":"First day","order":2},"endedOn":{"label":"Last day","order":3},"endReason":{"order":4},"tenantId":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nEmployees is where you keep a record of who works for you. Each person has an\\nemployment record with their role, their worker type and whether they are\\ncurrently active, plus the dates they started and, if they left, finished.\\n\\nOnly people using the app can see these records. They are kept closed to\\nassistants and other automated tools on purpose, so an agent cannot read them.\\n\\n## Tasks\\n\\n### Add an employee\\n\\n1. Open the list of employees and choose **New**.\\n2. Pick the **{field:Employment.profileId}**.\\n3. Give them an **{field:Employment.employeeNumber}**, your own reference for them.\\n4. Fill in their **{field:Employment.position}** and **{field:Employment.workerType}**.\\n5. Save. They now show in your list of employees.\\n\\n### Record that someone has left\\n\\n1. Open the person from the list.\\n2. Set the **{field:Employment.status}** to show they no longer work for you.\\n3. Record their **{field:EmploymentTerm.endedOn}** and the **{field:EmploymentTerm.endReason}**.\\n4. Save. Their history stays on file.\\n","fieldRefs":["Employment.employeeNumber","Employment.position","Employment.profileId","Employment.status","Employment.workerType","EmploymentTerm.endReason","EmploymentTerm.endedOn"]},"exposure":"ui-only","demo":{"mode":"server","reasons":["Needs a server because its package depends on @happyvertical/smrt-tenancy, which do not build for a browser (#3624)."]}},{"id":"human-resources.qualifications","className":"HumanResourcesQualificationsRecipe","label":"Qualifications","summary":"Track the certificates and training your people hold, and when they run out. Only people can see it; agents cannot read it.","synonyms":["certifications","certificates","licences","training","first aid"],"models":["@happyvertical/smrt-human-resources:Qualification","@happyvertical/smrt-human-resources:HeldQualification"],"nav":[{"label":"Qualifications","model":"@happyvertical/smrt-human-resources:Qualification","icon":"book","description":"The certificates, licences and training your people can hold.","noun":"qualification"},{"label":"Held qualifications","model":"@happyvertical/smrt-human-resources:HeldQualification","icon":"fileText","description":"Who holds which qualification, and when it runs out.","noun":"held qualification"}],"requires":["human-resources.people"],"section":{"id":"staff","label":"Staff","icon":"users","description":"The people who work for you."},"options":{"@happyvertical/smrt-human-resources:Qualification":{"fields":{"name":{"order":1},"kind":{"order":2},"issuingBody":{"order":3},"expires":{"order":4},"validityMonths":{"order":5},"key":{"visibility":"advanced"},"scope":{"visibility":"advanced"},"isActive":{"visibility":"advanced"},"tenantId":{"visibility":"hidden"}}},"@happyvertical/smrt-human-resources:HeldQualification":{"fields":{"qualificationId":{"label":"Qualification","order":1},"profileId":{"label":"Person","order":2},"issuedOn":{"order":3},"expiresOn":{"order":4},"certificateNumber":{"order":5},"status":{"order":6},"tenantId":{"visibility":"hidden"},"employmentId":{"visibility":"advanced"},"verifiedByProfileId":{"visibility":"advanced"},"verifiedAt":{"visibility":"advanced"},"documentAssetId":{"visibility":"advanced"},"renewalOfId":{"visibility":"hidden"}}}},"help":{"markdown":"## Overview\\n\\nQualifications is where you list the certificates, licences and training your\\nwork needs, such as first aid, and record who holds each one and when it runs\\nout. It builds on Employees, so switch that on first.\\n\\nOnly people using the app can see these records. They are kept closed to\\nassistants and other automated tools on purpose, so an agent cannot read them.\\n\\n## Tasks\\n\\n### Set up a qualification\\n\\n1. Open the list of qualifications and choose **New**.\\n2. Type the **{field:Qualification.name}**, for example \\"First aid\\".\\n3. Say who gives it out in **{field:Qualification.issuingBody}**.\\n4. Tick **{field:Qualification.expires}** if it has to be renewed, and set **{field:Qualification.validityMonths}** to how long it lasts.\\n5. Save.\\n\\n### Record who holds a qualification\\n\\n1. Open the held qualifications and choose **New**.\\n2. Pick the **{field:HeldQualification.qualificationId}** and the **{field:HeldQualification.profileId}** who holds it.\\n3. Enter the date it was **{field:HeldQualification.issuedOn}** and when it **{field:HeldQualification.expiresOn}**.\\n4. Add the **{field:HeldQualification.certificateNumber}** from the certificate.\\n5. Set the **{field:HeldQualification.status}** to show whether it is still valid.\\n6. Save. You can now see who needs to renew before the date.\\n","fieldRefs":["HeldQualification.certificateNumber","HeldQualification.expiresOn","HeldQualification.issuedOn","HeldQualification.profileId","HeldQualification.qualificationId","HeldQualification.status","Qualification.expires","Qualification.issuingBody","Qualification.name","Qualification.validityMonths"]},"exposure":"ui-only","demo":{"mode":"server","reasons":["Needs a server because its package depends on @happyvertical/smrt-tenancy, which do not build for a browser (#3624)."]}}],"smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3624"],"via":["@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/dates.ts
|
|
10
10
|
var ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
@@ -93,7 +93,6 @@ var Employment = class extends SmrtObject {
|
|
|
93
93
|
profileId = "";
|
|
94
94
|
userId = null;
|
|
95
95
|
employerProfileId = null;
|
|
96
|
-
/** Free text, unique per tenant. */
|
|
97
96
|
employeeNumber = "";
|
|
98
97
|
workerType = "employee";
|
|
99
98
|
position = null;
|
|
@@ -110,18 +109,26 @@ var Employment = class extends SmrtObject {
|
|
|
110
109
|
};
|
|
111
110
|
__publicField$1(Employment, "__smrtPackage__", "@happyvertical/smrt-human-resources");
|
|
112
111
|
__decorateClass$1([tenantId()], Employment.prototype, "tenantId", 2);
|
|
113
|
-
__decorateClass$1([crossPackageRef("@happyvertical/smrt-profiles:Profile", { onDelete: "RESTRICT" })], Employment.prototype, "profileId", 2);
|
|
112
|
+
__decorateClass$1([field({ description: "The person who works for you." }), crossPackageRef("@happyvertical/smrt-profiles:Profile", { onDelete: "RESTRICT" })], Employment.prototype, "profileId", 2);
|
|
114
113
|
__decorateClass$1([crossPackageRef("@happyvertical/smrt-users:User", { nullable: true })], Employment.prototype, "userId", 2);
|
|
115
114
|
__decorateClass$1([crossPackageRef("@happyvertical/smrt-profiles:Profile", {
|
|
116
115
|
nullable: true,
|
|
117
116
|
onDelete: "RESTRICT"
|
|
118
117
|
})], Employment.prototype, "employerProfileId", 2);
|
|
119
|
-
__decorateClass$1([field({
|
|
118
|
+
__decorateClass$1([field({ description: "Your own reference for this person, such as a staff number." })], Employment.prototype, "employeeNumber", 2);
|
|
120
119
|
__decorateClass$1([field({
|
|
121
120
|
type: "text",
|
|
122
|
-
|
|
121
|
+
description: "Whether they are an employee, contractor or another kind of worker."
|
|
122
|
+
})], Employment.prototype, "workerType", 2);
|
|
123
|
+
__decorateClass$1([field({
|
|
124
|
+
type: "text",
|
|
125
|
+
nullable: true,
|
|
126
|
+
description: "Their role or trade."
|
|
123
127
|
})], Employment.prototype, "position", 2);
|
|
124
|
-
__decorateClass$1([field({
|
|
128
|
+
__decorateClass$1([field({
|
|
129
|
+
type: "text",
|
|
130
|
+
description: "Whether they currently work for you."
|
|
131
|
+
})], Employment.prototype, "status", 2);
|
|
125
132
|
Employment = __decorateClass$1([TenantScoped({ mode: "required" }), smrt({
|
|
126
133
|
tableName: "employments",
|
|
127
134
|
sensitive: true,
|
|
@@ -156,12 +163,17 @@ var EmploymentTerm = class extends SmrtObject {
|
|
|
156
163
|
};
|
|
157
164
|
__publicField$1(EmploymentTerm, "__smrtPackage__", "@happyvertical/smrt-human-resources");
|
|
158
165
|
__decorateClass$1([tenantId()], EmploymentTerm.prototype, "tenantId", 2);
|
|
159
|
-
__decorateClass$1([foreignKey("Employment", { onDelete: "RESTRICT" })], EmploymentTerm.prototype, "employmentId", 2);
|
|
160
|
-
__decorateClass$1([field({ type: "text" })], EmploymentTerm.prototype, "startedOn", 2);
|
|
166
|
+
__decorateClass$1([field({ description: "The person this period of work belongs to." }), foreignKey("Employment", { onDelete: "RESTRICT" })], EmploymentTerm.prototype, "employmentId", 2);
|
|
161
167
|
__decorateClass$1([field({
|
|
162
168
|
type: "text",
|
|
163
|
-
|
|
169
|
+
description: "The first day of this period of work."
|
|
170
|
+
})], EmploymentTerm.prototype, "startedOn", 2);
|
|
171
|
+
__decorateClass$1([field({
|
|
172
|
+
type: "text",
|
|
173
|
+
nullable: true,
|
|
174
|
+
description: "The last day of this period of work. Empty while it continues."
|
|
164
175
|
})], EmploymentTerm.prototype, "endedOn", 2);
|
|
176
|
+
__decorateClass$1([field({ description: "Why the period of work ended." })], EmploymentTerm.prototype, "endReason", 2);
|
|
165
177
|
EmploymentTerm = __decorateClass$1([TenantScoped({ mode: "required" }), smrt({
|
|
166
178
|
tableName: "employment_terms",
|
|
167
179
|
sensitive: true,
|
|
@@ -273,7 +285,6 @@ var Qualification = class extends SmrtObject {
|
|
|
273
285
|
name = "";
|
|
274
286
|
kind = "certification";
|
|
275
287
|
issuingBody = "";
|
|
276
|
-
/** Whether held qualifications of this kind expire. */
|
|
277
288
|
expires = false;
|
|
278
289
|
validityMonths = null;
|
|
279
290
|
scope = "person";
|
|
@@ -290,10 +301,17 @@ var Qualification = class extends SmrtObject {
|
|
|
290
301
|
};
|
|
291
302
|
__publicField(Qualification, "__smrtPackage__", "@happyvertical/smrt-human-resources");
|
|
292
303
|
__decorateClass([tenantId()], Qualification.prototype, "tenantId", 2);
|
|
293
|
-
__decorateClass([field({
|
|
304
|
+
__decorateClass([field({ description: "What the qualification is called, such as First aid." })], Qualification.prototype, "name", 2);
|
|
305
|
+
__decorateClass([field({
|
|
306
|
+
type: "text",
|
|
307
|
+
description: "The sort of qualification, such as a certificate or a licence."
|
|
308
|
+
})], Qualification.prototype, "kind", 2);
|
|
309
|
+
__decorateClass([field({ description: "Who gives it out." })], Qualification.prototype, "issuingBody", 2);
|
|
310
|
+
__decorateClass([field({ description: "Whether it has to be renewed." })], Qualification.prototype, "expires", 2);
|
|
294
311
|
__decorateClass([field({
|
|
295
312
|
type: "integer",
|
|
296
|
-
nullable: true
|
|
313
|
+
nullable: true,
|
|
314
|
+
description: "How many months it lasts once given."
|
|
297
315
|
})], Qualification.prototype, "validityMonths", 2);
|
|
298
316
|
__decorateClass([field({ type: "text" })], Qualification.prototype, "scope", 2);
|
|
299
317
|
Qualification = __decorateClass([TenantScoped({ mode: "required" }), smrt({
|
|
@@ -341,18 +359,26 @@ var HeldQualification = class extends SmrtObject {
|
|
|
341
359
|
};
|
|
342
360
|
__publicField(HeldQualification, "__smrtPackage__", "@happyvertical/smrt-human-resources");
|
|
343
361
|
__decorateClass([tenantId()], HeldQualification.prototype, "tenantId", 2);
|
|
344
|
-
__decorateClass([foreignKey(Qualification, { onDelete: "RESTRICT" })], HeldQualification.prototype, "qualificationId", 2);
|
|
345
|
-
__decorateClass([crossPackageRef("@happyvertical/smrt-profiles:Profile", { onDelete: "RESTRICT" })], HeldQualification.prototype, "profileId", 2);
|
|
362
|
+
__decorateClass([field({ description: "The qualification this person holds." }), foreignKey(Qualification, { onDelete: "RESTRICT" })], HeldQualification.prototype, "qualificationId", 2);
|
|
363
|
+
__decorateClass([field({ description: "The person who holds it." }), crossPackageRef("@happyvertical/smrt-profiles:Profile", { onDelete: "RESTRICT" })], HeldQualification.prototype, "profileId", 2);
|
|
346
364
|
__decorateClass([foreignKey("Employment", {
|
|
347
365
|
nullable: true,
|
|
348
366
|
onDelete: "RESTRICT"
|
|
349
367
|
})], HeldQualification.prototype, "employmentId", 2);
|
|
350
|
-
__decorateClass([field({ type: "text" })], HeldQualification.prototype, "issuedOn", 2);
|
|
351
368
|
__decorateClass([field({
|
|
352
369
|
type: "text",
|
|
353
|
-
|
|
370
|
+
description: "The day it was given."
|
|
371
|
+
})], HeldQualification.prototype, "issuedOn", 2);
|
|
372
|
+
__decorateClass([field({
|
|
373
|
+
type: "text",
|
|
374
|
+
nullable: true,
|
|
375
|
+
description: "The day it runs out. Empty if it does not."
|
|
354
376
|
})], HeldQualification.prototype, "expiresOn", 2);
|
|
355
|
-
__decorateClass([field({
|
|
377
|
+
__decorateClass([field({ description: "The number printed on the certificate." })], HeldQualification.prototype, "certificateNumber", 2);
|
|
378
|
+
__decorateClass([field({
|
|
379
|
+
type: "text",
|
|
380
|
+
description: "Whether it is valid, expired, suspended or revoked."
|
|
381
|
+
})], HeldQualification.prototype, "status", 2);
|
|
356
382
|
__decorateClass([crossPackageRef("@happyvertical/smrt-profiles:Profile", {
|
|
357
383
|
nullable: true,
|
|
358
384
|
onDelete: "RESTRICT"
|
|
@@ -2077,6 +2103,136 @@ var QualificationService = class extends HrService {
|
|
|
2077
2103
|
}
|
|
2078
2104
|
};
|
|
2079
2105
|
//#endregion
|
|
2080
|
-
|
|
2106
|
+
//#region src/recipes.ts
|
|
2107
|
+
var HumanResourcesPeopleRecipe = class extends SmrtRecipe {
|
|
2108
|
+
static id = "human-resources.people";
|
|
2109
|
+
static help = "./people.recipe.md";
|
|
2110
|
+
static label = "Employees";
|
|
2111
|
+
static summary = "Keep a record of who works for you and in what role. Only people can see it; agents cannot read it.";
|
|
2112
|
+
static synonyms = [
|
|
2113
|
+
"hr",
|
|
2114
|
+
"human resources",
|
|
2115
|
+
"staff",
|
|
2116
|
+
"people",
|
|
2117
|
+
"team",
|
|
2118
|
+
"workers"
|
|
2119
|
+
];
|
|
2120
|
+
static exposure = "ui-only";
|
|
2121
|
+
static section = {
|
|
2122
|
+
id: "staff",
|
|
2123
|
+
label: "Staff",
|
|
2124
|
+
icon: "users",
|
|
2125
|
+
description: "The people who work for you."
|
|
2126
|
+
};
|
|
2127
|
+
static models = [Employment, EmploymentTerm];
|
|
2128
|
+
static nav = [{
|
|
2129
|
+
label: "Employees",
|
|
2130
|
+
model: Employment,
|
|
2131
|
+
icon: "users",
|
|
2132
|
+
description: "Everyone who works for you, with their role and status.",
|
|
2133
|
+
noun: "employee"
|
|
2134
|
+
}];
|
|
2135
|
+
static options = {
|
|
2136
|
+
Employment: { fields: {
|
|
2137
|
+
profileId: {
|
|
2138
|
+
label: "Person",
|
|
2139
|
+
order: 1
|
|
2140
|
+
},
|
|
2141
|
+
employeeNumber: { order: 2 },
|
|
2142
|
+
position: { order: 3 },
|
|
2143
|
+
workerType: { order: 4 },
|
|
2144
|
+
status: { order: 5 },
|
|
2145
|
+
tenantId: { visibility: "hidden" },
|
|
2146
|
+
userId: { visibility: "advanced" },
|
|
2147
|
+
employerProfileId: { visibility: "advanced" }
|
|
2148
|
+
} },
|
|
2149
|
+
EmploymentTerm: { fields: {
|
|
2150
|
+
employmentId: {
|
|
2151
|
+
label: "Person",
|
|
2152
|
+
order: 1
|
|
2153
|
+
},
|
|
2154
|
+
startedOn: {
|
|
2155
|
+
label: "First day",
|
|
2156
|
+
order: 2
|
|
2157
|
+
},
|
|
2158
|
+
endedOn: {
|
|
2159
|
+
label: "Last day",
|
|
2160
|
+
order: 3
|
|
2161
|
+
},
|
|
2162
|
+
endReason: { order: 4 },
|
|
2163
|
+
tenantId: { visibility: "hidden" }
|
|
2164
|
+
} }
|
|
2165
|
+
};
|
|
2166
|
+
};
|
|
2167
|
+
var HumanResourcesQualificationsRecipe = class extends SmrtRecipe {
|
|
2168
|
+
static id = "human-resources.qualifications";
|
|
2169
|
+
static help = "./qualifications.recipe.md";
|
|
2170
|
+
static label = "Qualifications";
|
|
2171
|
+
static summary = "Track the certificates and training your people hold, and when they run out. Only people can see it; agents cannot read it.";
|
|
2172
|
+
static synonyms = [
|
|
2173
|
+
"certifications",
|
|
2174
|
+
"certificates",
|
|
2175
|
+
"licences",
|
|
2176
|
+
"training",
|
|
2177
|
+
"first aid"
|
|
2178
|
+
];
|
|
2179
|
+
static exposure = "ui-only";
|
|
2180
|
+
static requires = ["human-resources.people"];
|
|
2181
|
+
static section = {
|
|
2182
|
+
id: "staff",
|
|
2183
|
+
label: "Staff",
|
|
2184
|
+
icon: "users",
|
|
2185
|
+
description: "The people who work for you."
|
|
2186
|
+
};
|
|
2187
|
+
static models = [Qualification, HeldQualification];
|
|
2188
|
+
static nav = [{
|
|
2189
|
+
label: "Qualifications",
|
|
2190
|
+
model: Qualification,
|
|
2191
|
+
icon: "book",
|
|
2192
|
+
description: "The certificates, licences and training your people can hold.",
|
|
2193
|
+
noun: "qualification"
|
|
2194
|
+
}, {
|
|
2195
|
+
label: "Held qualifications",
|
|
2196
|
+
model: HeldQualification,
|
|
2197
|
+
icon: "fileText",
|
|
2198
|
+
description: "Who holds which qualification, and when it runs out.",
|
|
2199
|
+
noun: "held qualification"
|
|
2200
|
+
}];
|
|
2201
|
+
static options = {
|
|
2202
|
+
Qualification: { fields: {
|
|
2203
|
+
name: { order: 1 },
|
|
2204
|
+
kind: { order: 2 },
|
|
2205
|
+
issuingBody: { order: 3 },
|
|
2206
|
+
expires: { order: 4 },
|
|
2207
|
+
validityMonths: { order: 5 },
|
|
2208
|
+
key: { visibility: "advanced" },
|
|
2209
|
+
scope: { visibility: "advanced" },
|
|
2210
|
+
isActive: { visibility: "advanced" },
|
|
2211
|
+
tenantId: { visibility: "hidden" }
|
|
2212
|
+
} },
|
|
2213
|
+
HeldQualification: { fields: {
|
|
2214
|
+
qualificationId: {
|
|
2215
|
+
label: "Qualification",
|
|
2216
|
+
order: 1
|
|
2217
|
+
},
|
|
2218
|
+
profileId: {
|
|
2219
|
+
label: "Person",
|
|
2220
|
+
order: 2
|
|
2221
|
+
},
|
|
2222
|
+
issuedOn: { order: 3 },
|
|
2223
|
+
expiresOn: { order: 4 },
|
|
2224
|
+
certificateNumber: { order: 5 },
|
|
2225
|
+
status: { order: 6 },
|
|
2226
|
+
tenantId: { visibility: "hidden" },
|
|
2227
|
+
employmentId: { visibility: "advanced" },
|
|
2228
|
+
verifiedByProfileId: { visibility: "advanced" },
|
|
2229
|
+
verifiedAt: { visibility: "advanced" },
|
|
2230
|
+
documentAssetId: { visibility: "advanced" },
|
|
2231
|
+
renewalOfId: { visibility: "hidden" }
|
|
2232
|
+
} }
|
|
2233
|
+
};
|
|
2234
|
+
};
|
|
2235
|
+
//#endregion
|
|
2236
|
+
export { EMPLOYMENT_STATUS_TRANSITIONS, Employment, EmploymentChange, EmploymentChangeCollection, EmploymentCollection, EmploymentService, EmploymentTerm, EmploymentTermCollection, HUMAN_RESOURCES_MODULE_META, HUMAN_RESOURCES_UI_SLOTS, HeldQualification, HeldQualificationChange, HeldQualificationChangeCollection, HeldQualificationCollection, HrError, HumanResourcesPeopleRecipe, HumanResourcesQualificationsRecipe, Qualification, QualificationCollection, QualificationService, SUGGESTED_QUALIFICATIONS, SUGGESTED_WORKER_TYPES, addDays, addMonths, assertIsoDate, isIsoDate };
|
|
2081
2237
|
|
|
2082
2238
|
//# sourceMappingURL=index.js.map
|