Controllo p.Iva

This commit is contained in:
2025-07-22 09:10:30 +02:00
parent 7bcb0581cc
commit b34f6cb213
12 changed files with 424 additions and 213 deletions

View File

@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;
namespace salesbook.Shared.Core.Dto;
public class CheckVatRequestDTO
{
[JsonPropertyName("countryCode")]
public string CountryCode { get; set; }
[JsonPropertyName("vatNumber")]
public string VatNumber { get; set; }
}

View File

@@ -0,0 +1,39 @@
using System.Text.Json.Serialization;
namespace salesbook.Shared.Core.Dto;
public class CheckVatResponseDTO
{
[JsonPropertyName("countryCode")]
public string? CountryCode { get; set; }
[JsonPropertyName("vatNumber ")]
public string? VatNumber { get; set; }
[JsonPropertyName("requestDate")]
public string? RequestDate { get; set; }
[JsonPropertyName("valid")]
public bool Valid { get; set; }
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("address")]
public string? CompleteAddress { get; set; }
[JsonPropertyName("ragSoc")]
public string? RagSoc { get; set; }
[JsonPropertyName("indirizzo")]
public string? Indirizzo { get; set; }
[JsonPropertyName("cap")]
public string? Cap { get; set; }
[JsonPropertyName("citta")]
public string? Citta { get; set; }
[JsonPropertyName("prov")]
public string? Prov { get; set; }
}

View File

@@ -17,22 +17,22 @@ public class ContactDTO
public string? CodVage { get; set; }
[JsonPropertyName("ragSoc")]
public string RagSoc { get; set; }
public string? RagSoc { get; set; }
[JsonPropertyName("indirizzo")]
public string Indirizzo { get; set; }
public string? Indirizzo { get; set; }
[JsonPropertyName("cap")]
public string Cap { get; set; }
public string? Cap { get; set; }
[JsonPropertyName("citta")]
public string Citta { get; set; }
public string? Citta { get; set; }
[JsonPropertyName("prov")]
public string Prov { get; set; }
public string? Prov { get; set; }
[JsonPropertyName("nazione")]
public string Nazione { get; set; }
public string? Nazione { get; set; }
[JsonPropertyName("telefono")]
public string? Telefono { get; set; }

View File

@@ -16,4 +16,7 @@ public class SettingsResponseDTO
[JsonPropertyName("vtbTipi")]
public List<VtbTipi>? VtbTipi { get; set; }
[JsonPropertyName("nazioni")]
public List<Nazioni>? Nazioni { get; set; }
}

View File

@@ -0,0 +1,23 @@
using System.Text.Json.Serialization;
using SQLite;
namespace salesbook.Shared.Core.Entity;
[Table("nazioni")]
public class Nazioni
{
[PrimaryKey, Column("nazione"), JsonPropertyName("nazione")]
public string Nazione { get; set; }
[Column("cod_nazione_iso"), JsonPropertyName("codNazioneIso")]
public string CodNazioneIso { get; set; }
[Column("cod_nazi_alpha_2"), JsonPropertyName("codNazioneAlpha2")]
public string CodNazioneAlpha2 { get; set; }
[Column("descrizione"), JsonPropertyName("descrizione")]
public string Descrizione { get; set; }
[Column("chk_part_iva"), JsonPropertyName("chkPartIva")]
public bool ChkPartIva { get; set; }
}

View File

@@ -15,4 +15,5 @@ public interface IIntegryApiService
Task<List<StbActivity>?> SaveActivity(ActivityDTO activity);
Task SaveContact(CRMCreateContactRequestDTO request);
Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request);
}

View File

@@ -71,4 +71,7 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
public Task SaveContact(CRMCreateContactRequestDTO request) =>
integryApiRestClient.AuthorizedPost<object>("crm/createContact", request);
public Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request) =>
integryApiRestClient.Post<CheckVatResponseDTO>("checkPartitaIva", request)!;
}