Gestito aggiornamento elenco contatti in caso di aggiunta o modifica del prospect / cliente
This commit is contained in:
13
salesbook.Shared/Core/Dto/CRMCreateContactResponseDTO.cs
Normal file
13
salesbook.Shared/Core/Dto/CRMCreateContactResponseDTO.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class CRMCreateContactResponseDTO
|
||||
{
|
||||
[JsonPropertyName("anagClie")]
|
||||
public AnagClie? AnagClie { get; set; }
|
||||
|
||||
[JsonPropertyName("ptbPros")]
|
||||
public PtbPros? PtbPros { get; set; }
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace salesbook.Shared.Core.Entity;
|
||||
public class AnagClie
|
||||
{
|
||||
[PrimaryKey, Column("cod_anag"), JsonPropertyName("codAnag")]
|
||||
public string CodAnag { get; set; }
|
||||
public string? CodAnag { get; set; }
|
||||
|
||||
[Column("cod_vtip"), JsonPropertyName("codVtip")]
|
||||
public string? CodVtip { get; set; }
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace salesbook.Shared.Core.Entity;
|
||||
public class PtbPros
|
||||
{
|
||||
[PrimaryKey, Column("cod_ppro"), JsonPropertyName("codPpro")]
|
||||
public string CodPpro { get; set; }
|
||||
public string? CodPpro { get; set; }
|
||||
|
||||
[Column("agenzia_banca"), JsonPropertyName("agenziaBanca")]
|
||||
public string AgenziaBanca { get; set; }
|
||||
|
||||
@@ -14,7 +14,7 @@ public interface IIntegryApiService
|
||||
Task DeleteActivity(string activityId);
|
||||
|
||||
Task<List<StbActivity>?> SaveActivity(ActivityDTO activity);
|
||||
Task SaveContact(CRMCreateContactRequestDTO request);
|
||||
Task<CRMCreateContactResponseDTO?> SaveContact(CRMCreateContactRequestDTO request);
|
||||
Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request);
|
||||
|
||||
//Google
|
||||
|
||||
@@ -10,6 +10,7 @@ public interface IManageDataService
|
||||
|
||||
Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null);
|
||||
Task<List<ContactDTO>> GetContact();
|
||||
Task<ContactDTO?> GetSpecificContact(string codAnag, bool IsContact);
|
||||
|
||||
Task InsertOrUpdate<T>(T objectToSave);
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Contact;
|
||||
|
||||
public class NewContactMessage(CRMCreateContactResponseDTO value) : ValueChangedMessage<CRMCreateContactResponseDTO>(value);
|
||||
17
salesbook.Shared/Core/Messages/Contact/NewContactService.cs
Normal file
17
salesbook.Shared/Core/Messages/Contact/NewContactService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Contact;
|
||||
|
||||
public class NewContactService
|
||||
{
|
||||
public event Action<CRMCreateContactResponseDTO>? OnContactCreated;
|
||||
|
||||
public NewContactService(IMessenger messenger)
|
||||
{
|
||||
messenger.Register<NewContactMessage>(this, (_, o) =>
|
||||
{
|
||||
OnContactCreated?.Invoke(o.Value);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -69,8 +69,8 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
||||
public Task<List<StbActivity>?> SaveActivity(ActivityDTO activity) =>
|
||||
integryApiRestClient.AuthorizedPost<List<StbActivity>?>("crm/saveActivity", activity);
|
||||
|
||||
public Task SaveContact(CRMCreateContactRequestDTO request) =>
|
||||
integryApiRestClient.AuthorizedPost<object>("crm/createContact", request);
|
||||
public Task<CRMCreateContactResponseDTO?> SaveContact(CRMCreateContactRequestDTO request) =>
|
||||
integryApiRestClient.AuthorizedPost<CRMCreateContactResponseDTO>("crm/createContact", request);
|
||||
|
||||
public Task<CheckVatResponseDTO> CheckVat(CheckVatRequestDTO request) =>
|
||||
integryApiRestClient.Post<CheckVatResponseDTO>("checkPartitaIva", request)!;
|
||||
|
||||
Reference in New Issue
Block a user