53 lines
1.1 KiB
TypeScript
53 lines
1.1 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
UpdateDateColumn,
|
|
} from "typeorm";
|
|
|
|
@Entity({ name: process.env.TABEL_SKUS })
|
|
export class Sku {
|
|
@PrimaryGeneratedColumn("increment")
|
|
id!: number;
|
|
|
|
@Column({ type: "varchar", length: 255, unique: true })
|
|
sku!: string;
|
|
|
|
@Column({
|
|
type: "enum",
|
|
enum: ["pass", "done", "error", "pending", "processing"],
|
|
})
|
|
status!: string;
|
|
|
|
@Column({ type: "json", nullable: true })
|
|
source_data?: string;
|
|
|
|
@Column({ type: "longtext", nullable: true })
|
|
normalized_html?: string;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
normalized_title?: string;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
normalized_short_description?: string;
|
|
|
|
@Column({ type: "text", nullable: true })
|
|
error_message?: string;
|
|
|
|
@CreateDateColumn({
|
|
type: "timestamp",
|
|
precision: 0,
|
|
default: () => "CURRENT_TIMESTAMP",
|
|
})
|
|
created_at!: Date;
|
|
|
|
@UpdateDateColumn({
|
|
type: "timestamp",
|
|
precision: 0,
|
|
default: () => "CURRENT_TIMESTAMP",
|
|
onUpdate: "CURRENT_TIMESTAMP",
|
|
})
|
|
updated_at!: Date;
|
|
}
|