diff --git a/src/payload-generated-schema.ts b/src/payload-generated-schema.ts index 9b9a8b1..db736f9 100644 --- a/src/payload-generated-schema.ts +++ b/src/payload-generated-schema.ts @@ -16,13 +16,39 @@ import { varchar, timestamp, numeric, - integer, jsonb, + integer, boolean, type AnyPgColumn, pgEnum, } from "@payloadcms/db-postgres/drizzle/pg-core"; import { sql, relations } from "@payloadcms/db-postgres/drizzle"; +import { geometryColumn } from "@payloadcms/db-postgres"; +export const enum_game_vehicles_status = pgEnum("enum_game_vehicles_status", [ + "idle", + "assigned", + "in_transit", + "damaged", + "destroyed", +]); +export const enum_game_event_logs_target_collection = pgEnum( + "enum_game_event_logs_target_collection", + [ + "game-structures", + "game-vehicles", + "structures", + "resources", + "assets", + "vehicles", + "factions", + "missions", + "campaigns", + "users", + "technologies", + "maps", + "shipments", + ], +); export const enum_users_roles = pgEnum("enum_users_roles", ["guest", "user", "admin", "developer"]); export const enum_awards_type = pgEnum("enum_awards_type", ["commendation", "ribbon", "medal"]); export const enum_assignments_type = pgEnum("enum_assignments_type", [ @@ -77,7 +103,21 @@ export const enum_factions_type = pgEnum("enum_factions_type", [ "corporation", "special", ]); +export const enum_technologies_approval_status = pgEnum("enum_technologies_approval_status", [ + "in_progress", + "ready_for_review", + "approved", + "rejected", + "revision_requested", +]); export const enum_technologies_type = pgEnum("enum_technologies_type", ["asset", "upgrade"]); +export const enum_assets_approval_status = pgEnum("enum_assets_approval_status", [ + "in_progress", + "ready_for_review", + "approved", + "rejected", + "revision_requested", +]); export const enum_assets_asset_type = pgEnum("enum_assets_asset_type", [ "weapon", "magazine", @@ -114,6 +154,13 @@ export const enum_assets_market_trading_rarity = pgEnum("enum_assets_market_trad "legendary", "unique", ]); +export const enum_resources_approval_status = pgEnum("enum_resources_approval_status", [ + "in_progress", + "ready_for_review", + "approved", + "rejected", + "revision_requested", +]); export const enum_resources_type = pgEnum("enum_resources_type", [ "physical", "fluid", @@ -140,6 +187,13 @@ export const enum_vehicles_pylons_pylon_type = pgEnum("enum_vehicles_pylons_pylo "mountedWeapon", "pylon", ]); +export const enum_vehicles_approval_status = pgEnum("enum_vehicles_approval_status", [ + "in_progress", + "ready_for_review", + "approved", + "rejected", + "revision_requested", +]); export const enum_vehicles_armor_rating = pgEnum("enum_vehicles_armor_rating", [ "none", "light", @@ -147,6 +201,13 @@ export const enum_vehicles_armor_rating = pgEnum("enum_vehicles_armor_rating", [ "heavy", "composite", ]); +export const enum_structures_approval_status = pgEnum("enum_structures_approval_status", [ + "in_progress", + "ready_for_review", + "approved", + "rejected", + "revision_requested", +]); export const enum_structures_category = pgEnum("enum_structures_category", [ "logistics", "military", @@ -164,6 +225,22 @@ export const enum_structures_function_type = pgEnum("enum_structures_function_ty "defense", "miscellaneous", ]); +export const enum_shipments_status = pgEnum("enum_shipments_status", [ + "pending", + "dispatched", + "in_transit", + "arrived", + "completed", + "cancelled", + "failed", + "stranded", +]); +export const enum_narrative_events_triggers_type = pgEnum("enum_narrative_events_triggers_type", [ + "manual", + "mission_complete", + "timer", + "condition", +]); export const media = pgTable( "media", @@ -180,11 +257,11 @@ export const media = pgTable( thumbnailURL: varchar("thumbnail_u_r_l"), filename: varchar("filename"), mimeType: varchar("mime_type"), - filesize: numeric("filesize"), - width: numeric("width"), - height: numeric("height"), - focalX: numeric("focal_x"), - focalY: numeric("focal_y"), + filesize: numeric("filesize", { mode: "number" }), + width: numeric("width", { mode: "number" }), + height: numeric("height", { mode: "number" }), + focalX: numeric("focal_x", { mode: "number" }), + focalY: numeric("focal_y", { mode: "number" }), }, (columns) => [ index("media_updated_at_idx").on(columns.updatedAt), @@ -193,6 +270,240 @@ export const media = pgTable( ], ); +export const game_hard_resources = pgTable( + "game_hard_resources", + { + id: serial("id").primaryKey(), + name: varchar("name").notNull(), + amount: numeric("amount", { mode: "number" }).notNull().default(0), + description: jsonb("description").notNull(), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + }, + (columns) => [ + uniqueIndex("game_hard_resources_name_idx").on(columns.name), + index("game_hard_resources_updated_at_idx").on(columns.updatedAt), + index("game_hard_resources_created_at_idx").on(columns.createdAt), + ], +); + +export const game_structures_stored_resources = pgTable( + "game_structures_stored_resources", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + resource: integer("resource_id") + .notNull() + .references(() => resources.id, { + onDelete: "set null", + }), + amount: numeric("amount", { mode: "number" }).notNull(), + gridX: numeric("grid_x", { mode: "number" }).notNull(), + gridY: numeric("grid_y", { mode: "number" }).notNull(), + rotated: boolean("rotated").default(false), + }, + (columns) => [ + index("game_structures_stored_resources_order_idx").on(columns._order), + index("game_structures_stored_resources_parent_id_idx").on(columns._parentID), + index("game_structures_stored_resources_resource_idx").on(columns.resource), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [game_structures.id], + name: "game_structures_stored_resources_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const game_structures_void_storage = pgTable( + "game_structures_void_storage", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + resource: integer("resource_id") + .notNull() + .references(() => resources.id, { + onDelete: "set null", + }), + amount: numeric("amount", { mode: "number" }).notNull(), + gridX: numeric("grid_x", { mode: "number" }).notNull(), + gridY: numeric("grid_y", { mode: "number" }).notNull(), + rotated: boolean("rotated").default(false), + }, + (columns) => [ + index("game_structures_void_storage_order_idx").on(columns._order), + index("game_structures_void_storage_parent_id_idx").on(columns._parentID), + index("game_structures_void_storage_resource_idx").on(columns.resource), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [game_structures.id], + name: "game_structures_void_storage_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const game_structures = pgTable( + "game_structures", + { + id: serial("id").primaryKey(), + name: varchar("name").notNull(), + type: integer("type_id") + .notNull() + .references(() => structures.id, { + onDelete: "set null", + }), + faction: integer("faction_id").references(() => factions.id, { + onDelete: "set null", + }), + coordinates: geometryColumn("coordinates"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + }, + (columns) => [ + index("game_structures_type_idx").on(columns.type), + index("game_structures_faction_idx").on(columns.faction), + index("game_structures_updated_at_idx").on(columns.updatedAt), + index("game_structures_created_at_idx").on(columns.createdAt), + ], +); + +export const game_vehicles_stored_resources = pgTable( + "game_vehicles_stored_resources", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + resource: integer("resource_id") + .notNull() + .references(() => resources.id, { + onDelete: "set null", + }), + amount: numeric("amount", { mode: "number" }).notNull(), + gridX: numeric("grid_x", { mode: "number" }).notNull(), + gridY: numeric("grid_y", { mode: "number" }).notNull(), + rotated: boolean("rotated").default(false), + }, + (columns) => [ + index("game_vehicles_stored_resources_order_idx").on(columns._order), + index("game_vehicles_stored_resources_parent_id_idx").on(columns._parentID), + index("game_vehicles_stored_resources_resource_idx").on(columns.resource), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [game_vehicles.id], + name: "game_vehicles_stored_resources_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const game_vehicles_void_storage = pgTable( + "game_vehicles_void_storage", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + resource: integer("resource_id") + .notNull() + .references(() => resources.id, { + onDelete: "set null", + }), + amount: numeric("amount", { mode: "number" }).notNull(), + gridX: numeric("grid_x", { mode: "number" }).notNull(), + gridY: numeric("grid_y", { mode: "number" }).notNull(), + rotated: boolean("rotated").default(false), + }, + (columns) => [ + index("game_vehicles_void_storage_order_idx").on(columns._order), + index("game_vehicles_void_storage_parent_id_idx").on(columns._parentID), + index("game_vehicles_void_storage_resource_idx").on(columns.resource), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [game_vehicles.id], + name: "game_vehicles_void_storage_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const game_vehicles = pgTable( + "game_vehicles", + { + id: serial("id").primaryKey(), + name: varchar("name").notNull(), + type: integer("type_id") + .notNull() + .references(() => vehicles.id, { + onDelete: "set null", + }), + deployedAt: integer("deployed_at_id").references(() => game_structures.id, { + onDelete: "set null", + }), + faction: integer("faction_id").references(() => factions.id, { + onDelete: "set null", + }), + status: enum_game_vehicles_status("status").notNull().default("idle"), + currentFuel: numeric("current_fuel", { mode: "number" }).notNull().default(0), + currentHealth: numeric("current_health", { mode: "number" }).notNull(), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + }, + (columns) => [ + index("game_vehicles_type_idx").on(columns.type), + index("game_vehicles_deployed_at_idx").on(columns.deployedAt), + index("game_vehicles_faction_idx").on(columns.faction), + index("game_vehicles_updated_at_idx").on(columns.updatedAt), + index("game_vehicles_created_at_idx").on(columns.createdAt), + ], +); + +export const game_event_logs = pgTable( + "game_event_logs", + { + id: serial("id").primaryKey(), + system: boolean("system").default(true), + timestamp: timestamp("timestamp", { + mode: "string", + withTimezone: true, + precision: 3, + }).notNull(), + type: varchar("type").notNull(), + message: varchar("message").notNull(), + actor: integer("actor_id").references(() => users.id, { + onDelete: "set null", + }), + structure: integer("structure_id").references(() => game_structures.id, { + onDelete: "set null", + }), + targetCollection: enum_game_event_logs_target_collection("target_collection"), + targetId: numeric("target_id", { mode: "number" }), + data: jsonb("data"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + }, + (columns) => [ + index("game_event_logs_type_idx").on(columns.type), + index("game_event_logs_actor_idx").on(columns.actor), + index("game_event_logs_structure_idx").on(columns.structure), + index("game_event_logs_updated_at_idx").on(columns.updatedAt), + index("game_event_logs_created_at_idx").on(columns.createdAt), + ], +); + export const users_roles = pgTable( "users_roles", { @@ -260,7 +571,7 @@ export const users = pgTable( }), salt: varchar("salt"), hash: varchar("hash"), - loginAttempts: numeric("login_attempts").default("0"), + loginAttempts: numeric("login_attempts", { mode: "number" }).default(0), lockUntil: timestamp("lock_until", { mode: "string", withTimezone: true, precision: 3 }), }, (columns) => [ @@ -315,15 +626,21 @@ export const profiles = pgTable( }), dossier_personalExcerpt: varchar("dossier_personal_excerpt"), dossier_intelExcerpt: jsonb("dossier_intel_excerpt"), - progression_scoreboard_infantryKills: numeric("progression_scoreboard_infantry_kills").default( - "0", - ), - progression_scoreboard_vehicleKills: numeric("progression_scoreboard_vehicle_kills").default( - "0", - ), - progression_scoreboard_armorKills: numeric("progression_scoreboard_armor_kills").default("0"), - progression_scoreboard_airKills: numeric("progression_scoreboard_air_kills").default("0"), - progression_scoreboard_deaths: numeric("progression_scoreboard_deaths").default("0"), + progression_scoreboard_infantryKills: numeric("progression_scoreboard_infantry_kills", { + mode: "number", + }).default(0), + progression_scoreboard_vehicleKills: numeric("progression_scoreboard_vehicle_kills", { + mode: "number", + }).default(0), + progression_scoreboard_armorKills: numeric("progression_scoreboard_armor_kills", { + mode: "number", + }).default(0), + progression_scoreboard_airKills: numeric("progression_scoreboard_air_kills", { + mode: "number", + }).default(0), + progression_scoreboard_deaths: numeric("progression_scoreboard_deaths", { + mode: "number", + }).default(0), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) .defaultNow() .notNull(), @@ -347,12 +664,14 @@ export const profiles_rels = pgTable( parent: integer("parent_id").notNull(), path: varchar("path").notNull(), awardsID: integer("awards_id"), + qualificationsID: integer("qualifications_id"), }, (columns) => [ index("profiles_rels_order_idx").on(columns.order), index("profiles_rels_parent_idx").on(columns.parent), index("profiles_rels_path_idx").on(columns.path), index("profiles_rels_awards_id_idx").on(columns.awardsID), + index("profiles_rels_qualifications_id_idx").on(columns.qualificationsID), foreignKey({ columns: [columns["parent"]], foreignColumns: [profiles.id], @@ -363,6 +682,11 @@ export const profiles_rels = pgTable( foreignColumns: [awards.id], name: "profiles_rels_awards_fk", }).onDelete("cascade"), + foreignKey({ + columns: [columns["qualificationsID"]], + foreignColumns: [qualifications.id], + name: "profiles_rels_qualifications_fk", + }).onDelete("cascade"), ], ); @@ -376,7 +700,9 @@ export const awards = pgTable( image: integer("image_id").references(() => media.id, { onDelete: "set null", }), - experiencePoints: numeric("experience_points"), + experiencePoints: numeric("experience_points", { mode: "number" }), + ribbonDesign: jsonb("ribbon_design"), + medalDesign: jsonb("medal_design"), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) .defaultNow() .notNull(), @@ -470,6 +796,27 @@ export const assignments_rels = pgTable( ], ); +export const experience = pgTable( + "experience", + { + id: serial("id").primaryKey(), + name: varchar("name").notNull(), + requiredPoints: numeric("required_points", { mode: "number" }).notNull(), + description: jsonb("description").notNull(), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + }, + (columns) => [ + uniqueIndex("experience_name_idx").on(columns.name), + index("experience_updated_at_idx").on(columns.updatedAt), + index("experience_created_at_idx").on(columns.createdAt), + ], +); + export const missions_mission_roles_provided_roles = pgTable( "missions_mission_roles_provided_roles", { @@ -542,7 +889,11 @@ export const missions_factions_involved = pgTable( _order: integer("_order").notNull(), _parentID: integer("_parent_id").notNull(), id: varchar("id").primaryKey(), - factionName: varchar("faction_name").notNull(), + faction: integer("faction_id") + .notNull() + .references(() => factions.id, { + onDelete: "set null", + }), threatLevel: enum_missions_factions_involved_threat_level("threat_level") .notNull() .default("hostile"), @@ -550,6 +901,7 @@ export const missions_factions_involved = pgTable( (columns) => [ index("missions_factions_involved_order_idx").on(columns._order), index("missions_factions_involved_parent_id_idx").on(columns._parentID), + index("missions_factions_involved_faction_idx").on(columns.faction), foreignKey({ columns: [columns["_parentID"]], foreignColumns: [missions.id], @@ -624,8 +976,8 @@ export const missions_comms_and_docs_frequencies = pgTable( _order: integer("_order").notNull(), _parentID: integer("_parent_id").notNull(), id: varchar("id").primaryKey(), - frequency: numeric("frequency").notNull(), - channel: numeric("channel"), + frequency: numeric("frequency", { mode: "number" }).notNull(), + channel: numeric("channel", { mode: "number" }), netName: varchar("net_name").notNull(), freqUsage: varchar("freq_usage").notNull(), }, @@ -669,9 +1021,11 @@ export const missions = pgTable( withTimezone: true, precision: 3, }).notNull(), - classification_estimatedDuration: numeric("classification_estimated_duration") + classification_estimatedDuration: numeric("classification_estimated_duration", { + mode: "number", + }) .notNull() - .default("240"), + .default(240), ownershipAndStatus_status: enum_missions_ownership_and_status_status( "ownership_and_status_status", ) @@ -682,23 +1036,27 @@ export const missions = pgTable( ) .notNull() .default("leadership"), - missionRoles_maxPlayers: numeric("mission_roles_max_players").notNull().default("32"), + missionRoles_maxPlayers: numeric("mission_roles_max_players", { mode: "number" }) + .notNull() + .default(32), missionRoles_notes: varchar("mission_roles_notes"), civilianPresence: enum_missions_civilian_presence("civilian_presence").default("None"), gameDetails_serverDetails_serverIp: varchar("game_details_server_details_server_ip") .notNull() .default("arma.onyxsimple.com"), - gameDetails_serverDetails_serverPort: numeric("game_details_server_details_server_port") + gameDetails_serverDetails_serverPort: numeric("game_details_server_details_server_port", { + mode: "number", + }) .notNull() - .default("2302"), + .default(2302), gameDetails_serverDetails_serverPassword: varchar( "game_details_server_details_server_password", ).default("ptf313"), - gameDetails_gameSetup_missionFile: integer("game_details_game_setup_mission_file_id") - .notNull() - .references(() => mission_files.id, { - onDelete: "set null", - }), + gameDetails_gameSetup_missionFile: integer( + "game_details_game_setup_mission_file_id", + ).references(() => mission_files.id, { + onDelete: "set null", + }), gameDetails_gameSetup_requiredMods: integer( "game_details_game_setup_required_mods_id", ).references(() => mod_lists.id, { @@ -857,19 +1215,50 @@ export const technologies_requirements_prerequisite_technologies = pgTable( ], ); +export const technologies_research_costs_resources = pgTable( + "technologies_research_costs_resources", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + resource: integer("resource_id") + .notNull() + .references(() => resources.id, { + onDelete: "set null", + }), + amount: numeric("amount", { mode: "number" }).notNull().default(1), + }, + (columns) => [ + index("technologies_research_costs_resources_order_idx").on(columns._order), + index("technologies_research_costs_resources_parent_id_idx").on(columns._parentID), + index("technologies_research_costs_resources_resource_idx").on(columns.resource), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [technologies.id], + name: "technologies_research_costs_resources_parent_id_fk", + }).onDelete("cascade"), + ], +); + export const technologies = pgTable( "technologies", { id: serial("id").primaryKey(), name: varchar("name").notNull(), + approvalStatus: enum_technologies_approval_status("approval_status") + .notNull() + .default("in_progress"), type: enum_technologies_type("type").notNull().default("upgrade"), summary: varchar("summary").notNull(), description: jsonb("description"), - requirements_intelligencePoints: numeric("requirements_intelligence_points"), - researchCosts_minimumResearchDuration: numeric("research_costs_minimum_research_duration") + researchCosts_minimumResearchDuration: numeric("research_costs_minimum_research_duration", { + mode: "number", + }) .notNull() - .default("0"), - researchCosts_maximumResearchDuration: numeric("research_costs_maximum_research_duration"), + .default(0), + researchCosts_maximumResearchDuration: numeric("research_costs_maximum_research_duration", { + mode: "number", + }), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) .defaultNow() .notNull(), @@ -916,7 +1305,7 @@ export const assets_crafting_crafting_data_inputs = pgTable( _order: integer("_order").notNull(), _parentID: integer("_parent_id").notNull(), id: varchar("id").primaryKey(), - quantity: numeric("quantity"), + quantity: numeric("quantity", { mode: "number" }), lended: boolean("lended"), }, (columns) => [ @@ -936,7 +1325,7 @@ export const assets_crafting_crafting_data_byproducts = pgTable( _order: integer("_order").notNull(), _parentID: integer("_parent_id").notNull(), id: varchar("id").primaryKey(), - quantity: numeric("quantity"), + quantity: numeric("quantity", { mode: "number" }), }, (columns) => [ index("assets_crafting_crafting_data_byproducts_order_idx").on(columns._order), @@ -954,6 +1343,7 @@ export const assets = pgTable( { id: serial("id").primaryKey(), name: varchar("name").notNull(), + approvalStatus: enum_assets_approval_status("approval_status").notNull().default("in_progress"), className: varchar("class_name").notNull().default(""), assetType: enum_assets_asset_type("asset_type").notNull().default("weapon"), "Weapon Configuration_slotType": enum_assets_weapon_configuration_slot_type( @@ -965,9 +1355,15 @@ export const assets = pgTable( "Nightvision Configuration_nvgHasThermals": boolean( "nightvision_configuration_nvg_has_thermals", ), - "Container Configuration_capacityKg": numeric("container_configuration_capacity_kg"), - "Container Configuration_weightKg": numeric("container_configuration_weight_kg"), - "Magazine Configuration_roundCapacity": numeric("magazine_configuration_round_capacity"), + "Container Configuration_capacityKg": numeric("container_configuration_capacity_kg", { + mode: "number", + }), + "Container Configuration_weightKg": numeric("container_configuration_weight_kg", { + mode: "number", + }), + "Magazine Configuration_roundCapacity": numeric("magazine_configuration_round_capacity", { + mode: "number", + }), "Magazine Configuration_ammoType": varchar("magazine_configuration_ammo_type"), "Magazine Configuration_greenmagCompatible": boolean( "magazine_configuration_greenmag_compatible", @@ -981,21 +1377,26 @@ export const assets = pgTable( marketTrading_Rarity: enum_assets_market_trading_rarity("market_trading_rarity"), marketTrading_perceivedValue_baseBuyPrice: numeric( "market_trading_perceived_value_base_buy_price", + { mode: "number" }, ), marketTrading_perceivedValue_baseSellPrice: numeric( "market_trading_perceived_value_base_sell_price", + { mode: "number" }, ), crafting_craftable: boolean("crafting_craftable"), crafting_blueprintRequired: boolean("crafting_blueprint_required"), crafting_technologyRequiredToUse: boolean("crafting_technology_required_to_use"), crafting_craftingData_craftingTimePerUnit: numeric( "crafting_crafting_data_crafting_time_per_unit", + { mode: "number" }, ) .notNull() - .default("1"), - crafting_craftingData_batchSize: numeric("crafting_crafting_data_batch_size") + .default(1), + crafting_craftingData_batchSize: numeric("crafting_crafting_data_batch_size", { + mode: "number", + }) .notNull() - .default("1"), + .default(1), isLive: boolean("is_live"), notes: jsonb("notes"), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) @@ -1068,18 +1469,26 @@ export const resources = pgTable( id: serial("id").primaryKey(), name: varchar("name").notNull(), codeName: varchar("code_name").notNull(), + approvalStatus: enum_resources_approval_status("approval_status") + .notNull() + .default("in_progress"), type: enum_resources_type("type").notNull().default("physical"), description: jsonb("description"), icon: integer("icon_id").references(() => media.id, { onDelete: "set null", }), color: varchar("color"), - baseValue: numeric("base_value").notNull().default("1"), + baseValue: numeric("base_value", { mode: "number" }).notNull().default(1), tradeable: boolean("tradeable"), rarity: enum_resources_rarity("rarity").notNull().default("common"), unitOfMeasure: varchar("unit_of_measure").notNull(), - massPerUnit: numeric("mass_per_unit").notNull().default("0"), - stackSize: numeric("stack_size").default("1"), + massPerUnit: numeric("mass_per_unit", { mode: "number" }).notNull().default(0), + stackSize: numeric("stack_size", { mode: "number" }).default(1), + gridWidth: numeric("grid_width", { mode: "number" }).notNull().default(1), + gridHeight: numeric("grid_height", { mode: "number" }).notNull().default(1), + stackable: boolean("stackable").default(true), + maxStackSize: numeric("max_stack_size", { mode: "number" }), + rotatable: boolean("rotatable").default(true), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) .defaultNow() .notNull(), @@ -1124,7 +1533,7 @@ export const vehicles_materials = pgTable( .references(() => resources.id, { onDelete: "set null", }), - amount: numeric("amount"), + amount: numeric("amount", { mode: "number" }), }, (columns) => [ index("vehicles_materials_order_idx").on(columns._order), @@ -1149,8 +1558,8 @@ export const vehicles_scrap_returns = pgTable( .references(() => resources.id, { onDelete: "set null", }), - amount: numeric("amount").default("1"), - chance: numeric("chance").default("100"), + amount: numeric("amount", { mode: "number" }).default(1), + chance: numeric("chance", { mode: "number" }).default(100), }, (columns) => [ index("vehicles_scrap_returns_order_idx").on(columns._order), @@ -1175,7 +1584,7 @@ export const vehicles_upkeep_costs = pgTable( .references(() => resources.id, { onDelete: "set null", }), - amount: numeric("amount").default("1"), + amount: numeric("amount", { mode: "number" }).default(1), }, (columns) => [ index("vehicles_upkeep_costs_order_idx").on(columns._order), @@ -1195,7 +1604,7 @@ export const vehicles_allowed_virtual_cargo = pgTable( _order: integer("_order").notNull(), _parentID: integer("_parent_id").notNull(), id: varchar("id").primaryKey(), - amount: numeric("amount").default("1"), + amount: numeric("amount", { mode: "number" }).default(1), }, (columns) => [ index("vehicles_allowed_virtual_cargo_order_idx").on(columns._order), @@ -1216,7 +1625,7 @@ export const vehicles_pylons = pgTable( id: varchar("id").primaryKey(), pylonName: varchar("pylon_name").notNull(), pylonType: enum_vehicles_pylons_pylon_type("pylon_type").notNull().default("mountedWeapon"), - amount: numeric("amount").default("1"), + amount: numeric("amount", { mode: "number" }).default(1), ammoType: integer("ammo_type_id").references(() => assets.id, { onDelete: "set null", }), @@ -1239,21 +1648,33 @@ export const vehicles = pgTable( id: serial("id").primaryKey(), name: varchar("name").notNull(), classname: varchar("classname"), - Description: jsonb("description"), + approvalStatus: enum_vehicles_approval_status("approval_status") + .notNull() + .default("in_progress"), + description: jsonb("description"), image: integer("image_id").references(() => media.id, { onDelete: "set null", }), - constructionTime: numeric("construction_time"), - width: numeric("width"), - height: numeric("height"), - maxMass: numeric("max_mass"), - aceCargoSlots: numeric("ace_cargo_slots"), - maxHealth: numeric("max_health"), + fuel_fuelType: integer("fuel_fuel_type_id") + .notNull() + .references(() => resources.id, { + onDelete: "set null", + }), + fuel_fuelCapacity: numeric("fuel_fuel_capacity", { mode: "number" }).notNull(), + fuel_fuelConsumptionRate: numeric("fuel_fuel_consumption_rate", { mode: "number" }) + .notNull() + .default(1), + constructionTime: numeric("construction_time", { mode: "number" }), + width: numeric("width", { mode: "number" }), + height: numeric("height", { mode: "number" }), + maxMass: numeric("max_mass", { mode: "number" }), + aceCargoSlots: numeric("ace_cargo_slots", { mode: "number" }), + maxHealth: numeric("max_health", { mode: "number" }), armorRating: enum_vehicles_armor_rating("armor_rating"), - maxSpeedOnRoad: numeric("max_speed_on_road"), - maxSpeedOffRoad: numeric("max_speed_off_road"), - maxAirspeed: numeric("max_airspeed"), - maxKnots: numeric("max_knots"), + maxSpeedOnRoad: numeric("max_speed_on_road", { mode: "number" }), + maxSpeedOffRoad: numeric("max_speed_off_road", { mode: "number" }), + maxAirspeed: numeric("max_airspeed", { mode: "number" }), + maxKnots: numeric("max_knots", { mode: "number" }), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) .defaultNow() .notNull(), @@ -1263,6 +1684,7 @@ export const vehicles = pgTable( }, (columns) => [ index("vehicles_image_idx").on(columns.image), + index("vehicles_fuel_fuel_fuel_type_idx").on(columns.fuel_fuelType), index("vehicles_updated_at_idx").on(columns.updatedAt), index("vehicles_created_at_idx").on(columns.createdAt), ], @@ -1327,7 +1749,7 @@ export const structures_materials = pgTable( .references(() => resources.id, { onDelete: "set null", }), - amount: numeric("amount"), + amount: numeric("amount", { mode: "number" }), }, (columns) => [ index("structures_materials_order_idx").on(columns._order), @@ -1350,7 +1772,7 @@ export const structures_resources_in_range = pgTable( resource: integer("resource_id").references(() => resources.id, { onDelete: "set null", }), - range: numeric("range"), + range: numeric("range", { mode: "number" }), }, (columns) => [ index("structures_resources_in_range_order_idx").on(columns._order), @@ -1373,7 +1795,7 @@ export const structures_structures_in_range = pgTable( structure: integer("structure_id").references(() => structures.id, { onDelete: "set null", }), - range: numeric("range"), + range: numeric("range", { mode: "number" }), }, (columns) => [ index("structures_structures_in_range_order_idx").on(columns._order), @@ -1396,7 +1818,7 @@ export const structures_upkeep = pgTable( resource: integer("resource_id").references(() => resources.id, { onDelete: "set null", }), - amount: numeric("amount"), + amount: numeric("amount", { mode: "number" }), }, (columns) => [ index("structures_upkeep_order_idx").on(columns._order), @@ -1416,11 +1838,16 @@ export const structures_auto_generated_resources = pgTable( _order: integer("_order").notNull(), _parentID: integer("_parent_id").notNull(), id: varchar("id").primaryKey(), - resource: integer("resource_id").references(() => resources.id, { - onDelete: "set null", - }), - amount: numeric("amount"), - frequency: varchar("frequency"), + resource: integer("resource_id") + .notNull() + .references(() => resources.id, { + onDelete: "set null", + }), + minAmount: numeric("min_amount", { mode: "number" }).notNull(), + maxAmount: numeric("max_amount", { mode: "number" }), + minFrequency: varchar("min_frequency").notNull().default(1), + maxFrequency: varchar("max_frequency"), + produceChance: numeric("produce_chance", { mode: "number" }).default(100), }, (columns) => [ index("structures_auto_generated_resources_order_idx").on(columns._order), @@ -1440,7 +1867,7 @@ export const structures_allowed_storage = pgTable( _order: integer("_order").notNull(), _parentID: integer("_parent_id").notNull(), id: varchar("id").primaryKey(), - amount: numeric("amount"), + amount: numeric("amount", { mode: "number" }), }, (columns) => [ index("structures_allowed_storage_order_idx").on(columns._order), @@ -1477,25 +1904,29 @@ export const structures = pgTable( id: serial("id").primaryKey(), name: varchar("name").notNull(), codeName: varchar("code_name").notNull(), + approvalStatus: enum_structures_approval_status("approval_status") + .notNull() + .default("in_progress"), description: jsonb("description").notNull(), image: integer("image_id").references(() => media.id, { onDelete: "set null", }), category: enum_structures_category("category").notNull(), - constructionTime: numeric("construction_time").notNull(), + constructionTime: numeric("construction_time", { mode: "number" }).notNull(), requiresUpgrade: boolean("requires_upgrade"), upgradesInto: integer("upgrades_into_id").references((): AnyPgColumn => structures.id, { onDelete: "set null", }), - upgradeCostMultiplier: numeric("upgrade_cost_multiplier").default("1"), + upgradeCostMultiplier: numeric("upgrade_cost_multiplier", { mode: "number" }).default(1), terrainType: enum_structures_terrain_type("terrain_type").notNull(), - sellPrice: numeric("sell_price"), + sellPrice: numeric("sell_price", { mode: "number" }), functionType: enum_structures_function_type("function_type"), - maxCapacityMass: numeric("max_capacity_mass"), - xSize: numeric("x_size"), - ySize: numeric("y_size"), - maxHealth: numeric("max_health").notNull(), - repairSpeed: numeric("repair_speed"), + maxCapacityMass: numeric("max_capacity_mass", { mode: "number" }), + restrictToAllowed: boolean("restrict_to_allowed").default(false), + xSize: numeric("x_size", { mode: "number" }), + ySize: numeric("y_size", { mode: "number" }), + maxHealth: numeric("max_health", { mode: "number" }).notNull(), + repairSpeed: numeric("repair_speed", { mode: "number" }), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) .defaultNow() .notNull(), @@ -1559,6 +1990,119 @@ export const structures_rels = pgTable( ], ); +export const shipments_cargo = pgTable( + "shipments_cargo", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + amount: numeric("amount", { mode: "number" }).notNull(), + }, + (columns) => [ + index("shipments_cargo_order_idx").on(columns._order), + index("shipments_cargo_parent_id_idx").on(columns._parentID), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [shipments.id], + name: "shipments_cargo_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const shipments = pgTable( + "shipments", + { + id: serial("id").primaryKey(), + name: varchar("name"), + origin: integer("origin_id") + .notNull() + .references(() => game_structures.id, { + onDelete: "set null", + }), + destination: integer("destination_id") + .notNull() + .references(() => game_structures.id, { + onDelete: "set null", + }), + transportVehicle: integer("transport_vehicle_id") + .notNull() + .references(() => game_vehicles.id, { + onDelete: "set null", + }), + distance: numeric("distance", { mode: "number" }).notNull(), + fuelCost: numeric("fuel_cost", { mode: "number" }).notNull(), + fuelConsumed: numeric("fuel_consumed", { mode: "number" }).default(0), + status: enum_shipments_status("status").notNull().default("pending"), + dispatchedAt: timestamp("dispatched_at", { mode: "string", withTimezone: true, precision: 3 }), + estimatedArrival: timestamp("estimated_arrival", { + mode: "string", + withTimezone: true, + precision: 3, + }), + completedAt: timestamp("completed_at", { mode: "string", withTimezone: true, precision: 3 }), + autoReturn: boolean("auto_return").default(false), + createdBy: integer("created_by_id").references(() => users.id, { + onDelete: "set null", + }), + failureReason: varchar("failure_reason"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }) + .defaultNow() + .notNull(), + }, + (columns) => [ + index("shipments_origin_idx").on(columns.origin), + index("shipments_destination_idx").on(columns.destination), + index("shipments_transport_vehicle_idx").on(columns.transportVehicle), + index("shipments_created_by_idx").on(columns.createdBy), + index("shipments_updated_at_idx").on(columns.updatedAt), + index("shipments_created_at_idx").on(columns.createdAt), + ], +); + +export const shipments_rels = pgTable( + "shipments_rels", + { + id: serial("id").primaryKey(), + order: integer("order"), + parent: integer("parent_id").notNull(), + path: varchar("path").notNull(), + resourcesID: integer("resources_id"), + assetsID: integer("assets_id"), + vehiclesID: integer("vehicles_id"), + }, + (columns) => [ + index("shipments_rels_order_idx").on(columns.order), + index("shipments_rels_parent_idx").on(columns.parent), + index("shipments_rels_path_idx").on(columns.path), + index("shipments_rels_resources_id_idx").on(columns.resourcesID), + index("shipments_rels_assets_id_idx").on(columns.assetsID), + index("shipments_rels_vehicles_id_idx").on(columns.vehiclesID), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [shipments.id], + name: "shipments_rels_parent_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["resourcesID"]], + foreignColumns: [resources.id], + name: "shipments_rels_resources_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["assetsID"]], + foreignColumns: [assets.id], + name: "shipments_rels_assets_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["vehiclesID"]], + foreignColumns: [vehicles.id], + name: "shipments_rels_vehicles_fk", + }).onDelete("cascade"), + ], +); + export const maps = pgTable( "maps", { @@ -1586,6 +2130,9 @@ export const narrative_events = pgTable( id: serial("id").primaryKey(), name: varchar("name").notNull(), summary: varchar("summary").notNull(), + flowData: jsonb("flow_data").notNull(), + triggers_type: enum_narrative_events_triggers_type("triggers_type").default("manual"), + triggers_condition: jsonb("triggers_condition"), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) .defaultNow() .notNull(), @@ -1619,11 +2166,11 @@ export const mission_files = pgTable( thumbnailURL: varchar("thumbnail_u_r_l"), filename: varchar("filename"), mimeType: varchar("mime_type"), - filesize: numeric("filesize"), - width: numeric("width"), - height: numeric("height"), - focalX: numeric("focal_x"), - focalY: numeric("focal_y"), + filesize: numeric("filesize", { mode: "number" }), + width: numeric("width", { mode: "number" }), + height: numeric("height", { mode: "number" }), + focalX: numeric("focal_x", { mode: "number" }), + focalY: numeric("focal_y", { mode: "number" }), }, (columns) => [ index("mission_files_author_idx").on(columns.author), @@ -1653,11 +2200,11 @@ export const mod_lists = pgTable( thumbnailURL: varchar("thumbnail_u_r_l"), filename: varchar("filename"), mimeType: varchar("mime_type"), - filesize: numeric("filesize"), - width: numeric("width"), - height: numeric("height"), - focalX: numeric("focal_x"), - focalY: numeric("focal_y"), + filesize: numeric("filesize", { mode: "number" }), + width: numeric("width", { mode: "number" }), + height: numeric("height", { mode: "number" }), + focalX: numeric("focal_x", { mode: "number" }), + focalY: numeric("focal_y", { mode: "number" }), }, (columns) => [ index("mod_lists_author_idx").on(columns.author), @@ -1667,6 +2214,16 @@ export const mod_lists = pgTable( ], ); +export const payload_kv = pgTable( + "payload_kv", + { + id: serial("id").primaryKey(), + key: varchar("key").notNull(), + data: jsonb("data").notNull(), + }, + (columns) => [uniqueIndex("payload_kv_key_idx").on(columns.key)], +); + export const payload_locked_documents = pgTable( "payload_locked_documents", { @@ -1694,12 +2251,17 @@ export const payload_locked_documents_rels = pgTable( parent: integer("parent_id").notNull(), path: varchar("path").notNull(), mediaID: integer("media_id"), + "game-hard-resourcesID": integer("game_hard_resources_id"), + "game-structuresID": integer("game_structures_id"), + "game-vehiclesID": integer("game_vehicles_id"), + "game-event-logsID": integer("game_event_logs_id"), usersID: integer("users_id"), ranksID: integer("ranks_id"), profilesID: integer("profiles_id"), awardsID: integer("awards_id"), qualificationsID: integer("qualifications_id"), assignmentsID: integer("assignments_id"), + experienceID: integer("experience_id"), missionsID: integer("missions_id"), campaignsID: integer("campaigns_id"), factionsID: integer("factions_id"), @@ -1708,6 +2270,7 @@ export const payload_locked_documents_rels = pgTable( resourcesID: integer("resources_id"), vehiclesID: integer("vehicles_id"), structuresID: integer("structures_id"), + shipmentsID: integer("shipments_id"), mapsID: integer("maps_id"), "narrative-eventsID": integer("narrative_events_id"), "mission-filesID": integer("mission_files_id"), @@ -1718,12 +2281,19 @@ export const payload_locked_documents_rels = pgTable( index("payload_locked_documents_rels_parent_idx").on(columns.parent), index("payload_locked_documents_rels_path_idx").on(columns.path), index("payload_locked_documents_rels_media_id_idx").on(columns.mediaID), + index("payload_locked_documents_rels_game_hard_resources_id_idx").on( + columns["game-hard-resourcesID"], + ), + index("payload_locked_documents_rels_game_structures_id_idx").on(columns["game-structuresID"]), + index("payload_locked_documents_rels_game_vehicles_id_idx").on(columns["game-vehiclesID"]), + index("payload_locked_documents_rels_game_event_logs_id_idx").on(columns["game-event-logsID"]), index("payload_locked_documents_rels_users_id_idx").on(columns.usersID), index("payload_locked_documents_rels_ranks_id_idx").on(columns.ranksID), index("payload_locked_documents_rels_profiles_id_idx").on(columns.profilesID), index("payload_locked_documents_rels_awards_id_idx").on(columns.awardsID), index("payload_locked_documents_rels_qualifications_id_idx").on(columns.qualificationsID), index("payload_locked_documents_rels_assignments_id_idx").on(columns.assignmentsID), + index("payload_locked_documents_rels_experience_id_idx").on(columns.experienceID), index("payload_locked_documents_rels_missions_id_idx").on(columns.missionsID), index("payload_locked_documents_rels_campaigns_id_idx").on(columns.campaignsID), index("payload_locked_documents_rels_factions_id_idx").on(columns.factionsID), @@ -1732,6 +2302,7 @@ export const payload_locked_documents_rels = pgTable( index("payload_locked_documents_rels_resources_id_idx").on(columns.resourcesID), index("payload_locked_documents_rels_vehicles_id_idx").on(columns.vehiclesID), index("payload_locked_documents_rels_structures_id_idx").on(columns.structuresID), + index("payload_locked_documents_rels_shipments_id_idx").on(columns.shipmentsID), index("payload_locked_documents_rels_maps_id_idx").on(columns.mapsID), index("payload_locked_documents_rels_narrative_events_id_idx").on( columns["narrative-eventsID"], @@ -1748,6 +2319,26 @@ export const payload_locked_documents_rels = pgTable( foreignColumns: [media.id], name: "payload_locked_documents_rels_media_fk", }).onDelete("cascade"), + foreignKey({ + columns: [columns["game-hard-resourcesID"]], + foreignColumns: [game_hard_resources.id], + name: "payload_locked_documents_rels_game_hard_resources_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["game-structuresID"]], + foreignColumns: [game_structures.id], + name: "payload_locked_documents_rels_game_structures_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["game-vehiclesID"]], + foreignColumns: [game_vehicles.id], + name: "payload_locked_documents_rels_game_vehicles_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["game-event-logsID"]], + foreignColumns: [game_event_logs.id], + name: "payload_locked_documents_rels_game_event_logs_fk", + }).onDelete("cascade"), foreignKey({ columns: [columns["usersID"]], foreignColumns: [users.id], @@ -1778,6 +2369,11 @@ export const payload_locked_documents_rels = pgTable( foreignColumns: [assignments.id], name: "payload_locked_documents_rels_assignments_fk", }).onDelete("cascade"), + foreignKey({ + columns: [columns["experienceID"]], + foreignColumns: [experience.id], + name: "payload_locked_documents_rels_experience_fk", + }).onDelete("cascade"), foreignKey({ columns: [columns["missionsID"]], foreignColumns: [missions.id], @@ -1818,6 +2414,11 @@ export const payload_locked_documents_rels = pgTable( foreignColumns: [structures.id], name: "payload_locked_documents_rels_structures_fk", }).onDelete("cascade"), + foreignKey({ + columns: [columns["shipmentsID"]], + foreignColumns: [shipments.id], + name: "payload_locked_documents_rels_shipments_fk", + }).onDelete("cascade"), foreignKey({ columns: [columns["mapsID"]], foreignColumns: [maps.id], @@ -1893,7 +2494,7 @@ export const payload_migrations = pgTable( { id: serial("id").primaryKey(), name: varchar("name"), - batch: numeric("batch"), + batch: numeric("batch", { mode: "number" }), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }) .defaultNow() .notNull(), @@ -1916,13 +2517,156 @@ export const game_rules = pgTable( .references(() => resources.id, { onDelete: "set null", }), + proximityThreshold: numeric("proximity_threshold", { mode: "number" }).default(10), + gameTickIntervalMinutes: numeric("game_tick_interval_minutes", { mode: "number" }).default(10), updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }), createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }), }, (columns) => [index("game_rules_main_currency_idx").on(columns.mainCurrency)], ); +export const game_rules_rels = pgTable( + "game_rules_rels", + { + id: serial("id").primaryKey(), + order: integer("order"), + parent: integer("parent_id").notNull(), + path: varchar("path").notNull(), + assignmentsID: integer("assignments_id"), + }, + (columns) => [ + index("game_rules_rels_order_idx").on(columns.order), + index("game_rules_rels_parent_idx").on(columns.parent), + index("game_rules_rels_path_idx").on(columns.path), + index("game_rules_rels_assignments_id_idx").on(columns.assignmentsID), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [game_rules.id], + name: "game_rules_rels_parent_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["assignmentsID"]], + foreignColumns: [assignments.id], + name: "game_rules_rels_assignments_fk", + }).onDelete("cascade"), + ], +); + export const relations_media = relations(media, () => ({})); +export const relations_game_hard_resources = relations(game_hard_resources, () => ({})); +export const relations_game_structures_stored_resources = relations( + game_structures_stored_resources, + ({ one }) => ({ + _parentID: one(game_structures, { + fields: [game_structures_stored_resources._parentID], + references: [game_structures.id], + relationName: "storedResources", + }), + resource: one(resources, { + fields: [game_structures_stored_resources.resource], + references: [resources.id], + relationName: "resource", + }), + }), +); +export const relations_game_structures_void_storage = relations( + game_structures_void_storage, + ({ one }) => ({ + _parentID: one(game_structures, { + fields: [game_structures_void_storage._parentID], + references: [game_structures.id], + relationName: "voidStorage", + }), + resource: one(resources, { + fields: [game_structures_void_storage.resource], + references: [resources.id], + relationName: "resource", + }), + }), +); +export const relations_game_structures = relations(game_structures, ({ one, many }) => ({ + type: one(structures, { + fields: [game_structures.type], + references: [structures.id], + relationName: "type", + }), + faction: one(factions, { + fields: [game_structures.faction], + references: [factions.id], + relationName: "faction", + }), + storedResources: many(game_structures_stored_resources, { + relationName: "storedResources", + }), + voidStorage: many(game_structures_void_storage, { + relationName: "voidStorage", + }), +})); +export const relations_game_vehicles_stored_resources = relations( + game_vehicles_stored_resources, + ({ one }) => ({ + _parentID: one(game_vehicles, { + fields: [game_vehicles_stored_resources._parentID], + references: [game_vehicles.id], + relationName: "storedResources", + }), + resource: one(resources, { + fields: [game_vehicles_stored_resources.resource], + references: [resources.id], + relationName: "resource", + }), + }), +); +export const relations_game_vehicles_void_storage = relations( + game_vehicles_void_storage, + ({ one }) => ({ + _parentID: one(game_vehicles, { + fields: [game_vehicles_void_storage._parentID], + references: [game_vehicles.id], + relationName: "voidStorage", + }), + resource: one(resources, { + fields: [game_vehicles_void_storage.resource], + references: [resources.id], + relationName: "resource", + }), + }), +); +export const relations_game_vehicles = relations(game_vehicles, ({ one, many }) => ({ + type: one(vehicles, { + fields: [game_vehicles.type], + references: [vehicles.id], + relationName: "type", + }), + deployedAt: one(game_structures, { + fields: [game_vehicles.deployedAt], + references: [game_structures.id], + relationName: "deployedAt", + }), + faction: one(factions, { + fields: [game_vehicles.faction], + references: [factions.id], + relationName: "faction", + }), + storedResources: many(game_vehicles_stored_resources, { + relationName: "storedResources", + }), + voidStorage: many(game_vehicles_void_storage, { + relationName: "voidStorage", + }), +})); +export const relations_game_event_logs = relations(game_event_logs, ({ one }) => ({ + actor: one(users, { + fields: [game_event_logs.actor], + references: [users.id], + relationName: "actor", + }), + structure: one(game_structures, { + fields: [game_event_logs.structure], + references: [game_structures.id], + relationName: "structure", + }), +})); export const relations_users_roles = relations(users_roles, ({ one }) => ({ parent: one(users, { fields: [users_roles.parent], @@ -1963,6 +2707,11 @@ export const relations_profiles_rels = relations(profiles_rels, ({ one }) => ({ references: [awards.id], relationName: "awards", }), + qualificationsID: one(qualifications, { + fields: [profiles_rels.qualificationsID], + references: [qualifications.id], + relationName: "qualifications", + }), })); export const relations_profiles = relations(profiles, ({ one, many }) => ({ user: one(users, { @@ -2014,6 +2763,7 @@ export const relations_assignments = relations(assignments, ({ one, many }) => ( relationName: "_rels", }), })); +export const relations_experience = relations(experience, () => ({})); export const relations_missions_mission_roles_provided_roles = relations( missions_mission_roles_provided_roles, ({ one }) => ({ @@ -2054,6 +2804,11 @@ export const relations_missions_factions_involved = relations( references: [missions.id], relationName: "factionsInvolved", }), + faction: one(factions, { + fields: [missions_factions_involved.faction], + references: [factions.id], + relationName: "faction", + }), }), ); export const relations_missions_logistics_and_support_insertion = relations( @@ -2190,6 +2945,21 @@ export const relations_technologies_requirements_prerequisite_technologies = rel }), }), ); +export const relations_technologies_research_costs_resources = relations( + technologies_research_costs_resources, + ({ one }) => ({ + _parentID: one(technologies, { + fields: [technologies_research_costs_resources._parentID], + references: [technologies.id], + relationName: "researchCosts_resources", + }), + resource: one(resources, { + fields: [technologies_research_costs_resources.resource], + references: [resources.id], + relationName: "resource", + }), + }), +); export const relations_technologies_rels = relations(technologies_rels, ({ one }) => ({ parent: one(technologies, { fields: [technologies_rels.parent], @@ -2206,6 +2976,9 @@ export const relations_technologies = relations(technologies, ({ many }) => ({ requirements_prerequisiteTechnologies: many(technologies_requirements_prerequisite_technologies, { relationName: "requirements_prerequisiteTechnologies", }), + researchCosts_resources: many(technologies_research_costs_resources, { + relationName: "researchCosts_resources", + }), _rels: many(technologies_rels, { relationName: "_rels", }), @@ -2381,6 +3154,11 @@ export const relations_vehicles = relations(vehicles, ({ one, many }) => ({ category: many(vehicles_category, { relationName: "category", }), + fuel_fuelType: one(resources, { + fields: [vehicles.fuel_fuelType], + references: [resources.id], + relationName: "fuel_fuelType", + }), materials: many(vehicles_materials, { relationName: "materials", }), @@ -2552,6 +3330,63 @@ export const relations_structures = relations(structures, ({ one, many }) => ({ relationName: "_rels", }), })); +export const relations_shipments_cargo = relations(shipments_cargo, ({ one }) => ({ + _parentID: one(shipments, { + fields: [shipments_cargo._parentID], + references: [shipments.id], + relationName: "cargo", + }), +})); +export const relations_shipments_rels = relations(shipments_rels, ({ one }) => ({ + parent: one(shipments, { + fields: [shipments_rels.parent], + references: [shipments.id], + relationName: "_rels", + }), + resourcesID: one(resources, { + fields: [shipments_rels.resourcesID], + references: [resources.id], + relationName: "resources", + }), + assetsID: one(assets, { + fields: [shipments_rels.assetsID], + references: [assets.id], + relationName: "assets", + }), + vehiclesID: one(vehicles, { + fields: [shipments_rels.vehiclesID], + references: [vehicles.id], + relationName: "vehicles", + }), +})); +export const relations_shipments = relations(shipments, ({ one, many }) => ({ + origin: one(game_structures, { + fields: [shipments.origin], + references: [game_structures.id], + relationName: "origin", + }), + destination: one(game_structures, { + fields: [shipments.destination], + references: [game_structures.id], + relationName: "destination", + }), + transportVehicle: one(game_vehicles, { + fields: [shipments.transportVehicle], + references: [game_vehicles.id], + relationName: "transportVehicle", + }), + cargo: many(shipments_cargo, { + relationName: "cargo", + }), + createdBy: one(users, { + fields: [shipments.createdBy], + references: [users.id], + relationName: "createdBy", + }), + _rels: many(shipments_rels, { + relationName: "_rels", + }), +})); export const relations_maps = relations(maps, () => ({})); export const relations_narrative_events = relations(narrative_events, () => ({})); export const relations_mission_files = relations(mission_files, ({ one }) => ({ @@ -2568,6 +3403,7 @@ export const relations_mod_lists = relations(mod_lists, ({ one }) => ({ relationName: "author", }), })); +export const relations_payload_kv = relations(payload_kv, () => ({})); export const relations_payload_locked_documents_rels = relations( payload_locked_documents_rels, ({ one }) => ({ @@ -2581,6 +3417,26 @@ export const relations_payload_locked_documents_rels = relations( references: [media.id], relationName: "media", }), + "game-hard-resourcesID": one(game_hard_resources, { + fields: [payload_locked_documents_rels["game-hard-resourcesID"]], + references: [game_hard_resources.id], + relationName: "game-hard-resources", + }), + "game-structuresID": one(game_structures, { + fields: [payload_locked_documents_rels["game-structuresID"]], + references: [game_structures.id], + relationName: "game-structures", + }), + "game-vehiclesID": one(game_vehicles, { + fields: [payload_locked_documents_rels["game-vehiclesID"]], + references: [game_vehicles.id], + relationName: "game-vehicles", + }), + "game-event-logsID": one(game_event_logs, { + fields: [payload_locked_documents_rels["game-event-logsID"]], + references: [game_event_logs.id], + relationName: "game-event-logs", + }), usersID: one(users, { fields: [payload_locked_documents_rels.usersID], references: [users.id], @@ -2611,6 +3467,11 @@ export const relations_payload_locked_documents_rels = relations( references: [assignments.id], relationName: "assignments", }), + experienceID: one(experience, { + fields: [payload_locked_documents_rels.experienceID], + references: [experience.id], + relationName: "experience", + }), missionsID: one(missions, { fields: [payload_locked_documents_rels.missionsID], references: [missions.id], @@ -2651,6 +3512,11 @@ export const relations_payload_locked_documents_rels = relations( references: [structures.id], relationName: "structures", }), + shipmentsID: one(shipments, { + fields: [payload_locked_documents_rels.shipmentsID], + references: [shipments.id], + relationName: "shipments", + }), mapsID: one(maps, { fields: [payload_locked_documents_rels.mapsID], references: [maps.id], @@ -2702,15 +3568,32 @@ export const relations_payload_preferences = relations(payload_preferences, ({ m }), })); export const relations_payload_migrations = relations(payload_migrations, () => ({})); -export const relations_game_rules = relations(game_rules, ({ one }) => ({ +export const relations_game_rules_rels = relations(game_rules_rels, ({ one }) => ({ + parent: one(game_rules, { + fields: [game_rules_rels.parent], + references: [game_rules.id], + relationName: "_rels", + }), + assignmentsID: one(assignments, { + fields: [game_rules_rels.assignmentsID], + references: [assignments.id], + relationName: "assignments", + }), +})); +export const relations_game_rules = relations(game_rules, ({ one, many }) => ({ mainCurrency: one(resources, { fields: [game_rules.mainCurrency], references: [resources.id], relationName: "mainCurrency", }), + _rels: many(game_rules_rels, { + relationName: "_rels", + }), })); type DatabaseSchema = { + enum_game_vehicles_status: typeof enum_game_vehicles_status; + enum_game_event_logs_target_collection: typeof enum_game_event_logs_target_collection; enum_users_roles: typeof enum_users_roles; enum_awards_type: typeof enum_awards_type; enum_assignments_type: typeof enum_assignments_type; @@ -2724,20 +3607,35 @@ type DatabaseSchema = { enum_missions_civilian_presence: typeof enum_missions_civilian_presence; enum_campaigns_status: typeof enum_campaigns_status; enum_factions_type: typeof enum_factions_type; + enum_technologies_approval_status: typeof enum_technologies_approval_status; enum_technologies_type: typeof enum_technologies_type; + enum_assets_approval_status: typeof enum_assets_approval_status; enum_assets_asset_type: typeof enum_assets_asset_type; enum_assets_weapon_configuration_slot_type: typeof enum_assets_weapon_configuration_slot_type; enum_assets_nightvision_configuration_nvg_generation: typeof enum_assets_nightvision_configuration_nvg_generation; enum_assets_market_trading_rarity: typeof enum_assets_market_trading_rarity; + enum_resources_approval_status: typeof enum_resources_approval_status; enum_resources_type: typeof enum_resources_type; enum_resources_rarity: typeof enum_resources_rarity; enum_vehicles_category: typeof enum_vehicles_category; enum_vehicles_pylons_pylon_type: typeof enum_vehicles_pylons_pylon_type; + enum_vehicles_approval_status: typeof enum_vehicles_approval_status; enum_vehicles_armor_rating: typeof enum_vehicles_armor_rating; + enum_structures_approval_status: typeof enum_structures_approval_status; enum_structures_category: typeof enum_structures_category; enum_structures_terrain_type: typeof enum_structures_terrain_type; enum_structures_function_type: typeof enum_structures_function_type; + enum_shipments_status: typeof enum_shipments_status; + enum_narrative_events_triggers_type: typeof enum_narrative_events_triggers_type; media: typeof media; + game_hard_resources: typeof game_hard_resources; + game_structures_stored_resources: typeof game_structures_stored_resources; + game_structures_void_storage: typeof game_structures_void_storage; + game_structures: typeof game_structures; + game_vehicles_stored_resources: typeof game_vehicles_stored_resources; + game_vehicles_void_storage: typeof game_vehicles_void_storage; + game_vehicles: typeof game_vehicles; + game_event_logs: typeof game_event_logs; users_roles: typeof users_roles; users_sessions: typeof users_sessions; users: typeof users; @@ -2748,6 +3646,7 @@ type DatabaseSchema = { qualifications: typeof qualifications; assignments: typeof assignments; assignments_rels: typeof assignments_rels; + experience: typeof experience; missions_mission_roles_provided_roles: typeof missions_mission_roles_provided_roles; missions_briefing: typeof missions_briefing; missions_mission_objectives: typeof missions_mission_objectives; @@ -2762,6 +3661,7 @@ type DatabaseSchema = { factions: typeof factions; factions_rels: typeof factions_rels; technologies_requirements_prerequisite_technologies: typeof technologies_requirements_prerequisite_technologies; + technologies_research_costs_resources: typeof technologies_research_costs_resources; technologies: typeof technologies; technologies_rels: typeof technologies_rels; assets_crafting_crafting_data_inputs: typeof assets_crafting_crafting_data_inputs; @@ -2786,17 +3686,30 @@ type DatabaseSchema = { structures_prohibited_storage: typeof structures_prohibited_storage; structures: typeof structures; structures_rels: typeof structures_rels; + shipments_cargo: typeof shipments_cargo; + shipments: typeof shipments; + shipments_rels: typeof shipments_rels; maps: typeof maps; narrative_events: typeof narrative_events; mission_files: typeof mission_files; mod_lists: typeof mod_lists; + payload_kv: typeof payload_kv; payload_locked_documents: typeof payload_locked_documents; payload_locked_documents_rels: typeof payload_locked_documents_rels; payload_preferences: typeof payload_preferences; payload_preferences_rels: typeof payload_preferences_rels; payload_migrations: typeof payload_migrations; game_rules: typeof game_rules; + game_rules_rels: typeof game_rules_rels; relations_media: typeof relations_media; + relations_game_hard_resources: typeof relations_game_hard_resources; + relations_game_structures_stored_resources: typeof relations_game_structures_stored_resources; + relations_game_structures_void_storage: typeof relations_game_structures_void_storage; + relations_game_structures: typeof relations_game_structures; + relations_game_vehicles_stored_resources: typeof relations_game_vehicles_stored_resources; + relations_game_vehicles_void_storage: typeof relations_game_vehicles_void_storage; + relations_game_vehicles: typeof relations_game_vehicles; + relations_game_event_logs: typeof relations_game_event_logs; relations_users_roles: typeof relations_users_roles; relations_users_sessions: typeof relations_users_sessions; relations_users: typeof relations_users; @@ -2807,6 +3720,7 @@ type DatabaseSchema = { relations_qualifications: typeof relations_qualifications; relations_assignments_rels: typeof relations_assignments_rels; relations_assignments: typeof relations_assignments; + relations_experience: typeof relations_experience; relations_missions_mission_roles_provided_roles: typeof relations_missions_mission_roles_provided_roles; relations_missions_briefing: typeof relations_missions_briefing; relations_missions_mission_objectives: typeof relations_missions_mission_objectives; @@ -2821,6 +3735,7 @@ type DatabaseSchema = { relations_factions_rels: typeof relations_factions_rels; relations_factions: typeof relations_factions; relations_technologies_requirements_prerequisite_technologies: typeof relations_technologies_requirements_prerequisite_technologies; + relations_technologies_research_costs_resources: typeof relations_technologies_research_costs_resources; relations_technologies_rels: typeof relations_technologies_rels; relations_technologies: typeof relations_technologies; relations_assets_crafting_crafting_data_inputs: typeof relations_assets_crafting_crafting_data_inputs; @@ -2845,15 +3760,20 @@ type DatabaseSchema = { relations_structures_prohibited_storage: typeof relations_structures_prohibited_storage; relations_structures_rels: typeof relations_structures_rels; relations_structures: typeof relations_structures; + relations_shipments_cargo: typeof relations_shipments_cargo; + relations_shipments_rels: typeof relations_shipments_rels; + relations_shipments: typeof relations_shipments; relations_maps: typeof relations_maps; relations_narrative_events: typeof relations_narrative_events; relations_mission_files: typeof relations_mission_files; relations_mod_lists: typeof relations_mod_lists; + relations_payload_kv: typeof relations_payload_kv; relations_payload_locked_documents_rels: typeof relations_payload_locked_documents_rels; relations_payload_locked_documents: typeof relations_payload_locked_documents; relations_payload_preferences_rels: typeof relations_payload_preferences_rels; relations_payload_preferences: typeof relations_payload_preferences; relations_payload_migrations: typeof relations_payload_migrations; + relations_game_rules_rels: typeof relations_game_rules_rels; relations_game_rules: typeof relations_game_rules; }; diff --git a/src/payload-types.ts b/src/payload-types.ts index 005590f..33eaf85 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -70,6 +70,7 @@ export interface Config { media: Media; 'game-hard-resources': GameHardResource; 'game-structures': GameStructure; + 'game-vehicles': GameVehicle; 'game-event-logs': GameEventLog; users: User; ranks: Rank; @@ -86,6 +87,7 @@ export interface Config { resources: Resource; vehicles: Vehicle; structures: Structure; + shipments: Shipment; maps: Map; 'narrative-events': NarrativeEvent; 'mission-files': MissionFile; @@ -107,6 +109,7 @@ export interface Config { media: MediaSelect | MediaSelect; 'game-hard-resources': GameHardResourcesSelect | GameHardResourcesSelect; 'game-structures': GameStructuresSelect | GameStructuresSelect; + 'game-vehicles': GameVehiclesSelect | GameVehiclesSelect; 'game-event-logs': GameEventLogsSelect | GameEventLogsSelect; users: UsersSelect | UsersSelect; ranks: RanksSelect | RanksSelect; @@ -123,6 +126,7 @@ export interface Config { resources: ResourcesSelect | ResourcesSelect; vehicles: VehiclesSelect | VehiclesSelect; structures: StructuresSelect | StructuresSelect; + shipments: ShipmentsSelect | ShipmentsSelect; maps: MapsSelect | MapsSelect; 'narrative-events': NarrativeEventsSelect | NarrativeEventsSelect; 'mission-files': MissionFilesSelect | MissionFilesSelect; @@ -143,9 +147,10 @@ export interface Config { 'game-rules': GameRulesSelect | GameRulesSelect; }; locale: null; - user: User & { - collection: 'users'; + widgets: { + collections: CollectionsWidget; }; + user: User; jobs: { tasks: unknown; workflows: unknown; @@ -423,6 +428,10 @@ export interface Structure { * The maximum storage capacity of this structure as mass (retrieved from the mass defined for every asset stored here.) */ maxCapacityMass?: number | null; + /** + * When enabled, ONLY the items listed in Allowed Storage can be stored here — everything else is rejected. When disabled, the Allowed Storage list still enforces per-item quantity caps, but other items are permitted up to the mass capacity. + */ + restrictToAllowed?: boolean | null; xSize?: number | null; ySize?: number | null; allowedStorage?: @@ -810,6 +819,23 @@ export interface Vehicle { } | null; image?: (number | null) | Media; category?: ('civilian' | 'utility' | 'transport' | 'weaponized' | 'military')[] | null; + /** + * Fuel configuration for this vehicle. Defines what fuel type it uses, how much it can hold, and how fast it consumes fuel. + */ + fuel: { + /** + * The type of fuel this vehicle consumes (e.g., gasoline, diesel, jet fuel). + */ + fuelType: number | Resource; + /** + * Maximum fuel units this vehicle's tank can hold. + */ + fuelCapacity: number; + /** + * Fuel consumed per unit of distance traveled. + */ + fuelConsumptionRate: number; + }; materials?: | { resource: number | Resource; @@ -965,6 +991,63 @@ export interface Campaign { updatedAt: string; createdAt: string; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "game-vehicles". + */ +export interface GameVehicle { + id: number; + /** + * Display name or callsign for this vehicle instance. + */ + name: string; + /** + * The vehicle type/template this instance is based on. + */ + type: number | Vehicle; + /** + * The structure where this vehicle is currently stationed. Null if in transit. + */ + deployedAt?: (number | null) | GameStructure; + /** + * The faction that owns this vehicle. + */ + faction?: (number | null) | Faction; + status: 'idle' | 'assigned' | 'in_transit' | 'damaged' | 'destroyed'; + /** + * Current fuel level. Must be between 0 and the vehicle type's fuel capacity. + */ + currentFuel: number; + /** + * Current health. Must be between 0 and the vehicle type's max health. + */ + currentHealth: number; + storedResources?: + | { + resource: number | Resource; + amount: number; + gridX: number; + gridY: number; + rotated?: boolean | null; + id?: string | null; + }[] + | null; + /** + * Items displaced by grid resizing. + */ + voidStorage?: + | { + resource: number | Resource; + amount: number; + gridX: number; + gridY: number; + rotated?: boolean | null; + id?: string | null; + }[] + | null; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "game-event-logs". @@ -986,6 +1069,7 @@ export interface GameEventLog { targetCollection?: | ( | 'game-structures' + | 'game-vehicles' | 'structures' | 'resources' | 'assets' @@ -996,6 +1080,7 @@ export interface GameEventLog { | 'users' | 'technologies' | 'maps' + | 'shipments' ) | null; targetId?: number | null; @@ -1040,6 +1125,7 @@ export interface User { }[] | null; password?: string | null; + collection: 'users'; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -1462,6 +1548,67 @@ export interface ModList { focalX?: number | null; focalY?: number | null; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "shipments". + */ +export interface Shipment { + id: number; + /** + * Shipment label. Auto-generated if left empty. + */ + name?: string | null; + origin: number | GameStructure; + destination: number | GameStructure; + /** + * The vehicle instance transporting this shipment. + */ + transportVehicle: number | GameVehicle; + /** + * Euclidean distance between origin and destination. + */ + distance: number; + cargo: { + item: + | { + relationTo: 'resources'; + value: number | Resource; + } + | { + relationTo: 'assets'; + value: number | Asset; + } + | { + relationTo: 'vehicles'; + value: number | Vehicle; + }; + amount: number; + id?: string | null; + }[]; + /** + * Total fuel required for the entire trip. + */ + fuelCost: number; + /** + * Fuel consumed so far during transit. + */ + fuelConsumed?: number | null; + status: 'pending' | 'dispatched' | 'in_transit' | 'arrived' | 'completed' | 'cancelled' | 'failed' | 'stranded'; + dispatchedAt?: string | null; + estimatedArrival?: string | null; + completedAt?: string | null; + /** + * If true, the vehicle will automatically return to its origin after completing this shipment. + */ + autoReturn?: boolean | null; + createdBy?: (number | null) | User; + /** + * Reason for failure or stranding. + */ + failureReason?: string | null; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "narrative-events". @@ -1539,6 +1686,10 @@ export interface PayloadLockedDocument { relationTo: 'game-structures'; value: number | GameStructure; } | null) + | ({ + relationTo: 'game-vehicles'; + value: number | GameVehicle; + } | null) | ({ relationTo: 'game-event-logs'; value: number | GameEventLog; @@ -1603,6 +1754,10 @@ export interface PayloadLockedDocument { relationTo: 'structures'; value: number | Structure; } | null) + | ({ + relationTo: 'shipments'; + value: number | Shipment; + } | null) | ({ relationTo: 'maps'; value: number | Map; @@ -1722,6 +1877,41 @@ export interface GameStructuresSelect { updatedAt?: T; createdAt?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "game-vehicles_select". + */ +export interface GameVehiclesSelect { + name?: T; + type?: T; + deployedAt?: T; + faction?: T; + status?: T; + currentFuel?: T; + currentHealth?: T; + storedResources?: + | T + | { + resource?: T; + amount?: T; + gridX?: T; + gridY?: T; + rotated?: T; + id?: T; + }; + voidStorage?: + | T + | { + resource?: T; + amount?: T; + gridX?: T; + gridY?: T; + rotated?: T; + id?: T; + }; + updatedAt?: T; + createdAt?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "game-event-logs_select". @@ -2180,6 +2370,13 @@ export interface VehiclesSelect { description?: T; image?: T; category?: T; + fuel?: + | T + | { + fuelType?: T; + fuelCapacity?: T; + fuelConsumptionRate?: T; + }; materials?: | T | { @@ -2294,6 +2491,7 @@ export interface StructuresSelect { id?: T; }; maxCapacityMass?: T; + restrictToAllowed?: T; xSize?: T; ySize?: T; allowedStorage?: @@ -2314,6 +2512,35 @@ export interface StructuresSelect { updatedAt?: T; createdAt?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "shipments_select". + */ +export interface ShipmentsSelect { + name?: T; + origin?: T; + destination?: T; + transportVehicle?: T; + distance?: T; + cargo?: + | T + | { + item?: T; + amount?: T; + id?: T; + }; + fuelCost?: T; + fuelConsumed?: T; + status?: T; + dispatchedAt?: T; + estimatedArrival?: T; + completedAt?: T; + autoReturn?: T; + createdBy?: T; + failureReason?: T; + updatedAt?: T; + createdAt?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "maps_select". @@ -2437,6 +2664,14 @@ export interface GameRule { * Assignment(s) considered the intelligence division. Members and leaders of these assignments get elevated access to draft missions and intelligence content. */ intelAssignments?: (number | Assignment)[] | null; + /** + * Distance threshold for instant transfers. Structures within this distance can transfer resources instantly. Beyond this, shipments are required. + */ + proximityThreshold?: number | null; + /** + * How often the game tick runs, in minutes. This processes shipment movement, fuel consumption, and arrivals. + */ + gameTickIntervalMinutes?: number | null; updatedAt?: string | null; createdAt?: string | null; } @@ -2448,10 +2683,22 @@ export interface GameRulesSelect { mainCurrency?: T; commandAssignments?: T; intelAssignments?: T; + proximityThreshold?: T; + gameTickIntervalMinutes?: T; updatedAt?: T; createdAt?: T; globalType?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "collections_widget". + */ +export interface CollectionsWidget { + data?: { + [k: string]: unknown; + }; + width: 'full'; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "auth".