180 lines
3.8 KiB
JavaScript
180 lines
3.8 KiB
JavaScript
// Directus collection definitions and seed data
|
|
// This file documents the CMS schema that needs to be configured
|
|
|
|
const COLLECTIONS = {
|
|
restaurants: {
|
|
name: 'restaurants',
|
|
fields: [
|
|
{
|
|
field: 'id',
|
|
type: 'uuid',
|
|
primary: true,
|
|
},
|
|
{
|
|
field: 'name',
|
|
type: 'string',
|
|
required: true,
|
|
},
|
|
{
|
|
field: 'description',
|
|
type: 'text',
|
|
},
|
|
{
|
|
field: 'cuisine_type',
|
|
type: 'string',
|
|
example: 'Italian',
|
|
},
|
|
{
|
|
field: 'website_url',
|
|
type: 'string',
|
|
},
|
|
{
|
|
field: 'phone',
|
|
type: 'string',
|
|
},
|
|
{
|
|
field: 'image_id',
|
|
type: 'uuid',
|
|
relation: 'one_to_one',
|
|
relatedCollection: 'directus_files',
|
|
},
|
|
{
|
|
field: 'status',
|
|
type: 'string',
|
|
default: 'published',
|
|
},
|
|
],
|
|
},
|
|
|
|
attractions: {
|
|
name: 'attractions',
|
|
fields: [
|
|
{
|
|
field: 'id',
|
|
type: 'uuid',
|
|
primary: true,
|
|
},
|
|
{
|
|
field: 'name',
|
|
type: 'string',
|
|
required: true,
|
|
},
|
|
{
|
|
field: 'description',
|
|
type: 'text',
|
|
},
|
|
{
|
|
field: 'category',
|
|
type: 'string',
|
|
example: 'Museum',
|
|
},
|
|
{
|
|
field: 'distance_km',
|
|
type: 'float',
|
|
},
|
|
{
|
|
field: 'image_id',
|
|
type: 'uuid',
|
|
relation: 'one_to_one',
|
|
relatedCollection: 'directus_files',
|
|
},
|
|
{
|
|
field: 'website_url',
|
|
type: 'string',
|
|
},
|
|
{
|
|
field: 'hours',
|
|
type: 'text',
|
|
},
|
|
{
|
|
field: 'status',
|
|
type: 'string',
|
|
default: 'published',
|
|
},
|
|
],
|
|
},
|
|
|
|
settings: {
|
|
name: 'settings',
|
|
description: 'Global kiosk configuration and settings',
|
|
fields: [
|
|
{
|
|
field: 'id',
|
|
type: 'uuid',
|
|
primary: true,
|
|
},
|
|
{
|
|
field: 'key',
|
|
type: 'string',
|
|
required: true,
|
|
unique: true,
|
|
example: 'general',
|
|
comment: 'Unique key identifying this setting group',
|
|
},
|
|
{
|
|
field: 'title',
|
|
type: 'string',
|
|
required: true,
|
|
default: 'Amanda',
|
|
example: 'Amanda',
|
|
comment: 'Displayed welcome title (e.g., "Welcome, Amanda")',
|
|
},
|
|
{
|
|
field: 'use_ip_location',
|
|
type: 'boolean',
|
|
default: false,
|
|
comment: 'If true, uses IP geolocation. If false, uses manual_location.',
|
|
},
|
|
{
|
|
field: 'manual_location',
|
|
type: 'string',
|
|
example: 'Disneyland, Anaheim, CA',
|
|
comment: 'Manual location string used when use_ip_location is false',
|
|
},
|
|
{
|
|
field: 'idle_timeout_seconds',
|
|
type: 'integer',
|
|
default: 300,
|
|
comment: 'Time in seconds before idle screen is shown',
|
|
},
|
|
{
|
|
field: 'plex_enabled',
|
|
type: 'boolean',
|
|
default: true,
|
|
comment: 'Whether Plex integration is enabled',
|
|
},
|
|
{
|
|
field: 'restaurants_enabled',
|
|
type: 'boolean',
|
|
default: true,
|
|
comment: 'Whether restaurants section is visible',
|
|
},
|
|
{
|
|
field: 'attractions_enabled',
|
|
type: 'boolean',
|
|
default: true,
|
|
comment: 'Whether attractions section is visible',
|
|
},
|
|
{
|
|
field: 'brand_color',
|
|
type: 'string',
|
|
default: '#1f2937',
|
|
example: '#1f2937',
|
|
comment: 'Primary brand color (hex)',
|
|
},
|
|
{
|
|
field: 'metadata',
|
|
type: 'json',
|
|
comment: 'Additional configuration JSON for extensibility',
|
|
},
|
|
{
|
|
field: 'updated_at',
|
|
type: 'timestamp',
|
|
readonly: true,
|
|
},
|
|
],
|
|
},
|
|
};
|
|
|
|
export default COLLECTIONS;
|