Add project device structure history
This commit is contained in:
@@ -24,6 +24,21 @@ export type ProjectDeviceUpdateField =
|
||||
export type ProjectDeviceUpdatePatch =
|
||||
Partial<ProjectDeviceUpdateValues>;
|
||||
|
||||
export const projectDeviceUpdateFields = [
|
||||
"name",
|
||||
"displayName",
|
||||
"phaseType",
|
||||
"connectionKind",
|
||||
"costGroup",
|
||||
"category",
|
||||
"quantity",
|
||||
"powerPerUnit",
|
||||
"simultaneityFactor",
|
||||
"cosPhi",
|
||||
"remark",
|
||||
"voltageV",
|
||||
] as const satisfies readonly ProjectDeviceUpdateField[];
|
||||
|
||||
export interface ProjectDeviceUpdateFieldChange<
|
||||
TField extends ProjectDeviceUpdateField = ProjectDeviceUpdateField,
|
||||
> {
|
||||
@@ -173,20 +188,9 @@ function assertProjectDeviceUpdateFieldValue(
|
||||
function isProjectDeviceUpdateField(
|
||||
value: string
|
||||
): value is ProjectDeviceUpdateField {
|
||||
return [
|
||||
"name",
|
||||
"displayName",
|
||||
"phaseType",
|
||||
"connectionKind",
|
||||
"costGroup",
|
||||
"category",
|
||||
"quantity",
|
||||
"powerPerUnit",
|
||||
"simultaneityFactor",
|
||||
"cosPhi",
|
||||
"remark",
|
||||
"voltageV",
|
||||
].includes(value);
|
||||
return projectDeviceUpdateFields.includes(
|
||||
value as ProjectDeviceUpdateField
|
||||
);
|
||||
}
|
||||
|
||||
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
||||
|
||||
Reference in New Issue
Block a user