Boavizta / boaviztapi

🛠 Giving access to BOAVIZTA reference data and methodologies trough a RESTful API
GNU Affero General Public License v3.0
68 stars 23 forks source link

Distribute manufacture impacts over a period of time #78

Closed da-ekchajzer closed 2 years ago

da-ekchajzer commented 2 years ago

Problem

Usage impacts are computed for a certain period of time. The manufacture impacts are returned for all the life cycle of a device. We should provide a way to distribute manufacture impacts on a certain period of usage given by the user.

Solution

The easiest way to distribute manufacture impacts is linearly.

Different time distribution can be process :

Distribution could be a query parameter :

da-ekchajzer commented 2 years ago

This has been implemented in https://github.com/Boavizta/boaviztapi/commit/36b7b3330ad500676e4f34bcfee7c0f8303c563a.

A route parameter makes it possible to choose between TOTAL and LINEAR allocation. TOTAL is set by default.