-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send friendly messages if cant acquire counteragent (#28)
* Diadoc client: add code and message to diadoc http exception * Diadoc client: 1. Migrate to updated APIs 2. Capture acquire ca errors differently: - 409 errors as expected ones as simple messages - the left ones as exceptions * Update TinkoffToDiadoc service to support updated diadoc client
- Loading branch information
Showing
18 changed files
with
165 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from typing import Literal, TypedDict | ||
|
||
|
||
class Box(TypedDict): | ||
"""https://developer.kontur.ru/docs/diadoc-api/proto/Box.html""" | ||
|
||
BoxId: str # exists in response, but not used — according to docs BoxIdGuid should be used as boxId param | ||
Title: str | ||
BoxIdGuid: str | ||
|
||
|
||
class Organization(TypedDict): | ||
"""https://developer.kontur.ru/docs/diadoc-api/proto/Organization.html""" | ||
|
||
ShortName: str | ||
Inn: str | ||
Kpp: str | ||
OrgId: str | ||
Boxes: list[Box] # boxes contains one and only one box | ||
IsActive: bool | ||
IsRoaming: bool | ||
|
||
|
||
CounteragentStatus = Literal[ | ||
"UnknownCounteragentStatus", | ||
"IsMyCounteragent", | ||
"InvitesMe", | ||
"IsInvitedByMe", | ||
"RejectsMe", | ||
"IsRejectedByMe", | ||
"NotInCounteragentList", | ||
] | ||
|
||
|
||
class Counteragent(TypedDict): | ||
"""https://developer.kontur.ru/docs/diadoc-api/proto/Counteragent.html""" | ||
|
||
IndexKey: str | ||
Organization: Organization | ||
CurrentStatus: CounteragentStatus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.