scala-pet-store
scala-pet-store copied to clipboard
Pet and Order status can get out of sync
(sort of a design issue...)
Both Pet
and Order
have their own status which is updated independently. That is, nothing enforces they correspond, like OrderStatus.Delivered
implies PetStatus.Adopted
.
Some ideas to reconcile:
-
status: PetStatus
could be removed fromPet
altogether. -
OrderService
could update thePetRepository
as necessary, and other methods to update thePetStatus
could be limited.