I have a following conditional update returning false. But when I check in the database the columns I was trying to update are in fact updated.
def deliver(d: Delivery, placedDate: java.time.LocalDate, locationKey: String, vendorId: String, orderId: String, code: String, courierId: String, courierName: String) = {
update.
where(_.placedDate eqs placedDate).
and(_.locationKey eqs locationKey).
and(_.vendorId eqs vendorId).
and(_.orderId eqs orderId).
modify(_.status setTo "DELIVERED").
and(_.deliveredTime setTo LocalDateTime.now()).
onlyIf(_.status is "COLLECTED").and(_.deliveryCode is code).future().map(_.wasApplied)
}
Thank you