[x] Values are settable via application.properties
[x] Values are settable via environment variable
[ ] The README.md points to a new document docs/environment.md that explains these environment variables, and all others that can be defined in the app (including existing ones.)
Implementation
I strongly encourage you to break this into two separate PRs
First PR: Backend only (10 points)
[x] Set up these variables in application.properties
[x] Set up a new endpoint in commons controller called /api/commons/defaults that returns a Commons object in JSON format containing these values.
Second PR: Frontend Only (10 points)
Frontend:
[ ] On the commons create page, get the default values from /api/commons/defaults and pre-populate the form with those values instead of using hard coded values.
Priority issue
Worth 20 points when fully complete.
User Story
Discussion
Currently the following values for a new commons have defaults that are hard coded:
These fields don't have default values, but should:
We would like, instead, for those default values to be settable in application.properties, and overridable by environment variables.
app.commons.default.startingBalance
HAPPYCOWS_STARTING_BALANCE
app.commons.default.cowPrice
HAPPYCOWS_COW_PRICE
app.commons.default.milkPrice
HAPPYCOWS_MILK_PRICE
app.commons.default.degradationRate
HAPPYCOWS_MILK_PRICE
app.commons.default.carryingCapacity
HAPPYCOWS_CARRYING_CAPACITY
app.commons.default.capacityPerUser
HAPPYCOWS_CAPACITY_PER_USER
app.commons.default.aboveCapacityHealthUpdateStrategy
HAPPYCOWS_ABOVE_CAPACITY_HEALTH_UPDATE_STRATEGY
app.commons.default.belowCapacityHealthUpdateStrategy
HAPPYCOWS_BELOW_CAPACITY_HEALTH_UPDATE_STRATEGY
Acceptance Criteria
docs/environment.md
that explains these environment variables, and all others that can be defined in the app (including existing ones.)Implementation
I strongly encourage you to break this into two separate PRs
First PR: Backend only (10 points)
Second PR: Frontend Only (10 points)
Frontend: