public async Task <IActionResult> AddPurchaseType(ShopPurchaseTypePostRequest model) { try { if (!ModelState.IsValid) { throw new Exception("Petición de alta inválida"); } return(Ok(await _shopService.AddAllowedPurchaseTypeAsync(model, _apiDbContext))); } catch (Exception e) { return(StatusCode(500, e.Message)); } }