344 lines
7.6 KiB
TypeScript
344 lines
7.6 KiB
TypeScript
export interface ProjectDto {
|
|
id: string;
|
|
name: string;
|
|
singlePhaseVoltageV: number;
|
|
threePhaseVoltageV: number;
|
|
currentRevision: number;
|
|
}
|
|
|
|
export interface ProjectHistoryStateDto {
|
|
projectId: string;
|
|
currentRevision: number;
|
|
undoDepth: number;
|
|
redoDepth: number;
|
|
undoChangeSetId: string | null;
|
|
redoChangeSetId: string | null;
|
|
}
|
|
|
|
export type ProjectRevisionSourceDto =
|
|
| "user"
|
|
| "undo"
|
|
| "redo"
|
|
| "restore"
|
|
| "migration";
|
|
|
|
export interface ProjectRevisionSummaryDto {
|
|
revisionId: string;
|
|
changeSetId: string;
|
|
revisionNumber: number;
|
|
createdAtIso: string;
|
|
actorId: string | null;
|
|
source: ProjectRevisionSourceDto;
|
|
description: string | null;
|
|
commandType: string;
|
|
payloadSchemaVersion: number;
|
|
}
|
|
|
|
export interface ProjectRevisionPageDto {
|
|
projectId: string;
|
|
currentRevision: number;
|
|
revisions: ProjectRevisionSummaryDto[];
|
|
nextBeforeRevision: number | null;
|
|
}
|
|
|
|
export interface ProjectSnapshotMetadataDto {
|
|
id: string;
|
|
projectId: string;
|
|
sourceRevision: number;
|
|
schemaVersion: number;
|
|
kind: "named" | "automatic";
|
|
name: string;
|
|
description: string | null;
|
|
payloadSha256: string;
|
|
createdAtIso: string;
|
|
createdByActorId: string | null;
|
|
}
|
|
|
|
export interface ProjectSnapshotRestoreResultDto
|
|
extends ProjectCommandResultDto {
|
|
snapshot: ProjectSnapshotMetadataDto;
|
|
}
|
|
|
|
export interface ProjectSettingsCommandResultDto
|
|
extends ProjectCommandResultDto {
|
|
project: ProjectDto;
|
|
}
|
|
|
|
export interface ProjectCommandDto {
|
|
schemaVersion: number;
|
|
type: string;
|
|
payload: unknown;
|
|
}
|
|
|
|
export interface ProjectCommandResultDto {
|
|
revision: {
|
|
revisionId: string;
|
|
changeSetId: string;
|
|
projectId: string;
|
|
revisionNumber: number;
|
|
createdAtIso: string;
|
|
};
|
|
history: ProjectHistoryStateDto;
|
|
}
|
|
|
|
export interface DistributionBoardDto {
|
|
id: string;
|
|
projectId: string;
|
|
name: string;
|
|
}
|
|
|
|
export interface DistributionBoardCommandResultDto
|
|
extends ProjectCommandResultDto {
|
|
distributionBoard: DistributionBoardDto;
|
|
}
|
|
|
|
export interface CircuitListDto {
|
|
id: string;
|
|
projectId: string;
|
|
distributionBoardId: string;
|
|
name: string;
|
|
}
|
|
|
|
export interface FloorDto {
|
|
id: string;
|
|
projectId: string;
|
|
name: string;
|
|
sortOrder: number;
|
|
}
|
|
|
|
export interface RoomDto {
|
|
id: string;
|
|
projectId: string;
|
|
floorId: string | null;
|
|
roomNumber: string;
|
|
roomName: string;
|
|
}
|
|
|
|
export interface GlobalDeviceDto {
|
|
id: string;
|
|
name: string;
|
|
displayName: string;
|
|
category: string | null;
|
|
quantity: number;
|
|
installedPowerPerUnitKw: number;
|
|
demandFactor: number;
|
|
voltageV: number | null;
|
|
phaseCount: 1 | 3 | null;
|
|
powerFactor: number | null;
|
|
note: string | null;
|
|
}
|
|
|
|
export interface ProjectDeviceDto {
|
|
id: string;
|
|
projectId: string;
|
|
name: string;
|
|
displayName: string;
|
|
phaseType: "single_phase" | "three_phase";
|
|
connectionKind: string | null;
|
|
costGroup: string | null;
|
|
category: string | null;
|
|
quantity: number;
|
|
powerPerUnit: number;
|
|
simultaneityFactor: number;
|
|
totalPower: number;
|
|
cosPhi: number | null;
|
|
remark: string | null;
|
|
voltageV: number | null;
|
|
}
|
|
|
|
export interface ProjectDeviceCommandResultDto
|
|
extends ProjectCommandResultDto {
|
|
projectDevice: ProjectDeviceDto;
|
|
}
|
|
|
|
export interface CreateFloorInput {
|
|
name: string;
|
|
}
|
|
|
|
export interface CreateRoomInput {
|
|
floorId?: string;
|
|
roomNumber: string;
|
|
roomName: string;
|
|
}
|
|
|
|
export interface CreateGlobalDeviceInput {
|
|
name: string;
|
|
displayName: string;
|
|
category?: string;
|
|
quantity: number;
|
|
installedPowerPerUnitKw: number;
|
|
demandFactor: number;
|
|
voltageV?: number;
|
|
phaseCount?: 1 | 3;
|
|
powerFactor?: number;
|
|
note?: string;
|
|
}
|
|
|
|
export interface CreateProjectDeviceInput {
|
|
name: string;
|
|
displayName: string;
|
|
phaseType: "single_phase" | "three_phase";
|
|
connectionKind?: string;
|
|
costGroup?: string;
|
|
category?: string;
|
|
quantity: number;
|
|
powerPerUnit: number;
|
|
simultaneityFactor: number;
|
|
cosPhi?: number;
|
|
remark?: string;
|
|
voltageV?: number;
|
|
}
|
|
|
|
export interface ProjectDeviceSyncDifferenceDto {
|
|
field: ProjectDeviceSyncField;
|
|
currentValue: string | number | null;
|
|
sourceValue: string | number | null;
|
|
isOverridden: boolean;
|
|
}
|
|
|
|
export interface ProjectDeviceSyncRowDto {
|
|
rowId: string;
|
|
circuitId: string;
|
|
equipmentIdentifier: string;
|
|
circuitDisplayName: string | null;
|
|
circuitListId: string;
|
|
circuitListName: string;
|
|
distributionBoardId: string;
|
|
distributionBoardName: string;
|
|
rowDisplayName: string;
|
|
overriddenFields: ProjectDeviceSyncField[];
|
|
differences: ProjectDeviceSyncDifferenceDto[];
|
|
}
|
|
|
|
export interface ProjectDeviceSyncPreviewDto {
|
|
projectDevice: {
|
|
id: string;
|
|
name: string;
|
|
displayName: string;
|
|
};
|
|
rows: ProjectDeviceSyncRowDto[];
|
|
}
|
|
|
|
export interface ProjectDeviceSyncCommandResultDto
|
|
extends ProjectCommandResultDto {
|
|
preview: ProjectDeviceSyncPreviewDto;
|
|
}
|
|
|
|
export interface CircuitTreeDeviceRowDto {
|
|
id: string;
|
|
linkedProjectDeviceId?: string;
|
|
legacyConsumerId?: string;
|
|
sortOrder: number;
|
|
name: string;
|
|
displayName: string;
|
|
phaseType?: string;
|
|
connectionKind?: string;
|
|
costGroup?: string;
|
|
category?: string;
|
|
level?: string;
|
|
roomId?: string;
|
|
roomNumberSnapshot?: string;
|
|
roomNameSnapshot?: string;
|
|
quantity: number;
|
|
powerPerUnit: number;
|
|
simultaneityFactor: number;
|
|
cosPhi?: number;
|
|
remark?: string;
|
|
overriddenFields?: string;
|
|
rowTotalPower: number;
|
|
}
|
|
|
|
export interface CircuitTreeCircuitDto {
|
|
id: string;
|
|
circuitListId: string;
|
|
sectionId: string;
|
|
equipmentIdentifier: string;
|
|
displayName?: string;
|
|
sortOrder: number;
|
|
protectionType?: string;
|
|
protectionRatedCurrent?: number;
|
|
protectionCharacteristic?: string;
|
|
cableType?: string;
|
|
cableCrossSection?: string;
|
|
cableLength?: number;
|
|
rcdAssignment?: string;
|
|
terminalDesignation?: string;
|
|
voltage?: number;
|
|
controlRequirement?: string;
|
|
status?: string;
|
|
isReserve: boolean;
|
|
remark?: string;
|
|
circuitTotalPower: number;
|
|
deviceRows: CircuitTreeDeviceRowDto[];
|
|
}
|
|
|
|
export interface CircuitTreeSectionDto {
|
|
id: string;
|
|
key: string;
|
|
displayName: string;
|
|
prefix: string;
|
|
sortOrder: number;
|
|
circuits: CircuitTreeCircuitDto[];
|
|
}
|
|
|
|
export interface CircuitTreeMigrationReportDto {
|
|
circuitListId: string;
|
|
legacyConsumerCount: number;
|
|
createdCircuitCount: number;
|
|
createdDeviceRowCount: number;
|
|
groupedDuplicateCircuitNumbers: Array<{ normalizedCircuitNumber: string; count: number }>;
|
|
generatedIdentifiers: string[];
|
|
unassignedRows: Array<{ consumerId: string; reason: string }>;
|
|
warnings: string[];
|
|
}
|
|
|
|
export interface CircuitTreeResponseDto {
|
|
circuitListId: string;
|
|
currentRevision: number;
|
|
sections: CircuitTreeSectionDto[];
|
|
migrationReport?: CircuitTreeMigrationReportDto;
|
|
}
|
|
|
|
export interface CreateCircuitInputDto {
|
|
sectionId: string;
|
|
equipmentIdentifier: string;
|
|
displayName?: string;
|
|
sortOrder: number;
|
|
protectionType?: string;
|
|
protectionRatedCurrent?: number;
|
|
protectionCharacteristic?: string;
|
|
cableType?: string;
|
|
cableCrossSection?: string;
|
|
cableLength?: number;
|
|
rcdAssignment?: string;
|
|
terminalDesignation?: string;
|
|
voltage?: number;
|
|
controlRequirement?: string;
|
|
status?: string;
|
|
isReserve?: boolean;
|
|
remark?: string;
|
|
}
|
|
|
|
export interface CreateCircuitDeviceRowInputDto {
|
|
linkedProjectDeviceId?: string;
|
|
name: string;
|
|
displayName: string;
|
|
phaseType?: string;
|
|
connectionKind?: string;
|
|
costGroup?: string;
|
|
category?: string;
|
|
level?: string;
|
|
roomId?: string;
|
|
roomNumberSnapshot?: string;
|
|
roomNameSnapshot?: string;
|
|
quantity: number;
|
|
powerPerUnit: number;
|
|
simultaneityFactor: number;
|
|
cosPhi?: number;
|
|
remark?: string;
|
|
overriddenFields?: string;
|
|
sortOrder?: number;
|
|
}
|
|
|
|
import type { ProjectDeviceSyncField } from "../shared/constants/project-device-sync-fields";
|