Bite 32.3 — Work and Credit Evidence - RodrigoMattosoSilveira/EnterpriseRemoteSystems GitHub Wiki
Bite 32.3 — Work and Credit Evidence
Manual Promotion Test Suite
Branch: 898-bite-323-work-and-credit-evidence
Committed HEAD SHA: 0c87cc892f8b039b6fabf6ec8699e0f6ae8e1c91
Promotion rule
Promote Bite 32.3 only if all four tests PASS.
Promotion is blocked if any of the following occurs:
- a Person cannot see Work and Credit Evidence for their own current Journey;
- a Person cannot see the evidence surface for their own closed Journey;
- recognized work includes future PLANNING assignments that do not yet have an actual outcome;
- a daily-wage Journey incorrectly presents unrelated Gold Production as a compensation input;
- a commission Journey fails to show its matching Gold Production input;
- the accrual evidence does not reconcile with the seeded compensation rule;
- Journey-specific credits/debits or receipt provenance are missing or attached to the wrong Journey;
- a Tenant Administrator receives the self-service Work and Credit Evidence surface merely because they can browse Journeys;
- switching locale changes the underlying evidence;
- raw I18N keys appear;
- an unexpected 401, 403, 404, 500, JavaScript exception, or application error occurs during a supported UI flow.
0. Prerequisites
0.1 Confirm exact HEAD
From the repository root:
git rev-parse HEAD
Expected:
0c87cc892f8b039b6fabf6ec8699e0f6ae8e1c91
PASS: the SHA matches exactly.
BLOCK PROMOTION: stop if it differs.
0.2 Reset the deterministic Brazilian demo database
Stop any currently running LOCAL backend.
Run:
make brazilian-demo-local-reset BRAZILIAN_DEMO_AS_OF=2026-09-18
make brazilian-demo-local-verify BRAZILIAN_DEMO_AS_OF=2026-09-18
Do not continue unless verification succeeds.
The expected scenario includes:
Completed Work Period: September 16, 2026
Future PLANNING Work Period: September 19, 2026
Rafael:
DAILY wage = R$350.00
earning credit = R$350.00
expense debit = R$350.00
receipt = RETURNED
resulting BRL balance = R$0.00
Camila:
commission = 5%
matching Gold Production = 80 g
calculated earning = 4 g
resulting gold balance = 4 g
Rafael historical Journey:
closed June 10, 2026
daily wage = R$280.00
intentionally has no seeded Work Period/accrual/ledger evidence
0.3 Start LOCAL backend
In Terminal 1:
ERS_DATABASE_PATH=data/brazilian-demo.db make local-backend
Leave it running.
0.4 Start LOCAL frontend
In Terminal 2:
make local-frontend
Open the normal LOCAL ERS URL displayed by Vite.
Do not navigate by manually typing application route URLs during these tests.
Test 01 — Rafael: daily-wage Work and Credit Evidence in Portuguese
Purpose
Verify that an ordinary Person can trace:
recognized work
→ daily-wage rule
→ accrual
→ earning credit
→ expense debit
→ receipt provenance
while unrelated Gold Production and future PLANNING work are excluded.
Identity
Sign out of any existing session.
Sign in as:
Person: Rafael Lima
Nickname: Rafa
Login: [email protected]
Password: Demo-31.4-Person!
Confirm the selected Tenant/context is:
Mineração Serra Dourada — DEMO
Select:
Português (Brasil)
Navigation
-
In the normal application navigation, click Colaboradores.
-
Confirm the page title is:
Minhas Jornadas de Colaborador -
Confirm Rafael's current and historical Journeys are listed.
-
Select Rafael's current Journey—the one that is not marked Encerrada.
-
Confirm the Journey detail page identifies Rafael Lima.
Compensation rule
-
Scroll to:
Demonstrativo de Trabalho e Crédito -
Confirm the panel contains:
Regra de remuneração Trabalho reconhecido Ganhos calculados Lançamentos da Conta Corrente -
Under Regra de remuneração, confirm:
- the method corresponds to a daily wage;
- the value is R$ 350,00 per day.
Work recognized
- Under Trabalho reconhecido, count the recognized Work Period records.
Expected:
1
- Confirm the record is dated:
16 de set. de 2026
- Confirm its Work Period status is the localized equivalent of:
FULLY_POSTED
Expected Portuguese presentation:
Totalmente Lançado
- Confirm:
Resultado real: Trabalhou
- Confirm the work assignment corresponds to Rafael's current assignment:
- Maintenance;
- Main Mine;
- Equipment Maintenance.
- Locate:
Entrada de Produção de Ouro
- Confirm its value is:
Nenhuma entrada de Produção de Ouro correspondente
This is important.
Rafael is paid a daily wage, so the 80 g site production must not be presented as one of his compensation inputs.
- Confirm there is no recognized-work record dated September 19, 2026.
The September 19 Work Period is still PLANNING and has no actual outcome. It must not be presented as recognized work.
Earnings calculated
- Under:
Ganhos calculados
confirm exactly one posted earning calculation is shown.
- Confirm:
Regra de cálculo: BRL Diário
- Confirm the direction is:
Crédito
- Confirm:
Valor ganho: R$ 350,00
- Confirm the accrual date is:
16 de set. de 2026
-
Confirm the accrual/run state is posted rather than pending.
-
Confirm Work Period and Assignment provenance IDs are displayed.
Record them:
Work Period ID: ______________________________________
Assignment ID: _______________________________________
Current Account postings
- Under:
Lançamentos da Conta Corrente
confirm Rafael has at least these two Journey-specific postings:
Earning
crédito de ganho
Crédito lançado
R$ 350,00
with an effective date of:
16 de set. de 2026
- Confirm its source provenance corresponds to:
atribuição do Período de Trabalho
- Confirm the Source ID matches the Assignment ID recorded in step 23.
Expense
- Locate the Journey's flight expense posting.
Confirm:
dedução de despesa
Débito lançado
and a debit magnitude of:
R$ 350,00
The displayed signed amount should clearly be negative/debit.
- Confirm its effective date is:
17 de set. de 2026
- Confirm:
Origem do lançamento: despesa
- Confirm the posting includes receipt information.
Expected receipt state:
Devolvido · Concluído · RCP-DEMO-BR-0002
- Confirm both postings identify their correction state as:
Original
Expected result
The visible evidence should tell this coherent story:
Rafael worked September 16
↓
daily wage R$350
↓
R$350 earning calculated
↓
R$350 credit posted
↓
R$350 flight expense debit posted
↓
receipt returned/completed
The evidence must not claim that the 80 g Gold Production was an input to Rafael's daily-wage calculation.
PASS
PASS if all steps above are satisfied.
BLOCK PROMOTION
Block promotion if:
- the panel is absent;
- September 19 appears under recognized work;
- Rafael shows
80 gas Gold Production input; - the earned amount is not R$350;
- the earning credit or flight debit is missing;
- the receipt is missing or has the wrong lifecycle state;
- the posting provenance does not reconcile with the displayed work/accrual evidence.
Test 02 — Camila: gold-commission evidence in English
Purpose
Verify the second compensation model and simultaneous en-US implementation:
recognized work
→ 80 g Gold Production
→ 5% commission
→ 4 g earned
→ 4 g credit posted
Identity
-
Sign out as Rafael.
-
Sign in as:
Person: Camila Souza
Nickname: Cami
Login: [email protected]
Password: Demo-31.4-Person!
- Confirm selected Tenant:
Mineração Serra Dourada — DEMO
- Select:
English (United States)
Navigation
-
Click Collaborators in the normal application navigation.
-
Confirm the page is self-service:
My Collaborator Journeys
-
Open Camila Souza's current Journey.
-
Scroll to:
Work and Credit Evidence
Compensation rule
- Confirm the section:
Compensation rule
- Confirm the method corresponds to:
Commission
- Confirm the value is:
5%
Work recognized
- Under:
Work recognized
confirm exactly one recognized Work Period is shown.
- Confirm its date is:
Sep 16, 2026
- Confirm:
Actual outcome: Worked
- Confirm the Work Period is:
Fully Posted
- Confirm the assignment corresponds to:
- Processing;
- Processing Plant;
- Gold Processing.
- Locate:
Gold Production input
- Confirm it says:
80 g gold recorded
- Confirm there is no September 19 PLANNING assignment under Work recognized.
Earnings calculated
- Under:
Earnings calculated
confirm one posted calculation.
- Confirm:
Calculation rule: Gold Commission
- Confirm:
Direction: Credit
- Confirm:
Amount earned: 4 g
- Confirm the accrual date is:
Sep 16, 2026
- Confirm the Work Period and Assignment provenance IDs are displayed.
Record the Assignment ID:
Camila Assignment ID: __________________________________
Current Account postings
- Under:
Current Account postings
confirm a posting exists with:
earning credit
Credit posted
4 g
- Confirm its date is:
Sep 16, 2026
- Confirm:
Source provenance: Work Period assignment
-
Confirm its Source ID matches the Camila Assignment ID recorded above.
-
Confirm:
Correction: Original
- Confirm no unrelated Rafael or João Expense posting appears in Camila's evidence.
I18N inspection
- Confirm the new Bite 32.3 structural UI is English:
Work and Credit Evidence
Compensation rule
Work recognized
Earnings calculated
Current Account postings
Gold Production input
Amount earned
Credit posted
- Confirm no raw translation key appears, such as:
workCredit.title
workCredit.workRecognized
workCredit.amountEarned
workCredit.creditPosted
- Confirm the same screen does not retain Portuguese Bite 32.3 structural labels such as:
Demonstrativo de Trabalho e Crédito
Trabalho reconhecido
Ganhos calculados
Crédito lançado
Expected result
Camila's statement must communicate:
80 g production
× 5% commission
= 4 g earned
= 4 g credit posted
with provenance linking the recognized work to the accrual and ledger credit.
PASS
PASS if the 80 g → 5% → 4 g story is visibly coherent and entirely presented in English.
BLOCK PROMOTION
Block promotion if:
- Gold Production is absent;
- production is not 80 g;
- commission is not 5%;
- calculated earning is not 4 g;
- credit posting is not 4 g;
- another Person's financial posting appears;
- untranslated or mixed-language 32.3 UI appears.
Test 03 — Rafael's closed Journey retains the historical evidence surface
Purpose
Verify the core historical invariant of Bite 32.3:
Closing a Journey must not remove the Person's ability to inspect that Journey's Work and Credit Evidence.
The demo's historical Rafael Journey intentionally contains no seeded Work Period, accrual, or ledger evidence. The correct behavior is therefore a durable evidence panel with truthful empty states, not fabricated financial history.
Identity
-
Sign out as Camila.
-
Sign in again as:
Person: Rafael Lima
Login: [email protected]
Password: Demo-31.4-Person!
- Confirm:
Mineração Serra Dourada — DEMO
- Select:
Português (Brasil)
Navigation
-
Click Colaboradores.
-
Confirm:
Minhas Jornadas de Colaborador
- Select Rafael's historical Journey marked:
Encerrada
- Confirm this is the Journey that started:
10 de fev. de 2026
and ended:
10 de jun. de 2026
- Confirm the Journey header describes the actual end date, not a projected end.
The closed-Journey presentation must communicate the equivalent of:
Encerrada em 10 de jun. de 2026
and must not characterize June 10 as merely the projected end.
Evidence surface
-
Scroll down.
-
Confirm the closed Journey still displays:
Demonstrativo de Trabalho e Crédito
- Under:
Regra de remuneração
confirm:
- the method is daily wage;
- the configured historical value is R$ 280,00.
- Under:
Trabalho reconhecido
confirm the empty-state message is:
Nenhuma evidência de Período de Trabalho foi registrada para esta Jornada.
- Under:
Ganhos calculados
confirm:
Nenhum cálculo de acúmulo foi registrado para esta Jornada.
- Under:
Lançamentos da Conta Corrente
confirm:
Nenhum lançamento da Conta Corrente foi registrado para esta Jornada.
- Confirm the page does not copy Rafael's current Journey evidence into this historical Journey.
Specifically, the historical Journey must not contain:
R$ 350,00 earning
R$ 350,00 flight debit
RCP-DEMO-BR-0002
September 16, 2026 Work Period evidence
Expected result
The closed Journey remains a readable historical statement, but ERS truthfully reports that no canonical Work Period/accrual/ledger evidence was recorded for that old Journey.
It must not manufacture or borrow evidence from Rafael's newer Journey.
PASS
PASS if the evidence surface remains accessible and all three evidence collections correctly show their empty states.
BLOCK PROMOTION
Block promotion if:
- the Work and Credit Evidence panel disappears solely because the Journey is closed;
- opening the closed Journey causes a 403;
- current-Journey accounting evidence appears on the closed Journey;
- ERS fabricates historical earnings or postings;
- the Journey once again describes its actual closure as only a projected end.
Test 04 — Tenant Administrator does not receive Person self-service evidence access
Purpose
Verify the authorization boundary established by Bite 32.3.
This Bite introduces Person self-service evidence access only.
It does not grant Tenant Administrators the new evidence projection merely because they can browse a Person's Journeys.
Identity
-
Sign out as Rafael.
-
Sign in as:
Role: Tenant Administrator
Person: Mariana Alves
Login: [email protected]
Password: Demo-31.4-Brasil!
- Confirm selected Tenant:
Mineração Serra Dourada — DEMO
Locale may be either supported locale.
Navigation
- Use the normal UI navigation to open:
People / Pessoas
- Locate:
Rafael Lima
-
Open Rafael's Person record.
-
Locate:
Journey History / Histórico de Jornadas
-
Open Rafael's current Journey through its normal Journey-history action.
-
Confirm the Journey detail itself opens successfully. This verifies Mariana retains the normal 32.1 Tenant Administrator Journey-history access.
-
Scroll through the entire Journey detail page.
-
Confirm there is no section titled:
Work and Credit Evidence
or:
Demonstrativo de Trabalho e Crédito
-
Return to Rafael's Person page.
-
Open Rafael's closed historical Journey.
-
Again scroll through the entire Journey detail.
-
Confirm the Work and Credit Evidence panel is absent.
Expected result
Mariana may inspect Rafael's Journey history according to Bite 32.1, but Bite 32.3 does not add access to the Person's self-service Work and Credit Evidence projection.
The expected distinction is:
Rafael as himself
→ Work and Credit Evidence visible
Mariana as Tenant Administrator
→ Journey detail visible
→ Work and Credit Evidence not visible
PASS
PASS if Mariana can still perform the normal Tenant Administrator Journey-history flow while the new 32.3 evidence panel remains absent.
BLOCK PROMOTION
Block promotion if:
- Mariana sees the new evidence panel;
- the panel exposes Rafael's accrual/ledger/receipt evidence;
- removing evidence access accidentally prevents Mariana from opening the Journey itself;
- an authorization/application error occurs during the pre-existing Tenant Administrator Journey-history flow.
Correction/reversal provenance — no additional manual fixture required
Bite 32.3 also preserves:
original postings
reversals
replacements
inactive historical postings
correction reason
related-entry provenance
No extra manual test is required for those states before this promotion.
The Brazilian demo fixture intentionally does not manufacture ledger corrections solely for presentation purposes.
The committed automated coverage explicitly creates:
original credit
+
debit with receipt
+
ledger reversal
+
related original entry
+
correction reason
and verifies that all of those records survive the evidence projection.
Creating synthetic correction rows manually would add less confidence than the deterministic automated test and would require unnecessary database mutation.
Cross-Tenant confidentiality — no manual DevTools/API/SQL test required
No additional manual cross-Tenant evidence test is required.
The committed backend regression explicitly verifies:
different Membership
→ requested Journey evidence denied
same Membership identifier but Journey in another Tenant
→ requested Journey evidence denied
That is a stronger deterministic test of the repository's Tenant predicate than attempting to construct malformed cross-Tenant data manually.
DevTools / API / SQL
None required.
All promotion acceptance above is intentionally executable through the normal ERS UI.
Final promotion checklist
[x] Exact ZIP/SHA verified
[x] make local-check passes — reported by tester
[x] Feature-branch CI passes — reported by tester
[ ] Test 01 — Rafael DAILY evidence + expense/receipt provenance — PASS
[ ] Test 02 — Camila 80 g × 5% = 4 g commission + en-US parity — PASS
[ ] Test 03 — Rafael closed Journey historical evidence surface — PASS
[ ] Test 04 — Tenant Administrator does not receive self-service evidence — PASS
If all four tests PASS and no new usability or confidentiality defect is observed, Bite 32.3 — Work and Credit Evidence is ready for promotion.