mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 19:59:20 +00:00
changed contacts routes to typescript
This commit is contained in:
36
backend/src/models/Ticket.ts
Normal file
36
backend/src/models/Ticket.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
Table,
|
||||
Column,
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
Model,
|
||||
DataType,
|
||||
PrimaryKey
|
||||
} from "sequelize-typescript";
|
||||
|
||||
@Table
|
||||
class Ticket extends Model<Ticket> {
|
||||
@PrimaryKey
|
||||
@Column(DataType.NUMBER)
|
||||
id: number;
|
||||
|
||||
@Column({ defaultValue: "pending" })
|
||||
status: string;
|
||||
|
||||
// @Column({ allowNull: false, unique: true })
|
||||
// userId: string;
|
||||
|
||||
@Column(DataType.VIRTUAL)
|
||||
unreadMessages: string;
|
||||
|
||||
@Column(DataType.STRING)
|
||||
lastMessage: string;
|
||||
|
||||
@CreatedAt
|
||||
createdAt: Date;
|
||||
|
||||
@UpdatedAt
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export default Ticket;
|
||||
Reference in New Issue
Block a user