Esempio n. 1
0
        public override bool IsValid(params ILegalPerson[] persons)
        {
            var subj = GetSubjectPerson(persons);

            if (subj == null)
            {
                AddReasonEntry($"{nameof(GetSubjectPerson)} returned nothing");
                return(false);
            }
            var title = subj.GetLegalPersonTypeName();

            if (base.PropertyOwnerIsInPossession(persons))
            {
                return(false);
            }

            if (Relinquishment == null)
            {
                AddReasonEntry($"{title} {subj.Name}, {nameof(Relinquishment)} is unassigned");
                return(false);
            }

            if (!Relinquishment.IsValid(persons))
            {
                AddReasonEntryRange(Relinquishment.GetReasonEntries());
                AddReasonEntry($"{title} {subj.Name}, {nameof(MislaidProperty)} requires property was " +
                               "voluntarily placed somewhere but later forgotten");
                return(false);
            }

            if (IsPropertyLocationKnown(subj))
            {
                AddReasonEntry($"{title} {subj.Name}, {nameof(IsPropertyLocationKnown)} is true");
                return(false);
            }

            SubjectProperty = new ResDerelictae(SubjectProperty)
            {
                IsEntitledTo = lp => false, IsInPossessionOf = lp => false
            };

            return(true);
        }
Esempio n. 2
0
        public override bool IsValid(params ILegalPerson[] persons)
        {
            var subj = GetSubjectPerson(persons);

            if (subj == null)
            {
                AddReasonEntry($"{nameof(GetSubjectPerson)} returned nothing");
                return(false);
            }
            var title = subj.GetLegalPersonTypeName();

            if (base.PropertyOwnerIsInPossession(persons))
            {
                return(false);
            }
            if (Relinquishment == null)
            {
                AddReasonEntry($"{title} {subj.Name}, {nameof(Relinquishment)} is unassigned");
                return(false);
            }

            if (Relinquishment.IsVoluntary(subj))
            {
                AddReasonEntry($"{title} {subj.Name}, {nameof(LostProperty)} " +
                               "requires the owner to have acted involuntarily");
                return(false);
            }

            if (IsPropertyLocationKnown(subj))
            {
                AddReasonEntry($"{title} {subj.Name}, {nameof(IsPropertyLocationKnown)} is true");
                return(false);
            }

            SubjectProperty = new ResDerelictae(SubjectProperty)
            {
                IsEntitledTo = lp => false, IsInPossessionOf = lp => false
            };

            return(true);
        }