Controllo p.Iva
This commit is contained in:
12
salesbook.Shared/Core/Dto/CheckVatRequestDTO.cs
Normal file
12
salesbook.Shared/Core/Dto/CheckVatRequestDTO.cs
Normal 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; }
|
||||
}
|
||||
39
salesbook.Shared/Core/Dto/CheckVatResponseDTO.cs
Normal file
39
salesbook.Shared/Core/Dto/CheckVatResponseDTO.cs
Normal 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; }
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
@@ -16,4 +16,7 @@ public class SettingsResponseDTO
|
||||
|
||||
[JsonPropertyName("vtbTipi")]
|
||||
public List<VtbTipi>? VtbTipi { get; set; }
|
||||
|
||||
[JsonPropertyName("nazioni")]
|
||||
public List<Nazioni>? Nazioni { get; set; }
|
||||
}
|
||||
23
salesbook.Shared/Core/Entity/Nazioni.cs
Normal file
23
salesbook.Shared/Core/Entity/Nazioni.cs
Normal 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; }
|
||||
}
|
||||
@@ -15,4 +15,5 @@ public interface IIntegryApiService
|
||||
|
||||
Task<List<StbActivity>?> SaveActivity(ActivityDTO activity);
|
||||
Task SaveContact(CRMCreateContactRequestDTO request);
|
||||
Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request);
|
||||
}
|
||||
@@ -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)!;
|
||||
}
|
||||
Reference in New Issue
Block a user