mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
add inbound sms api
two endpoints: * get all inbound sms for a service (you can limit to the X most recent, or filter by user's phone number [which will be normalised]) * get a summary of inbound sms for a service - returns the count of inbound sms in the database, and the date that the most recent was sent
This commit is contained in:
@@ -1175,6 +1175,18 @@ class InboundSms(db.Model):
|
||||
def content(self, content):
|
||||
self._content = encryption.encrypt(content)
|
||||
|
||||
def serialize(self):
|
||||
return {
|
||||
'id': str(self.id),
|
||||
'created_at': self.created_at.isoformat(),
|
||||
'service_id': str(self.service_id),
|
||||
'notify_number': self.notify_number,
|
||||
'user_number': self.user_number,
|
||||
'content': self.content,
|
||||
'provider_date': self.provider_date and self.provider_date.isoformat(),
|
||||
'provider_reference': self.provider_reference
|
||||
}
|
||||
|
||||
|
||||
class LetterRate(db.Model):
|
||||
__tablename__ = 'letter_rates'
|
||||
|
||||
Reference in New Issue
Block a user