Repository navigation
Core Domain Model
Permanent identity and contact record.
- id
- first_name
- last_name
- nick_name
- phone
- cpf
- rg
- address_street_1
- address-street_2
- address_city
- address_state
- address_coutry
- bank_name
- bank_numbere
- bank_checking
- pix_key
- emergency_contact_name
- emergency_contact_phone
- emergency_contact_notes
- status
- created_at
- updated_at
- archived_at nullable
- unique(name)
- unique(phone)
- unique(email)
- unique(cpf)
- unique(pix_key)
A person may have many collaborator journeys over time.
Represents a specific contractual work journey for a person.
- id
- person_id
- journey_start_date
- default_end_date
- extension_days
- projected_end_date
- payment_method_id
- payment_value
- sector_id
- location_id
- task_id
- status_id
- notes
- created_at
- updated_at
- closed_at nullable
default_end_date = journey_start_date + 90 daysprojected_end_date = default_end_date + extension_days
- no physical deletion
- one person may have multiple journeys across time
- optional rule: only one active collaborator journey per person at a time
Production recorded for a specific well and period.
- id
- work_date
- period_code
- location_id
- grams_produced
- comments
- created_by
- created_at
- updated_at
- unique(work_date, period_code, location_id)
- location must be a mine-well type location
Daily gold reference price.
- id
- quote_date
- quoted_at_time
- price_brl_per_gram
- source_name
- comments
- created_by
- created_at
- updated_at
- unique(quote_date)
Default rule: use most recent quote at time of transaction.
Catalog of goods and services.
- id
- code
- name
- description
- category
- price_brl
- active
- created_at
- updated_at
price_gold_grams = price_brl / latest_gold_price_brl_per_gram
Gold price equivalent is usually computed dynamically and optionally snapshot into expense line items.
Immutable ledger entry representing a credit or debit in one currency.
- id
- reverted_entry_id nullable
- collaborator_id
- entry_date
- source_type
- source_id nullable
- method_id nullable
- currency_code
- cd_flag
- item_description
- quantity
- unit_price
- total_price
- comments
- status
- created_by
- created_at
- earning_accrual
- expense
- reversal
- zero_out
- journey_close
- manual_adjustment
- BRL
- GOLD_GRAMS
- CREDIT
- DEBIT
- quantity > 0
- total_price >= 0
- reversal entries reference original entry
- original entries are not edited after posting
A plan/accrual anchor for operational periods.
- id
- work_date
- period_code
- starts_at
- ends_at
- status
- created_at
- updated_at
- planned
- informed
- accrued
- locked
- unique(work_date, period_code)
Operational assignment of a collaborator for a work period.
- id
- work_period_id
- collaborator_id
- include_flag
- sector_id
- location_id
- task_id
- method_id
- payment_value_snapshot
- assignment_status
- substituted_for_collaborator_id nullable
- exception_type nullable
- comments
- created_at
- updated_at
- planned
- worked
- sick
- license
- absent
- excluded
- none
- sick_substitution
- license_substitution
Header record for an expense operation.
- id
- collaborator_id
- expense_date
- currency_code
- total_amount
- category
- collaborator_agreement
- comments
- created_by
- created_at
- updated_at
- canteen
- pix
- flights
- pay_daily_wager
- diverse
Line item under an expense transaction.
- id
- expense_id
- price_list_item_id nullable
- item_name_snapshot
- quantity
- unit_price
- total_price
- comments
- created_at
Tracks the accrual operation for a work period.
- id
- work_period_id
- accrual_status
- comments
- created_by
- created_at
- updated_at
- draft
- pending_production
- posted
- partially_posted
- reverted
One collaborator’s earnings computation for a period.
- id
- accrual_batch_id
- collaborator_id
- method_id
- currency_code
- calculation_basis_json
- gross_amount
- transfer_amount
- net_amount
- ledger_entry_id nullable
- status
- comments
- created_at
Configurable lookup tables.
Recommended generic table structure:
- id
- type
- code
- label
- description
- active
- sort_order
- metadata_json
- created_at
- updated_at
Supported types:
- sector
- location
- task
- method
- person_status
- collaborator_status
- expense_category
- period_code
- ledger_currency
- ledger_cd_flag