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_push_registration")
public class PushRegistrationModel extends BaseModel {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

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

    @Size(max = 255)
    @NotNull
    @Column(name = "reg_id", nullable = false)
    private String regId;

    @NotNull
    @Column(name = "registrant_platform_type", nullable = false)
    private Integer registrantPlatformType;

    @Size(max = 255)
    @NotNull
    @ColumnDefault("'zh'")
    @Column(name = "language", nullable = false)
    private String language;

    @Size(max = 255)
    @NotNull
    @Column(name = "device_model", nullable = false)
    private String deviceModel;

    @Size(max = 255)
    @NotNull
    @Column(name = "device_manufacturer", nullable = false)
    private String deviceManufacturer;

    @Size(max = 255)
    @NotNull
    @Column(name = "device_system_version", nullable = false)
    private String deviceSystemVersion;

    @Size(max = 255)
    @NotNull
    @Column(name = "device_system", nullable = false)
    private String deviceSystem;

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

}