...
|
...
|
@@ -76,6 +76,12 @@ func (service OrderService) GetOrder(getOrderQuery query.GetOrderQuery) (*domain |
|
|
orderRepository domain.OrderRepository
|
|
|
order *domain.Order
|
|
|
)
|
|
|
if err = transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
if value, err := factory.CreateOrderRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
...
|
...
|
@@ -102,7 +108,10 @@ func (service OrderService) GetOrder(getOrderQuery query.GetOrderQuery) (*domain |
|
|
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
order.PartnerInfo = partnerData.Partner
|
|
|
|
|
|
err = transactionContext.CommitTransaction()
|
|
|
if err != nil {
|
|
|
return nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
return order, nil
|
|
|
}
|
|
|
|
...
|
...
|
|