"""Seed Griffins Mandanda blog posts for UI / sitemap testing (temporary)."""

from django.core.management.base import BaseCommand

from blog.models import BlogPost


POSTS = [
    {
        'slug': 'understanding-academic-qualifications-and-achievements',
        'title': 'Understanding Academic Qualifications and Achievements',
        'excerpt': (
            'From high school certificates to doctoral degrees — a practical guide to '
            'academic qualifications and how to choose the right path for your career.'
        ),
        'content': """In this write up we will explore some common types of academic qualification awarded by educational institutions upon completion of specific programs of study. We start from the foundation to the pinnacle of education achievement.

High School Certificate (High School Diploma)

The journey begins with the High School Certificate, a qualification earned upon successful completion of secondary education. This foundational qualification opens doors to a variety of opportunities including entry level jobs and serves as a stepping stone for higher education.

Different countries and regions around the world have different names for this qualifications, such as high school diploma, grade 12 Certificate, general education certificate and many more.

Certificate Programs

Certificate programs are laser-focused, offering targeted training in various areas like IT, healthcare, hospitality, business and more. These programs usually last for a few months to a year, equipping you with practical skills that are directly applicable to the industry.

Diploma Programs

Diploma programs are slightly more comprehensive, often spanning one to three years. It should also be noted that there are certain Institutions that offer diploma programs for 6 months to a year.

Diploma programs provide a deeper understanding of a subject, making them an excellent choice for individuals who want a well-rounded education in a shorter time frame.

Associate's Degree

This is typically a two-year degree obtained from a community college or technical school. It's often pursued to gain practical skills for a specific job or as a stepping stone to a bachelor's degree. The length and curriculum for this qualification can differ from country to country.

You may be asking yourself, what is then the difference between a diploma and an associate degree. Well an associate degree offers a more comprehensive education, with broader career prospects and the potential for further education, while a diploma is more focused and specific, concentrating primarily on the skills and knowledge relevant to a particular industry or profession.

Honorary Degrees

These are awarded to individuals for their significant contributions to society, without requiring formal coursework. They are typically given by universities as a recognition of achievement.

Bachelor's Degree

The Bachelor's Degree is the cornerstone of higher education, typically requiring four years of study at colleges or universities. With courses spanning arts, sciences, business, and more, this degree primes you for a range of professions and lays the foundation for further academic pursuits.

Professional Degrees

These are specialized degrees required for specific professions. Examples include Doctor of Medicine (M.D.) for physicians and Juris Doctor (J.D.) for lawyers. They typically involve further study beyond a bachelor's degree.

Master's Degree

This is a graduate-level degree obtained after a bachelor's degree.

Master's Degree qualification deepens your expertise in a specific field and usually takes one to two years to complete. It is a good qualification for people seeking specialization and enhanced career prospects.

Doctoral Degree (Ph.D.)

This is the highest level of academic achievement. It typically involves several years of research and the completion of a dissertation. Doctoral degrees are often pursued by those aiming for careers in academia or specialized research.

Earning a Ph.D. can lead to prestigious roles in research, academia and thought leadership.

Continuing Education Programs

These are short-term courses, trainings and workshops aimed at professionals looking to enhance their skills or stay current in their field.

These programs can be days, weeks to months long. Examples include training in emotional intelligence, leadership, communication, strategic management etc.

It is important to mention that the length of academic qualifications can vary according to University, country and regions. For instance you will find bachelor's degree programs varying in length, ranging from 3 to 5 years.

When it comes to choosing an academic qualification to pursue, consider your interests, career goals, the time and resources you are willing to invest and the relevance on the market.

Follow Peza Job Zambia for more insightful information.

#PezaJobZambia #CareerDevelopment""",
        'category': 'Career Development',
        'author_name': 'Griffins Mandanda',
        'author_role': 'Founder & Lead Career Coach, Peza Job Zambia',
        'cover_image_url': 'https://images.unsplash.com/photo-1523240795612-9a054b0db644?w=1200&q=80',
        'read_minutes': 8,
        'is_featured': True,
    },
    {
        'slug': 'how-to-write-a-cv-that-gets-interviews-in-zambia',
        'title': 'How to Write a CV That Gets You Interviews in Zambia',
        'excerpt': (
            'Practical CV tips for Zambian job seekers — format, achievements, keywords, '
            'and the mistakes recruiters see most often.'
        ),
        'content': """Your CV is often the first impression you make on a recruiter. In Zambia's competitive job market, a generic document will not get you to the interview stage. Here is how to build a CV that stands out.

Start with a clear professional summary

Open with three to four lines that state who you are, your core skills, and the value you bring. Avoid vague phrases like "hard-working team player." Instead, be specific: "Accounts professional with five years of experience in payroll, tax compliance, and financial reporting for mid-size firms in Lusaka."

Tailor every application

One CV for every job is a common mistake. Read the job description carefully and mirror relevant keywords — skills, tools, and qualifications the employer mentions. You do not need to rewrite everything, but your summary and key achievements should align with each role.

Quantify your achievements

Recruiters scan for results. Replace duties with outcomes:

• "Processed invoices" → "Processed 200+ invoices monthly with 99% accuracy."
• "Managed a team" → "Led a team of 8, improving delivery times by 25% in six months."

Numbers, percentages, and timeframes make your impact tangible.

Keep format clean and scannable

Use clear headings: Profile, Experience, Education, Skills, Certifications. Stick to one or two pages unless you are applying for senior executive roles. Use consistent fonts, bullet points, and dates (month/year). Save and send as PDF unless the employer asks otherwise.

Include the essentials recruiters expect

• Full name and professional contact details (phone, email, LinkedIn if you have one).
• Relevant work history in reverse chronological order.
• Education and professional certifications.
• Skills that match the role — both technical and soft skills where relevant.

Proofread before you send

Spelling and grammar errors signal carelessness. Read your CV aloud, use spell-check, and ask someone you trust to review it. At Peza Job Zambia, we see strong candidates overlooked simply because of avoidable CV errors.

Your CV should open doors — not close them. Invest time in getting it right, and update it every time you gain new skills or achievements.

Follow Peza Job Zambia for more career insights.

#PezaJobZambia #CVWriting #JobSearch""",
        'category': 'Career Tips',
        'author_name': 'Griffins Mandanda',
        'author_role': 'Founder & Lead Career Coach, Peza Job Zambia',
        'cover_image_url': 'https://images.unsplash.com/photo-1586281380347-632531db7ed4?w=1200&q=80',
        'read_minutes': 6,
        'is_featured': False,
    },
    {
        'slug': 'ace-your-next-job-interview-in-zambia',
        'title': 'Ace Your Next Job Interview in Zambia',
        'excerpt': (
            'Prepare for common interview questions, communicate your value clearly, '
            'and leave a lasting impression with these proven strategies.'
        ),
        'content': """A strong CV gets you in the room. The interview decides whether you get the job. Here is how to prepare and perform with confidence.

Research the company and role

Before any interview, study the organisation — its products, services, culture, and recent news. Understand the job description and how your experience maps to it. Employers notice candidates who show genuine interest and preparation.

Prepare your stories using the STAR method

Most interviews use behavioural questions: "Tell us about a time when…" Structure your answers with Situation, Task, Action, and Result. Prepare five to seven stories covering teamwork, problem-solving, leadership, conflict, and achievement.

Common questions to rehearse

• Tell us about yourself (keep it professional, 60–90 seconds).
• Why do you want this job?
• What are your strengths and weaknesses?
• Describe a challenge you overcame at work.
• Where do you see yourself in three to five years?
• What are your salary expectations?

Practice out loud — not just in your head.

Communicate the value you bring

Interviewers are asking: "Why should we hire you?" Connect your skills and past results to their needs. Be concise, confident, and honest. If you lack a specific skill, show willingness to learn and related experience that transfers.

Ask smart questions

Interviews are two-way. Prepare questions about team structure, success in the first 90 days, growth opportunities, and company culture. Thoughtful questions show you are serious about the role.

Mind the details

Arrive early (or join virtual calls five minutes ahead). Dress appropriately. Bring copies of your CV and any requested documents. Follow up with a brief thank-you message within 24 hours.

At Peza Job Zambia, interview coaching helps candidates refine answers, manage nerves, and present their best selves. Preparation is the difference between hoping for an offer and earning one.

Follow Peza Job Zambia for more interview and career tips.

#PezaJobZambia #InterviewTips #CareerDevelopment""",
        'category': 'Interview Prep',
        'author_name': 'Griffins Mandanda',
        'author_role': 'Founder & Lead Career Coach, Peza Job Zambia',
        'cover_image_url': 'https://images.unsplash.com/photo-1573497019940-1c28c88b4f3e?w=1200&q=80',
        'read_minutes': 7,
        'is_featured': False,
    },
    {
        'slug': 'how-to-choose-the-right-course-for-your-career',
        'title': 'How to Choose the Right Course for Your Career',
        'excerpt': (
            'Align your education with market demand, your strengths, and long-term goals — '
            'a guide to smarter course and program selection.'
        ),
        'content': """Choosing the wrong course costs time, money, and momentum. Whether you are a school leaver, a professional upskilling, or someone changing careers, the right program should connect your strengths to real opportunities in the market.

Start with career clarity

Before picking a course, ask: What work do I enjoy? What am I naturally good at? What lifestyle and income do I want? Course selection coaching helps you answer these questions before you commit to years of study.

Research market demand

Some fields grow while others shrink. Look at job postings in Zambia and beyond — which roles appear repeatedly? Which skills do employers list as requirements? Talk to people already working in fields that interest you.

Match qualifications to your goal

• Entry-level roles may need certificates or diplomas.
• Professional careers often require degrees or professional certifications.
• Senior specialisation may call for master's programs or industry credentials.

Do not over-qualify or under-qualify for the path you want. Understand what employers in your target field actually expect.

Consider time, cost, and institution quality

Compare program length, fees, accreditation, and graduate outcomes. A shorter, focused certificate may open doors faster than a long program that drifts from your goal. Verify that the institution is recognised and that the curriculum is current.

Balance passion with practicality

Ideally, your course aligns with both interest and employability. If you love a field with limited local jobs, plan how you will create opportunity — entrepreneurship, remote work, or complementary skills that broaden your options.

Seek guidance before you enrol

Speak to career advisors, mentors, and professionals in the field. At Peza Job Zambia, course selection coaching helps individuals choose programs aligned with their values, strengths, and market relevance — saving costly wrong turns.

The right course is an investment, not a gamble. Choose with intention.

Follow Peza Job Zambia for more education and career guidance.

#PezaJobZambia #CareerDevelopment #Education""",
        'category': 'Career Development',
        'author_name': 'Griffins Mandanda',
        'author_role': 'Founder & Lead Career Coach, Peza Job Zambia',
        'cover_image_url': 'https://images.unsplash.com/photo-1434030216411-0b793f4b4173?w=1200&q=80',
        'read_minutes': 6,
        'is_featured': False,
    },
    {
        'slug': 'smart-job-search-strategies-for-zambian-professionals',
        'title': 'Smart Job Search Strategies for Zambian Professionals',
        'excerpt': (
            'Where to look, how to apply, and how to network effectively — a practical job '
            'search playbook for today\'s Zambian workforce.'
        ),
        'content': """Applying randomly and waiting for callbacks rarely works. A smart job search is focused, consistent, and multi-channel. Here is how Zambian professionals can search with purpose.

Use multiple platforms — not just one

Register on PEZAJOB, monitor company career pages, and stay active on professional networks. Different employers use different channels. The wider your reach, the more opportunities you uncover.

Set a weekly search routine

Treat job searching like a project. Allocate fixed hours each week for browsing listings, tailoring applications, networking, and follow-ups. Track what you applied for and when. Consistency beats sporadic bursts of effort.

Target quality over quantity

Ten tailored applications outperform fifty generic ones. Match your CV and cover letter to each role. Reference the company name, role title, and specific requirements. Recruiters recognise copy-paste applications immediately.

Leverage your network

Inform mentors, former colleagues, and industry contacts that you are looking. Ask for introductions, not just favours. Attend career fairs, webinars, and professional association events. Relationships often unlock opportunities that never get advertised.

Optimise your online presence

Employers search candidates online. Ensure your PEZAJOB profile is complete, your LinkedIn is professional, and your public information reflects the image you want.

Stay resilient

Rejection is part of the process — not a verdict on your worth. Learn from each experience, refine your approach, and keep moving.

Follow Peza Job Zambia for job opportunities and career resources.

#PezaJobZambia #JobSearch #CareerTips""",
        'category': 'Job Search',
        'author_name': 'Griffins Mandanda',
        'author_role': 'Founder & Lead Career Coach, Peza Job Zambia',
        'cover_image_url': 'https://images.unsplash.com/photo-1454165804603-c3d57bc86b40?w=1200&q=80',
        'read_minutes': 6,
        'is_featured': False,
    },
]


class Command(BaseCommand):
    help = 'Seed test blog posts by Griffins Mandanda (temporary — for homepage / sitemap testing)'

    def add_arguments(self, parser):
        parser.add_argument(
            '--only',
            action='store_true',
            help='Delete all other blog posts and keep only these test articles',
        )

    def handle(self, *args, **options):
        slugs = [p['slug'] for p in POSTS]
        if options['only']:
            removed, _ = BlogPost.objects.exclude(slug__in=slugs).delete()
            if removed:
                self.stdout.write(f'Removed {removed} other blog post(s).')

        for data in POSTS:
            BlogPost.objects.update_or_create(
                slug=data['slug'],
                defaults={**data, 'is_published': True},
            )

        self.stdout.write(self.style.SUCCESS(f'Seeded {len(POSTS)} test blog posts: {", ".join(slugs)}'))
