6d8b6b3e59
Implemented DeliveryTask, Payment, and Sale entities with full CRUD, business logic, and API endpoints. Updated Order/OrderItem for sale linkage and fulfillment tracking. Registered new DbSets and DI services. Revised documentation for delivery, sale, and payment workflows.
18 lines
557 B
C#
18 lines
557 B
C#
using Distribution.Data;
|
|
using Distribution.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Distribution.Features.Payment;
|
|
|
|
public class PaymentRepository(AppDBContext context) : IPaymentRepository
|
|
{
|
|
public async Task<List<Models.Payment>> GetBySaleIdAsync(Guid saleId) =>
|
|
await context.Payments
|
|
.Where(p => p.FK_SaleId == saleId && p.IsActive)
|
|
.OrderBy(p => p.CollectedAt)
|
|
.ToListAsync();
|
|
|
|
public async Task AddAsync(Models.Payment payment) =>
|
|
await context.Payments.AddAsync(payment);
|
|
}
|