Key Assumptions and Clarifications - RodrigoMattosoSilveira/EnterpriseRemoteSystems GitHub Wiki
The source requirements are strong, but several operational rules must be made explicit for implementation.
3.1 Non-destructive records
The following records are never physically deleted:
- Person
- Collaborator
- Current Account Entry
- Mine Well Production
- Gold Price
- Price List Items
- Reference Data
Instead, records are managed with status flags, activity flags, effective dates, or reversal records.
3.2 Modular monolith first
The recommended architecture is a modular monolith, not microservices, because:
- business rules are tightly coupled,
- SQLite is the requested database,
- deployment simplicity matters for remote operations,
- transaction safety across accounting workflows is easier in one process,
- future extraction to services remains possible.
3.3 Ledger is the source of truth
Balances are derived from immutable current-account entries and reversals, not from mutable balance fields.
3.4 Dual-currency ledger
The system tracks accounting in two units:
- BRL (Real)
- Gold grams
A current-account entry belongs to exactly one currency. Summaries compute balances separately for each currency.
3.5 Salary accrual cadence
Because salary is specified as a monthly salary, but work planning operates in daily work periods, the design assumes:
- monthly salary is normalized to a daily accrual rate for daily projected earning calculations,
- the normalization formula is configurable,
- the default formula is
monthly_salary / 30.
3.6 Daily period model
Mine-well production is recorded by:
- date
- period
- well
Each period is a 12-hour shift. The plan/accrual engine uses a formal work_period entity to anchor planning and earnings.
3.7 Commission basis
Commissioned collaborators earn based on:
- assigned work well,
- work period,
- recorded well production,
- collaborator commission percentage.
If required production is missing, accrual status remains pending until production is recorded.
3.8 Sick-day and license rules
The specification implies substitution-based earnings transfer logic. The implementation will support explicit substitution links so every exception is auditable.
3.9 Work journey lifecycle
A collaborator journey has:
- start date,
- default end date = start date + 90 days,
- extension days,
- projected end date = default end + extension days,
- status transitions,
- closure workflow.
3.10 Role model
Initial recommended roles:
- Administrator: full access
- Planner: planning, accrual, production support
- Mercantile Operator: expense entry, read summaries
- Finance Viewer: read-only reports and ledgers