freelancing-solutions / gcp-database-as-a-service-stock-markets

GCP NDB database as a service for a stock market investment and social web services.
MIT License
3 stars 1 forks source link

Send response here #543

Open freelancing-solutions opened 3 years ago

freelancing-solutions commented 3 years ago

Send response here

https://github.com/freelancing-solutions/gcp-database-as-a-service-stock-markets/blob/0a8e5279855e00c4bb85401215034f33a57fa091/data_service/views/helpdesk.py#L394


                            'message': 'successfully updated ticket'}), 200
        return jsonify({'status': False, 'message': 'Unable to find ticket'}), 500

    @use_context
    @handle_view_errors
    async def send_sms_notification_async(self, ticket_id: str, subject: str, message: str) -> tuple:
        """
            find ticket send notification update ticket to reflect that notification was sent
        """
        ticket_instance: Ticket = Ticket.query(Ticket.ticket_id == ticket_id).get_async().get_result()
        if isinstance(ticket_instance, Ticket):
            ticket_instance.response_sent = True
            key = ticket_instance.put_async().get_result()
            # TODO Send response here
            if key is None:
                return jsonify({'status': False, 'message': 'General error updating database'}), 500
            return jsonify({'status': True, 'payload': ticket_instance.to_dict(),
                            'message': 'successfully updated ticket'}), 200
        return jsonify({'status': False, 'message': 'Unable to find ticket'}), 500

    @use_context
    @handle_view_errors
    def add_response(self, ticket_id: str, subject: str, message: str) -> tuple:

4af22489d6724c5c4fcd9182a96e9c4c0c1fcfa4