import { Serializer } from '../../../../serializers/serializer';
import { DepartmentMemberSC } from '../../../departments/presentation/serializationClasses/departmentMemberSC';
import { UserDAO } from '../../../users/infrastructure/dataAccessObjects/userDAO';
import { UserBasicDataDTO } from '../dtos/userBasicDataDTO';

export class UserBasicDataSC extends Serializer<UserDAO, UserBasicDataDTO> {
    serialize(serializableObject: UserDAO): UserBasicDataDTO {
        return new UserBasicDataDTO(
            serializableObject.id,
            serializableObject.employeeInternalId,
            serializableObject.firstName,
            serializableObject.lastName,
            serializableObject.profilePicture,
            serializableObject.email,
            serializableObject.department ? new DepartmentMemberSC().serialize(serializableObject.department) : null,
        );
    }
}
