package com.sikey.wa04.business.infrastructure.dto.model;

import jakarta.persistence.*;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

import java.time.Instant;

@Getter
@Setter
@Entity
@Table(name = "tb_child_alarm_clock")
public class ChildAlarmClockModel extends BaseModel {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    @Size(max = 36)
    @NotNull
    @Column(name = "child_id", nullable = false, length = 36)
    private String childId;

    @Size(max = 52)
    @Column(name = "label", length = 52)
    private String label;

    @Size(max = 10)
    @NotNull
    @Column(name = "repeats", nullable = false, length = 10)
    private String repeats;

    @Size(max = 10)
    @NotNull
    @Column(name = "time", nullable = false, length = 10)
    private String time;

    @Column(name = "once_time")
    private Long onceTime;

    @NotNull
    @ColumnDefault("0")
    @Column(name = "status", nullable = false)
    private Boolean status;

    @Column(name = "deleted_at")
    private Instant deletedAt;

}