Which part of SahiDawa needs improvement?
Backend API (apps/api/src/routes/reports.ts) & Frontend wizard (apps/web/components/reports/ReportWizard.tsx)
Description
There is a functional disconnect between scanning a suspicious medicine and filing a counterfeit report:
- When a user reports a batch using
POST /api/verify/batch/report, it associates the report with scanned_barcode and medicine_id (by resolving the batch number), but doesn't take images, descriptions, state details, etc.
- When a user reports an incident via the Report Wizard (
POST /api/reports), they can add description, pharmacy details, and images, but POST /api/reports schema and logic completely ignores scanned_barcode and medicine_id.
If a user gets a suspicious result in the medicine scanner and clicks "Report", the system cannot link the scanned barcode or database medicine entry to the final incident report.
Detailed Implementation Guidance
1. Backend Route (apps/api/src/routes/reports.ts)
- Locate
createReportSchema in reports.ts. Extend it with two new optional fields:
scannedBarcode: z.string().optional()
medicineId: z.string().uuid().optional()
- Update the SQL payload inside
supabase.from("counterfeit_reports").insert({...}) to parse and store scanned_barcode and medicine_id columns:
scanned_barcode: data.scannedBarcode ?? null,
medicine_id: data.medicineId ?? null,
2. Frontend Wizard (apps/web/components/reports/ReportWizard.tsx)
- Check if the URL contains query parameters
barcode or medicineId when the user enters the reporting workflow from a scan details screen.
- Store these properties in the wizard component's state.
- Include
scannedBarcode and medicineId in the JSON request payload when sending the report data to the POST /api/reports endpoint on submission.
GSSoC 2026
To get assigned, please reply with your planned approach. Keep it clean and avoid spamming.
⚠️ Contributor Instructions (Please Read Carefully)
- Do NOT spam "/assign" or "Please assign me".
- To claim this task, you MUST reply with a brief proposed implementation plan/approach. What files will you touch? How will you solve it?
- Once your approach is reviewed and approved by a maintainer, you will be officially assigned.
- Any PR opened without prior assignment and approach approval will be closed.
Which part of SahiDawa needs improvement?
Backend API (
apps/api/src/routes/reports.ts) & Frontend wizard (apps/web/components/reports/ReportWizard.tsx)Description
There is a functional disconnect between scanning a suspicious medicine and filing a counterfeit report:
POST /api/verify/batch/report, it associates the report withscanned_barcodeandmedicine_id(by resolving the batch number), but doesn't take images, descriptions, state details, etc.POST /api/reports), they can add description, pharmacy details, and images, butPOST /api/reportsschema and logic completely ignoresscanned_barcodeandmedicine_id.If a user gets a suspicious result in the medicine scanner and clicks "Report", the system cannot link the scanned barcode or database medicine entry to the final incident report.
Detailed Implementation Guidance
1. Backend Route (
apps/api/src/routes/reports.ts)createReportSchemainreports.ts. Extend it with two new optional fields:scannedBarcode:z.string().optional()medicineId:z.string().uuid().optional()supabase.from("counterfeit_reports").insert({...})to parse and storescanned_barcodeandmedicine_idcolumns:2. Frontend Wizard (
apps/web/components/reports/ReportWizard.tsx)barcodeormedicineIdwhen the user enters the reporting workflow from a scan details screen.scannedBarcodeandmedicineIdin the JSON request payload when sending the report data to thePOST /api/reportsendpoint on submission.GSSoC 2026
To get assigned, please reply with your planned approach. Keep it clean and avoid spamming.