fix(calendar): change owner_id from String to Uuid type
The database schema defines owner_id as UUID, but the Calendar entity stored it as String. This caused a type mismatch error when creating calendars via CalDAV clients like DAVx: column "owner_id" is of type uuid but expression is of type text Changes: - Change Calendar.owner_id from String to Uuid - Update new() and with_id() to accept Uuid - Update owner_id() getter to return &Uuid - Update belongs_to() to accept &Uuid - Update calendar_storage_adapter to pass Uuid directly - Update tests to use Uuid::new_v4() Fixes #200
This commit is contained in:
@@ -49,7 +49,7 @@ impl CalendarStoragePort for CalendarStorageAdapter {
|
||||
dto: CreateCalendarDto,
|
||||
owner_id: Uuid,
|
||||
) -> Result<CalendarDto, DomainError> {
|
||||
let calendar = Calendar::new(dto.name, owner_id.to_string(), dto.description, dto.color)?;
|
||||
let calendar = Calendar::new(dto.name, owner_id, dto.description, dto.color)?;
|
||||
|
||||
let created = self.calendar_repository.create_calendar(calendar).await?;
|
||||
Ok(CalendarDto::from(created))
|
||||
|
||||
Reference in New Issue
Block a user