Skip to content
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

feat(api): cost-surface: application logic #196

Merged
merged 4 commits into from
May 19, 2021

Conversation

kgajowy
Copy link
Contributor

@kgajowy kgajowy commented May 18, 2021

Cost Surface update - application logic

Overview

Part of Users should be able to upload shapefiles of scenario cost surfaces - subtask https://vizzuality.atlassian.net/browse/MARXAN-413

Designs

Link to the related design prototypes (if applicable)

Testing instructions

Please explain how to test the PR: ID of a dataset, steps to reach the feature, etc.

Feature relevant tickets

Link to the related task manager tickets


Checklist before submitting

  • Meaningful commits and code rebased on develop.
  • If this PR adds feature that should be tested for regressions when
    deploying to staging/production, please add brief testing instructions
    to the deploy checklist (docs/deployment-checklist.md)
  • Update CHANGELOG file

@vercel
Copy link

vercel bot commented May 18, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

marxan – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan/6TXFkn5dByLcDBL8gYiodK8zR8sc
✅ Preview: https://marxan-git-feat-marxan-413-cost-surface-application-vizzuality1.vercel.app

marxan-storybook – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/CuMFwmWfwvTqQmRZic5toUbCLvjy
✅ Preview: https://marxan-storybo-git-feat-marxan-413-cost-surface-applicat-f44aa1.vercel.app

import { CostSurfaceInputDto } from '../../analysis/entry-points/adjust-cost-surface-input';

export abstract class ResolvePuWithCost {
abstract fromShapefile(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Which is the purpose of this class?

Are we introducing Hex. approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its just an interface what main logic will use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dependency Inversion Principle


@Injectable()
export class CostSurfaceFacade {
constructor(
private readonly adjustCostSurfaceService: AdjustCostSurface,
private readonly proxyService: ProxyService,
private readonly shapefileConverter: ResolvePuWithCost,
Copy link
Collaborator

Choose a reason for hiding this comment

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

ResolvePuWithCost is instantiated as shapefileConverter? Naming is confusing for me

Can you give further explanation?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@kgajowy Sorry, I forgot to click 'Start review...'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexeh its input is a shapefile and returns base PU ids with cost. Suitable names are always appreciated ;)

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.

4 participants