Display concerts with card views on "All concerts" page, adding image property for tours

This commit is contained in:
2024-09-28 21:18:25 +02:00
parent 8d0b141217
commit 0616409f14
49 changed files with 454 additions and 219 deletions

View File

@@ -0,0 +1,35 @@
import { BelongsTo, Column, ForeignKey, HasMany, Model, Table } from "sequelize-typescript";
import { Location } from "./location.model";
import { Tour } from "./tour.model";
import { OrderItem } from "../ordering/orderItem.model";
@Table({ timestamps: false })
export class Concert extends Model {
@Column
date: String
@Column
price: Number
@Column
inStock: Number
@ForeignKey(() => Location)
@Column
locationId: Number
@ForeignKey(() => Tour)
tourId: Number
// Relations
@BelongsTo(() => Tour)
tour: Tour
@BelongsTo(() => Location)
location: Location
@HasMany(() => OrderItem)
orderItems: OrderItem[]
}