示例#1
0
        public AdvancedPaymentDomain Serialize(AdvancedPaymentDomain advancedPaymentDomain)
        {
            advancedPaymentDomain.RequestedOn         = DateTime.Now;
            advancedPaymentDomain.StatusRequest       = "pending";
            advancedPaymentDomain.AmountRequestedList = AmountRequestedList;

            return(advancedPaymentDomain);
        }
示例#2
0
        public async Task <IActionResult> Analyzed([FromServices] AdvancedPaymentDomain advancedPaymentDomain, [FromBody] AntecipatedAnalyzeViewModel antecipatedAnalyzeViewModel)
        {
            antecipatedAnalyzeViewModel.Serialize(advancedPaymentDomain);

            var result = await advancedPaymentDomain.UpdateAntecipateToAnalyzed();

            if (!result)
            {
                return(UnprocessableEntity(new { Error = "Antecipação não existe ou não pode ser alterada" }));
            }

            return(Ok());
        }
示例#3
0
        public async Task <IActionResult> Create([FromServices] AdvancedPaymentDomain advancedPaymentDomain, [FromBody] AdvancedPaymentViewModel advancedPaymentViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState.Values));
            }

            advancedPaymentViewModel.Serialize(advancedPaymentDomain);

            if (!await advancedPaymentDomain.Advanced())
            {
                return(UnprocessableEntity(new { Error = "Falha ao registrar antecipação" }));
            }

            return(Ok(advancedPaymentDomain.AdvancedPayment));
        }
 public AdvancedPaymentDomain Serialize(AdvancedPaymentDomain advancedPaymentDomain)
 {
     advancedPaymentDomain.Id = Id.Value;
     return(advancedPaymentDomain);
 }