Kodall
Tutorials

Lesson 5 Test your knowledge

So far we created a way to track the inventory changes produced by purchase invoices. To test what you've learned, we advise you to create another type of invoice called sale_invoice. This invoice is similar with purchase_invoice with some differences.

So far we created a way to track the inventory changes produced by purchase invoices. To test what you've learned, we advise you to create another type of invoice called sale_invoice. This invoice is similar with purchase_invoice with some differences.

To help you out, here are some tips:

  • instead of supplier entity, create and use another entity called client (this one will have same properties like supplier entity);
  • instead of purchase_invoice_item, create and use an entity called sale_invoice_item (similar with purchase_invoice_item);
  • in the InventoryService add another method called createOut, which creates an inventory entity that contributes to the overall of the product quantity, in a way that decreases its quantity;
  • create another Event listener, but this time for the sale_invoice entity;
  • modify the methods of the generated workflow (called SaleInvoiceOperations) in order to keep track of inventory changes produced by this new document (sale_invoice)

The complete ER diagram shoud look like this:

Rendering diagram...