-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for-sale config to be specified when events and seasons are cre…
…ated (#146) * Allow for-sale config to be specified when events and seasons are created * Keep `ForSaleConfig` in its previous form - New `ForSaleConfigParams` class added for defining for sale config at event or season creation time * Removed `ValueObject` parent class from `ForSaleConfigParams` --------- Co-authored-by: Steve Chaloner <[email protected]>
- Loading branch information
Showing
9 changed files
with
147 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package seatsio.events; | ||
|
||
import com.google.gson.JsonObject; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static seatsio.json.JsonObjectBuilder.aJsonObject; | ||
|
||
public class ForSaleConfigParams { | ||
|
||
public boolean forSale; | ||
public List<String> objects; | ||
public Map<String, Integer> areaPlaces; | ||
public List<String> categories; | ||
|
||
public ForSaleConfigParams(boolean forSale) { | ||
this.forSale = forSale; | ||
} | ||
|
||
public ForSaleConfigParams(boolean forSale, List<String> objects, Map<String, Integer> areaPlaces, List<String> categories) { | ||
this.forSale = forSale; | ||
this.objects = objects; | ||
this.areaPlaces = areaPlaces; | ||
this.categories = categories; | ||
} | ||
|
||
public ForSaleConfigParams forSale(boolean forSale) { | ||
this.forSale = forSale; | ||
return this; | ||
} | ||
|
||
public ForSaleConfigParams objects(List<String> objects) { | ||
this.objects = objects; | ||
return this; | ||
} | ||
|
||
public ForSaleConfigParams areaPlaces(Map<String, Integer> areaPlaces) { | ||
this.areaPlaces = areaPlaces; | ||
return this; | ||
} | ||
|
||
public ForSaleConfigParams categories(List<String> categories) { | ||
this.categories = categories; | ||
return this; | ||
} | ||
|
||
public JsonObject toJson() { | ||
return aJsonObject() | ||
.withProperty("forSale", forSale) | ||
.withPropertyIfNotNull("objects", objects) | ||
.withPropertyIfNotNull("areaPlaces", areaPlaces) | ||
.withPropertyIfNotNull("categories", categories) | ||
.build(); | ||
} | ||
} |
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
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