-
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
- Loading branch information
Steve Chaloner
committed
Oct 16, 2023
1 parent
01d1cd0
commit e49c4fa
Showing
8 changed files
with
113 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,56 @@ | ||
package seatsio.events; | ||
|
||
import com.google.gson.JsonObject; | ||
import seatsio.util.ValueObject; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static seatsio.json.JsonObjectBuilder.aJsonObject; | ||
|
||
public class ForSaleConfig extends ValueObject { | ||
|
||
public boolean forSale; | ||
public List<String> objects; | ||
public Map<String, Integer> areaPlaces; | ||
public List<String> categories; | ||
|
||
public ForSaleConfig() { | ||
} | ||
|
||
public ForSaleConfig(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 ForSaleConfig forSale(boolean forSale) { | ||
this.forSale = forSale; | ||
return this; | ||
} | ||
|
||
public ForSaleConfig objects(List<String> objects) { | ||
this.objects = objects; | ||
return this; | ||
} | ||
|
||
public ForSaleConfig areaPlaces(Map<String, Integer> areaPlaces) { | ||
this.areaPlaces = areaPlaces; | ||
return this; | ||
} | ||
|
||
public ForSaleConfig 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