Skip to content

Commit

Permalink
Merge pull request #230 from ctreminiom/feature/custom-field-extracti…
Browse files Browse the repository at this point in the history
…on-as-arrays

✨ Extract customfields from buffer support
  • Loading branch information
ctreminiom authored Sep 24, 2023
2 parents 1dea06a + 4aef1bb commit d05cc84
Show file tree
Hide file tree
Showing 8 changed files with 6,090 additions and 662 deletions.
1 change: 1 addition & 0 deletions pkg/infra/models/agile_sprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ type SprintDetailScheme struct {
CompleteDate string `json:"completeDate,omitempty"`
OriginBoardID int `json:"originBoardId,omitempty"`
Goal string `json:"goal,omitempty"`
BoardID int `json:"boardId,omitempty"`
}
21 changes: 13 additions & 8 deletions pkg/infra/models/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ var (
ErrUnauthorized = errors.New("client: atlassian insufficient permissions")
ErrInternalError = errors.New("client: atlassian internal error")
ErrBadRequestError = errors.New("client: atlassian invalid payload")
ErrNoSiteError = errors.New("client: no atlassian site set")
ErrNoFloatTypeError = errors.New("custom-field: no float type set")
ErrNoSprintTypeError = errors.New("custom-field: no sprint type found")
ErrNoMultiVersionTypeError = errors.New("custom-field: no multiversion type found")
ErrNilPayloadError = errors.New("client: please provide the necessary payload struct")
ErrNonPayloadPointerError = errors.New("client: please provide a valid payload struct pointer (&)")
ErrNoFieldInformationError = errors.New("custom-field: please provide a buffer with a valid fields object")
Expand All @@ -146,18 +150,21 @@ var (
ErrNoAssetTypeError = errors.New("custom-field: no asset type found")
ErrNoUrlTypeError = errors.New("custom-field: no url type set")
ErrNoTextTypeError = errors.New("custom-field: no text type set")
ErrNoDateTimeTypeError = errors.New("custom-field: no date-time type set")
ErrNoDateTypeError = errors.New("custom-field: no date type set")
ErrNoDatePickerTypeError = errors.New("custom-field: no datepicker type set")
ErrNoDateTimeTypeError = errors.New("custom-field: no datetime type set")
ErrNoSelectTypeError = errors.New("custom-field: no select type set")
ErrNoButtonTypeError = errors.New("custom-field: no button type set")
ErrNoUserTypeError = errors.New("custom-field: no user type set")
ErrNoLabelsTypeError = errors.New("custom-field: no labels type set")
ErrNoMultiUserTypeError = errors.New("custom-field: no multi-user type set")
ErrNoCheckBoxTypeError = errors.New("custom-field: no check-box type set")
ErrNoCascadingParentError = errors.New("custom-field: no cascading parent value set")
ErrNoCascadingChildError = errors.New("custom-field: no cascading child value set")
ErrNoAttachmentIdsError = errors.New("sm: no attachment id's set")
ErrNoLabelsError = errors.New("sm: no label names set")
ErrNoComponentsError = errors.New("sm: no components set")
ErrNoIssuesSliceError = errors.New("jira: no issues object set")
ErrNoMapValuesError = errors.New("jira: no map values set")
ErrNCoComponentError = errors.New("sm: no component set")
ErrNoWorkspaceIDError = errors.New("assets: no workspace id set")
ErrNoAqlQueryError = errors.New("assets: no aql query id set")
Expand All @@ -166,12 +173,10 @@ var (
ErrNoObjectSchemaIDError = errors.New("assets: no object schema id set")
ErrNoObjectTypeIDError = errors.New("assets: no object type id set")
ErrNoObjectTypeAttributeIDError = errors.New("assets: no object type attribute id set")
ErrNoSiteError = errors.New("client: no atlassian site set")
ErrNoCreateIssuesError = errors.New("jira: no issues payload set")
ErrNoIssueSchemeError = errors.New("jira: no issue instance set")

ErrNoWorkspaceError = errors.New("bitbucket: no workspace set")
ErrNoMemberIDError = errors.New("bitbucket: no member id set")
ErrNoWebhookIDError = errors.New("bitbucket: no webhook id set")
ErrNoRepositoryError = errors.New("bitbucket: no repository set")
ErrNoWorkspaceError = errors.New("bitbucket: no workspace set")
ErrNoMemberIDError = errors.New("bitbucket: no member id set")
ErrNoWebhookIDError = errors.New("bitbucket: no webhook id set")
ErrNoRepositoryError = errors.New("bitbucket: no repository set")
)
4 changes: 2 additions & 2 deletions pkg/infra/models/jira_customFields.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *CustomFields) DateTime(customFieldID string, dateValue time.Time) error
}

if dateValue.IsZero() {
return ErrNoDateTimeTypeError
return ErrNoDatePickerTypeError
}

var dateNode = map[string]interface{}{}
Expand All @@ -125,7 +125,7 @@ func (c *CustomFields) Date(customFieldID string, dateTimeValue time.Time) (err
}

if dateTimeValue.IsZero() {
return ErrNoDateTypeError
return ErrNoDateTimeTypeError
}

var dateTimeNode = map[string]interface{}{}
Expand Down
4 changes: 2 additions & 2 deletions pkg/infra/models/jira_customFields_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func TestCustomFields_Date(t *testing.T) {
dateTimeValue: time.Time{},
},
wantErr: true,
Err: ErrNoDateTypeError,
Err: ErrNoDateTimeTypeError,
},
}
for _, testCase := range testCases {
Expand Down Expand Up @@ -275,7 +275,7 @@ func TestCustomFields_DateTime(t *testing.T) {
dateValue: time.Time{},
},
wantErr: true,
Err: ErrNoDateTimeTypeError,
Err: ErrNoDatePickerTypeError,
},
}
for _, testCase := range testCases {
Expand Down
Loading

0 comments on commit d05cc84

Please sign in to comment.