# ProfitCenterHierarchy

## Description

ProfitCenterHierarchy is the organizational structure entity that defines a tree-based grouping of profit centers for hierarchical roll-up reporting and profitability aggregation. Each hierarchy carries a name and company scope. Profit center hierarchies support multi-dimensional analysis by business dimension such as region, product line, or service line, enabling both detailed drill-down analysis and executive-level summary reporting. Multiple hierarchies can coexist for the same company to support different analytical perspectives (e.g., one by region, one by product line).

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- [createProfitCenterHierarchy](../commands/CreateProfitCenterHierarchy.md) - Create a new profit center hierarchy with a name for a company

### Query Definitions

- [GetProfitCenterHierarchy](../queries/GetProfitCenterHierarchy.md) - Retrieve a profit center hierarchy by id with its full node tree

### Models

- ProfitCenterHierarchy
- ProfitCenterHierarchyNode

### Invariants

- Profit center hierarchy requires a name
- Profit center hierarchy must reference a valid companyId; the company must be in ACTIVE status
- Profit center hierarchies are scoped to a company; hierarchies from different companies are fully isolated
- Hierarchy roll-up aggregates financial results from child nodes up to parent nodes

### Relationships

- **References Company**: Each profit center hierarchy is scoped to a Company via companyId (organization module)
- **Has Many ProfitCenterHierarchyNode**: A profit center hierarchy contains one or more hierarchy nodes forming a tree structure
