WIP service
This commit is contained in:
@@ -1,24 +1,25 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/lib/pq"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Event struct {
|
||||
gorm.Model
|
||||
Start time.Time `json:"start"`
|
||||
End time.Time `json:"end"`
|
||||
Author User `json:"author" gorm:"-"`
|
||||
AuthorId uint `json:"-"`
|
||||
Employee User `json:"employee" gorm:"-"`
|
||||
EmployeeId uint `json:"-"`
|
||||
Member PD `json:"member" gorm:"-"`
|
||||
MemberId uint `json:"-"`
|
||||
Status string `json:"status"`
|
||||
MedicalCard Card `json:"medicalCard" gorm:"-"`
|
||||
MedicalCardId uint `json:"-"`
|
||||
Services []uint `json:"services" gorm:"-"`
|
||||
Start time.Time `json:"start"`
|
||||
End time.Time `json:"end"`
|
||||
Author User `json:"author" gorm:"-"`
|
||||
AuthorId uint `json:"-"`
|
||||
Employee User `json:"employee" gorm:"-"`
|
||||
EmployeeId uint `json:"-"`
|
||||
Member PD `json:"member" gorm:"-"`
|
||||
MemberId uint `json:"-"`
|
||||
Status string `json:"status"`
|
||||
MedicalCard Card `json:"medicalCard" gorm:"-"`
|
||||
MedicalCardId uint `json:"-"`
|
||||
Services pq.Int32Array `json:"services" gorm:"type:integer[]"`
|
||||
}
|
||||
|
||||
type CreateEvent struct {
|
||||
@@ -28,5 +29,5 @@ type CreateEvent struct {
|
||||
MemberId uint `json:"member_id"`
|
||||
Status string `json:"status"`
|
||||
MedicalCardId uint `json:"medical_card_id"`
|
||||
Services []uint `json:"services"`
|
||||
Services []int32 `json:"services"`
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type EventsServices struct {
|
||||
gorm.Model
|
||||
EventId uint
|
||||
ServiceId uint
|
||||
}
|
||||
@@ -5,16 +5,9 @@ import "gorm.io/gorm"
|
||||
type (
|
||||
User struct {
|
||||
gorm.Model
|
||||
UserName string `json:"userName" gorm:"unique"`
|
||||
UserName string `json:"user_name" gorm:"unique"`
|
||||
Password string `json:"password,omitempty"`
|
||||
FirstName string `json:"firstName"`
|
||||
LastName string `json:"lastName"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
}
|
||||
)
|
||||
|
||||
type APIUser struct {
|
||||
UserName string `json:"userName" gorm:"unique"`
|
||||
Password string `json:"password,omitempty"`
|
||||
FirstName string `json:"firstName"`
|
||||
LastName string `json:"lastName"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user