Class OrderPaymentEntry
java.lang.Object
org.salespointframework.core.AbstractEntity<ID>
org.salespointframework.core.AbstractAggregateRoot<AccountancyEntry.AccountancyEntryIdentifier>
org.salespointframework.accountancy.AccountancyEntry
org.salespointframework.accountancy.OrderPaymentEntry
- All Implemented Interfaces:
Persistable<AccountancyEntry.AccountancyEntryIdentifier>
A
OrderPaymentEntry
is used to store information of payments of orders.- Author:
- Hannes Weisbach, Thomas Dedek, Oliver Gierke
-
Nested Class Summary
Nested classes/interfaces inherited from class org.salespointframework.accountancy.AccountancyEntry
AccountancyEntry.AccountancyEntryIdentifier
-
Constructor Summary
ConstructorDescriptionOrderPaymentEntry
(Order.OrderIdentifier orderIdentifier, UserAccount.UserAccountIdentifier userAccountIdentifier, javax.money.MonetaryAmount amount, String description, PaymentMethod paymentMethod) AProductPaymentEntry
is constructed for a specificOrder.OrderIdentifier
attached to it. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether theOrderPaymentEntry
belongs to the givenOrder
.TheOrder.OrderIdentifier
which thisOrderPaymentEntry
refers to.ThePaymentMethod
chosen for the order belonging to thisOrderPaymentEntry
.The identifier of theUserAccount
which thisOrderPaymentEntry
refers to.static OrderPaymentEntry
Creates a newOrderPaymentEntry
for the givenOrder
and description.static OrderPaymentEntry
Creates a newOrderPaymentEntry
that rolls back the payment for the givenOrder
.toString()
Methods inherited from class org.salespointframework.accountancy.AccountancyEntry
getDate, getDescription, getId, getValue, hasDate, isExpense, isRevenue
Methods inherited from class org.salespointframework.core.AbstractAggregateRoot
registerEvent
Methods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, hasId, isNew
-
Constructor Details
-
OrderPaymentEntry
public OrderPaymentEntry(Order.OrderIdentifier orderIdentifier, UserAccount.UserAccountIdentifier userAccountIdentifier, javax.money.MonetaryAmount amount, String description, PaymentMethod paymentMethod) AProductPaymentEntry
is constructed for a specificOrder.OrderIdentifier
attached to it. This entry saves also theUserAccount.UserAccountIdentifier
and the specified amount that was paid.- Parameters:
orderIdentifier
- theOrder.OrderIdentifier
to which thisOrderPaymentEntry
will refer to, must not be null.userAccountIdentifier
- the identifier of theUserAccount
thisOrderPaymentEntry
will refer to, must not be null.amount
- theMonetaryAmount
that was paid, must not be null.description
- textual description of the payment entry, must not be null.paymentMethod
- must not be null.
-
-
Method Details
-
of
Creates a newOrderPaymentEntry
for the givenOrder
and description.- Parameters:
order
- must not be null.description
- must not be null.- Returns:
- will never be null.
-
rollback
Creates a newOrderPaymentEntry
that rolls back the payment for the givenOrder
.- Parameters:
order
- must not be null.description
- must not be null.- Returns:
- will never be null.
- Since:
- 7.1
-
belongsTo
Returns whether theOrderPaymentEntry
belongs to the givenOrder
.- Parameters:
order
- must not be null.- Returns:
- whether the
OrderPaymentEntry
belongs to the givenOrder
.
-
getOrderIdentifier
TheOrder.OrderIdentifier
which thisOrderPaymentEntry
refers to. -
getUserAccountIdentifier
The identifier of theUserAccount
which thisOrderPaymentEntry
refers to. -
getPaymentMethod
ThePaymentMethod
chosen for the order belonging to thisOrderPaymentEntry
. -
toString
- Overrides:
toString
in classAccountancyEntry
-