Prima parte di migliorie per la sincronizzazione dei dati
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using salesbook.Shared.Core.Entity;
|
||||
using salesbook.Shared.Core.Helpers.Enum;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
namespace salesbook.Shared.Core.Dto.Activity;
|
||||
|
||||
public class ActivityDTO : StbActivity
|
||||
{
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto.Activity;
|
||||
|
||||
public class CRMRetrieveActivityRequestDTO
|
||||
{
|
||||
[JsonPropertyName("dateFilter")]
|
||||
public string? DateFilter { get; set; }
|
||||
|
||||
[JsonPropertyName("activityId")]
|
||||
public string? ActivityId { get; set; }
|
||||
|
||||
[JsonPropertyName("codJcom")]
|
||||
public string? CodJcom { get; set; }
|
||||
|
||||
[JsonPropertyName("startDate")]
|
||||
public DateTime? StarDate { get; set; }
|
||||
|
||||
[JsonPropertyName("endDate")]
|
||||
public DateTime? EndDate { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
using salesbook.Shared.Core.Helpers;
|
||||
using salesbook.Shared.Core.Helpers.Enum;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
namespace salesbook.Shared.Core.Dto.Activity;
|
||||
|
||||
public class FilterActivityDTO
|
||||
{
|
||||
11
salesbook.Shared/Core/Dto/Activity/WhereCondActivity.cs
Normal file
11
salesbook.Shared/Core/Dto/Activity/WhereCondActivity.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto.Activity;
|
||||
|
||||
public class WhereCondActivity
|
||||
{
|
||||
public DateTime? Start { get; set; }
|
||||
public DateTime? End { get; set; }
|
||||
|
||||
public string? ActivityId { get; set; }
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Java.Time;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class CRMRetrieveActivityRequestDTO
|
||||
{
|
||||
[JsonPropertyName("dateFilter")]
|
||||
public string? DateFilter { get; set; }
|
||||
|
||||
[JsonPropertyName("codJcom")]
|
||||
public string? CodJcom { get; set; }
|
||||
}
|
||||
19
salesbook.Shared/Core/Dto/Contact/CRMAnagRequestDTO.cs
Normal file
19
salesbook.Shared/Core/Dto/Contact/CRMAnagRequestDTO.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto.Contact;
|
||||
|
||||
public class CRMAnagRequestDTO
|
||||
{
|
||||
[JsonPropertyName("filterDate")]
|
||||
public DateTime? FilterDate { get; set; }
|
||||
|
||||
[JsonPropertyName("flagStato")]
|
||||
public string? FlagStato { get; set; }
|
||||
[JsonPropertyName("partitaIva")]
|
||||
public string? PartIva { get; set; }
|
||||
[JsonPropertyName("codAnag")]
|
||||
public string? CodAnag { get; set; }
|
||||
|
||||
[JsonPropertyName("returnPersRif")]
|
||||
public bool ReturnPersRif { get; set; }
|
||||
}
|
||||
17
salesbook.Shared/Core/Dto/Contact/CRMProspectRequestDTO.cs
Normal file
17
salesbook.Shared/Core/Dto/Contact/CRMProspectRequestDTO.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto.Contact;
|
||||
|
||||
public class CRMProspectRequestDTO
|
||||
{
|
||||
[JsonPropertyName("filterDate")]
|
||||
public DateTime? FilterDate { get; set; }
|
||||
|
||||
[JsonPropertyName("partitaIva")]
|
||||
public string? PartIva { get; set; }
|
||||
[JsonPropertyName("codPpro")]
|
||||
public string? CodPpro { get; set; }
|
||||
|
||||
[JsonPropertyName("returnPersRif")]
|
||||
public bool ReturnPersRif { get; set; }
|
||||
}
|
||||
10
salesbook.Shared/Core/Dto/Contact/WhereCondContact.cs
Normal file
10
salesbook.Shared/Core/Dto/Contact/WhereCondContact.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace salesbook.Shared.Core.Dto.Contact;
|
||||
|
||||
public class WhereCondContact
|
||||
{
|
||||
public string? FlagStato { get; set; }
|
||||
public string? PartIva { get; set; }
|
||||
public string? CodAnag { get; set; }
|
||||
|
||||
public bool OnlyContact { get; set; }
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using salesbook.Shared.Core.Entity;
|
||||
|
||||
namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class TaskSyncResponseDTO
|
||||
public class UsersSyncResponseDTO
|
||||
{
|
||||
[JsonPropertyName("anagClie")]
|
||||
public List<AnagClie>? AnagClie { get; set; }
|
||||
@@ -1,5 +1,6 @@
|
||||
using AutoMapper;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto.Activity;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using MudBlazor;
|
||||
using salesbook.Shared.Components.SingleElements.Modal;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto.Activity;
|
||||
|
||||
namespace salesbook.Shared.Core.Helpers;
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto.Activity;
|
||||
using salesbook.Shared.Core.Dto.Contact;
|
||||
using salesbook.Shared.Core.Dto.JobProgress;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
|
||||
@@ -8,8 +10,8 @@ public interface IIntegryApiService
|
||||
{
|
||||
Task<List<StbActivity>?> RetrieveActivity(CRMRetrieveActivityRequestDTO activityRequest);
|
||||
Task<List<JtbComt>?> RetrieveAllCommesse(string? dateFilter = null);
|
||||
Task<TaskSyncResponseDTO> RetrieveAnagClie(string? dateFilter = null);
|
||||
Task<TaskSyncResponseDTO> RetrieveProspect(string? dateFilter = null);
|
||||
Task<UsersSyncResponseDTO> RetrieveAnagClie(CRMAnagRequestDTO request);
|
||||
Task<UsersSyncResponseDTO> RetrieveProspect(CRMProspectRequestDTO request);
|
||||
Task<SettingsResponseDTO> RetrieveSettings();
|
||||
Task<List<CRMAttachedResponseDTO>?> RetrieveAttached(string codJcom);
|
||||
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
using System.Linq.Expressions;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto.Activity;
|
||||
using salesbook.Shared.Core.Dto.Contact;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace salesbook.Shared.Core.Interface;
|
||||
|
||||
public interface IManageDataService
|
||||
{
|
||||
Task<List<T>> GetTable<T>(Expression<Func<T, bool>>? whereCond = null) where T : new();
|
||||
|
||||
Task<List<ActivityDTO>> GetActivity(Expression<Func<StbActivity, bool>>? whereCond = null);
|
||||
Task<List<ContactDTO>> GetContact();
|
||||
|
||||
Task<List<AnagClie>> GetClienti(WhereCondContact? whereCond = null);
|
||||
Task<List<PtbPros>> GetProspect(WhereCondContact? whereCond = null);
|
||||
Task<List<ContactDTO>> GetContact(WhereCondContact whereCond);
|
||||
Task<ContactDTO?> GetSpecificContact(string codAnag, bool IsContact);
|
||||
|
||||
Task<List<ActivityDTO>> GetActivity(WhereCondActivity whereCond, bool useLocalDb = false);
|
||||
|
||||
Task InsertOrUpdate<T>(T objectToSave);
|
||||
Task InsertOrUpdate<T>(List<T> listToSave);
|
||||
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
public interface ISyncDbService
|
||||
{
|
||||
Task GetAndSaveActivity(string? dateFilter = null);
|
||||
Task GetAndSaveCommesse(string? dateFilter = null);
|
||||
Task GetAndSaveProspect(string? dateFilter = null);
|
||||
Task GetAndSaveClienti(string? dateFilter = null);
|
||||
Task GetAndSaveSettings(string? dateFilter = null);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.Messaging.Messages;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto.Activity;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Activity.Copy;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto.Activity;
|
||||
|
||||
namespace salesbook.Shared.Core.Messages.Activity.Copy;
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using IntegryApiClient.Core.Domain.Abstraction.Contracts.Account;
|
||||
using IntegryApiClient.Core.Domain.RestClient.Contacts;
|
||||
using salesbook.Shared.Core.Dto;
|
||||
using salesbook.Shared.Core.Dto.Activity;
|
||||
using salesbook.Shared.Core.Dto.JobProgress;
|
||||
using salesbook.Shared.Core.Entity;
|
||||
using salesbook.Shared.Core.Interface;
|
||||
using System.Net.Http.Headers;
|
||||
using salesbook.Shared.Core.Dto.Contact;
|
||||
|
||||
namespace salesbook.Shared.Core.Services;
|
||||
|
||||
@@ -26,29 +28,11 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
||||
return integryApiRestClient.AuthorizedGet<List<JtbComt>?>("crm/retrieveCommesse", queryParams);
|
||||
}
|
||||
|
||||
public Task<TaskSyncResponseDTO> RetrieveAnagClie(string? dateFilter)
|
||||
{
|
||||
var queryParams = new Dictionary<string, object>();
|
||||
public Task<UsersSyncResponseDTO> RetrieveAnagClie(CRMAnagRequestDTO request) =>
|
||||
integryApiRestClient.AuthorizedPost<UsersSyncResponseDTO>("crm/retrieveClienti", request)!;
|
||||
|
||||
if (dateFilter != null)
|
||||
{
|
||||
queryParams.Add("dateFilter", dateFilter);
|
||||
}
|
||||
|
||||
return integryApiRestClient.AuthorizedGet<TaskSyncResponseDTO>("crm/retrieveClienti", queryParams)!;
|
||||
}
|
||||
|
||||
public Task<TaskSyncResponseDTO> RetrieveProspect(string? dateFilter)
|
||||
{
|
||||
var queryParams = new Dictionary<string, object>();
|
||||
|
||||
if (dateFilter != null)
|
||||
{
|
||||
queryParams.Add("dateFilter", dateFilter);
|
||||
}
|
||||
|
||||
return integryApiRestClient.AuthorizedGet<TaskSyncResponseDTO>("crm/retrieveProspect", queryParams)!;
|
||||
}
|
||||
public Task<UsersSyncResponseDTO> RetrieveProspect(CRMProspectRequestDTO request) =>
|
||||
integryApiRestClient.AuthorizedPost<UsersSyncResponseDTO>("crm/retrieveProspect", request)!;
|
||||
|
||||
public Task<SettingsResponseDTO> RetrieveSettings() =>
|
||||
integryApiRestClient.AuthorizedGet<SettingsResponseDTO>("crm/retrieveSettings")!;
|
||||
|
||||
Reference in New Issue
Block a user