Type 'DecimalJsLike' is not assignable to type 'Value'.
My models:
I need to calculate price for an entire order (sum of
priceNetto of all order items) to generate paymentId. So I have a loop:
The type of orderItemCreateManyOrderInput is of course Prisma.OrderItemCreateManyOrderInput[], because I have to create Order with all OrderItems after generating paymentId.
But I am getting an error inside a loop: Type 'DecimalJsLike' is not assignable to type 'Value'. in finalPrice.add(item.priceNetto);, because item.priceNetto is of type 'string | number | Decimal | DecimalJsLike'.
What should I do?2 Replies
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into
#ask-ai for a quick spin!Or maybe another question: Why type of
priceNetto in CreateInput is 'string | number | Decimal | DecimalJsLike' instead of just Decimal?