jordidh / multi-tenant-app

Exemple d'aplicació multi tenant
MIT License
0 stars 5 forks source link

Implementation of Orders Management System #18

Open jordidh opened 1 month ago

jordidh commented 1 month ago

Implementation of Orders Management System

Background

The current warehouse management software under development lacks a comprehensive orders management system. This new system will handle various types of orders including customer orders, provider orders, transfer orders, devolution orders, and fabrication orders.

Objective

Design, code, and test an implementation of a robust orders management system that can handle different types of orders efficiently.

Order Types

  1. Customer Order: To pick, pack, and send items to the customer.
  2. Provider Order: To receive, label, and put away stock received from a provider.
  3. Transfer Order: To transfer stock between warehouses.
  4. Devolution Order from Customer: To handle returned items from the customer.
  5. Devolution Order to Provider: To return items to the provider.
  6. Fabrication Order: To manage orders related to the manufacturing process.

Enhanced Attributes

Each order type will have the following attributes:

  1. Order ID: Unique identifier for the order.
  2. Order Type: Type of the order (Customer, Provider, Transfer, Devolution from Customer, Devolution to Provider, Fabrication).
  3. Customer/Provider Details: Information about the customer or provider (name, address, contact).
  4. Order Date: Date the order was placed.
  5. Due Date: Date by which the order should be completed.
  6. Status: Current status of the order (Pending, In Progress, Completed, Cancelled).
  7. Items: List of items in the order, including item ID, description, quantity, and any specific instructions.
  8. Warehouse Details: For transfer and fabrication orders, details of the source and destination warehouses.
  9. Notes: Additional notes or instructions related to the order.

Operations

  1. Create Order: Operation to create a new order.

    • Input:
      • orderType
      • customer/providerDetails
      • orderDate
      • dueDate
      • items
      • warehouseDetails (if applicable)
      • notes
    • Output: orderID
  2. Update Order: Operation to update an existing order.

    • Input:
      • orderID
      • orderType
      • customer/providerDetails
      • orderDate
      • dueDate
      • items
      • warehouseDetails (if applicable)
      • notes
    • Output: Confirmation of update
  3. Get Order Details: Operation to retrieve details of an order by its ID.

    • Input: orderID
    • Output:
      • orderID
      • orderType
      • customer/providerDetails
      • orderDate
      • dueDate
      • status
      • items
      • warehouseDetails (if applicable)
      • notes
  4. Delete Order: Operation to delete an order by its ID.

    • Input: orderID
    • Output: Confirmation of deletion
  5. List Orders: Operation to list all orders with optional filters for order type, status, and date range.

    • Input:
      • orderType (optional)
      • status (optional)
      • dateRange (optional)
    • Output: List of orders matching the criteria

Tasks

  1. Database Schema Update:

    • Create tables to store order details and related information.
  2. API Endpoints:

    • Create endpoints for the operations: Create Order, Update Order, Get Order Details, Delete Order, List Orders.
  3. UI/UX Design:

    • Design the user interface for managing orders, including forms for order creation and updating, and views for listing and viewing order details.
  4. Business Logic Implementation:

    • Implement the logic to handle different order types and their specific requirements.
  5. Validation Rules:

    • Implement validation rules to ensure data integrity and correctness.
  6. Testing:

    • Write and execute unit tests, integration tests, and end-to-end tests to ensure the functionality works as expected.
    • Perform regression testing to ensure existing functionality is not broken.

Acceptance Criteria

jordidh commented 4 days ago

Updates from the last commit:

  1. Delete table creation sentences from db_test.sql
  2. Rename db_test.sql to db_test_inserts.sql
  3. Change the test database creation to run the script from db_tenant.sql and db_test_inserts.sql
  4. Delete the table place and use location instead
  5. Create an API REST for account, provider and address
  6. Rerun all the tests and make a pullrequest