Skip to content

Business Requirements Document

Italo Pessoa edited this page Jul 18, 2024 · 1 revision

1. User Management

BR-U-001: Unique User Registration - The application shall only allow one user registration per unique CPF number.

2. Product Management

BR-P-001: Product Categorization - The application shall enable the registration of products under various predefined categories.

3. Order Management

BR-O-001: Order Creation - To create an order, the user shall provide a list of items with their desired quantities.

BR-O-002: Order Confirmation - Upon successful order creation, the application shall return an internal order ID and a tracking code.

BR-O-003: Optional Customer Association - The user may optionally associate a customer with the order during creation.

BR-O-004: Initial Order Status - Newly created orders shall automatically assume the status "PaymentPending".

BR-O-005: Order Status Update - The application shall provide a dedicated endpoint to update the status of an order.

BR-O-006: Automatic Status Transition on Payment Confirmation - Upon successful payment confirmation, the order status shall automatically transition to "Received".

BR-O-007: Status Transition Rules - Order status updates shall adhere to the following rules:

  • "InPreparation" is only permissible from "Received".
  • "Ready" is only permissible from "InPreparation".
  • "Completed" is only permissible from "Ready".

4. Payment Processing

BR-PM-001: Payment Creation - The application shall allow payment creation against a previously created order.

BR-PM-002: Payment Details - Payment creation requires input from the internal order ID and the chosen payment method.

BR-PM-003: Payment Gateway Integration - An external or test payment gateway shall handle payment processing.

BR-PM-004: Payment Information Storage - The application shall store the payment identifier and status received from the payment gateway.

BR-PM-005: Webhook Processing - The application shall provide an endpoint for processing webhook notifications from supported payment gateways.

BR-PM-006: Payment Status Update - Payment status updates shall exclusively occur through the processing of webhook notifications.

BR-PM-007: Automatic Order Status Update on Payment Approval - The associated order status shall automatically transition to "Received" when a payment is approved.