Agranelos BFF - Endpoints Mapping

Azure Functions to BFF Endpoints

Products (Implemented)

Azure Function                    →  BFF Endpoint
─────────────────────────────────────────────────────────
GET  /productos                   →  GET  /api/productos
GET  /productos/{id}              →  GET  /api/productos/{id}
POST /productos                   →  POST /api/productos
PUT  /productos/{id}              →  PUT  /api/productos/{id}
DELETE /productos/{id}            →  DELETE /api/productos/{id}

Warehouses (Implemented + Enhanced)

Azure Function                    →  BFF Endpoint
─────────────────────────────────────────────────────────
GET  /bodegas                     →  GET  /api/bodegas
GET  /bodegas/{id}                →  GET  /api/bodegas/{id}
GET  /bodegas/{id}/productos      →  GET  /api/bodegas/{id}/productos    [NEW]
POST /bodegas                     →  POST /api/bodegas
PUT  /bodegas/{id}                →  PUT  /api/bodegas/{id}
DELETE /bodegas/{id}              →  DELETE /api/bodegas/{id}            [ENHANCED]
                                      - Parameter: ?force=true          [NEW]
                                      - Automatic validation           [NEW]
                                      - Product impact response        [NEW]

GraphQL (Implemented)

Azure Function                    →  BFF Endpoint
─────────────────────────────────────────────────────────
POST /graphql                     →  GET  /api/graphql (info)
                                  →  POST /api/graphql (query)

Other Azure Functions Endpoints

Endpoint                          Status
─────────────────────────────────────────────────────────
POST /init (InitializeDatabase)   Not exposed in BFF (internal operation)

Files Created

agranelos-bff/
├── src/main/java/com/agranelos/bff/
│   ├── controller/
│   │   ├── BodegaController.java           [CREATED]
│   │   ├── GraphQLController.java          [CREATED]
│   │   └── ProductoController.java         [EXISTING]
│   └── dto/
│       ├── BodegaDto.java                  [CREATED]
│       ├── BodegaEliminacionResponseDto.java [CREATED]
│       ├── GraphQLRequestDto.java          [CREATED]
│       └── ProductoDto.java                [EXISTING]
├── docs/                                   [CREATED]
└── Agranelos-BFF.postman_collection.json   [UPDATED]

Implementation Statistics

New Functionalities (October 2025)

Implementation Status: COMPLETE

All Azure Functions endpoints are now available through the BFF with enhanced warehouse management capabilities.