Commit c69401c7 by Murlidhar Fichadia

initial commit

Co-Authored-By: Oz <oz-agent@warp.dev>
parents
# Inventory & Order Processing System
Build a backend API for a simple inventory and order processing system.
## Scenario
We are building an e-commerce platform where customers can place orders for multiple products at once.
## Requirements
### Data Model
Design and migrate the following (add columns as you see fit, but these are the minimum):
- **products**`id`, `name`, `sku`, `price`, `stock_quantity`, `timestamps`
- **orders**`id`, `user_id`, `status` (`pending`/`confirmed`/`cancelled`/`dispatched`/`refunded`), `total_amount`, `timestamps`
- **order_items**`id`, `order_id`, `product_id`, `quantity`, `unit_price`, `timestamps`
### Features to Build
#### 1. Place an Order
- Accept a list of products and quantities via a `POST` endpoint.
- Validate the request.
- Return the created order with its items and the calculated total.
#### 2. Cancel an Order
- Only `pending` and `confirmed` orders can be cancelled.
#### 3. List Orders
- Return a list of orders for a given customer, including the items in each order and the associated product details.
#### 4. Low Stock Report
- A single endpoint that returns all products where `stock_quantity` is below a configurable threshold (default: `5`).
### Things to note:
- Approach this as production code, not a take-home demo. We pay close attention to the assumptions you make, the failure modes you anticipate, and the trade-offs you choose.
- Each endpoint should respond with consistent, predictable JSON — think about how a frontend or mobile client would consume your API.
- Please provide a README describing how to set up and run the application locally, how to run the test suite, and a brief explanation of the key decisions you made and why.
- Laravel 9+ and PHP 8+ must be used.
## Bonus:
- Add unit/integration tests (Use PhpUnit or Pest testing suite for testing).
Please make sure this project is completed at least one working day before your interview.
The completed project should be submitted by pushing the code to GitHub and a link emailed to HR.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment