Procurement API =============== Materials --------- .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/materials/`` - GET - procurement, central_ops - List material catalog. Filters: ``category``, ``search`` * - ``/api/v1/materials/`` - POST - procurement - Add material to catalog. Body: ``{name, sku, category, unit, description}`` * - ``/api/v1/materials/{id}/`` - GET - procurement, central_ops - Get material detail with stock levels per zone * - ``/api/v1/materials/{id}/`` - PATCH - procurement - Update material details * - ``/api/v1/materials/{id}/stock/`` - GET - procurement, central_ops - Get stock levels by zone for this material * - ``/api/v1/materials/{id}/stock/`` - PATCH - procurement - Update stock for a zone. Body: ``{zone, quantity_available}`` Material Allocation ------------------- .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/installations/{id}/materials/`` - GET - procurement, central_ops - List materials allocated to an installation * - ``/api/v1/installations/{id}/materials/`` - POST - procurement - Allocate material. Body: ``{material, quantity}``. Auto-deducts from zone stock * - ``/api/v1/installations/{id}/materials/{alloc_id}/`` - PATCH - procurement - Update allocation status (dispatched, delivered, returned) Procurement Requests -------------------- .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/procurement-requests/`` - GET - procurement, central_ops - List requests. Filters: ``status``, ``installation``, ``vendor`` * - ``/api/v1/procurement-requests/`` - POST - procurement, central_ops - Create request. Body: ``{installation, material, quantity, estimated_cost}`` * - ``/api/v1/procurement-requests/{id}/`` - GET - procurement - Get request detail * - ``/api/v1/procurement-requests/{id}/`` - PATCH - procurement - Update: vendor, status, actual_cost Vendors ------- .. list-table:: :header-rows: 1 :widths: 30 10 20 40 * - Endpoint - Method - Permission - Description * - ``/api/v1/vendors/`` - GET - procurement, finance - List vendors. Filters: ``zone``, ``is_active`` * - ``/api/v1/vendors/`` - POST - procurement - Add vendor. Body: ``{name, phone, zone, upi_id, bank_account, bank_ifsc}`` * - ``/api/v1/vendors/{id}/`` - GET - procurement, finance - Get vendor detail * - ``/api/v1/vendors/{id}/`` - PATCH - procurement - Update vendor details