Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial: Add Stock Entity and Features for Inventory Management #36

Merged
merged 35 commits into from
Jan 8, 2025

Conversation

neozhu
Copy link
Owner

@neozhu neozhu commented Jan 7, 2025

Overview

This PR introduces a Stock entity and related features to manage inventory within the CleanAspire application. The changes span multiple layers of the project, including domain, application, API, and client, enabling seamless inventory management operations such as stock receiving, dispatching, and querying.


Key Changes

1. CleanAspire.Domain

  • Added Stock Entity:
    • Represents a stock record, including ProductId, Product, Quantity, and Location.
    • Configured with StockConfiguration to define relationships and constraints.
  • Updated ApplicationDbContext:
    • Added DbSet<Stock> to handle database operations for Stock.

2. CleanAspire.Application

  • Queries and Commands:
    • StocksWithPaginationQuery: Supports paginated and keyword-filtered stock queries.
    • StockReceivingCommand: Handles stock receiving operations.
    • StockDispatchingCommand: Handles stock dispatching operations.
  • Handlers:
    • Implemented query and command handlers to interact with the database and business logic.

3. CleanAspire.Api

  • Added StockEndpointRegistrar:
    • Exposes API endpoints for:
      • Receiving stock (POST /stocks/receive)
      • Dispatching stock (POST /stocks/dispatch)
      • Fetching paginated stock data (POST /stocks/pagination).

4. CleanAspire.ClientApp

  • Blazor Page for Stock Management:
    • Added a stock management page (/stocks/index) using MudDataGrid.
    • Features:
      • Search, pagination, and sorting for stock records.
      • Dialogs for receiving and dispatching stock.
      • Cache refresh and real-time data updates.
  • Dialogs for Stock Operations:
    • Dialog components for stock receiving and dispatching with form validation.

@neozhu neozhu linked an issue Jan 7, 2025 that may be closed by this pull request
@neozhu neozhu merged commit e87ebed into main Jan 8, 2025
4 of 5 checks passed
@neozhu neozhu deleted the feature/stock branch January 8, 2025 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to Create a New Object in a CRUD Application: A Step-by-Step Guide
1 participant