import { UNCents } from '../payment/payments.types';
import { UNMerchant, UNRichMerchantData, UNTransactionTypes } from './transactions.types';
import { UNDirection } from '../types';

export type UNCardTransaction = {
  type: UNTransactionTypes.Card
  id: number
  attributes: {
    cardNetwork: string
    cardLast4Digits: string
    createdAt: Date
    amount: UNCents
    direction: UNDirection
    balance: UNCents
    summary: string
    interchange?: number | null
    networkTransactionId?: string
    richMerchantData?: UNRichMerchantData
    paymentMethod?: string
    merchant?: UNMerchant
    recurring: boolean
  }
  relationships: {
    account: {
      data: {
        type: string
        id: number
      }
    }
    customer?: {
      data: {
        type: string
        id: number
      }
    }
    customers?: {
      data: [
        {
          type: 'customer'
          id: string
        }
      ]
    }
    org?: {
      data: {
        type: string
        id: number
      }
    }
  }
} 