package models

import (
	"time"
)

type Licence struct {
	ID             uint `json:"id"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
	Status         int8       `json:"status" binding:"omitempty,number"`
	Number         string     `json:"number" binding:"omitempty,safe_content"`
	IssuedDate     time.Time  `json:"issued_date" binding:"omitempty"`
	ExpirationDate time.Time  `json:"expiration_date" binding:"omitempty"`
	IssuingCountry string     `json:"country" binding:"safe_content"`
	Categories     []Category `json:"categories" gorm:"many2many:licence_2_categories"`
}

type Category struct {
	ID   uint   `json:"id" gorm:"primaryKey"`
	Name string `json:"category" binding:"safe_content"`
}
