using Marco.Pms.Model.AttendanceModule;
using Marco.Pms.Model.ViewModels.Activities;
using Marco.Pms.Model.ViewModels.AttendanceVM;

namespace Marco.Pms.Model.Mapper
{
    public static class AttendanceMapper
    {
        public static AttendanceLogVM ToAttendanceLogVMFromAttendanceLog(this AttendanceLog attendanceLog, string preSignedUrl, string thumbPreSignedUrl)
        {
            return new AttendanceLogVM
            {
                Id = attendanceLog.Id,
                Comment = attendanceLog.Comment,
                Employee = attendanceLog.Employee != null ? attendanceLog.Employee.ToBasicEmployeeVMFromEmployee() : new BasicEmployeeVM(),
                ActivityTime = attendanceLog.ActivityTime,
                Activity = attendanceLog.Activity,
                Photo = attendanceLog.Photo,
                Latitude = attendanceLog.Latitude,
                Longitude = attendanceLog.Longitude,
                UpdatedOn = attendanceLog.UpdatedOn,
                UpdatedByEmployee = attendanceLog.UpdatedByEmployee != null ? attendanceLog.UpdatedByEmployee.ToBasicEmployeeVMFromEmployee() : new BasicEmployeeVM(),
                DocumentId = attendanceLog.Document != null ? attendanceLog.Document.Id : null,
                PreSignedUrl = preSignedUrl,
                ThumbPreSignedUrl = thumbPreSignedUrl,
            };
        }
    }
}
