import {ProfileService} from "@/infrastructure/api/ProfileService";
import {Profile} from "@/domain/models/Profile";
import {Experience} from "@/domain/models/Experience";
import {Project} from "@/domain/models/Project";
import {SkillGroup} from "@/domain/models/Skill";
import {Education} from "@/domain/models/Education";
import {Certification} from "@/domain/models/Certification";

export interface ProfileData {
    profile: Profile;
    experience: Experience[];
    projects: Project[];
    skills: SkillGroup[];
    education: Education[];
    certifications: Certification[];
}

export class GetProfile {
    constructor(private readonly profileService: ProfileService) {
    }

    async execute(): Promise<ProfileData> {
        const profile = await this.profileService.getProfile();
        const experience = await this.profileService.getExperience(profile.id);
        const projects = await this.profileService.getProjects(profile.id);
        const skills = await this.profileService.getSkills(profile.id);
        const education = await this.profileService.getEducation(profile.id);
        const certifications = await this.profileService.getCertifications(profile.id);

        return {profile, experience, projects, skills, education, certifications};
    }
}