32 lines
1017 B
Go
32 lines
1017 B
Go
package holiday
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"time"
|
|
)
|
|
|
|
type Holiday struct {
|
|
Id uuid.UUID `db:"id"`
|
|
Country string `db:"country"`
|
|
Date time.Time `db:"date"`
|
|
Name string `db:"name"`
|
|
Description string `db:"description"`
|
|
IsStateHoliday bool `db:"is_state"`
|
|
IsReligiousHoliday bool `db:"is_religious"`
|
|
}
|
|
|
|
type Paging struct {
|
|
PageSize int `form:"page_size" binging:"min=0"`
|
|
Page int `form:"page" binging:"min=0"`
|
|
}
|
|
|
|
type Search struct {
|
|
Country string `form:"country" binding:"len=2"`
|
|
Year *int `form:"year" binding:"omitempty,min=0"`
|
|
Date *time.Time `form:"date" time_format:"2006-01-02"`
|
|
RangeStart *time.Time `form:"range_start" time_format:"2006-01-02"`
|
|
RangeEnd *time.Time `form:"range_end" time_format:"2006-01-02"`
|
|
StateHoliday *bool `form:"state_holiday,omitempty"`
|
|
ReligiousHoliday *bool `form:"religious_holiday,omitempty"`
|
|
}
|