Created
July 19, 2018 14:57
-
-
Save CyxouD/3f42e4e50da87583b177ea8f70bd2d9d to your computer and use it in GitHub Desktop.
Contract (interface) which declare action of Presenter and MVP View. In this case AddEditCardFragment will implement AddEditCardContract.View interface and AddEditCardPresenter will implement AddEditCardContract.Presenter interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface AddEditCardContract { | |
interface Presenter : BasePresenter { | |
fun getCreditCardLogo(creditCardNumber: String) | |
fun validateCreditCardNumber(creditCardNumber: String) | |
fun validateCreditCardHolder(creditCardHolder: String) | |
fun validateCreditCardExpiryDate(creditExpiryDate: String) | |
fun validateCreditCardCVV(creditCVV: String) | |
fun validateCreditCardTypeAndPriority(creditCardType: String, creditCardPriority: String) | |
fun saveCreditCard(number: String, | |
holderName: String, | |
expiryDate: String, | |
cvv: String, | |
type: CardType, | |
isAirplus: Boolean, | |
isPrimary: Boolean) | |
} | |
interface View : BaseView<Presenter> { | |
fun showCreditCardLogo(creditCardEnum: CreditCardEnum) | |
fun showNoCreditCardLogo() | |
fun showCreditCardNumberValidatedSuccessfully() | |
fun showCreditCardNumberFailedToValidate() | |
fun showCreditCardHolderValidatedSuccessfully() | |
fun showCreditCardHolderFailedToValidate() | |
fun showCreditCardExpiryDateValidatedSuccessfully() | |
fun showCreditCardExpiryDateFailedToValidate() | |
fun showCreditCardCvvValidatedSuccessfully() | |
fun showCreditCardCvvFailedToValidate() | |
fun showCreditCardPriorityAndTypeValidatedSuccessfully() | |
fun showCreditCardPriorityIsEmpty() | |
fun showCreditCardTypeIsEmpty() | |
fun showCreditCardSavedSuccessfully() | |
fun showCreditCardFailedToSave() | |
} | |
enum class CardType { | |
PERSONAL, BUSINESS | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment