You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 lines
946 B

import { Model, Table, Column, DataType } from "sequelize-typescript";
@Table
export class Product extends Model<Product> {
@Column({
type: DataType.STRING,
allowNull: false,
})
name: string;
@Column({
type: DataType.STRING,
allowNull: false,
})
description: string;
@Column({
type: DataType.DECIMAL(10, 2),
allowNull: false,
})
price: number;
@Column({
type: DataType.STRING,
allowNull: true,
})
imageUrl: string;
@Column({
type: DataType.ARRAY(DataType.STRING),
allowNull: true,
})
tags: string[];
@Column({
type: DataType.INTEGER,
allowNull: false,
defaultValue: 0,
})
quantity: number;
@Column({
type: DataType.STRING,
allowNull: true,
})
brand: string;
@Column({
type: DataType.STRING,
allowNull: true,
})
color: string;
@Column({
type: DataType.STRING,
allowNull: false,
})
category: string;
}