File size: 2,417 Bytes
e4667e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Envirolytics Manual Testing Guide (Postman)

Base URL: `http://localhost:8000`

## 1. Live Status & Source Attribution
**Endpoint:** `GET /api/live-status`
- **Output:** Raw Air Quality Data.

**Endpoint:** `GET /api/analysis/source-attribution`
- **Output:**
  ```json
  {
      "analysis_type": "SOURCE_ATTRIBUTION",
      "primary_source": "INDUSTRY",
      "confidence_scores": { "INDUSTRY": 0.8, "TRAFFIC": 0.2 },
      "message": "The model attributes the current pollution profile mostly to INDUSTRY."
  }
  ```

---

## 2. Green QR (Multi-Mode)
**Endpoint:** `POST /api/enforce/green-qr`

### Scenario A: Metro Reward (50 Credits)
- **Body (JSON):**
  ```json
  {
      "user_gps": [28.6139, 77.2090],
      "station_gps": [28.6140, 77.2090],
      "transport_mode": "METRO"
  }
  ```
- **Expected Output:** `"credits_earned": 50`

### Scenario B: Carpool (20 Credits)
- **Body (JSON):**
  ```json
  {
      "user_gps": [28.6139, 77.2090],
      "station_gps": [28.6140, 77.2090],
      "transport_mode": "CARPOOL"
  }
  ```
- **Expected Output:** `"credits_earned": 20`

---

## 3. Biomass Marketplace
**Endpoint:** `POST /api/marketplace/list-biomass`

### Scenario A: List Stubble
- **Body (JSON):**
  ```json
  {
      "farmer_id": "F_009",
      "biomass_type": "STUBBLE",
      "quantity_kg": 1000,
      "price_per_kg": 2.0,
      "gps": [30.5, 76.5],
      "contact_info": "Phone: 9999999999"
  }
  ```
- **Expected Output:** `"status": "LISTED"`

**Endpoint:** `GET /api/marketplace/browse`
- **Output:** List of active listings.

---

## 4. Industry Audit (Fraud Detection)
**Endpoint:** `POST /api/government/audit-industry`

### Scenario: Under-Reporting Fraud
Station says **200**, Industry says **10**.
- **Body (JSON):**
  ```json
  {
      "industry_id": "IND_LYING",
      "nearest_station_pm25": 200.0,
      "sensor_readings": {
          "pm25": 10.0, "no2": 20.0, "so2": 5.0, "co": 0.5, "wind": 2.5, "temp": 25.0
      }
  }
  ```
- **Expected Output:** `"audit_result": "POSSIBLE_UNDER_REPORTING"`

---

## 5. Farmer Subsidy (Double Dip Check)
**Endpoint:** `POST /api/enforce/farmer-subsidy`

### Scenario: Fraud Detected
Claiming sales but Satellite sees Fire.
- **Body (JSON):**
  ```json
  {
      "farmer_id": "FARM_FRAUD",
      "gps": [30.5, 76.5],
      "claimed_biomass_sold_kg": 500.0,
      "debug_fire_co": 5.0
  }
  ```
- **Expected Output:** `"status": "FRAUD_DETECTED"`