Added opeing times types for company, site and site area
MODIFY
src/types/Company.ts
src/types/Company.ts
import Address from './Address';
import { AuthorizationActions } from './Authorization';
import CreatedUpdatedProps from './CreatedUpdatedProps';
+import { OpeningTimes } from './OpeningTimes';
import Site from './Site';
export default interface Company extends CreatedUpdatedProps, AuthorizationActions {
@@ -11,4 +12,5 @@ export default interface Company extends CreatedUpdatedProps, AuthorizationActio
logo?: string;
sites?: Site[];
distanceMeters?: number;
+ openingTimes?: OpeningTimes;
}

ADD
src/types/OpeningTimes.ts
+
+export interface OpeningTimes {
+ twentyFourBySeven: boolean;
+ regularHours: RegularHour[];
+ exceptionalOpenings: Period[];
+ exceptionalClosings: Period[];
+}
+
+export interface Period {
+ periodBegin: Date;
+ periodEnd: Date;
+}
+
+export interface RegularHour extends Period {
+ weekday: number; // Number of day in the week, from Monday (1) till Sunday (7)
+}

MODIFY
src/types/Site.ts
src/types/Site.ts
@@ -2,6 +2,7 @@ import Address from './Address';
import Company from './Company';
import ConnectorStats from './ConnectorStats';
import CreatedUpdatedProps from './CreatedUpdatedProps';
+import { OpeningTimes } from './OpeningTimes';
import SiteArea from './SiteArea';
import { SiteAuthorizationActions } from './Authorization';
@@ -18,6 +19,7 @@ export default interface Site extends CreatedUpdatedProps, SiteAuthorizationActi
company?: Company;
distanceMeters?: number;
public?: boolean;
+ openingTimes?: OpeningTimes;
}
export interface SiteUser {

MODIFY
src/types/SiteArea.ts
src/types/SiteArea.ts
@@ -5,6 +5,7 @@ import { AuthorizationActions } from './Authorization';
import ConnectorStats from './ConnectorStats';
import Consumption from './Consumption';
import CreatedUpdatedProps from './CreatedUpdatedProps';
+import { OpeningTimes } from './OpeningTimes';
import Site from '../types/Site';
export default interface SiteArea extends CreatedUpdatedProps, AuthorizationActions {
@@ -24,4 +25,5 @@ export default interface SiteArea extends CreatedUpdatedProps, AuthorizationActi
connectorStats: ConnectorStats;
values: Consumption[];
distanceMeters?: number;
+ openingTimes?: OpeningTimes;
}

Added opeing times types for company, site and site area