import { StripPrefix } from "../../helpers/objectMappers"; import { IEnoBuildingDetailView } from "../../models/interfaces/IEnoBuildingDetailView"; import { IEnoConsumptionPointView } from "../../models/interfaces/IEnoConsumptionPointView"; import { IPpasCommercialInvoiceDevice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoiceDevice"; import { IPpasCommercialInvoicePrice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasCommercialInvoicePrice"; import { IPpasDistributionInvoiceDevice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasDistributionInvoiceDevice"; import { IPpasDistributionInvoicePrice } from "../../../schema-definitions/models/enapo/ppas/interfaces/IPpasDistributionInvoicePrice"; import { EnapoCommodity } from "../../../schema-definitions/models/enapo/interfaces/IEnapoGidMapping"; import { IEnoRegistrationUnit } from "./IEnoRegistrationUnit"; export type TEnoElectricityMetadata = StripPrefix; export type TEnoDistributionInvoice = StripPrefix; export type TEnoDistributionInstallation = Omit, "place_id">; export type TEnoCommercialInvoice = StripPrefix; export type TEnoCommercialInstallation = Omit, "place_id">; export type TEnoDistributionDevice = Omit; export type TEnoDistributionPrice = Omit; export type TEnoCommercialDevice = Omit; export type TEnoCommercialPrice = Omit; export interface IEnoPorsennaDeviceInfo { name: string | null; type: string | null; level: string | null; measurement_target: string | null; meter_number: string | null; supply_point_number: string | null; disabled_at: Date | null; tenant: string; } export interface IEnoPorsennaSubDevice { name: string | null; type: string | null; meter_number: string | null; disabled_at: Date | null; } export interface IEnoPorsennaYearlyConsumption { period: string; value: number; unit: string; days_covered: number | null; } export interface IEnoPorsennaBlock { device: IEnoPorsennaDeviceInfo; sub_devices: IEnoPorsennaSubDevice[]; yearly_consumption: IEnoPorsennaYearlyConsumption[]; } export interface IEnoPorsennaOnlyBlock { porsenna: IEnoPorsennaBlock | null; } export interface IEnoEnergyManagement { source: string; building_name: string | null; address: string | null; devices_total: number; devices_active: number; } export interface IEnoElectricityBlock { metadata: TEnoElectricityMetadata | null; porsenna?: IEnoPorsennaBlock; } export interface IEnoGasDistributionBlock { invoice: TEnoDistributionInvoice; installation: TEnoDistributionInstallation; devices: TEnoDistributionDevice[]; prices: TEnoDistributionPrice[]; } export interface IEnoGasCommercialBlock { invoice: TEnoCommercialInvoice; installation: TEnoCommercialInstallation; devices: TEnoCommercialDevice[]; prices: TEnoCommercialPrice[]; } export interface IEnoGasBlock { distribution: IEnoGasDistributionBlock | null; commercial: IEnoGasCommercialBlock | null; porsenna?: IEnoPorsennaBlock; } export interface IEnoConsumptionPointResponse { place_id: string; id_type: "ean" | "eic" | "om"; commodity: EnapoCommodity; is_first_gid: boolean; is_active: boolean; link_source: string; valid_from: string | null; valid_to: string | null; address: string | null; /** Present only when commodity = electricity */ electricity?: IEnoElectricityBlock; /** Present only when commodity = gas */ gas?: IEnoGasBlock; /** Present only when commodity = heat (Porsenna-sourced) */ heat?: IEnoPorsennaOnlyBlock; /** Present only when commodity = water (Porsenna-sourced) */ water?: IEnoPorsennaOnlyBlock; } export interface IEnoBuildingAddressResponse { popis: string | null; hlavni: boolean | null; poradi: number; } /** eno_budova physical attributes only; the eno_ciselnik lookups live under `property`. */ export type TEnoBuildingPhysical = Omit; /** Správce (eno_ciselnik_spravce). */ export interface IEnoManager { id: number | null; kod: string | null; nazev: string | null; ic: string | null; dic: string | null; } export interface IEnoBuildingProperty { registration_unit: IEnoRegistrationUnit | null; managers: { /** eno_majetek.id_maj_spravce_mandatni */ mandate: IEnoManager | null; /** eno_majetek.id_maj_spravce_ucet_jednotka */ accounting_unit: IEnoManager | null; }; } export interface IEnoBuildingDetailResponse { gid: string; /** null when the GID has no eno_budova record (known only to the OM mapping or Porsenna) */ building: TEnoBuildingPhysical | null; /** ENO lookup data resolved through eno_majetek; null when the building has no majetek record */ property: IEnoBuildingProperty | null; addresses: IEnoBuildingAddressResponse[]; /** null when the building is not tracked in Porsenna (e-manazer) */ energy_management: IEnoEnergyManagement | null; consumption_points: IEnoConsumptionPointResponse[]; }