Adding Seat plan component and database tables
This commit is contained in:
22
software/backend/models/locations/seatRow.model.ts
Normal file
22
software/backend/models/locations/seatRow.model.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { BelongsTo, Column, ForeignKey, HasMany, Model, Table } from "sequelize-typescript";
|
||||
import { SeatGroup } from "./seatGroup.model";
|
||||
import { Seat } from "./seat.model";
|
||||
|
||||
@Table({ timestamps: false })
|
||||
export class SeatRow extends Model {
|
||||
@Column
|
||||
row: number
|
||||
|
||||
@ForeignKey(() => SeatGroup)
|
||||
@Column
|
||||
seatGroupId: number
|
||||
|
||||
|
||||
// Relations
|
||||
|
||||
@BelongsTo(() => SeatGroup)
|
||||
seatGroup: SeatGroup
|
||||
|
||||
@HasMany(() => Seat)
|
||||
seats: Seat[]
|
||||
}
|
||||
Reference in New Issue
Block a user