chore: update
This commit is contained in:
@@ -186,4 +186,21 @@ public class CartService {
|
||||
|
||||
return getCart(cartId);
|
||||
}
|
||||
|
||||
@Mutation("deleteCart")
|
||||
public Uni<Boolean> deleteCart(@Name("cartId") UUID cartId) {
|
||||
String key = "cart:" + cartId;
|
||||
String priceKey = "cart_prices:" + cartId;
|
||||
|
||||
return Uni.createFrom()
|
||||
.item(() -> {
|
||||
long deletedKeys = hashCommands
|
||||
.getDataSource()
|
||||
.key()
|
||||
.del(key, priceKey);
|
||||
|
||||
return deletedKeys > 0;
|
||||
})
|
||||
.runSubscriptionOn(Infrastructure.getDefaultWorkerPool());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -29,11 +30,11 @@ public class ShiftRegistrationEntity extends BaseEntity {
|
||||
ShiftEntity registratingShift
|
||||
) {
|
||||
return list(
|
||||
"staffId = ?1 and shift.startTime < ?2 and shift.endTime > ?3 and shift.date = date",
|
||||
"staffId = ?1 and shift.startTime < ?2 and shift.endTime > ?3 and shift.date = ?3",
|
||||
staffId,
|
||||
registratingShift.endTime,
|
||||
registratingShift.startTime,
|
||||
registratingShift.date
|
||||
new Timestamp(registratingShift.date.getTime())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user