# WorkSchedule

## Description

WorkSchedule is the effective-dated planned-time baseline for an `Assignment`. It records the scheduled daily and weekly minutes that downstream calculation and reporting use as their reference. Actual worked time remains in time-tracking.

Employment-regime classification does not belong on this record. Workforce already assigns a company-defined `WorkRegime` to `WorkerEmployment`; calculation strategies and application-owned rules interpret that catalog. Regime-specific and country-specific configuration — a flex core-time band, Japanese variable-working clearing periods, deemed-hours settings — is supplied by the consuming application through WorkSchedule custom fields and application-owned models.

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- createWorkSchedule — open the initial planned-time baseline for an Assignment
- updateWorkSchedule — record a planned-time change as a new generation
- endWorkSchedule — close the current generation

### Query Definitions

- getWorkSchedule — retrieve one generation by id
- getWorkScheduleAsOf — resolve the generation effective on a date
- listWorkSchedulesByAssignment — list an Assignment's history
- listActiveWorkSchedules — list current generations

### Models

- WorkSchedule

### Invariants

- Generations are effective-dated by `effectiveStart`, nullable `effectiveEnd`, and `versionOf`; generations in one lineage must not overlap
- Every WorkSchedule references exactly one `Assignment`
- `scheduledDailyMinutes` and `scheduledWeeklyMinutes` are non-negative minute counts
- The generation's effective range must be consistent with the referenced Assignment

### Relationships

- **Belongs to Assignment**: `assignmentId` references the [Assignment](Assignment.md) whose planned-time baseline this is
- **Uses WorkRegime indirectly**: the Assignment's WorkerEmployment identifies the applicable company-defined [WorkRegime](WorkRegime.md); WorkSchedule does not duplicate it
- **Extended by applications**: regime-specific and jurisdiction-specific configuration is added through custom fields and application-owned models
