I am trying to add 2 custom fields to the Cart service. I had a look at the Cart update() method and it seems that it needs to be adjusted to add custom fields. I overwrote the method and added following two clauses:
....
if ("internal_order_id" in data) {
cart.internal_order_id = data.internal_order_id as string;
}
if ("is_partial_delivery" in data) {
cart.is_partial_delivery = data.is_partial_delivery as boolean;
}
console.log("FULL CART: ", cart);
const updatedCart = await cartRepo.save(cart);
....
I adjusted CartUpdateProps and StorePostCartsCartReq to allow me to post both fields (repo etc. is also extended and migrations ran).
When I log the cart right before the update I can see my new properties are there and everything seems in order, I can also see that the .save() method is called successfully.
When checking the DB after I do not see the fields though - they are just null. I have been trying for days now, what am I missing here? Thanks!