express-typeorm-rest-boilerplate
Version:
Boilerplate code to get started with building RESTful API Services
53 lines (42 loc) • 1.01 kB
text/typescript
import { Entity, ObjectIdColumn, Column, ObjectID } from 'typeorm';
import { IsNotEmpty, IsString } from 'class-validator';
import { Company } from './Company';
import { User } from './User';
export class JobApplication {
id?: ObjectID;
role?: string;
description?: string;
company?: ObjectID | Company;
user?: ObjectID | User;
status?: string;
appliedDate?: string;
createdAt?: string = new Date().toISOString();
updatedAt?: string;
public constructor(data?: JobApplication) {
if (data) {
this.role = data.role;
this.description = data.description;
this.company = data.company;
this.user = data.user;
this.status = data.status;
this.appliedDate = data.appliedDate;
this.updatedAt = new Date().toISOString();
}
}
}