{"size": 1666, "ext": "js", "max_stars_repo_path": "src/api/models/Order.js", "max_stars_repo_name": "daltino/luggage-care-daltonwhyte", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/api/models/Order.js", "max_issues_repo_name": "daltino/luggage-care-daltonwhyte", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/api/models/Order.js", "max_forks_repo_name": "daltino/luggage-care-daltonwhyte", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.5135135135, "max_line_length": 52, "alphanum_fraction": 0.4363745498}
module.exports = mongoose => {
  const Order = mongoose.model(
    'order',
    mongoose.Schema(
      {
        /**
         * @jsdoc value
         * @propertyOf Order
         * @name Order.unique_code
         * @description
         * Unique code to view order
         */
        unique_code: {
          type: String,
          trim: true,
          index: true,
          unique: true,
          match: /^[a-zA-Z0-9_]+$/,
        },
        /**
         * @jsdoc value
         * @propertyOf Order
         * @name Order.user
         * @description
         * User who placed the order
         */
        user: {
          type: mongoose.Schema.Types.ObjectId,
          ref: 'User'
        },
        /**
         * @jsdoc value
         * @propertyOf Order
         * @name Order.meal
         * @description
         * Meal for this order
         */
        meal: {
          type: mongoose.Schema.Types.ObjectId,
          ref: 'Meal'
        },
        /**
         * @jsdoc value
         * @propertyOf Order
         * @name Order.ingredients
         * @description
         * Meal for this order
         */
        ingredients: [{
          type: mongoose.Schema.Types.ObjectId,
          ref: 'Ingredient'
        }],
        /**
         * @jsdoc value
         * @propertyOf Order
         * @name Order.status
         * @description
         * Status of this order
         */
        status: {
          type: Boolean,
          default: true
        }
      },
      {
        timestamps: true,
        toObject: { getters: true, virtuals: true },
        toJSON: { getters: true, virtuals: true },
      },
    )
  );

  return Order;
};