File size: 589 Bytes
53c9876
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import type { Sensor, Reading } from '@prisma/client';

export type { Sensor, Reading };

export type SensorResponse = Sensor;
export type ReadingResponse = Reading;

export type SensorWithLatestReading = Sensor & {
  latestReading?: Reading | null;
};

export type InsertSensor = {
  sensorId: string;
  latitude: number;
  longitude: number;
  locationName?: string;
};

export type InsertReading = {
  sensorId: string;
  ph: number;
  turbidity: number;
  temperature: number;
  hardness: number;
  potability?: number;
};

export type TimeRange = '1h' | '1d' | '1w' | '1m' | 'custom';