Record original-alignment implementation and traceability checkpoint
Capture current source, content data, tests, asset licenses, and original-specification traceability. Original implementation remains incomplete. The accepted matching UI generation passed 154 suites and 12,253 checks, with eight rendered staff-contract screens reviewed. Latest native Windows and full-original acceptance remain outstanding.
This commit is contained in:
@@ -50,6 +50,16 @@ var _item_releaser := Callable()
|
||||
var _travel_estimator := Callable()
|
||||
var _external_task_driver := Callable()
|
||||
var _attendance_driver := Callable()
|
||||
var _arrival_driver := Callable()
|
||||
|
||||
# Optional scheduler policy: zero delegates work progression to Runtime.
|
||||
var _work_progress_driver: Callable
|
||||
func configure_work_progress_driver(driver: Callable) -> void:
|
||||
_work_progress_driver = driver
|
||||
|
||||
|
||||
func configure_arrival_driver(driver: Callable) -> void:
|
||||
_arrival_driver = driver
|
||||
|
||||
|
||||
func configure_callbacks(
|
||||
@@ -170,7 +180,7 @@ func get_daily_payroll_rows() -> Array[Dictionary]:
|
||||
rows.append({
|
||||
&"staff_id": staff.staff_id,
|
||||
&"employment_kind": staff.get_employment_kind_name(),
|
||||
&"daily_wage": staff.daily_wage,
|
||||
&"daily_wage": staff.get_effective_daily_wage(),
|
||||
})
|
||||
return rows
|
||||
|
||||
@@ -193,7 +203,7 @@ func get_payroll_obligations() -> Array[Dictionary]:
|
||||
&"staff_id": staff_id,
|
||||
&"payroll_status": &"ACTIVE",
|
||||
&"employment_kind": staff.get_employment_kind_name(),
|
||||
&"daily_wage": staff.daily_wage,
|
||||
&"daily_wage": staff.get_effective_daily_wage(),
|
||||
&"unpaid_wages": staff.unpaid_wages,
|
||||
}
|
||||
for staff_id: StringName in _sorted_keys(_departed_payroll):
|
||||
@@ -730,6 +740,8 @@ func begin_task(task_id: StringName, absolute_minute: int = -1) -> CommandResult
|
||||
return _conflict("Task cannot begin from its current state.")
|
||||
if staff.state not in [StaffRuntimeType.State.MOVING_TO_TASK, StaffRuntimeType.State.AVAILABLE]:
|
||||
return _conflict("Staff cannot begin the reserved Task from its current state.")
|
||||
if _arrival_driver.is_valid() and not bool(_arrival_driver.call(task, staff, minute)):
|
||||
return _conflict("Task arrival was redirected or is no longer valid.")
|
||||
# Both state preconditions are checked before either side is mutated.
|
||||
var task_state_before: StaffTask.State = task.state
|
||||
var task_changed_at_before := task.state_changed_at
|
||||
@@ -829,7 +841,11 @@ func _advance_assigned_tasks(absolute_minute: int) -> Array[Dictionary]:
|
||||
StaffTaskType.State.WORKING:
|
||||
if is_externally_driven_task(task_id):
|
||||
continue
|
||||
var progress_result := progress_task(task.task_id, 1, absolute_minute)
|
||||
var units := 1
|
||||
if _work_progress_driver.is_valid():
|
||||
units = int(_work_progress_driver.call(task.task_id))
|
||||
if units <= 0: continue
|
||||
var progress_result := progress_task(task.task_id, units, absolute_minute)
|
||||
if progress_result.is_success():
|
||||
actions.append({
|
||||
&"task_id": task.task_id,
|
||||
@@ -878,6 +894,8 @@ func remove_staff(
|
||||
var staff := get_staff(staff_id)
|
||||
if staff == null:
|
||||
return _not_found("Staff", staff_id)
|
||||
if staff.employment_kind == StaffRuntimeType.EmploymentKind.UNIQUE:
|
||||
return _conflict("Unique Staff cannot be dismissed, sold or permanently removed.")
|
||||
if is_externally_driven_task(staff.current_task_id):
|
||||
return _conflict("Finish the employee external operation before removal.")
|
||||
var minute := current_minute if absolute_minute < 0 else absolute_minute
|
||||
@@ -921,6 +939,8 @@ func retire_staff(staff_id: StringName, absolute_minute: int = -1) -> CommandRes
|
||||
var staff := get_staff(staff_id)
|
||||
if staff == null:
|
||||
return _not_found("Staff", staff_id)
|
||||
if staff.employment_kind == StaffRuntimeType.EmploymentKind.UNIQUE:
|
||||
return _conflict("Unique Staff cannot be dismissed, sold or permanently removed.")
|
||||
if is_externally_driven_task(staff.current_task_id):
|
||||
return _conflict("Finish the employee external operation before retirement.")
|
||||
staff.is_retiring = true
|
||||
@@ -1409,7 +1429,8 @@ func _update_shift_states(absolute_minute: int, only_staff: StringName = &"", re
|
||||
staff.shift_id = &""
|
||||
if staff.assigned_facility_id == shift.assigned_facility_id:
|
||||
staff.assigned_facility_id = &""
|
||||
staff.transition_to(StaffRuntimeType.State.OFF_DUTY, &"SHIFT_ENDED", absolute_minute)
|
||||
if staff.can_take_shift():
|
||||
staff.transition_to(StaffRuntimeType.State.OFF_DUTY, &"SHIFT_ENDED", absolute_minute)
|
||||
shift.close(absolute_minute)
|
||||
shift_state_changed.emit(staff.staff_id, shift.shift_instance_id, staff.state)
|
||||
shift = null
|
||||
@@ -1550,7 +1571,7 @@ func _build_payroll_preview(day: int) -> Dictionary:
|
||||
# Daily close covers [0, day * 1440). A hire exactly on the end
|
||||
# boundary belongs to the next close; carried debt remains due now.
|
||||
var newly_accrued := (
|
||||
staff.daily_wage if staff.employment_effective_minute < period_end else 0
|
||||
staff.get_effective_daily_wage() if staff.employment_effective_minute < period_end else 0
|
||||
)
|
||||
if (
|
||||
prior < 0
|
||||
|
||||
Reference in New Issue
Block a user