const mongoose = require("mongoose"); const { Schema } = mongoose; // Hero const HeroSchema = new Schema( { badge: { type: String, default: "" }, title: { type: String, default: "" }, description: { type: String, default: "" }, studentCount: { type: String, default: "" }, image: { type: String, default: "" }, imageAlt: { type: String, default: "" }, coreValues: { type: [String], default: [] }, }, { _id: false }, ); // Leadership const SocialSchema = new Schema( { linkedin: { type: String, default: "" }, twitter: { type: String, default: "" }, }, { _id: false }, ); const LeadershipMemberSchema = new Schema( { name: { type: String, default: "" }, role: { type: String, default: "" }, bio: { type: String, default: "" }, avatar: { type: String, default: "" }, social: { type: SocialSchema, default: () => ({}) }, }, { _id: false }, ); const LeadershipSchema = new Schema( { heading: { type: String, default: "" }, description: { type: String, default: "" }, members: { type: [LeadershipMemberSchema], default: [] }, }, { _id: false }, ); // Learning Model const LearningFeatureSchema = new Schema( { icon: { type: String, default: "" }, title: { type: String, default: "" }, desc: { type: String, default: "" }, }, { _id: false }, ); const LearningModeSchema = new Schema( { title: { type: String, default: "" }, description: { type: String, default: "" }, features: { type: [LearningFeatureSchema], default: [] }, }, { _id: false }, ); const LearningModelSchema = new Schema( { heading: { type: String, default: "" }, description: { type: String, default: "" }, async: { type: LearningModeSchema, default: () => ({}) }, sync: { type: LearningModeSchema, default: () => ({}) }, }, { _id: false }, ); // Accreditation const AccreditationBadgeSchema = new Schema( { icon: { type: String, default: "" }, title: { type: String, default: "" }, desc: { type: String, default: "" }, }, { _id: false }, ); const AccreditationStatSchema = new Schema( { value: { type: String, default: "" }, label: { type: String, default: "" }, isPrimary: { type: Boolean, default: false }, }, { _id: false }, ); const AccreditationSchema = new Schema( { heading: { type: String, default: "" }, description: { type: String, default: "" }, badges: { type: [AccreditationBadgeSchema], default: [] }, stats: { type: [AccreditationStatSchema], default: [] }, }, { _id: false }, ); // Success Stories const StorySchema = new Schema( { quote: { type: String, default: "" }, name: { type: String, default: "" }, program: { type: String, default: "" }, avatar: { type: String, default: "" }, }, { _id: false }, ); const SuccessStoriesSchema = new Schema( { heading: { type: String, default: "" }, description: { type: String, default: "" }, stories: { type: [StorySchema], default: [] }, }, { _id: false }, ); // CTA const CtaButtonSchema = new Schema( { label: { type: String, default: "" }, href: { type: String, default: "" }, }, { _id: false }, ); const CtaSchema = new Schema( { heading: { type: String, default: "" }, description: { type: String, default: "" }, primaryButton: { type: CtaButtonSchema, default: () => ({}) }, secondaryButton: { type: CtaButtonSchema, default: () => ({}) }, }, { _id: false }, ); // Root schema const AboutSchema = new Schema( { hero: { type: HeroSchema, default: () => ({}) }, leadership: { type: LeadershipSchema, default: () => ({}) }, learningModel: { type: LearningModelSchema, default: () => ({}) }, accreditation: { type: AccreditationSchema, default: () => ({}) }, successStories: { type: SuccessStoriesSchema, default: () => ({}) }, cta: { type: CtaSchema, default: () => ({}) }, }, { timestamps: true, strict: false, }, ); module.exports = mongoose.model("About", AboutSchema);