-
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.
Keep
ForSaleConfig
in its previous form
- New `ForSaleConfigParams` class added for defining for sale config at event or season creation time
- Loading branch information
Steve Chaloner
committed
Oct 16, 2023
1 parent
e49c4fa
commit f2efd35
Showing
7 changed files
with
97 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,14 @@ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
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 ForSaleConfigParams extends ValueObject { | ||
|
||
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