# AllocationResult

## Description

AllocationResult is an immutable record produced when an allocation cycle is executed in ACTUAL mode, capturing the outcome of a single sender-receiver cost distribution. Each result carries an allocation cycle reference, sender cost center reference, receiver type, receiver id, allocated amount, and cost element reference. Allocation results serve as the authoritative audit trail for cost allocations, linking the cycle, sender, receiver, allocated amount, and cost element used. Once created, allocation result records cannot be modified or deleted — corrections are handled exclusively through cycle reversal and re-execution.

## Domain Model Definitions

### Model type

AppendOnly

### Command Definitions

- [executeAllocationCycle](../commands/ExecuteAllocationCycle.md) - Allocation results are created as part of executing an allocation cycle in ACTUAL mode

### Query Definitions

- [GetAllocationCycle](../queries/GetAllocationCycle.md) - Retrieve allocation results as part of the parent allocation cycle

### Models

- AllocationResult

### Invariants

- Allocation results are created exclusively during allocation cycle execution in ACTUAL mode
- Allocation results cannot be modified or deleted after creation
- Each allocation result references the allocation cycle, sender, receiver, allocated amount, and cost element used
- Allocation results serve as the immutable audit trail for cost allocations

### Relationships

- **Belongs to AllocationCycle**: Each allocation result belongs to an AllocationCycle via allocationCycleId
- **References CostCenter (sender)**: Each allocation result references a sender CostCenter via senderCostCenterId
- **Polymorphic Receiver**: Each allocation result references a receiver via receiverType and receiverId, which can be a CostCenter, ProfitCenter, or InternalOrder
- **References CostElement**: Each allocation result references a CostElement via costElementId
