using System.Text.Json.Serialization;
using SQLite;

namespace salesbook.Shared.Core.Entity;

[Table("jtb_comt")]
public class JtbComt
{
    [PrimaryKey, Column("cod_jcom"), JsonPropertyName("codJcom")]
    public string CodJcom { get; set; }

    [Column("cod_jfas"), JsonPropertyName("codJfas")]
    public string CodJfas { get; set; }

    [Column("cod_jflav"), JsonPropertyName("codJflav")]
    public string CodJflav { get; set; }

    [Column("descrizione"), JsonPropertyName("descrizione")]
    public string Descrizione { get; set; }

    [Column("importo"), JsonPropertyName("importo")]
    public decimal Importo { get; set; } = 0;

    [Column("data_inizi_lav"), JsonPropertyName("dataIniziLav")]
    public DateTime? DataIniziLav { get; set; }

    [Column("cod_mart"), JsonPropertyName("codMart")]
    public string CodMart { get; set; }

    [Column("data_cons"), JsonPropertyName("dataCons")]
    public DateTime? DataCons { get; set; }

    [Column("manuali"), JsonPropertyName("manuali")]
    public string Manuali { get; set; }

    [Column("note"), JsonPropertyName("note")]
    public string Note { get; set; }

    [Column("cod_anag"), JsonPropertyName("codAnag")]
    public string? CodAnag { get; set; }

    [Column("cod_divi"), JsonPropertyName("codDivi")]
    public string CodDivi { get; set; } = "EURO";

    [Column("cambio_divi"), JsonPropertyName("cambioDivi")]
    public decimal CambioDivi { get; set; } = 1;

    [Column("cod_divi_cont"), JsonPropertyName("codDiviCont")]
    public string CodDiviCont { get; set; }

    [Column("cambio_divi_cont"), JsonPropertyName("cambioDiviCont")]
    public decimal CambioDiviCont { get; set; }

    [Column("responsabile_com"), JsonPropertyName("responsabileCom")]
    public string ResponsabileCom { get; set; }

    [Column("stato_commessa"), JsonPropertyName("statoCommessa")]
    public string StatoCommessa { get; set; }

    [Column("tipo_commessa"), JsonPropertyName("tipoCommessa")]
    public string TipoCommessa { get; set; }

    [Column("descrizione_estesa"), JsonPropertyName("descrizioneEstesa")]
    public string DescrizioneEstesa { get; set; }

    [Column("perc_comp"), JsonPropertyName("percComp")]
    public decimal PercComp { get; set; } = 0;

    [Column("cod_vdes"), JsonPropertyName("codVdes")]
    public string CodVdes { get; set; }

    [Column("gestione"), JsonPropertyName("gestione")]
    public string Gestione { get; set; }

    [Column("data_ord"), JsonPropertyName("dataOrd")]
    public DateTime? DataOrd { get; set; }

    [Column("num_ord"), JsonPropertyName("numOrd")]
    public int? NumOrd { get; set; }

    [Column("matricola"), JsonPropertyName("matricola")]
    public string Matricola { get; set; }

    [Column("tipo_anag"), JsonPropertyName("tipoAnag")]
    public string TipoAnag { get; set; }

    [Column("flag_pubblica"), JsonPropertyName("flagPubblica")]
    public string FlagPubblica { get; set; } = "N";

    [Column("cig"), JsonPropertyName("cig")]
    public string Cig { get; set; }

    [Column("cup"), JsonPropertyName("cup")]
    public string Cup { get; set; }

    [Column("indirizzo_ente"), JsonPropertyName("indirizzoEnte")]
    public string IndirizzoEnte { get; set; }

    [Column("note_cons"), JsonPropertyName("noteCons")]
    public string NoteCons { get; set; }

    [Column("cod_vage"), JsonPropertyName("codVage")]
    public string CodVage { get; set; }

    [Column("cod_jflav_tec"), JsonPropertyName("codJflavTec")]
    public string CodJflavTec { get; set; }

    [Column("note_tecniche"), JsonPropertyName("noteTecniche")]
    public string NoteTecniche { get; set; }

    [Ignore, JsonIgnore]
    public DateTime? LastUpd { get; set; }
}