Extend database with more tables, rewrite API doc, improve API endpoints
This commit is contained in:
14
software/backend/models/brand.model.ts
Normal file
14
software/backend/models/brand.model.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Column, HasMany, Model, Table } from "sequelize-typescript";
|
||||
import { Product } from "./product.model";
|
||||
|
||||
@Table({ timestamps: false })
|
||||
export class Brand extends Model {
|
||||
@Column
|
||||
name: string
|
||||
|
||||
|
||||
// Relations
|
||||
|
||||
@HasMany(() => Product)
|
||||
products: Product[]
|
||||
}
|
||||
Reference in New Issue
Block a user