import { CreateDateColumn, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'; import { DeepPartial, ID } from '../../../../shared/shared-types'; import { primaryKeyType } from '../../config/vendure-config'; const keyType = primaryKeyType(); /** * This is the base class from which all entities inherit. */ export abstract class VendureEntity { protected constructor(input?: DeepPartial) { if (input) { for (const [key, value] of Object.entries(input)) { this[key] = value; } } } @PrimaryGeneratedColumn(keyType) id: ID; @CreateDateColumn() createdAt: Date; @UpdateDateColumn() updatedAt: Date; }