Connect Orders database table with Payments and Addresses, visualize it in the frontend

This commit is contained in:
2024-09-24 23:41:35 +02:00
parent 531f964841
commit 6dd49f630d
19 changed files with 517 additions and 223 deletions

View File

@@ -1,5 +1,6 @@
import { BelongsTo, Column, ForeignKey, Model, Table } from "sequelize-typescript";
import { BelongsTo, Column, ForeignKey, HasMany, Model, Table } from "sequelize-typescript";
import { Account } from "./account.model";
import { Order } from "./order.model";
@Table({ timestamps: false })
export class Payment extends Model {
@@ -15,6 +16,10 @@ export class Payment extends Model {
// Relations
@BelongsTo(() => Account)
account: Account
@HasMany(() => Order)
orders: Order[]
}