This commit is contained in:
2026-02-03 20:29:55 +08:00
parent d5dde77ee9
commit 9d42a45bb1
18 changed files with 484 additions and 186 deletions

View File

@@ -1,50 +1,39 @@
// Service layer DTOs for auth module
// Service layer DTOs for auth module - User profile operations
// Sign up input/output
export type ServiceInputSignUp = {
email: string;
username: string;
password: string; // plain text, will be hashed by better-auth
password: string;
name: string;
};
export type ServiceOutputSignUp = {
export type ServiceOutputAuth = {
success: boolean;
userId?: string;
email?: string;
username?: string;
};
// Sign in input/output
export type ServiceInputSignIn = {
identifier: string; // email or username
identifier: string;
password: string;
};
export type ServiceOutputSignIn = {
success: boolean;
userId?: string;
email?: string;
username?: string;
sessionToken?: string;
// Get user profile input/output
export type ServiceInputGetUserProfileByUsername = {
username: string;
};
// Sign out input/output
export type ServiceInputSignOut = {
sessionId?: string;
export type ServiceInputGetUserProfileById = {
id: string;
};
export type ServiceOutputSignOut = {
success: boolean;
};
// User existence check
export type ServiceInputCheckUserExists = {
email?: string;
username?: string;
};
export type ServiceOutputCheckUserExists = {
emailExists: boolean;
usernameExists: boolean;
};
export type ServiceOutputUserProfile = {
id: string;
email: string;
emailVerified: boolean;
username: string | null;
displayUsername: string | null;
image: string | null;
createdAt: Date;
updatedAt: Date;
} | null;