[x] We need some logic to convert from the raw input json into an Either[AdvertNewCar,AdvertUsedCar]. If we do that then it becomes easy to
[x] We need logic to convert to raw json.
[x] Write tests for the Json service
Hydrate Service
We need a service that will hydrate/convert between the database StorableTrait input/output types and the AdvertNewCar/AdvertUsedCar types.
Service needs to:
[x] Given a StorableType, it needs to convert it into an Either[AdvertNewCar,AdvertUsedCar]. The other direction is already satisfied, since the AdvertNewCar,AdvertUsedCar already implement StorableType.
The data flow is
Json service
Either[AdvertNewCar,AdvertUsedCar]
. If we do that then it becomes easy toHydrate Service
We need a service that will hydrate/convert between the database
StorableTrait
input/output types and theAdvertNewCar/AdvertUsedCar
types.Service needs to:
AdvertNewCar,AdvertUsedCar
already implement StorableType.