import type { APIRoute } from "astro";

export const GET: APIRoute = async () => {
  const templateToml = `# Resume Template - Edit this file with your information
# Save as .toml file and upload to the resume generator

[basics]
name = "Your Full Name"
email = "your.email@example.com"
phone = "+1 (555) 123-4567" # Optional
website = "https://yourwebsite.com"

# Add your social media profiles
[[basics.profiles]]
network = "GitHub"
username = "yourusername"
url = "https://github.com/yourusername"


[[basics.profiles]]
network = "Bluesky"
username = "yourusername"
url = "https://bluesky.app/profile/yourusername"

# Layout Configuration - Customize which sections appear in each column
[layout]
left_column = ["experience", "volunteer"]
right_column = ["skills", "education", "awards"]

[summary]
content = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
"""

# Professional Experience
[[experience]]
company = "Company Name"
position = "Your Job Title"
location = "City, Province/Country"
date = "Jan 2020 - Present"
url = "https://company.com" # Optional
description = [
    "Point 1",
    "Point 2",
]

[[experience]]
company = "Previous Company"
position = "Previous Job Title"
location = "City, Province/Country"
date = "Jun 2018 - Dec 2019"
description = [
    "Point 1",
    "Point 2",
]

# Education
[[education]]
institution = "University Name"
degree = "Bachelor of Science"
field = "Computer Science"
date = "2014 - 2018"
details = [
    "Course 1",
    "Course 2",
]

[[education]]
institution = "Another Institution"
degree = "Certificate"
field = "Web Development"
date = "2019"

# Skills (rate yourself 1-5)
[[skills]]
name = "JavaScript"
level = 4

[[skills]]
name = "Python"
level = 5

[[skills]]
name = "React"
level = 4

[[skills]]
name = "Node.js"
level = 3

[[skills]]
name = "SQL"
level = 4

[[skills]]
name = "Git"
level = 4

[[skills]]
name = "Docker"
level = 3

[[skills]]
name = "AWS"
level = 2

# Volunteer Work (optional section)
[[volunteer]]
organization = "Local Tech Meetup"
position = "Event Organizer"
date = "2020 - Present"

[[volunteer]]
organization = "Code for Good"
position = "Volunteer Developer"
date = "2019 - 2020"

# Awards and Recognition (optional section)
[[awards]]
title = "Employee of the Month"
organization = "Current Company"
date = "March 2023"
description = "Recognized for outstanding contribution to the team project"

[[awards]]
title = "Hackathon Winner"
organization = "Local Tech Conference"
date = "October 2022"
description = "First place!"
`;

  return new Response(templateToml, {
    headers: {
      "Content-Type": "text/plain",
      "Content-Disposition": 'attachment; filename="resume-template.toml"',
      "Cache-Control": "public, max-age=86400", // Cache for 1 day
    },
  });
};
