This commit is contained in:
2025-08-06 12:31:52 +02:00
parent c003c29d83
commit c93b0c9bec
18 changed files with 249 additions and 18 deletions

View File

@@ -6,11 +6,36 @@ namespace salesbook.Shared.Core.Entity;
[Table("vtb_dest")]
public class VtbDest
{
[PrimaryKey, Column("composite_key")]
public string CompositeKey { get; set; }
private string? _codAnag;
[Column("cod_anag"), JsonPropertyName("codAnag"), Indexed(Name = "VtbDestPK", Order = 1, Unique = true)]
public string CodAnag { get; set; }
public string? CodAnag
{
get => _codAnag;
set
{
_codAnag = value;
if (_codAnag != null && _codVdes != null)
UpdateCompositeKey();
}
}
private string? _codVdes;
[Column("cod_vdes"), JsonPropertyName("codVdes"), Indexed(Name = "VtbDestPK", Order = 2, Unique = true)]
public string CodVdes { get; set; }
public string? CodVdes
{
get => _codVdes;
set
{
_codVdes = value;
if (_codAnag != null && _codVdes != null)
UpdateCompositeKey();
}
}
[Column("destinatario"), JsonPropertyName("destinatario")]
public string Destinatario { get; set; }
@@ -194,4 +219,7 @@ public class VtbDest
[Column("cod_fisc_legale"), JsonPropertyName("codFiscLegale")]
public string CodFiscLegale { get; set; }
private void UpdateCompositeKey() =>
CompositeKey = $"{CodAnag}::{CodVdes}";
}