Update Status
This commit is contained in:
parent
e544ef8f71
commit
7cc4f1d152
@ -133,6 +133,10 @@ func (s *OrderService) CheckInInquiry(ctx mycontext.Context, qrCode string, part
|
||||
return nil, errors2.ErrorBadRequest
|
||||
}
|
||||
|
||||
if order.Status != "PAID" {
|
||||
return nil, errors2.ErrorInvalidRequest
|
||||
}
|
||||
|
||||
if order.TicketStatus == "USED" {
|
||||
return nil, errors2.ErrorTicketInvalidOrAlreadyUsed
|
||||
}
|
||||
@ -179,11 +183,11 @@ func (s *OrderService) CheckInExecute(ctx mycontext.Context,
|
||||
Order: order,
|
||||
}
|
||||
|
||||
if order.Status != "UNUSED" {
|
||||
if order.TicketStatus != "UNUSED" {
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
order.Status = "USED"
|
||||
order.TicketStatus = "USED"
|
||||
order, err = s.repo.Update(ctx, order)
|
||||
if err != nil {
|
||||
logger.ContextLogger(ctx).Error("error when updating order status", zap.Error(err))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user