This commit is contained in:
Kiss Dávid
2026-03-21 12:34:22 +01:00
parent 465613f6a0
commit 9efbe5baee
42 changed files with 571 additions and 562 deletions
Regular → Executable
+13 -5
View File
@@ -1,6 +1,6 @@
import { DateTime } from 'luxon'
import { BaseModel, column, hasMany } from '@adonisjs/lucid/orm'
import type { HasMany } from '@adonisjs/lucid/types/relations'
import { BaseModel, column, manyToMany } from '@adonisjs/lucid/orm'
import type { ManyToMany } from '@adonisjs/lucid/types/relations'
import RestaurantMenuItem from './restaurant_menu_item.js'
export default class RestaurantMenu extends BaseModel {
@@ -16,6 +16,14 @@ export default class RestaurantMenu extends BaseModel {
@column()
declare name: string
@hasMany(() => RestaurantMenuItem)
declare items: HasMany<typeof RestaurantMenuItem>
}
@column({ columnName: 'name_hu' })
declare nameHu: string | null
@column({ columnName: 'name_en' })
declare nameEn: string | null
@manyToMany(() => RestaurantMenuItem, {
pivotTable: 'menu_item_menus',
})
declare items: ManyToMany<typeof RestaurantMenuItem>
}