Surveys API =========== Surveys ------- .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/surveys/`` - GET - central_ops, field_team (assigned only) - List surveys. Filters: ``status``, ``scheduled_date``, ``team``, ``zone`` * - ``/api/v1/surveys/`` - POST - central_ops - Create survey from lead. Body: ``{lead, scheduled_date, scheduled_time_slot}`` * - ``/api/v1/surveys/{id}/`` - GET - central_ops, field_team (assigned) - Get survey detail with assignments, report, media * - ``/api/v1/surveys/{id}/`` - PATCH - central_ops - Update survey: scheduled_date, scheduled_time_slot, status * - ``/api/v1/surveys/{id}/assign/`` - POST - central_ops - Assign team to survey. Body: ``{team}`` * - ``/api/v1/surveys/{id}/confirm/`` - POST - central_ops - Mark customer confirmed. Updates ``customer_confirmed=True`` * - ``/api/v1/surveys/calendar/`` - GET - central_ops, field_team - Calendar view: surveys grouped by date. Filters: ``date_from``, ``date_to``, ``zone`` Survey Reports -------------- .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/surveys/{id}/report/`` - GET - central_ops, field_team (assigned) - Get survey report * - ``/api/v1/surveys/{id}/report/`` - POST - field_team (assigned) - Submit survey report. Body: ``{site_ready, load_adequate, earthing_present, civil_work_needed, civil_work_details, electrical_notes, general_notes}`` * - ``/api/v1/surveys/{id}/report/review/`` - POST - central_ops - Review report. Body: ``{review_status, review_notes}`` (approve or reject) Survey Media ------------ .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/surveys/{id}/media/`` - GET - central_ops, field_team (assigned) - List survey media files * - ``/api/v1/surveys/{id}/media/`` - POST - field_team (assigned) - Upload media. Body (multipart): ``{media_type, file, caption}`` * - ``/api/v1/surveys/{id}/media/{media_id}/`` - DELETE - central_ops - Remove media file