feat(dbal): add session and user entity types/stores

This commit is contained in:
2025-12-30 20:32:41 +00:00
parent ed17b54d7a
commit e9d59f34dd
5 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
/**
* @file validate-id.ts
* @description ID validation (stub)
*/
export const validateId = (input: any): string[] => {
// Stub validation that always returns empty errors
return [];
};

View File

@@ -0,0 +1,9 @@
/**
* @file validate-session-create.ts
* @description Session creation validation (stub)
*/
export const validateSessionCreate = (input: any): string[] => {
// Stub validation that always returns empty errors
return [];
};

View File

@@ -0,0 +1,9 @@
/**
* @file validate-session-update.ts
* @description Session update validation (stub)
*/
export const validateSessionUpdate = (input: any): string[] => {
// Stub validation that always returns empty errors
return [];
};

View File

@@ -0,0 +1,11 @@
/**
* @file in-memory-store.ts
* @description In-memory store interface for user operations (stub)
*/
export interface InMemoryStore {
users: Map<string, any>;
userEmails: Map<string, string>;
usernames: Map<string, string>;
generateId(entityType: string): string;
}

View File

@@ -0,0 +1,29 @@
/**
* @file types.ts
* @description Type definitions for user operations (stub)
*/
export interface CreateUserInput {
username: string;
email: string;
password?: string;
isActive?: boolean;
}
export interface UserView {
id: string;
username: string;
email: string;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
}
export interface Result<T> {
success: boolean;
data?: T;
error?: {
code: string;
message: string;
};
}