1
0
Fork 0
polaris-task-force/src/collections/users/Ranks.ts
Z8MB1E 8d92e7aaa9 feat(promotions): add rank promotion ceiling with GM promote flow
Promotion service lib, ceiling field on Ranks, permission gate, migration, and GM promote button with tests.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-09-14 15:37:05 -04:00

49 lines
1 KiB
TypeScript

import { CollectionConfig } from "payload";
import { requirePermission } from "@/utils/access-control/hasPermission";
export const Ranks: CollectionConfig = {
slug: "ranks",
access: {
create: requirePermission("ranks:create"),
update: requirePermission("ranks:update"),
delete: requirePermission("ranks:delete"),
},
admin: {
useAsTitle: "name",
group: "Users",
},
orderable: true,
fields: [
{
name: "name",
type: "text",
required: true,
unique: true,
},
{
name: "abbreviation",
type: "text",
required: true,
unique: true,
},
{
name: "description",
type: "text",
required: true,
},
{
name: "insignia",
type: "upload",
relationTo: "media",
},
{
name: "promotionCeiling",
type: "relationship",
relationTo: "ranks",
admin: {
description:
"Holders of this rank may promote members up to and including this rank. Leave empty for no promotion authority.",
},
},
],
};