using Marco.Pms.Model.Dtos.Roles;
using Marco.Pms.Model.Roles;
using Marco.Pms.Model.ViewModels;
using Marco.Pms.Model.ViewModels.Roles;
#nullable disable
namespace Marco.Pms.Model.Mapper
{
    public static class ApplicationRoleMapper
    {
        public static ApplicationRolesVM ToRoleVMFromApplicationRole(this ApplicationRole model)
        {
            return new ApplicationRolesVM
            {
                Id = model.Id,
                Role = model.Role,
                IsSystem = model.IsSystem,
                Description = model.Description,
                //FeaturePermission = model.FeaturePermissions
            };
        }
        public static ApplicationRole ToApplicationRoleFromCreateDto(this CreateApplicationRoleDto model, Guid TenantId)
        {
            return new ApplicationRole
            {
                Id = new Guid(),
                Role = model.Role,
                Description = model.Description,
                TenantId = TenantId,
            };
        }

        public static ApplicationRole ToApplicationRoleFromUpdateDto(this UpdateApplicationRoleDto model, Guid TenantId)
        {
            return new ApplicationRole
            {
                Id = model.Id,
                Role = model.Role,
                Description = model.Description,
                //FeaturePermissions = model.FeaturePermission,
                TenantId = TenantId,
            };
        }

        public static JobRole ToJobRoleFromCreateJobRoleDot(this CreateJobRoleDto model, Guid TenantId)
        {
            return new JobRole
            {

                Name = model.Name,
                Description = model.Description,
                TenantId = TenantId
            };
        }

        public static JobRole ToJobRoleFromUpdateJobRoleDot(this UpdateJobRoleDto model, Guid TenantId)
        {
            return new JobRole
            {
                Id = model.Id,
                Name = model.Name,
                Description = model.Description,
                TenantId = TenantId
            };
        }

        public static JobRoleVM ToJobRoleVMFromJobRole(this JobRole model)
        {
            return new JobRoleVM
            {
                Id = model.Id,
                Name = model.Name,
                Description = model.Description,
            };
        }

    }
}