using System;
using System.Linq.Expressions;
using Brizco.Domain.Dtos.LargDtos;
using Brizco.Domain.Dtos.SmallDtos;
using Brizco.Domain.Entities.Task;

namespace Brizco.Domain.Mappers
{
    public static partial class ActivityMapper
    {
        public static Activity AdaptToActivity(this ActivitySDto p1)
        {
            return p1 == null ? null : new Activity()
            {
                Status = p1.Status,
                DoneAt = p1.DoneAt,
                IsDone = p1.IsDone,
                PerformanceDescription = p1.PerformanceDescription,
                Type = p1.Type,
                Title = p1.Title,
                Description = p1.Description,
                IsRelatedToShift = p1.IsRelatedToShift,
                IsRelatedToRole = p1.IsRelatedToRole,
                IsRelatedToPerson = p1.IsRelatedToPerson,
                IsDisposable = p1.IsDisposable,
                SetFor = p1.SetFor,
                HasDisposed = p1.HasDisposed,
                Amount = p1.Amount,
                AmountType = p1.AmountType,
                Id = p1.Id
            };
        }
        public static Activity AdaptTo(this ActivitySDto p2, Activity p3)
        {
            if (p2 == null)
            {
                return null;
            }
            Activity result = p3 ?? new Activity();
            
            result.Status = p2.Status;
            result.DoneAt = p2.DoneAt;
            result.IsDone = p2.IsDone;
            result.PerformanceDescription = p2.PerformanceDescription;
            result.Type = p2.Type;
            result.Title = p2.Title;
            result.Description = p2.Description;
            result.IsRelatedToShift = p2.IsRelatedToShift;
            result.IsRelatedToRole = p2.IsRelatedToRole;
            result.IsRelatedToPerson = p2.IsRelatedToPerson;
            result.IsDisposable = p2.IsDisposable;
            result.SetFor = p2.SetFor;
            result.HasDisposed = p2.HasDisposed;
            result.Amount = p2.Amount;
            result.AmountType = p2.AmountType;
            result.Id = p2.Id;
            return result;
            
        }
        public static Expression<Func<ActivitySDto, Activity>> ProjectToActivity => p4 => new Activity()
        {
            Status = p4.Status,
            DoneAt = p4.DoneAt,
            IsDone = p4.IsDone,
            PerformanceDescription = p4.PerformanceDescription,
            Type = p4.Type,
            Title = p4.Title,
            Description = p4.Description,
            IsRelatedToShift = p4.IsRelatedToShift,
            IsRelatedToRole = p4.IsRelatedToRole,
            IsRelatedToPerson = p4.IsRelatedToPerson,
            IsDisposable = p4.IsDisposable,
            SetFor = p4.SetFor,
            HasDisposed = p4.HasDisposed,
            Amount = p4.Amount,
            AmountType = p4.AmountType,
            Id = p4.Id
        };
        public static ActivitySDto AdaptToSDto(this Activity p5)
        {
            return p5 == null ? null : new ActivitySDto()
            {
                Type = p5.Type,
                Title = p5.Title,
                Description = p5.Description,
                IsRelatedToShift = p5.IsRelatedToShift,
                IsRelatedToRole = p5.IsRelatedToRole,
                IsRelatedToPerson = p5.IsRelatedToPerson,
                IsDisposable = p5.IsDisposable,
                SetFor = p5.SetFor,
                HasDisposed = p5.HasDisposed,
                Status = p5.Status,
                DoneAt = p5.DoneAt,
                IsDone = p5.IsDone,
                PerformanceDescription = p5.PerformanceDescription,
                Amount = p5.Amount,
                AmountType = p5.AmountType,
                Id = p5.Id
            };
        }
        public static ActivitySDto AdaptTo(this Activity p6, ActivitySDto p7)
        {
            if (p6 == null)
            {
                return null;
            }
            ActivitySDto result = p7 ?? new ActivitySDto();
            
            result.Type = p6.Type;
            result.Title = p6.Title;
            result.Description = p6.Description;
            result.IsRelatedToShift = p6.IsRelatedToShift;
            result.IsRelatedToRole = p6.IsRelatedToRole;
            result.IsRelatedToPerson = p6.IsRelatedToPerson;
            result.IsDisposable = p6.IsDisposable;
            result.SetFor = p6.SetFor;
            result.HasDisposed = p6.HasDisposed;
            result.Status = p6.Status;
            result.DoneAt = p6.DoneAt;
            result.IsDone = p6.IsDone;
            result.PerformanceDescription = p6.PerformanceDescription;
            result.Amount = p6.Amount;
            result.AmountType = p6.AmountType;
            result.Id = p6.Id;
            return result;
            
        }
        public static Expression<Func<Activity, ActivitySDto>> ProjectToSDto => p8 => new ActivitySDto()
        {
            Type = p8.Type,
            Title = p8.Title,
            Description = p8.Description,
            IsRelatedToShift = p8.IsRelatedToShift,
            IsRelatedToRole = p8.IsRelatedToRole,
            IsRelatedToPerson = p8.IsRelatedToPerson,
            IsDisposable = p8.IsDisposable,
            SetFor = p8.SetFor,
            HasDisposed = p8.HasDisposed,
            Status = p8.Status,
            DoneAt = p8.DoneAt,
            IsDone = p8.IsDone,
            PerformanceDescription = p8.PerformanceDescription,
            Amount = p8.Amount,
            AmountType = p8.AmountType,
            Id = p8.Id
        };
        public static Activity AdaptToActivity(this ActivityLDto p9)
        {
            return p9 == null ? null : new Activity()
            {
                Status = p9.Status,
                DoneAt = p9.DoneAt,
                IsDone = p9.IsDone,
                PerformanceDescription = p9.PerformanceDescription,
                Type = p9.Type,
                Title = p9.Title,
                Description = p9.Description,
                IsRelatedToShift = p9.IsRelatedToShift,
                IsRelatedToRole = p9.IsRelatedToRole,
                IsRelatedToPerson = p9.IsRelatedToPerson,
                IsDisposable = p9.IsDisposable,
                SetFor = p9.SetFor,
                HasDisposed = p9.HasDisposed,
                Amount = p9.Amount,
                AmountType = p9.AmountType,
                Id = p9.Id
            };
        }
        public static Activity AdaptTo(this ActivityLDto p10, Activity p11)
        {
            if (p10 == null)
            {
                return null;
            }
            Activity result = p11 ?? new Activity();
            
            result.Status = p10.Status;
            result.DoneAt = p10.DoneAt;
            result.IsDone = p10.IsDone;
            result.PerformanceDescription = p10.PerformanceDescription;
            result.Type = p10.Type;
            result.Title = p10.Title;
            result.Description = p10.Description;
            result.IsRelatedToShift = p10.IsRelatedToShift;
            result.IsRelatedToRole = p10.IsRelatedToRole;
            result.IsRelatedToPerson = p10.IsRelatedToPerson;
            result.IsDisposable = p10.IsDisposable;
            result.SetFor = p10.SetFor;
            result.HasDisposed = p10.HasDisposed;
            result.Amount = p10.Amount;
            result.AmountType = p10.AmountType;
            result.Id = p10.Id;
            return result;
            
        }
        public static Expression<Func<ActivityLDto, Activity>> ProjectLDtoToActivity => p12 => new Activity()
        {
            Status = p12.Status,
            DoneAt = p12.DoneAt,
            IsDone = p12.IsDone,
            PerformanceDescription = p12.PerformanceDescription,
            Type = p12.Type,
            Title = p12.Title,
            Description = p12.Description,
            IsRelatedToShift = p12.IsRelatedToShift,
            IsRelatedToRole = p12.IsRelatedToRole,
            IsRelatedToPerson = p12.IsRelatedToPerson,
            IsDisposable = p12.IsDisposable,
            SetFor = p12.SetFor,
            HasDisposed = p12.HasDisposed,
            Amount = p12.Amount,
            AmountType = p12.AmountType,
            Id = p12.Id
        };
        public static ActivityLDto AdaptToLDto(this Activity p13)
        {
            return p13 == null ? null : new ActivityLDto()
            {
                Type = p13.Type,
                Title = p13.Title,
                Description = p13.Description,
                IsRelatedToShift = p13.IsRelatedToShift,
                IsRelatedToRole = p13.IsRelatedToRole,
                IsRelatedToPerson = p13.IsRelatedToPerson,
                IsDisposable = p13.IsDisposable,
                SetFor = p13.SetFor,
                HasDisposed = p13.HasDisposed,
                Status = p13.Status,
                DoneAt = p13.DoneAt,
                IsDone = p13.IsDone,
                PerformanceDescription = p13.PerformanceDescription,
                Amount = p13.Amount,
                AmountType = p13.AmountType,
                Id = p13.Id
            };
        }
        public static ActivityLDto AdaptTo(this Activity p14, ActivityLDto p15)
        {
            if (p14 == null)
            {
                return null;
            }
            ActivityLDto result = p15 ?? new ActivityLDto();
            
            result.Type = p14.Type;
            result.Title = p14.Title;
            result.Description = p14.Description;
            result.IsRelatedToShift = p14.IsRelatedToShift;
            result.IsRelatedToRole = p14.IsRelatedToRole;
            result.IsRelatedToPerson = p14.IsRelatedToPerson;
            result.IsDisposable = p14.IsDisposable;
            result.SetFor = p14.SetFor;
            result.HasDisposed = p14.HasDisposed;
            result.Status = p14.Status;
            result.DoneAt = p14.DoneAt;
            result.IsDone = p14.IsDone;
            result.PerformanceDescription = p14.PerformanceDescription;
            result.Amount = p14.Amount;
            result.AmountType = p14.AmountType;
            result.Id = p14.Id;
            return result;
            
        }
        public static Expression<Func<Activity, ActivityLDto>> ProjectToLDto => p16 => new ActivityLDto()
        {
            Type = p16.Type,
            Title = p16.Title,
            Description = p16.Description,
            IsRelatedToShift = p16.IsRelatedToShift,
            IsRelatedToRole = p16.IsRelatedToRole,
            IsRelatedToPerson = p16.IsRelatedToPerson,
            IsDisposable = p16.IsDisposable,
            SetFor = p16.SetFor,
            HasDisposed = p16.HasDisposed,
            Status = p16.Status,
            DoneAt = p16.DoneAt,
            IsDone = p16.IsDone,
            PerformanceDescription = p16.PerformanceDescription,
            Amount = p16.Amount,
            AmountType = p16.AmountType,
            Id = p16.Id
        };
    }
}