# FiscalYear

## Description

FiscalYear represents a logical grouping of accounting periods scoped to a single company. Each fiscal year carries a name, start date, and end date, and may follow a calendar year (January–December) or a non-calendar cycle (e.g., April–March, 4-4-5 week structures). A fiscal year contains one or more AccountingPeriod records that collectively span its full date range. The fiscal year is the outermost temporal boundary for period management, trial balance generation, and year-end close processes.

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- [createFiscalYear](../command/CreateFiscalYear.md) - Create a new fiscal year for a company with name, start/end dates
- [updateFiscalYear](../command/UpdateFiscalYear.md) - Update mutable fields of an existing fiscal year (name only; dates immutable after periods exist)
- [deleteFiscalYear](../command/DeleteFiscalYear.md) - Delete a fiscal year with no associated accounting periods

### Query Definitions

- [GetFiscalYear](../query/GetFiscalYear.md) - Retrieve a fiscal year by id
- [ListFiscalYears](../query/ListFiscalYears.md) - List fiscal years for a company with optional filters

### Models

- FiscalYear

### Invariants

- Fiscal year must reference a valid companyId from the organization module
- Fiscal year name is required and must be non-empty
- Fiscal year must have a valid start date and end date, with start date strictly before end date
- Fiscal years within the same company must not have overlapping date ranges
- Fiscal year start and end dates are immutable after accounting periods have been created
- A fiscal year cannot be deleted if it has any associated accounting periods
- Year-end close can only be run once per fiscal year; duplicate attempts are rejected

### Relationships

- **References Company**: Each fiscal year belongs to a Company via companyId (organization module)
- **Has Many AccountingPeriod**: A fiscal year contains one or more accounting periods
