Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#160 Updated to self-core 0.0.29 #161

Merged
merged 2 commits into from
Oct 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<name>Self XDSD Storage Module</name>
<description>Storage Module for Self XDSD</description>
<properties>
<self.core.version>0.0.27</self.core.version>
<self.core.version>0.0.29</self.core.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/selfxdsd/storage/SelfJooq.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
* @author Mihai Andronache (amihaiemil@gmail.com)
* @version $Id$
* @since 0.0.1
* @todo #160:60min Implement and write unit tests for
* a wallets' PaymentMethods. It should follow the same
* pattern as other entities (SelfPaymentMethods with IT tests etc).
*/
public final class SelfJooq implements Storage {

Expand Down Expand Up @@ -114,6 +117,11 @@ public PayoutMethods payoutMethods() {
return new SelfPayoutMethods(this, this.database);
}

@Override
public PaymentMethods paymentMethods() {
throw new UnsupportedOperationException("Not yet implemented.");
}

@Override
public void close() {
this.database.close();
Expand Down
29 changes: 24 additions & 5 deletions src/main/java/com/selfxdsd/storage/SelfWallets.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@
* @author Mihai Andronache (amihaiemil@gmail.com)
* @version $Id$
* @since 0.0.21
* @todo #135:30min Once we have other types of Wallet (e.g. StripeWallet),
* modify the method walletFromRecord to build the wallet accordingly.
* Method register(...) should then also be adapted to support other wallet
* types.
* @todo #160:30min Implement and test method updateCash(...) here. We should
* only allow cash update for the Stripe wallets. The Fake wallets' cash
* should never be updated.
*/
public final class SelfWallets implements Wallets {

Expand Down Expand Up @@ -115,6 +114,7 @@ public Wallet register(
);
} else {
registered = new StripeWallet(
this.storage,
project,
cash,
identifier,
Expand Down Expand Up @@ -192,7 +192,7 @@ public BigDecimal cash() {
}

@Override
public Invoice pay(final Invoice invoice) {
public Wallet pay(final Invoice invoice) {
return wallet.pay(invoice);
}

Expand All @@ -210,9 +210,27 @@ public boolean active() {
public Project project() {
return wallet.project();
}

@Override
public Wallet updateCash(final BigDecimal bigDecimal) {
return wallet.updateCash(bigDecimal);
}

@Override
public PaymentMethods paymentMethods() {
return null;
}
};
}

@Override
public Wallet updateCash(
final Wallet wallet,
final BigDecimal bigDecimal
) {
throw new UnsupportedOperationException("Not yet implemented.");
}

@Override
public Iterator<Wallet> iterator() {
throw new UnsupportedOperationException(
Expand Down Expand Up @@ -243,6 +261,7 @@ private Wallet walletFromRecord(
);
} else if(Wallet.Type.STRIPE.equalsIgnoreCase(type)) {
wallet = new StripeWallet(
this.storage,
project,
BigDecimal.valueOf(
record.getValue(SLF_WALLETS_XDSD.CASH).longValue()
Expand Down