Class SubmitReceiptPresenter<T extends SubmitReceiptView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<T>
-
- com.cheetahdigital.receipt.ui.submit.SubmitReceiptPresenter<T>
-
- All Implemented Interfaces:
com.cheetahdigital.uikit.architecture.mvp.MvpPresenter<T>
public class SubmitReceiptPresenter<T extends SubmitReceiptView> extends com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<T>
ExtendsMvpNullObjectBasePresenter
withSubmitReceiptView
The presenter calls all API methods to submit a receipt
-
-
Constructor Summary
Constructors Constructor Description SubmitReceiptPresenter()
Default constructor that acceptsReceiptParams
needed forReceiptAPI
SubmitReceiptPresenter(ReceiptParams receiptParams)
Default constructor that acceptsReceiptParams
needed forReceiptAPI
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ReceiptAPI
getReceiptAPI()
Get current instance ofReceiptAPI
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Receipt>,Receipt>
getSubmitReceiptListener()
Create a listener forReceiptAPI
protected void
onSubmitReceiptFailed(java.lang.String error)
Called after a failed response fromReceiptAPI.submitReceipt(MediaFile, ReceiptParams, ListenerModel)
protected void
onSubmitReceiptSuccess(Receipt data)
Called after a successful response fromReceiptAPI.submitReceipt(MediaFile, ReceiptParams, ListenerModel)
void
submitReceipt(com.cheetahdigital.uikit.helper.video.MediaFile receipt)
This submits a file receipt to the API
-
-
-
Constructor Detail
-
SubmitReceiptPresenter
public SubmitReceiptPresenter()
Default constructor that acceptsReceiptParams
needed forReceiptAPI
-
SubmitReceiptPresenter
public SubmitReceiptPresenter(ReceiptParams receiptParams)
Default constructor that acceptsReceiptParams
needed forReceiptAPI
- Parameters:
receiptParams
- theReceiptParams
needed forReceiptAPI
-
-
Method Detail
-
getSubmitReceiptListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Receipt>,Receipt> getSubmitReceiptListener()
Create a listener forReceiptAPI
- Returns:
- listener to handle
ReceiptAPI
requests
-
getReceiptAPI
protected ReceiptAPI getReceiptAPI()
Get current instance ofReceiptAPI
- Returns:
ReceiptAPI
used on this presenter
-
submitReceipt
public void submitReceipt(com.cheetahdigital.uikit.helper.video.MediaFile receipt)
This submits a file receipt to the API- Parameters:
receipt
- TypedFile - the image of the receipt
-
onSubmitReceiptFailed
protected void onSubmitReceiptFailed(java.lang.String error)
Called after a failed response fromReceiptAPI.submitReceipt(MediaFile, ReceiptParams, ListenerModel)
- Parameters:
error
- detail of the error
-
onSubmitReceiptSuccess
protected void onSubmitReceiptSuccess(Receipt data)
Called after a successful response fromReceiptAPI.submitReceipt(MediaFile, ReceiptParams, ListenerModel)
- Parameters:
data
-Receipt
response
-
-