export interface PutEditIssueRequestBody {
    fields: Partial<JiraIssueFields>
}

export interface PostTransitionIssueRequestBody {
    transition: { id: string }
}

export interface PostCreateIssueRequestBody extends JiraIssue {}

export interface PostCreateIssueResponse {
    id: string,
    key: string
}

export interface PostBulkCreateIssueRequestBody {
    issueUpdates: PostCreateIssueRequestBody[]
}

export interface BulkTransitionInput {
    selectedIssueIdsOrKeys: string[],
    transitionId: string
}

export interface PostBulkTransitionIssuesRequestBody {
    bulkTransitionInputs: BulkTransitionInput[],
    sendBulkNotification: false
}

export interface PostBulkCreateIssueResponse {
    issues: PostCreateIssueResponse[]
}

export interface PostAddCommentResponse {
    body: JiraContent
}

export interface JiraIssueFields {
    summary: string,
    description: JiraContent,
    project?: JiraProject,
    issuetype?: { id: string },
    parent?: JiraParent,
    fixVersions?: JiraVersion[],
    subtasks?: JiraSubTask[],
    customfield_14857?: JiraContent,    // Test Steps field
    customfield_10007?: number          // Sprint field,
    customfield_13100?: { id: string }          // UAT Tester ID field

}

export interface JiraSubTask {
    id: string,
    key: string
}

export interface JiraProject {
    key: string
}

export interface JiraParent {
    key: string
}

export interface JiraContent {
    type?: string,
    text?: string,
    version?: number
    content?: JiraContent[]
}

export interface JiraVersion {
    id: string
}

export interface JiraTransition {
    id: string,
    name: string
}

export interface JiraIssueType {
    id: string,
    self: string,
    description: string,
    iconUrl: string,
    name: string,
    untranslatedName: string,
    subtask: boolean,
}

export interface GetIssueTransitionsResponse {
    transitions: JiraTransition[]
}

export interface GetIssueTypesResponse {
    issueTypes: JiraIssueType[]
}

export interface PostBulkFetchIssuesRequestBody {
    issueIdsOrKeys: string[]
}

export interface PostBulkFetchIssuesResponse {
    issues: GetIssueResponse[];
}

export interface JiraIssue {
    key?: string,
    id?: string,
    transition?: { id: string },
    fields: JiraIssueFields
}

export interface GetIssueResponse extends JiraIssue {}

export interface GetBoardResponse {
    id: number,
    name: string
}

export interface GetSprintResponse {
    values: JiraSprint[]
}

export interface GetJqlSearchIssueParams {
    jql: string
}

export interface GetJqlSearchIssueResponse extends PostBulkFetchIssuesResponse {}

export interface JiraSprint {
    id: number,
    name: string,
    originBoardId: number
}