tiagostutz / java-code-assignment

This is a sample application used as a code assignment for Java Developer interview
MIT License
1 stars 0 forks source link

FIx business logic in DB or code #11

Open srcmaxim opened 2 months ago

srcmaxim commented 2 months ago

I see that one Location has a lower capacity that a Warehouse associated with it.

From assignment/CODE_ASSIGNMENT.md:

Validate the warehouse capacity, ensuring it does not exceed the maximum capacity associated with the location.

  1. com.fulfilment.application.monolith.location.LocationGateway

    locations.add(new Location("ZWOLLE-001", 1, 40));
  2. import.sql

    INSERT INTO warehouse(id, businessUnitCode, location, capacity, stock, createdAt, archivedAt) 
    VALUES (1, 'MWH.001', 'ZWOLLE-001', 100, 10, '2024-07-01', null);
tiagostutz commented 2 months ago

Hey @srcmaxim, that's a good catch.! Thanks.

Would you like to Fork and open a PR to fix this issue?

srcmaxim commented 2 months ago

Here's my PR: https://github.com/tiagostutz/java-code-assignment/pull/12