Ejemplo n.º 1
0
        public async Task <ActionResult <SuccessResponseVM> > CreateVoucherType([FromBody] VoucherTypeVM vocType)
        {
            try
            {
                var result = await _mediator.Send(new CreateVoucherType
                {
                    Payload = new CreateVoucherTypeRequestVM
                    {
                        VoucherType = vocType
                    },

                    Actor = new ProfileVM {
                        Name = "System"
                    }
                });;

                return(Ok(result));
            }
            catch (Exception exception)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, exception));
            }
        }
        public async Task <ActionResult <SuccessResponseVM> > CreateVocTypeAsync([FromBody] VoucherTypeVM requestVM)
        {
            var result = await _promoService.CreateVocType(requestVM);

            return(ProcessResponse(result));
        }