import type { Weekday } from './Weekday'; import type { IValueObject } from '@gridpilot/shared/domain'; export interface MonthlyRecurrencePatternProps { ordinal: 1 | 2 | 3 | 4; weekday: Weekday; } export class MonthlyRecurrencePattern implements IValueObject { readonly ordinal: 1 | 2 | 3 | 4; readonly weekday: Weekday; constructor(ordinal: 1 | 2 | 3 | 4, weekday: Weekday) { this.ordinal = ordinal; this.weekday = weekday; } get props(): MonthlyRecurrencePatternProps { return { ordinal: this.ordinal, weekday: this.weekday, }; } equals(other: IValueObject): boolean { const a = this.props; const b = other.props; return a.ordinal === b.ordinal && a.weekday === b.weekday; } }