mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 04:09:26 +00:00
54 lines
755 B
TypeScript
54 lines
755 B
TypeScript
import {
|
|
Table,
|
|
Column,
|
|
CreatedAt,
|
|
UpdatedAt,
|
|
Model,
|
|
PrimaryKey,
|
|
AutoIncrement,
|
|
AllowNull,
|
|
Unique,
|
|
Default,
|
|
HasMany
|
|
} from "sequelize-typescript";
|
|
import ContactCustomField from "./ContactCustomField";
|
|
import Ticket from "./Ticket";
|
|
|
|
@Table
|
|
class Contact extends Model<Contact> {
|
|
@PrimaryKey
|
|
@AutoIncrement
|
|
@Column
|
|
id: number;
|
|
|
|
@Column
|
|
name: string;
|
|
|
|
@AllowNull(false)
|
|
@Unique
|
|
@Column
|
|
number: string;
|
|
|
|
@AllowNull(false)
|
|
@Default("")
|
|
@Column
|
|
email: string;
|
|
|
|
@Column
|
|
profilePicUrl: string;
|
|
|
|
@CreatedAt
|
|
createdAt: Date;
|
|
|
|
@UpdatedAt
|
|
updatedAt: Date;
|
|
|
|
@HasMany(() => Ticket)
|
|
tickets: Ticket[];
|
|
|
|
@HasMany(() => ContactCustomField)
|
|
extraInfo: ContactCustomField[];
|
|
}
|
|
|
|
export default Contact;
|