module.exports = mongoose => {
    var schema = mongoose.Schema(
        {
            time: Date,
            translate1_number: Number,
            translate2_number: Number,
            max_resource_number: Number,
            status: String, // 'active', 'inactive'
            data: Object,
            site: Number,
            create_by: String,
            create_date: Date,
            edit_by: String,
            edit_date: Date
        },
        { collection: 'timedata', timestamps: true }
      );
    schema.method("toJSON", function() {
        const { __v, _id, ...object } = this.toObject();
        object.id = _id;
        return object;
      });
    const Timedata = mongoose.model("timedata", schema);
    return Timedata;
  };