public List <ErrorMessage> ValidDeleteContactById(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { var errorMessages = IsDeleteContactByIdMsgEntityValid(deleteContactByIdMsgEntity); errorMessages = IsContactIdValid(deleteContactByIdMsgEntity); return(errorMessages); }
public List <ErrorMessage> DeleteContactById(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { var contactDAO = contactServiceMapper.MapContactDAO(deleteContactByIdMsgEntity); contactServiceRepository.DeleteContactById(contactDAO); return(null); }
public List <ErrorMessage> IsDeleteContactByIdMsgEntityValid(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { if (deleteContactByIdMsgEntity.IsEmpty()) { return(KanakketuppuUtility.GetErrorMessages(contactServiceErrorCode.DeleteContactByIdMsgEntityIsEmpty)); } return(null); }
public ContactDAO MapContactDAO(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { return(new ContactDAO { Id = deleteContactByIdMsgEntity.ParsedId, ModifiedBy = deleteContactByIdMsgEntity.ModifiedBy, ModifiedOn = deleteContactByIdMsgEntity.ModifiedOn }); }
public List <ErrorMessage> IsContactIsReadyToDelete(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { if (deleteContactByIdMsgEntity.ExistingContact.Count() >= 2) { return(KanakketuppuUtility.GetErrorMessages(contactServiceErrorCode.ToManyContactsForId)); } if (deleteContactByIdMsgEntity.ExistingContact.FirstOrDefault().Status.IsEqual(ContactStatus.DELETED.ToString())) { return(KanakketuppuUtility.GetErrorMessages(contactServiceErrorCode.DeleteContactByIdAlreadyDeleted)); } return(null); }
public List <ErrorMessage> IsContactIdValid(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { var contactDao = contactServiceRepository.GetContactById(deleteContactByIdMsgEntity.ParsedId); if (!contactDao.AnyWithNullCheck()) { deleteContactByIdMsgEntity.HttpStatusCode = HttpStatusCode.NotFound; return(KanakketuppuUtility.GetErrorMessages(contactServiceErrorCode.DeleteContactByIdIdNotFound)); } deleteContactByIdMsgEntity.ExistingContact = contactDao; return(null); }
public List <ErrorMessage> IsContactIdValid(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { if (deleteContactByIdMsgEntity.Id.IsEmpty()) { return(KanakketuppuUtility.GetErrorMessages(contactServiceErrorCode.ContactIdIsEmpty)); } deleteContactByIdMsgEntity.ParsedId = deleteContactByIdMsgEntity.Id.ToLong(); if (deleteContactByIdMsgEntity.ParsedId == 0) { return(KanakketuppuUtility.GetErrorMessages(contactServiceErrorCode.ContactIdIsInValid)); } return(null); }
public List <ErrorMessage> VerifyDeleteContactById(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { var errorMessages = IsContactIdValid(deleteContactByIdMsgEntity); if (errorMessages.AnyWithNullCheck()) { return(errorMessages); } errorMessages = IsContactIsReadyToDelete(deleteContactByIdMsgEntity); if (errorMessages.AnyWithNullCheck()) { return(errorMessages); } return(errorMessages); }
public List <ErrorMessage> DeleteContactById(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { //Setup deleteContactByIdMsgEntity.CreatedOn = deleteContactByIdMsgEntity.ModifiedOn = DateTime.UtcNow; deleteContactByIdMsgEntity.CreatedBy = deleteContactByIdMsgEntity.ModifiedBy = "ADMIN"; //Validation var resultMessage = contactServiceValidation.ValidDeleteContactById(deleteContactByIdMsgEntity); if (resultMessage.AnyWithNullCheck()) { return(resultMessage); } //Verifier resultMessage = contactServiceVerifier.VerifyDeleteContactById(deleteContactByIdMsgEntity); if (resultMessage.AnyWithNullCheck()) { return(resultMessage); } //Processor resultMessage = contactServiceProcessor.ProcessorDeleteContactById(deleteContactByIdMsgEntity); if (resultMessage.AnyWithNullCheck()) { return(resultMessage); } //PostProcessor var postResultMessage = contactServicePostProcessor.PostProcessorDeleteContactById(deleteContactByIdMsgEntity); if (postResultMessage.AnyWithNullCheck()) { //TODO:log response } return(resultMessage); }
public List <ErrorMessage> ProcessorDeleteContactById(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { var errorMessages = DeleteContactById(deleteContactByIdMsgEntity); return(errorMessages); }
public List <ErrorMessage> PostProcessorDeleteContactById(DeleteContactByIdMsgEntity deleteContactByIdMsgEntity) { return(null); }