-
Notifications
You must be signed in to change notification settings - Fork 55
Logic for calculating ProjectEstimationItems
maxceem edited this page Aug 23, 2019
·
6 revisions
The initial task is described in the next issue and implemented by the next PR.
When we create a project with estimations we are trying to find buildingBlocks for that estimations. If we found them and they have privateConfig with defined priceItems then we for such estimation we create estimation items.
-
We have an estimation during project creation:
{ id: 7, buildingBlockKey: 'BLOCK_KEY', price: 6000 }
And we found a
buildingBlockfor such estimation:id: 13, key: 'BLOCK_KEY', privateConfig: { priceItems: { community: 3456, topcoder_service: '20%', fee: 1234 } }
Than 3 estimation item records would be created:
[ { price: 3456, type: 'community', projectEstimationId: 7, markupUsedReference: 'buildingBlock', markupUsedReferenceId: 13 }, { price: 1200, type: 'topcoder_service', projectEstimationId: 7, markupUsedReference: 'buildingBlock', markupUsedReferenceId: 13 }, { price: 1234, type: 'fee', projectEstimationId: 7, markupUsedReference: 'buildingBlock', markupUsedReferenceId: 13 } ]
- calculation using
buildingBlockswould happened only once during project creation. As project is just created, so we just create new one and we don't have to remove existent ones, as there are no existent estimation items for a new project. - we don't have any logic to recalculate price estimation on using
buildingBlocks. Candiate events to do so in the future:- when we change the project scope. So far we don't update
estimationsrecords when we update project scope, thus we don't recalculate estimations items also - when we change
buildingBlocksrecords. Not sure if project estimation items should be recalculated or no in such case. Though so far we don't have any API to mangebuildingBlocksthus we don't have any events to recalculate estimation items. Note, putting such logic may trigger recalculation estimation items for multiple projects
- when we change the project scope. So far we don't update