ohcnetwork / life

Verified Crowd-Sourced Emergency Services Directory
https://life.coronasafe.network/
84 stars 56 forks source link

Google Sheet Export Bugs #253

Closed jitendraag closed 3 years ago

jitendraag commented 3 years ago

Describe the bug I am listing multiple bugs here because many of them might have the same fix.

  1. Order of columns in our Google sheet export is NOT same as sample data or data structure. If someone wants to use this Google sheet and copy paste data to their existing sheet, they can't do this without reordering columns first.
  2. We are exposing internal fields like state_id, district_id, delete etc. These are not documented in our schema and are not part of our public schema. I am afraid if someone can mess up with our system if these ids are exposed. (Can we confirm these columns will be discarded)
  3. I saw pincode and pin_code columns. We should remove pin_code
  4. I also see columns that are NOT part of our schema but came from external partners. We should consider removing those from our output.
  5. Order of columns and number of columns between all our sheets should be same (right now it's not)

To Reproduce Try to combine data from 5 sheets here into a sheet in our format that you are already working on:

Expected behavior Explained above

Screenshots NA

Desktop (please complete the following information): NA

Smartphone (please complete the following information): NA

Additional context NA

shrihari689 commented 3 years ago

Fixed 📍🚀

  1. Ordered according to Mandatory Fields ✅
  2. Removed all internal fields ✅ But dumped id column as external_id
  3. It was from our spreadsheet data I think, because backend (pincode) has no issue. ✅
  4. Somehow managed to show data as of our schema 📌 ✅
  5. Done ✅

I also provided the schema on GitHub Issue comment. :pushpin:

🔴 Update: Our Master DB Spreadsheets has sheets according to category and also a Master sheet which contains all data 🎉

Spreadsheet Display Schema:

{
      id: external_id,
      title: title,
      state: state,
      district: district,
      category: category,
      phone_1: phone_1,
      email: email,
      phone_2: phone_2,
      address: address,
      pincode: pincode || pin_code,
      comment: comment,
      description: description,
      source_link: source_link,
      quantity_available: quantity_available,
      price: price,
      created_by: created_by,
      created_on: created_on,
      verified_by: verified_by,
      last_verified_on: last_verified_on,
      verification_status: verification_status,
      assigned_to: e["Assigned_to"] || assigned_to,
      hospital_available_icu_beds: hospital_available_icu_beds,
      hospital_available_normal_beds: hospital_available_normal_beds,
      hospital_available_oxygen_beds: hospital_available_oxygen_beds,
      hospital_available_ventilator_beds: hospital_available_ventilator_beds,
      latitude: latitude,
      longitude: longitude,
      downvotes: downvotes,
      upvotes: upvotes,
      is_duplicate: is_duplicate,
 }

cc: @bodhi @Vignesh