| Age | Commit message (Collapse) | Author | Files | Lines |
|
Instead of setting updated_at to current everywhere, aggregate in
touch() method.
|
|
|
|
|
|
|
|
Add infrastructure layer with SQLite repositories for
calendars, events, and recurring events. Implements the repository
pattern with proper domain/infrastructure separation.
- Add CalendarModel, EventModel, RecurrenceModel, and RecurrenceExceptionModel
for database persistence
- Implement SqliteCalendarRepository with CRUD operations
- Implement SqliteEventRepository with calendar filtering and time range queries
- Implement SqliteRecurringEventRepository with exception handling and transactions
- Add bidirectional mappers between domain entities and persistence models
- Use sqlx query_as for type-safe database queries with FromRow derivation
- Support upsert operations for all entities using ON CONFLICT clauses
|
|
Implement domain-driven design layer with entities, value objects, and
repository traits for calendar management system.
Domain Entities:
- Calendar: manages calendar lifecycle and archival state
- Event: handles single occurrence events with cancellation support
- RecurringEvent: supports recurring events with exception handling
- RecurrenceException: manages modifications to specific occurrences
Value Objects:
- TimeRange: enforces valid start/end time constraints
- EventColor: type-safe color representation
- Frequency: recurrence frequency enumeration (daily/weekly/monthly/yearly)
- RecurrenceRule: encapsulates recurrence pattern logic
- CalendarId & EventId: essentially just a wrapper
Repository Traits:
- CalendarRepository: calendar persistence interface
- EventRepository: event querying and persistence with overlap detection
- RecurrenceRepository: recurring event management
Key Design Decisions:
- Use Uuid for entity IDs (type safety, performance)
- Encapsulate business logic within entities
- Immutable value objects with validation
- Repository pattern for infrastructure abstraction
- Clear separation of concerns between domain and persistence layers
All entities include timestamp tracking and follow builder pattern for
construction with validation at domain boundaries.
|
|
|