import { ReadDTO } from '@energyweb/origin-energy-api-react-query-client' ; import dayjs from 'dayjs' ; const generateRandomEnergyNumber = ( randomizer ) => { return Math . floor ( Math . random ( ) * ( 2000 - 100 + randomizer ) + 100 ) ; } ; const generateRandomMockReadings = ( howMany , randomizer ) => { const randomData = [ ] ; let timestamp = '1622322000000' ; for ( let i = 0 ; i < howMany ; i ++ ) { randomData . push ( { timestamp , value : generateRandomEnergyNumber ( randomizer ) , } ) ; timestamp = dayjs ( Number ( timestamp ) ) . add ( 15 , 'minutes' ) . unix ( ) . toString ( ) . concat ( '000' ) ; } return randomData ; } ; export const smartMeterReadingsMock = { METER002 : generateRandomMockReadings ( 24 , 1020 ) , } ;