CW-051 · Publish labour aggregates to the ecosystem
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- postgresql, typescript
Research direction
Read docs/labour-data-contract.md first, then inspect the existing outbox described by CW-006 and the payroll and attendance flows. Implement the versioned labour-data/1.0 emissions and replay behavior described there, and use the acceptance criteria to verify suppression, reconciliation, revisions, privacy, unmapped centres, and idempotent replay.
Written by the indexing model from the issue text.
Description
Priority P3 · Area payroll · attendance · Estimate L · Phase E (ecosystem)
What to build
Implements docs/labour-data-contract.md, whose every decision was settled on 2026-09-25. Read it first — this ticket does not restate it.
Nothing is waiting on this. The consuming ERP feature is Enterprise-edition work scheduled after ERP v1. It is written now because the decisions are fresh, not because there is a date. Cwork itself is and remains entirely Apache 2.0; that edition split is the ERP's, and the contract is a documented public interface any other consumer may implement against.
- A
costCentre → locationCodemapping, maintained in Cwork, many-to-one — Cwork owns the cost centre, so it owns the mapping. labour.cost.period_closedwhen a payroll run closes;labour.hours.day_lockedwhen attendance for a day is locked.- Suppression at
LABOUR_MIN_GROUP(5), merging intoUNALLOCATED, pulling the next-smallest group in when that bucket would come from fewer than two — otherwise subtracting the published groups from the total reveals the number the rule exists to hide. - Revisions:
revision,previousRevision, and the revision inside the idempotency key. Without it a restatement looks exactly like a duplicate of the figure it corrects and is discarded by the mechanism meant to make delivery safe. - Emission through the existing outbox (CW-006), to a consumer holding a scoped, revocable machine credential whose every call is audited.
- A replay endpoint by period, not a cursor: the aggregates are recomputed from stored payroll and attendance, so replay is idempotent and cheap.
- Versioned
labour-data/1.0, independently of Cwork's 0.x.
Acceptance criteria
- No employee identity and no individual pay appears in any emission — a test puts distinctive names, ids and salaries in the fixture and asserts none of them reaches an event.
- A cost centre of four people is suppressed, and the totals still reconcile: published plus
UNALLOCATEDequals the period. -
UNALLOCATEDnever represents a single group. - Re-closing a period emits revision 2 carrying full figures, and a consumer that never saw revision 1 can use it as an opening position.
- An unmapped cost centre is emitted with
locationCode: null, not dropped. - Replaying a period twice changes nothing on the consumer's side.
Blocked by
None technically. By sequence it sits behind the phase 3 filings and the other phase E tickets — #48, #50, then #49 after #43.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 10
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from SuruchBoss/Cwork
-
P1
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
SuruchBoss/Cwork#90 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation good first issue P3 phase-E
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SuruchBoss/Cwork#50 ·
Maintainers usually reply within 1 day
-
good first issue mobile P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SuruchBoss/Cwork#11 ·
Maintainers usually reply within 1 day
-
P2
Difficulty 5/5 Over a week Newbie friendliness 25/100
SuruchBoss/Cwork#89 ·
Maintainers usually reply within 1 day
-
P1
Difficulty 5/5 Over a week Newbie friendliness 25/100
SuruchBoss/Cwork#88 ·
Maintainers usually reply within 1 day
All issues in SuruchBoss/Cwork
Similar issues
-
bug priority: P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
wayfinder:task
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug customer-reported data-plane question Service Attention Storage
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Azure/azure-rest-api-specs#47397 · 2 comments ·
Maintainers usually reply within 1 day
-
Claude thinking budget can shrink capped Haiku responses to 2,048 tokensPossibly taken @DavyMassoneto claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
diegosouzapw/OmniRoute#17109 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
paperclipai/paperclip#16785 ·
Maintainers usually reply within 1 day