API is covered with feature tests.
git clone https://github.com/xEdelweiss/store-test-assignment.git
cd store-test-assignment
composer install
cp .env.example .env
php artisan key:generate
php vendor/bin/phpunit
- Prices are not saved for the order.
- Cart is processed on a frontend.
Modules:
- User
Registration(out of scope)Authentication(out of scope)- See orders history
Rate order(out of scope)- Update profile
- Product
- List products
- Filter products
- See product details
Add/Update/Remove products(out of scope)
- Order
- Make order
- See order details
Filter orders(out of scope)
Events and their possible use:
- OrderCreated:
- Block products for some amount of time
- Track order start for analytics
OrderPaid(out of scope)- Trigger order shipping from the warehouse
- Financial analytics
- OrderShipped
- Client notification
- Tracking logistics
OrderDelivered(consider as completed, out of scope)- Track order completion for analytics
OrderCancelled(out of scope)- Prepare warehouse for products returning
- Trigger refund
- Track success rate
OrderRefunded(out of scope)- Financial accounting
Order statuses:
- Created
Paid(out of scope)- Shipped
- Delivered
Cancelled(out of scope)Refunded(out of scope)
- Full-text search by title/description
With the project's growth, we could use laravel-modules
to further divide code. For now, it should be enough to keep the default Laravel structure and use subdirectories to separate modules, e.g. App\Events\Orders\OrderCreated
.