Fase 3: Implementación de Listings (Avisos) - Entidades, Repositorio, API y Frontend Wizard integración
This commit is contained in:
17
src/SIGCM.Domain/Entities/Listing.cs
Normal file
17
src/SIGCM.Domain/Entities/Listing.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace SIGCM.Domain.Entities;
|
||||
|
||||
public class Listing
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int CategoryId { get; set; }
|
||||
public int OperationId { get; set; }
|
||||
public required string Title { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public string Currency { get; set; } = "ARS"; // ARS, USD
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public string Status { get; set; } = "Draft"; // Draft, Published, Sold, Paused
|
||||
public int? UserId { get; set; }
|
||||
|
||||
// Navigation properties logic will be handled manually via repositories in Dapper
|
||||
}
|
||||
9
src/SIGCM.Domain/Entities/ListingAttributeValue.cs
Normal file
9
src/SIGCM.Domain/Entities/ListingAttributeValue.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace SIGCM.Domain.Entities;
|
||||
|
||||
public class ListingAttributeValue
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ListingId { get; set; }
|
||||
public int AttributeDefinitionId { get; set; }
|
||||
public required string Value { get; set; }
|
||||
}
|
||||
10
src/SIGCM.Domain/Interfaces/IListingRepository.cs
Normal file
10
src/SIGCM.Domain/Interfaces/IListingRepository.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using SIGCM.Domain.Entities;
|
||||
|
||||
namespace SIGCM.Domain.Interfaces;
|
||||
|
||||
public interface IListingRepository
|
||||
{
|
||||
Task<int> CreateAsync(Listing listing, Dictionary<int, string> attributes);
|
||||
Task<Listing?> GetByIdAsync(int id);
|
||||
Task<IEnumerable<Listing>> GetAllAsync();
|
||||
}
|
||||
Reference in New Issue
Block a user