package com.honey.honey.model;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Table(name = "db_users_a")
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserA {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @Column(name = "screen_name", nullable = false, length = 75)
    @Builder.Default
    private String screenName = "-";

    @Column(name = "telegram_id", unique = true)
    private Long telegramId;

    @Column(name = "telegram_name", nullable = false, length = 33)
    @Builder.Default
    private String telegramName = "-";

    @Column(name = "is_premium", nullable = false)
    @Builder.Default
    private Integer isPremium = 0;

    @Column(name = "language_code", nullable = false, length = 2)
    @Builder.Default
    private String languageCode = "XX";

    @Column(name = "country_code", nullable = false, length = 2)
    @Builder.Default
    private String countryCode = "XX";

    @Column(name = "device_code", nullable = false, length = 5)
    @Builder.Default
    private String deviceCode = "XX";

    @Column(name = "ip", columnDefinition = "VARBINARY(16)")
    private byte[] ip;

    @Column(name = "date_reg", nullable = false)
    @Builder.Default
    private Integer dateReg = 0;

    @Column(name = "date_login", nullable = false)
    @Builder.Default
    private Integer dateLogin = 0;

    @Column(name = "banned", nullable = false)
    @Builder.Default
    private Integer banned = 0;

    @Column(name = "avatar_url", length = 500)
    private String avatarUrl;

    @Column(name = "last_telegram_file_id", length = 255)
    private String lastTelegramFileId;

    /** When false, user blocked the bot or send failed with 403; used for notification broadcast skip. */
    @Column(name = "bot_active", nullable = false)
    @Builder.Default
    private boolean botActive = true;
}


