BRMS should serve as the source of polygons uses by the Forests website. We have a CFR global id field on BRMS and Forests that uniquely identifies a CFR. Investigate how we can push the master polygon from a BRMS CFR to the equivalent CFR in the Forests system.
See Forests issue https://github.com/National-Forestry-Authority/forests/issues/352
[ ] Install Queue UI
[ ] Add item to queue on updating CFR with changed master polygon
[ ] Implement queue worker to process queue on cron. Queue worker authenticates with client credentials using secret stored in environment variable. See API calls below.
[ ] Give user clear feedback on status of queue. Show status block on dashboard listing queue items. Show user, CFR, time of queueing, status. Need a new log type, using the Log module, so we keep a record of all processed items.
[ ] On saving add message telling user item has been queued and can be tracked on dashboard
BRMS should serve as the source of polygons uses by the Forests website. We have a CFR global id field on BRMS and Forests that uniquely identifies a CFR. Investigate how we can push the master polygon from a BRMS CFR to the equivalent CFR in the Forests system. See Forests issue https://github.com/National-Forestry-Authority/forests/issues/352
The API calls are: POST https://forests.ddev.site/oauth/token with body form data: client_id=brms grant_type=client_credentials client_secret=the secret set in the BRMS consumer at https://forests.ddev.site/admin/config/services/consumer
GET https://forests.ddev.site/api/asset/cfr?filter[cfr_global_id]=9dc69f9c-2340-4d98-b4e3-0c57420b3bd4 to get the UUID of the CFR with the given cfr_global_id. The response includes the id which is used in the PATCH call to update the polygon. Set auth type to Bearer token and use the token returned by the oauth/token call
PATCH https://forests.ddev.site/api/asset/cfr/the-id-returned-by-the-get-call Set auth type to Bearer token and use the token returned by the oauth/token call Set body to raw JSON with this format: