intern project and user fix bug and implementation
This commit is contained in:
+75
-25
@@ -1,21 +1,34 @@
|
||||
// Admin/Mentor Projects
|
||||
// types/project.types.ts
|
||||
|
||||
export type ProjectStatus = "active" | "completed" | "archived";
|
||||
export type MemberStatus = "active" | "inactive";
|
||||
|
||||
export interface ProjectAdmin {
|
||||
id: number;
|
||||
full_name: string;
|
||||
email: string;
|
||||
profile_picture: string;
|
||||
professional_bio: string;
|
||||
profile_picture: string | null;
|
||||
professional_bio: string | null;
|
||||
}
|
||||
|
||||
// Project General
|
||||
export interface ProjectMember {
|
||||
id: number;
|
||||
id_user: number;
|
||||
status?: MemberStatus;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
// Response GET /project-api/get dan GET /project-api/get/{id}
|
||||
export interface Project {
|
||||
id: number;
|
||||
slug: string;
|
||||
project_icon: string;
|
||||
project_name: string;
|
||||
description: string;
|
||||
start_date: string;
|
||||
end_date: string;
|
||||
status: "active" | "inactive" | "completed";
|
||||
status: ProjectStatus;
|
||||
admin: ProjectAdmin;
|
||||
total_members: number;
|
||||
total_tasks: number;
|
||||
@@ -23,31 +36,35 @@ export interface Project {
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
//
|
||||
export interface TaskSubmissionDetails {
|
||||
id: number;
|
||||
file_path: string | null;
|
||||
url_link: string | null;
|
||||
submitted_at: string;
|
||||
updated_at: string;
|
||||
// Detail project (includes members array)
|
||||
export interface ProjectDetail extends Project {
|
||||
members: ProjectMember[];
|
||||
}
|
||||
|
||||
// Task General: ALL TASK COMBINED
|
||||
export interface InternTask {
|
||||
// Response GET /project-api/my-tasks
|
||||
export interface InternTaskItem {
|
||||
id: number;
|
||||
slug: string;
|
||||
id_project: number;
|
||||
project_slug: string;
|
||||
project_name: string;
|
||||
project_icon: string;
|
||||
title: string;
|
||||
description: string;
|
||||
deadline_at: string;
|
||||
submission_type: "url_link" | "file";
|
||||
submission_status: "submitted" | "pending" | "late";
|
||||
submission_details: TaskSubmissionDetails | null;
|
||||
submission_type: "file_upload" | "url_link";
|
||||
submission_status: "pending" | "submitted" | "done" | "overdue";
|
||||
submission_details: {
|
||||
id: number;
|
||||
file_path: string | null;
|
||||
url_link: string | null;
|
||||
submitted_at: string;
|
||||
updated_at: string;
|
||||
} | null;
|
||||
}
|
||||
|
||||
// Intern
|
||||
export interface Intern {
|
||||
// Response GET /project-api/interns
|
||||
export interface InternDetail {
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
@@ -57,14 +74,47 @@ export interface Intern {
|
||||
avatar: string | null;
|
||||
}
|
||||
|
||||
//Project Task
|
||||
export interface ProjectTask {
|
||||
// Payload POST /project-api/add
|
||||
export interface CreateProjectPayload {
|
||||
project_icon: string;
|
||||
project_name: string;
|
||||
description: string;
|
||||
start_date: string; // "YYYY-MM-DD"
|
||||
end_date: string; // "YYYY-MM-DD"
|
||||
member_emails?: string[];
|
||||
}
|
||||
|
||||
// Payload PATCH /project-api/update/{id}
|
||||
export interface UpdateProjectPayload {
|
||||
project_icon?: string;
|
||||
project_name?: string;
|
||||
description?: string;
|
||||
start_date?: string;
|
||||
end_date?: string;
|
||||
status?: ProjectStatus;
|
||||
}
|
||||
|
||||
// Payload POST /project-api/assign-member
|
||||
export interface AssignMemberPayload {
|
||||
id_project: number;
|
||||
id_user: number;
|
||||
}
|
||||
|
||||
// Response assign-member
|
||||
export interface MemberAssignment {
|
||||
id: number;
|
||||
id_project: number;
|
||||
title: string;
|
||||
description: string;
|
||||
deadline_at: string;
|
||||
submission_type: "file_upload" | "url_link";
|
||||
id_user: number;
|
||||
status: MemberStatus;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface ProjectMember {
|
||||
id: number;
|
||||
full_name: string;
|
||||
email: string;
|
||||
professional_bio: string | null;
|
||||
position: string;
|
||||
kelompok_peminatan: string;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
// types/task.types.ts
|
||||
|
||||
export type SubmissionType = "file_upload" | "url_link";
|
||||
export type DisplayStatus = "pending" | "submitted" | "done" | "overdue";
|
||||
|
||||
export interface ProjectTask {
|
||||
id: number;
|
||||
id_project: number;
|
||||
slug: string;
|
||||
title: string;
|
||||
description: string;
|
||||
deadline_at: string;
|
||||
submission_type: SubmissionType;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface TaskSubmissionData {
|
||||
id: number;
|
||||
id_task: number;
|
||||
id_user: number;
|
||||
file_path: string | null;
|
||||
url_link: string | null;
|
||||
submitted_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface ProjectTaskDetail extends ProjectTask {
|
||||
project: {
|
||||
id: number;
|
||||
project_name: string;
|
||||
project_icon: string;
|
||||
};
|
||||
display_status: DisplayStatus;
|
||||
my_submission: TaskSubmissionData | null;
|
||||
}
|
||||
|
||||
export interface AdminTaskDetail extends ProjectTask {
|
||||
project: {
|
||||
id: number;
|
||||
project_name: string;
|
||||
project_icon: string;
|
||||
};
|
||||
submission_summary: {
|
||||
total_members: number;
|
||||
total_submitted: number;
|
||||
total_done: number;
|
||||
total_pending: number;
|
||||
total_overdue: number;
|
||||
};
|
||||
submissions: Array<{
|
||||
id_user: number;
|
||||
full_name: string;
|
||||
file_path: string | null;
|
||||
url_link: string | null;
|
||||
submitted_at: string | null;
|
||||
updated_at: string | null;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface CreateTaskPayload {
|
||||
title: string;
|
||||
description: string;
|
||||
deadline_date: string; // "YYYY-MM-DD"
|
||||
specific_time: string; // "HH:mm"
|
||||
submission_type: SubmissionType;
|
||||
}
|
||||
|
||||
export interface UpdateTaskPayload extends Partial<CreateTaskPayload> {}
|
||||
Reference in New Issue
Block a user