-
Notifications
You must be signed in to change notification settings - Fork 5
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
refactor: move scenario features data to shared lib #363
Conversation
This pull request is being automatically deployed with Vercel (learn more). marxan – ./app🔍 Inspect: https://vercel.com/vizzuality1/marxan/78tk2eGyvgyLjTcmuEgpSwLqPhSg marxan-storybook – ./app🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/5TfsNczqHhHGscKRpZUPjq6Xfchq |
async from( | ||
outputDirectory: string, | ||
scenarioId: string, | ||
): Promise<ScenarioFeatureData[]> { | ||
const planningUnits = await this.scenarioFeatureData.findAndCount({ | ||
where: { | ||
scenarioId, | ||
}, | ||
select: ['id', 'featureId'], | ||
}); | ||
const _mapping = planningUnits[0].reduce<FeatureIdToScenarioFeatureData>( | ||
(previousValue, sfd) => { | ||
previousValue[sfd.featureId] = sfd.id; | ||
return previousValue; | ||
}, | ||
{}, | ||
); | ||
console.log(`--- scenario features data mapping`, _mapping); | ||
return []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dummy placeholder for next PR
@@ -46,11 +48,21 @@ export class GeoOutputRepository { | |||
const planningUnitsState: PlanningUnitsSelectionState = await this.planningUnitsStateCalculator.consume( | |||
solutionsStream, | |||
); | |||
|
|||
// TODO grab data from ScenarioFeaturesDataService | |||
const _sfds = await this.scenarioFeaturesDataReader.from( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const _sfds = await this.scenarioFeaturesDataReader.from( | |
const _scenarioFeaturesDataStream = await this.scenarioFeaturesDataReader.from( |
Figured out that adding more would be hard to read the diff, thus adding standalone PR for moving things around and setting really dummy shell/plan for putting the data to the db.