[PlantUML] Интеграция с АСБ
1. Создание задачи на создание заказа (CREATE_NEW_LETTER)
flowchart LR
subgraph LetterService
process(createLetter) --> addTask(addTaskToQueue)
end
subgraph LetterController
request(createLetter) --> process
validate{validateRequest}
end
validate -->|False| failValidate
validate -->|True| request
subgraph AuthService
auth{authByJwtToken}
end
auth -->|False| failAuth
auth -->|True| validate
subgraph QueueService
newTask{{addTask\nCREATE_NEW_LETTER}}
end
start([POST\n/api/v1/letter]) --> auth
failAuth([401 Unautorized])
failValidate([400 Bad Request])
addTask --> newTask --> success([201 Created])
2. Обработка задачи создания заказа (CREATE_NEW_LETTER)
flowchart LR
subgraph amoCrmApiService
getLeadById(getLeadById)
getContactById(getContactById)
end
subgraph asbApiService
createAsbOrder([createOrder])
end
subgraph databaseService
createLeadToLetterLink[(createLeadToLetterLink)]
end
createLeadToLetterLink --> success([END])
subgraph LetterService
createLetter(createLetter)
createLetter <-.-> getLeadById
createLetter <-.-> getContactById
createLetter .-> mapLetter([mapLetter])
mapLetter .-> createAsbOrder .-> createLetter
createLetter --> createLeadToLetterLink
end
start{{subscribeTask\nCREATE_NEW_LETTER}} --> createLetter
Edited by Pavel Kupreev