Skip to content

DDD based approach in creating invoice module in Laravel

Notifications You must be signed in to change notification settings

arrosinski/invoice-module

Repository files navigation

Invoice module with approve and reject system as a part of a bigger enterprise system. Approval module exists and you should use it.

  • Invoice contains:
    • Invoice number
    • Invoice date
    • Due date
    • Company
      • Name
      • Street Address
      • City
      • Zip code
      • Phone
    • Billed company
      • Name
      • Street Address
      • City
      • Zip code
      • Phone
      • Email address
    • Products
      • Name
      • Quantity
      • Unit Price
      • Total
    • Total price
Image just for visualization

TO DO:

Simple Invoice module which is approving or rejecting single invoice using information from existing approval module which tells if the given resource is approvable / rejectable. Only 3 endpoints are required:

  - Show Invoice data, like in the list above
  - Approve Invoice
  - Reject Invoice
  • In this task you must save only invoices so don’t write repositories for every model/ entity.

  • You should be able to approve or reject each invoice just once (if invoice is approved you cannot reject it and vice versa.

  • You can assume that product quantity is integer and only currency is USD.

  • Proper seeder is located in Invoice module and it’s named DatabaseSeeder

  • In .env.example proper connection to database is established.

  • Using proper DDD structure is mandatory (with elements like entity, value object, repository, mapper / proxy, DTO). Unit tests in plus.

  • Docker is in docker catalog and you need only do

    ./start.sh
    

    to make everything work

    docker container is in docker folder. To connect with it just:

    docker compose exec workspace bash
    

About

DDD based approach in creating invoice module in Laravel

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •