update description field for office transactions
This commit is contained in:
+4
-3
@@ -54,21 +54,22 @@ public class OfficeTransaction extends AbstractAuditableCustom<AppUser, Long> {
|
|||||||
this.transactionDate = null;
|
this.transactionDate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OfficeTransaction create(Office fromOffice, Office toOffice, LocalDate transactionLocalDate, Money amount) {
|
public static OfficeTransaction create(Office fromOffice, Office toOffice, LocalDate transactionLocalDate, Money amount, String description) {
|
||||||
|
|
||||||
Date transactionDate = null;
|
Date transactionDate = null;
|
||||||
if (transactionLocalDate != null) {
|
if (transactionLocalDate != null) {
|
||||||
transactionDate = transactionLocalDate.toDate();
|
transactionDate = transactionLocalDate.toDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new OfficeTransaction(fromOffice, toOffice, transactionDate, amount);
|
return new OfficeTransaction(fromOffice, toOffice, transactionDate, amount, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
private OfficeTransaction(final Office fromOffice,final Office toOffice, final Date transactionDate, final Money amount) {
|
private OfficeTransaction(final Office fromOffice,final Office toOffice, final Date transactionDate, final Money amount, String description) {
|
||||||
this.from = fromOffice;
|
this.from = fromOffice;
|
||||||
this.to = toOffice;
|
this.to = toOffice;
|
||||||
this.transactionDate = transactionDate;
|
this.transactionDate = transactionDate;
|
||||||
this.currency = amount.getCurrency();
|
this.currency = amount.getCurrency();
|
||||||
this.transactionAmount = amount.getAmount();
|
this.transactionAmount = amount.getAmount();
|
||||||
|
this.description = description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -131,7 +131,7 @@ public class OfficeWritePlatformServiceJpaRepositoryImpl implements OfficeWriteP
|
|||||||
MonetaryCurrency currency = new MonetaryCurrency(appCurrency.getCode(), appCurrency.getDecimalPlaces());
|
MonetaryCurrency currency = new MonetaryCurrency(appCurrency.getCode(), appCurrency.getDecimalPlaces());
|
||||||
Money amount = Money.of(currency, command.getTransactionAmount());
|
Money amount = Money.of(currency, command.getTransactionAmount());
|
||||||
|
|
||||||
OfficeTransaction entity = OfficeTransaction.create(fromOffice, toOffice, command.getTransactionDate(), amount);
|
OfficeTransaction entity = OfficeTransaction.create(fromOffice, toOffice, command.getTransactionDate(), amount, command.getDescription());
|
||||||
|
|
||||||
this.officeMonetaryTransferRepository.save(entity);
|
this.officeMonetaryTransferRepository.save(entity);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user