Documentation
¶
Overview ¶
Package entity defines main entities for business logic (services), data base mapping and HTTP response objects if suitable. Each logic group entities in own file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ReasonList = map[int]*AbsenceReason{
1: {
ID: 1,
Description: "Личные дела",
Emoji: "🏠",
},
2: {
ID: 2,
Description: "Гостевой пропуск",
Emoji: "✈",
},
3: {
ID: 3,
Description: "Командировка",
Emoji: "✈",
},
4: {
ID: 4,
Description: "Местная командировка",
Emoji: "🚙",
},
5: {
ID: 5,
Description: "Болезнь",
Emoji: "🌡",
},
6: {
ID: 6,
Description: "Больничный лист",
Emoji: "🏥",
},
7: {
ID: 7,
Description: "Ночные работы",
Emoji: "🌃",
},
8: {
ID: 8,
Description: "Дежурство",
Emoji: "👨💻",
},
9: {
ID: 9,
Description: "Учеба",
Emoji: "📚",
},
10: {
ID: 10,
Description: "Удаленная работа",
Emoji: "🏠",
},
11: {
ID: 11,
Description: "Отпуск",
Emoji: "🌅",
},
12: {
ID: 12,
Description: "Отпуск за свой счет",
Emoji: "⛺",
},
13: {
ID: 13,
Description: "Отсутствие с отработкой",
Emoji: "⌛",
},
}
ReasonList stores AbsenceReason in-memory.
Functions ¶
This section is empty.
Types ¶
type AbsenceReason ¶
AbsenceReason wraps info about user absence reason.
type Credentials ¶
type Credentials struct {
IP string
Port string
Login string
Password string
EmployeeURL string
AbsenceURL string
}
Credentials contains info for authentication and working with a third-party WebAPI.
func TestCredentials ¶
func TestCredentials() *Credentials
TestCredentials returns the Credentials entity initialized with valid data.
func (*Credentials) Validate ¶
func (c *Credentials) Validate() error
Validate validates fields of the Credentials entity.
type CustomDate ¶
CustomDate contains date in a custom format.
func (CustomDate) MarshalJSON ¶
func (t CustomDate) MarshalJSON() ([]byte, error)
MarshalJSON is a redefined method for correct json.Encoder work.
func (*CustomDate) UnmarshalJSON ¶
func (t *CustomDate) UnmarshalJSON(data []byte) error
UnmarshalJSON is a redefined method for correct json.Decoder work.
type CustomTime ¶
CustomDate contains time in a custom format.
func (CustomTime) MarshalJSON ¶
func (t CustomTime) MarshalJSON() ([]byte, error)
MarshalJSON is a redefined method for correct json.Encoder work.
func (*CustomTime) UnmarshalJSON ¶
func (t *CustomTime) UnmarshalJSON(data []byte) error
UnmarshalJSON is a redefined method for correct json.Decoder work.
type User ¶
type User struct {
DisplayName string `json:"displayName,omitempty"`
Email string `json:"email,omitempty"`
MobilePhone string `json:"mobilePhone,omitempty"`
WorkPhone string `json:"workPhone,omitempty"`
ID int `json:"id,omitempty"`
}
User contains info about user.
type UserAbsenceData ¶
type UserAbsenceData struct {
CreatedDate CustomDate `json:"createdDate,omitempty"`
DateFrom CustomTime `json:"dateFrom,omitempty"`
DateTo CustomTime `json:"dateTo,omitempty"`
ID int `json:"id,omitempty"`
PersonID int `json:"personId,omitempty"`
ReasonID int `json:"reasonId,omitempty"`
}
UserAbsenceData represents user absence status info from third-party WebAPI.
func TestUserAbsenceData ¶
func TestUserAbsenceData() *UserAbsenceData
TestUserAbsenceData returns the UserAbsenceData entity initialized with valid data.