upd
This commit is contained in:
+1
-1
@@ -28,7 +28,7 @@ for (const {
|
||||
unit_type,
|
||||
unit_view,
|
||||
balcony_area,
|
||||
} of unitsOfMarasiDrive.concat(unitsOfDubaiMarina)) {
|
||||
} of unitsOfMarasiDrive) {
|
||||
type Unit = typeof unitsTable.$inferInsert;
|
||||
|
||||
const parts = unit_no.split("-");
|
||||
|
||||
@@ -72,39 +72,11 @@ export const unitsController = new Elysia({ prefix: "/units" })
|
||||
query: t.Partial(
|
||||
t.Object({
|
||||
project: t.String(),
|
||||
unitTypes: t.Array(
|
||||
t.Union([
|
||||
t.Literal("Studio Squared"),
|
||||
t.Literal("1 BR Squared"),
|
||||
t.Literal("Studio Flex"),
|
||||
t.Literal("2 BR Squared"),
|
||||
t.Literal("Studio2"),
|
||||
t.Literal("One Bedroom2"),
|
||||
t.Literal("One Bedroom Loft"),
|
||||
t.Literal("Two Bedroom Loft"),
|
||||
])
|
||||
),
|
||||
unitTypes: t.Array(t.String()),
|
||||
cost: t.Tuple([t.Number(), t.Number()]),
|
||||
floor: t.Tuple([t.Number(), t.Number()]),
|
||||
area: t.Tuple([t.Number(), t.Number()]),
|
||||
view: t.Union([
|
||||
t.Literal("Canal / Amenities"),
|
||||
t.Literal("Corner-Canal / Amenities"),
|
||||
t.Literal("Corner-Canal View"),
|
||||
t.Literal("Business Bay"),
|
||||
t.Literal("Park Facing"),
|
||||
t.Literal("Corner-Park Facing"),
|
||||
t.Literal("Partial Park"),
|
||||
t.Literal("BK/DT / Amenities"),
|
||||
t.Literal("Corner-BK/DT / Amenities"),
|
||||
t.Literal("Corner-Canal / BK/DT View"),
|
||||
t.Literal("Marina View"),
|
||||
t.Literal("Partial Marina View"),
|
||||
t.Literal("Partial Marina, Partial City View"),
|
||||
t.Literal("City view"),
|
||||
t.Literal("Marina View, Sea View"),
|
||||
t.Literal("Partial Marina View, Partial Sea View"),
|
||||
]),
|
||||
view: t.String(),
|
||||
order: t.Tuple([
|
||||
t.Union([t.Literal("cost"), t.Literal("sqft")]),
|
||||
t.Union([t.Literal("asc"), t.Literal("desc")]),
|
||||
@@ -150,39 +122,11 @@ export const unitsController = new Elysia({ prefix: "/units" })
|
||||
query: t.Partial(
|
||||
t.Object({
|
||||
project: t.String(),
|
||||
unitTypes: t.Array(
|
||||
t.Union([
|
||||
t.Literal("Studio Squared"),
|
||||
t.Literal("1 BR Squared"),
|
||||
t.Literal("Studio Flex"),
|
||||
t.Literal("2 BR Squared"),
|
||||
t.Literal("Studio2"),
|
||||
t.Literal("One Bedroom2"),
|
||||
t.Literal("One Bedroom Loft"),
|
||||
t.Literal("Two Bedroom Loft"),
|
||||
])
|
||||
),
|
||||
unitTypes: t.Array(t.String()),
|
||||
cost: t.Tuple([t.Number(), t.Number()]),
|
||||
floor: t.Tuple([t.Number(), t.Number()]),
|
||||
area: t.Tuple([t.Number(), t.Number()]),
|
||||
view: t.Union([
|
||||
t.Literal("Canal / Amenities"),
|
||||
t.Literal("Corner-Canal / Amenities"),
|
||||
t.Literal("Corner-Canal View"),
|
||||
t.Literal("Business Bay"),
|
||||
t.Literal("Park Facing"),
|
||||
t.Literal("Corner-Park Facing"),
|
||||
t.Literal("Partial Park"),
|
||||
t.Literal("BK/DT / Amenities"),
|
||||
t.Literal("Corner-BK/DT / Amenities"),
|
||||
t.Literal("Corner-Canal / BK/DT View"),
|
||||
t.Literal("Marina View"),
|
||||
t.Literal("Partial Marina View"),
|
||||
t.Literal("Partial Marina, Partial City View"),
|
||||
t.Literal("City view"),
|
||||
t.Literal("Marina View, Sea View"),
|
||||
t.Literal("Partial Marina View, Partial Sea View"),
|
||||
]),
|
||||
view: t.String(),
|
||||
})
|
||||
),
|
||||
}
|
||||
@@ -281,50 +225,16 @@ export const unitsController = new Elysia({ prefix: "/units" })
|
||||
500: t.ObjectString({}),
|
||||
},
|
||||
params: t.Object({
|
||||
filterName: t.Union([
|
||||
t.Literal("unitTypes"),
|
||||
t.Literal("views"),
|
||||
t.Literal("cost"),
|
||||
t.Literal("area"),
|
||||
t.Literal("floor"),
|
||||
]),
|
||||
filterName: t.String(),
|
||||
}),
|
||||
query: t.Partial(
|
||||
t.Object({
|
||||
project: t.String(),
|
||||
unitTypes: t.Array(
|
||||
t.Union([
|
||||
t.Literal("Studio Squared"),
|
||||
t.Literal("1 BR Squared"),
|
||||
t.Literal("Studio Flex"),
|
||||
t.Literal("2 BR Squared"),
|
||||
t.Literal("Studio2"),
|
||||
t.Literal("One Bedroom2"),
|
||||
t.Literal("One Bedroom Loft"),
|
||||
t.Literal("Two Bedroom Loft"),
|
||||
])
|
||||
),
|
||||
unitTypes: t.Array(t.String()),
|
||||
cost: t.Tuple([t.Number(), t.Number()]),
|
||||
floor: t.Tuple([t.Number(), t.Number()]),
|
||||
area: t.Tuple([t.Number(), t.Number()]),
|
||||
view: t.Union([
|
||||
t.Literal("Canal / Amenities"),
|
||||
t.Literal("Corner-Canal / Amenities"),
|
||||
t.Literal("Corner-Canal View"),
|
||||
t.Literal("Business Bay"),
|
||||
t.Literal("Park Facing"),
|
||||
t.Literal("Corner-Park Facing"),
|
||||
t.Literal("Partial Park"),
|
||||
t.Literal("BK/DT / Amenities"),
|
||||
t.Literal("Corner-BK/DT / Amenities"),
|
||||
t.Literal("Corner-Canal / BK/DT View"),
|
||||
t.Literal("Marina View"),
|
||||
t.Literal("Partial Marina View"),
|
||||
t.Literal("Partial Marina, Partial City View"),
|
||||
t.Literal("City view"),
|
||||
t.Literal("Marina View, Sea View"),
|
||||
t.Literal("Partial Marina View, Partial Sea View"),
|
||||
]),
|
||||
view: t.String(),
|
||||
})
|
||||
),
|
||||
}
|
||||
|
||||
+3
-28
@@ -12,39 +12,14 @@ export const unitsTable = pgTable(
|
||||
floor: integer("floor").notNull(),
|
||||
unitType: varchar("unit_type", {
|
||||
length: 256,
|
||||
enum: [
|
||||
"Studio Squared",
|
||||
"1 BR Squared",
|
||||
"Studio Flex",
|
||||
"2 BR Squared",
|
||||
"One Bedroom2",
|
||||
"Studio2",
|
||||
"One Bedroom Loft",
|
||||
"Two Bedroom Loft",
|
||||
],
|
||||
}),
|
||||
noOfBathrooms: integer("no_of_bathrooms").notNull(),
|
||||
unitView: varchar("unit_view", {
|
||||
length: 256,
|
||||
enum: [
|
||||
"Canal / Amenities",
|
||||
"Corner-Canal / Amenities",
|
||||
"Corner-Canal View",
|
||||
"Business Bay",
|
||||
"Park Facing",
|
||||
"Corner-Park Facing",
|
||||
"Partial Park",
|
||||
"BK/DT / Amenities",
|
||||
"Corner-BK/DT / Amenities",
|
||||
"Corner-Canal / BK/DT View",
|
||||
"Marina View",
|
||||
"Partial Marina View",
|
||||
"Partial Marina, Partial City View",
|
||||
"City view",
|
||||
"Marina View, Sea View",
|
||||
"Partial Marina View, Partial Sea View",
|
||||
],
|
||||
}),
|
||||
// unitTypeVariant: varchar("unit_type_variant", {
|
||||
// length: 256,
|
||||
// }),
|
||||
suitsArea: doublePrecision("suits_area").notNull(),
|
||||
squareFt: doublePrecision("square_ft").notNull(),
|
||||
noOfParkingSpace: integer("no_of_parking_space").notNull(),
|
||||
|
||||
Reference in New Issue
Block a user