
type CustomPayment @key(fields: "worksheetPaymentCustomId") {
    abacusEvents: [AbacusEvent!]!
    account: AbacusAccount!
    actionStates: [AbacusState!]!
    activityStatementPeriod: AbacusStatementPeriod!
    amount: Decimal!
    amountAfterWithholdingAndVat: Decimal!
    contract: AbacusContract!
    createdAt: String!
    createdBy: String!
    currencyCode: String!
    lastModified: String!
    lastModifiedBy: String!
    paymentName: String!
    reports: [ReportPayment!]!
    statementPeriod: AbacusStatementPeriod!
    vatAmount: Decimal
    vatRate: Decimal
    withholdingTaxAmount: Decimal
    withholdingTaxRate: Decimal
    worksheetPaymentCustomId: ID!
}

input createCustomPaymentInput {
    accountId: ID!
    activityStatementPeriodId: ID!
    amount: Decimal!
    amountAfterWithholdingAndVat: Decimal!
    contractId: ID!
    currencyCode: String!
    paymentName: String!
    statementPeriodId: ID!
    vatAmount: Decimal
    vatRate: Decimal
    withholdingTaxAmount: Decimal
    withholdingTaxRate: Decimal
}

type CustomPaymentsList {
    items: [CustomPayment!]!
    totalCount: Int!
}

extend type Mutation {
    createCustomPayment(input: createCustomPaymentInput!): CustomPayment!
    updateApprovalForCustomPayment(
        worksheetPaymentCustomId: ID!
        reportExportUrl: String!
    ): CustomPayment!
    confirmApprovalForCustomPayment(
        worksheetPaymentCustomId: ID!
    ): CustomPayment!
    confirmFundsForCustomPayment(
        worksheetPaymentCustomId: ID!
    ): CustomPayment!
    deleteApprovalForCustomPayment(
        worksheetPaymentCustomId: ID!
    ): DeleteResponse!
    deleteCustomPayment(
        worksheetPaymentCustomId: ID!
    ): DeleteResponse!
    sendCustomPayment(
        worksheetPaymentCustomId: ID!
    ): CustomPayment!
}

extend type Query {
    customPayment(worksheetPaymentCustomId: ID!): CustomPayment!
    customPayments(
        limit: Int!
        offset: Int!
    ): CustomPaymentsList!
}
