Commit Graph

79 Commits

Author SHA1 Message Date
Jeff Stieler ddae6d3955 Add currency symbol to orders endpoint response. 2019-01-17 00:01:09 -07:00
Jeff Stieler 149ee08f4b Include all users in customer lookup table generation. 2019-01-16 10:20:11 -07:00
Jeff Stieler 11cb74cccd Fix variable name nitpick. 2019-01-16 09:45:52 -07:00
Jeff Stieler a2f94c11ba Add coupons and taxes lookup table generation to reports rebuild. 2019-01-16 09:45:51 -07:00
Jeff Stieler 84732137bc Bail out of creating batches for customers and orders if there are none. 2019-01-16 09:45:51 -07:00
Jeff Stieler 5c6174066e Add tests for report regeneration batch queuing methods. 2019-01-16 09:45:04 -07:00
Jeff Stieler 4786938bdf Fix customers report tests. 2019-01-16 09:45:03 -07:00
Jeff Stieler 6eca20c5fd Reports regenerate: add mechanism to queue an action after another completes - use to queue orders lookup init after customers lookup. 2019-01-16 09:45:03 -07:00
Jeff Stieler 4740f93985 Reports regenerate: use queue to update order stats and products lookup table. 2019-01-16 09:45:02 -07:00
Jeff Stieler 3b9a4ef4a1 Report regeneration: allow batch sizes to differ between actions. 2019-01-16 09:45:02 -07:00
Jeff Stieler fabc1dc70b Reports regenerate: use queue to update customers lookup table. 2019-01-16 09:45:02 -07:00
Jeff Stieler c361119a0d Report table generation: add method for enqueuing a large number of batch jobs with a limited batch size. 2019-01-16 09:45:01 -07: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
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 46b503dd54 Update customers report lookup table when customers/users are updated. 2019-01-08 10:33:17 -07:00
Jeff Stieler 154482acc9 Derive orders_count, total_spend, avg_order_value, and date_late_order for customer reports from the order stats report table. 2019-01-08 10:33:17 -07:00
Jeff Stieler 8105ddb38a Add new guest customers to lookup when syncing the order stats report table. 2019-01-08 10:33:16 -07:00
Jeff Stieler 1a90840e97 Add customer_id to order stats report table to reference with customer lookup. 2019-01-08 10:30:16 -07:00
Jeff Stieler a1317f2152 Customer lookup table: allow registration date to be null (for guests). 2019-01-08 10:29:43 -07:00
Jeff Stieler c337944cf6 Backfill guests into customer report lookup table using order data and billing email. 2019-01-08 10:29:43 -07:00
Jeff Stieler 1832450fd1 Update customer lookup table when orders (with registered customers) are created, updated, or refunded. 2019-01-08 10:29:40 -07:00
Jeff Stieler 2ea61e9a86 Move registered customer lookup update logic into data store class. 2019-01-08 10:29:40 -07:00
Jeff Stieler d0e2c5162f Place a UNIQUE constraint on the user_id key for the customer report lookup table. 2019-01-08 10:29:39 -07:00
Jeff Stieler 6e5fef2f7b Include customers report files. 2019-01-08 10:29:37 -07:00
Jeff Stieler 746120e254 Change customer report lookup table columns to match API parameters. 2019-01-08 10:29:36 -07:00
Jeff Stieler a2154daa4c Register customer report lookup table with core WC. 2019-01-08 10:29:35 -07:00
Jeff Stieler 281c06a5d4 Add username column to customer report lookup table. 2019-01-08 10:29:34 -07:00
Jeff Stieler 9131932910 First pass at initializing the customer lookup table with existing registered customer data. 2019-01-08 10:29:34 -07:00
Jeff Stieler a5cf136037 Add customer report lookup table creation to initialization query. 2019-01-08 10:29:33 -07:00
Joshua T Flowers d9e7e1b952 Remove unused show_product_categories_in_rest function (https://github.com/woocommerce/woocommerce-admin/pull/1235) 2019-01-08 09:53:02 +08:00
Joshua T Flowers f3346e9298 Add the order status column to lookup table (https://github.com/woocommerce/woocommerce-admin/pull/1211)
* Add the order status column to lookup table

* Fix order status filter for order stats

* Fix normalize order status and make static function
2019-01-08 09:16:10 +08: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 b3979ff984 Fix order status product sync (https://github.com/woocommerce/woocommerce-admin/pull/1151)
* Move order product sync to product data store

* Move order taxes sync to taxes data store

* Move order coupons sync to coupons data store

* Use table_name constant in data syncs

* Remove order data for incomplete order statuses

* Fix report rebuild tool

* Update comments to describe create/update entry reference

* Fix data_store_init function name change
2018-12-27 11:49:00 +08:00
Joshua T Flowers c747d3399e Use unbounded per_page limit in apiFetch for categories (https://github.com/woocommerce/woocommerce-admin/pull/1149) 2018-12-26 10:37:02 +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
Joshua T Flowers f83b0e0615 Add product categories wc-api and breadcrumbs (https://github.com/woocommerce/woocommerce-admin/pull/1131)
* Add support for product cats in wp rest api

* Add categories to WC API

* Add category breadcrumbs component

* Increase per_page limit size for product cat API

* Use wc/v3 API to pull product categories

* Return category IDs in API

* Add categories to product reports

* Add category IDs test for REST API

* Switch to getResource instead of require for total count selector
2018-12-21 10:44:27 +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
Peter Fabian 6c456657e8 Changed coupon_gross_discount to amount. 2018-12-18 12:01:42 +08:00
Peter Fabian 5eee869a74 Added small fixes to set up coupon endpoints. 2018-12-18 12:01:38 +08:00
Peter Fabian 357b8f914a Added query classes and data stores for coupons and coupons/stats. 2018-12-18 12:01:17 +08:00
Justin Shreve e42ad6956b Add customer email filter (https://github.com/woocommerce/woocommerce-admin/pull/1092)
* Add customer email filter

* Handle PR feedback: Fix up if statement and add extra info to validation comment
2018-12-17 11:20:11 -05: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
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
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
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 164a67144b try/variations-endpoint 2018-12-03 11:49:37 +13:00
Peter Fabian a86560498e Added primary key to coupon lookup.
Otherwise REPLACE query adds a multiple identical rows.
2018-11-23 22:29:47 +01:00