mirror of
https://github.com/mmahdium/portfolio.git
synced 2026-08-16 21:14:31 +03:30
feat(epic-1): complete resume data foundation - types, data, and composable
Epic 1: Resume Data & Types - All Stories Complete Story 1.1: Create Resume TypeScript Interfaces ✅ - Add Resume, ResumeBasics, WorkExperience, Education, Skill, Language, Certification interfaces - File: app/types/resume.ts - All interfaces exported with proper TypeScript types - Date fields use YYYY-MM string format Story 1.2: Create Sample Resume Data File ✅ - Add sample resume data with Ali Arghyani profile - File: app/data/resume.en.ts - Includes: basics, work (2), education (1), skills (2), languages (2) - Data independent from portfolio data Story 1.3: Create Resume Data Composable ✅ - Add useResumeData composable for reactive data access - File: app/composables/useResumeData.ts - Exports: resume ref, formatDate(), getFullName(), getPdfFilename() - Proper JSDoc documentation Files Added: - app/types/resume.ts - app/data/resume.en.ts - app/composables/useResumeData.ts - docs/sprint-artifacts/1-1-create-resume-typescript-interfaces.md - docs/sprint-artifacts/1-1-create-resume-typescript-interfaces.context.xml - docs/sprint-artifacts/1-2-create-sample-resume-data-file.md - docs/sprint-artifacts/1-2-create-sample-resume-data-file.context.xml - docs/sprint-artifacts/1-3-create-resume-data-composable.md - docs/sprint-artifacts/1-3-create-resume-data-composable.context.xml Files Modified: - docs/sprint-artifacts/sprint-status.yaml (stories 1.1-1.3: backlog → done) All stories reviewed and approved. Epic 1 complete - data foundation ready for Epic 2 (Resume Preview Page).
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Resume Data Composable
|
||||
* Provides reactive access to resume data and helper functions
|
||||
*/
|
||||
|
||||
import { computed } from 'vue'
|
||||
import { resumeData } from '~/data/resume.en'
|
||||
|
||||
export function useResumeData() {
|
||||
// Reactive reference to resume data
|
||||
const resume = computed(() => resumeData)
|
||||
|
||||
/**
|
||||
* Format YYYY-MM date string to readable format
|
||||
* @param date - Date string in YYYY-MM format (e.g., "2023-01")
|
||||
* @param locale - Locale for formatting (default: 'en')
|
||||
* @returns Formatted date string (e.g., "Jan 2023")
|
||||
*/
|
||||
function formatDate(date: string, locale: string = 'en'): string {
|
||||
if (!date) return ''
|
||||
|
||||
const [year, month] = date.split('-')
|
||||
const dateObj = new Date(Number(year), Number(month) - 1)
|
||||
|
||||
const monthName = dateObj.toLocaleDateString(locale, { month: 'short' })
|
||||
return `${monthName} ${year}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Get full name from resume data
|
||||
* @returns Full name
|
||||
*/
|
||||
function getFullName(): string {
|
||||
return resumeData.basics.name
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate PDF filename from resume data
|
||||
* @returns Filename in format "FirstName_LastName_Resume.pdf"
|
||||
*/
|
||||
function getPdfFilename(): string {
|
||||
const name = resumeData.basics.name
|
||||
const filename = name.replace(/\s+/g, '_')
|
||||
return `${filename}_Resume.pdf`
|
||||
}
|
||||
|
||||
return {
|
||||
resume,
|
||||
formatDate,
|
||||
getFullName,
|
||||
getPdfFilename,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user