This repository was archived by the owner on Oct 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_request.go
More file actions
78 lines (68 loc) · 2.71 KB
/
model_request.go
File metadata and controls
78 lines (68 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package main
import (
model "github.com/msepp/stopwatch/stopwatchmodel"
)
// ReqPayloadAddGroup defines data fields available when adding a group
type ReqPayloadAddGroup struct {
// Name of the new group. Required.
Name string `json:"name" mapstructure:"name"`
}
// ReqPayloadUpdateGroup defines data fields required to update a group
type ReqPayloadUpdateGroup struct {
// GroupID is the groups ID. Required.
GroupID int `json:"id" mapstructure:"id"`
// Name of the new group. Required.
Name string `json:"name" mapstructure:"name"`
}
// ReqPayloadGetGroupTasks defines data fields available when reading groups tasks
type ReqPayloadGetGroupTasks struct {
// GroupID of the group to fetch. Required.
GroupID int `json:"id" mapstructure:"id"`
}
// ReqPayloadSetHistory is the payload for updating task usage history
type ReqPayloadSetHistory struct {
History []model.HistoryTask `json:"history" mapstructure:"history"`
}
// ReqPayloadAddTask defines data fields available when adding a task
type ReqPayloadAddTask struct {
// CostCode for the task
CostCode string `json:"costcode" mapstructure:"costcode"`
// GroupID the task should be added to. Required.
GroupID int `json:"groupid" mapstructure:"groupid"`
// Name of the new task. Required.
Name string `json:"name" mapstructure:"name"`
}
// ReqPayloadSetTaskStatus defines data fields required for changing task status
type ReqPayloadSetTaskStatus struct {
// GroupID of the target task. Required.
GroupID int `json:"groupid" mapstructure:"groupid"`
// TaskID of the target task. Required.
TaskID int `json:"taskid" mapstructure:"id"`
}
// ReqPayloadGetTask defines data fields required for reading task details
type ReqPayloadGetTask struct {
// GroupID of the target task. Required.
GroupID int `json:"groupid" mapstructure:"groupid"`
// TaskID of the target task. Required.
TaskID int `json:"taskid" mapstructure:"id"`
}
// ReqPayloadUpdateTask defines data fields required for updating task data
type ReqPayloadUpdateTask struct {
// GroupID of the target task. Required.
GroupID int `json:"groupid" mapstructure:"groupid"`
// TaskID of the target task. Required.
TaskID int `json:"taskid" mapstructure:"id"`
// Name of the new task. Required.
Name string `json:"name" mapstructure:"name"`
// CostCode for the task.
CostCode string `json:"costcode" mapstructure:"costcode"`
}
// ReqPayloadGetUsage defines fields for requesting usage statistics for a group
type ReqPayloadGetUsage struct {
// GroupID of the target task. Required.
GroupID int `json:"groupid" mapstructure:"groupid"`
// StartDate is the starting date. Required.
StartDate string `json:"start" mapstructure:"start"`
// EndDate is the end date. Required.
EndDate string `json:"end" mapstructure:"end"`
}