-
Notifications
You must be signed in to change notification settings - Fork 120
Top performers Mark2: Storage + Yosemite fmwk support #285
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 all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
402557f
Added TopEarnerStats + TopEarnerStatsItem to Storage fmwk
bummytime 7036ad4
Removed lastUpdated field from TopEarnerStats
bummytime 40310a8
ReadOnlyConvertible imp for TopEarners
bummytime 9681bc9
WIP: Updates to StatsStore for top earners
bummytime 248ed41
Added TopEarners store test
bummytime 9641a8a
More tests
bummytime 928739b
Updates + final tests for top earner in Storage + Yosemite
bummytime 11da69f
Merge branch 'develop' of github.com:woocommerce/woocommerce-ios into…
bummytime 9bbb121
Doc comment fix
bummytime 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
25 changes: 25 additions & 0 deletions
25
Networking/NetworkingTests/Responses/top-performers-week-alt.json
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,25 @@ | ||
| { | ||
| "date": "2018-W12", | ||
| "unit": "week", | ||
| "limit": "4", | ||
| "data": [ | ||
| { | ||
| "ID": 996, | ||
| "name": "Funky Hoodie 2", | ||
| "total": 2, | ||
| "quantity": 444, | ||
| "price": 40, | ||
| "image": "https:\/\/jamosova3.mystagingwebsite.com\/wp-content\/uploads\/2017\/05\/hoodie-with-logo.jpg", | ||
| "currency": "USD" | ||
| }, | ||
| { | ||
| "ID": 933, | ||
| "name": "Smile T-Shirt 2", | ||
| "total": 161.00, | ||
| "quantity": 555, | ||
| "price": 55.44, | ||
| "image": "https:\/\/jamosova3.mystagingwebsite.com\/wp-content\/uploads\/2018\/04\/smile.gif", | ||
| "currency": "USD" | ||
| } | ||
| ] | ||
| } |
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 |
|---|---|---|
|
|
@@ -31,4 +31,4 @@ | |
| "currency": "USD" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
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,8 @@ | ||
| # Core Data Migrations | ||
|
|
||
| This file documents changes in the extensions data model. Please explain any changes to the data model as well as any custom migrations. | ||
|
|
||
| ## Model 2 | ||
| - @bummytime 2018-09-05 | ||
| - Added new entity: `TopEarnerStats`, to encapsulate all of the top earner stats for a given site & granularity | ||
| - Added new entity: `TopEarnerStatsItem`, to encapsulate all the top earner stats for a specific product | ||
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,7 @@ | ||
| import Foundation | ||
| import CoreData | ||
|
|
||
| @objc(TopEarnerStats) | ||
| public class TopEarnerStats: NSManagedObject { | ||
|
|
||
| } |
31 changes: 31 additions & 0 deletions
31
Storage/Storage/Model/TopEarnerStats+CoreDataProperties.swift
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,31 @@ | ||
| import Foundation | ||
| import CoreData | ||
|
|
||
|
|
||
| extension TopEarnerStats { | ||
|
|
||
| @nonobjc public class func fetchRequest() -> NSFetchRequest<TopEarnerStats> { | ||
| return NSFetchRequest<TopEarnerStats>(entityName: "TopEarnerStats") | ||
| } | ||
|
|
||
| @NSManaged public var granularity: String | ||
| @NSManaged public var limit: String | ||
| @NSManaged public var date: String | ||
| @NSManaged public var items: Set<TopEarnerStatsItem>? | ||
| } | ||
|
|
||
| // MARK: Generated accessors for items | ||
| extension TopEarnerStats { | ||
|
|
||
| @objc(addItemsObject:) | ||
| @NSManaged public func addToItems(_ value: TopEarnerStatsItem) | ||
|
|
||
| @objc(removeItemsObject:) | ||
| @NSManaged public func removeFromItems(_ value: TopEarnerStatsItem) | ||
|
|
||
| @objc(addItems:) | ||
| @NSManaged public func addToItems(_ values: NSSet) | ||
|
|
||
| @objc(removeItems:) | ||
| @NSManaged public func removeFromItems(_ values: NSSet) | ||
| } |
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,7 @@ | ||
| import Foundation | ||
| import CoreData | ||
|
|
||
| @objc(TopEarnerStatsItem) | ||
| public class TopEarnerStatsItem: NSManagedObject { | ||
|
|
||
| } |
19 changes: 19 additions & 0 deletions
19
Storage/Storage/Model/TopEarnerStatsItem+CoreDataProperties.swift
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,19 @@ | ||
| import Foundation | ||
| import CoreData | ||
|
|
||
|
|
||
| extension TopEarnerStatsItem { | ||
|
|
||
| @nonobjc public class func fetchRequest() -> NSFetchRequest<TopEarnerStatsItem> { | ||
| return NSFetchRequest<TopEarnerStatsItem>(entityName: "TopEarnerStatsItem") | ||
| } | ||
|
|
||
| @NSManaged public var productID: Int64 | ||
| @NSManaged public var productName: String? | ||
| @NSManaged public var quantity: Int16 | ||
| @NSManaged public var price: Double | ||
| @NSManaged public var total: Double | ||
| @NSManaged public var currency: String? | ||
| @NSManaged public var imageUrl: String? | ||
| @NSManaged public var stats: TopEarnerStats? | ||
| } |
8 changes: 8 additions & 0 deletions
8
Storage/Storage/Model/WooCommerce.xcdatamodeld/.xccurrentversion
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,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>_XCCurrentVersionName</key> | ||
| <string>Model 2.xcdatamodel</string> | ||
| </dict> | ||
| </plist> |
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.
Nice!!!!!