Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Automatically merged facility cannot be split to its own independent facility #2383

Open
vrwOAR opened this issue Mar 14, 2023 · 13 comments
Open
Labels
bug Something isn't working OSH_JIRA

Comments

@vrwOAR
Copy link
Member

vrwOAR commented Mar 14, 2023

Overview

Data uploaded from Sungbo Industrial Co. was processed by the algorithm and automatically matched to DR Industry. The addresses are similar, however the names are dissimilar. When attempting to separate the facilities via the adjust facility matches page, the Match # - 1574557 only has the options to either promote the address or transfer to another facility. The SPLIT button is not available.

When you attempt to promote the match, it returns an error message "An error prevented promoting that facility match".

Expected Behavior

The expected match functionality would allow match # - 1574557 to either be transferred, split &/or promoted. Enabling the desired facility name/address match Sungbo Industrial Co., 79, Sanseong-ro, Danwon-gu, Ansan-si, Gyeonggi-do, Republic of Korea to be the primary record for the facility.

Actual Behavior

Transferring the match is functioning, however, the promotion after transfer returns the error. "An error prevented promoting that facility match"

Split is not available.

Promoting returns the error. "An error prevented promoting that facility match"

Steps to Reproduce

Demo

image

Additional context

@vrwOAR vrwOAR added the bug Something isn't working label Mar 14, 2023
@mariel-oar
Copy link

@jwalgran @obrienad , mind taking a look at this and providing an estimate?

@obrienad
Copy link

Hey team! Please add your planning poker estimate with Zenhub @jwalgran @TaiWilkin

@jwalgran
Copy link
Contributor

@TaiWilkin regarding planning poker, I am first clarifying this issue.

@jwalgran
Copy link
Contributor

@vrwOAR The current title of the issue is "Automatically merged facility cannot be split to its own independent facility" but the reproduction instructions mention using the "Promote" feature.

Based on the example match, it looks like you are intending to split the match, not promote it. Is that the case?

@mariel-oar
Copy link

@jwalgran , we are trying to get Sungbo to be the promoted name. I believe that Vanessa mentioned the split option because the promote option was failing...so the thinking was that we could split it and then transfer DR Industrial into to that new entry. The point is that there is an error happening with the promotion function as well as with the split button not being there...both seem to be bugs/error behavior. If either pathway were working, we could maneuver to get Sungbo as the top entry, which is the end goal.

@jwalgran
Copy link
Contributor

Before noticing the split/promote discrepancy between the title and the description I reproduced this in production by following the steps in the description to se it logged in Rollbar

https://rollbar.com/OpenApparelRegistry/OpenSupplyHub/items/66/

The match that we are attempting to promote appears to not have a location.

Because this will always fail, the minimal feature would be to disable the promotion button if the item corresponding to the match does not have a location. We already hide the split button in this case and should do the same for the promote button

This minimal would still leave the match "stuck" to the incorrect facility.

To fully resolve this we would need to provide a way to get coordinates for the new facility. An option for this would be to build an interface similar to Update Facility Location that would allow the moderator to enter coordinates for the facility.

@TaiWilkin lets put an estimate on this idem based on this larger feature set

  • Add an admin-only API that allows updating the location of a facility list item via the match ID
    • Add en entry to the processing_results array on the list tiem to record the action.
  • If the item associated with a match does not have a geocoded location
    • Hide the "Promote' button
    • Show a button to "Set Location"
  • When "Set Location" is clicked show a dialog
    • Display the country and address for the item
    • Reuse functionality from /dashboard/updatefacilitylocation and /dashboard/geocoder to allow allow geocoding an address or entering coordinates directly to set a new point location and show the point on a map as a preview.
    • When the "Update Item Location" button is clicked, call the API to save the new coordinates on the item and, if successful, update the state as needed so that the split or promote buttons are available.

@mariel-oar
Copy link

ok, interesting, I think in this case, we might just be able to get the claim contributor (Sungbo) to provide a location? @vrwOAR will need to chime in though, I'm not sure why they don't have a location because i thought they submitted a list before submitting a claim.

@jwalgran
Copy link
Contributor

The address on the item in question, 79, Sanseong-ro, Danwon-gu, Ansan-si, Gyeonggi-do, Republic of Korea does not geocode but was able to finish processing because it got matched to KR2020314RCZ04G, therefore a valid geocode was not needed at the time. Splitting or promoting requires us to get coordinates for the item.

Screenshot 2023-03-15 at 12 28 39 PM

@mariel-oar
Copy link

ah got it, thanks for clarification.

So, in theory if they upload an address that geocodes, we should be able to promote... (as i'm typing this i'm remembering a conversation with Vanessa where they were adamant about the provided address, but maybe that was someone else)

@jwalgran
Copy link
Contributor

Yes. We should be able to successfully promote match with an address that correctly geocodes to a location.

@vrwOAR
Copy link
Member Author

vrwOAR commented Mar 16, 2023

@jwalgran & @mariel-oar , I was thinking that the comma after 79 might be the issue. Without the comma the return from google maps still isn't great.

With the name & address, it's improved - but still not an exact location.

Perhaps removing the comma will be enough for a city center result. I will contact the contributor and advise them to re-upload.

@vrwOAR
Copy link
Member Author

vrwOAR commented Mar 16, 2023

@jwalgran this is another occurrence without the option to split. HK2022214691TV5. Is it the same root cause? The uploaded values were contributed as CN, which likely did not return GPS coordinates.

@jwalgran
Copy link
Contributor

Yes. There are 2 other matches displayed for this and have addresses return zero geocoding results.

WORKSHOP No.D, 4/F WILLIAM ENTERPRISES INDUSTRIAL BUILDING,23-25 NG FONG STREET,SAN PO KONG, Kowloon, Hong Kong, China

Workshop No. D, 4/F William Enterprises Industrial Building, 23-25 NG Fong Street, San Po Kong, Kowloon, Hong Kong, , China

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working OSH_JIRA
Projects
None yet
Development

No branches or pull requests

4 participants