Filtrati tipi attività per utente

This commit is contained in:
2025-09-08 12:19:17 +02:00
parent 82d268d9f8
commit 93b1a94c88
7 changed files with 86 additions and 4 deletions

View File

@@ -0,0 +1,56 @@
using SQLite;
using System.Text.Json.Serialization;
namespace salesbook.Shared.Core.Entity;
[Table("srl_activity_type_user")]
public class SrlActivityTypeUser
{
[PrimaryKey, Column("composite_key")]
public string CompositeKey { get; set; }
private string? _activityTypeId;
[Column("activity_type_id"), JsonPropertyName("activityTypeId"), Indexed(Name = "ActivityTypePK", Order = 1, Unique = true)]
public string? ActivityTypeId
{
get => _activityTypeId;
set
{
_activityTypeId = value;
if (_activityTypeId != null && _flagTipologia != null && _userName != null)
UpdateCompositeKey();
}
}
private string? _flagTipologia;
[Column("flag_tipologia"), JsonPropertyName("flagTipologia"), Indexed(Name = "ActivityTypePK", Order = 2, Unique = true)]
public string? FlagTipologia
{
get => _flagTipologia;
set
{
_flagTipologia = value;
if (_activityTypeId != null && _flagTipologia != null && _userName != null)
UpdateCompositeKey();
}
}
private string? _userName;
[Column("user_name"), JsonPropertyName("userName"), Indexed(Name = "ActivityTypePK", Order = 3, Unique = true)]
public string? UserName
{
get => _userName;
set
{
_userName = value;
if (_activityTypeId != null && _flagTipologia != null && _userName != null)
UpdateCompositeKey();
}
}
private void UpdateCompositeKey() =>
CompositeKey = $"{ActivityTypeId}::{FlagTipologia}::{UserName}";
}