mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 04:09:26 +00:00
changed all models to typescript
This commit is contained in:
@@ -4,13 +4,15 @@ import {
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
Model,
|
||||
DataType,
|
||||
PrimaryKey,
|
||||
AutoIncrement,
|
||||
AllowNull,
|
||||
Unique,
|
||||
Default
|
||||
Default,
|
||||
HasMany
|
||||
} from "sequelize-typescript";
|
||||
import ContactCustomField from "./ContactCustomField";
|
||||
import Ticket from "./Ticket";
|
||||
|
||||
@Table
|
||||
class Contact extends Model<Contact> {
|
||||
@@ -19,7 +21,7 @@ class Contact extends Model<Contact> {
|
||||
@Column
|
||||
id: number;
|
||||
|
||||
@Column(DataType.STRING)
|
||||
@Column
|
||||
name: string;
|
||||
|
||||
@AllowNull(false)
|
||||
@@ -40,6 +42,12 @@ class Contact extends Model<Contact> {
|
||||
|
||||
@UpdatedAt
|
||||
updatedAt: Date;
|
||||
|
||||
@HasMany(() => Ticket)
|
||||
tickets: Ticket[];
|
||||
|
||||
@HasMany(() => ContactCustomField)
|
||||
extraInfo: ContactCustomField[];
|
||||
}
|
||||
|
||||
export default Contact;
|
||||
|
||||
Reference in New Issue
Block a user