|
|
|
@ -32,67 +32,68 @@ const RoleSchema = new Schema({ name: String });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tanksSchema = new mongoose.Schema({
|
|
|
|
|
hardwareId: { type: String },
|
|
|
|
|
InstallerId: { type: String, default: null },
|
|
|
|
|
tankhardwareId: { type: String },
|
|
|
|
|
hardwareId_type: { type: String },
|
|
|
|
|
hardwareId_company: { type: String },
|
|
|
|
|
customerId: { type: String, default: null },
|
|
|
|
|
tankName: { type: String, default: null },
|
|
|
|
|
blockName: { type: String, default: null },
|
|
|
|
|
capacity: { type: String, default: "0" },
|
|
|
|
|
height: { type: String, default: "0" },
|
|
|
|
|
tankLocation: { type: String, default: null },
|
|
|
|
|
waterCapacityPerCm:{ type: String, default: "0" },
|
|
|
|
|
typeOfWater: { type: String, default: null },
|
|
|
|
|
waterlevel: { type: String, default: "0" },
|
|
|
|
|
waterlevel_at_midnight:{ type: String,default:"0" },
|
|
|
|
|
total_water_added_from_midnight:{ type: String,default:"0" },
|
|
|
|
|
auto_min_percentage :{ type: String, default: "20" },
|
|
|
|
|
reserved_percentage:{type: String,default:"20"},
|
|
|
|
|
auto_max_percentage :{ type: String, default: "80" },
|
|
|
|
|
|
|
|
|
|
connections: {
|
|
|
|
|
source: { type: String },
|
|
|
|
|
inputConnections: [
|
|
|
|
|
{
|
|
|
|
|
inputConnections: { type: String },
|
|
|
|
|
input_type: { type: String },
|
|
|
|
|
inputismotor: { type: Boolean, },
|
|
|
|
|
motor_id:{ type: String ,default: null},
|
|
|
|
|
motor_status: { type: String, default: "0" },
|
|
|
|
|
auto_mode:{type:String,default:"inactive"},
|
|
|
|
|
motor_stop_status: { type: String, default: "1" },
|
|
|
|
|
motor_on_type :{ type: String, default: "manual" },
|
|
|
|
|
capacity:{ type: String ,default: null},
|
|
|
|
|
water_level:{ type: String ,default: null},
|
|
|
|
|
manual_threshold_percentage:{type: String, default: "90"},
|
|
|
|
|
manual_threshold_time:{type: String, default: null},
|
|
|
|
|
threshold_type:{type: String, default: "percentage"},
|
|
|
|
|
startTime:{type: String,default:null},
|
|
|
|
|
start_instance_id:{type:String,default:null},
|
|
|
|
|
stopTime:{type: String,default:null}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
outputConnections: [
|
|
|
|
|
{
|
|
|
|
|
outputConnections: { type: String },
|
|
|
|
|
output_type: { type: String },
|
|
|
|
|
outputismotor: { type: Boolean, },
|
|
|
|
|
motor_id:{ type: String ,default: null},
|
|
|
|
|
motor_status: { type: String, default: "0" },
|
|
|
|
|
motor_stop_status: { type: String, default: "1" },
|
|
|
|
|
capacity:{ type: String ,default: null},
|
|
|
|
|
water_level:{ type: String ,default: null},
|
|
|
|
|
manual_threshold_percentage:{type: String, default: "90"},
|
|
|
|
|
manual_threshold_time:{type: String, default: null},
|
|
|
|
|
threshold_type:{type: String, default: "percentage"},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
hardwareId: { type: String },
|
|
|
|
|
InstallerId: { type: String, default: null },
|
|
|
|
|
tankhardwareId: { type: String },
|
|
|
|
|
hardwareId_type: { type: String },
|
|
|
|
|
hardwareId_company: { type: String },
|
|
|
|
|
customerId: { type: String, default: null },
|
|
|
|
|
tankName: { type: String, default: null },
|
|
|
|
|
blockName: { type: String, default: null },
|
|
|
|
|
capacity: { type: String, default: "0" },
|
|
|
|
|
height: { type: String, default: "0" },
|
|
|
|
|
tankLocation: { type: String, default: null },
|
|
|
|
|
waterCapacityPerCm: { type: String, default: "0" },
|
|
|
|
|
typeOfWater: { type: String, default: null },
|
|
|
|
|
waterlevel: { type: String, default: "0" },
|
|
|
|
|
waterlevel_at_midnight: { type: String, default: "0" },
|
|
|
|
|
total_water_added_from_midnight: { type: String, default: "0" },
|
|
|
|
|
auto_min_percentage: { type: String, default: "20" },
|
|
|
|
|
reserved_percentage: { type: String, default: "20" },
|
|
|
|
|
auto_max_percentage: { type: String, default: "80" },
|
|
|
|
|
|
|
|
|
|
connections: {
|
|
|
|
|
source: { type: String },
|
|
|
|
|
inputConnections: [
|
|
|
|
|
{
|
|
|
|
|
inputConnections: { type: String },
|
|
|
|
|
input_type: { type: String },
|
|
|
|
|
inputismotor: { type: Boolean },
|
|
|
|
|
motor_id: { type: String, default: null },
|
|
|
|
|
motor_status: { type: String, default: "0" },
|
|
|
|
|
auto_mode: { type: String, default: "inactive" },
|
|
|
|
|
motor_stop_status: { type: String, default: "1" },
|
|
|
|
|
motor_on_type: { type: String, default: "manual" },
|
|
|
|
|
capacity: { type: String, default: null },
|
|
|
|
|
water_level: { type: String, default: null },
|
|
|
|
|
manual_threshold_percentage: { type: String, default: "90" },
|
|
|
|
|
manual_threshold_time: { type: String, default: null },
|
|
|
|
|
threshold_type: { type: String, default: "percentage" },
|
|
|
|
|
startTime: { type: String, default: null },
|
|
|
|
|
start_instance_id: { type: String, default: null },
|
|
|
|
|
stopTime: { type: String, default: null },
|
|
|
|
|
waterlevelPercentage: { type: String, default: null } // Added field
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
outputConnections: [
|
|
|
|
|
{
|
|
|
|
|
outputConnections: { type: String },
|
|
|
|
|
output_type: { type: String },
|
|
|
|
|
outputismotor: { type: Boolean },
|
|
|
|
|
motor_id: { type: String, default: null },
|
|
|
|
|
motor_status: { type: String, default: "0" },
|
|
|
|
|
motor_stop_status: { type: String, default: "1" },
|
|
|
|
|
capacity: { type: String, default: null },
|
|
|
|
|
water_level: { type: String, default: null },
|
|
|
|
|
manual_threshold_percentage: { type: String, default: "90" },
|
|
|
|
|
manual_threshold_time: { type: String, default: null },
|
|
|
|
|
threshold_type: { type: String, default: "percentage" },
|
|
|
|
|
waterlevelPercentage: { type: String, default: null } // Added field
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|