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
|
||||
from typing import List
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import field_validator
|
||||
|
||||
@@ -62,7 +62,7 @@ class NotifyReceivedBillRequestSchema(BaseSchema):
|
||||
|
||||
class CreateBillingResponseSchema(BaseSchema):
|
||||
ok: bool
|
||||
|
||||
message:Optional[str]
|
||||
|
||||
class NotifyReceivedBillResponseSchema(BaseSchema):
|
||||
ok: bool
|
||||
|
||||
@@ -154,6 +154,9 @@ class BillingService(BaseService):
|
||||
billing_request_values: List[CreateBillingRequestValue] = []
|
||||
|
||||
for service in services.values():
|
||||
# Omit services that have no price
|
||||
if not service.price:
|
||||
continue
|
||||
billing_request_values.append(
|
||||
CreateBillingRequestValue(
|
||||
name=service.name,
|
||||
@@ -178,7 +181,7 @@ class BillingService(BaseService):
|
||||
)
|
||||
create_bill_response = await billing_client.create(create_bill_request)
|
||||
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:
|
||||
await self.create_group_bill_request(basic_card.group)
|
||||
|
||||
Reference in New Issue
Block a user