Beispiel #1
0
        public DomainStatusCodes RemoveRelative(int personId, RemoveRelativeDTO personRelativeData)
        {
            if (!CheckIfPersonExists(personId, out var _))
            {
                return(DomainStatusCodes.RecordNotFound);
            }

            if (!CheckIfPersonExists(personRelativeData.RelativeId, out var _))
            {
                return(DomainStatusCodes.RecordNotFound);
            }

            var existinRelation = _relatedPersonRepository.GetRelation(personId, personRelativeData.RelativeId);

            if (existinRelation == null)
            {
                return(DomainStatusCodes.RecordNotFound);
            }

            _relatedPersonRepository.Remove(personId, personRelativeData.RelativeId);

            Commit();

            return(DomainStatusCodes.Success);
        }
Beispiel #2
0
        public IActionResult CreatePerson(int userId, [FromBody] RemoveRelativeDTO relative)
        {
            var statusCode = _relatedPersonRepository.RemoveRelative(userId, relative);

            return(Response(statusCode));
        }