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

prevent creating identical agreements #882

Merged
merged 7 commits into from
Aug 10, 2023

Conversation

pylipp
Copy link
Contributor

@pylipp pylipp commented Aug 5, 2023

When creating an agreement, now it is first checked whether an identical accepted agreement exists, i.e. same set of organisations and same (sub)set of bases involved, and overlapping validity periods. If so, the GraphQL response contains an error with BAD_USER_INPUT code.

@pylipp pylipp force-pushed the prevent-creating-identical-agreements branch 2 times, most recently from bb45eea to 2ca794a Compare August 6, 2023 16:24
@codecov
Copy link

codecov bot commented Aug 6, 2023

Codecov Report

Merging #882 (c5d2b76) into master (1066ad3) will increase coverage by 0.09%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #882      +/-   ##
==========================================
+ Coverage   71.78%   71.87%   +0.09%     
==========================================
  Files         280      280              
  Lines        7084     7101      +17     
  Branches     1506     1507       +1     
==========================================
+ Hits         5085     5104      +19     
  Misses       1963     1963              
+ Partials       36       34       -2     
Flag Coverage Δ
backend 96.88% <100.00%> (+0.08%) ⬆️
frontend 52.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...rver/business_logic/box_transfer/agreement/crud.py 100.00% <100.00%> (+2.66%) ⬆️
back/boxtribute_server/exceptions.py 92.18% <100.00%> (+0.38%) ⬆️

@pylipp
Copy link
Contributor Author

pylipp commented Aug 6, 2023

@pylipp pylipp force-pushed the prevent-creating-identical-agreements branch from 2ca794a to 82f0a01 Compare August 6, 2023 16:44
@pylipp pylipp marked this pull request as ready for review August 6, 2023 16:46
@pylipp pylipp force-pushed the prevent-creating-identical-agreements branch from 82f0a01 to a3306d3 Compare August 7, 2023 15:33
From the GraphQL interface, a Date type is passed in. For the data
level, but also for the business logic, it needs to be converted into a
timezone-aware UTC datetime. This should happen as early as possible in
create_transfer_agreement(); and for clarity it's moved into a separate
method. Set default for valid_from to current time there. This
implicitly fixes a bug that occurred when validUntil was specified but
validFrom was not.
@pylipp pylipp force-pushed the prevent-creating-identical-agreements branch from a3306d3 to c5d2b76 Compare August 7, 2023 15:47
Copy link
Member

@HaGuesto HaGuesto left a comment

Choose a reason for hiding this comment

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

approved

@HaGuesto HaGuesto merged commit e100d76 into master Aug 10, 2023
5 checks passed
@HaGuesto HaGuesto deleted the prevent-creating-identical-agreements branch August 10, 2023 11:01
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