Skip to main content

Data Models

All API request and response schemas used by the Boxme Levelling API.

UserProfile

Returned by POST /api/auth/login.

PropertyTypeDescription
idintegerUser ID
usernamestringLogin username
rolestringbod | warehouse_manager | warehouse_leader | hr | staff
warehouse_idinteger | nullAssigned warehouse (null = all)
full_namestringFull name
warehouse_namestring | nullWarehouse name

Employee

PropertyTypeDescription
idintegerEmployee ID
employee_codestringCode (e.g., BM001)
full_namestringFull name
emailstringEmail
warehouse_idintegerWarehouse FK
warehouse_namestringWarehouse name
main_staff_group_idintegerStaff group FK
group_namestringGroup name
rolestringstaff | leader | manager | hr | bod
statusstringactive | probation | inactive
hire_datedateHire date
contract_salarynumberMonthly base salary

ViolationRecord

PropertyTypeDescription
idintegerRecord ID
employee_idintegerEmployee FK
full_namestringEmployee name
employee_codestringEmployee code
violation_type_idintegerType FK
violation_namestringType name
datedateViolation date
periodstringPeriod (e.g., 2026-02)
penalty_pointsnumberPoints deducted
statusstringpending | confirmed | appealed | waived
evidencestring | nullEvidence description
notesstring | nullAdditional notes
warehouse_namestringWarehouse name

RecoveryRecord

PropertyTypeDescription
idintegerRecord ID
employee_idintegerEmployee FK
full_namestringEmployee name
recovery_typestringtraining | skill_test | initiative
points_recoverednumberPoints to recover
periodstringPeriod
statusstringpending | approved | rejected | expired
deadlinedate | nullCompletion deadline
course_idinteger | nullLinked course
course_namestring | nullCourse name
violation_record_idinteger | nullLinked violation

BonusRecord

PropertyTypeDescription
idintegerRecord ID
employee_idintegerEmployee FK
full_namestringEmployee name
bonus_type_idintegerType FK
bonus_type_namestringType name
datedateAward date
periodstringPeriod
pointsnumberPoints awarded
statusstringpending_approval | approved | rejected

EmployeePeriodScore

PropertyTypeDescription
idintegerRecord ID
employee_idintegerEmployee FK
full_namestringEmployee name
employee_codestringEmployee code
warehouse_namestringWarehouse
group_namestringStaff group
period_typestringweek | month | quarter | year
period_valuestringPeriod value (e.g., 2026-02)
avg_pphnumberAverage PPH
pph_levelstring | nullneeds_improvement | average | good | excellent
total_penalty_pointsnumberSum of penalties
total_bonus_pointsnumberSum of bonuses
total_recovery_pointsnumberSum of recovered
net_penaltynumbertotal_penalty - total_recovery
violation_levelstring | nulllow | medium | high | critical
statusstringdraft | manager_review | hr_approved | final

ApprovalRequest

PropertyTypeDescription
idintegerRequest ID
typestringbonus | appeal | score_finalization | initiative | recovery
reference_idintegerReferenced record ID
reference_tablestringTable name
statusstringpending | approved | rejected
approver_rolestringRequired approval role
decided_byinteger | nullDecider user ID

Configuration Models

PPHThreshold

PropertyTypeDescription
levelstringneeds_improvement | average | good | excellent
min_pphnumberMinimum PPH
max_pphnumber | nullMaximum PPH
country_idinteger | nullScope
warehouse_idinteger | nullScope
staff_group_idinteger | nullScope
effective_fromdateStart date

ViolationType

PropertyTypeDescription
codestringMachine code (e.g., VIO_PKG_01)
namestringDisplay name
departmentstring | nullDepartment
penalty_pointsnumberDefault penalty
sourcestringwms_auto | manual
is_activeinteger0 or 1

BonusType

PropertyTypeDescription
codestringCode (e.g., BONUS_INITIATIVE)
namestringDisplay name
pointsnumberDefault points
requires_approvalinteger0 or 1
is_activeinteger0 or 1

SkillCourse

PropertyTypeDescription
codestringCourse code
namestringCourse name
course_typestringtraining | skill_test | initiative
duration_daysintegerDefault deadline (days)
max_recovery_pctnumberMax recovery % (0–100)
providerstring | nullCourse provider