Skip to main content
MongoDB database name is taken from MONGODB_URI (typically d79-directory). Collection relationships and the ownership vs collaboration split are on Data relationships. Schema map Caption: Add ER-style diagram: User 1—n FormSubmission, FormSubmission 1—n FormComment, FormTemplate versions, SchoolYearSettings per year, AuditLog.

User

Collection: users Indexes: { email, isActive }, { schoolName, isActive }, { assignedForms.formId }.

FormSubmission

Collection: formsubmissions formData[stepKey] shape:
Partial unique index schoolName_schoolYear_unique on { schoolName: 1, schoolYear: 1 } (only when schoolYear is a non-empty string). Duplicate and create routes return 409 when a school already has a plan for that year. Super Admin System reports whether this index is present.

FormTemplate

Collection: formtemplates
  • Unique version
  • status: draft | published | archived
  • schoolYear optional
  • steps[]: { id, key, title, questions[] }
  • Question: { id, question_number, title, placeholder, type, required, description, active, order } plus extra keys (strict: false)

SchoolYearSettings

Collection: schoolyearsettings — unique schoolYear. archived, archivedAt, archivedBy, questionBankVersion, deadlines[], districtGoals[].

FormComment

Collection: formcomments formId, reviewer identity, comment, status, optional stepNumber / stepKey, isActive, isFixed, readBy.

AuditLog

Collection: auditlogs Actions include login, form_created, form_duplicated, form_attested, form_submitted, question_bank_published, csv_import, settings_changed, and others listed on the schema enum.