diff --git a/README.md b/README.md index 8c5c9a8..b58ffad 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,28 @@ This project use Apache Airflow, GitHub action CICD, excel, sql, docker and pyth # Scenario user story Ensure that customer order data is correctly loaded into the database so that I can analyze purchasing patterns. -**Acceptance Criteria:** -The Customer_ID must be unique. -The Product_ID must exist in the Products table. -The Quantity must not be negative. -The Order_Date must be valid and in the correct format (YYYY-MM-DD). -The Customer_Name must not be empty. \ No newline at end of file +## Acceptance Criteria: +The ```Customer_ID``` must be unique.
+The ```Product_ID``` must exist in the Products table.
+The ```Quantity``` must not be negative.
+The ```Order_Date``` must be valid and in the correct format (YYYY-MM-DD).
+The ```Customer_Name``` must not be empty.
+ +## Transformation Logic (ETL): +**Extract**: Data is extracted from Excel files containing order details.
+**Transform**: +Remove leading/trailing spaces from Customer_Name.
+Ensure Order_Date is in the correct format (YYYY-MM-DD).
+Handle missing or invalid values for Quantity (e.g., replace negative values with zero).
+**Load**: Data is loaded into the Orders table in SQLite + +## Test Plan +# Data Validation Test Cases + +| **Test Case ID** | **Test Case Description** | **Steps to Execute** | **Expected Result** | **Business Rule Compliance** | **Risk Level** | **Test Data** | +|------------------|-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|------------------------------------------------------------------|----------------------------------|-----------------------------------------------------------| +| TC_01 | **Validate Customer_ID Uniqueness** | - Insert two orders with the same Customer_ID.
- Check if the system raises an error or rejects the second order. | **Failure**: The system should reject the second order with the same Customer_ID. | Duplicate Customer_ID violates uniqueness in the orders table. | **Critical** – Affects data integrity. | Customer_ID: 1234 (used for two orders)
Order_Date: "2024-12-01"
Product_ID: 567
Quantity: 2 | +| TC_02 | **Validate Correct Date Format** | - Insert an order with an invalid date format (e.g., `12/01/2024` for `Order_Date`).
- Attempt to save the order. | **Failure**: The system should reject the order due to incorrect date format. | The `Order_Date` must follow a standardized format. | **High** – Incorrect data can cause parsing issues and errors in reporting. | Customer_ID: 1234
Order_Date: "12/01/2024" (invalid format)
Product_ID: 567
Quantity: 2 | +| TC_03 | **Validate Missing Customer_Name** | - Insert an order with a missing `Customer_Name` value.
- Attempt to save the order. | **Failure**: The system should reject the order due to missing customer name. | The `Customer_Name` field is mandatory for all orders. | **High** – Missing customer information affects order processing and analysis. | Customer_ID: 1234
Order_Date: "2024-12-01"
Product_ID: 567
Quantity: 2 (Customer_Name: NULL) | +| TC_04 | **Validate Negative Quantity** | - Insert an order with a negative `Quantity` value.
- Attempt to save the order. | **Failure**: The system should reject the order due to invalid quantity. | `Quantity` must always be a positive number. | **High** – Negative quantity violates business logic and can affect financial calculations. | Customer_ID: 1234
Order_Date: "2024-12-01"
Product_ID: 567
Quantity: -5 | +| TC_05 | **Validate Missing Order Date** | - Insert an order with a missing `Order_Date` value.
- Attempt to save the order. | **Failure**: The system should reject the order due to missing order date. | `Order_Date` cannot be missing. | **Critical** – Missing order dates make the data unusable for time-based analysis. | Customer_ID: 1234
Customer_Name: "John Doe"
Product_ID: 567
Quantity: 2 (Order_Date: NULL) | \ No newline at end of file