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 lombok.experimental.Accessors;
import org.hibernate.annotations.ColumnDefault;

import java.time.Instant;

@Getter
@Setter
@Entity
@Table(name = "tb_child")
@Accessors(chain = true)
public class ChildModel extends BaseModel {
    @Id
    @Size(max = 36)
    @Column(name = "id", nullable = false, length = 36)
    private String id;

    @Size(max = 125)
    @NotNull
    @Column(name = "child_name", nullable = false, length = 125)
    private String childName;

    @Size(max = 125)
    @NotNull
    @Column(name = "phone_number", nullable = false, length = 125)
    private String phoneNumber;

    @Size(max = 10)
    @NotNull
    @ColumnDefault("'86'")
    @Column(name = "area_code", nullable = false, length = 10)
    private String areaCode;

    @Size(max = 512)
    @Column(name = "avatar", length = 512)
    private String avatar;

    @NotNull
    @ColumnDefault("0")
    @Column(name = "gender", nullable = false)
    private Integer gender;

    @NotNull
    @ColumnDefault("120")
    @Column(name = "height", nullable = false)
    private Integer height;

    @NotNull
    @ColumnDefault("100")
    @Column(name = "weight", nullable = false)
    private Integer weight;

    @Size(max = 32)
    @Column(name = "birthday", length = 32)
    private String birthday;

    @NotNull
    @ColumnDefault("1")
    @Column(name = "is_enable_block_unknown_call", nullable = false)
    private Boolean isEnableBlockUnknownCall = true;

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

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

}