Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial API refactoring for catalog override prices
- Loading branch information
Showing
55 changed files
with
614 additions
and
164 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
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
66 changes: 66 additions & 0 deletions
66
catalog/src/main/java/org/killbill/billing/catalog/DefaultPlanPhasePriceOverride.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,66 @@ | ||
/* | ||
* Copyright 2014-2015 Groupon, Inc | ||
* Copyright 2014-2015 The Billing Project, LLC | ||
* | ||
* The Billing Project licenses this file to you under the Apache License, version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.killbill.billing.catalog; | ||
|
||
import java.math.BigDecimal; | ||
|
||
import org.killbill.billing.catalog.api.Currency; | ||
import org.killbill.billing.catalog.api.PlanPhasePriceOverride; | ||
import org.killbill.billing.catalog.api.PlanPhaseSpecifier; | ||
|
||
public class DefaultPlanPhasePriceOverride implements PlanPhasePriceOverride { | ||
|
||
private final String phaseName; | ||
private final PlanPhaseSpecifier planPhaseSpecifier; | ||
private final Currency currency; | ||
private final BigDecimal fixedPrice; | ||
private final BigDecimal recurringPrice; | ||
|
||
public DefaultPlanPhasePriceOverride(final String phaseName, final PlanPhaseSpecifier planPhaseSpecifier, final Currency currency, final BigDecimal fixedPrice, final BigDecimal recurringPrice) { | ||
this.phaseName = phaseName; | ||
this.planPhaseSpecifier = planPhaseSpecifier; | ||
this.currency = currency; | ||
this.fixedPrice = fixedPrice; | ||
this.recurringPrice = recurringPrice; | ||
} | ||
|
||
@Override | ||
public String getPhaseName() { | ||
return phaseName; | ||
} | ||
|
||
@Override | ||
public PlanPhaseSpecifier getPlanPhaseSpecifier() { | ||
return planPhaseSpecifier; | ||
} | ||
|
||
@Override | ||
public Currency getCurrency() { | ||
return currency; | ||
} | ||
|
||
@Override | ||
public BigDecimal getFixedPrice() { | ||
return fixedPrice; | ||
} | ||
|
||
@Override | ||
public BigDecimal getRecurringPrice() { | ||
return recurringPrice; | ||
} | ||
} |
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
4 changes: 4 additions & 0 deletions
4
catalog/src/main/java/org/killbill/billing/catalog/dao/CatalogOverrideDao.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,4 @@ | ||
package org.killbill.billing.catalog.dao; | ||
|
||
public class CatalogOverrideDao { | ||
} |
33 changes: 33 additions & 0 deletions
33
.../src/main/java/org/killbill/billing/catalog/dao/CatalogOverridePhaseDefinitionSqlDao.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,33 @@ | ||
/* | ||
* Copyright 2014-2015 Groupon, Inc | ||
* Copyright 2014-2015 The Billing Project, LLC | ||
* | ||
* The Billing Project licenses this file to you under the Apache License, version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.killbill.billing.catalog.dao; | ||
|
||
import org.skife.jdbi.v2.sqlobject.Bind; | ||
import org.skife.jdbi.v2.sqlobject.SqlQuery; | ||
import org.skife.jdbi.v2.sqlobject.customizers.Define; | ||
import org.skife.jdbi.v2.sqlobject.mixins.CloseMe; | ||
import org.skife.jdbi.v2.sqlobject.mixins.Transactional; | ||
import org.skife.jdbi.v2.sqlobject.stringtemplate.UseStringTemplate3StatementLocator; | ||
|
||
@UseStringTemplate3StatementLocator | ||
public interface CatalogOverridePhaseDefinitionSqlDao extends Transactional<CatalogOverridePhaseDefinitionSqlDao>, CloseMe { | ||
|
||
@SqlQuery | ||
public Long getRecordIdFromObject(@Bind("id") String id, @Define("tableName") final String tableName); | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...src/main/java/org/killbill/billing/catalog/dao/CatalogOverridePlanDefinitionModelDao.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,4 @@ | ||
package org.killbill.billing.catalog.dao; | ||
|
||
public class CatalogOverridePlanDefinitionModelDao { | ||
} |
33 changes: 33 additions & 0 deletions
33
...g/src/main/java/org/killbill/billing/catalog/dao/CatalogOverridePlanDefinitionSqlDao.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,33 @@ | ||
/* | ||
* Copyright 2014-2015 Groupon, Inc | ||
* Copyright 2014-2015 The Billing Project, LLC | ||
* | ||
* The Billing Project licenses this file to you under the Apache License, version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.killbill.billing.catalog.dao; | ||
|
||
import org.skife.jdbi.v2.sqlobject.Bind; | ||
import org.skife.jdbi.v2.sqlobject.SqlQuery; | ||
import org.skife.jdbi.v2.sqlobject.customizers.Define; | ||
import org.skife.jdbi.v2.sqlobject.mixins.CloseMe; | ||
import org.skife.jdbi.v2.sqlobject.mixins.Transactional; | ||
import org.skife.jdbi.v2.sqlobject.stringtemplate.UseStringTemplate3StatementLocator; | ||
|
||
@UseStringTemplate3StatementLocator | ||
public interface CatalogOverridePlanDefinitionSqlDao extends Transactional<CatalogOverridePlanDefinitionSqlDao>, CloseMe { | ||
|
||
@SqlQuery | ||
public Long getRecordIdFromObject(@Bind("id") String id, @Define("tableName") final String tableName); | ||
|
||
} |
Oops, something went wrong.
1 comment
on commit 445c377
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
getPlanPhasePrice*O*verrides
?