# Domain Glossary

This glossary captures terms that appear in code, database fields, and UI.

## Business Terms

- RPS: Repair Performance System, the desktop app/product.
- Bodyshop: A repair shop/account using the app.
- Association: Link between a user email and a bodyshop.
- Job: A repair claim/estimate record.
- Jobline: A line item within a repair estimate.
- Claim number / `clm_no`: Claim identifier used for lookup/search.
- RO number / `ro_number`: Repair order number.
- Insurer / `ins_co_nm`: Insurance company name on a job.
- Accepted insurers / `accepted_ins_co`: Shop-specific list of insurers to accept/import.
- Close date: Claim close date, used in reporting and ruleset selection.
- Loss date: Date of loss, used by job queries and reporting.
- Vehicle group / `group`: Group assignment based on vehicle make/type/age and configured rules.
- Target: Target percentage used in RPS calculations.
- Grouping: Hasura data that maps vehicle make/type/date ranges to groups.
- Group verified: User/shop-confirmed group assignment.
- Requires reimport: Flag indicating a job should be reimported because decoded data or rules changed.

## Estimate/File Terms

- EMS: Estimate Management Standard file set. The app watches for estimate files in local folders.
- DBF: dBASE file format used by decoded estimate data.
- AD1/AD2: Estimate DBF files decoded by `electron/decoder/decoder.js`.
- LIN: Estimate line DBF file.
- VEH: Vehicle DBF file.
- TTL: Totals DBF file.
- PFH/PFL/PFM/STL: Additional estimate/system DBF files decoded when present.
- Watch path: Local directory watched by chokidar.
- File scan: Manual scan of configured watch paths.
- Import: Decode local estimate files and upsert the resulting job/joblines into Hasura.

## Rules and Programs

- MPI: Manitoba Public Insurance, a ruleset/insurer context used heavily in targets and line rules.
- SGI: Saskatchewan Government Insurance, another ruleset context. Some UI warns SGI eligibility rules may fall back to MPI rules.
- RCC: A reporting/eligibility flag surfaced as `sgi_rcc`/RCC-related UI.
- Ruleset: Date/rule bundle used by decoder logic to mark/interpret joblines.
- V1/V2/V3 rulesets: Decoder-era rulesets selected by close date.
- Claims Clerk: Domain rule engine that flags line-level issues/alerts.
- Estimate Scrubber / ES: External API workflow that validates/scrubs estimate JSON and returns a report.
- ES API key: Shop-specific API key stored on `bodyshops.es_api_key`.

## Common Database Fields

Jobs:

- `id`: UUID primary key.
- `bodyshopid`: Owning bodyshop.
- `clm_no`: Claim number.
- `ro_number`: Repair order number.
- `ins_co_nm`: Insurer name.
- `close_date`: Claim close date.
- `loss_date`: Loss date.
- `v_vin`: Vehicle VIN.
- `v_makedesc` / `v_model`: Vehicle make/model.
- `v_model_yr`: Vehicle model year.
- `v_type`: Vehicle type.
- `v_age`: Vehicle age.
- `v_mileage`: Vehicle mileage.
- `group`: Vehicle group.
- `group_verified`: Whether group was manually verified.
- `rates`, `totals`: JSON estimate rate/total blobs.
- `requires_reimport`: Indicates data should be imported again.

Joblines:

- `id`: UUID primary key.
- `jobid`: Parent job.
- `line_no`: Estimate line number.
- `unq_seq`: Source unique sequence id.
- `line_ind`: Source line indicator.
- `line_desc`: Line description.
- `part_type`: Part type/category.
- `db_price`: Database/reference price.
- `act_price`: Actual price.
- `price_diff`, `price_diff_pc`: Price difference fields.
- `ignore`: Whether line is excluded from calculations.
- `alerts`: Rules/claims-clerk alert payload.
- `line_ref`: Parent/source line reference.

Bodyshops:

- `shopname`: Shop display name.
- `accepted_ins_co`: JSON array of accepted insurers.
- `targets`: JSON target config.
- `groups`: JSON group config.
- `features`: Feature config.
- `channel`: Update/release channel.
- `es_api_key`: Estimate scrubber key.
- `ins_rule_set`: Shop ruleset, such as SGI.

## UI/Code Abbreviations

- `pct`, `pc`: Percent.
- `ppd`: Price/part difference domain abbreviation used in settings/alerts.
- `rps`: Repair performance score/system.
- `asgn`: Assignment.
- `insp`: Inspection.
- `ded`: Deductible.
- `supp`: Supplement.
- `tlos`: Total loss indicator.
- `prt`: Part.
- `lbr`: Labor.
- `amt`: Amount.
- `qty`: Quantity.

