Commit Graph

26 Commits

Author SHA1 Message Date
louwie17 484e945460 Fix updating WC customer without wordpress user (if multiple orders are present) (https://github.com/woocommerce/woocommerce-admin/pull/5825)
* Create get last order function that does not rely on Wordpress user, and add test for use case

* Add change log

* Make sure tests use the right index for comparison

* Order by date_created_gmt first and order id second, and wrote test for get_last_order

* Fix test assertion, and remove unnecessary parameter
2020-12-10 09:42:17 -04:00
louwie17 e09f7d623e Update customer data on order update (https://github.com/woocommerce/woocommerce-admin/pull/5776)
* Add sync order customer to scheduler to update customer info on order update

* Write tests for syncing customer data from order
2020-12-03 08:55:27 -04:00
Jeff Stieler 025860c879 Delete associated customer analytics data when user is deleted from WordPress. (https://github.com/woocommerce/woocommerce-admin/pull/4977)
* Delete customer lookup rows when their corresponding user is deleted.

* Asynchronously delete users from customer lookup table.

* Add user deletion test case.

* Fix user deletion test.
2020-08-13 09:23:51 -04:00
Claudio Sanches 073a3f706f Fix usage of "package" tag in file headers (https://github.com/woocommerce/woocommerce-admin/pull/4940)
* Don't require package tag or file comment inside src

* Removed package tag from files inside src

* Fixed tests directory in phpcs.xml.dist

* Fixed usage of package tag

* Fixed new classes

* Fixed coding standards

* Fixed coding standards in tests
2020-08-11 16:18:47 -03:00
Ron Rennick f78c143f3b Move in-house rest endpoints to private namespace (https://github.com/woocommerce/woocommerce-admin/pull/3204)
* move in-house rest endpoints to private namespace

* PHPCS sniff fixes
2019-11-12 14:15:55 -04:00
Jeff Stieler 8f27a374f1 Fix tests. 2019-08-21 09:34:17 -07:00
Jeff Stieler b7912bc579 PSR4-ify the Reports data store classes. 2019-08-12 15:03:17 -07:00
Jeff Stieler 35d763fa8c Merge pull request woocommerce/woocommerce-admin#2463 from KZeni/patch-2
Add State alongside City (and other customer info).
2019-06-28 12:24:25 -06:00
Kurt Zenisek ce8d670420 Increased assertCount to accommodate the added data point 2019-06-20 14:24:14 -05:00
Jeff Stieler f75e3c7820 Check for good WC_Orders before using instance methods. 2019-06-20 08:31:10 -06:00
Joshua T Flowers 57416a2bdb Refactor customer name retrieval (https://github.com/woocommerce/woocommerce-admin/pull/2418)
* Return early from creating customer if order is false

* Refactor customer first and last name methods

* Separate customer name tests to create guest orders

* Check for parent_id before retrieving customer ID in refund

* Use registered customer ID in import report tests

* Compare absolute integer when checking for valid customer ID

* Check for order before getting customer ID when retrieving existing customer ID
2019-06-20 11:22:47 +08:00
Kurt Zenisek a39c885160 Added state alongside city & other info 2019-06-19 17:11:24 -05:00
Joshua T Flowers e31be343e2 Make customer name extendable (https://github.com/woocommerce/woocommerce-admin/pull/1976)
* Make customer name extendable

* Update get_customer_name to favor user profile information

* Update customer name on profile update

* Add tests around customer name getting and setting

* Prefix customer name filter with woocommerce_reports_
2019-04-09 11:39:39 +08:00
Jeff Stieler bfe5a75e98 Update text domain. (https://github.com/woocommerce/woocommerce-admin/pull/1795)
* Translation call text domain change from “wc-admin” to “woocommerce-admin”.

* Fix .pot file generation.

* Fix errantly closed array item in /revenue/stats controller.

* Rename plugin zip, main file, and repo name to "woocommerce-admin".
2019-03-13 11:14:02 -06:00
Joshua T Flowers aef11ef586 Refactor customer ID creation (https://github.com/woocommerce/woocommerce-admin/pull/1619)
* Fix indendtation for table creations

* Refactor how customers are created on order update

* Check if user has a role of customer or previous orders before storing

* Add tests for user creation

* Allow null emails for customers

* Only select customer_id in guest ID query
2019-02-20 10:30:00 +08:00
Justin Shreve 4f64358c8e Fix customer filters and download user filtering (https://github.com/woocommerce/woocommerce-admin/pull/1618)
* Add the ability to search name, username, and email fields on the customer endpoint, update autocompletors, add in include parameter.

* Update the username to be returned in the download response, update download filtering based on customer id, and only rename include parameter on main customers endpoint.
2019-02-19 14:35:29 -05:00
Ron Rennick e91f7f6d00 phpcs for reports-customers.php 2019-02-14 19:14:43 -04:00
Jeff Stieler e36d25e112 Make customer object IDs compatible with `wc-api`/`fresh-data`. 2019-02-12 11:08:03 -08:00
Jeff Stieler 926fdcfb97 Hook `v4/customers` endpoint up to customers report/lookup table and change name search to be fuzzy. 2019-02-12 11:06:22 -08:00
Jeff Stieler 21572698d8 Fix unit tests that rely on queued data updates. 2019-02-04 09:18:50 -07:00
Joshua T Flowers 7cdbbf87e8 Update all wc-admin endpoints to v4 (https://github.com/woocommerce/woocommerce-admin/pull/1298)
* Update all wc-admin endpoints to v4

* Add namespace for products and customers controllers

* Include product quantity in orders data store

* Add coupons to extended data in the orders data store

* Format order statuses response from database

* Hook up orders table to orders endpoint

* Add namespace to data endpoint controller

* Add namespaces to remaining extended controllers

* Use NAMESPACE var in place of wc/v4

* Update product links in orders table to products reports

* Add coupons rest controller override

* Format coupon code in response

Co-Authored-By: joshuatf <joshuatf@gmail.com>
2019-01-18 10:52:58 +08:00
Jeff Stieler 4786938bdf Fix customers report tests. 2019-01-16 09:45:03 -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