Project ROUNDTABLE Docs
Data model

Commands and portfolios

Navy organizational hierarchy and PAE routing nodes

A command is an organizational unit such as a Systems Command (SYSCOM), Program Executive Office (PEO), or warfare center. A portfolio node is a technical area associated with a command. Together they tell ROUNDTABLE both where government work belongs and which point of contact (POC) should receive a relevant submission.

Command

ColumnPrisma typeRequired?DefaultMeaning
idStringYescuid()Command identifier.
nameStringYes; uniqueNoneFull organization name.
abbreviationStringYes; uniqueNoneShort display and seed lookup name.
echelonStringYesNoneHuman-readable level such as SYSCOM, PEO, or Warfare Center.
parentIdString?NoNULLParent command; null means top-level.
locationString?NoNULLHeadquarters or primary location.
missionString?NoNULLPlain-language mission statement.

The parent and children relation fields form the self-referencing command tree. users, portfolioNodes, and engagements connect the command to the rest of the ledger.

PortfolioNode

ColumnPrisma typeRequired?DefaultMeaning
idStringYescuid()Technical-node identifier.
nameStringYesNonePortfolio label.
descriptionString?NoNULLExplanation of the technical area.
techTagsStringYesNoneLowercase comma-separated routing vocabulary.
commandIdStringYesNoneOwning command.
parentIdString?NoNULLOptional parent portfolio node.

The portfolio also has command, parent, children, interestProfiles, and submissionMatches relations. The seed creates ten examples: AI/ML & Autonomy, C4I & Networks, Cyber & Information Warfare, Unmanned Maritime Systems, Undersea Warfare, Naval Aviation Systems, Enterprise IT & Cloud, Energetics & Directed Energy, Logistics & Sustainment, and Expeditionary & Littoral.

Seeded hierarchy

The seed creates top-level Systems Commands and attaches warfare centers and PEOs below them. “RDT&E” means research, development, test, and evaluation; “C4I” means command, control, communications, computers, and intelligence.

The diagram is a conceptual subset of the seed's command list. The authoritative parent mapping is COMMAND_PARENTS in prisma/seed.ts; manual reorganization is preserved when a command already exists.

Why hierarchy matters

getDescendantCommandIds() walks parentId downward. getScopedCommandIds() deliberately returns ALL for GOV_ADMIN and GOV_SYSTEM_ADMIN, but only the user's own command for other roles. This means a command lead assigned to NAVSEA does not automatically gain access to NSWC Dahlgren. Hierarchy inheritance is reserved for system-admin authority, not ordinary command visibility.

Portfolio matching

A submission's organization tags and submission tags are compared with each node's techTags. A strong match creates SubmissionMatch records and can notify the node's POC. A portfolio node is not a user and does not itself receive mail; its related InterestProfile users do.

Foreign keys and invariants

Command.parentId and PortfolioNode.parentId are nullable self-foreign keys. A null parent is a top-level node. The schema does not encode a maximum depth, so UI and hierarchy helpers should traverse until no parent remains. The command reparent route adds explicit self and cycle validation because a relational foreign key alone would allow a cycle.

PortfolioNode.commandId is required. Every routing node therefore belongs to a command even when it has a parent portfolio node. InterestProfile.portfolioNodeId is optional because a POC can rely only on free-form tags and keywords.

The schema has unique constraints on command full name and abbreviation. Seed lookups use abbreviation for parent assignment and name for portfolio/organization idempotence; changing either value affects future seed behavior.