2025-04-09 10:24:38 -04:00
|
|
|
import { Session } from 'src/database';
|
2024-04-19 06:47:29 -04:00
|
|
|
|
|
|
|
|
export class SessionResponseDto {
|
|
|
|
|
id!: string;
|
|
|
|
|
createdAt!: string;
|
|
|
|
|
updatedAt!: string;
|
|
|
|
|
current!: boolean;
|
|
|
|
|
deviceType!: string;
|
|
|
|
|
deviceOS!: string;
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-09 10:24:38 -04:00
|
|
|
export const mapSession = (entity: Session, currentId?: string): SessionResponseDto => ({
|
2024-04-19 06:47:29 -04:00
|
|
|
id: entity.id,
|
|
|
|
|
createdAt: entity.createdAt.toISOString(),
|
|
|
|
|
updatedAt: entity.updatedAt.toISOString(),
|
|
|
|
|
current: currentId === entity.id,
|
|
|
|
|
deviceOS: entity.deviceOS,
|
|
|
|
|
deviceType: entity.deviceType,
|
|
|
|
|
});
|