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

MARXAN - 448 Cost surface - scenarioId guard #241

Merged
merged 4 commits into from
Jun 8, 2021
Merged

Conversation

kgajowy
Copy link
Contributor

@kgajowy kgajowy commented Jun 7, 2021

Similar to projects:

  • move current service to crud-service and wrap existing functions,
  • the ones that act on a given scenarioId received existing guard which verifies existence of given Scenario,
  • move serializers to standalone classes
  • leaves space for ACL stuff
  • "fixed" spec for changing planning unit's inclusivity (by id / geo) - it was running without existing scenario id, added check prevents that

@vercel
Copy link

vercel bot commented Jun 7, 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/CNaCwLFa1z3JhJg73ui1CD4i4Kdh
✅ Preview: https://marxan-git-api-scenario-id-guard-vizzuality1.vercel.app

marxan-storybook – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/CFncvb7TUXcHWsjuPmLVQxbSMMU1
✅ Preview: https://marxan-storybook-git-api-scenario-id-guard-vizzuality1.vercel.app

Copy link
Member

@hotzevzl hotzevzl left a comment

Choose a reason for hiding this comment

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

@kgajowy nice cleanup, thank you!

see suggestion about sticking to existing naming convention for services (I think yours was simply a typo here) and about a pagination that was removed - once you've taken care of these, feel free to merge, thanks.

import { UpdateScenarioPlanningUnitLockStatusDto } from './dto/update-scenario-planning-unit-lock-status.dto';

@Injectable()
export class ScenarioService {
Copy link
Member

Choose a reason for hiding this comment

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

I suggest to stick to <Plural>Service (as for the recently-refactored ProjectsService), and <Plural>CrudService (this is already ok in this PR for ScenariosCrudService). Filename to be adjusted accordingly here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hotzevzl I actually forgot to mention this but I have done this "miss" on purpose - to have a clean diff (otherwise git would mess with diff merging new/old content).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(as you already reviewed, will change it in this PR)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 86 to 87
const results = await this.service.findAll(fetchSpecification);
return this.scenarioSerializer.serialize(results.data, results.metadata);
Copy link
Member

Choose a reason for hiding this comment

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

we should keep pagination here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

async findAll(fetchSpecification: FetchSpecification) {
    return this.crudService.findAllPaginated(fetchSpecification);
  }

we do 🤔

Will change tho.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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