package com.diegocayo.organizame.data.mapper

import com.diegocayo.organizame.data.local.entity.TaskEntity
import com.diegocayo.organizame.domain.model.Subject
import com.diegocayo.organizame.domain.model.Task

fun TaskEntity.toModel(subject: Subject? = null): Task {
    return Task(
        id = id,
        title = title,
        description = description,
        subject = subject,
        priority = priority,
        status = status,
        scheduledDate = scheduledDate,
        createdAt = createdAt
    )
}

fun Task.toEntity(): TaskEntity {
    return TaskEntity(
        id = id,
        title = title,
        description = description,
        subjectId = subject?.id,
        priority = priority,
        status = status,
        scheduledDate = scheduledDate,
        createdAt = createdAt
    )
} 