package com.ffii.fpsms.m18.entity

import com.ffii.core.entity.BaseEntity
import jakarta.persistence.*
import java.time.LocalDateTime

@Entity
@Table(name = "scheduler_sync_log")
open class SchedulerSyncLog(
    @Column
    open var syncType: String? = null,  // PO, DO1, DO2, MASTER_DATA

    @Column
    open var status: String = "", // SUCCESS, FAILED, PARTIAL

    @Column
    open var recordsProcessed: Int = 0,

    @Column
    open var recordsSaved: Int = 0,

    @Column
    open var recordsFailed: Int = 0,

    @Column(columnDefinition = "TEXT")
    open var errorMessage: String? = null,

    @Column(columnDefinition = "TEXT")
    open var query: String? = null,

    @Column
    open var startTime: LocalDateTime = LocalDateTime.now(),

    @Column
    open var endTime: LocalDateTime = LocalDateTime.now()
) : BaseEntity<Long>()