This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
notifications.go
52 lines (45 loc) · 2.52 KB
/
notifications.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
43
44
45
46
47
48
49
50
51
52
package models
import "time"
type TypeEvenement string
const (
EvenementCreationMessage TypeEvenement = "message"
EvenementCreationCommentaire TypeEvenement = "commentaire"
EvenementLectureMessage TypeEvenement = "lecture_message"
EvenementCommentaireGeneral TypeEvenement = "commentaire_general"
EvenementCreationInspection TypeEvenement = "creation_inspection"
EvenementModificationInspection TypeEvenement = "modification_inspection"
EvenementPublicationInspection TypeEvenement = "publication_inspection"
EvenementDemandeValidationInspection TypeEvenement = "demande_validation_inspection"
EvenementRejetValidationInspection TypeEvenement = "rejet_validation_inspection"
EvenementValidationInspection TypeEvenement = "validation_inspection"
EvenementClotureInspection TypeEvenement = "cloture_inspection"
EvenementCreationPointDeControle TypeEvenement = "creation_point_de_controle"
EvenementModificationPointDeControle TypeEvenement = "modification_point_de_controle"
EvenementSuppressionPointDeControle TypeEvenement = "suppression_point_de_controle"
EvenementPublicationPointDeControle TypeEvenement = "publication_point_de_controle"
EvenementCreationConstat TypeEvenement = "creation_constat"
EvenementModificationConstat TypeEvenement = "modification_constat"
EvenementSuppressionConstat TypeEvenement = "suppression_constat"
EvenementResolutionConstat TypeEvenement = "resolution_constat"
EvenementCreationSuite TypeEvenement = "creation_suite"
EvenementModificationSuite TypeEvenement = "modification_suite"
EvenementSuppressionSuite TypeEvenement = "suppression_suite"
)
type Notification struct {
Id int64 `json:"id"`
Lue bool `json:"lue" sql:",notnull"`
EvenementId int64 `json:"evenement_id" sql:",notnull"`
DestinataireId int64 `json:"destinataire_id" sql:",notnull"`
Destinataire *User `json:"-"`
Evenement *Evenement `json:"evenement,omitempty"`
}
type Evenement struct {
Id int64 `json:"id"`
Type TypeEvenement `json:"type"`
CreatedAt time.Time `json:"created_at"`
Data map[string]interface{} `json:"data" sql:"type:jsonb"`
AuteurId int64 `json:"auteur_id" sql:",notnull"`
InspectionId int64 `json:"inspection_id" sql:",notnull"`
Auteur *User `json:"auteur,omitempty"`
Inspection *Inspection `json:"-"`
}