@@ -2,31 +2,111 @@ package goal
22
33import "time"
44
5- type Goal struct {
5+ const (
6+ GoalStatusInProgress = "inProgress"
7+ GoalStatusCompleted = "completed"
8+ GoalStatusIncomplete = "incomplete"
9+ )
10+
11+ const (
12+ GoalLevelBeginner = "Beginner"
13+ GoalLevelIntermediate = "Intermediate"
14+ GoalLevelAdvanced = "Advanced"
15+ GoalLevelCustom = "Custom"
16+ )
17+
18+ type GoalLevel struct {
619 Id int `json:"id"`
720 Level string `json:"level"`
821 CreatedAt time.Time `json:"createdAt"`
922 UpdatedAt time.Time `json:"updatedAt"`
1023}
1124
12- type GoalContribution struct {
25+ type GoalLevelName struct {
26+ Level string `json:"level"`
27+ }
28+
29+ type UserGoal struct {
30+ Id int `json:"id"`
31+ UserId int `json:"userId"`
32+ GoalLevelId int `json:"goalLevelId"`
33+ Status string `json:"status"`
34+ MonthStartedAt time.Time `json:"monthStartedAt"`
35+ CreatedAt time.Time `json:"createdAt"`
36+ UpdatedAt time.Time `json:"updatedAt"`
37+ }
38+
39+ type UserGoalTarget struct {
40+ Id int `json:"id"`
41+ UserGoalId int `json:"userGoalId"`
42+ ContributionScoreId int `json:"contributionScoreId"`
43+ Target int `json:"target"`
44+ CreatedAt time.Time `json:"createdAt"`
45+ UpdatedAt time.Time `json:"updatedAt"`
46+ }
47+
48+ type UserGoalProgress struct {
49+ UserGoalTargetId int `json:"userGoalTargetId"`
50+ ContributionId int `json:"contributionId"`
51+ }
52+
53+ type Contribution struct {
1354 Id int `json:"id"`
14- GoalId int `json:"goalId"`
55+ UserId int `json:"userId"`
56+ RepositoryId int `json:"repositoryId"`
1557 ContributionScoreId int `json:"contributionScoreId"`
16- TargetCount int `json:"targetCount"`
17- IsCustom bool `json:"isCustom"`
18- SetByUserId int `json:"setByUserId"`
58+ ContributionType string `json:"contributionType"`
59+ BalanceChange int `json:"balanceChange"`
60+ ContributedAt time.Time `json:"contributedAt"`
61+ GithubEventId string `json:"githubEventId"`
1962 CreatedAt time.Time `json:"createdAt"`
2063 UpdatedAt time.Time `json:"updatedAt"`
2164}
2265
23- type CustomGoalLevelTarget struct {
66+ type CreateUserGoalRequest struct {
67+ Level string `json:"level"`
68+ CustomTargets []CustomTargetRequest `json:"customTargets,omitempty"`
69+ }
70+
71+ type CustomTargetRequest struct {
2472 ContributionType string `json:"contributionType"`
2573 Target int `json:"target"`
2674}
2775
28- type UserGoalLevelProgress struct {
76+ type GetUserCurrentGoalStatusResponse struct {
77+ UserGoalId int `json:"userGoalId"`
78+ Level string `json:"level"`
79+ Status string `json:"status"`
80+ MonthStartedAt time.Time `json:"monthStartedAt"`
81+ CreatedAt time.Time `json:"createdAt"`
82+ UpdatedAt time.Time `json:"updatedAt"`
83+ GoalTargetProgress []UserGoalTargetProgress `json:"goalTargetProgress"`
84+ }
85+
86+ type UserGoalTargetProgress struct {
2987 ContributionType string `json:"contributionType"`
30- TargetCount int `json:"targetCount"`
31- AchievedCount int `json:"achievedCount"`
88+ Target int `json:"target"`
89+ Progress int `json:"progress"`
90+ }
91+
92+ type UserGoalIdRequest struct {
93+ UserGoalId int `json:"userGoalId"`
3294}
95+
96+ type GoalSummary struct {
97+ Id int `json:"id"`
98+ UserId int `json:"userId"`
99+ SnapshotDate time.Time `json:"snapshotDate"`
100+ IncompleteGoalsCount int `json:"incompleteGoalsCount"`
101+ TargetSet int `json:"targetSet"`
102+ TargetCompleted int `json:"targetCompleted"`
103+ CreatedAt time.Time `json:"createdAt"`
104+ UpdatedAt time.Time `json:"updatedAt"`
105+ }
106+
107+ // type MonthlyGoalSummary struct {
108+ // Day time.Time `json:"Day"`
109+ // IncompleteGoalsCount int `json:"IncompleteGoalsCount"`
110+ // TargetSet int `json:"TargetSet"`
111+ // TargetCompleted int `json:"TargetCompleted"`
112+ // }
0 commit comments