Vizzuality/landgriffon

View on GitHub
api/src/baseEntities/timestamped-base-entity.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { BaseEntity, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';

export class TimestampedBaseEntity extends BaseEntity {
  @CreateDateColumn({
    type: 'timestamptz',
  })
  @ApiProperty()
  createdAt!: string;

  @UpdateDateColumn({
    type: 'timestamptz',
  })
  @ApiProperty()
  updatedAt!: string;
}