Gestita pagina notifiche

This commit is contained in:
2025-09-11 16:06:19 +02:00
parent 7319378e75
commit 7bfe67a97c
30 changed files with 611 additions and 105 deletions

View File

@@ -1,14 +1,15 @@
using AutoMapper;
using MudBlazor.Extensions;
using salesbook.Shared.Core.Dto;
using salesbook.Shared.Core.Dto.Activity;
using salesbook.Shared.Core.Dto.Contact;
using salesbook.Shared.Core.Entity;
using salesbook.Shared.Core.Helpers.Enum;
using salesbook.Shared.Core.Interface;
using Sentry.Protocol;
using System.Linq.Expressions;
using salesbook.Shared.Core.Interface.IntegryApi;
using salesbook.Shared.Core.Interface.System.Network;
using Sentry.Protocol;
using System.Linq.Expressions;
namespace salesbook.Maui.Core.Services;
@@ -211,6 +212,15 @@ public class ManageDataService(
{
var dto = mapper.Map<ActivityDTO>(activity);
if (activity is { AlarmTime: not null, EstimatedTime: not null })
{
var minuteBefore = activity.EstimatedTime.Value - activity.AlarmTime.Value;
dto.MinuteBefore = (int)Math.Abs(minuteBefore.TotalMinutes);
dto.NotificationDate = dto.MinuteBefore == 0 ?
activity.EstimatedTime : activity.AlarmTime;
}
if (activity.CodJcom != null)
{
dto.Category = ActivityCategoryEnum.Commessa;