Skip to content

Data model for spend price per building blocks and project settings #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Aug 23, 2019

Conversation

maxceem
Copy link
Contributor

@maxceem maxceem commented Aug 21, 2019

Implementation for #316

Done via 2 challenges:
http://www.topcoder.com/challenge-details/30096338/?type=develop
http://www.topcoder.com/challenge-details/30096337/?type=develop

Implemented:

Models:

  • ProjectEstimationItems
  • ProjectSettings
  • BuildingBlock

Endpoints:

  • GET /projects/{id}/estimations/{id}/items
  • CRUD for ProjectSettings
  • BuildingBlock are returned now as a par of GET /projects/metadata

ProjectEstimationItems calculation

ProjectEstimationItems are calculated when:

  • we create a project with estimations and there are buildingBlocks for that estimations. Note, we don't have any logic to recalculate ProjectEstimationItems based buildingBlocks. So ProjectEstimationItems are calculated based on buildingBlocks only during project creation.
  • after we create a project we can create ProjectSettings. As soon as we create at least one ProjectSettings which descibes price calculation logic: all existent ProjectEstimationItems are deleted and recreated using ProjectSettings. And later when add/update/delete ProjectSettings about pricing all existent ProjectEstimationItems are delted and recreated.

As a result of the logic above, if we have at least one ProjectSettings about pricing buildingBlocks are not more used to calculate ProjectEstimationItems.

SQL Migrations

To apply this PR two migrations SQL scripts should be applied:

maxceem added 13 commits July 18, 2019 18:24
# Conflicts:
#	package-lock.json
#	postman.json
#	src/constants.js
#	src/permissions/index.js
#	src/routes/index.js
#	swagger.yaml

Also fixed lint errors.
…ature/price-estimation-items/merged

# Conflicts:
#	postman.json
#	src/constants.js
#	src/models/projectEstimationItem.js
#	src/permissions/index.js
#	src/routes/index.js
#	src/routes/projects/create.js
#	swagger.yaml
…erformance when retrieving ProjectSettings and checking their permissions

added warning comments
@maxceem maxceem requested a review from vikasrohit August 21, 2019 10:36
@vikasrohit
Copy link

Thanks @maxceem for the PR, a quick question for you: Do you think if we merge this PR into dev, we can safely move the changes to production, in case we have to do a production release before the 2.5 release?

@maxceem
Copy link
Contributor Author

maxceem commented Aug 21, 2019

I think yes. This PR almost doesn't touch the existent logic. The only place is triggering ProjectEstimationItems calculation on project creation. But I think we have enough time to verify there are no issues in project creation before releasing.

All other logic uses new models and endpoints.

Copy link

@vikasrohit vikasrohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Few queries and minor suggestions. @maxceem could you please refer to me our final approach about using settings vs building blocks for determining pricing items? I would like keep that handy for my discussions with the team.

@vikasrohit
Copy link

Thanks for the changes @maxceem Seems like we have conflicts now.

# Conflicts:
#	postman.json
#	src/permissions/index.js
@maxceem
Copy link
Contributor Author

maxceem commented Aug 23, 2019

@vikasrohit resolved merge conflicts.

@vikasrohit vikasrohit merged commit 9df0aca into dev Aug 23, 2019
@maxceem
Copy link
Contributor Author

maxceem commented Aug 23, 2019

Looks good. Few queries and minor suggestions. @maxceem could you please refer to me our final approach about using settings vs building blocks for determining pricing items? I would like keep that handy for my discussions with the team.

I've created a wiki page with summarised implementation logic https://github.com/topcoder-platform/tc-project-service/wiki/Logic-for-calculating-ProjectEstimationItems

Let me know if any moment has to be clarified.

@eisbilir eisbilir deleted the feature/price-estimation-items/merged branch November 9, 2023 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants