Loading mobile/src/auth/domain/datasources/auth_datasource.ts +2 −0 Original line number Diff line number Diff line Loading @@ -5,4 +5,6 @@ import { UserInfoEntity } from "../entities/user_info_entity"; export interface AuthDataSource { login: (email: string, password: string) => Promise<LoginInfoEntity>; register: (user: RegisterInfoEntity) => Promise<LoginInfoEntity>; getResetCode: (email: string) => Promise<void>; resetPassword: (code: string) => Promise<void>; } No newline at end of file mobile/src/auth/domain/repositories/auth_repository.ts +2 −0 Original line number Diff line number Diff line Loading @@ -5,4 +5,6 @@ import { UserInfoEntity } from '../entities/user_info_entity'; export interface AuthRepository { login: (email: string, password: string) => Promise<LoginInfoEntity>; register: (user: RegisterInfoEntity) => Promise<LoginInfoEntity>; getResetCode: (email: string) => Promise<void>; resetPassword: (code: string) => Promise<void>; } No newline at end of file mobile/src/auth/infrastructure/dev/datasources/auth_datasource.ts +6 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,12 @@ import { LoginInfoEntity } from '../../../domain/entities/login_info_entity'; import { RegisterInfoEntity } from '../../../domain/entities/register_info'; import { UserInfoEntity } from '../../../domain/entities/user_info_entity'; export class AuthDataSourceDev implements AuthDataSource { getResetCode (email: string): Promise<void>{ throw new Error("Method not implemented."); } resetPassword (code: string): Promise<void> { throw new Error("Method not implemented."); } async login(email: string, password: string): Promise<LoginInfoEntity>{ await delay(1000); return new Promise((resolve) => { Loading mobile/src/auth/infrastructure/prod/datasources/auth_datasource.ts +6 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,12 @@ import { UserInfoEntity } from "../../../domain/entities/user_info_entity"; import { RegisterResponseModel } from "../models/register_user_model"; export class AuthDatasourceProd implements AuthDataSource { getResetCode (email: string): Promise<void> { throw new Error("Method not implemented."); } resetPassword (code: string): Promise<void> { throw new Error("Method not implemented."); } login: (email: string, password: string) => Promise<LoginInfoEntity> = async (email, password) => { const loginInfo: LoginUserModel = { email, Loading mobile/src/auth/infrastructure/prod/repositories/auth_repository.ts +6 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,12 @@ import { AuthRepository } from '../../../domain/repositories/auth_repository'; export class AuthRepositoryImpl implements AuthRepository { constructor(private authDataSource: AuthDataSource) { } getResetCode (email: string) { return this.authDataSource.getResetCode(email); } resetPassword (code: string) { return this.authDataSource.resetPassword(code); } async login(email: string, password: string) { return await this.authDataSource.login(email, password); } Loading Loading
mobile/src/auth/domain/datasources/auth_datasource.ts +2 −0 Original line number Diff line number Diff line Loading @@ -5,4 +5,6 @@ import { UserInfoEntity } from "../entities/user_info_entity"; export interface AuthDataSource { login: (email: string, password: string) => Promise<LoginInfoEntity>; register: (user: RegisterInfoEntity) => Promise<LoginInfoEntity>; getResetCode: (email: string) => Promise<void>; resetPassword: (code: string) => Promise<void>; } No newline at end of file
mobile/src/auth/domain/repositories/auth_repository.ts +2 −0 Original line number Diff line number Diff line Loading @@ -5,4 +5,6 @@ import { UserInfoEntity } from '../entities/user_info_entity'; export interface AuthRepository { login: (email: string, password: string) => Promise<LoginInfoEntity>; register: (user: RegisterInfoEntity) => Promise<LoginInfoEntity>; getResetCode: (email: string) => Promise<void>; resetPassword: (code: string) => Promise<void>; } No newline at end of file
mobile/src/auth/infrastructure/dev/datasources/auth_datasource.ts +6 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,12 @@ import { LoginInfoEntity } from '../../../domain/entities/login_info_entity'; import { RegisterInfoEntity } from '../../../domain/entities/register_info'; import { UserInfoEntity } from '../../../domain/entities/user_info_entity'; export class AuthDataSourceDev implements AuthDataSource { getResetCode (email: string): Promise<void>{ throw new Error("Method not implemented."); } resetPassword (code: string): Promise<void> { throw new Error("Method not implemented."); } async login(email: string, password: string): Promise<LoginInfoEntity>{ await delay(1000); return new Promise((resolve) => { Loading
mobile/src/auth/infrastructure/prod/datasources/auth_datasource.ts +6 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,12 @@ import { UserInfoEntity } from "../../../domain/entities/user_info_entity"; import { RegisterResponseModel } from "../models/register_user_model"; export class AuthDatasourceProd implements AuthDataSource { getResetCode (email: string): Promise<void> { throw new Error("Method not implemented."); } resetPassword (code: string): Promise<void> { throw new Error("Method not implemented."); } login: (email: string, password: string) => Promise<LoginInfoEntity> = async (email, password) => { const loginInfo: LoginUserModel = { email, Loading
mobile/src/auth/infrastructure/prod/repositories/auth_repository.ts +6 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,12 @@ import { AuthRepository } from '../../../domain/repositories/auth_repository'; export class AuthRepositoryImpl implements AuthRepository { constructor(private authDataSource: AuthDataSource) { } getResetCode (email: string) { return this.authDataSource.getResetCode(email); } resetPassword (code: string) { return this.authDataSource.resetPassword(code); } async login(email: string, password: string) { return await this.authDataSource.login(email, password); } Loading