<?php

namespace App\Controllers;

/**
 * PagesController - Serves view pages
 * 
 * This controller only returns views. No business logic.
 * All data is fetched via API calls from the frontend.
 */
class PagesController extends BaseController
{
    /**
     * Dashboard page
     */
    public function dashboard()
    {
        return view('v2/dashboard/dashboard_index', [
            'pageTitle' => 'Dashboard',
            'activePage' => 'dashboard'
        ]);
    }

    /**
     * Patients page
     */
    public function patients()
    {
        return view('v2/patients/patients_index', [
            'pageTitle' => 'Patients',
            'activePage' => 'patients'
        ]);
    }

    /**
     * Lab Requests page
     */
    public function requests()
    {
        return view('v2/requests/requests_index', [
            'pageTitle' => 'Lab Requests',
            'activePage' => 'requests'
        ]);
    }

    /**
     * Settings page
     */
    public function settings()
    {
        return view('v2/settings/settings_index', [
            'pageTitle' => 'Settings',
            'activePage' => 'settings'
        ]);
    }

    // ========================================
    // Master Data - Organization
    // ========================================
    
    /**
     * Master Data - Organization Accounts
     */
    public function masterOrgAccounts()
    {
        return view('v2/master/organization/accounts_index', [
            'pageTitle' => 'Organization Accounts',
            'activePage' => 'master-org-accounts'
        ]);
    }

    /**
     * Master Data - Organization Sites
     */
    public function masterOrgSites()
    {
        return view('v2/master/organization/sites_index', [
            'pageTitle' => 'Organization Sites',
            'activePage' => 'master-org-sites'
        ]);
    }

    /**
     * Master Data - Organization Disciplines
     */
    public function masterOrgDisciplines()
    {
        return view('v2/master/organization/disciplines_index', [
            'pageTitle' => 'Disciplines',
            'activePage' => 'master-org-disciplines'
        ]);
    }

    /**
     * Master Data - Organization Departments
     */
    public function masterOrgDepartments()
    {
        return view('v2/master/organization/departments_index', [
            'pageTitle' => 'Departments',
            'activePage' => 'master-org-departments'
        ]);
    }

    /**
     * Master Data - Organization Workstations
     */
    public function masterOrgWorkstations()
    {
        return view('v2/master/organization/workstations_index', [
            'pageTitle' => 'Workstations',
            'activePage' => 'master-org-workstations'
        ]);
    }

    // ========================================
    // Master Data - Specimen
    // ========================================

    /**
     * Master Data - Specimen Containers
     */
    public function masterSpecimenContainers()
    {
        return view('v2/master/specimen/containers_index', [
            'pageTitle' => 'Container Definitions',
            'activePage' => 'master-specimen-containers'
        ]);
    }

    /**
     * Master Data - Specimen Preparations
     */
    public function masterSpecimenPreparations()
    {
        return view('v2/master/specimen/preparations_index', [
            'pageTitle' => 'Specimen Preparations',
            'activePage' => 'master-specimen-preparations'
        ]);
    }

    // ========================================
    // Master Data - Tests & ValueSets
    // ========================================

    /**
     * Master Data - Lab Tests
     */
    public function masterTests()
    {
        return view('v2/master/tests/tests_index', [
            'pageTitle' => 'Lab Tests',
            'activePage' => 'master-tests'
        ]);
    }

    /**
     * Master Data - Value Sets
     */
    public function masterValueSets()
    {
        return view('v2/master/valuesets/valuesets_index', [
            'pageTitle' => 'Value Sets',
            'activePage' => 'master-valuesets'
        ]);
    }

    /**
     * Login page
     */
    public function login()
    {
        return view('v2/auth/login', [
            'pageTitle' => 'Login',
            'activePage' => ''
        ]);
    }
}
