diff --git a/src/migrations/index.ts b/src/migrations/index.ts index 79fc7d5..191c670 100644 --- a/src/migrations/index.ts +++ b/src/migrations/index.ts @@ -4,6 +4,7 @@ import * as migration_20260826_050000_repair_shims_auxiliary_tables from './2026 import * as migration_20260826_060000_add_game_servers_event_target from './20260826_060000_add_game_servers_event_target'; import * as migration_20260827_005757 from './20260827_005757'; import * as migration_20260827_022334_add_eod_minesweeper_best_flags from './20260827_022334_add_eod_minesweeper_best_flags'; +import * as migration_20260827_213857_add_evaluations_collection from './20260827_213857_add_evaluations_collection'; export const migrations = [ { @@ -34,6 +35,11 @@ export const migrations = [ { up: migration_20260827_022334_add_eod_minesweeper_best_flags.up, down: migration_20260827_022334_add_eod_minesweeper_best_flags.down, - name: '20260827_022334_add_eod_minesweeper_best_flags' + name: '20260827_022334_add_eod_minesweeper_best_flags', + }, + { + up: migration_20260827_213857_add_evaluations_collection.up, + down: migration_20260827_213857_add_evaluations_collection.down, + name: '20260827_213857_add_evaluations_collection' }, ]; diff --git a/src/payload-types.ts b/src/payload-types.ts index 69e345b..5c9d9fe 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -83,6 +83,7 @@ export interface Config { assignments: Assignment; experience: Experience; 'user-notifications': UserNotification; + evaluations: Evaluation; missions: Mission; 'mission-attendances': MissionAttendance; campaigns: Campaign; @@ -143,6 +144,7 @@ export interface Config { assignments: AssignmentsSelect | AssignmentsSelect; experience: ExperienceSelect | ExperienceSelect; 'user-notifications': UserNotificationsSelect | UserNotificationsSelect; + evaluations: EvaluationsSelect | EvaluationsSelect; missions: MissionsSelect | MissionsSelect; 'mission-attendances': MissionAttendancesSelect | MissionAttendancesSelect; campaigns: CampaignsSelect | CampaignsSelect; @@ -1282,6 +1284,10 @@ export interface Role { | 'user-notifications:read' | 'user-notifications:update' | 'user-notifications:delete' + | 'evaluations:create' + | 'evaluations:read' + | 'evaluations:update' + | 'evaluations:delete' | 'missions:create' | 'missions:read' | 'missions:update' @@ -1585,6 +1591,7 @@ export interface GameEventLog { | 'loadouts' | 'market-listings' | 'market-negotiations' + | 'evaluations' | 'tickets' | 'game-servers' ) @@ -1844,6 +1851,27 @@ export interface UserNotification { updatedAt: string; createdAt: string; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "evaluations". + */ +export interface Evaluation { + id: number; + /** + * Who submitted this evaluation. Private — only visible to users with evaluations:read. + */ + rater: number | User; + ratee: number | User; + mission: number | Mission; + kind: 'leader-direct' | 'leader-indirect' | 'subordinate'; + level: 'exceptional' | 'excellent' | 'proficient' | 'adequate' | 'moderate' | 'under-review'; + /** + * Private free-text note. Never shown to normal users; managers only. + */ + comment?: string | null; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "missions". @@ -3029,6 +3057,10 @@ export interface PayloadLockedDocument { relationTo: 'user-notifications'; value: number | UserNotification; } | null) + | ({ + relationTo: 'evaluations'; + value: number | Evaluation; + } | null) | ({ relationTo: 'missions'; value: number | Mission; @@ -3556,6 +3588,20 @@ export interface UserNotificationsSelect { updatedAt?: T; createdAt?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "evaluations_select". + */ +export interface EvaluationsSelect { + rater?: T; + ratee?: T; + mission?: T; + kind?: T; + level?: T; + comment?: T; + updatedAt?: T; + createdAt?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "missions_select". diff --git a/src/payload.config.ts b/src/payload.config.ts index 8a2eacc..ce39347 100644 --- a/src/payload.config.ts +++ b/src/payload.config.ts @@ -46,6 +46,7 @@ import { Loadouts } from "@/collections/locker/Loadouts"; import { MarketListings } from "@/collections/market/MarketListings"; import { MarketNegotiations } from "@/collections/market/MarketNegotiations"; import { UserNotifications } from "@/collections/users/UserNotifications"; +import { Evaluations } from "@/collections/users/Evaluations"; import { Tickets } from "@/collections/tickets/Tickets"; import { Projects } from "@/collections/projects/Projects"; import { Sprints } from "@/collections/projects/Sprints"; @@ -203,6 +204,7 @@ export default buildConfig({ Assignments, Experience, UserNotifications, + Evaluations, // Intel Missions, @@ -313,6 +315,7 @@ export default buildConfig({ [Assignments.slug]: true, [Experience.slug]: true, [UserNotifications.slug]: true, + [Evaluations.slug]: true, // Intel [Missions.slug]: true,