creates application
This commit is contained in:
70
backend/src/types/index.ts
Normal file
70
backend/src/types/index.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import { Request } from 'express';
|
||||
|
||||
export interface AuthenticatedUser {
|
||||
id: string;
|
||||
username: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
export interface AuthenticatedRequest extends Request {
|
||||
user?: AuthenticatedUser;
|
||||
}
|
||||
|
||||
export interface CreateClientInput {
|
||||
name: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface UpdateClientInput {
|
||||
name?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface CreateProjectInput {
|
||||
name: string;
|
||||
description?: string;
|
||||
color?: string;
|
||||
clientId: string;
|
||||
}
|
||||
|
||||
export interface UpdateProjectInput {
|
||||
name?: string;
|
||||
description?: string;
|
||||
color?: string;
|
||||
clientId?: string;
|
||||
}
|
||||
|
||||
export interface CreateTimeEntryInput {
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
description?: string;
|
||||
projectId: string;
|
||||
}
|
||||
|
||||
export interface UpdateTimeEntryInput {
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
description?: string;
|
||||
projectId?: string;
|
||||
}
|
||||
|
||||
export interface TimeEntryFilters {
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
projectId?: string;
|
||||
clientId?: string;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface StartTimerInput {
|
||||
projectId?: string;
|
||||
}
|
||||
|
||||
export interface UpdateTimerInput {
|
||||
projectId?: string | null;
|
||||
}
|
||||
|
||||
export interface StopTimerInput {
|
||||
projectId?: string;
|
||||
}
|
||||
10
backend/src/types/session.d.ts
vendored
Normal file
10
backend/src/types/session.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'express-session';
|
||||
import type { AuthenticatedUser } from './index';
|
||||
import type { AuthSession } from '../auth/oidc';
|
||||
|
||||
declare module 'express-session' {
|
||||
interface SessionData {
|
||||
user?: AuthenticatedUser;
|
||||
oidc?: AuthSession;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user