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

Implemented new endpoint to update brand status. #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

laz95
Copy link

@laz95 laz95 commented Sep 24, 2023

Implemented following changes:

  • Added brand_status table to the database to store all available brand statuses and their metadata
  • Added brand_status_history table to the database to store changes to brand status, like when status of a brand was changed and by which user. Current status of a brand can be retrieved from this table by querying last added entry for that brand id.
  • Added updateBrandStatus endpoint to BrandResolver.ts
  • Added updateBrandStatus function to BrandService.ts that checks if user is admin and has access to brand and updates status
  • Added BrandStatusHistory.ts that contains logic to change brand status and retrieve brand status from db to check if given status exists. If status is invalid, it throws exception.
  • Modified tc_col_memorable-test.json to add tests for updating brand status: one test that updates brand status to DATA_READY and other test that throws INVALID STATUS exception

@laz95 laz95 force-pushed the feature/change-brand-status branch from 8c840db to 2460920 Compare October 4, 2023 20:48
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.

1 participant