input AbacusAccountingPeriodInput {
    accountingPeriodName: String!
    """One of 'distribution', 'legacy_distribution', or 'neighbouring_rights'. Defaults to 'distribution'."""
    contractType: String!
    statementPeriodId: ID!
}

input AbacusAccountingPeriodUpdate {
    accountingPeriodId: ID!
    accountingPeriodName: String
    accountingPeriodStatus: String
}

input AbacusAccountingPeriodStateUpdate {
    accountingPeriodId: ID!
    actionStates: [AbacusStateUpdate]!
}


type AbacusAccountingPeriod @key(fields: "accountingPeriodId") {
    accountingPeriodId: ID
    accountingPeriodName: String
    accountingPeriodReports: [AbacusAccountingPeriodReport]
    accountingPeriodStatus: String
    accountingRunVatOverview: [AbacusLedgerAccountingRunVatOverview]
    accountingRuns: AbacusAccountingRuns
    actionStates: [AbacusState]
    closedDate: Date
    """One of 'distribution', 'legacy_distribution', or 'neighbouring_rights'. Defaults to 'distribution'."""
    contractType: String!
    salesFile: [AbacusSalesFile]
    statementPeriod: AbacusStatementPeriod!
}

type AbacusAccountingPeriodsList {
    items: [AbacusAccountingPeriod!]!
    totalCount: Int!
}

extend type Mutation {
    abacusCreateAccountingPeriod(input: AbacusAccountingPeriodInput): AbacusAccountingPeriod
    abacusUpdateAccountingPeriod(input: AbacusAccountingPeriodUpdate): AbacusAccountingPeriod
    abacusUpdateAccountingPeriodState(input: AbacusAccountingPeriodStateUpdate): [AbacusState]!
}

extend type Query {
    abacusAccountingPeriod(
        accountingPeriodId: ID
    ): AbacusAccountingPeriod
    abacusAccountingPeriods(
        limit: Int,
        offset: Int
    ): AbacusAccountingPeriodsList!
}
