diff --git a/TwilioSMSReceiver.Common/Interfaces/IMessageHandler.cs b/TwilioSMSReceiver.Common/Interfaces/IMessageHandler.cs
index cf9472d..8ff4a4b 100644
--- a/TwilioSMSReceiver.Common/Interfaces/IMessageHandler.cs
+++ b/TwilioSMSReceiver.Common/Interfaces/IMessageHandler.cs
@@ -2,8 +2,18 @@
namespace TwilioSMSReceiver.Common.Interfaces
{
+ ///
+ /// The main code where we send all SMS data and translate it accordingly
+ ///
public interface IMessageHandler
{
+ ///
+ /// The main relay SMS code
+ ///
+ /// Parsed model of the SMS Message
+ /// True if it succeeded, false if it didn't relay successfully
+ /// Returned if the code is loaded, but not actually implemented
+ /// All generic exceptions are returned here
public Task RelaySms(SMSModel model);
}
}
diff --git a/TwilioSMSReceiver.Data/Models/SMSModel.cs b/TwilioSMSReceiver.Data/Models/SMSModel.cs
index 4016810..ae7ea97 100644
--- a/TwilioSMSReceiver.Data/Models/SMSModel.cs
+++ b/TwilioSMSReceiver.Data/Models/SMSModel.cs
@@ -6,18 +6,38 @@ using System.ComponentModel.DataAnnotations;
namespace TwilioSMSReceiver.Data.Models
{
+ ///
+ /// The SMS Model
+ ///
public class SMSModel
{
[Key]
public int Id { get; set; }
+ ///
+ /// Where the SMS/MMS Message was directed to
+ ///
[Required]
public string ReceivedNumber { get; set; }
-
+ ///
+ /// Where the SMS/MMS Message was sent from
+ ///
[Required]
public string SenderNumber { get; set; }
+ ///
+ /// When the message was received
+ ///
public DateTime TimeReceived { get; set; }
+ ///
+ /// Contents of the SMS message
+ ///
public string? MessageContents { get; set; }
+ ///
+ /// MMS Content if any
+ ///
public ICollection MMSContent { get; set; }
+ ///
+ /// Has this message been processed - currently always false as we don't have background processing just yet
+ ///
public bool IsForwardedYet { get; set; }
}
@@ -25,14 +45,23 @@ namespace TwilioSMSReceiver.Data.Models
{
[Key]
public int Id { get; set; }
+ ///
+ /// Foreign key of the SMS Message
+ ///
public int SMSModelId { get; set; }
public SMSModel ParentSMSMessage { get; set; }
+ ///
+ /// URL of the MMS Data
+ ///
public string OriginalMMSData { get; set; }
}
public class MSTeamsWebHook
{
public int Id { get; set; }
+ ///
+ /// Where we sent the message to
+ ///
public string WebHookUri { get; set; }
}
}
diff --git a/TwilioSMSReceiver.Data/SMSDbCtx.cs b/TwilioSMSReceiver.Data/SMSDbCtx.cs
index 66522c5..24fc06e 100644
--- a/TwilioSMSReceiver.Data/SMSDbCtx.cs
+++ b/TwilioSMSReceiver.Data/SMSDbCtx.cs
@@ -1,16 +1,33 @@
using Microsoft.EntityFrameworkCore;
+using System;
using TwilioSMSReceiver.Data.Models;
namespace TwilioSMSReceiver.Data
{
+ ///
+ /// The database context
+ ///
public class SMSDbCtx : DbContext
{
+ ///
+ /// The main DB Context base constructor for this database context
+ ///
+ /// The usual options for EF Core Database if called outside of a DI Scope
+ [Obsolete("Don't call this directly unless you're calling it from EF Core")]
public SMSDbCtx(DbContextOptions options) : base(options)
{
}
-
+ ///
+ /// Received SMS Messages
+ ///
public DbSet SMSMessages { get; set; }
+ ///
+ /// Received MMS Message data
+ ///
public DbSet MMSMessages { get; set; }
+ ///
+ /// Teams WebHooks we should be spamming to
+ ///
public DbSet MSTeamsWebHooks { get; set; }
}
}