Skip to content

Commit

Permalink
feat: update interface types
Browse files Browse the repository at this point in the history
  • Loading branch information
Piccio98 committed May 10, 2023
1 parent 901829a commit 217102c
Showing 1 changed file with 144 additions and 4 deletions.
148 changes: 144 additions & 4 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ProColumns } from "@ant-design/pro-table"
import { SpinSize } from "antd/lib/spin"
import { DefaultOptionType } from "rc-cascader"

export interface LoadingSpinnerProps {
message?: string,
Expand Down Expand Up @@ -73,15 +75,15 @@ export interface Renewable {
}

export interface Organization {
_id: string,
_id: string;
name: string;
description?: string;
userId?: string;
type?: Array<string>;
icon?: string;
icon: string;
customers?: Array<UserProps>;
details?: any;
createAt?: Date;
createAt: Date;
}

export interface Building {
Expand All @@ -96,6 +98,7 @@ export interface Building {
lat: string;
long: string;
resources?: Array<any>;
date?: Date;
}

export interface Bills {
Expand All @@ -114,4 +117,141 @@ export interface Activity {
}

export type TimeStamp = "Weekly" | "Monthly" | "Yearly" | ""
export type EnergyType = "Solar" | "Hydro" | "Geo" | "Wind"
export type EnergyType = "Solar" | "Hydro" | "Geo" | "Wind"

export interface Bills {
totalElectric: number,
totalGas: number,
totalWater: number,
result: Array<any>,
aggregated: any
}

export interface Pages {
bills: Bills,
cost: Array<Object>
}

export interface Data {
price: number,
name: string,
type: string,
organization: number,
earning: number,
organizationId: string,
resourcesType: any
buildings?: Array<any>
}

export interface ResourcesModal {
visible: boolean,
setVisible: (arg: boolean) => void,
data: Data,
options: string[] | DefaultOptionType[] | undefined
}
export interface ElementName {
name: string
}

export interface ResourcesCard {
element: ElementName,
onClick: (React.MouseEventHandler<HTMLAnchorElement> & React.MouseEventHandler<HTMLButtonElement>) | undefined
}

export interface RenewableDetailsModal {
filter: string,
data: Data,
setVisible: (arg: boolean) => void,
visible: boolean
}

export interface Step1 {
gas: boolean,
setGas: (arg: boolean) => void,
electric: boolean,
setElectric: (arg: boolean) => void,
water: boolean,
setWater: (arg: boolean) => void,
distributed: boolean,
setDistributed: (arg: boolean) => void,
setPrices: (arg: any) => void,
prices: Array<any>,

}

export interface Step2 {
name: string,
setDescription: (arg: string) => void,
setIcon: (arg: any) => void,
description: string
}

export interface Step3 {
name: string,
owner: string,
icon: any,
createAt: Date,
type: Array<string | boolean>,
description: string,
prices: Array<any>,
setData: (arg: Object) => void
}

export interface OrganizationCard {
description: string,
title: string,
selected: boolean
}

export interface EditCard {
data: any,
type: string
}

export interface UsersCard {
openModal: (arg: any) => void
}

export interface Customers {
organization: Organization
}

export interface CarouselKpi {
loading: boolean,
gasSum: number,
kWhSum: number,
waterSum: number,
gasCost: number,
kWhCost: number,
waterCost: number,
sold: number,
renewable: number
}

export interface CustomerModal {
visible: boolean,
user: UserProps,
setVisible: (arg: boolean) => void
}

export interface CustomersBuildingTable {
data: readonly Record<string, any>[] | undefined,
columns: any,
headerTitle?: React.ReactNode
}

export interface ModalDetails {
visible: boolean,
setVisible: (arg:boolean) => void,
building: Building,
bills: Array<any>;
}

export interface CustomerDrawer {
visible: boolean,
buildingId: string,
setVisible: (arg: boolean) => void,
showWater?: boolean,
showElectric?: boolean,
showGas?: boolean
}

0 comments on commit 217102c

Please sign in to comment.