BritishYouthBandAssociation / OrgAdmin

Admin site for organisations
1 stars 0 forks source link

Incorrect Import Data #294

Closed rugulous closed 11 months ago

rugulous commented 1 year ago

It looks like the WooCommerce import is not just importing any membership data, it is also importing anyone that has ever made a transaction through the website

rugulous commented 11 months ago

I think I've found the problem, looks to be here in WPOrderProcessor:

async process(order) {
        const contact = await this.getContact(order);
        const org = this.getMetaData(order, '_billing_wooccm13');
        const photoConsent = this.getMetaData(order, '_billing_wooccm21');
        const memberships = [];
...

getContact creates the user if they don't exist, but it's later on that we do the checks for whether this order should be created (in processOrderLine). So this could do with a restructure!