<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Application version
    |--------------------------------------------------------------------------
    |
    | The canonical version of this install. Everything that needs to know
    | "what version am I?" reads `config('pos.version')` — the updater's
    | feed comparison, the backup manifest, the footer, support diagnostics.
    |
    | This ships inside config/pos.php (which the updater REPLACES on every
    | update), so a new release naturally carries its own new version number.
    | Bump it here when cutting a release. Format: semver (MAJOR.MINOR.PATCH).
    |
    */

    'version' => '1.0.3',

    /*
    |--------------------------------------------------------------------------
    | Product name
    |--------------------------------------------------------------------------
    |
    | The product's own display name — used where we must brand as the product
    | itself rather than the customer's company, most notably the installer
    | (which runs before any company exists, so `config('app.name')` is still
    | the framework default "Laravel" there). One place to change when the
    | final name is locked. The running app shows the company name instead, via
    | ApplyCompanySettings.
    |
    */

    'name' => 'POS',

    /*
    |--------------------------------------------------------------------------
    | Demo mode
    |--------------------------------------------------------------------------
    |
    | When enabled, the login page shows a small notice with a link out to the
    | configured marketing site — so visitors who land on the live demo know
    | they're looking at a demo and can find their way back to the product
    | website. The toggle is environment-driven (.env) so the same code can
    | run as either the live demo or a real install without code changes.
    |
    */

    'demo' => [

        // Master switch. Set POS_DEMO_MODE=true in .env on the public demo
        // install; leave it false (the default) on customer installs.
        'enabled' => env('POS_DEMO_MODE', false),

        // Where the "click here" link in the demo banner points. Defaults to
        // the Infinitie product page; override for forks via .env.
        'website_url' => env('POS_DEMO_WEBSITE_URL', 'https://infinitietech.com'),

        // Google Analytics 4 Measurement ID (e.g. "G-XXXXXXXXXX") for the
        // public demo. Left empty by default and ONLY ever loaded when demo
        // mode is on — a real customer install never phones home to GA, which
        // keeps the "self-hosted, no callbacks" promise intact. Set
        // POS_DEMO_GA_ID in .env on the demo install to enable tracking.
        'analytics_id' => env('POS_DEMO_GA_ID', ''),

        // Where the landing page's "Get it on CodeCanyon" buy buttons point.
        // This is the whole reason the demo exists — to convert a visitor
        // into a purchase — so it's first-class config. Override for forks
        // via .env.
        'purchase_url' => env('POS_DEMO_PURCHASE_URL', 'https://codecanyon.net/item/hyper-pos-laravel-point-of-sale-inventory-erp-online-offline-pos-invoicing-accounting/64055507'),

        // Specific "Extended License" buy link used by the pricing band.
        // Falls back to purchase_url when left unset.
        'extended_url' => env('POS_DEMO_EXTENDED_URL', 'https://codecanyon.net/cart/add_items?item_ids=64055507&license=extended'),

        // "Talk to our expert" button on the landing page's customization
        // band. A wa.me link opens WhatsApp; swap for any contact URL.
        'support_whatsapp' => env('POS_DEMO_SUPPORT_WHATSAPP', 'https://wa.me/919974692496'),

        // Pre-fillable demo credentials shown on the login page when demo mode
        // is enabled. Each entry renders as a card with a "Copy & Fill" button
        // that pastes the email + password into the login form. Empty entries
        // (no email OR no password) are skipped at render time, so the demo
        // operator can light up just the roles they actually seeded by leaving
        // the others blank in .env.
        'credentials' => [
            [
                'role'     => 'admin',
                'email'    => env('POS_DEMO_ADMIN_EMAIL', ''),
                'password' => env('POS_DEMO_ADMIN_PASSWORD', ''),
            ],
            [
                // The demo cashier is a fixed test account seeded by
                // DemoCashierUserSeeder, so it ships with working defaults
                // (shown on the login page whenever demo mode is on). The
                // admin above stays env-only because it's the operator's own
                // install admin. Override these via .env if you reseed.
                'role'     => 'cashier',
                'email'    => env('POS_DEMO_CASHIER_EMAIL', 'cashier@demo.test'),
                'password' => env('POS_DEMO_CASHIER_PASSWORD', 'cashier1234'),
            ],
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Auto-updater
    |--------------------------------------------------------------------------
    |
    | See docs/features/updater-hooks.md. The feed is a static JSON endpoint
    | we control; the public key verifies the Ed25519 signature on each
    | release zip so a compromised feed or a man-in-the-middle can't push a
    | malicious update. Per-install preferences (channel, auto-check, pinned
    | version, skipped versions) live in the database — NOT here — so they
    | survive an update.
    |
    */

    'updater' => [

        // The update feed. env-overridable for forks / staging; defaults to
        // the canonical endpoint shipped with the product.
        'feed_url' => env('POS_UPDATE_FEED_URL', 'https://updates.infinitietech.com/pos.json'),

        // Base64-encoded Ed25519 public key used to verify release signatures.
        // Populated at release time; empty here until the signing key exists,
        // and the updater treats an empty key as "signature checks disabled"
        // only in non-production (production refuses to install unsigned).
        'public_key' => env('POS_UPDATE_PUBLIC_KEY', ''),

        // Default channel for a fresh install. The per-install choice is a
        // database setting that overrides this.
        'channel' => env('POS_UPDATE_CHANNEL', 'stable'),

        // Seconds to wait on the feed endpoint before giving up. A slow or
        // unreachable feed must never block the app — see the graceful
        // failure handling in the update client.
        'feed_timeout' => 15,

        // Seconds allowed for streaming a release zip down (much larger than
        // the feed JSON — tens of megabytes).
        'download_timeout' => 300,

    ],

    /*
    |--------------------------------------------------------------------------
    | Licensing
    |--------------------------------------------------------------------------
    |
    | See docs/features/installer.md §3 + §6. The license is validated once at
    | install (Step 3) against our license server, then re-checked in the
    | background every ~30 days. A failed re-check NEVER locks the app — it only
    | surfaces a banner. The license KEY lives in .env (LICENSE_KEY); the
    | validated DETAILS (buyer, type, support window) are cached in the DB.
    |
    | `public_key` verifies the offline-activation blob (Ed25519) for customers
    | behind firewalls who can't reach the license server during install.
    |
    */

    'license' => [

        // Master switch for license enforcement. When false the installer skips
        // the purchase-code step entirely and the background re-check no-ops —
        // useful for free / internal builds or offline development.
        //
        // ON: the CodeCanyon item is live (see item_id below), so the installer
        // asks for a purchase code and validates it against the validator
        // server. Set POS_LICENSE_REQUIRED=false in .env to disable on a
        // fork / internal build.
        'required' => env('POS_LICENSE_REQUIRED', true),

        // Developer bypass: when true, the installer's license validation
        // returns a stub "valid" response WITHOUT hitting the validator
        // server. Use for offline development against a live validator
        // URL; never enable in production. OFF by default — set
        // `POS_LICENSE_DEV_BYPASS=true` in `.env` to opt in.
        'dev_bypass' => env('POS_LICENSE_DEV_BYPASS', false),

        // Panel-side license verification. OFF for now.
        //
        // `required` above governs the INSTALLER's one-time purchase-code step.
        // This flag governs everything the RUNNING app does with that code:
        //   - the background 30-day re-check (and its "Re-check now" button),
        //   - the Settings → License screen,
        //   - the nag banner across the admin shell.
        //
        // It's separate because re-verifying inside the panel is what surfaced a
        // permanent "invalid license" banner on fresh installs — the store owner
        // already proved the code at install, and a self-hosted app shouldn't
        // keep phoning home to re-litigate it. Set POS_LICENSE_RECHECK=true in
        // .env to switch the re-check + banner back on.
        'recheck' => env('POS_LICENSE_RECHECK', false),

        // The activated license key + its install fingerprint, written to .env
        // by the installer. Surfaced through config so the background re-check
        // reads them even when the config is cached (env() outside config
        // returns null once `config:cache` runs).
        'key'         => env('LICENSE_KEY', ''),
        'fingerprint' => env('LICENSE_FINGERPRINT', ''),

        // The license server endpoint. env-overridable for forks / staging.
        // The default points at the Infinitie validator service:
        //   GET <check_url>?purchase_code=…&domain_url=…&item_id=<item_id>
        // The server replies with `{error: 0, purchase_code, token,
        // username, item_id, …}` on a valid key.
        'check_url' => env('POS_LICENSE_CHECK_URL', 'https://validator.infinitietech.com/home/validator'),

        // The product / item identifier the validator binds the key to.
        // The legacy CI codebase called this `WEB_CODE`; in this build
        // it's `POS_LICENSE_ITEM_ID` in `.env` and reads from here at
        // runtime. Required by the validator — without it every check
        // comes back invalid.
        'item_id' => env('POS_LICENSE_ITEM_ID', '64055507'),

        // Seconds to wait on the license server before giving up. Offline
        // activation has been removed in this build; an unreachable server
        // surfaces a "couldn't reach license server" error and the
        // customer must retry once connectivity is restored.
        'timeout' => 15,

    ],

];
