Feat: Cambios Varios
This commit is contained in:
14
src/SIGCM.Domain/Entities/AuditLog.cs
Normal file
14
src/SIGCM.Domain/Entities/AuditLog.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace SIGCM.Domain.Entities;
|
||||
|
||||
public class AuditLog
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public required string Action { get; set; }
|
||||
public int? EntityId { get; set; }
|
||||
public string? EntityType { get; set; }
|
||||
public string? Details { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
// Propiedad auxiliar para el Join
|
||||
public string? Username { get; set; }
|
||||
}
|
||||
11
src/SIGCM.Domain/Entities/Client.cs
Normal file
11
src/SIGCM.Domain/Entities/Client.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SIGCM.Domain.Entities;
|
||||
|
||||
public class Client
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public required string DniOrCuit { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Phone { get; set; }
|
||||
public string? Address { get; set; }
|
||||
}
|
||||
@@ -8,19 +8,23 @@ public class Listing
|
||||
public required string Title { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public decimal AdFee { get; set; }
|
||||
public string Currency { get; set; } = "ARS";
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public string Status { get; set; } = "Draft";
|
||||
public int? UserId { get; set; }
|
||||
public int? ClientId { get; set; }
|
||||
|
||||
// Propiedades para impresión
|
||||
public string? PrintText { get; set; }
|
||||
public DateTime? PrintStartDate { get; set; }
|
||||
public int PrintDaysCount { get; set; }
|
||||
public bool IsBold { get; set; }
|
||||
public bool IsFrame { get; set; }
|
||||
public string PrintFontSize { get; set; } = "normal";
|
||||
public string PrintAlignment { get; set; } = "left";
|
||||
|
||||
// Propiedades auxiliares (no están en la tabla Listings, vienen de Joins/Subqueries)
|
||||
// Propiedades auxiliares
|
||||
public string? CategoryName { get; set; }
|
||||
public string? MainImageUrl { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
namespace SIGCM.Domain.Interfaces;
|
||||
using SIGCM.Domain.Entities;
|
||||
|
||||
namespace SIGCM.Domain.Interfaces;
|
||||
|
||||
public interface ICategoryRepository
|
||||
{
|
||||
Task<IEnumerable<Category>> GetAllAsync();
|
||||
@@ -12,4 +13,6 @@ public interface ICategoryRepository
|
||||
Task<IEnumerable<Operation>> GetOperationsAsync(int categoryId);
|
||||
Task AddOperationAsync(int categoryId, int operationId);
|
||||
Task RemoveOperationAsync(int categoryId, int operationId);
|
||||
}
|
||||
Task MergeCategoriesAsync(int sourceId, int targetId);
|
||||
Task<bool> HasChildrenAsync(int categoryId);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using SIGCM.Domain.Models;
|
||||
using SIGCM.Domain.Entities;
|
||||
using SIGCM.Application.DTOs;
|
||||
|
||||
namespace SIGCM.Domain.Interfaces;
|
||||
|
||||
@@ -9,6 +10,24 @@ public interface IListingRepository
|
||||
Task<Listing?> GetByIdAsync(int id);
|
||||
Task<ListingDetail?> GetDetailByIdAsync(int id);
|
||||
Task<IEnumerable<Listing>> GetAllAsync();
|
||||
Task<int> CountByCategoryIdAsync(int categoryId);
|
||||
Task MoveListingsAsync(int sourceCategoryId, int targetCategoryId);
|
||||
|
||||
// Búsqueda Simple y Facetada
|
||||
Task<IEnumerable<Listing>> SearchAsync(string? query, int? categoryId);
|
||||
Task<IEnumerable<Listing>> SearchFacetedAsync(string? query, int? categoryId, Dictionary<string, string>? attributes);
|
||||
|
||||
// Impresión
|
||||
Task<IEnumerable<Listing>> GetListingsForPrintAsync(DateTime date);
|
||||
|
||||
// Moderación
|
||||
Task<IEnumerable<Listing>> GetPendingModerationAsync();
|
||||
Task UpdateStatusAsync(int id, string status);
|
||||
Task<int> GetPendingCountAsync();
|
||||
|
||||
// Estadísticas
|
||||
Task<IEnumerable<CategorySalesReportDto>> GetSalesByRootCategoryAsync(DateTime startDate, DateTime endDate);
|
||||
Task<DashboardStats> GetDashboardStatsAsync(DateTime startDate, DateTime endDate);
|
||||
Task<CashierDashboardDto?> GetCashierStatsAsync(int userId, DateTime startDate, DateTime endDate);
|
||||
Task<GlobalReportDto> GetDetailedReportAsync(DateTime start, DateTime end, int? userId = null);
|
||||
}
|
||||
8
src/SIGCM.Domain/Models/CashierDashboardDto.cs
Normal file
8
src/SIGCM.Domain/Models/CashierDashboardDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace SIGCM.Domain.Models;
|
||||
|
||||
public class CashierDashboardDto
|
||||
{
|
||||
public decimal MyRevenue { get; set; }
|
||||
public int MyAdsCount { get; set; }
|
||||
public int MyPendingAds { get; set; }
|
||||
}
|
||||
10
src/SIGCM.Domain/Models/CategorySalesReport.cs
Normal file
10
src/SIGCM.Domain/Models/CategorySalesReport.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace SIGCM.Application.DTOs;
|
||||
|
||||
public class CategorySalesReportDto
|
||||
{
|
||||
public int CategoryId { get; set; }
|
||||
public required string CategoryName { get; set; }
|
||||
public decimal TotalSales { get; set; }
|
||||
public int AdCount { get; set; }
|
||||
public decimal Percentage { get; set; }
|
||||
}
|
||||
23
src/SIGCM.Domain/Models/DashboardStats.cs
Normal file
23
src/SIGCM.Domain/Models/DashboardStats.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SIGCM.Domain.Models;
|
||||
|
||||
public class DashboardStats
|
||||
{
|
||||
public decimal RevenueToday { get; set; }
|
||||
public int AdsToday { get; set; }
|
||||
public decimal TicketAverage { get; set; }
|
||||
public double PaperOccupation { get; set; }
|
||||
public List<DailyRevenue> WeeklyTrend { get; set; } = new();
|
||||
public List<ChannelStat> ChannelMix { get; set; } = new();
|
||||
}
|
||||
|
||||
public class DailyRevenue
|
||||
{
|
||||
public string Day { get; set; } = "";
|
||||
public decimal Amount { get; set; }
|
||||
}
|
||||
|
||||
public class ChannelStat
|
||||
{
|
||||
public string Name { get; set; } = "";
|
||||
public int Value { get; set; }
|
||||
}
|
||||
21
src/SIGCM.Domain/Models/GlobalReportDto.cs
Normal file
21
src/SIGCM.Domain/Models/GlobalReportDto.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace SIGCM.Domain.Models;
|
||||
|
||||
public class GlobalReportDto
|
||||
{
|
||||
public DateTime GeneratedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime FromDate { get; set; }
|
||||
public DateTime ToDate { get; set; }
|
||||
public decimal TotalRevenue { get; set; }
|
||||
public int TotalAds { get; set; }
|
||||
public List<ReportItemDto> Items { get; set; } = new();
|
||||
}
|
||||
|
||||
public class ReportItemDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public string Title { get; set; } = "";
|
||||
public string Category { get; set; } = "";
|
||||
public string Cashier { get; set; } = "";
|
||||
public decimal Amount { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user