import {
ServiceApiContract,
ServiceDependencies,
} from "@ethicdevs/react-monolith";
import { FastifyRequest } from "fastify";
import { User } from "@prisma/client";
import type { CryptoServiceAPI } from "../crypto/types";
export interface AuthServiceCreateUserDTO {
emailAddress: string;
username: string;
password: string;
}
export interface AuthServiceAPI extends ServiceApiContract {
createUser(dto: AuthServiceCreateUserDTO): Promise<User>;
isExistingUsername(username: string): Promise<boolean>;
isExistingEmailAddress(emailAddress: string): Promise<boolean>;
isExistingUserUid(userUid: string): boolean;
findUserByUsername(username: string): void;
findUserByUid(userUid: string): void;
sendUserEmailAddressV8nEmail(args: unknown[]): void;
validateUserEmailAddress(
userUid: string,
emailAddress: string
): Promise<void>;
}
export interface AuthServiceDeps extends ServiceDependencies {
cryptoService: CryptoServiceAPI;
request: FastifyRequest;
}