add driversLicence model
This commit is contained in:
27
internal/models/drivers_licence.go
Normal file
27
internal/models/drivers_licence.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type DriversLicence struct {
|
||||
gorm.Model
|
||||
Status int8 `json:"licence_status" validate:"omitempty,number"`
|
||||
LicenceNumber string `json:"licence_number" validate:"safe_content"`
|
||||
IssuedDate time.Time `json:"licence_issued_date" validate:"omitempty,lte"`
|
||||
ExpirationDate time.Time `json:"licence_expiration_date" validate:"omitempty,gt"`
|
||||
IssuingCountry string `json:"licence_country" validate:"safe_content"`
|
||||
LicenceCategories []LicenceCategory `json:"licence_categories" gorm:"many2many:licence_2_categories"`
|
||||
}
|
||||
|
||||
type LicenceCategory struct {
|
||||
gorm.Model
|
||||
Category string `json:"licence_category" validate:"safe_content"`
|
||||
}
|
||||
|
||||
// func (d *DriversLicence) BeforeCreate(tx *gorm.DB) (err error) {
|
||||
// d.Status = constants.UnverifiedStatus
|
||||
// return
|
||||
// }
|
||||
Reference in New Issue
Block a user