All files / common base.entity.ts

80% Statements 8/10
100% Branches 0/0
33.33% Functions 1/3
66.66% Lines 4/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16          1x   3x     3x     3x    
import { v4 } from 'uuid';
 
import { Entity, PrimaryKey, Property } from '@mikro-orm/core';
 
@Entity({ abstract: true })
export abstract class BaseEntity {
  @PrimaryKey({ type: 'uuid' })
  id: string = v4();
 
  @Property({ onCreate: () => new Date() })
  createdAt: Date = new Date();
 
  @Property({ onUpdate: () => new Date() })
  updatedAt: Date = new Date();
}