Meters columns

This commit is contained in:
2026-02-02 01:43:11 -06:00
parent 46aab5fbba
commit 4f484779d8
3 changed files with 358 additions and 0 deletions

View File

@@ -18,6 +18,60 @@ export interface Meter {
installation_date: Date | null;
created_at: Date;
updated_at: Date;
// Communication & Network Fields
protocol?: string | null;
mac?: string | null;
gateway?: string | null;
network_mode?: string | null;
phone_id?: string | null;
phone_model?: string | null;
phone_name?: string | null;
// Voltage & Power Fields
voltage?: number | null;
voltage_rtu?: number | null;
voltage_status?: string | null;
// Signal & Communication Quality
signal?: number | null;
// Status Fields
storage_status?: string | null;
flow_status?: string | null;
open_status?: string | null;
actuator_status?: string | null;
counter_status?: string | null;
leakage_status?: string | null;
burst_status?: string | null;
valid_status?: string | null;
// Security & Alerts
magnetic_attack?: boolean | null;
realtime_information_flag?: boolean | null;
// Flow Measurements
current_flow?: number | null;
total_flow_reverse?: number | null;
current_flow_reverse?: number | null;
// Protocol Fields (M-Bus/LoRaWAN specific)
l_field?: string | null;
c_field?: string | null;
ver?: string | null;
dev?: string | null;
ci_field?: string | null;
// Company & Manufacturer Info
company_abbreviation?: string | null;
manufacturer?: string | null;
// Geolocation
latitude?: number | null;
longitude?: number | null;
// Additional Data
data?: Record<string, any> | null;
}
/**
@@ -74,6 +128,42 @@ export interface CreateMeterInput {
type?: string;
status?: string;
installation_date?: string;
// Extended fields (all optional)
protocol?: string;
mac?: string;
gateway?: string;
network_mode?: string;
phone_id?: string;
phone_model?: string;
phone_name?: string;
voltage?: number;
voltage_rtu?: number;
voltage_status?: string;
signal?: number;
storage_status?: string;
flow_status?: string;
open_status?: string;
actuator_status?: string;
counter_status?: string;
leakage_status?: string;
burst_status?: string;
valid_status?: string;
magnetic_attack?: boolean;
realtime_information_flag?: boolean;
current_flow?: number;
total_flow_reverse?: number;
current_flow_reverse?: number;
l_field?: string;
c_field?: string;
ver?: string;
dev?: string;
ci_field?: string;
company_abbreviation?: string;
manufacturer?: string;
latitude?: number;
longitude?: number;
data?: Record<string, any>;
}
/**
@@ -88,6 +178,42 @@ export interface UpdateMeterInput {
type?: string;
status?: string;
installation_date?: string;
// Extended fields (all optional)
protocol?: string;
mac?: string;
gateway?: string;
network_mode?: string;
phone_id?: string;
phone_model?: string;
phone_name?: string;
voltage?: number;
voltage_rtu?: number;
voltage_status?: string;
signal?: number;
storage_status?: string;
flow_status?: string;
open_status?: string;
actuator_status?: string;
counter_status?: string;
leakage_status?: string;
burst_status?: string;
valid_status?: string;
magnetic_attack?: boolean;
realtime_information_flag?: boolean;
current_flow?: number;
total_flow_reverse?: number;
current_flow_reverse?: number;
l_field?: string;
c_field?: string;
ver?: string;
dev?: string;
ci_field?: string;
company_abbreviation?: string;
manufacturer?: string;
latitude?: number;
longitude?: number;
data?: Record<string, any>;
}
/**

View File

@@ -73,6 +73,60 @@ export const createMeterSchema = z.object({
.datetime({ message: 'Installation date must be a valid ISO date string' })
.optional()
.nullable(),
// Communication & Network Fields
protocol: z.string().max(50).optional().nullable(),
mac: z.string().max(50).optional().nullable(),
gateway: z.string().max(100).optional().nullable(),
network_mode: z.string().max(50).optional().nullable(),
phone_id: z.string().max(50).optional().nullable(),
phone_model: z.string().max(100).optional().nullable(),
phone_name: z.string().max(100).optional().nullable(),
// Voltage & Power Fields
voltage: z.number().optional().nullable(),
voltage_rtu: z.number().optional().nullable(),
voltage_status: z.string().max(50).optional().nullable(),
// Signal & Communication Quality
signal: z.number().int().optional().nullable(),
// Status Fields
storage_status: z.string().max(50).optional().nullable(),
flow_status: z.string().max(50).optional().nullable(),
open_status: z.string().max(50).optional().nullable(),
actuator_status: z.string().max(50).optional().nullable(),
counter_status: z.string().max(50).optional().nullable(),
leakage_status: z.string().max(50).optional().nullable(),
burst_status: z.string().max(50).optional().nullable(),
valid_status: z.string().max(50).optional().nullable(),
// Security & Alerts
magnetic_attack: z.boolean().optional().nullable(),
realtime_information_flag: z.boolean().optional().nullable(),
// Flow Measurements
current_flow: z.number().optional().nullable(),
total_flow_reverse: z.number().optional().nullable(),
current_flow_reverse: z.number().optional().nullable(),
// Protocol Fields
l_field: z.string().max(10).optional().nullable(),
c_field: z.string().max(10).optional().nullable(),
ver: z.string().max(10).optional().nullable(),
dev: z.string().max(20).optional().nullable(),
ci_field: z.string().max(10).optional().nullable(),
// Company & Manufacturer Info
company_abbreviation: z.string().max(50).optional().nullable(),
manufacturer: z.string().max(100).optional().nullable(),
// Geolocation
latitude: z.number().min(-90).max(90).optional().nullable(),
longitude: z.number().min(-180).max(180).optional().nullable(),
// Additional Data
data: z.record(z.any()).optional().nullable(),
});
/**
@@ -117,6 +171,60 @@ export const updateMeterSchema = z.object({
.datetime({ message: 'Installation date must be a valid ISO date string' })
.optional()
.nullable(),
// Communication & Network Fields
protocol: z.string().max(50).optional().nullable(),
mac: z.string().max(50).optional().nullable(),
gateway: z.string().max(100).optional().nullable(),
network_mode: z.string().max(50).optional().nullable(),
phone_id: z.string().max(50).optional().nullable(),
phone_model: z.string().max(100).optional().nullable(),
phone_name: z.string().max(100).optional().nullable(),
// Voltage & Power Fields
voltage: z.number().optional().nullable(),
voltage_rtu: z.number().optional().nullable(),
voltage_status: z.string().max(50).optional().nullable(),
// Signal & Communication Quality
signal: z.number().int().optional().nullable(),
// Status Fields
storage_status: z.string().max(50).optional().nullable(),
flow_status: z.string().max(50).optional().nullable(),
open_status: z.string().max(50).optional().nullable(),
actuator_status: z.string().max(50).optional().nullable(),
counter_status: z.string().max(50).optional().nullable(),
leakage_status: z.string().max(50).optional().nullable(),
burst_status: z.string().max(50).optional().nullable(),
valid_status: z.string().max(50).optional().nullable(),
// Security & Alerts
magnetic_attack: z.boolean().optional().nullable(),
realtime_information_flag: z.boolean().optional().nullable(),
// Flow Measurements
current_flow: z.number().optional().nullable(),
total_flow_reverse: z.number().optional().nullable(),
current_flow_reverse: z.number().optional().nullable(),
// Protocol Fields
l_field: z.string().max(10).optional().nullable(),
c_field: z.string().max(10).optional().nullable(),
ver: z.string().max(10).optional().nullable(),
dev: z.string().max(20).optional().nullable(),
ci_field: z.string().max(10).optional().nullable(),
// Company & Manufacturer Info
company_abbreviation: z.string().max(50).optional().nullable(),
manufacturer: z.string().max(100).optional().nullable(),
// Geolocation
latitude: z.number().min(-90).max(90).optional().nullable(),
longitude: z.number().min(-180).max(180).optional().nullable(),
// Additional Data
data: z.record(z.any()).optional().nullable(),
});
/**