package com.korancrew.brizzi.hce

/**
 * Daftar command literal resmi yang sering dipakai pada unit test / tracing.
 */
object BrizziCommandCatalog {
    const val SELECT_AID_1_NATIVE_ISO = "00A40400085A00000301000000"
    const val SELECT_AID_1_BY_NAME_NATIVE_ISO = "00A4040C085A00000301000000"
    const val SELECT_AID_1_ISO = "905A00000301000000"
    const val SELECT_AID_3_NATIVE_ISO = "00A40400085A00000303000000"
    const val SELECT_AID_3_BY_NAME_NATIVE_ISO = "00A4040C085A00000303000000"
    const val SELECT_AID_3_ISO = "905A00000303000000"
    const val SELECT_UNKNOWN_AID_NATIVE_ISO = "00A40400085A00009999000000"
    const val GET_CARD_INFO_ISO = "90BD000007BD0000000017000000"
    const val GET_CARD_STATUS_ISO = "90BD0000070100000020000000"
    const val REQUEST_KEY_CARD_00_ISO = "900A0000010000"
    const val REQUEST_KEY_CARD_01_ISO = "900A0000010100"
    const val GET_UID_PCSC = "FFCA000000"
    const val GET_LAST_TXN_AND_AKUM_DEBET_ISO = "90BD0000070300000007000000"
    const val GET_BALANCE_ISO = "906C0000010000"
    const val GET_LOG_TRANSACTION_ISO = "90BB0000070100000000000000"
    const val ABORT_TRANSACTION_ISO = "90A7000000"
    const val COMMIT_TRANSACTION_ISO = "90C7000000"
    const val ABORT_TRANSACTION_NATIVE = "A7"
    const val COMMIT_TRANSACTION_NATIVE = "C7"
    const val GET_BALANCE_NATIVE = "6C00"

    fun authenticateIso(randomKeyHex: String): String = "90AF000010${randomKeyHex}00"
    fun creditIso(amountReversedHex: String): String = "900C000004${amountReversedHex}0000"
    fun debitIso(amountReversedHex: String): String = "90DC000004${amountReversedHex}0000"
    fun creditNative(amountReversedHex: String): String = "0C000004${amountReversedHex}00"
    fun debitNative(amountReversedHex: String): String = "DC000004${amountReversedHex}00"
}
