Skip to content

feat: add work regimes and view pay by any period - #11

Merged
devRMA merged 2 commits into
fix/4k-responsivefrom
feat/regimes-e-periodos
Aug 1, 2026
Merged

feat: add work regimes and view pay by any period#11
devRMA merged 2 commits into
fix/4k-responsivefrom
feat/regimes-e-periodos

Conversation

@devRMA

@devRMAdevRMA commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Closes#6.

Both requests from the issue: a work regime field, and viewing pay by any period.

Work regime

RegimeContributes underCeiling
CLTRGPS8.475,55
Empregado PúblicoRGPS8.475,55
EstatutárioRPPS federalnone

The issue notes each regime has different deduction rules. Concretely, the difference is which social security table applies — the income tax treatment is identical across all three.

CLT and Empregado Público are both RGPS contributors, so they genuinely share one table. Estatutário follows the federal RPPS ladder from Anexo III of Portaria Interministerial MPS/MF nº 13 de 09/01/2026, which continues the RGPS brackets rather than replacing them:

até 1.621,00 7,5% ┐
2.902,84 9% │ identical to RGPS
4.354,27 12% │
8.475,55 14% ┘ ← RGPS stops here (capped)
14.514,30 14,5% ┐
29.028,57 16,5% │ estatutário keeps going
56.605,73 19% │
acima 22% ┘ no ceiling

Expressing it as the general table plus four tiers keeps a single progressive implementation, so the two can never drift apart in the shared range.

The practical consequence: the regimes are identical up to 8.475,55 and only diverge above it. At a 20.000,00 salary CLT contributes the capped 988,09 while Estatutário contributes 2.768,85.

Scope: federal RPPS only. State and municipal schemes set their own rates per entity, so they are out of scope — the manual INSS override already covers those users.

Dependents

The income tax had no dependent field. Each one now deducts 189,59, competing with the 607,20 simplified deduction — larger wins, as the Receita computes it.

One interaction worth knowing: above the 5.000,00 exemption the contribution alone is already at least 501,51, so a single declared dependent always tips the comparison to the legal deduction. The simplified deduction only wins with zero dependents, between 5.000 and roughly 5.755.

Viewing by period

The headline card gains a period selector. Everything derives from the monthly net, the monthly workload and a new configurable daily journey:

PeriodDerivationAt the defaults
Hournet ÷ monthly hours20,45
Dayhour × daily journey163,58
Weekday × 5817,91
Monthnet4.498,49
Yearnet × 1358.480,37

A year counts thirteen paid months, including the 13th salary — that answers "what do I make in a year" rather than a literal ×12.

Notes for review

The period selector is a real radio group rather than a row of buttons, so grouping, the checked state and arrow-key navigation come from the platform instead of being reimplemented.

Every new preference persists alongside the existing ones, and a stored value that is not a known regime or period falls back to the default rather than being trusted — the same treatment #9 gave the other stored values.

devRMAand others added 2 commits August 1, 2026 18:08
Adds the domain rules behind #6.
`calculateSocialSecurity` now takes a regime. CLT and Empregado Público are
both RGPS contributors, so they share the existing four brackets and its
8.475,55 ceiling. Estatutário follows the federal RPPS ladder from Anexo III
of Portaria Interministerial MPS/MF nº 13 de 09/01/2026 — which continues
the RGPS brackets rather than replacing them, adding 14,5% / 16,5% / 19% /
22% and no cap. Expressing it as the general table plus four tiers keeps a
single progressive implementation instead of two tables that could drift.
The two regimes are therefore identical up to 8.475,55 and only diverge
above it: at a 20.000,00 salary CLT contributes the capped 988,09 while
Estatutário contributes 2.768,85.
`calculateIncomeTax` now accepts a dependent count at 189,59 each, competing
with the 607,20 simplified deduction — larger wins, as the Receita computes
it. Worth noting the interaction: above the 5.000,00 exemption the
contribution alone is already at least 501,51, so a single declared
dependent always tips the comparison to the legal deduction.
`lib/salary-period.ts` converts a monthly amount to any period, deriving the
hourly rate from the monthly workload and the day from a configurable daily
journey. A year is thirteen paid months, counting the 13th salary.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Closes#6.
The calculator gains a regime selector (CLT, Empregado Público,
Estatutário), a dependent count in the taxes panel, a daily journey field,
and a period selector on the headline card covering hour, day, week, month
and year. Everything persists alongside the existing preferences, and a
stored value that is not a known regime or period falls back to the default
rather than being trusted.
The period selector is a real radio group rather than a row of buttons, so
grouping, the checked state and arrow-key navigation come from the platform
instead of being reimplemented.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercelBot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
workloadReadyReadyPreviewAug 1, 2026 9:13pm

@devRMAdevRMA changed the title feat/regimes e periodosfeat: add work regimes and view pay by any periodAug 1, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@devRMAdevRMA self-assigned this Aug 1, 2026
@devRMA
devRMA marked this pull request as ready for review August 1, 2026 21:45
@devRMA
devRMA merged commit 9a0661f into mainAug 1, 2026
4 checks passed
@devRMA
devRMA deleted the feat/regimes-e-periodos branch August 1, 2026 21:47
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: adicionar suporte a regimes estatutário e empregado público e mais...

2 participants

@devRMA@codecov-commenter