package mapper

import (
	"netidhub-saas-be/app/database/entity"
	res "netidhub-saas-be/app/module/user_role_accesses/response"
)

func UserRoleAccessesResponseMapper(userRoleAccessesReq *entity.UserRoleAccesses) (userRoleAccessesRes *res.UserRoleAccessesResponse) {
	if userRoleAccessesReq != nil {
		userRoleAccessesRes = &res.UserRoleAccessesResponse{
			ID:                userRoleAccessesReq.ID,
			UserRoleId:        userRoleAccessesReq.UserRoleId,
			MenuId:            userRoleAccessesReq.MenuId,
			IsViewEnabled:     userRoleAccessesReq.IsViewEnabled,
			IsInsertEnabled:   userRoleAccessesReq.IsInsertEnabled,
			IsUpdateEnabled:   userRoleAccessesReq.IsUpdateEnabled,
			IsDeleteEnabled:   userRoleAccessesReq.IsDeleteEnabled,
			IsApprovalEnabled: userRoleAccessesReq.IsApprovalEnabled,
			IsAdminEnabled:    userRoleAccessesReq.IsAdminEnabled,
			IsActive:          userRoleAccessesReq.IsActive,
			CreatedAt:         userRoleAccessesReq.CreatedAt,
			UpdatedAt:         userRoleAccessesReq.UpdatedAt,
		}
	}
	return userRoleAccessesRes
}
