public async Task <ActionResult> PostAsync(int providerId, int customerId, int petId, int profileId, [FromBody] SaveVaccinationRecordResource resource)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState.GetErrorMessages()));
            }


            var Prid = await _providerService.FindByIdAsync(providerId
                                                            );

            if (!Prid.Success)
            {
                return(BadRequest(Prid.Message));
            }


            var Cid = await _customerService.FindByIdAsync(customerId
                                                           );

            if (!Cid.Success)
            {
                return(BadRequest(Cid.Message));
            }

            var Pid = await _petService.FindByIdAsync(petId
                                                      );

            if (!Pid.Success)
            {
                return(BadRequest(Pid.Message));
            }

            var Proid = await _profileService.FindByIdAsync(profileId
                                                            );

            if (!Proid.Success)
            {
                return(BadRequest(Proid.Message));
            }


            //DEBO COPIAR LA FUNCION DE DE BUSCAR LA LISTA DE MASCOTAS POR ID DE CUSTOMER PARA QUE POR ID DE MEDICALPROFILE PODER RECUPERAR TODOS LOS VACCINATION
            var vaccinationRecord = _mapper.Map <SaveVaccinationRecordResource, VaccinationRecord>(resource);
            var result            = await _vaccinationRecordService.SaveByProfileIdAsync(profileId, vaccinationRecord);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }
            var VaccinationRecordResource = _mapper.Map <VaccinationRecord, VaccinationRecordResource>(result.VaccinationRecord);

            return(Ok(VaccinationRecordResource));
        }
        public async Task <IActionResult> PutAsync(int providerId, int customerId, int petId, int profileId, int id, [FromBody] SaveVaccinationRecordResource resource)
        {
            var Prid = await _providerService.FindByIdAsync(providerId
                                                            );

            if (!Prid.Success)
            {
                return(BadRequest(Prid.Message));
            }


            var Cid = await _customerService.FindByIdAsync(customerId
                                                           );

            if (!Prid.Success)
            {
                return(BadRequest(Cid.Message));
            }

            var Pid = await _petService.FindByIdAsync(petId
                                                      );

            if (!Pid.Success)
            {
                return(BadRequest(Pid.Message));
            }

            var Proid = await _profileService.FindByIdAsync(profileId
                                                            );

            if (!Proid.Success)
            {
                return(BadRequest(Proid.Message));
            }

            var vaccinationRecord = _mapper.Map <SaveVaccinationRecordResource, VaccinationRecord>(resource);
            var result            = await _vaccinationRecordService.UpdateAsync(id, vaccinationRecord);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }
            var VaccinationRecordResource = _mapper.Map <VaccinationRecord, VaccinationRecordResource>(result.VaccinationRecord);

            return(Ok(VaccinationRecordResource));
        }