mirror of
https://github.com/hoshikawa2/compass_backoffice.git
synced 2026-07-09 13:54:20 +00:00
67 lines
1.8 KiB
Python
67 lines
1.8 KiB
Python
# /compass_backoffice/legacy_backend/
|
|
# uvicorn mock_imdb_server:app --port 8011
|
|
|
|
from fastapi import FastAPI, Request
|
|
|
|
app = FastAPI(title="Mock IMDB TIM")
|
|
|
|
@app.get("/access/v1/info")
|
|
async def get_access_info(request: Request):
|
|
return {
|
|
"cpfCnpj": request.query_params.get("cpfCnpj") or "06252533106",
|
|
"msisdn": request.query_params.get("msisdn") or "62981152324",
|
|
"plan": {
|
|
"Type": "POS_PAGO",
|
|
"name": "TIM Black Família 50GB"
|
|
},
|
|
"customer": {
|
|
"segment": "consumer",
|
|
"status": "active",
|
|
"contumazCustomer": False,
|
|
"odcCustomer": False
|
|
},
|
|
"contracts": [
|
|
{
|
|
"contractId": "mock-contract-001",
|
|
"status": "active",
|
|
"product": "Celular Pós-pago"
|
|
}
|
|
]
|
|
}
|
|
|
|
@app.get("/access/v1/info/{msisdn}")
|
|
async def get_access_info_by_msisdn(msisdn: str):
|
|
return {
|
|
"msisdn": msisdn,
|
|
"cpfCnpj": "06252533106",
|
|
"plan": {
|
|
"Type": "POS_PAGO",
|
|
"name": "TIM Black Família 50GB"
|
|
},
|
|
"customer": {
|
|
"segment": "consumer",
|
|
"status": "active",
|
|
"contumazCustomer": False,
|
|
"odcCustomer": False
|
|
}
|
|
}
|
|
|
|
from uuid import uuid4
|
|
|
|
@app.post("/customers/v1/backOfficeSRopening")
|
|
async def backoffice_sr_opening(payload: dict):
|
|
protocol = f"SR-MOCK-{uuid4().hex[:8].upper()}"
|
|
|
|
return {
|
|
"status": "success",
|
|
"interactionProtocol": protocol,
|
|
"crmProtocol": protocol,
|
|
"fieldsToUpdate": {
|
|
"status": "Aberto",
|
|
"reason": "Mock Siebel SR Opening"
|
|
},
|
|
"case_response": {
|
|
"message": "Chamado Siebel aberto com sucesso no mock"
|
|
},
|
|
"transitions": []
|
|
} |