Untitled

mail@pastecode.io avatar
unknown
plain_text
4 months ago
4.3 kB
4
Indexable
const mongoose = require("mongoose");

const appSettingsSchema = new mongoose.Schema(
  {
    // Basic Information
    name: { type: String, required: true, unique: true },
    uniqueId: { type: String, required: true, unique: true },
    status: { type: String, default: "1" },
    logo: { type: String, default: "" },

    // Notification Settings
    notificationSettings: {
      android: {
        type: {
          type: String
        },
        onesignalAppId: { type: String },
        onesignalApiKey: { type: String },
        firebaseServerKey: { type: String },
        firebaseTopics: { type: String }
      },
      ios: {
        type: {
          type: String
        },
        onesignalAppId: { type: String },
        onesignalApiKey: { type: String },
        firebaseServerKey: { type: String },
        firebaseTopics: { type: String }
      }
    },

    // API Settings
    apiSettings: {
      sport: {
        baseUrl: { type: String },
        apiKey: { type: String }
      }
    },

    // Email Settings
    emailSettings: {
      supportEmail: { type: String },
      fromEmail: { type: String },
      fromName: { type: String },
      smtp: {
        host: { type: String },
        port: { type: String },
        username: { type: String },
        password: { type: String },
        encryption: { type: String }
      }
    },

    // Social Media Links
    socialMedia: {
      facebook: { type: String },
      instagram: { type: String },
      twitter: { type: String },
      telegram: { type: String },
      youtube: { type: String }
    },

    // Android Settings
    androidSettings: {
      privacyPolicy: { type: String },
      termsConditions: { type: String },
      appShareLink: { type: String },
      defaultPage: { type: String },
      appPublishingControl: { type: String },
      liveVersionCode: { type: String },
      adType: { type: String },
      adSwitch: { type: String },
      multipleAd: { type: String },
      othersAdType: [{ type: Object }],
      appAds: [{ type: Object }],
      clickControl: { type: String },
      adStatus: { type: String },
      versionName: { type: String },
      versionCode: { type: String },
      forceUpdate: { type: String, default: "no" },
      updateFor: { type: String, default: "in" },
      appUrl: { type: String },
      buttonText: { type: String },
      description: { type: String },
      requiredApp: {
        enable: { type: String, default: "no" },
        applicationId: { type: String },
        url: { type: String },
        name: { type: String },
        description: { type: String }
      },
      promo: {
        button: { type: String },
        text: { type: String },
        link: { type: String },
        status: { type: String }
      },
      adSettings: { type: Object }
    },

    // iOS Settings
    iosSettings: {
      privacyPolicy: { type: String },
      termsConditions: { type: String },
      appShareLink: { type: String },
      appRatingLink: { type: String },
      defaultPage: { type: String },
      appPublishingControl: { type: String },
      liveVersionCode: { type: String },
      adType: { type: String },
      appAds: [{ type: Object }],
      multipleAd: { type: String },
      othersAdType: [{ type: Object }],
      adSwitch: { type: String },
      clickControl: { type: String },
      adStatus: { type: String },
      versionName: { type: String },
      versionCode: { type: String },
      forceUpdate: { type: String, default: "no" },
      updateFor: { type: String, default: "in" },
      appUrl: { type: String },
      buttonText: { type: String },
      description: { type: String },
      requiredApp: {
        enable: { type: String, default: "no" },
        applicationId: { type: String },
        url: { type: String },
        name: { type: String },
        description: { type: String }
      },
      promo: {
        button: { type: String },
        text: { type: String },
        link: { type: String },
        status: { type: String }
      },
      adSettings: { type: Object }
    },

    // Miscellaneous
    ip: { type: String }
  },
  {
    timestamps: true
  }
);

const AppSettings = mongoose.model("AppSettings", appSettingsSchema);

module.exports = AppSettings;
Leave a Comment