package com.diegocayo.organizame.data.mapper

import com.diegocayo.organizame.data.local.entity.EventEntity
import com.diegocayo.organizame.domain.model.Event
import com.diegocayo.organizame.domain.model.Subject

fun EventEntity.toModel(subject: Subject? = null): Event {
    return Event(
        id = id,
        title = title,
        description = description,
        subject = subject,
        date = date,
        startTime = startTime,
        endTime = endTime,
        createdAt = createdAt
    )
}

fun Event.toEntity(): EventEntity {
    return EventEntity(
        id = id,
        title = title,
        description = description,
        subjectId = subject?.id,
        date = date,
        startTime = startTime,
        endTime = endTime,
        createdAt = createdAt
    )
} 