public class DefaultInvoiceDao extends EntityDaoBase<InvoiceModelDao,Invoice,InvoiceApiException> implements InvoiceDao
paginationHelper, transactionalSqlDao
Constructor and Description |
---|
DefaultInvoiceDao(TagInternalApi tagInternalApi,
org.skife.jdbi.v2.IDBI dbi,
org.skife.jdbi.v2.IDBI roDbi,
NextBillingDatePoster nextBillingDatePoster,
org.killbill.bus.api.PersistentBus eventBus,
org.killbill.clock.Clock clock,
CacheControllerDispatcher cacheControllerDispatcher,
NonEntityDao nonEntityDao,
InvoiceConfig invoiceConfig,
InvoiceDaoHelper invoiceDaoHelper,
CBADao cbaDao,
ParentInvoiceCommitmentPoster parentInvoiceCommitmentPoster,
InternalCallContextFactory internalCallContextFactory) |
Modifier and Type | Method and Description |
---|---|
void |
changeInvoiceStatus(java.util.UUID invoiceId,
InvoiceStatus newStatus,
InternalCallContext context)
Update invoice status
|
java.util.Map<java.util.UUID,java.math.BigDecimal> |
computeItemAdjustments(java.lang.String invoiceId,
java.util.Map<java.util.UUID,java.math.BigDecimal> invoiceItemIdsWithNullAmounts,
InternalTenantContext context) |
void |
consumeExstingCBAOnAccountWithUnpaidInvoices(java.util.UUID accountId,
InternalCallContext context) |
void |
createInvoice(InvoiceModelDao invoice,
InvoiceDispatcher.FutureAccountNotifications callbackDateTimePerSubscriptions,
InternalCallContext context) |
java.util.List<InvoiceItemModelDao> |
createInvoices(java.util.List<InvoiceModelDao> invoices,
InternalCallContext context) |
void |
createParentChildInvoiceRelation(InvoiceParentChildModelDao invoiceRelation,
InternalCallContext context)
Save parent/child invoice relationship
|
InvoicePaymentModelDao |
createRefund(java.util.UUID paymentId,
java.math.BigDecimal requestedRefundAmount,
boolean isInvoiceAdjusted,
java.util.Map<java.util.UUID,java.math.BigDecimal> invoiceItemIdsWithNullAmounts,
java.lang.String transactionExternalKey,
InternalCallContext context)
Create a refund.
|
void |
deleteCBA(java.util.UUID accountId,
java.util.UUID invoiceId,
java.util.UUID invoiceItemId,
InternalCallContext context)
Delete a CBA item.
|
InvoiceItemModelDao |
doCBAComplexity(InvoiceModelDao invoice,
InternalCallContext context) |
protected InvoiceApiException |
generateAlreadyExistsException(InvoiceModelDao entity,
InternalCallContext context) |
java.math.BigDecimal |
getAccountBalance(java.util.UUID accountId,
InternalTenantContext context) |
java.math.BigDecimal |
getAccountCBA(java.util.UUID accountId,
InternalTenantContext context) |
java.util.UUID |
getAccountIdFromInvoicePaymentId(java.util.UUID invoicePaymentId,
InternalTenantContext context) |
java.util.List<InvoiceModelDao> |
getAllInvoicesByAccount(java.lang.Boolean includeVoidedInvoices,
InternalTenantContext context) |
InvoiceModelDao |
getById(java.util.UUID invoiceId,
InternalTenantContext context) |
InvoiceModelDao |
getByInvoiceItem(java.util.UUID invoiceItemId,
InternalTenantContext context) |
InvoiceModelDao |
getByNumber(java.lang.Integer number,
InternalTenantContext context) |
InvoicePaymentModelDao |
getChargebackById(java.util.UUID chargebackId,
InternalTenantContext context) |
java.util.List<InvoicePaymentModelDao> |
getChargebacksByAccountId(java.util.UUID accountId,
InternalTenantContext context) |
java.util.List<InvoicePaymentModelDao> |
getChargebacksByPaymentId(java.util.UUID paymentId,
InternalTenantContext context) |
java.util.List<InvoiceParentChildModelDao> |
getChildInvoicesByParentInvoiceId(java.util.UUID parentInvoiceId,
InternalCallContext context)
Get parent/child invoice relationship by parent invoice id
|
InvoiceItemModelDao |
getCreditById(java.util.UUID creditId,
InternalTenantContext context)
Retrieve a credit by id.
|
InvoiceItemModelDao |
getExternalChargeById(java.util.UUID externalChargeId,
InternalTenantContext context)
Retrieve am external charge by id.
|
java.util.UUID |
getInvoiceIdByPaymentId(java.util.UUID paymentId,
InternalTenantContext context) |
java.util.List<InvoiceItemModelDao> |
getInvoiceItemsByParentInvoice(java.util.UUID parentInvoiceId,
InternalTenantContext context)
Retrieve invoice items details associated to Parent SUMMARY invoice item
|
InvoicePaymentModelDao |
getInvoicePaymentByCookieId(java.lang.String cookieId,
InternalTenantContext context) |
java.util.List<InvoicePaymentModelDao> |
getInvoicePaymentsByAccount(InternalTenantContext context) |
java.util.List<InvoicePaymentModelDao> |
getInvoicePaymentsByInvoice(java.util.UUID invoiceId,
InternalTenantContext context) |
java.util.List<InvoicePaymentModelDao> |
getInvoicePaymentsByPaymentId(java.util.UUID paymentId,
InternalTenantContext context) |
java.util.List<InvoiceModelDao> |
getInvoicesByAccount(java.lang.Boolean includeVoidedInvoices,
InternalTenantContext context) |
java.util.List<InvoiceModelDao> |
getInvoicesByAccount(java.lang.Boolean includeVoidedInvoices,
org.joda.time.LocalDate fromDate,
InternalTenantContext context) |
java.util.List<InvoiceModelDao> |
getInvoicesBySubscription(java.util.UUID subscriptionId,
InternalTenantContext context) |
InvoiceModelDao |
getParentDraftInvoice(java.util.UUID parentAccountId,
InternalCallContext context)
Retrieve parent invoice by the parent account id
|
java.math.BigDecimal |
getRemainingAmountPaid(java.util.UUID invoicePaymentId,
InternalTenantContext context) |
java.util.List<InvoiceModelDao> |
getUnpaidInvoicesByAccountId(java.util.UUID accountId,
org.joda.time.LocalDate upToDate,
InternalTenantContext context) |
void |
notifyOfPaymentCompletion(InvoicePaymentModelDao invoicePayment,
InternalCallContext context) |
void |
notifyOfPaymentInit(InvoicePaymentModelDao invoicePayment,
InternalCallContext context) |
InvoicePaymentModelDao |
postChargeback(java.util.UUID paymentId,
java.lang.String chargebackTransactionExternalKey,
java.math.BigDecimal amount,
Currency currency,
InternalCallContext context) |
InvoicePaymentModelDao |
postChargebackReversal(java.util.UUID paymentId,
java.lang.String chargebackTransactionExternalKey,
InternalCallContext context) |
Pagination<InvoiceModelDao> |
searchInvoices(java.lang.String searchKey,
java.lang.Long offset,
java.lang.Long limit,
InternalTenantContext context) |
void |
setFutureAccountNotificationsForEmptyInvoice(java.util.UUID accountId,
InvoiceDispatcher.FutureAccountNotifications callbackDateTimePerSubscriptions,
InternalCallContext context) |
void |
transferChildCreditToParent(Account childAccount,
InternalCallContext childAccountContext)
Move a given child credit to the parent level
|
void |
updateInvoiceItemAmount(java.util.UUID invoiceItemId,
java.math.BigDecimal amount,
InternalCallContext context)
Update invoice item amount
|
checkEntityAlreadyExists, create, create, createAndRefresh, get, getAll, getByRecordId, getCount, getCreateEntitySqlDaoTransactionWrapper, getCreateEntitySqlDaoTransactionWrapper, getNaturalOrderingColumns, getRecordId, postBusEventFromTransaction, test
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, get, getAll, getByRecordId, getCount, getRecordId, test
@Inject public DefaultInvoiceDao(TagInternalApi tagInternalApi, org.skife.jdbi.v2.IDBI dbi, @Named(value="main-ro") org.skife.jdbi.v2.IDBI roDbi, NextBillingDatePoster nextBillingDatePoster, org.killbill.bus.api.PersistentBus eventBus, org.killbill.clock.Clock clock, CacheControllerDispatcher cacheControllerDispatcher, NonEntityDao nonEntityDao, InvoiceConfig invoiceConfig, InvoiceDaoHelper invoiceDaoHelper, CBADao cbaDao, ParentInvoiceCommitmentPoster parentInvoiceCommitmentPoster, InternalCallContextFactory internalCallContextFactory)
protected InvoiceApiException generateAlreadyExistsException(InvoiceModelDao entity, InternalCallContext context)
generateAlreadyExistsException
in class EntityDaoBase<InvoiceModelDao,Invoice,InvoiceApiException>
public java.util.List<InvoiceModelDao> getInvoicesByAccount(java.lang.Boolean includeVoidedInvoices, InternalTenantContext context)
getInvoicesByAccount
in interface InvoiceDao
public java.util.List<InvoiceModelDao> getAllInvoicesByAccount(java.lang.Boolean includeVoidedInvoices, InternalTenantContext context)
getAllInvoicesByAccount
in interface InvoiceDao
public java.util.List<InvoiceModelDao> getInvoicesByAccount(java.lang.Boolean includeVoidedInvoices, org.joda.time.LocalDate fromDate, InternalTenantContext context)
getInvoicesByAccount
in interface InvoiceDao
public InvoiceModelDao getById(java.util.UUID invoiceId, InternalTenantContext context) throws InvoiceApiException
getById
in interface EntityDao<InvoiceModelDao,Invoice,InvoiceApiException>
getById
in class EntityDaoBase<InvoiceModelDao,Invoice,InvoiceApiException>
InvoiceApiException
public InvoiceModelDao getByNumber(java.lang.Integer number, InternalTenantContext context) throws InvoiceApiException
getByNumber
in interface InvoiceDao
InvoiceApiException
public InvoiceModelDao getByInvoiceItem(java.util.UUID invoiceItemId, InternalTenantContext context) throws InvoiceApiException
getByInvoiceItem
in interface InvoiceDao
InvoiceApiException
public void setFutureAccountNotificationsForEmptyInvoice(java.util.UUID accountId, InvoiceDispatcher.FutureAccountNotifications callbackDateTimePerSubscriptions, InternalCallContext context)
setFutureAccountNotificationsForEmptyInvoice
in interface InvoiceDao
public void createInvoice(InvoiceModelDao invoice, InvoiceDispatcher.FutureAccountNotifications callbackDateTimePerSubscriptions, InternalCallContext context)
createInvoice
in interface InvoiceDao
public java.util.List<InvoiceItemModelDao> createInvoices(java.util.List<InvoiceModelDao> invoices, InternalCallContext context)
createInvoices
in interface InvoiceDao
public java.util.List<InvoiceModelDao> getInvoicesBySubscription(java.util.UUID subscriptionId, InternalTenantContext context)
getInvoicesBySubscription
in interface InvoiceDao
public Pagination<InvoiceModelDao> searchInvoices(java.lang.String searchKey, java.lang.Long offset, java.lang.Long limit, InternalTenantContext context)
searchInvoices
in interface InvoiceDao
public java.math.BigDecimal getAccountBalance(java.util.UUID accountId, InternalTenantContext context)
getAccountBalance
in interface InvoiceDao
public java.math.BigDecimal getAccountCBA(java.util.UUID accountId, InternalTenantContext context)
getAccountCBA
in interface InvoiceDao
public java.util.List<InvoiceModelDao> getUnpaidInvoicesByAccountId(java.util.UUID accountId, @Nullable org.joda.time.LocalDate upToDate, InternalTenantContext context)
getUnpaidInvoicesByAccountId
in interface InvoiceDao
public java.util.UUID getInvoiceIdByPaymentId(java.util.UUID paymentId, InternalTenantContext context)
getInvoiceIdByPaymentId
in interface InvoiceDao
public java.util.List<InvoicePaymentModelDao> getInvoicePaymentsByPaymentId(java.util.UUID paymentId, InternalTenantContext context)
getInvoicePaymentsByPaymentId
in interface InvoiceDao
public java.util.List<InvoicePaymentModelDao> getInvoicePaymentsByAccount(InternalTenantContext context)
getInvoicePaymentsByAccount
in interface InvoiceDao
public java.util.List<InvoicePaymentModelDao> getInvoicePaymentsByInvoice(java.util.UUID invoiceId, InternalTenantContext context)
getInvoicePaymentsByInvoice
in interface InvoiceDao
public InvoicePaymentModelDao getInvoicePaymentByCookieId(java.lang.String cookieId, InternalTenantContext context)
getInvoicePaymentByCookieId
in interface InvoiceDao
public InvoicePaymentModelDao createRefund(java.util.UUID paymentId, java.math.BigDecimal requestedRefundAmount, boolean isInvoiceAdjusted, java.util.Map<java.util.UUID,java.math.BigDecimal> invoiceItemIdsWithNullAmounts, java.lang.String transactionExternalKey, InternalCallContext context) throws InvoiceApiException
InvoiceDao
createRefund
in interface InvoiceDao
paymentId
- payment associated with that refundrequestedRefundAmount
- amount to refundisInvoiceAdjusted
- whether the refund should trigger an invoice or invoice item adjustmentinvoiceItemIdsWithNullAmounts
- invoice item ids and associated amounts to adjusttransactionExternalKey
- transaction refund externalKeycontext
- the call callcontextInvoiceApiException
public InvoicePaymentModelDao postChargeback(java.util.UUID paymentId, java.lang.String chargebackTransactionExternalKey, java.math.BigDecimal amount, Currency currency, InternalCallContext context) throws InvoiceApiException
postChargeback
in interface InvoiceDao
InvoiceApiException
public InvoicePaymentModelDao postChargebackReversal(java.util.UUID paymentId, java.lang.String chargebackTransactionExternalKey, InternalCallContext context) throws InvoiceApiException
postChargebackReversal
in interface InvoiceDao
InvoiceApiException
public InvoiceItemModelDao doCBAComplexity(InvoiceModelDao invoice, InternalCallContext context) throws InvoiceApiException
doCBAComplexity
in interface InvoiceDao
InvoiceApiException
public java.util.Map<java.util.UUID,java.math.BigDecimal> computeItemAdjustments(java.lang.String invoiceId, java.util.Map<java.util.UUID,java.math.BigDecimal> invoiceItemIdsWithNullAmounts, InternalTenantContext context) throws InvoiceApiException
computeItemAdjustments
in interface InvoiceDao
InvoiceApiException
public java.math.BigDecimal getRemainingAmountPaid(java.util.UUID invoicePaymentId, InternalTenantContext context)
getRemainingAmountPaid
in interface InvoiceDao
public java.util.UUID getAccountIdFromInvoicePaymentId(java.util.UUID invoicePaymentId, InternalTenantContext context) throws InvoiceApiException
getAccountIdFromInvoicePaymentId
in interface InvoiceDao
InvoiceApiException
public java.util.List<InvoicePaymentModelDao> getChargebacksByAccountId(java.util.UUID accountId, InternalTenantContext context)
getChargebacksByAccountId
in interface InvoiceDao
public java.util.List<InvoicePaymentModelDao> getChargebacksByPaymentId(java.util.UUID paymentId, InternalTenantContext context)
getChargebacksByPaymentId
in interface InvoiceDao
public InvoicePaymentModelDao getChargebackById(java.util.UUID chargebackId, InternalTenantContext context) throws InvoiceApiException
getChargebackById
in interface InvoiceDao
InvoiceApiException
public InvoiceItemModelDao getExternalChargeById(java.util.UUID externalChargeId, InternalTenantContext context) throws InvoiceApiException
InvoiceDao
getExternalChargeById
in interface InvoiceDao
externalChargeId
- the external charge idInvoiceApiException
public void notifyOfPaymentInit(InvoicePaymentModelDao invoicePayment, InternalCallContext context)
notifyOfPaymentInit
in interface InvoiceDao
public void notifyOfPaymentCompletion(InvoicePaymentModelDao invoicePayment, InternalCallContext context)
notifyOfPaymentCompletion
in interface InvoiceDao
public InvoiceItemModelDao getCreditById(java.util.UUID creditId, InternalTenantContext context) throws InvoiceApiException
InvoiceDao
getCreditById
in interface InvoiceDao
creditId
- the credit idInvoiceApiException
public void deleteCBA(java.util.UUID accountId, java.util.UUID invoiceId, java.util.UUID invoiceItemId, InternalCallContext context) throws InvoiceApiException
InvoiceDao
deleteCBA
in interface InvoiceDao
accountId
- the account idinvoiceId
- the invoice idinvoiceItemId
- the invoice item id of the cba item to deleteInvoiceApiException
public void consumeExstingCBAOnAccountWithUnpaidInvoices(java.util.UUID accountId, InternalCallContext context)
consumeExstingCBAOnAccountWithUnpaidInvoices
in interface InvoiceDao
accountId
- the account for which we need to rebalance the CBAcontext
- the callcontextpublic void changeInvoiceStatus(java.util.UUID invoiceId, InvoiceStatus newStatus, InternalCallContext context) throws InvoiceApiException
InvoiceDao
changeInvoiceStatus
in interface InvoiceDao
invoiceId
- the invoice idnewStatus
- the new invoice statecontext
- the tenant contextInvoiceApiException
- if any unexpected error occurspublic void createParentChildInvoiceRelation(InvoiceParentChildModelDao invoiceRelation, InternalCallContext context) throws InvoiceApiException
InvoiceDao
createParentChildInvoiceRelation
in interface InvoiceDao
invoiceRelation
- the invoice relation objectcontext
- the tenant contextInvoiceApiException
- if any unexpected error occurspublic java.util.List<InvoiceParentChildModelDao> getChildInvoicesByParentInvoiceId(java.util.UUID parentInvoiceId, InternalCallContext context) throws InvoiceApiException
InvoiceDao
getChildInvoicesByParentInvoiceId
in interface InvoiceDao
parentInvoiceId
- the parent invoice idcontext
- the tenant contextInvoiceApiException
- if any unexpected error occurspublic InvoiceModelDao getParentDraftInvoice(java.util.UUID parentAccountId, InternalCallContext context) throws InvoiceApiException
InvoiceDao
getParentDraftInvoice
in interface InvoiceDao
parentAccountId
- the parent account idcontext
- the tenant contextInvoiceApiException
- if any unexpected error occurspublic void updateInvoiceItemAmount(java.util.UUID invoiceItemId, java.math.BigDecimal amount, InternalCallContext context) throws InvoiceApiException
InvoiceDao
updateInvoiceItemAmount
in interface InvoiceDao
invoiceItemId
- the invoice item idamount
- the new amount valuecontext
- the tenant contextInvoiceApiException
- if any unexpected error occurspublic void transferChildCreditToParent(Account childAccount, InternalCallContext childAccountContext) throws InvoiceApiException
InvoiceDao
transferChildCreditToParent
in interface InvoiceDao
childAccount
- the child accountchildAccountContext
- the tenant context for the child account idInvoiceApiException
- if any unexpected error occurspublic java.util.List<InvoiceItemModelDao> getInvoiceItemsByParentInvoice(java.util.UUID parentInvoiceId, InternalTenantContext context) throws InvoiceApiException
InvoiceDao
getInvoiceItemsByParentInvoice
in interface InvoiceDao
parentInvoiceId
- the parent invoice idcontext
- the tenant contextInvoiceApiException
- if any unexpected error occursCopyright © 2010-2018. All Rights Reserved.