Commit Graph

46 Commits

Author SHA1 Message Date
Jeff Stieler c0e6a097fd Fix orders report test. 2019-01-16 09:45:52 -07:00
Jeff Stieler 4786938bdf Fix customers report tests. 2019-01-16 09:45:03 -07:00
Joshua T Flowers 33a7cfa1b0 Store all order statuses (https://github.com/woocommerce/woocommerce-admin/pull/1285)
* Store all orders regardless of status in wc_order_stats

* Only query select statuses if status_is or status_is_not is not set

* Fix order stats example query

* Filter category store by default order statuses

* Add table_name to interval functions to avoid ambiguity

* Filter coupon store by default order statuses

* Fix interval stats by adding table_name to interval function

* Filter products store by default order statuses

* Remove unused order_status in coupons data store

* Store products with any order status

* Fix ambiguous order by call in products data store

* Apply status filter after other filters to avoid logical OR matching

* Store all coupon data regardless of order status

* Filter taxes by default order statuses

* Filter customer stats by default order status

* Filter default order statuses in variations data store

* Use excluded statuses to filter reports by default

* DRY up default excluded statuses query

* Fix up new orders data store after rebase
2019-01-16 10:23:00 +08:00
Joshua T Flowers 14f8f08edf Add v4 orders endpoint (https://github.com/woocommerce/woocommerce-admin/pull/1246)
* Rename orders controllers and data store to order stats

* Add orders data store and controller

* Add coupon, product, and status filters

* Add customer type query filter

* Add extended info for products and categories

* Bump API namespace to v4

* Add missing schema properties

* Set default customer_type and extended_info params

* Add orders endpoint tests

* Only use one JOIN if both excluded and included queries are used

* Optimize query calls to get product and category data

* Split product and category fetch and limit to product_cat taxonomy
2019-01-15 09:53:02 +08:00
Jeff Stieler adf8bbeb23 Merge pull request woocommerce/woocommerce-admin#1260 from woocommerce/fix/1239-handle-between-rest-api-param
Handle *_between params in Reports controllers
2019-01-10 10:52:08 -07:00
Jeff Stieler 2246a1e075 Expect array value for _between params.
Add param validation method and normalize to min/max based by comparing values.
2019-01-09 14:19:37 -07:00
Justin Shreve d46ce1df7a Add store performance indicator endpoint (https://github.com/woocommerce/woocommerce-admin/pull/1255)
* Add store performance REST API endpoint

* Clean up validation, add list of allowed stats to OPTIONS endpoint, and rename endpoint to performance-indicators

* Add tests

* Add additional filters to make extending the performance indiciators area easier.

* Add docblocks for filters
2019-01-09 16:08:39 -05:00
Jeff Stieler b15a4bc804 Add utility method to normalize numeric “between” parameters in REST API requests. 2019-01-08 17:41:24 -07:00
Jeff Stieler d42e04cd59 Short circuit registered customer data update when the given ID is bad. 2019-01-08 10:29:44 -07:00
Jeff Stieler d000d3e42a Add cases using ‘name’ and a date parameter to customers report endpoint tests. 2019-01-08 10:29:42 -07:00
Jeff Stieler 737331dd3b Add missing _gmt date fields to customers report response items. 2019-01-08 10:29:41 -07:00
Jeff Stieler 1a4b890660 Add unit tests for customers report endpoint. 2019-01-08 10:29:41 -07:00
Justin Shreve f37b9319e1 Download Report API: Add path to response, fix ordering, and fix schema typo (https://github.com/woocommerce/woocommerce-admin/pull/1248)
* Add download_path to download report endpoint and fix schema typo

* Fix ordering and add tests
2019-01-08 09:51:28 -05:00
Justin Shreve e3e9ccb6a4 Add `reports/downloads/stats` REST API Endpoint (https://github.com/woocommerce/woocommerce-admin/pull/1142)
* First pass at downloads REST API

* Add reports/downloads/stats endpoint.

* Add tests

* Update cache key
2019-01-03 13:00:48 -05:00
Joshua T Flowers 7bbdd78bde Add missing intervals to product reports (https://github.com/woocommerce/woocommerce-admin/pull/1200)
* Add missing intervals to product reports

* Fix failing tests for product stats API

Before and after query should be within today's date since missing intervals for other days will be filled in with remaining dates.
2018-12-31 13:20:22 +08:00
Joshua T Flowers 268182e75f Add invalid note ID test (https://github.com/woocommerce/woocommerce-admin/pull/1197) 2018-12-28 09:44:53 -08:00
Justin Shreve 579113910d Add remaining filters to the downloads report (https://github.com/woocommerce/woocommerce-admin/pull/1141)
* Add order number, username, and IP address filters to the downloads report.

* Adds tests
2018-12-21 16:40:41 -08:00
Justin Shreve 49a0f0f6d2 Add `reports/downloads` REST API endpoint. (https://github.com/woocommerce/woocommerce-admin/pull/1122)
* First pass at downloads REST API

* Handle PR feedback
2018-12-21 14:57:46 -08:00
Peter Fabian dff8b63271 Merge pull request woocommerce/woocommerce-admin#1010 from woocommerce/fix/845
Added /reports/coupons and /reports/coupons/stats endpoints
2018-12-19 13:55:28 +01:00
Joshua T Flowers 08d3e2c38d Change product_gross_revenue to product_net_revenue (https://github.com/woocommerce/woocommerce-admin/pull/1105)
* Change product_gross_revenue to product_net_revenue

* Change product_gross_revenue to product_net_revenue in category data store

* Change to net_revenue in frontend category report
2018-12-19 08:56:27 +08:00
Paul Sealock 15bbbe739d Hook up Categories table to endpoint 2018-12-19 08:36:42 +13:00
Peter Fabian 6c456657e8 Changed coupon_gross_discount to amount. 2018-12-18 12:01:42 +08:00
Peter Fabian db8004aaf7 PHPCS fixes. 2018-12-18 12:01:41 +08:00
Peter Fabian 28f6f7ece5 PHPCS changes so that I will be able to merge master into this branch.
Otherwise I get errors during merge commit.
2018-12-18 12:01:41 +08:00
Peter Fabian 46bf4bedc8 Added basic tests for coupons and coupons/stats. 2018-12-18 12:01:40 +08:00
Peter Fabian 6950522f91 Removed timezone info that was added incorrectly 2018-12-18 12:01:39 +08:00
Joshua T Flowers 9486ab7896 Update/taxes endpoint hookup/941 (https://github.com/woocommerce/woocommerce-admin/pull/1008)
* Hook up taxes to endpoint

* Hook up tax stats endpoint

* Add default tax stat totals for empty results

* Create subtotals from intervals in API

* Change orders to orders_count to keep consistent naming
2018-12-18 10:26:46 +08:00
Claudio Sanches 80f1b2f256 [REST API] Stock endpoint (https://github.com/woocommerce/woocommerce-admin/pull/974)
* New reports stock endpoint

* Register new endpoint

* Unit tests

* Included "name" into stock results

* Fixed sku type

* Improve stock _links returning properly links for variations and parent products

* Fixed docblock

* Sort stock by stock_quantity by default

* Fixed orderby

* Ignore sticky posts

* Fixed variable names
2018-12-14 07:43:39 -08:00
Peter Fabian 43b60489ff Merge pull request woocommerce/woocommerce-admin#1060 from woocommerce/fix/remove-force-update-in-tests
Removed force update in tests
2018-12-12 19:47:16 +01:00
Justin Shreve 20e202080a Add Live Data to Reviews Panel (https://github.com/woocommerce/woocommerce-admin/pull/1055)
* Add Live Data to Reviews Panel
Adds the ability to embed the product in a product review response

* Clean up code needed to embed some product fields.

* Add API response tests
2018-12-12 08:35:56 -05:00
Peter Fabian 256a7fd708 Test should run without explicitly calling update for lookups.
Same as code in general, tests should also check whether the lookups are updated correctly without explicitly needing to call update on data stores.
2018-12-11 12:41:47 +01:00
Peter Fabian c612f85c6c PHPCS updates. 2018-12-11 12:39:44 +01:00
Allen Snook de105648be Activity Panel: Inbox: Filter update and error notes out of the inbox (https://github.com/woocommerce/woocommerce-admin/pull/893)
* Filter update and error notes out of the inbox

* Remove redundant trim().

* Fix test for admin notes API type parameter.
2018-12-11 09:00:57 +08:00
Joshua T Flowers 04d3ce6eb1 Add taxes endpoint and data store (https://github.com/woocommerce/woocommerce-admin/pull/1000)
* Add taxes endpoint and data store

* Add sorting options and normalize orderby param

* Add report taxes unit tests

* Add tax rate to response

* Add country, state, priority, and name to response

* Fix tax codes query param

* Add class comment

* Add missing  to record query

* Add comment about ambiguous column
2018-12-11 08:58:05 +08:00
Joshua T Flowers 557cec57cb Add tax stats endpoint (https://github.com/woocommerce/woocommerce-admin/pull/1019) 2018-12-11 08:55:05 +08:00
Paul Sealock 93a7472e54 REST API: Add stock info to products and variations 2018-12-11 07:19:46 +13:00
Peter Fabian 1acb9827e7 Merge branch 'master' into fix/749
# Conflicts:
#	includes/data-stores/class-wc-admin-reports-products-data-store.php
2018-12-03 16:21:04 +01:00
Paul Sealock 516062975b try/variations-endpoint 2018-12-03 12:02:58 +13:00
Peter Fabian 26debd77c3 WIP on advanced filters.
Plus fixing bugs:
- fixed tests
- fixed schema definition to reflect response data
- split WHERE SQL clause into time constraints and rest
2018-11-16 17:51:33 +01:00
Allen Snook aeb7d15c9a Deeply test the structure of a single note for expected values 2018-11-14 11:17:01 -08:00
Allen Snook 40376c23e1 Add unit tests for admin notes REST API 2018-11-14 11:06:53 -08:00
Jonathan Belcher ecb3013fd3 Uses PHPBCF to autofix warnings and errors (https://github.com/woocommerce/woocommerce-admin/pull/611) 2018-10-22 12:20:14 -04:00
Peter Fabian 28c09248df Added remaining test files. 2018-09-24 19:46:37 +02:00
Peter Fabian 670436ac13 PHPCS fixes. 2018-09-24 17:24:08 +02:00
Peter Fabian 9ccb1e2124 Added revenue stats tests. 2018-09-20 16:20:50 +02:00
Peter Fabian 389a2182a1 Initial setup for unit tests. 2018-09-20 16:20:04 +02:00