add core api

This commit is contained in:
ItsMalma
2025-11-15 22:28:58 +07:00
parent e6386648be
commit 8f91994f29
78 changed files with 6701 additions and 904 deletions

View File

@@ -1,14 +1,9 @@
import { Airport } from "@/database/entities/airport.entity";
import { Country } from "@/database/entities/country.entity";
import { Hotel } from "@/database/entities/hotel.entity";
import {
Collection,
Entity,
ManyToOne,
OneToMany,
PrimaryKey,
Property,
Unique,
type Rel,
} from "@mikro-orm/core";
@@ -17,10 +12,6 @@ export class City {
@PrimaryKey({ type: "varchar", length: 30 })
id!: string;
@Property({ type: "varchar", length: 200 })
@Unique()
slug!: string;
@Property({ type: "varchar", length: 100 })
name!: string;
@@ -39,12 +30,4 @@ export class City {
onUpdate: () => new Date(),
})
updatedAt!: Date;
// Collections
@OneToMany(() => Airport, (airport) => airport.city)
cities = new Collection<City>(this);
@OneToMany(() => Hotel, (hotel) => hotel.city)
hotels = new Collection<Hotel>(this);
}