Skip to content
Snippets Groups Projects
Commit 6e20183b authored by Filip Piták's avatar Filip Piták
Browse files

Rename transaction type

parent acf4e7de
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ public class StatisticalReport { ...@@ -19,7 +19,7 @@ public class StatisticalReport {
private final TransactionStatistics withdrawalAmount = new TransactionStatistics(TransactionType.WITHDRAW); private final TransactionStatistics withdrawalAmount = new TransactionStatistics(TransactionType.WITHDRAW);
private final TransactionStatistics crossAccountAmount = new TransactionStatistics(TransactionType.CROSS_ACCOUNT_PAYMENT); private final TransactionStatistics crossAccountAmount = new TransactionStatistics(TransactionType.TRANSFER);
private final TransactionStatistics creditAmount = new TransactionStatistics(TransactionType.CREDIT); private final TransactionStatistics creditAmount = new TransactionStatistics(TransactionType.CREDIT);
...@@ -49,7 +49,7 @@ public class StatisticalReport { ...@@ -49,7 +49,7 @@ public class StatisticalReport {
case REFUND -> refundAmount.AddAmount(transaction.getAmount()); case REFUND -> refundAmount.AddAmount(transaction.getAmount());
case DEPOSIT -> depositAmount.AddAmount(transaction.getAmount()); case DEPOSIT -> depositAmount.AddAmount(transaction.getAmount());
case WITHDRAW -> withdrawalAmount.AddAmount(transaction.getAmount()); case WITHDRAW -> withdrawalAmount.AddAmount(transaction.getAmount());
case CROSS_ACCOUNT_PAYMENT -> crossAccountAmount.AddAmount(transaction.getAmount()); case TRANSFER -> crossAccountAmount.AddAmount(transaction.getAmount());
} }
} }
......
...@@ -11,7 +11,7 @@ public enum TransactionType { ...@@ -11,7 +11,7 @@ public enum TransactionType {
CREDIT, CREDIT,
CROSS_ACCOUNT_PAYMENT, TRANSFER,
REFUND REFUND
......
...@@ -21,7 +21,7 @@ class StatisticalReportTest { ...@@ -21,7 +21,7 @@ class StatisticalReportTest {
Transaction tr3 = new Transaction(TransactionType.WITHDRAW, BigDecimal.ONE, OffsetDateTime.now(), new UUID(2, 2)); Transaction tr3 = new Transaction(TransactionType.WITHDRAW, BigDecimal.ONE, OffsetDateTime.now(), new UUID(2, 2));
Transaction tr5 = new Transaction(TransactionType.REFUND, BigDecimal.ONE, OffsetDateTime.now(), new UUID(2, 2)); Transaction tr5 = new Transaction(TransactionType.REFUND, BigDecimal.ONE, OffsetDateTime.now(), new UUID(2, 2));
Transaction tr6 = new Transaction(TransactionType.DEPOSIT, BigDecimal.ONE, OffsetDateTime.now(), new UUID(2, 2)); Transaction tr6 = new Transaction(TransactionType.DEPOSIT, BigDecimal.ONE, OffsetDateTime.now(), new UUID(2, 2));
Transaction tr7 = new Transaction(TransactionType.CROSS_ACCOUNT_PAYMENT, BigDecimal.ONE, OffsetDateTime.now(), new UUID(2, 2)); Transaction tr7 = new Transaction(TransactionType.TRANSFER, BigDecimal.ONE, OffsetDateTime.now(), new UUID(2, 2));
report = new StatisticalReport(List.of(tr1, tr2, tr3, tr5, tr6, tr7)); report = new StatisticalReport(List.of(tr1, tr2, tr3, tr5, tr6, tr7));
} }
@Test @Test
...@@ -59,7 +59,7 @@ class StatisticalReportTest { ...@@ -59,7 +59,7 @@ class StatisticalReportTest {
//Act //Act
TransactionStatistics statistics = report.getCrossAccountAmount(); TransactionStatistics statistics = report.getCrossAccountAmount();
//Assert //Assert
assertThat(statistics.getType()).isEqualTo(TransactionType.CROSS_ACCOUNT_PAYMENT); assertThat(statistics.getType()).isEqualTo(TransactionType.TRANSFER);
} }
@Test @Test
public void whenGetAllStatsThenStatsOfAllTypesReturned(){ public void whenGetAllStatsThenStatsOfAllTypesReturned(){
......
...@@ -17,7 +17,7 @@ components: ...@@ -17,7 +17,7 @@ components:
schemas: schemas:
TransactionType: TransactionType:
type: string type: string
enum: [ WITHDRAW, DEPOSIT, CREDIT, CROSS_ACCOUNT_PAYMENT, REFUND ] enum: [ WITHDRAW, DEPOSIT, CREDIT, TRANSFER, REFUND ]
description: type of transaction description: type of transaction
Transaction: Transaction:
title: A transaction title: A transaction
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment