Wanted: a qualified review of the Thai payroll and social-security rules
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
What this is
Cwork computes Thai personal income tax withholding, social security and Labour
Protection Act overtime. Those rules were written from published sources — the
Revenue Code, the Social Security Act, Revenue Department guidance — and
unit-tested against hand-worked examples.
That proves the code computes what its author believed the rules to be. It does
not prove the belief is correct. No accountant, tax agent or payroll
professional has reviewed them.
This issue is an open invitation to anyone who has the standing to.
What there is to look at
| The rules, in prose | docs/payroll-thailand.md — brackets, allowances, the order of operations, OT multipliers |
| The implementation | backend/src/modules/payroll/domain/thai-tax.ts — pure functions, no database, readable on its own |
| The test cases | backend/src/modules/payroll/domain/thai-tax.spec.ts — 27 cases with the bracket arithmetic worked out by hand |
The rule set is data (THAI_TAX_RULES_2026), so a correction is usually a
config edit plus a test case rather than a rewrite.
The questions that would help most
- The order of operations. Employment expense deduction (50%, capped at
฿100,000), then allowances, then donations capped at 10% of what remains,
then the progressive brackets. Is that the right sequence, and are the caps
applied against the right base at each step? - Monthly withholding versus annual liability. The engine annualises the
month's pay and divides. Is that the method the Revenue Department expects,
and what should happen to a mid-year joiner or a one-off bonus? - Social security. 5% each side, on a salary floor and ceiling. Are the
current figures right, and is the rounding what the SSO expects? - Overtime multipliers. 1.5× on a working day, 2× on a day off, 3× on a
public holiday for an employee entitled to holiday pay. Are the conditions
attached to each right? - Anything the engine does not model at all that a real payroll run would
hit in the first month.
How to help
A comment is enough — a correction, a citation, or "this one is wrong and here
is the case that shows it". A failing test case is even better. You do not need
to write any code, and you do not need to read the rest of the repository.
If you would rather not be named, say so and you will not be.
Why it is being asked in public
An HRIS that gets withholding wrong costs somebody their salary and their
employer a penalty. Saying "no qualified person has checked this" in the README
and then not asking anyone would be the wrong half of honesty.
Tracked as part of CW-030 in docs/backlog.md.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with docs/payroll-thailand.md, then compare the rules with backend/src/modules/payroll/domain/thai-tax.ts and the 27 cases in backend/src/modules/payroll/domain/thai-tax.spec.ts. Verify the cited Thai tax, social-security and labour rules against current authoritative sources; done means recording corrections, citations, missing cases or confirmation from a qualified reviewer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, documentation, testing
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 30/100