Closed mariel-oar closed 2 years ago
All three of the example facilities have anonymized contributor details.
The items associated with these facilities are all inactive
~I suspect that~ we are filtering out inactive items when fetching the sectors for a facility
opensupplyhub=> select i.id, sector, is_public, is_active from api_facilitylistitem i join api_source s on i.source_id = s.id where facility
_id = 'MA20202680RFD9Z';
id | sector | is_public | is_active
--------+-----------+-----------+-----------
141607 | {Apparel} | t | f
142170 | {Apparel} | t | f
(2 rows)
opensupplyhub=> select i.id, sector, is_public, is_active from api_facilitylistitem i join api_source s on i.source_id = s.id where facility_id = 'CN20211821GPP86';
id | sector | is_public | is_active
--------+-----------+-----------+-----------
536590 | {Apparel} | f | f
540863 | {Apparel} | t | f
(2 rows)
opensupplyhub=> select i.id, sector, is_public, is_active from api_facilitylistitem i join api_source s on i.source_id = s.id where facility_id = 'TN2020268Y889EV';
id | sector | is_public | is_active
--------+-----------+-----------+-----------
141610 | {Apparel} | t | f
142173 | {Apparel} | t | f
(2 rows)
All facilities moved over from OAR should have been assigned a sector value of Apparel. All new facilities are blocked if sector is not included.
There are a number of facilities (look like they are all apparel facilities that are showing up with a blank sector value): CN20211821GPP86 MA20202680RFD9Z TN2020268Y889EV
Proposed Fix