ad26a53f21
fix: update project card to reflect actual tasks done from project data feat: enhance task form components to accept project ID for submissions refactor: clean up certificate detail page by removing unused elements chore: streamline certificate generation page by removing unnecessary navigation refactor: update certificate list page to use dynamic project data feat: improve interns management page with API integration and better state handling feat: add modal for assigning interns to projects with project selection feat: create a new component for displaying project cards in certificate list fix: correct import paths in create project dialog component refactor: enhance project hooks to include task filtering and refetch capabilities fix: update mock certificate data to reflect correct status feat: extend certificate types to include new fields for better tracking feat: add task_done field to project types for improved task management
134 lines
2.8 KiB
TypeScript
134 lines
2.8 KiB
TypeScript
// 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 | null;
|
|
professional_bio: string | null;
|
|
}
|
|
|
|
// Response GET /project-api/get dan GET /project-api/get/{id}
|
|
export interface Project {
|
|
id: number;
|
|
slug: string;
|
|
project_icon: string;
|
|
background_color: string;
|
|
project_name: string;
|
|
description: string;
|
|
start_date: string;
|
|
end_date: string;
|
|
status: ProjectStatus;
|
|
admin: ProjectAdmin;
|
|
total_members: number;
|
|
task_done: number;
|
|
total_tasks: number;
|
|
created_at: string;
|
|
updated_at: string;
|
|
}
|
|
|
|
// Detail project (includes members array)
|
|
export interface ProjectDetail extends Project {
|
|
members: ProjectMember[];
|
|
}
|
|
|
|
// 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: "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;
|
|
}
|
|
|
|
// Response GET /project-api/interns
|
|
export interface InternDetail {
|
|
id: number;
|
|
name: string;
|
|
email: string;
|
|
projectName: string;
|
|
role: string;
|
|
isAssignedByMentor: boolean;
|
|
avatar: string | null;
|
|
}
|
|
|
|
// 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;
|
|
id_user: number;
|
|
status: MemberStatus;
|
|
created_at: string;
|
|
updated_at: string;
|
|
}
|
|
|
|
export interface ProjectMember {
|
|
avatar: string
|
|
id: number;
|
|
full_name: string;
|
|
email: string;
|
|
professional_bio: string | null;
|
|
position: string;
|
|
kelompok_peminatan: string;
|
|
}
|
|
|
|
export interface Mahasiswa {
|
|
id: number;
|
|
nama_depan: string;
|
|
nama_belakang: string;
|
|
email: string;
|
|
kontak: string;
|
|
jurusan: string;
|
|
role: string;
|
|
cv_path: string;
|
|
portofolio_path: string;
|
|
motivasi: string;
|
|
relevant_skills: string;
|
|
}
|
|
|
|
export interface MahasiswaResponse {
|
|
message: string;
|
|
data: Mahasiswa[];
|
|
} |