Open dasvas opened 11 months ago
Hi. I was practicing writing RPCs and queries in Supabase and tried to address this issue: 'In the form, there is an option to select a reporting year.' I understood the end-to-end method of doing things:)
Given a KPI id, you need to retrieve that KPI with the min and max values from unit_constraint table.
git commit -m "Updated kpi.service and kpi.controller to retrieve min and max values for KPI" in daria-branch
@maalej
git commit -m "Updated to retrieve KPI details and min and max values in KPI feature" in daria-branch
added a function public.get_kpi_and_constraints in Supabase
???(Could you try to fetch the value with a 3rd join with fills_in table?)
LEFT JOIN LATERAL ( -- Using LATERAL to fetch the latest kpi_value SELECT f.kpi_value FROM fills_in AS f WHERE f.kpi_id = k.id ORDER BY f.updated_at DESC LIMIT 1 ) AS fi ON TRUE
Create queries for each field in the economist reporting form to fetch data from the DB.
Related to user story #40