using Marco.Pms.Model.Dtos.Project;
using Marco.Pms.Model.Projects;

namespace Marco.Pms.Model.Mapper
{
    public static class BuildingMapper
    {
        public static Building ToBuildingFromBuildingDto(this BuildingDto model, Guid tenantId)
        {
            return new Building
            {
                Id = model.Id != null ? model.Id.Value : Guid.Empty,
                Description = model.Description,
                Name = model.Name,
                ProjectId = model.ProjectId,
                TenantId = tenantId,
            };
        }
    }

    public static class FloorMapper
    {
        public static Floor ToFloorFromFloorDto(this FloorDto model, Guid tenantId)
        {
            return new Floor
            {
                Id = model.Id != null ? model.Id.Value : Guid.Empty,
                FloorName = model.FloorName,
                BuildingId = model.BuildingId,
                TenantId = tenantId
            };
        }
    }

    public static class WorAreaMapper
    {
        public static WorkArea ToWorkAreaFromWorkAreaDto(this WorkAreaDto model, Guid tenantId)
        {
            return new WorkArea
            {
                Id = model.Id != null ? model.Id.Value : Guid.Empty,
                AreaName = model.AreaName,
                FloorId = model.FloorId,
                TenantId = tenantId

            };
        }
    }
    public static class WorkItemMapper
    {
        public static WorkItem ToWorkItemFromWorkItemDto(this WorkItemDto model, Guid tenantId)
        {
            return new WorkItem
            {
                Id = model.Id != null ? model.Id.Value : Guid.Empty,
                ActivityId = model.ActivityID,
                CompletedWork = model.CompletedWork,
                PlannedWork = model.PlannedWork,
                WorkCategoryId = model.WorkCategoryId,
                TaskDate = DateTime.Now,
                TenantId = tenantId,
                WorkAreaId = model.WorkAreaID,
                ParentTaskId = model.ParentTaskId,
                Description = model.Comment

            };
        }
        //public static WorkItemVm ToWorkItemVMFromWorkItem(this WorkItem workItem)
        //{
        //    return new WorkItemVm
        //    {
        //        Id
        //    }
        //}
    }
}
