diff --git a/src/collections/intelligence/Technologies.ts b/src/collections/intelligence/Technologies.ts index 4d9d22e..f1dd235 100644 --- a/src/collections/intelligence/Technologies.ts +++ b/src/collections/intelligence/Technologies.ts @@ -1,5 +1,5 @@ import { CollectionConfig } from "payload"; -import { isAdmin } from "@/utils/access-control/isRole"; +import { isAdmin, isDeveloper } from "@/utils/access-control/isRole"; export const Technologies: CollectionConfig = { slug: "technologies", @@ -19,6 +19,33 @@ export const Technologies: CollectionConfig = { type: "text", required: true, }, + { + name: "approvalStatus", + type: "select", + label: "Approval Status", + options: [ + { label: "In Progress", value: "in_progress" }, + { label: "Ready for Review", value: "ready_for_review" }, + { label: "Approved", value: "approved" }, + { label: "Rejected", value: "rejected" }, + { label: "Revision Requested", value: "revision_requested" }, + ], + defaultValue: "in_progress", + filterOptions: ({ options, data, req }) => { + return !isDeveloper({ req }) + ? options.filter((option) => + typeof option === "string" + ? options + : ["in_progress", "ready_for_review"].includes(option.value), + ) + : options; + }, + required: true, + admin: { + description: + "Mark whether this technology is ready for developer approval and implementation into the live environment.", + }, + }, { name: "type", type: "select", diff --git a/src/collections/logistics/Assets.ts b/src/collections/logistics/Assets.ts index 5d2f9fd..2921b5e 100644 --- a/src/collections/logistics/Assets.ts +++ b/src/collections/logistics/Assets.ts @@ -13,6 +13,33 @@ export const Assets: CollectionConfig = { type: "text", required: true, }, + { + name: "approvalStatus", + type: "select", + label: "Approval Status", + options: [ + { label: "In Progress", value: "in_progress" }, + { label: "Ready for Review", value: "ready_for_review" }, + { label: "Approved", value: "approved" }, + { label: "Rejected", value: "rejected" }, + { label: "Revision Requested", value: "revision_requested" }, + ], + defaultValue: "in_progress", + filterOptions: ({ options, data, req }) => { + return !isDeveloper({ req }) + ? options.filter((option) => + typeof option === "string" + ? options + : ["in_progress", "ready_for_review"].includes(option.value), + ) + : options; + }, + required: true, + admin: { + description: + "Mark whether this asset is ready for developer approval and implementation into the live environment.", + }, + }, { type: "tabs", tabs: [ diff --git a/src/collections/logistics/Resources.ts b/src/collections/logistics/Resources.ts index cf43ebd..8fc1b27 100644 --- a/src/collections/logistics/Resources.ts +++ b/src/collections/logistics/Resources.ts @@ -109,6 +109,33 @@ export const Resources: CollectionConfig = { description: 'Internal ID for scripts (e.g., "res_fuel").', }, }, + { + name: "approvalStatus", + type: "select", + label: "Approval Status", + options: [ + { label: "In Progress", value: "in_progress" }, + { label: "Ready for Review", value: "ready_for_review" }, + { label: "Approved", value: "approved" }, + { label: "Rejected", value: "rejected" }, + { label: "Revision Requested", value: "revision_requested" }, + ], + defaultValue: "in_progress", + filterOptions: ({ options, data, req }) => { + return !isDeveloper({ req }) + ? options.filter((option) => + typeof option === "string" + ? options + : ["in_progress", "ready_for_review"].includes(option.value), + ) + : options; + }, + required: true, + admin: { + description: + "Mark whether this resource is ready for developer approval and implementation into the live environment.", + }, + }, { name: "type", type: "select", diff --git a/src/collections/logistics/Structures.ts b/src/collections/logistics/Structures.ts index c4d3c80..9ca8277 100644 --- a/src/collections/logistics/Structures.ts +++ b/src/collections/logistics/Structures.ts @@ -1,4 +1,5 @@ import { CollectionConfig } from "payload"; +import { isDeveloper } from "@/utils/access-control/isRole"; export const Structures: CollectionConfig = { slug: "structures", @@ -27,6 +28,33 @@ export const Structures: CollectionConfig = { description: 'Internal ID for scripts (e.g., "fob_alpha_tier1").', }, }, + { + name: "approvalStatus", + type: "select", + label: "Approval Status", + options: [ + { label: "In Progress", value: "in_progress" }, + { label: "Ready for Review", value: "ready_for_review" }, + { label: "Approved", value: "approved" }, + { label: "Rejected", value: "rejected" }, + { label: "Revision Requested", value: "revision_requested" }, + ], + defaultValue: "in_progress", + filterOptions: ({ options, data, req }) => { + return !isDeveloper({ req }) + ? options.filter((option) => + typeof option === "string" + ? options + : ["in_progress", "ready_for_review"].includes(option.value), + ) + : options; + }, + required: true, + admin: { + description: + "Mark whether this structure is ready for developer approval and implementation into the live environment.", + }, + }, { name: "description", type: "richText", diff --git a/src/collections/logistics/Vehicles.ts b/src/collections/logistics/Vehicles.ts index 5459cfa..4c7226f 100644 --- a/src/collections/logistics/Vehicles.ts +++ b/src/collections/logistics/Vehicles.ts @@ -1,4 +1,5 @@ import { CollectionConfig } from "payload"; +import { isDeveloper } from "@/utils/access-control/isRole"; export const Vehicles: CollectionConfig = { slug: "vehicles", @@ -25,7 +26,34 @@ export const Vehicles: CollectionConfig = { }, }, { - name: "Description", + name: "approvalStatus", + type: "select", + label: "Approval Status", + options: [ + { label: "In Progress", value: "in_progress" }, + { label: "Ready for Review", value: "ready_for_review" }, + { label: "Approved", value: "approved" }, + { label: "Rejected", value: "rejected" }, + { label: "Revision Requested", value: "revision_requested" }, + ], + defaultValue: "in_progress", + filterOptions: ({ options, data, req }) => { + return !isDeveloper({ req }) + ? options.filter((option) => + typeof option === "string" + ? options + : ["in_progress", "ready_for_review"].includes(option.value), + ) + : options; + }, + required: true, + admin: { + description: + "Mark whether this vehicle is ready for developer approval and implementation into the live environment.", + }, + }, + { + name: "description", type: "richText", admin: { description: diff --git a/src/payload-types.ts b/src/payload-types.ts index ecde44a..19813e5 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -255,6 +255,10 @@ export interface Structure { * Internal ID for scripts (e.g., "fob_alpha_tier1"). */ codeName: string; + /** + * Mark whether this structure is ready for developer approval and implementation into the live environment. + */ + approvalStatus: 'in_progress' | 'ready_for_review' | 'approved' | 'rejected' | 'revision_requested'; /** * A detailed description of the structure, including details like tactical advantages, resource production, and/or world lore regarding this structure. */ @@ -456,6 +460,10 @@ export interface Resource { * Internal ID for scripts (e.g., "res_fuel"). */ codeName: string; + /** + * Mark whether this resource is ready for developer approval and implementation into the live environment. + */ + approvalStatus: 'in_progress' | 'ready_for_review' | 'approved' | 'rejected' | 'revision_requested'; type: 'physical' | 'fluid' | 'energy' | 'abstract'; /** * A description of the resource, including where it comes from, how it is used, and any lore-related details. @@ -514,6 +522,10 @@ export interface Resource { export interface Technology { id: number; name: string; + /** + * Mark whether this technology is ready for developer approval and implementation into the live environment. + */ + approvalStatus: 'in_progress' | 'ready_for_review' | 'approved' | 'rejected' | 'revision_requested'; /** * An "Asset" technology will unlock a new item, vehicle, gear piece, structure, etc. An "Upgrade" technology will unlock an improvement to an Asset, like faster build speed, more storage capacity, etc. */ @@ -574,6 +586,10 @@ export interface Technology { export interface Asset { id: number; name: string; + /** + * Mark whether this asset is ready for developer approval and implementation into the live environment. + */ + approvalStatus: 'in_progress' | 'ready_for_review' | 'approved' | 'rejected' | 'revision_requested'; className: string; assetType: | 'weapon' @@ -719,10 +735,14 @@ export interface Vehicle { * If not provided, this vehicle will ONLY be available as a virtual asset (i.e., cannot be used in Arma.) */ classname?: string | null; + /** + * Mark whether this vehicle is ready for developer approval and implementation into the live environment. + */ + approvalStatus: 'in_progress' | 'ready_for_review' | 'approved' | 'rejected' | 'revision_requested'; /** * A detailed description of the vehicle, including details like tactical usage, mechanical details, and/or world lore regarding this vehicle. */ - Description?: { + description?: { root: { type: string; children: { @@ -1809,6 +1829,7 @@ export interface FactionsSelect { */ export interface TechnologiesSelect { name?: T; + approvalStatus?: T; type?: T; summary?: T; description?: T; @@ -1853,6 +1874,7 @@ export interface TechnologiesSelect { */ export interface AssetsSelect { name?: T; + approvalStatus?: T; className?: T; assetType?: T; 'Weapon Configuration'?: @@ -1944,6 +1966,7 @@ export interface ResourcesSelect { showWarning?: T; name?: T; codeName?: T; + approvalStatus?: T; type?: T; description?: T; icon?: T; @@ -1964,7 +1987,8 @@ export interface ResourcesSelect { export interface VehiclesSelect { name?: T; classname?: T; - Description?: T; + approvalStatus?: T; + description?: T; image?: T; category?: T; materials?: @@ -2028,6 +2052,7 @@ export interface VehiclesSelect { export interface StructuresSelect { name?: T; codeName?: T; + approvalStatus?: T; description?: T; image?: T; category?: T;