Database ERD
Overviewβ
The ForgeX database consists of 27 models organized into core entities, configuration tables, and audit logging. This ERD shows the complete structure with all relationships.
Entity Relationship Diagramβ
Model Categoriesβ
Core Models (3)β
User
Authentication and authorization with invitation system
Client
Customer/client management
Bid
Main bid entity with cost rollup fields
User Management (1)β
ServiceAccess
Service-specific access control (BIDS, PROJECTS, FIELD) with optional role override
Scope Types & Configuration (2)β
ScopeType
Types of scopes (e.g., Slab, Pier, Wall) with active/inactive status
ScopeTypeMaterialCategory
Junction table linking scope types to required material categories
Scope & Estimation Items (7)β
Scope
Work breakdown structure within a bid
ConcreteItem
Concrete and rebar calculations
LaborItem
Labor cost estimation
EquipmentItem
Equipment rental and fuel costs
MaterialItem
Material costs with waste factors
SubcontractorItem
Subcontractor services (pumps, saws, etc.)
MiscItem
Miscellaneous costs
Configuration Models (9)β
GlobalVariable
Bid-specific variable overrides
DefaultVariable
Location-based default variables
PricingItem
Global pricing catalog
BidPricingItem
Bid-specific pricing overrides
RebarRate
Rebar size and spacing rates
Employee
Crew/labor employee data
PumpPricing
Pump catalog with vendor pricing
Audit & Logging (1)β
AuditLog
Complete audit trail for all entity changes
Key Relationshipsβ
- Bid β Scope β Items: Hierarchical cost structure
- PricingItem β BidPricingItem: Global pricing with bid overrides
- PricingItem β Items: Items reference pricing for calculations
- ConcreteItem β MaterialItem: Auto-generated material items from concrete
- User β Bid: Creator tracking
- Client β Bid: One-to-many relationship
- Bid β Bid (sourceBidId): Imported bid traceability (optional self-reference)
- ScopeType β Scope: Each scope has a type (required for new scopes)
- ScopeType β ScopeTypeMaterialCategory: Many-to-many relationship for material categories
- User β ServiceAccess: Users have service-specific access with optional role overrides
Enumsβ
BidStatusβ
DRAFT- Work in progressSUBMITTED- Sent to clientNEGOTIATION- In negotiation phaseAWARDED- Bid wonCOMPLETED- Project completedLOST- Bid lost
UserRoleβ
ADMIN- System administratorPM- Project ManagerOPS- OperationsACCOUNTING- Accounting/FinanceESTIMATOR- Bid estimatorFOREMAN- Field foreman
UserStatusβ
PENDING_INVITATION- Invited but hasn't acceptedACTIVE- Active userDISABLED- Account disabled
ServiceTypeβ
BIDS- Bids service accessPROJECTS- Projects service accessFIELD- Field service access