<?php

namespace StampsNZ\Office;
require_once 'EndPoint.class.php';

final class LiveSite extends EndPoint
{


    public function __construct()
    {
        // Register the API details.
        $this->registerApi(
            'LiveSite',
            'Generates all the static pages of the live StampsNZ site.'
        );

        // Register the parameters.
        $this->registerEnum(
            'category',
            'The category to generate an HTML index page for',
            [
                'christmas',
                'health',
                'fiscal',
                'frama',
                'custom advertising label',
                'life insurance',
                'airmail',
                'express delivery',
                'postage due',
                'royal',
                'antarctic',
                'anzac',
                'official',
                'matariki',
                'chinese lunar year',
                'round kiwi',
            ],
            useKey: false
        );

        $this->registerFloat('denomination', 'The stamp value to generate HTML for', 0, 257.5);
        $this->registerEnum(
            'format',
            'The format defined in the database to generate HTML for',
            [
                'self adhesive',
                'joined pair',
                'joined strip',
                'joined block',
                'miniature sheet',
                'sheetlet',
                'prestige sheet',
                'booklet',
                'prestige booklet',
                'first day cover',
                'prestige cover',
            ],
            useKey: false
        );

        $this->registerEnum(
            'formatName',
            'The format to display to customers',
            [
                'self adhesive stamps',
                'se-tenant pairs',
                'se-tenant strips',
                'se-tenant blocks',
                'miniature sheets',
                'sheetlets',
                'prestige sheets',
                'booklets',
                'prestige booklets',
                'first day covers',
                'prestige covers',
            ],
            useKey: false
        );

        $this->registerInteger('issueId', 'The ID of the issue to generate HTML for', 1, 10000);
        $this->registerInteger('year', 'The year to generate an HTML index page for', 1855, 2026);
        $this->registerEnum(
            'classification',
            'The classification to index - definitive, commemorative or kiwi stamp',
            [
                'definitive',
                'commemorative',
                'kiwi stamp',
            ],
            useKey: false
        );

        $this->registerEnum(
            'units',
            'The currency - dollars, cents, pounds, shillings, or pence',
            [
                'penny',
                'shilling',
                'pound',
                'cent',
                'dollar',
            ],
            useKey: false
        );


        // Register the individual end points.
        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'home',
            [],
            ],
            'Render the live web site main front page - index.html'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'contact',
            [],
            ],
            'Render the live web site contact page'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'voucher',
            [],
            ],
            'Render the live web site gift voucher page'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'claimVoucher',
            [],
            ],
            'Render the live web site ifor claiming a gift voucher page'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'privacy',
            [],
            ],
            'Render the live web site privacy page'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'expect',
            [],
            ],
            'Render the live web site what to expect page'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'links',
            [],
            ],
            'Render the live web site links to other sites page'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'stanleyGibbons',
            [],
            ],
            'Render the live web site Stanley Gibbons catalogue code cross reference page'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'notFound',
            [],
            ],
            'Render the live web site page not found PHP code'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'issue',
            [
                '0' => 'issueId;,
            ],
            ],
            'Render the live web site HTML for an individual issue'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'faceValueIndex',
            [
                '0' => 'denomination;,
                '1' => 'units;,
            ],
            ],
            'Render the live web site HTML index for stamps with a specific face value'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'yearIndex',
            [
                '0' => 'year;,
            ],
            ],
            'Render the live web site HTML index for a year'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'categoryIndex',
            [
                '0' => 'category;,
            ],
            ],
            'Render the live web site HTML index for a category'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'classificationIndex',
            [
                '0' => 'classification;,
            ],
            ],
            'Render the live web site HTML index for the three issue classifications'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'aotearoaIndex',
            [],
            ],
            'Render the live web site HTML index for issues from Aotearoa / New Zealand'
        );

        $this->register(
            'get',
            'stamps/LiveSite.class.php',
            'formatIndex',
            [
                '0' => 'format;,
                '1' => 'formatName;,
            ],
            ],
            'Render the live web site HTML index for stamps with a specific format'
        );

    }



    /**    * Render the live web site main front page - index.html
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?home
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site contact page
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?contact
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site gift voucher page
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?voucher
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site ifor claiming a gift voucher page
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?claimVoucher
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site privacy page
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?privacy
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site what to expect page
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?expect
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site links to other sites page
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?links
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site Stanley Gibbons catalogue code cross reference page
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?stanleyGibbons
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site page not found PHP code
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?notFound
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site HTML for an individual issue
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?issue&0=*
     *
     * @param string $0 IssueId.
     *
     * @return void Never returns.
     */
    protected function get(string $0): void
    {
        $this->response(
            200,
            'get' => [
            '0' => $0,
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site HTML index for stamps with a specific face value
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?faceValueIndex&0=*&1=*
     *
     * @param string $0 Denomination.
     * @param string $1 Units.
     *
     * @return void Never returns.
     */
    protected function get(string $0, string $1): void
    {
        $this->response(
            200,
            'get' => [
            '0' => $0,
            '1' => $1,
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site HTML index for a year
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?yearIndex&0=*
     *
     * @param string $0 Year.
     *
     * @return void Never returns.
     */
    protected function get(string $0): void
    {
        $this->response(
            200,
            'get' => [
            '0' => $0,
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site HTML index for a category
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?categoryIndex&0=*
     *
     * @param string $0 Category.
     *
     * @return void Never returns.
     */
    protected function get(string $0): void
    {
        $this->response(
            200,
            'get' => [
            '0' => $0,
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site HTML index for the three issue classifications
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?classificationIndex&0=*
     *
     * @param string $0 Classification.
     *
     * @return void Never returns.
     */
    protected function get(string $0): void
    {
        $this->response(
            200,
            'get' => [
            '0' => $0,
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site HTML index for issues from Aotearoa / New Zealand
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?aotearoaIndex
     *
     * @return void Never returns.
     */
    protected function get(): void
    {
        $this->response(
            200,
            'get' => [
            ],
        ]
    );
    return;
    }


    /**    * Render the live web site HTML index for stamps with a specific format
     * 
     * Client call: GET https://192.168.0.4/stamps/LiveSite.class.php?formatIndex&0=*&1=*
     *
     * @param string $0 Format.
     * @param string $1 FormatName.
     *
     * @return void Never returns.
     */
    protected function get(string $0, string $1): void
    {
        $this->response(
            200,
            'get' => [
            '0' => $0,
            '1' => $1,
            ],
        ]
    );
    return;
    }

}

$liveSite = new LiveSite();
$liveSite->process();