This repository has been archived by the owner on Dec 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ticket.go
42 lines (35 loc) · 1.5 KB
/
ticket.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package dbadmin
import (
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type TicketStatus string
const (
TicketStatusNew TicketStatus = "NEW"
TicketStatusClosed TicketStatus = "CLOSED"
TicketStatusInProgress TicketStatus = "IN_PROGRESS" // TicketStatusInProgress admin must process it
TicketStatusPending TicketStatus = "PENDING" // TicketStatusPending service worker must process it
)
type TicketCustomer struct {
FirstName string `bson:"firstName" json:"firstName"`
LastName string `bson:"lastName" json:"lastName"`
Telephone string `bson:"telephone" json:"telephone"`
Email string `bson:"email" json:"email"`
OrderReference string `bson:"orderReference" json:"orderReference"`
}
type TicketMessage struct {
From string `bson:"from" json:"from"`
Role string `bson:"role" json:"role"`
Text string `bson:"text" json:"text"`
CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
}
type Ticket struct {
ID primitive.ObjectID `bson:"_id" json:"id"`
TicketNumber string `bson:"ticketNumber" json:"ticketNumber"`
Status TicketStatus `bson:"status" json:"status"`
StoreKey string `bson:"storeKey" json:"storeKey"`
Customer TicketCustomer `bson:"customer" json:"customer"`
CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
UpdatedAt time.Time `bson:"updatedAt" json:"updatedAt"`
Messages []TicketMessage `bson:"messages" json:"messages"`
}