-
Notifications
You must be signed in to change notification settings - Fork 6
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
Get active mismatches #68
Conversation
* add new request parameters include_reviewed and include_expired * adjust tests to new requirements * modify mismatches response to include status * modify API spec according to new requirements Bug: T285301
31fab91
to
5cfff7a
Compare
95b669a
to
cfa0012
Compare
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.
Looks great! Thank you, 🙇 Just one thing to change and a couple of suggestions
* | ||
* @return \Illuminate\Database\Eloquent\Factories\Factory | ||
*/ | ||
public function reviewed() |
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.
I really like the use of states we have in our factories 👍
database/seeders/MismatchSeeder.php
Outdated
Mismatch::factory(10) | ||
->for($import) | ||
->create(); | ||
|
||
Mismatch::factory(11) | ||
->for($expiredImport) | ||
->create(); | ||
|
||
Mismatch::factory(10) | ||
->for($import) | ||
->reviewed() | ||
->create(); | ||
|
||
Mismatch::factory(11) | ||
->for($expiredImport) | ||
->reviewed() |
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.
10+11+10+11 = 42 Checks out 🤓 😍
@@ -195,6 +195,14 @@ components: | |||
type: string | |||
external_url: | |||
type: string | |||
status: | |||
type: string | |||
enum: |
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.
💯 Thanks for updating the specs!
'ids' => $pendingMismatches->implode('item_id', '|') . '|' . | ||
$reviewedMismatches->implode('item_id', '|') . '|' . | ||
$expiredMismatches->implode('item_id', '|') . '|' . | ||
$expiredReviewedMismatches->implode('item_id', '|') |
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.
Well constructed!
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.
Perfect, thank you for all the changes! One last tiny comment and we're good to go!
Use private methods to set and get imports, mismatches and their IDs.
0b2ef97
to
c60ac0d
Compare
Thank you! |
This modifies the /mismatches endpoint, so that it only returns mismatches that have not been edited yet and that do not belong to expired imports. Two optional request parameters are added, which allow including reviewed mismatches or expired ones.
Bug: T285301