32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
from app.eco.enums.transaction_type import TransactionType
|
|
from app.eco.services.base_service import BaseService
|
|
from app.eco.schemas.send_sms import SendSmsSchema
|
|
from marshmallow import ValidationError
|
|
from app.eco.helpers.response_helper import ResponseHelper
|
|
|
|
class SendSMSService(BaseService):
|
|
TRANSACTION_TYPE = TransactionType.SEND_SMS
|
|
|
|
@staticmethod
|
|
def process_request(data):
|
|
"""
|
|
Process the SMS sending request.
|
|
|
|
Args:
|
|
data (dict): The request data.
|
|
|
|
Returns:
|
|
dict: A standardized response.
|
|
"""
|
|
try:
|
|
validated_data = SendSMSService.validate_data(data, SendSmsSchema())
|
|
|
|
response_data = {
|
|
"undelivered": []
|
|
}
|
|
return ResponseHelper.success(data=response_data)
|
|
except ValidationError as err:
|
|
return ResponseHelper.unprocessable_entity(result_description="Validation exception")
|
|
except Exception as e:
|
|
return ResponseHelper.internal_server_error()
|