<?php #CodeGenerator V3 Δ 1e7eec9d8ae4630c294e3be9af4eb281 Δ DYNAMICALLY GENERATED FILE - Do not modify this line! Remove it completely to protect the file from changes.
/**
 * Route File
 *
 * @version     1.0.$Revision:$
 * @version     SVN: $Id:$
 * @version     STUB: 1.0.0
 * @generated   2026-05-10 14:30:49
 * @package     bplan-base/globals
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 * @copyright   Copyright (C) 2025, 2026 bplan-solutions GmbH & Co. KG <https://www.bplan-solutions.de/>
 * /Δ\
 */


use Illuminate\Support\Facades\Route;
use LaravelJsonApi\Laravel\Facades\JsonApiRoute;
use LaravelJsonApi\Laravel\Http\Controllers\JsonApiController;
use LaravelJsonApi\Laravel\Routing\Relationships;
use LaravelJsonApi\Laravel\Routing\ResourceRegistrar;


JsonApiRoute::server('terminal')
    ->prefix('api/terminal')
    ->middleware('api')
    ->middleware('auth:sanctum')
    ->withoutMiddleware(\Illuminate\Routing\Middleware\SubstituteBindings::class)
    ->resources(function (ResourceRegistrar $Server) {

        $Server->resource('countries', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('tenant-records')->readOnly();
            });

        $Server->resource('entity-type-fields', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('entity-type')->readOnly();
            });

        $Server->resource('entity-type-models', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('entity-types')->readOnly();
            });

        $Server->resource('entity-types', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('derived-entity-types')->readOnly();
                $Relations->hasMany('fields')->readOnly();
                $Relations->hasMany('individuals')->readOnly();
                $Relations->hasOne('master-entity-type')->readOnly();
                $Relations->hasOne('model')->readOnly();
                $Relations->hasOne('module')->readOnly();
                $Relations->hasOne('source-entity-type')->readOnly();
                $Relations->hasMany('sub-entity-types')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('external-systems', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('tenant-external-systems')->readOnly();
            });

        $Server->resource('global-settings', JsonApiController::class)->except('store', 'destroy')
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('import-log-records', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('import-log')->readOnly();
            });

        $Server->resource('import-logs', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('import-log-records')->readOnly();
                $Relations->hasOne('import-user')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('individuals', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('entity-type')->readOnly();
                $Relations->hasOne('user')->readOnly();
            });

        $Server->resource('languages', JsonApiController::class)->only('show')
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('location-printers', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('location')->readOnly();
                $Relations->hasOne('printer')->readOnly();
            });

        $Server->resource('location-types', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('locations')->readOnly();
            });

        $Server->resource('locations', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('location-type')->readOnly();
                $Relations->hasOne('master')->readOnly();
                $Relations->hasMany('physical-printers')->readOnly();
                $Relations->hasMany('printers')->readOnly();
                $Relations->hasMany('sub-locations')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
                $Relations->hasMany('terminal-connections')->readOnly();
            });

        $Server->resource('module-tenants', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('module')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('modules', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('entity-types')->readOnly();
                $Relations->hasMany('tenants')->readOnly();
            });

        $Server->resource('print-jobs', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('printer')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('printer-types', JsonApiController::class)
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('printers')->readOnly();
            });

        $Server->resource('printers', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('locations')->readOnly();
                $Relations->hasOne('physical-location')->readOnly();
                $Relations->hasMany('print-jobs')->readOnly();
                $Relations->hasOne('printer-type')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('role-users', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('role')->readOnly();
                $Relations->hasOne('user')->readOnly();
            });

        $Server->resource('roles', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('tenant')->readOnly();
                $Relations->hasMany('users')->readOnly();
            });

        $Server->resource('tenant-external-systems', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('external-system')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('tenant-locales', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('tenant-records', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('country')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('tenant-users', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('tenant')->readOnly();
                $Relations->hasOne('user')->readOnly();
            });

        $Server->resource('tenants', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('assigned-users')->readOnly();
                $Relations->hasMany('entity-types')->readOnly();
                $Relations->hasMany('external-systems')->readOnly();
                $Relations->hasOne('global-setting')->readOnly();
                $Relations->hasMany('import-logs')->readOnly();
                $Relations->hasMany('languages')->readOnly();
                $Relations->hasMany('locales')->readOnly();
                $Relations->hasMany('locations')->readOnly();
                $Relations->hasOne('master-tenant')->readOnly();
                $Relations->hasMany('modules')->readOnly();
                $Relations->hasMany('print-jobs')->readOnly();
                $Relations->hasMany('printers')->readOnly();
                $Relations->hasMany('roles')->readOnly();
                $Relations->hasMany('sub-tenants')->readOnly();
                $Relations->hasOne('tenant-record')->readOnly();
                $Relations->hasMany('terminal-connections')->readOnly();
                $Relations->hasMany('users')->readOnly();
            });

        $Server->resource('terminal-connections', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('location')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
            });

        $Server->resource('user-records', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasOne('user')->readOnly();
            });

        $Server->resource('users', JsonApiController::class)->readOnly()
            ->relationships(function (Relationships $Relations) {
                $Relations->hasMany('import-logs')->readOnly();
                $Relations->hasOne('individual')->readOnly();
                $Relations->hasMany('roles')->readOnly();
                $Relations->hasOne('tenant')->readOnly();
                $Relations->hasMany('tenants')->readOnly();
                $Relations->hasOne('user-record')->readOnly();
            });

    });

if (file_exists(__DIR__.'/custom.terminal.php')) {
    require __DIR__.'/custom.terminal.php';
}
