Skip to content

Commit

Permalink
Merge pull request #179 from ctreminiom/feature/jira-workflow-structs
Browse files Browse the repository at this point in the history
🏗️ Parsed the workflow payload conditions.
  • Loading branch information
ctreminiom authored Mar 25, 2023
2 parents cf39c10 + fce93de commit 91fe2f2
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions pkg/infra/models/jira_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ type WorkflowTransitionScheme struct {
}

type WorkflowTransitionScreenScheme struct {
ID string `json:"id,omitempty"`
ID string `json:"id,omitempty"`
Properties interface{} `json:"properties,omitempty"`
}

type WorkflowTransitionRulesScheme struct {
Expand All @@ -53,17 +54,18 @@ type WorkflowTransitionRulesScheme struct {
}

type WorkflowTransitionRuleScheme struct {
Type string `json:"type"`
Type string `json:"type,omitempty"`
Configuration interface{} `json:"configuration,omitempty"`
}

type WorkflowStatusScheme struct {
ID string `json:"id"`
Name string `json:"name"`
Properties *WorkflowStatusPropertiesScheme `json:"properties"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Properties *WorkflowStatusPropertiesScheme `json:"properties,omitempty"`
}

type WorkflowStatusPropertiesScheme struct {
IssueEditable bool `json:"issueEditable"`
IssueEditable bool `json:"issueEditable,omitempty"`
}

type WorkflowCreatedResponseScheme struct {
Expand All @@ -79,13 +81,29 @@ type WorkflowPayloadScheme struct {
}

type WorkflowTransitionPayloadScheme struct {
Name string `json:"name,omitempty"`
From []string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Type string `json:"type,omitempty"`
Screen *WorkflowTransitionScreenPayloadScheme `json:"screen,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
From []string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Type string `json:"type,omitempty"`
Rules *WorkflowTransitionRulePayloadScheme `json:"rules,omitempty"`
Screen *WorkflowTransitionScreenPayloadScheme `json:"screen,omitempty"`
Properties interface{} `json:"properties,omitempty"`
}

type WorkflowTransitionScreenPayloadScheme struct {
ID string `json:"id"`
}

type WorkflowTransitionRulePayloadScheme struct {
Conditions *WorkflowConditionScheme `json:"conditions,omitempty"`
PostFunctions []*WorkflowTransitionRuleScheme `json:"postFunctions,omitempty"`
Validators []*WorkflowTransitionRuleScheme `json:"validators,omitempty"`
}

type WorkflowConditionScheme struct {
Conditions []*WorkflowConditionScheme `json:"conditions,omitempty"`
Configuration interface{} `json:"configuration,omitempty"`
Operator string `json:"operator,omitempty"`
Type string `json:"type,omitempty"`
}

0 comments on commit 91fe2f2

Please sign in to comment.