The things this system keeps track of, the kinds of each, and the business rules that keep the data true. The rules are enforced automatically on every change, whether it comes from a screen, an API or a message. This page is generated from the system itself.
Each Department has many Employee records.
| Field | Kind of value | Notes |
|---|---|---|
| Name | text | required |
| Budget | amount | required |
| Total salary | amount | computed the total of its Employee salary |
Each Labor Union has many Employee records.
| Field | Kind of value | Notes |
|---|---|---|
| Name | text | required |
| Dues rate | number | required |
| Field | Kind of value | Notes |
|---|---|---|
| Name | text | required |
| Discount rate | number | |
| Tax rate | number | |
| Notes | text | |
| Max hourly weekly salary | amount | |
| Military stipend per year | amount |
Each Employee may belong to one Department.
Each Employee has many Order records.
| Field | Kind of value | Notes |
|---|---|---|
| Type | one of: salaried, hourly, commissioned | required |
| Name | text | required |
| Salary | amount | computed hourly = hours worked * hourly rate; commissioned = base salary + commission total; salaried = as entered |
| Commission total | amount | computed the total of its Order amount |
| Military | text | |
| Total compensation | amount | computed calculated by a formula |
Each Order belongs to one Employee.
| Field | Kind of value | Notes |
|---|---|---|
| Amount | amount | required |
| Customer name | text | required |
They are classified in independent ways. Each record is exactly one kind on each way that is exclusive, and may also be a kind from the others.
Exactly one of these:
No additional fields.
May have one Labor Union. No other kind of employee can.
| Field | Kind of value | Notes |
|---|---|---|
| Hours worked | number | |
| Hourly rate | number | |
| Union dues | amount | computed hours worked * union dues rate for hourly employees (0 if no union, or not hourly) |
| Field | Kind of value | Notes |
|---|---|---|
| Base salary | amount | |
| Order count | whole number | computed the number of its Order records |
Independent of the other classifications:
| Field | Kind of value | Notes |
|---|---|---|
| Branch | one of: Army, Navy, Air Force, Marines, Coast Guard | |
| Rank | text | |
| Service years | whole number | |
| Military stipend | amount | computed service years * SysConfig military stipend per year for military employees, 0 otherwise |
Each rule traces to the requirement that asked for it. added by AI marks rules the requirement did not state, so a person should confirm them (the judgment calls are listed in ad-libs.md).
| Rule | Type | Requirement |
|---|---|---|
| Employee commission total: the total of its Order amount | Total | Commissioned employees are employees who can have Orders; only Commissioned employees may have Orders. Each Order has an amount and a customer name. Commissioned employees: commission_total = sum of Order.amount. |
| Employee order count: the number of its Order records added by AI | Count | (not stated in the requirement) |
| Only commissioned employees may have Orders | Check | Commissioned employees are employees who can have Orders; only Commissioned employees may have Orders. Each Order has an amount and a customer name. Commissioned employees: commission_total = sum of Order.amount. Applies to: Commissioned Employee If violated: Only commissioned employees may have Orders |
| Base salary applies only to commissioned employees | Check | Commissioned employees are employees who can have Orders; only Commissioned employees may have Orders. Each Order has an amount and a customer name. Commissioned employees: commission_total = sum of Order.amount. Applies to: Commissioned Employee If violated: base salary applies only to commissioned employees |
| Rule | Type | Requirement |
|---|---|---|
| Department total salary: the total of its Employee salary | Total | Departments have a name and a budget. Department.total_salary = sum of Employee.salary (all types). Department.total_salary must not exceed Department.budget. A user with the manager role may exceed the budget; other users may not. |
| Total salary must not exceed budget, unless the user has the manager role | Check | Departments have a name and a budget. Department.total_salary = sum of Employee.salary (all types). Department.total_salary must not exceed Department.budget. A user with the manager role may exceed the budget; other users may not. If violated: Department total salary ([total salary]) exceeds budget ([budget]) |
| Rule | Type | Requirement |
|---|---|---|
| Employee salary: hourly = hours worked * hourly rate; commissioned = base salary + commission total; salaried = as entered | Calculation | Hourly employees: salary = hours_worked * hourly_rate. / Commissioned employees: salary = base_salary + commission_total. |
| Employee type must be salaried, hourly or commissioned | Check | Employees have a name, dept, and salary. Employees have a type that is one of: 'salaried', 'hourly', or 'commissioned'. If violated: Employee type ([type]) must be salaried, hourly or commissioned |
| Rule | Type | Requirement |
|---|---|---|
| Employee union dues: hours worked * union dues rate for hourly employees (0 if no union, or not hourly) | Calculation | Hourly employees are employees with hours_worked (REAL) and hourly_rate (REAL). Hourly employees: salary must not exceed 5000 per week. Hourly employees may be assigned to a Union (optional); only Hourly employees may have a union_id. Unions have a name and a dues_rate (REAL). Hourly employees: union_dues = hours_worked * union.dues_rate (0 if no union assigned). |
| An hourly employee's weekly salary must not exceed SysConfig max hourly weekly salary | Check | Hourly employees are employees with hours_worked (REAL) and hourly_rate (REAL). Hourly employees: salary must not exceed 5000 per week. Hourly employees may be assigned to a Union (optional); only Hourly employees may have a union_id. Unions have a name and a dues_rate (REAL). Hourly employees: union_dues = hours_worked * union.dues_rate (0 if no union assigned). If violated: Hourly salary ([salary]) exceeds the weekly maximum |
| Only hourly employees may have a union id | Check | Hourly employees are employees with hours_worked (REAL) and hourly_rate (REAL). Hourly employees: salary must not exceed 5000 per week. Hourly employees may be assigned to a Union (optional); only Hourly employees may have a union_id. Unions have a name and a dues_rate (REAL). Hourly employees: union_dues = hours_worked * union.dues_rate (0 if no union assigned). Applies to: Hourly Employee If violated: Only hourly employees may have a union id |
| Hours worked and hourly rate apply only to hourly employees | Check | Hourly employees are employees with hours_worked (REAL) and hourly_rate (REAL). Hourly employees: salary must not exceed 5000 per week. Hourly employees may be assigned to a Union (optional); only Hourly employees may have a union_id. Unions have a name and a dues_rate (REAL). Hourly employees: union_dues = hours_worked * union.dues_rate (0 if no union assigned). Applies to: Hourly Employee If violated: hours worked and hourly rate apply only to hourly employees |
| Rule | Type | Requirement |
|---|---|---|
| Employee military stipend: service years * SysConfig military stipend per year for military employees, 0 otherwise | Calculation | Employees may also have a military classification, independent of employment type. Military employees have a branch (TEXT: 'Army', 'Navy', 'Air Force', 'Marines', 'Coast Guard'), a rank (TEXT), and service_years (INTEGER). Military employees receive a military_stipend (REAL) = service_years * 100. Total compensation for military employees = salary + military_stipend. Total compensation for non-military employees = salary. |
| Employee total compensation: calculated by a formula | Calculation | Employees may also have a military classification, independent of employment type. Military employees have a branch (TEXT: 'Army', 'Navy', 'Air Force', 'Marines', 'Coast Guard'), a rank (TEXT), and service_years (INTEGER). Military employees receive a military_stipend (REAL) = service_years * 100. Total compensation for military employees = salary + military_stipend. Total compensation for non-military employees = salary. Applies to: Military Employee |
| The military classification must be yes or no | Check | Employees may also have a military classification, independent of employment type. Military employees have a branch (TEXT: 'Army', 'Navy', 'Air Force', 'Marines', 'Coast Guard'), a rank (TEXT), and service_years (INTEGER). Military employees receive a military_stipend (REAL) = service_years * 100. Total compensation for military employees = salary + military_stipend. Total compensation for non-military employees = salary. If violated: military must be yes or no |
| Branch must be Army, Navy, Air Force, Marines or Coast Guard | Check | Employees may also have a military classification, independent of employment type. Military employees have a branch (TEXT: 'Army', 'Navy', 'Air Force', 'Marines', 'Coast Guard'), a rank (TEXT), and service_years (INTEGER). Military employees receive a military_stipend (REAL) = service_years * 100. Total compensation for military employees = salary + military_stipend. Total compensation for non-military employees = salary. If violated: branch ([branch]) must be Army, Navy, Air Force, Marines or Coast Guard |
| Branch, rank and service years apply only to military employees | Check | Employees may also have a military classification, independent of employment type. Military employees have a branch (TEXT: 'Army', 'Navy', 'Air Force', 'Marines', 'Coast Guard'), a rank (TEXT), and service_years (INTEGER). Military employees receive a military_stipend (REAL) = service_years * 100. Total compensation for military employees = salary + military_stipend. Total compensation for non-military employees = salary. Applies to: Military Employee If violated: branch, rank and service years apply only to military employees |
Where each calculated value comes from, and what a change ripples to. The same information is in lineage.csv and lineage.json for catalog tools.
| This value | is calculated from |
|---|---|
| Employee commission total | Order amount |
| Employee order count | Order records |
| Department total salary | Employee salary |
| Employee salary | Employee type, Employee hours worked, Employee hourly rate, Employee base salary, Employee commission total |
| Employee union dues | Employee type, Employee hours worked, Labor union dues rate |
| Employee military stipend | Employee military, Employee service years, Sys config military stipend per year |
| Employee total compensation | Employee salary, Employee military, Employee military stipend |
| If this changes | these are recalculated |
|---|---|
| Order amount | Employee commission total, Employee salary, Department total salary, Employee total compensation |
| Order records | Employee order count |
| Employee type | Employee salary, Employee union dues, Department total salary, Employee total compensation |
| Employee hours worked | Employee salary, Employee union dues, Department total salary, Employee total compensation |
| Employee hourly rate | Employee salary, Department total salary, Employee total compensation |
| Employee base salary | Employee salary, Department total salary, Employee total compensation |
| Labor union dues rate | Employee union dues |
| Employee military | Employee military stipend, Employee total compensation |
| Employee service years | Employee military stipend, Employee total compensation |
| Sys config military stipend per year | Employee military stipend, Employee total compensation |
rdflib is not installed: files were written but not parsed or validated
Technical files in this folder: demo_emp_types.ttl, demo_emp_types.shapes.ttl, genai-logic.ttl, lineage.csv, lineage.json.