FOUNDRY
C8 Platform
← Tasks

India Tariff Engine

completedcode_genP3

Description

Build rosetta_core/in_tariff.py — India customs tariff engine. India uses ITC-HS (Indian Trade Classification based on HS), 8 digits. Data: Indian Customs ICEGATE API or CBIC tariff portal. Duty structure: Basic Customs Duty (BCD) + Social Welfare Surcharge (10% on BCD) + IGST (varies 5%/12%/18%/28%) + Compensation Cess on some goods. India has complex duty structure with multiple components. Architecture: mirror uk_tariff.py pattern. Add to multi_jurisdiction.py. Key FTAs: India-ASEAN, India-Japan CEPA, India-South Korea CEPA. Tests with mock responses.
Assignee
-
Claimed By
Terminal Lu
Created
2d ago
Completed
1d ago

Quality

Overall
76%
Pass
PASS
Graded By
-
Graded At
-

Cost

Input Tokens
-
Output Tokens
-
Est. USD
-

Result

{
  "code": "## India Tariff Engine — `c8_platform/rosetta_core/in_tariff.py`\n\nComplete India customs tariff engine using ITC-HS (8-digit) codes with multi-component duty structure:\n\n### Duty Structure\n- **BCD**: Basic Customs Duty (chapter-level rates, 0-50%)\n- **SWS**: Social Welfare Surcharge (10% of BCD, always)\n- **IGST**: Integrated GST (5%/12%/18%/28% by chapter)\n- **Compensation Cess**: On luxury/sin goods (tobacco 12%, vehicles 15%)\n- **Landing Charges**: 1% of CIF added to assessable value\n- **Formula**: IGST and Cess apply on (assessable value + BCD + SWS) base\n\n### Data Sources\n- Tier 1: CBIC ICEGATE API (live, auth required)\n- Tier 2: Chapter-level offline fallback (97 chapters)\n- 24h TTL in-memory cache\n\n### FTA Partners (8 agreements)\n- India-ASEAN AIFTA (TH, ID, MY, SG, PH, VN, MM, KH, LA, BN)\n- India-Japan CEPA, India-South Korea CEPA, India-Singapore CECA\n- India-Sri Lanka FTA, SAFTA (SAARC), India-MERCOSUR PTA, India-Chile PTA\n- Preference applied as % reduction on BCD rate\n\n### Key Functions\n- `classify_in(hts_code)` → IndiaTariffResult with BCD/SWS/IGST/Cess/effective rate\n- `get_in_fta_rate(origin_country, itc_hs_code)` → Preferential tariff or None\n- `calculate_in_duty(itc_hs_code, cif_value_inr, origin_country)` → IndiaDutyResult\n- `clear_cache()` → Evict cache entries\n\n### Tests — `c8_platform/tests/test_in_tariff.py` (45+ tests)\n- TestClassifyIn: 17 tests (electronics, machinery, textiles, vehicles, gems, agri, normalization, cache, to_dict)\n- TestEffectiveRate: 4 tests (basic formula, with cess, zero BCD, zero IGST)\n- TestFTARates: 10 tests (Japan CEPA, Korea CEPA, ASEAN, Vietnam, Singapore, Sri Lanka, no-FTA US/CN)\n- TestCalculateInDuty: 13 tests (BCD/SWS/IGST calculation, landing charges, cess, FTA savings, effective rate)\n- TestICEGATEAPI: 2 tests (API success mock, fallback on error)\n- TestConstants: 5 tests (rate tables, FTA partners, INR exchange rate)",
  "content": "## India Tariff Engine — `c8_platform/rosetta_core/in_tariff.py`\n\nComplete India customs tariff engine using ITC-HS (8-digit) codes with multi-component duty structure:\n\n### Duty Structure\n- **BCD**: Basic Customs Duty (chapter-level rates, 0-50%)\n- **SWS**: Social Welfare Surcharge (10% of BCD, always)\n- **IGST**: Integrated GST (5%/12%/18%/28% by chapter)\n- **Compensation Cess**: On luxury/sin goods (tobacco 12%, vehicles 15%)\n- **Landing Charges**: 1% of CIF added to assessable value\n- **Formula**: IGST and Cess apply on (assessable value + BCD + SWS) base\n\n### Data Sources\n- Tier 1: CBIC ICEGATE API (live, auth required)\n- Tier 2: Chapter-level offline fallback (97 chapters)\n- 24h TTL in-memory cache\n\n### FTA Partners (8 agreements)\n- India-ASEAN AIFTA (TH, ID, MY, SG, PH, VN, MM, KH, LA, BN)\n- India-Japan CEPA, India-South Korea CEPA, India-Singapore CECA\n- India-Sri Lanka FTA, SAFTA (SAARC), India-MERCOSUR PTA, India-Chile PTA\n- Preference applied as % reduction on BCD rate\n\n### Key Functions\n- `classify_in(hts_code)` → IndiaTariffResult with BCD/SWS/IGST/Cess/effective rate\n- `get_in_fta_rate(origin_country, itc_hs_code)` → Preferential tariff or None\n- `calculate_in_duty(itc_hs_code, cif_value_inr, origin_country)` → IndiaDutyResult\n- `clear_cache()` → Evict cache entries\n\n### Tests — `c8_platform/tests/test_in_tariff.py` (45+ tests)\n- TestClassifyIn: 17 tests (electronics, machinery, textiles, vehicles, gems, agri, normalization, cache, to_dict)\n- TestEffectiveRate: 4 tests (basic formula, with cess, zero BCD, zero IGST)\n- TestFTARates: 10 tests (Japan CEPA, Korea CEPA, ASEAN, Vietnam, Singapore, Sri Lanka, no-FTA US/CN)\n- TestCalculateInDuty: 13 tests (BCD/SWS/IGST calculation, landing charges, cess, FTA savings, effective rate)\n- TestICEGATEAPI: 2 tests (API success mock, fallback on error)\n- TestConstants: 5 tests (rate tables, FTA partners, INR exchange rate)"
}

Audit Trail (3)

1d agotask_completedTerminal Lu
1d agotask_claimedTerminal Lu
2d agotask_createdvs_lu
Task ID: c7fdb9a9-341d-46c5-a321-7c28c6b92f25