MC/website/control-panel/clan-institutions.mjs
2026-11-27 23:43:05 +00:00

12 lines
1 KiB
JavaScript

export const CLAN_INSTITUTION_SCHEMA=`CREATE TABLE IF NOT EXISTS site_clan_institutions (
clan_id CHAR(36) PRIMARY KEY,institution_key VARCHAR(24) NOT NULL UNIQUE,
member_limit INTEGER NOT NULL DEFAULT 5,franchise_terms INTEGER NOT NULL DEFAULT 5,
recruitment_open INTEGER NOT NULL DEFAULT 0,custodian_user_id CHAR(36) NOT NULL,
FOREIGN KEY(clan_id) REFERENCES site_clans(id),FOREIGN KEY(custodian_user_id) REFERENCES site_accounts(id))`;
export function institutionalClanDenial(institution,action,body={}){
if(!institution)return null;
if(['archive','transfer','edit'].includes(action))return 'This institution has a permanent identity. Its franchise cannot be sold, transferred or conquered through ordinary clan management.';
if(action==='request'||action==='review'&&body.decision==='accept')return 'Institution membership is reserved for its authorised franchise roster. Recruitment is not open.';
if(action==='role'||action==='remove')return 'The institution roster is managed through its franchise.';
return null;
}