| 12345678910111213141516171819202122232425 |
- 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<VendureEntity>) {
- if (input) {
- for (const [key, value] of Object.entries(input)) {
- this[key] = value;
- }
- }
- }
- @PrimaryGeneratedColumn(keyType) id: ID;
- @CreateDateColumn() createdAt: Date;
- @UpdateDateColumn() updatedAt: Date;
- }
|