dont reserv other than ps5
This commit is contained in:
@@ -203,12 +203,6 @@ type AddRequest struct {
|
|||||||
StoreId *string `json:"storeId"`
|
StoreId *string `json:"storeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *PoolServer) GetReservationTime(item *messages.AddItem) time.Duration {
|
|
||||||
// TODO: Implement reservation time calculation, nil don't require reservation
|
|
||||||
return time.Minute * 15
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *PoolServer) AddSkuRequestHandler(w http.ResponseWriter, r *http.Request, id cart.CartId) error {
|
func (s *PoolServer) AddSkuRequestHandler(w http.ResponseWriter, r *http.Request, id cart.CartId) error {
|
||||||
addRequest := AddRequest{Quantity: 1}
|
addRequest := AddRequest{Quantity: 1}
|
||||||
err := json.NewDecoder(r.Body).Decode(&addRequest)
|
err := json.NewDecoder(r.Body).Decode(&addRequest)
|
||||||
|
|||||||
@@ -19,9 +19,13 @@ func NewCartMutationContext(reservationService inventory.CartReservationService)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *CartMutationContext) ReserveItem(ctx context.Context, cartId CartId, sku string, locationId *string, quantity uint16) (*time.Time, error) {
|
func (c *CartMutationContext) ReserveItem(ctx context.Context, cartId CartId, sku string, locationId *string, quantity uint16) (*time.Time, error) {
|
||||||
|
|
||||||
if quantity <= 0 || c.reservationService == nil {
|
if quantity <= 0 || c.reservationService == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
if sku != "919641" {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
l := inventory.LocationID("se")
|
l := inventory.LocationID("se")
|
||||||
if locationId != nil {
|
if locationId != nil {
|
||||||
l = inventory.LocationID(*locationId)
|
l = inventory.LocationID(*locationId)
|
||||||
|
|||||||
Reference in New Issue
Block a user