feat: phone regex fix
This commit is contained in:
4
external/billing/schemas.py
vendored
4
external/billing/schemas.py
vendored
@@ -1,5 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
from typing import List
|
from typing import List, Optional
|
||||||
|
|
||||||
from pydantic import field_validator
|
from pydantic import field_validator
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ class NotifyReceivedBillRequestSchema(BaseSchema):
|
|||||||
|
|
||||||
class CreateBillingResponseSchema(BaseSchema):
|
class CreateBillingResponseSchema(BaseSchema):
|
||||||
ok: bool
|
ok: bool
|
||||||
|
message:Optional[str]
|
||||||
|
|
||||||
class NotifyReceivedBillResponseSchema(BaseSchema):
|
class NotifyReceivedBillResponseSchema(BaseSchema):
|
||||||
ok: bool
|
ok: bool
|
||||||
|
|||||||
@@ -154,6 +154,9 @@ class BillingService(BaseService):
|
|||||||
billing_request_values: List[CreateBillingRequestValue] = []
|
billing_request_values: List[CreateBillingRequestValue] = []
|
||||||
|
|
||||||
for service in services.values():
|
for service in services.values():
|
||||||
|
# Omit services that have no price
|
||||||
|
if not service.price:
|
||||||
|
continue
|
||||||
billing_request_values.append(
|
billing_request_values.append(
|
||||||
CreateBillingRequestValue(
|
CreateBillingRequestValue(
|
||||||
name=service.name,
|
name=service.name,
|
||||||
@@ -178,7 +181,7 @@ class BillingService(BaseService):
|
|||||||
)
|
)
|
||||||
create_bill_response = await billing_client.create(create_bill_request)
|
create_bill_response = await billing_client.create(create_bill_request)
|
||||||
if not create_bill_response.ok:
|
if not create_bill_response.ok:
|
||||||
return CreateCardBillResponse(ok=create_bill_response.ok, message='Ошибка!')
|
return CreateCardBillResponse(ok=create_bill_response.ok, message=create_bill_response.message or 'Неизвестная ошибка')
|
||||||
|
|
||||||
if basic_card.group:
|
if basic_card.group:
|
||||||
await self.create_group_bill_request(basic_card.group)
|
await self.create_group_bill_request(basic_card.group)
|
||||||
|
|||||||
Reference in New Issue
Block a user