express-typeorm-rest-boilerplate
Version:
Boilerplate code to get started with building RESTful API Services
48 lines (38 loc) • 907 B
text/typescript
import { Entity, ObjectIdColumn, Column, Index, ObjectID } from 'typeorm';
import { IsUrl, IsString, IsNumberString } from 'class-validator';
export class Company {
id?: ObjectID;
name?: string;
description?: string;
logo?: string;
website?: string;
headquarters?: { city?: string; country?: string };
industry?: string;
foundedYear?: string;
public constructor(data?: Company) {
if (data) {
this.name = data.name;
this.description = data.description;
this.logo = data.logo;
this.website = data.website;
this.headquarters = data.headquarters;
this.industry = data.industry;
this.foundedYear = data.foundedYear;
}
}
}