Human-Resource Manager (disqrete-hrm)
EXECUTIVE DASHBOARD
HQ Thailand Dashboard
| Daily KPIs: |
|---|
| Total headcount |
| Active stores |
| OT cost today |
| Labor cost % sales |
| Sick leave % |
| Turnover % |
| Visa expiring in 60 days |
| Missing attendance logs |
| Payroll ready % |
Reporting Schedule
Schedule automatic generation:
| Report | Frequency |
|---|---|
| Payroll | Monthly |
| SSO | Monthly |
| Leave Balance | Monthly |
| OT Summary | Monthly |
| Employee Register | Real-time |
| Kor Ror 11 | Annual |
Bundled reports
- Employee Master List
- Payroll Register
- Leave Balance
- Attendance Summary
- Overtime Cost
- SSO Submission
- Tax PND1 Report
- Contract Expiry
- Termination Liability
- Annual Labour Compliance Report
🇹🇭 Thailand-Specific Fields Including:
| Data Field |
|---|
| Thai ID Card Number |
| Social Security Number |
| Bank Account |
| Tax (PND1) Status |
| Probation End Date |
| Military Status (if needed) |
| Work Permit / Visa (foreign staff) |
Software Datasheet
API-FIRST DESIGN
Employee Create
POST /api/v1/employees
Employee Remove
DELETE /api/v1/employees
Employee Record Modification
PUT /api/v1/employees
Attendance Clock-in
POST /api/v1/attendance/clockin
{
employee_code: "TH10025",
gps_lat: 13.7563,
gps_lon: 100.5018
}
Payroll Run
POST /api/v1/payroll/run?period=2026-04
Employee Timesheet Correction
POST /api/v1/timesheet/edit?date=2026-04-01
Store Manager Timesheet Approval
POST /api/v1/timesheet/approve?period=2026-04
Staff Sign-in Sheet
POST /api/v1/location/sign_in
{
employee_name: "Sabuy Deejung",
work_day: "2026-04-01",
signature: ....
}
HR Document Review or Comment
POST /api/v1/document/(sign|comment)
{
employee_name: "Sabuy Deejung",
date_time: "2026-04-01",
location: ...,
signature: ....
}
Store Dashboard
POST /api/v1/dashboard/<location_id>
{
employee_name: "Sabuy Deejung",
location: ...,
}
Country Dashboard
POST /api/v1/dashboard/country
{
country: [<country_id>,<country_id>, ...],
period: "2026-04",
}
SECURITY MODEL
Row-level security in MySQL or PostgreSQL (preferred) or BigQuery. Implementation adapts RBAC for ACL management.
We use nine-element binary authorization model. Baseline rule set provide access-control using ACL for RBAC for each system account.
| Roles | Rule Set (Customization Template) |
|---|---|
| Staff / Employee | [ ] [ ] [ ] [ ] [ ] [ ] [ ] |
| Store Manager | [ ] [ ] [ ] [ ] [ ] [ ] [ ] |
| HR Officer | [ ] [ ] [ ] [ ] [ ] [ ] [ ] |
| Country HR | [ ] [ ] [ ] [ ] [ ] [ ] [ ] |
| Payroll Admin | [ ] [ ] [ ] [ ] [ ] [ ] [ ] |
| CFO | [ ] [ ] [ ] [ ] [ ] [ ] [ ] |
| Global HR Director | [ ] [ ] [ ] [ ] [ ] [ ] [ ] |
| Internal Audit | [ ] [ ] [ ] [ ] [ ] [ ] [ ] |
ro - Read-only
rw - Read-write
wo - Write-only
no - No-Access
na - Not-Defined
Example Configuration
This settings are provided for Implementaiton Reference and compliance review.
Store Manager can approve attendance time
Store Manager : [no] [ro] [rw] [no] [no] [ro] [ro]
HR Officer can update employment status when new employee join or existing leave or retire or terminate
HR Officer : [no] [no] [ro] [rw] [wo] [ro] [ro]
HR Officer, Store Manager ,and Employee/Staff can receive training credits or convene to resolve conflict, incident report, or compliant. This can be done off-line or externally.
HR Officer : [no] [no] [ro] [no] [no] [ro] [ro]
Staff / Employee: [rw] [wo] [no] [no] [no] [ro] [ro]
Store Manager : [no] [ro] [rw] [no] [no] [ro] [ro]
Country HR resolves the dispute and record the result in the system.
Country HR [no] [no] [no] [wo] [rw] [ro] [ro]
Employee/staff user can log attendance time and request leave
Staff / Employee: [rw] [wo] [no] [no] [no] [ro] [ro]
Payroll read from work-time dataset and write to monthly summary. No one can see payroll during processing period except the Payroll Admin and the HR Officer. Only Payroll Admin can prepare and modify monthly reporting data.
Payroll Admin [ro] [ro] [rw] [wo] [rw] [ro] [ro]
CFO cannot see day-to-day operation or HR-related matter, but sees running costs and projected future costs for all operations. CFO also approves monthly expenditure and annual budget.
| CFO | [ no ] [ no ] [ ro ] [ no ] [ ro ] [ rw ] [ ro ] |
Global HR Director cannot see each country’s day-to-day, but can view monthly data and can update policy for each country.
| Internal Audit | [ no ] [ no ] [ no ] [ ro ] [ ro ] [ ro ] [ rw ] |
Internal Audit cannot modify any record, and only see day-to-day store-front activity for review purpose. The rule set only activate when formally required.
Normal operating period and while un-attended during audit period
| Internal Audit | [ no ] [ no ] [ no ] [ no ] [ ro ] [ ro ] [ ro ] |
During audit period
| Internal Audit | [ ro ] [ ro ] [ ro ] [ no ] [ no ] [ ro ] [ ro ] |
Database Schema and API
Supported Database (PostgreSQL, MySQL, SQL Server, Oracle)
- Normalized tables (3NF + audit versioning)
- Row-level security (multi-country isolation)
- Payroll calculation stored procedures (Thailand + global rules)
- Attendance fraud detection triggers
- Kafka event-driven HR pipeline schema
- REST API schema for PHP/Laravel or Django
- Prebuilt BI warehouse schema (star schema for labor analytics)
SQL Schema (Baseline)
-- =========================================================
-- HRM ENTERPRISE FULL SCHEMA (POSTGRESQL)
-- Bakery Chain - 100 Branches Global
-- =========================================================
-- =========================
-- ORGANIZATION STRUCTURE
-- =========================
CREATE TABLE company (
company_id BIGSERIAL PRIMARY KEY,
company_name VARCHAR(255),
country_base VARCHAR(100),
created_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE country (
country_id BIGSERIAL PRIMARY KEY,
country_code VARCHAR(10),
country_name VARCHAR(100)
);
CREATE TABLE branch (
branch_id BIGSERIAL PRIMARY KEY,
company_id BIGINT REFERENCES company(company_id),
country_id BIGINT REFERENCES country(country_id),
branch_code VARCHAR(50),
branch_name VARCHAR(255),
branch_type VARCHAR(50),
timezone VARCHAR(50),
active BOOLEAN DEFAULT TRUE
);
CREATE TABLE department (
department_id BIGSERIAL PRIMARY KEY,
department_name VARCHAR(100)
);
CREATE TABLE job_position (
position_id BIGSERIAL PRIMARY KEY,
position_name VARCHAR(100),
department_id BIGINT REFERENCES department(department_id)
);
CREATE TABLE cost_center (
cost_center_id BIGSERIAL PRIMARY KEY,
cost_center_name VARCHAR(100)
);
-- =========================
-- EMPLOYEE CORE
-- =========================
CREATE TABLE employee (
employee_id BIGSERIAL PRIMARY KEY,
employee_code VARCHAR(30) UNIQUE,
first_name VARCHAR(100),
last_name VARCHAR(100),
nationality VARCHAR(100),
birth_date DATE,
hire_date DATE,
termination_date DATE,
status VARCHAR(30),
branch_id BIGINT REFERENCES branch(branch_id),
position_id BIGINT REFERENCES job_position(position_id)
);
CREATE TABLE employee_contract (
contract_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
contract_type VARCHAR(50),
start_date DATE,
end_date DATE,
salary_base NUMERIC(14,2)
);
CREATE TABLE employee_document (
document_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
document_type VARCHAR(50),
document_path TEXT
);
-- =========================
-- SHIFT & ATTENDANCE
-- =========================
CREATE TABLE shift_template (
shift_id BIGSERIAL PRIMARY KEY,
shift_name VARCHAR(50),
start_time TIME,
end_time TIME
);
CREATE TABLE shift_schedule (
schedule_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
branch_id BIGINT REFERENCES branch(branch_id),
shift_date DATE,
shift_id BIGINT REFERENCES shift_template(shift_id)
);
CREATE TABLE attendance_log (
attendance_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
branch_id BIGINT REFERENCES branch(branch_id),
clock_in TIMESTAMP,
clock_out TIMESTAMP,
method VARCHAR(30)
);
CREATE TABLE overtime_request (
ot_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
request_date DATE,
hours NUMERIC(5,2),
status VARCHAR(30)
);
-- =========================
-- LEAVE MANAGEMENT
-- =========================
CREATE TABLE leave_type (
leave_type_id BIGSERIAL PRIMARY KEY,
name VARCHAR(50)
);
CREATE TABLE leave_request (
leave_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
leave_type_id BIGINT REFERENCES leave_type(leave_type_id),
start_date DATE,
end_date DATE,
status VARCHAR(30)
);
CREATE TABLE leave_balance (
balance_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
leave_type_id BIGINT REFERENCES leave_type(leave_type_id),
balance NUMERIC(10,2)
);
-- =========================
-- PAYROLL
-- =========================
CREATE TABLE payroll_period (
period_id BIGSERIAL PRIMARY KEY,
period_month INT,
period_year INT,
status VARCHAR(30)
);
CREATE TABLE payroll_run (
run_id BIGSERIAL PRIMARY KEY,
period_id BIGINT REFERENCES payroll_period(period_id),
run_date TIMESTAMP DEFAULT NOW()
);
CREATE TABLE payroll_line (
line_id BIGSERIAL PRIMARY KEY,
run_id BIGINT REFERENCES payroll_run(run_id),
employee_id BIGINT REFERENCES employee(employee_id),
base_salary NUMERIC(14,2),
overtime NUMERIC(14,2),
allowance NUMERIC(14,2),
deduction NUMERIC(14,2),
net_pay NUMERIC(14,2)
);
-- =========================
-- TAX & SSO (THAILAND)
-- =========================
CREATE TABLE tax_withholding (
tax_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
period_id BIGINT,
tax_amount NUMERIC(14,2)
);
CREATE TABLE sso_contribution (
sso_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
period_id BIGINT,
employee_contribution NUMERIC(14,2),
employer_contribution NUMERIC(14,2)
);
-- =========================
-- COMPLIANCE
-- =========================
CREATE TABLE work_rule_ack (
ack_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
acknowledged_at TIMESTAMP
);
CREATE TABLE severance_calculation (
severance_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
amount NUMERIC(14,2),
reason TEXT
);
-- =========================
-- GLOBAL MOBILITY
-- =========================
CREATE TABLE visa_record (
visa_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
country_id BIGINT REFERENCES country(country_id),
expiry_date DATE
);
CREATE TABLE work_permit (
permit_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
expiry_date DATE
);
-- =========================
-- TRAINING & DISCIPLINE
-- =========================
CREATE TABLE training_record (
training_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
training_name VARCHAR(100),
completion_date DATE
);
CREATE TABLE disciplinary_case (
case_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT REFERENCES employee(employee_id),
issue TEXT,
status VARCHAR(30)
);
-- =========================
-- AUDIT
-- =========================
CREATE TABLE audit_log (
log_id BIGSERIAL PRIMARY KEY,
table_name VARCHAR(100),
action VARCHAR(30),
changed_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE system_user (
user_id BIGSERIAL PRIMARY KEY,
username VARCHAR(100),
role VARCHAR(50)
);
Mock-Up UI Designs
| UI | Demo URL |
|---|---|
| Employee Login | https://disqrete.com/ui-mockup/employee-login.html |
Example: Enterprise HRM for 100-Branch Global Bakery Chain
HQ in Thailand | 100 branches worldwide | Bakery + Coffee + Ice Cream
This HRM architecture featured:
- Thai labor law compliance (2025)
- Multi-country expansion
- Retail shift workforce
- Payroll / attendance integration
- Auditability
- Scalable to 10,000+ employees
Implementation and Rollout
Three-phase model with as short as 90 days project lifecycle. MVP or DEMO installation deliverible within 2-weeks for testing and evaluation. System can Go-live within 4-weeks when integrate with exsting ERP or POS systems.
Phase 1 (90 days)
- Employee master
- Attendance
- Payroll Thailand
- Leave
- Dashboard
Phase 2
- Global branches
- Visa
- Scheduling AI
- Mobile app
Phase 3
- Predictive attrition
- Auto workforce planning
- Fraud detection
Baseline Architecture
1. CORE SYSTEM ARCHITECTURE
Mobile App / Web Portal
|
API Gateway
|
----------------------------------
| HRM Core Service |
| Payroll Service |
| Attendance Service |
| Compliance Reporting Service |
| Identity / SSO Service |
----------------------------------
|
PostgreSQL Cluster
|
BI / Dashboard / Data Warehouse
2. MASTER DATABASE MODULES
A. Organization Structure B. Employee Core C. Retail Workforce D. Leave E. Payroll F. Thailand Compliance G. Global Mobility H. Governance
3. KEY TABLE DESIGNS
employee
CREATE TABLE employee (
employee_id BIGSERIAL PRIMARY KEY,
employee_code VARCHAR(20) UNIQUE NOT NULL,
first_name VARCHAR(100),
last_name VARCHAR(100),
local_name VARCHAR(150),
gender VARCHAR(20),
birth_date DATE,
nationality VARCHAR(60),
marital_status VARCHAR(30),
tax_id VARCHAR(30),
passport_no VARCHAR(40),
email VARCHAR(150),
phone VARCHAR(50),
hire_date DATE,
termination_date DATE,
status VARCHAR(20),
branch_id BIGINT,
position_id BIGINT,
created_at TIMESTAMP DEFAULT NOW()
);
branch
CREATE TABLE branch (
branch_id BIGSERIAL PRIMARY KEY,
branch_code VARCHAR(20) UNIQUE,
branch_name VARCHAR(200),
country_code VARCHAR(10),
city VARCHAR(100),
timezone VARCHAR(50),
branch_type VARCHAR(50), -- bakery / kiosk / cafe
open_date DATE,
active BOOLEAN DEFAULT TRUE
);
attendence_log
CREATE TABLE attendance_log (
log_id BIGSERIAL PRIMARY KEY,
employee_id BIGINT,
branch_id BIGINT,
clock_in TIMESTAMP,
clock_out TIMESTAMP,
source VARCHAR(30), -- mobile/gps/biometric
latitude NUMERIC(10,6),
longitude NUMERIC(10,6),
approved BOOLEAN DEFAULT FALSE
);
payroll_line
CREATE TABLE payroll_line (
payroll_line_id BIGSERIAL PRIMARY KEY,
payroll_run_id BIGINT,
employee_id BIGINT,
basic_salary NUMERIC(14,2),
overtime_pay NUMERIC(14,2),
allowance NUMERIC(14,2),
deduction NUMERIC(14,2),
tax NUMERIC(14,2),
sso NUMERIC(14,2),
net_pay NUMERIC(14,2)
);
4. THAI LABOR LAW AUTOMATION
A. Overtime Compliance Engine
Checks:
- 8 hours/day
- weekly holiday work
- holiday OT rate
- missing approvals
B. Leave Engine
Auto grant:
- annual leave after 1 year
- sick leave tracking
- maternity leave entitlement
C. Severance Engine
Based on years of service.
D. PND1 Tax Engine
Monthly withholding.
E. SSO Engine
Monthly submission.
5. GLOBAL MULTI-COUNTRY SUPPORT
Each payroll country can plug local rules:
country_payroll_rule
country_leave_rule
country_tax_rule
country_holiday_calendar
Examples:
- Thailand
- Singapore
- Japan
- UAE
- UK
6. RETAIL-SPECIFIC FEATURES
Shift Scheduling AI
| Inputs: | Outputs: |
|---|---|
| * forecast sales | moving-average total value/volume |
| * foot traffic | frequency table and estimation w/ Poisson ditribution |
| * promotions | additive factor |
| * school holidays | additive factor negation |
| * weather | recommendation to on-site staffs for preparedness |
Benefits
- recommended staffing levels
- store manager situation-awareness
- source for data analytics for HQ
Cross-Branch Transfer
Employees can work temporary shifts in nearby stores.
Commission Rules
Coffee upsell / membership sales.
Software Cost
Starting from 59,999 THB.
A. Subscription
- deployed w/ SaaS via a partner
- yearly subscription payable at the beginning of the month
B. Perpetual License
- one-year warranty for a single version at the delivered installation environment
- license grated per legal entity for unlimited copies for the accepted version
Estimation of ROI
Fly-Away Cost ~ 100,000 THB per company.
Assumptions:
- Software Cost: Amortization in 3 years.
- SSO Contribution: 6,000 THB / employee / year.
- Units of Consumption is Active Employee Per Year
ROI:
- 3-Year ROI Breakdown
- baseline cost is 33,333 THB per year. Assuming a net economic profit of (6,000 THB) per unit of consumption, the 3-year ROI turns positively correlates with number of employed staffs.
| Active Employee | Total Consumption (3 Years) | Benefits (Employee-Employer Contribution) | Amortized SW Cost (3 Years) | 3-Year ROI |
|---|---|---|---|---|
| 10 | 30 | 180,000 THB | 100,000 THB | 80.0% |
| 20 | 60 | 360,000 THB | 100,000 THB | 260.0% |
| 50 | 150 | 900,000 THB | 100,000 THB | 800.0% |
| 100 | 300 | 1,800,000 THB | 100,000 THB | 1,700.0% |
| 500 | 1,500 | 9,000,000 THB | 100,000 THB | 8,900.0% |
| 1,000 | 3,000 | 18,000,000 THB | 100,000 THB | 17,900.0% |
| 10,000 | 30,000 | 180,000,000 THB | 100,000 THB | 179,900.0% |
Availability
Send email to boss@ chayapan .com for inquiry.