Skip to content

Commit f558a51

Browse files
authored
add missing min/max to BoardConfigurationColumn (#430)
* feat: add missing min/max fields to BoardConfigurationColumn * fix: add omitempty to min/max in BoardConfigurationColumn
1 parent 8a363be commit f558a51

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

board.go

+2
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ type BoardConfigurationColumnConfig struct {
117117
type BoardConfigurationColumn struct {
118118
Name string `json:"name"`
119119
Status []BoardConfigurationColumnStatus `json:"statuses"`
120+
Min int `json:"min,omitempty"`
121+
Max int `json:"max,omitempty"`
120122
}
121123

122124
// BoardConfigurationColumnStatus represents a status in the column configuration

board_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,19 @@ func TestBoardService_GetBoardConfigoration(t *testing.T) {
248248
t.Errorf("Expected 6 columns. go %d", len(boardConfiguration.ColumnConfig.Columns))
249249
}
250250

251+
backlogColumn := boardConfiguration.ColumnConfig.Columns[0]
252+
if backlogColumn.Min != 5 {
253+
t.Errorf("Expected a min of 5 issues in backlog. Got %d", backlogColumn.Min)
254+
}
255+
if backlogColumn.Max != 30 {
256+
t.Errorf("Expected a max of 30 issues in backlog. Got %d", backlogColumn.Max)
257+
}
258+
259+
inProgressColumn := boardConfiguration.ColumnConfig.Columns[2]
260+
if inProgressColumn.Min != 0 {
261+
t.Errorf("Expected a min of 0 issues in progress. Got %d", inProgressColumn.Min)
262+
}
263+
if inProgressColumn.Max != 0 {
264+
t.Errorf("Expected a max of 0 issues in progress. Got %d", inProgressColumn.Max)
265+
}
251266
}

mocks/board_configuration.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"id": "10005",
2727
"self": "https://test.jira.org/rest/api/2/status/10005"
2828
}
29-
]
29+
],
30+
"min": 5,
31+
"max": 30
3032
},
3133
{
3234
"name": "Selected for development",

0 commit comments

Comments
 (0)