mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 04:09:26 +00:00
changed contacts routes to typescript
This commit is contained in:
45
backend/src/models/Contact.ts
Normal file
45
backend/src/models/Contact.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import {
|
||||
Table,
|
||||
Column,
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
Model,
|
||||
DataType,
|
||||
PrimaryKey,
|
||||
AutoIncrement,
|
||||
AllowNull,
|
||||
Unique,
|
||||
Default
|
||||
} from "sequelize-typescript";
|
||||
|
||||
@Table
|
||||
class Contact extends Model<Contact> {
|
||||
@PrimaryKey
|
||||
@AutoIncrement
|
||||
@Column
|
||||
id: number;
|
||||
|
||||
@Column(DataType.STRING)
|
||||
name: string;
|
||||
|
||||
@AllowNull(false)
|
||||
@Unique
|
||||
@Column
|
||||
number: string;
|
||||
|
||||
@AllowNull(false)
|
||||
@Default("")
|
||||
@Column
|
||||
email: string;
|
||||
|
||||
@Column
|
||||
profilePicUrl: string;
|
||||
|
||||
@CreatedAt
|
||||
createdAt: Date;
|
||||
|
||||
@UpdatedAt
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export default Contact;
|
||||
Reference in New Issue
Block a user