2024-04-19 06:47:29 -04:00
|
|
|
import { SessionEntity } from 'src/entities/session.entity';
|
|
|
|
|
|
|
|
|
|
export const ISessionRepository = 'ISessionRepository';
|
|
|
|
|
|
2024-04-20 23:45:55 -04:00
|
|
|
type E = SessionEntity;
|
|
|
|
|
|
2024-04-19 06:47:29 -04:00
|
|
|
export interface ISessionRepository {
|
2024-04-20 23:45:55 -04:00
|
|
|
create<T extends Partial<E>>(dto: T): Promise<T>;
|
|
|
|
|
update<T extends Partial<E>>(dto: T): Promise<T>;
|
2024-04-19 06:47:29 -04:00
|
|
|
delete(id: string): Promise<void>;
|
2024-04-20 23:45:55 -04:00
|
|
|
getByToken(token: string): Promise<E | null>;
|
|
|
|
|
getByUserId(userId: string): Promise<E[]>;
|
2024-04-19 06:47:29 -04:00
|
|
|
}
|