Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/types/common/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const BuildingSystemEnum = z
"Plants",
"Roofs",
"Stairs",
"Structure",
])
.openapi({
description:
Expand All @@ -77,9 +78,12 @@ const ProductCategoryEnum = z
"Insulated Concrete Panels",
"Prefabricated Balcony",
"Pod",
"Structural Beam",
"Structural Column",
"Whole Building System",
"Structural Frame",
"Facade System",
"Curtain Wall",
"Hollowcore Floor",
"Concrete Lattice Floor",
"Floor Cassettes",
Expand Down
52 changes: 29 additions & 23 deletions src/types/common/productCategorySchema.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
import { z } from "zod";
import { BuildingSystemEnum, ProductCategoryEnum } from "./enums";
import { BuildingSystemEnum, ProductCategoryEnum,IfcBuildingElementEnum } from "./enums";

// Temporary schema for values
const RawProductCategorySchema = z.object({
category: ProductCategoryEnum,
buildingSystem: BuildingSystemEnum
buildingSystem: BuildingSystemEnum,
ifcCompatibleElements: z
.array(IfcBuildingElementEnum)
.optional(),
});

const productCategoryValues: z.infer<typeof RawProductCategorySchema>[] = [
{ category: "Boarding", buildingSystem: "Wall" },
{ category: "Solid Wall Panels", buildingSystem: "Wall" },
{ category: "Closed Wall Panels", buildingSystem: "Wall" },
{ category: "Twinwall", buildingSystem: "Wall" },
{ category: "Open Wall Panels", buildingSystem: "Wall" },
{ category: "Structural Insulated Panels (SIPs)", buildingSystem: "Wall" },
{ category: "Insulated Concrete Panels", buildingSystem: "Wall" },
{ category: "Whole Building System", buildingSystem: "Frame" },
{ category: "Structural Frame", buildingSystem: "Frame" },
{ category: "Hollowcore Floor", buildingSystem: "Floors" },
{ category: "Concrete Lattice Floor", buildingSystem: "Floors" },
{ category: "Floor Cassettes", buildingSystem: "Floors" },
{ category: "Solid Floor Panels", buildingSystem: "Floors" },
{ category: "Roof Panel", buildingSystem: "Roofs" },
{ category: "Roof Truss", buildingSystem: "Roofs" },
{ category: "Prefabricated Balcony", buildingSystem: "Balcony" },
{ category: "Pod", buildingSystem: "Pod" },
{ category: "Facade System", buildingSystem: "Facade" },
{ category: "Volumetric module", buildingSystem: "Modules" },
{ category: "Prefabricated Plant", buildingSystem: "Plants" },
{ category: "Prefabricated Stairs", buildingSystem: "Stairs" },
{ category: "Boarding", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcBuildingElementProxy"] },
{ category: "Solid Wall Panels", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcBuildingElementProxy"] },
{ category: "Closed Wall Panels", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcBuildingElementProxy"] },
{ category: "Twinwall", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcBuildingElementProxy"] },
{ category: "Open Wall Panels", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcBuildingElementProxy"] },
{ category: "Structural Insulated Panels (SIPs)", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcBuildingElementProxy"] },
{ category: "Insulated Concrete Panels", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcBuildingElementProxy"] },
{ category: "Whole Building System", buildingSystem: "Frame", ifcCompatibleElements: ["IfcBuildingElementProxy","IfcWall","IfcSlab","IfcRoof","IfcColumn","IfcBeam"] },
{ category: "Structural Frame", buildingSystem: "Frame", ifcCompatibleElements: ["IfcBuildingElementProxy","IfcColumn","IfcBeam","IfcMember"] },
{ category: "Hollowcore Floor", buildingSystem: "Floors", ifcCompatibleElements: ["IfcSlab","IfcBuildingElementProxy"] },
{ category: "Concrete Lattice Floor", buildingSystem: "Floors", ifcCompatibleElements: ["IfcSlab","IfcBuildingElementProxy"] },
{ category: "Floor Cassettes", buildingSystem: "Floors", ifcCompatibleElements: ["IfcSlab","IfcBuildingElementProxy"] },
{ category: "Solid Floor Panels", buildingSystem: "Floors", ifcCompatibleElements: ["IfcSlab","IfcBuildingElementProxy"] },
{ category: "Roof Panel", buildingSystem: "Roofs", ifcCompatibleElements: ["IfcRoof","IfcBuildingElementProxy","IfcCovering"] },
{ category: "Roof Truss", buildingSystem: "Roofs", ifcCompatibleElements: ["IfcRoof","IfcBuildingElementProxy","IfcBeam"] },
{ category: "Prefabricated Balcony", buildingSystem: "Balcony", ifcCompatibleElements: ["IfcBuildingElementProxy","IfcSlab"] },
{ category: "Pod", buildingSystem: "Pod", ifcCompatibleElements: ["IfcBuildingElementProxy"] },
{ category: "Facade System", buildingSystem: "Facade", ifcCompatibleElements: ["IfcCurtainWall","IfcBuildingElementProxy","IfcWall"] },
{ category: "Curtain Wall", buildingSystem: "Facade", ifcCompatibleElements: ["IfcCurtainWall","IfcBuildingElementProxy","IfcWall"] },
{ category: "Volumetric module", buildingSystem: "Modules", ifcCompatibleElements: ["IfcBuildingElementProxy","IfcWall","IfcSlab","IfcRoof"] },
{ category: "Prefabricated Plant", buildingSystem: "Plants", ifcCompatibleElements: ["IfcBuildingElementProxy"] },
{ category: "Prefabricated Stairs", buildingSystem: "Stairs", ifcCompatibleElements: ["IfcStair","IfcBuildingElementProxy","IfcRamp"] },
{ category: "Structural Beam", buildingSystem: "Structure", ifcCompatibleElements: ["IfcBeam", "IfcMember","IfcBuildingElementProxy"] },
{ category: "Structural Column", buildingSystem: "Structure", ifcCompatibleElements: ["IfcColumn", "IfcMember","IfcBuildingElementProxy"] },
];

const ProductCategorySchema = RawProductCategorySchema.refine(
Expand Down