mirror of
https://github.com/hoshikawa2/compass_backoffice.git
synced 2026-07-09 13:54:20 +00:00
bugfixes
This commit is contained in:
62
legacy_backend/mock_imdb_server.py
Normal file
62
legacy_backend/mock_imdb_server.py
Normal file
@@ -0,0 +1,62 @@
|
||||
# /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
|
||||
}
|
||||
}
|
||||
|
||||
@app.post("/customers/v1/backOfficeSRopening")
|
||||
async def backoffice_sr_opening(payload: dict):
|
||||
return {
|
||||
"status": "success",
|
||||
"crmProtocol": "SR-MOCK-123456",
|
||||
"fieldsToUpdate": {
|
||||
"status": "Aberto",
|
||||
"reason": "Mock Siebel SR Opening"
|
||||
},
|
||||
"case_response": {
|
||||
"message": "Chamado Siebel aberto com sucesso no mock"
|
||||
},
|
||||
"transitions": []
|
||||
}
|
||||
Reference in New Issue
Block a user