29 lines
918 B
Go
29 lines
918 B
Go
package model
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"gorm.io/gorm"
|
|
"time"
|
|
)
|
|
|
|
type Event struct {
|
|
gorm.Model
|
|
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primarykey"`
|
|
Start time.Time `json:"start"`
|
|
End time.Time `json:"end"`
|
|
Author User `json:"author" gorm:"-"`
|
|
AuthorId uuid.UUID `json:"-"`
|
|
Medic User `json:"medic" gorm:"-"`
|
|
MedicId uuid.UUID `json:"-"`
|
|
Person PersonalInformation `json:"person" gorm:"-"`
|
|
PersonId uuid.UUID `json:"-"`
|
|
OrgId uuid.UUID `json:"-"`
|
|
}
|
|
|
|
type CreateEvent struct {
|
|
Start time.Time `json:"start" validate:"required,datetime"`
|
|
End time.Time `json:"end" validate:"required,datetime"`
|
|
Person PersonalInformation `json:"person" validate:"required"`
|
|
MedicId uuid.UUID `json:"medic_id" validate:"required"`
|
|
}
|