|
| 1 | +/* |
| 2 | +Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +contributor license agreements. See the NOTICE file distributed with |
| 4 | +this work for additional information regarding copyright ownership. |
| 5 | +The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +(the "License"); you may not use this file except in compliance with |
| 7 | +the License. You may obtain a copy of the License at |
| 8 | +
|
| 9 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | +Unless required by applicable law or agreed to in writing, software |
| 12 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +See the License for the specific language governing permissions and |
| 15 | +limitations under the License. |
| 16 | +*/ |
| 17 | + |
| 18 | +package apiv2models |
| 19 | + |
| 20 | +import "time" |
| 21 | + |
| 22 | +// SprintReportInput drives the per-(board, sprint) Sprint Report collector. |
| 23 | +// It's what gets iterated over via the DAL cursor, and re-attached to each |
| 24 | +// raw row so the extractor knows which board/sprint a response belongs to. |
| 25 | +type SprintReportInput struct { |
| 26 | + BoardId uint64 `json:"board_id"` |
| 27 | + SprintId uint64 `json:"sprint_id"` |
| 28 | + // UpdateTime is the sprint's CompleteDate; used as the incremental-sync |
| 29 | + // watermark since a sprint report only exists/changes once a sprint closes. |
| 30 | + UpdateTime *time.Time `json:"update_time"` |
| 31 | +} |
| 32 | + |
| 33 | +// SprintReportStatFieldValue mirrors Jira's |
| 34 | +// {statFieldValue: {value, text}} shape used for per-issue point estimates. |
| 35 | +type SprintReportStatFieldValue struct { |
| 36 | + Value *float64 `json:"value"` |
| 37 | + Text string `json:"text"` |
| 38 | +} |
| 39 | + |
| 40 | +type SprintReportStatistic struct { |
| 41 | + StatFieldValue SprintReportStatFieldValue `json:"statFieldValue"` |
| 42 | +} |
| 43 | + |
| 44 | +// SprintReportIssue is one entry inside any of the four bucket lists |
| 45 | +// (completedIssues, issuesNotCompletedInCurrentSprint, puntedIssues, |
| 46 | +// issuesCompletedInAnotherSprint) in the Sprint Report response. |
| 47 | +type SprintReportIssue struct { |
| 48 | + Id uint64 `json:"id"` |
| 49 | + Key string `json:"key"` |
| 50 | + TypeName string `json:"typeName"` |
| 51 | + Done bool `json:"done"` |
| 52 | + // EstimateStatistic is the issue's estimate as of sprint *start* |
| 53 | + // ("BOS points" / committed). |
| 54 | + EstimateStatistic SprintReportStatistic `json:"estimateStatistic"` |
| 55 | + // CurrentEstimateStatistic is the issue's estimate as of sprint *close* |
| 56 | + // ("EOS points" / completed). |
| 57 | + CurrentEstimateStatistic SprintReportStatistic `json:"currentEstimateStatistic"` |
| 58 | +} |
| 59 | + |
| 60 | +// SprintReportContents is the "contents" object of the Sprint Report |
| 61 | +// response — the frozen snapshot Jira takes at sprint close. |
| 62 | +type SprintReportContents struct { |
| 63 | + CompletedIssues []SprintReportIssue `json:"completedIssues"` |
| 64 | + IssuesNotCompletedInCurrentSprint []SprintReportIssue `json:"issuesNotCompletedInCurrentSprint"` |
| 65 | + PuntedIssues []SprintReportIssue `json:"puntedIssues"` |
| 66 | + IssuesCompletedInAnotherSprint []SprintReportIssue `json:"issuesCompletedInAnotherSprint"` |
| 67 | +} |
| 68 | + |
| 69 | +// SprintReport is the top-level response of |
| 70 | +// GET rest/greenhopper/1.0/rapid/charts/sprintreport?rapidViewId=&sprintId= |
| 71 | +type SprintReport struct { |
| 72 | + Contents SprintReportContents `json:"contents"` |
| 73 | +} |
0 commit comments