Skip to content

Commit

Permalink
Merge pull request #181 from amihaiemil/180
Browse files Browse the repository at this point in the history
#180 PM commission as Percentage
  • Loading branch information
amihaiemil authored Nov 24, 2020
2 parents 56a826d + 3c20af4 commit 91b2dfd
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 80 deletions.
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.36</self.core.version>
<self.core.version>0.0.38</self.core.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/selfxdsd/storage/SelfContracts.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,7 @@ private Contract buildContract(final Record rec){
rec.getValue(SLF_PMS_XDSD.USERNAME),
rec.getValue(SLF_PMS_XDSD.PROVIDER),
rec.getValue(SLF_PMS_XDSD.ACCESS_TOKEN),
BigDecimal.valueOf(
rec.getValue(SLF_PMS_XDSD.COMMISSION).longValue()
),
rec.getValue(SLF_PMS_XDSD.COMMISSION).doubleValue(),
this.storage
),
this.storage
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/selfxdsd/storage/SelfInvoicedTasks.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ private InvoicedTask invoicedTaskFromRecord(
rec.getValue(SLF_INVOICEDTASKS_XDSD.ID),
rec.getValue(SLF_INVOICEDTASKS_XDSD.INVOICEID),
BigDecimal.valueOf(
rec.getValue(SLF_INVOICEDTASKS_XDSD.VALUE).longValue()
rec.getValue(SLF_INVOICEDTASKS_XDSD.VALUE).doubleValue()
),
BigDecimal.valueOf(
rec.getValue(SLF_INVOICEDTASKS_XDSD.COMMISSION).longValue()
rec.getValue(SLF_INVOICEDTASKS_XDSD.COMMISSION).doubleValue()
),
new StoredTask(
invoice.contract(),
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/com/selfxdsd/storage/SelfPms.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.jooq.Record;
import org.jooq.Result;

import java.math.BigDecimal;
import java.util.Iterator;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -117,7 +116,7 @@ public ProjectManager register(
final String username,
final String provider,
final String accessToken,
final BigDecimal commission
final double commission
) {
final int pmId = this.database.jooq()
.insertInto(
Expand All @@ -126,7 +125,7 @@ public ProjectManager register(
SLF_PMS_XDSD.USERNAME,
SLF_PMS_XDSD.PROVIDER,
SLF_PMS_XDSD.ACCESS_TOKEN,
SLF_PMS_XDSD.COMMISSION.cast(BigDecimal.class).as("commission")
SLF_PMS_XDSD.COMMISSION.cast(Double.class).as("commission")
)
.values(userId, username, provider, accessToken, commission)
.returning(SLF_PMS_XDSD.ID)
Expand Down Expand Up @@ -177,9 +176,7 @@ private ProjectManager buildProjectManager(final Record record){
record.getValue(SLF_PMS_XDSD.USERNAME),
record.getValue(SLF_PMS_XDSD.PROVIDER),
record.get(SLF_PMS_XDSD.ACCESS_TOKEN),
BigDecimal.valueOf(
record.getValue(SLF_PMS_XDSD.COMMISSION).longValue()
),
record.getValue(SLF_PMS_XDSD.COMMISSION).doubleValue(),
this.storage
);
}
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/com/selfxdsd/storage/SelfProjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.jooq.*;
import org.jooq.impl.DSL;

import java.math.BigDecimal;
import java.util.Iterator;

import static com.selfxdsd.storage.generated.jooq.tables.SlfPmsXdsd.SLF_PMS_XDSD;
Expand Down Expand Up @@ -295,9 +294,7 @@ private Project projectFromRecord(final Record rec,
rec.get(SLF_PMS_XDSD.USERNAME),
rec.get(SLF_PMS_XDSD.PROVIDER),
rec.get(SLF_PMS_XDSD.ACCESS_TOKEN),
BigDecimal.valueOf(
rec.get(SLF_PMS_XDSD.COMMISSION).longValue()
),
rec.get(SLF_PMS_XDSD.COMMISSION).doubleValue(),
this.storage
),
this.storage
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/selfxdsd/storage/SelfTasks.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,7 @@ private Task taskFromRecord(final Record rec) {
rec.getValue(SLF_PMS_XDSD.USERNAME),
rec.getValue(SLF_PMS_XDSD.PROVIDER),
rec.getValue(SLF_PMS_XDSD.ACCESS_TOKEN),
BigDecimal.valueOf(
rec.getValue(SLF_PMS_XDSD.COMMISSION).longValue()
),
rec.getValue(SLF_PMS_XDSD.COMMISSION).doubleValue(),
this.storage
),
this.storage
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 91b2dfd

Please sign in to comment.