open-contracting / credere-backend

A tool that facilitates the participation of Micro, Small, and Medium businesses (MSMEs) in the Colombian public procurement market.
https://credere.readthedocs.io
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Change how we get new contracts #273

Closed yolile closed 5 months ago

yolile commented 5 months ago

Currently, we use https://www.datos.gov.co/Gastos-Gubernamentales/SECOP-II-Contratos-Electr-nicos/jbjy-vk9h With

However, for the past month or so the ultima_actualizacion combined with estado_contrato = 'Borrador' fields are no longer being set correctly by the source. After some testing, I think we can use:

estado_contrato not in ("Cancelado", "Cerrado", "cedido") instead. We might have some duplicates but the code will skip them anyway.

jpmckinney commented 5 months ago

Are we storing the estado_contrato anywhere, so we can later review which ones passed the condition?

yolile commented 5 months ago

Yes, at award.source_data_contracts->>'estado_contrato'

jpmckinney commented 5 months ago

Cool, I see:

SELECT COUNT(*) c, source_data_contracts->>'estado_contrato' v FROM award GROUP BY v ORDER BY c DESC;
c v status
1772 Borrador
1290 En ejecución
1097 Modificado
905 terminado excluded
541 Activo
530 Cerrado excluded
12 Suspendido excluded
yolile commented 5 months ago

Ah, yes, because some of them were previous awards (see the previous field). But I've added "terminado" and "suspendido" to the exclusion list