Implement API endpoints and frontend components for creating and managing timesheets, projects, and dashboard functionalities. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 55837015-10e9-4be9-b857-7f5e6be73772 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: e5763354-5d83-482b-a89e-394e3eb5a41e Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1cc377db-7ea0-49f2-97ce-c3e87e0228cc/55837015-10e9-4be9-b857-7f5e6be73772/JpyvMwJ Replit-Helium-Checkpoint-Created: true
196 lines
3.7 KiB
TypeScript
196 lines
3.7 KiB
TypeScript
/**
|
|
* Generated by orval v8.5.3 🍺
|
|
* Do not edit manually.
|
|
* Api
|
|
* CRA (Compte Rendu d'Activité) API
|
|
* OpenAPI spec version: 0.1.0
|
|
*/
|
|
export interface HealthStatus {
|
|
status: string;
|
|
}
|
|
|
|
export interface Project {
|
|
id: number;
|
|
code: string;
|
|
name: string;
|
|
/** @nullable */
|
|
parentProjectId?: number | null;
|
|
/** @nullable */
|
|
client?: string | null;
|
|
/** @nullable */
|
|
category?: string | null;
|
|
isActive: boolean;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface CreateProjectBody {
|
|
code: string;
|
|
name: string;
|
|
/** @nullable */
|
|
parentProjectId?: number | null;
|
|
/** @nullable */
|
|
client?: string | null;
|
|
/** @nullable */
|
|
category?: string | null;
|
|
}
|
|
|
|
export interface UpdateProjectBody {
|
|
code?: string;
|
|
name?: string;
|
|
/** @nullable */
|
|
parentProjectId?: number | null;
|
|
/** @nullable */
|
|
client?: string | null;
|
|
/** @nullable */
|
|
category?: string | null;
|
|
isActive?: boolean;
|
|
}
|
|
|
|
export type TimesheetStatus =
|
|
(typeof TimesheetStatus)[keyof typeof TimesheetStatus];
|
|
|
|
export const TimesheetStatus = {
|
|
draft: "draft",
|
|
submitted: "submitted",
|
|
validated: "validated",
|
|
} as const;
|
|
|
|
export interface Timesheet {
|
|
id: number;
|
|
year: number;
|
|
month: number;
|
|
status: TimesheetStatus;
|
|
collaborator: string;
|
|
totalHours: number;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface CreateTimesheetBody {
|
|
year: number;
|
|
month: number;
|
|
collaborator: string;
|
|
}
|
|
|
|
export type UpdateTimesheetBodyStatus =
|
|
(typeof UpdateTimesheetBodyStatus)[keyof typeof UpdateTimesheetBodyStatus];
|
|
|
|
export const UpdateTimesheetBodyStatus = {
|
|
draft: "draft",
|
|
submitted: "submitted",
|
|
validated: "validated",
|
|
} as const;
|
|
|
|
export interface UpdateTimesheetBody {
|
|
status?: UpdateTimesheetBodyStatus;
|
|
collaborator?: string;
|
|
}
|
|
|
|
export type TimesheetDetailStatus =
|
|
(typeof TimesheetDetailStatus)[keyof typeof TimesheetDetailStatus];
|
|
|
|
export const TimesheetDetailStatus = {
|
|
draft: "draft",
|
|
submitted: "submitted",
|
|
validated: "validated",
|
|
} as const;
|
|
|
|
export interface TimeEntry {
|
|
id: number;
|
|
timesheetLineId: number;
|
|
date: string;
|
|
hours: number;
|
|
}
|
|
|
|
export interface TimesheetLineWithEntries {
|
|
id: number;
|
|
timesheetId: number;
|
|
projectId: number;
|
|
projectCode: string;
|
|
projectName: string;
|
|
/** @nullable */
|
|
client?: string | null;
|
|
/** @nullable */
|
|
category?: string | null;
|
|
totalHours: number;
|
|
entries: TimeEntry[];
|
|
}
|
|
|
|
export interface TimesheetDetail {
|
|
id: number;
|
|
year: number;
|
|
month: number;
|
|
status: TimesheetDetailStatus;
|
|
collaborator: string;
|
|
totalHours: number;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
lines: TimesheetLineWithEntries[];
|
|
}
|
|
|
|
export interface TimesheetLine {
|
|
id: number;
|
|
timesheetId: number;
|
|
projectId: number;
|
|
projectCode: string;
|
|
projectName: string;
|
|
/** @nullable */
|
|
client?: string | null;
|
|
/** @nullable */
|
|
category?: string | null;
|
|
totalHours: number;
|
|
}
|
|
|
|
export interface CreateTimesheetLineBody {
|
|
projectId: number;
|
|
}
|
|
|
|
export type UpsertTimeEntriesBodyEntriesItem = {
|
|
timesheetLineId: number;
|
|
date: string;
|
|
hours: number;
|
|
};
|
|
|
|
export interface UpsertTimeEntriesBody {
|
|
entries: UpsertTimeEntriesBodyEntriesItem[];
|
|
}
|
|
|
|
export interface DashboardSummary {
|
|
totalHoursThisMonth: number;
|
|
totalHoursThisYear: number;
|
|
activeProjects: number;
|
|
pendingTimesheets: number;
|
|
validatedTimesheets: number;
|
|
}
|
|
|
|
export interface MonthlyHours {
|
|
month: number;
|
|
totalHours: number;
|
|
label: string;
|
|
}
|
|
|
|
export interface ProjectHours {
|
|
projectId: number;
|
|
projectCode: string;
|
|
projectName: string;
|
|
totalHours: number;
|
|
}
|
|
|
|
export type ListTimesheetsParams = {
|
|
year?: number;
|
|
month?: number;
|
|
};
|
|
|
|
export type GetDashboardSummaryParams = {
|
|
year?: number;
|
|
};
|
|
|
|
export type GetMonthlyHoursParams = {
|
|
year?: number;
|
|
};
|
|
|
|
export type GetProjectHoursParams = {
|
|
year?: number;
|
|
month?: number;
|
|
};
|