-
Notifications
You must be signed in to change notification settings - Fork 121
Customer Search: Coordinate Customer and CustomerSearchResults entities with Storage
#7848
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
Merged
Merged
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
fca2d24
Add Customer+ReadOnlyConvertible
iamgabrielma 6cd8728
Add initial upsertCustomer logic & StorageTypeExension test
iamgabrielma 1d89a6c
Add upsertSearchCustomerResults & ReadOnlyConvertible
iamgabrielma 60f2f65
Fix whitespace & line length
iamgabrielma a622ae4
Merge branch 'trunk' into issue/7741-add-customer-upsert-logic
iamgabrielma b58f7b7
Merge branch 'trunk' into issue/7741-add-customer-upsert-logic
iamgabrielma 1d40075
Add siteID to loadCustomer & loadCustomerResult
iamgabrielma b25fd0f
Modify loadCustomer tests for siteID and keyword params
iamgabrielma 6c3d363
Update Customer Copiable with siteID
iamgabrielma 08dbbbe
Use storage.perform when upsertCustomer
iamgabrielma 8bb6b9d
Unit test for retrieveCustomer upserts data
iamgabrielma 0043213
Make WCAnalytics Copiable & Fakeable
iamgabrielma e57ddbc
Add upsertCustomerSearchResult to Storage
iamgabrielma 263dc79
Update WCAnalyticsCustomer with siteID param
iamgabrielma caf7b81
Add customer-2 json response
iamgabrielma 7d67287
Add upsert customerSearchResults to Storage
iamgabrielma ec11323
Add temporary method to debug responses
iamgabrielma 5dca4ec
Add comments. Fix typo.
iamgabrielma 457ae8a
Rename DecodingError
iamgabrielma a212847
Remove unnecessary XCTAsserts
iamgabrielma 470010e
Make CustomerStore StorageType lazy
iamgabrielma 27d82f2
Remove passing storage directly to upsertSearchCustomerResult
iamgabrielma 36f2e66
Merge branch 'trunk' into issue/7741-add-customer-upsert-logic
iamgabrielma 0a79129
capture weak self
iamgabrielma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| { | ||
| "data": { | ||
| "id": 26, | ||
| "date_created": "2017-03-21T16:09:28", | ||
| "date_created_gmt": "2017-03-21T19:09:28", | ||
| "date_modified": "2017-03-21T16:09:30", | ||
| "date_modified_gmt": "2017-03-21T19:09:30", | ||
| "email": "[email protected]", | ||
| "first_name": "Johnny", | ||
| "last_name": "Doe", | ||
| "role": "customer", | ||
| "username": "johnny.doe", | ||
| "billing": { | ||
| "first_name": "John", | ||
| "last_name": "Doe", | ||
| "company": "", | ||
| "address_1": "969 Market", | ||
| "address_2": "", | ||
| "city": "San Francisco", | ||
| "state": "CA", | ||
| "postcode": "94103", | ||
| "country": "US", | ||
| "email": "[email protected]", | ||
| "phone": "(555) 555-5555" | ||
| }, | ||
| "shipping": { | ||
| "first_name": "John", | ||
| "last_name": "Doe", | ||
| "company": "", | ||
| "address_1": "969 Market", | ||
| "address_2": "", | ||
| "city": "San Francisco", | ||
| "state": "CA", | ||
| "postcode": "94103", | ||
| "country": "US" | ||
| }, | ||
| "is_paying_customer": false, | ||
| "avatar_url": "https://secure.gravatar.com/avatar/8eb1b522f60d11fa897de1dc6351b7e8?s=96", | ||
| "meta_data": [], | ||
| "_links": { | ||
| "self": [ | ||
| { | ||
| "href": "https://example.com/wp-json/wc/v3/customers/25" | ||
| } | ||
| ], | ||
| "collection": [ | ||
| { | ||
| "href": "https://example.com/wp-json/wc/v3/customers" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why are we adding a
siteIDproperty toWCAnalyticsCustomer? It's very possible I missed it, but I didn't see where we're using this. It looks like we may only need it for theCustomermodel.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.
You're right that we're not actively using it at the moment. That said I'd prefer to leave it for consistency with the rest of the models, and at some point we may need to save this to storage directly and
siteIDwill be necessary ( I just haven't reached that point yet :D ). I can always circle back once the feature is completed and remove it if needed 👍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 generally prefer to wait to make changes until they're definitely needed, but you have more context about the overall changes needed for this project so I'd say go with what makes most sense for your plans here!