Documentation
¶
Index ¶
- Constants
- Variables
- func Idx(p ...string) []contract.IndexEntry
- func IdxSrch(p ...string) []contract.SearchIndexEntry
- func PeriodFromIndex(idx int64) int64
- func Rules(p ...string) contractpkg.QueryParamRules
- func YearFromIndex(idx int64) int64
- type Comp
- type Core
- type CoreOption
- type Meta
- type MetaOption
- type Period
Constants ¶
View Source
const ( PeriodKey = "period" PeriodYearKey = "period_year" )
View Source
const (
PeriodIndexKey = "period_index"
)
Variables ¶
View Source
var ( PeriodKeyFn = contract.PathKeyFn(PeriodKey) PeriodYearKeyFn = contract.PathKeyFn(PeriodYearKey) )
View Source
var PeriodIndexKeyFn = contract.PathKeyFn(PeriodIndexKey)
Functions ¶
func Idx ¶
func Idx(p ...string) []contract.IndexEntry
func IdxSrch ¶
func IdxSrch(p ...string) []contract.SearchIndexEntry
func PeriodFromIndex ¶ added in v0.0.249
func Rules ¶
func Rules(p ...string) contractpkg.QueryParamRules
func YearFromIndex ¶ added in v0.0.249
Types ¶
type Comp ¶ added in v0.0.244
type Comp struct {
PeriodIndex *int64 `json:"period_index" validate:"nnpt,nz"`
}
func (*Comp) GetPeriodIndex ¶ added in v0.0.244
func (*Comp) SetPeriodIndex ¶ added in v0.0.244
type Core ¶
type Core struct {
Period *int64 `json:"period" validate:"nnpt,nz,weekrange"`
PeriodYear *int64 `json:"period_year" validate:"nnpt,nz"`
}
func ApplyCore ¶
func ApplyCore(c *Core, modifiers ...CoreOption) Core
func (*Core) GetPeriodYear ¶ added in v0.0.243
func (*Core) SetPeriodYear ¶ added in v0.0.243
type CoreOption ¶
type CoreOption = contracti.CoreOption[Core]
func WithPeriod ¶
func WithPeriod(x int64) CoreOption
func WithPeriodYear ¶ added in v0.0.243
func WithPeriodYear(x int64) CoreOption
type Meta ¶
type Meta struct{}
func ApplyMeta ¶
func ApplyMeta(m *Meta, modifiers ...MetaOption) Meta
type MetaOption ¶
type MetaOption = contract.MetaOption[Meta]
type Period ¶
type Period struct {
Meta `bson:",inline" validate:"recurse"`
Comp `bson:",inline" validate:"recurse"`
Core `bson:",inline" validate:"recurse"`
}
Period represents a payroll period within a fiscal year typically ranging from week 1 to 53.
func MockWithComp ¶ added in v0.0.305
func MockWithComp() *Period
Click to show internal directories.
Click to hide internal directories.