-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
423 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/main/java/io/github/ghacupha/book_keeper/EntryDetails.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/io/github/ghacupha/book_keeper/WrongEntryCurrencyException.java
This file was deleted.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
.../github/ghacupha/book_keeper/Account.java → .../github/ghacupha/keeper/book/Account.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../ghacupha/book_keeper/AccountDetails.java → .../ghacupha/keeper/book/AccountDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
src/main/java/io/github/ghacupha/keeper/book/EntryDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package io.github.ghacupha.keeper.book; | ||
|
||
/** | ||
* Container for additional details for {@link Entry} | ||
* | ||
* @author edwin.njeru | ||
*/ | ||
public class EntryDetails { | ||
|
||
private final String narration; | ||
|
||
private String remarks; | ||
|
||
private String invoiceNumber; | ||
|
||
private String supplier; | ||
|
||
public EntryDetails(String narration) { | ||
this.narration = narration; | ||
this.remarks=""; | ||
this.invoiceNumber=""; | ||
this.supplier=""; | ||
} | ||
|
||
public EntryDetails(String narration, String remarks) { | ||
this(narration); | ||
this.remarks = remarks; | ||
this.invoiceNumber=""; | ||
this.supplier=""; | ||
} | ||
|
||
public EntryDetails(String narration, String remarks, String invoiceNumber) { | ||
this(narration,remarks); | ||
this.invoiceNumber = invoiceNumber; | ||
this.supplier=""; | ||
} | ||
|
||
public EntryDetails(String narration, String remarks, String invoiceNumber, String supplier) { | ||
this(narration,remarks,invoiceNumber); | ||
this.supplier = supplier; | ||
} | ||
|
||
public String getNarration() { | ||
return narration; | ||
} | ||
|
||
public String getRemarks() { | ||
return remarks; | ||
} | ||
|
||
public EntryDetails setRemarks(String remarks) { | ||
this.remarks = remarks; | ||
return this; | ||
} | ||
|
||
public String getInvoiceNumber() { | ||
return invoiceNumber; | ||
} | ||
|
||
public EntryDetails setInvoiceNumber(String invoiceNumber) { | ||
this.invoiceNumber = invoiceNumber; | ||
return this; | ||
} | ||
|
||
public String getSupplier() { | ||
return supplier; | ||
} | ||
|
||
public EntryDetails setSupplier(String supplier) { | ||
this.supplier = supplier; | ||
return this; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
EntryDetails that = (EntryDetails) o; | ||
|
||
if (!narration.equals(that.narration)) return false; | ||
if (!remarks.equals(that.remarks)) return false; | ||
if (!invoiceNumber.equals(that.invoiceNumber)) return false; | ||
return supplier.equals(that.supplier); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = narration.hashCode(); | ||
result = 31 * result + remarks.hashCode(); | ||
result = 31 * result + invoiceNumber.hashCode(); | ||
result = 31 * result + supplier.hashCode(); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("EntryDetails{"); | ||
sb.append("narration='").append(narration).append('\''); | ||
sb.append(", remarks='").append(remarks).append('\''); | ||
sb.append(", invoiceNumber='").append(invoiceNumber).append('\''); | ||
sb.append(", supplier='").append(supplier).append('\''); | ||
sb.append('}'); | ||
return sb.toString(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../book_keeper/ImmutableEntryException.java → .../keeper/book/ImmutableEntryException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/io/github/ghacupha/keeper/book/MismatchedCurrencyException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.github.ghacupha.keeper.book; | ||
|
||
/** | ||
* Thrown when the amount entered into an account has a different currency with the account's currency | ||
*/ | ||
public class MismatchedCurrencyException extends Throwable { | ||
public MismatchedCurrencyException(String message) { | ||
super(message); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
..._keeper/UntimelyBookingDateException.java → ...er/book/UntimelyBookingDateException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.