# -*- coding: utf-8 -*-

from pos_model import TenderType

from models import NfeTender


class PosTenderToNfeTender(object):
    @staticmethod
    def convert(pos_tender):
        # type: (int) -> int

        tender_map = {
            TenderType.cash: NfeTender.dinheiro,
            TenderType.credit: NfeTender.cartao_credito,
            TenderType.debit: NfeTender.cartao_debito
        }

        nfe_tender = tender_map.get(pos_tender, NfeTender.outros)
        return nfe_tender
