Skip to content

Commit

Permalink
models: (reportevent) Fix Unique parsing issue with workaround
Browse files Browse the repository at this point in the history
See #92
  • Loading branch information
5HT2 committed Mar 20, 2023
1 parent 76290ca commit 447e844
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions models/reportevent.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package models

import "sort"
import (
"sort"

"github.com/google/uuid"
)

type ReportEvent struct {
Report Unique `json:"report_id" db:"report_id"` // References the original report ID
Index int64 `json:"index" db:"event_index"` // Order of sections
Timestamp Timestamp `json:"timestamp" db:"event_timestamp"` // Timestamp of event
Type ReportEventType `json:"type" db:"event_type"` // Type of event
Section ReportEventSection `json:"section" db:"event_section"` // Section event is in
Content string `json:"content" db:"event_content"` // Content of event, if ReportEventNote
Drug Drug `json:"drug,omitempty" db:"event_drug"` // Drug of event, if ReportEventDrug
Report uuid.UUID `json:"report_id" db:"report_id"` // References the original report ID
Index int64 `json:"index" db:"event_index"` // Order of sections
Timestamp Timestamp `json:"timestamp" db:"event_timestamp"` // Timestamp of event
Type ReportEventType `json:"type" db:"event_type"` // Type of event
Section ReportEventSection `json:"section" db:"event_section"` // Section event is in
Content string `json:"content" db:"event_content"` // Content of event, if ReportEventNote
DrugID uuid.UUID `json:"drug_id,omitempty" db:"event_drug"` // DrugID of event, corresponds to Drug, if ReportEventDrug
Drug Drug `json:"drug,omitempty"` // Drug of event,if ReportEventDrug
}

type ReportEventType int64
Expand Down

0 comments on commit 447e844

Please sign in to comment.