2eb88b058e
- Implement Sale and SaleItem models for tracking sales transactions. - Create StockReturn model to manage stock adjustments for various reasons. - Introduce Supplier model to represent suppliers of products. - Develop InventoryRepository for CRUD operations on products, suppliers, sales, and stock returns. - Implement InventoryService to handle business logic for inventory management. - Update TenantDbContext to include new models and relationships. - Enhance ProfitLossRepository to account for sales, purchases, and stock returns in profit and loss calculations. - Modify Program.cs to register new inventory-related services.
45 lines
1.9 KiB
C#
45 lines
1.9 KiB
C#
using Fitness_core_BE.Models;
|
|
|
|
namespace Fitness_core_BE.Interfaces
|
|
{
|
|
public interface IInventoryRepository
|
|
{
|
|
// Products
|
|
Task<List<Product>> GetProducts(Guid clientId, bool includeInactive = false);
|
|
Task<Product?> GetProductById(Guid productId);
|
|
Task<Product> CreateProduct(Product product);
|
|
Task<Product> UpdateProduct(Product product);
|
|
/// <summary>Next sequential number for this client, e.g. 3 -> "PRD-0004" -- Sku is
|
|
/// system-generated, never user-entered.</summary>
|
|
Task<int> GetNextProductSequence(Guid clientId);
|
|
|
|
// Product detail page: stock-movement history (GRN-in, Sale-out, Return-out).
|
|
Task<List<GoodsReceivedNoteItem>> GetGrnItemsForProduct(Guid productId);
|
|
Task<List<SaleItem>> GetSaleItemsForProduct(Guid productId);
|
|
Task<List<StockReturn>> GetStockReturnsForProduct(Guid productId);
|
|
|
|
// Suppliers
|
|
Task<List<Supplier>> GetSuppliers(Guid clientId, bool includeInactive = false);
|
|
Task<Supplier?> GetSupplierById(Guid supplierId);
|
|
Task<Supplier> CreateSupplier(Supplier supplier);
|
|
|
|
// GRN
|
|
Task<GoodsReceivedNote> CreateGrn(GoodsReceivedNote grn);
|
|
Task<List<GoodsReceivedNote>> GetGrns(Guid clientId);
|
|
Task<GoodsReceivedNote?> GetGrnById(Guid grnId);
|
|
/// <summary>Next sequential number for this client, e.g. 3 -> "GRN-0004".</summary>
|
|
Task<int> GetNextGrnSequence(Guid clientId);
|
|
|
|
// Sales
|
|
Task<Sale> CreateSale(Sale sale);
|
|
Task<List<Sale>> GetSales(Guid clientId);
|
|
Task<Sale?> GetSaleById(Guid saleId);
|
|
Task<int> GetNextSaleSequence(Guid clientId);
|
|
|
|
// Returns
|
|
Task<StockReturn> CreateStockReturn(StockReturn stockReturn);
|
|
Task<List<StockReturn>> GetStockReturns(Guid clientId);
|
|
Task<StockReturn?> GetStockReturnById(Guid stockReturnId);
|
|
}
|
|
}
|