Esempio n. 1
0
        public IActionResult AcceptLoad([FromBody] LoadDetailViewModel load)
        {
            try
            {
                var loadData = _mapper.Map <LoadDetailData>(load);
                loadData.LoadTransaction = new LoadTransactionData()
                {
                    TransactionType = TransactionTypeData.Accepted
                };

                var result = _loadService.AcceptLoad(loadData, customerId: _user.UserId.Value, username: _systemUser);
                return(Success(_mapper.Map <LoadDetailViewModel>(result)));
            }
            catch (ValidationException e)
            {
                return(Error <LoadDetailViewModel>(e));
            }
        }