
# ==========================================================
# TAX FORM - QUERIES (USE where, NOT filter)
# Include ALL fields from the new TaxForm type
# ==========================================================

query listTaxForms($offset: Int, $limit: Int) @auth(level: USER) {
  taxForms(offset: $offset, limit: $limit, orderBy: { createdAt: DESC }) {
    id
    formType
    firstName
    lastName
    mInitial
    oLastName
    dob
    socialSN
    email
    phone
    address
    placeId
    latitude
    longitude
    city
    street
    country
    apt
    state
    zipCode

    marital
    multipleJob
    childrens
    otherDeps
    totalCredits
    otherInconme
    deductions
    extraWithholding

    citizen
    uscis
    passportNumber
    countryIssue
    prepartorOrTranslator

    signature
    date

    status
    staffId
    createdAt
    updatedAt
    createdBy
  }
}

query getTaxFormById($id: UUID!) @auth(level: USER) {
  taxForm(id: $id) {
    id
    formType
    firstName
    lastName
    mInitial
    oLastName
    dob
    socialSN
    email
    phone
    address
    placeId
    latitude
    longitude
    city
    street
    country
    apt
    state
    zipCode

    marital
    multipleJob
    childrens
    otherDeps
    totalCredits
    otherInconme
    deductions
    extraWithholding

    citizen
    uscis
    passportNumber
    countryIssue
    prepartorOrTranslator

    signature
    date

    status
    staffId
    createdAt
    updatedAt
    createdBy
  }
}

query getTaxFormsByStaffId(
  $staffId: UUID!
  $offset: Int
  $limit: Int
) @auth(level: USER) {
  taxForms(
    where: { staffId: { eq: $staffId } }
    offset: $offset
    limit: $limit
    orderBy: { createdAt: DESC }
  ) {
    id
    formType
    firstName
    lastName
    mInitial
    oLastName
    dob
    socialSN
    email
    phone
    address
    placeId
    latitude
    longitude
    city
    street
    country
    apt
    state
    zipCode

    marital
    multipleJob
    childrens
    otherDeps
    totalCredits
    otherInconme
    deductions
    extraWithholding

    citizen
    uscis
    passportNumber
    countryIssue
    prepartorOrTranslator

    signature
    date

    status
    staffId
    createdAt
    updatedAt
    createdBy
  }
}

query listTaxFormsWhere(
  $formType: TaxFormType
  $status: TaxFormStatus
  $staffId: UUID
  $offset: Int
  $limit: Int
) @auth(level: USER) {
  taxForms(
    where: {
      formType: { eq: $formType }
      status: { eq: $status }
      staffId: { eq: $staffId }
    }
    offset: $offset
    limit: $limit
    orderBy: { createdAt: DESC }
  ) {
    id
    formType
    firstName
    lastName
    mInitial
    oLastName
    dob
    socialSN
    email
    phone
    address
    placeId
    latitude
    longitude
    city
    street
    country
    apt
    state
    zipCode

    marital
    multipleJob
    childrens
    otherDeps
    totalCredits
    otherInconme
    deductions
    extraWithholding

    citizen
    uscis
    passportNumber
    countryIssue
    prepartorOrTranslator

    signature
    date

    status
    staffId
    createdAt
    updatedAt
    createdBy
  }
}
