68 lines
1.5 KiB
TypeScript
68 lines
1.5 KiB
TypeScript
import {
|
|
Table,
|
|
Column,
|
|
Model,
|
|
DataType,
|
|
PrimaryKey,
|
|
AutoIncrement,
|
|
Default,
|
|
} from 'sequelize-typescript';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
@Table({ tableName: 'locations' })
|
|
export class Location extends Model {
|
|
@ApiProperty({ type: Number })
|
|
@PrimaryKey
|
|
@AutoIncrement
|
|
@Column({ type: DataType.BIGINT })
|
|
id: number;
|
|
|
|
@ApiProperty({ type: String })
|
|
@Column({ type: DataType.TEXT })
|
|
name: string;
|
|
|
|
@ApiProperty({ type: String })
|
|
@Column({ type: DataType.TEXT })
|
|
code: string;
|
|
|
|
@ApiProperty({ type: [String] })
|
|
@Column({ type: DataType.ARRAY(DataType.TEXT) })
|
|
images: string[];
|
|
|
|
@ApiProperty({ type: String })
|
|
@Column({ type: DataType.TEXT })
|
|
status: string;
|
|
|
|
@ApiProperty({ type: Date })
|
|
@Column({ type: DataType.DATEONLY })
|
|
validFrom: Date;
|
|
|
|
@ApiProperty({ type: Date })
|
|
@Column({ type: DataType.DATEONLY })
|
|
validTill: Date;
|
|
|
|
@ApiProperty({ type: Date })
|
|
@Column({ type: DataType.DATE })
|
|
createdAt: Date;
|
|
|
|
@ApiProperty({ type: Date })
|
|
@Column({ type: DataType.DATE })
|
|
updatedAt: Date;
|
|
|
|
@ApiProperty({ type: String })
|
|
@Column({ type: DataType.TEXT })
|
|
createdBy: string;
|
|
|
|
@ApiProperty({ type: String })
|
|
@Column({ type: DataType.TEXT })
|
|
modifiedBy: string;
|
|
|
|
@ApiProperty({ type: Date })
|
|
@Column({ type: DataType.DATE })
|
|
deletedAt: Date;
|
|
|
|
@ApiProperty({ type: Number })
|
|
@Column({ type: DataType.NUMBER })
|
|
version: number;
|
|
}
|