Skip to content

xEdelweiss/store-test-assignment

Repository files navigation

Store Test Assignment

Run tests

API is covered with feature tests.

  1. git clone https://github.com/xEdelweiss/store-test-assignment.git
  2. cd store-test-assignment
  3. composer install
  4. cp .env.example .env
  5. php artisan key:generate
  6. php vendor/bin/phpunit

Features that are considered out of scope

  • Prices are not saved for the order.
  • Cart is processed on a frontend.

Overview

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)

Possible improvements

  • Full-text search by title/description

Structure

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.

About

This Laravel app demonstrates the interaction between three modules: User, Order, and Product. It showcases how to organize module workflow and project structure.

Resources

Stars

Watchers

Forks