diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000..6c28040b
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,8 @@
+version: 2
+
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ target-branch: "develop"
+ schedule:
+ interval: "weekly"
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index b59e8c46..4e796cf4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -194,3 +194,113 @@ Common/resgrid.local.pfx
Web/Resgrid.Web.ServicesCore/Properties/serviceDependencies.json
Web/Resgrid.Web.ServicesCore/Properties/serviceDependencies.local.json
Web/Resgrid.Web.ServicesCore/Properties/ServiceDependencies/local/appInsights1.arm.json
+
+Docker/docker-data/dms/mail-state/lib-clamav/bytecode.cvd
+
+Docker/docker-data/dms/mail-state/lib-clamav/daily.cvd
+
+Docker/docker-data/dms/mail-state/lib-clamav/freshclam.dat
+
+Docker/docker-data/dms/mail-state/lib-clamav/main.cvd
+Docker/docker-data/dms/config/dovecot-quotas.cf
+Docker/docker-data/dms/config/mailconfig
+Docker/docker-data/dms/config/postfix-aliases.cf
+Docker/docker-data/dms/mail-data/maildata
+Docker/docker-data/dms/mail-logs/maillogs
+Docker/docker-data/dms/mail-state/mailstate
+Docker/docker-data/dms/mail-state/lib-amavis/.razor/identity
+Docker/docker-data/dms/mail-state/lib-amavis/.razor/identity-ruYtA-SdhH
+Docker/docker-data/dms/mail-state/lib-amavis/.razor/server.n001.cloudmark.com.conf
+Docker/docker-data/dms/mail-state/lib-amavis/.razor/server.n004.cloudmark.com.conf
+Docker/docker-data/dms/mail-state/lib-amavis/.razor/servers.catalogue.lst
+Docker/docker-data/dms/mail-state/lib-amavis/.razor/servers.discovery.lst
+Docker/docker-data/dms/mail-state/lib-amavis/.razor/servers.nomination.lst
+Docker/docker-data/dms/mail-state/lib-spamassassin/sa-update-keys/pubring.kbx
+Docker/docker-data/dms/mail-state/lib-spamassassin/sa-update-keys/trustdb.gpg
+Docker/docker-data/sql/backup/sqlbackups
+Docker/docker-data/sql/data/Entropy.bin
+Docker/docker-data/sql/data/master.mdf
+Docker/docker-data/sql/data/mastlog.ldf
+Docker/docker-data/sql/data/model_msdbdata.mdf
+Docker/docker-data/sql/data/model_msdblog.ldf
+Docker/docker-data/sql/data/model_replicatedmaster.ldf
+Docker/docker-data/sql/data/model_replicatedmaster.mdf
+Docker/docker-data/sql/data/model.mdf
+Docker/docker-data/sql/data/modellog.ldf
+Docker/docker-data/sql/data/msdbdata.mdf
+Docker/docker-data/sql/data/msdblog.ldf
+Docker/docker-data/sql/data/Resgrid_log.ldf
+Docker/docker-data/sql/data/Resgrid.mdf
+Docker/docker-data/sql/data/ResgridOIDC_log.ldf
+Docker/docker-data/sql/data/ResgridOIDC.mdf
+Docker/docker-data/sql/data/ResgridWorkers_log.ldf
+Docker/docker-data/sql/data/ResgridWorkers.mdf
+Docker/docker-data/sql/data/sqldata
+Docker/docker-data/sql/data/tempdb.mdf
+Docker/docker-data/sql/data/templog.ldf
+Docker/docker-data/sql/log/errorlog
+Docker/docker-data/sql/log/errorlog.1
+Docker/docker-data/sql/log/errorlog.2
+Docker/docker-data/sql/log/errorlog.3
+Docker/docker-data/sql/log/errorlog.4
+Docker/docker-data/sql/log/errorlog.5
+Docker/docker-data/sql/log/errorlog.6
+Docker/docker-data/sql/log/errorlog.7
+Docker/docker-data/sql/log/errorlog.8
+Docker/docker-data/sql/log/errorlog.9
+Docker/docker-data/sql/log/errorlog.10
+Docker/docker-data/sql/log/errorlog.11
+Docker/docker-data/sql/log/errorlog.12
+Docker/docker-data/sql/log/errorlog.13
+Docker/docker-data/sql/log/errorlog.14
+Docker/docker-data/sql/log/errorlog.15
+Docker/docker-data/sql/log/errorlog.16
+Docker/docker-data/sql/log/errorlog.17
+Docker/docker-data/sql/log/errorlog.18
+Docker/docker-data/sql/log/errorlog.19
+Docker/docker-data/sql/log/HkEngineEventFile_0_132921975549100000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922007317990000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922009309080000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922013218750000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922018741370000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922033212920000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922067366660000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922075764680000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922088137910000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922111474730000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922117751690000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922122624170000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922132763460000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922142267410000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922152684910000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922153785260000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922154586090000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922155443490000.xel
+Docker/docker-data/sql/log/HkEngineEventFile_0_132922211494070000.xel
+Docker/docker-data/sql/log/log_16.trc
+Docker/docker-data/sql/log/log_17.trc
+Docker/docker-data/sql/log/log_18.trc
+Docker/docker-data/sql/log/log_19.trc
+Docker/docker-data/sql/log/log_20.trc
+Docker/docker-data/sql/log/sqllogs
+Docker/docker-data/sql/log/system_health_0_132922111481530000.xel
+Docker/docker-data/sql/log/system_health_0_132922117759410000.xel
+Docker/docker-data/sql/log/system_health_0_132922122632370000.xel
+Docker/docker-data/sql/log/system_health_0_132922132771730000.xel
+Docker/docker-data/sql/log/system_health_0_132922142272820000.xel
+Docker/docker-data/sql/log/system_health_0_132922152690110000.xel
+Docker/docker-data/sql/log/system_health_0_132922153791210000.xel
+Docker/docker-data/sql/log/system_health_0_132922154593260000.xel
+Docker/docker-data/sql/log/system_health_0_132922155450540000.xel
+Docker/docker-data/sql/log/system_health_0_132922211502270000.xel
+Docker/docker-data/dms/config/mailconfig
+Docker/docker-data/dms/mail-data/maildata
+Docker/docker-data/dms/mail-logs/maillogs
+Docker/docker-data/dms/mail-state/mailstate
+Docker/docker-data/sql/backup/sqlbackups
+Docker/docker-data/sql/data/sqldata
+Docker/docker-data/sql/log/sqllogs
+Docker/docker-data/dms/config/mailconfig
+Docker/docker-data/dms/mail-data/maildata
+Docker/docker-data/dms/mail-logs/maillogs
+Docker/docker-data/dms/mail-state/mailstate
diff --git a/Core/Resgrid.Config/ExternalErrorConfig.cs b/Core/Resgrid.Config/ExternalErrorConfig.cs
index 4aba0eb6..9f150794 100644
--- a/Core/Resgrid.Config/ExternalErrorConfig.cs
+++ b/Core/Resgrid.Config/ExternalErrorConfig.cs
@@ -1,7 +1,15 @@
namespace Resgrid.Config
{
+ ///
+ /// Configuration for working with external error tracking systems like Elk and Sentry
+ ///
public static class ExternalErrorConfig
{
+ ///
+ /// The current operating enviorment for the code, i.e. prod, qa, dev
+ ///
+ public static string Environment = "dev";
+
#region Elk Settings
public static string ElkServiceUrl = "http://localhost:9200";
#endregion Elk Settings
@@ -9,6 +17,7 @@ public static class ExternalErrorConfig
#region Sentry Settings
public static string ExternalErrorServiceUrl = "";
public static string ExternalErrorServiceUrlForWebsite = "";
+ public static string ExternalErrorServiceUrlForWebjobs = "";
#endregion Sentry Settings
}
diff --git a/Core/Resgrid.Config/JwtConfig.cs b/Core/Resgrid.Config/JwtConfig.cs
new file mode 100644
index 00000000..141112b1
--- /dev/null
+++ b/Core/Resgrid.Config/JwtConfig.cs
@@ -0,0 +1,16 @@
+namespace Resgrid.Config
+{
+ ///
+ /// Config settings for JWT's used in the website and api
+ ///
+ public static class JwtConfig
+ {
+ public static string Key = "";
+
+ public static string Issuer = "resgrid.local";
+
+ public static string Audience = "resgrid.local";
+
+ public static int Duration = 30;
+ }
+}
diff --git a/Core/Resgrid.Config/OidcConfig.cs b/Core/Resgrid.Config/OidcConfig.cs
new file mode 100644
index 00000000..f02594e4
--- /dev/null
+++ b/Core/Resgrid.Config/OidcConfig.cs
@@ -0,0 +1,20 @@
+namespace Resgrid.Config
+{
+ ///
+ /// Configuration for OpenID Connect (https://documentation.openiddict.com/)
+ ///
+ public static class OidcConfig
+ {
+ public static string Key = "";
+
+ public static string ConnectionString = "Server=rgdevserver;Database=ResgridOIDC;User Id=resgrid_app;Password=resgrid123;MultipleActiveResultSets=True;";
+
+ public static int AccessTokenExpiryMinutes = 1440;
+
+ public static int RefreshTokenExpiryDays = 30;
+
+ public static string EncryptionCert = "";
+
+ public static string SigningCert = "";
+ }
+}
diff --git a/Core/Resgrid.Config/Resgrid.Config.csproj b/Core/Resgrid.Config/Resgrid.Config.csproj
index 9444a28e..e9742aba 100644
--- a/Core/Resgrid.Config/Resgrid.Config.csproj
+++ b/Core/Resgrid.Config/Resgrid.Config.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netstandard2.1
Resgrid.Config
Resgrid.Config
diff --git a/Core/Resgrid.Config/ServiceBusConfig.cs b/Core/Resgrid.Config/ServiceBusConfig.cs
index 31d3564e..b60c9187 100644
--- a/Core/Resgrid.Config/ServiceBusConfig.cs
+++ b/Core/Resgrid.Config/ServiceBusConfig.cs
@@ -12,6 +12,7 @@ public static class ServiceBusConfig
public static string EmailBroadcastQueueName = "resgridemails";
public static string SystemQueueName = "resgridsys";
public static string PaymentQueueName = "payment";
+ public static string AuditQueueName = "audit";
#region Azure Service Bus Values
public static string SignalRServiceBusConnectionString = "";
@@ -49,6 +50,8 @@ public static class ServiceBusConfig
#region RabbitMQ Bus Values
public static string RabbitHostname = "localhost";
+ public static string RabbitHostname2 = ""; // For 3 host cluster, node 2
+ public static string RabbitHostname3 = ""; // For 3 host cluster, node 3
public static string RabbitUsername = "guest";
public static string RabbbitPassword = "guest";
public static string RabbbitExchange = "";
diff --git a/Core/Resgrid.Config/SystemBehaviorConfig.cs b/Core/Resgrid.Config/SystemBehaviorConfig.cs
index d2198d55..11b0142e 100644
--- a/Core/Resgrid.Config/SystemBehaviorConfig.cs
+++ b/Core/Resgrid.Config/SystemBehaviorConfig.cs
@@ -107,6 +107,11 @@ public static class SystemBehaviorConfig
///
public static LinksProviderTypes LinkProviderType = LinksProviderTypes.Polr;
+ ///
+ /// Sets the type of voip provider to use
+ ///
+ public static VoipProviderTypes VoipProviderType = VoipProviderTypes.Kazoo;
+
///
/// Sets the type of sms provider to use
///
@@ -150,6 +155,11 @@ public static class SystemBehaviorConfig
///
public static string SiteKey = "";
+ ///
+ /// A notice to display on the login page
+ ///
+ public static string LoginPageNotice = "";
+
public static string GetEnvPrefix()
{
switch (Environment)
diff --git a/Core/Resgrid.Config/TelemetryConfig.cs b/Core/Resgrid.Config/TelemetryConfig.cs
new file mode 100644
index 00000000..1a01a24d
--- /dev/null
+++ b/Core/Resgrid.Config/TelemetryConfig.cs
@@ -0,0 +1,7 @@
+namespace Resgrid.Config
+{
+ public static class TelemetryConfig
+ {
+ public static string Exporter = "";
+ }
+}
diff --git a/Core/Resgrid.Config/VoipConfig.cs b/Core/Resgrid.Config/VoipConfig.cs
new file mode 100644
index 00000000..321ef811
--- /dev/null
+++ b/Core/Resgrid.Config/VoipConfig.cs
@@ -0,0 +1,34 @@
+namespace Resgrid.Config
+{
+ ///
+ /// Configuration for using a VOIP system for voice communication between applications
+ ///
+ public static class VoipConfig
+ {
+ public static int BaseChannelExtensionNumber = 15;
+ public static int BaseChannelExtensionBump = 15;
+
+ public static string VoipDomain = "";
+ public static string VoipServerAddress = "";
+ public static string VoipServerWebsocketAddress = "";
+ public static string VoipServerWebsocketSslAddress = "";
+
+ public static string KazooUsername = "";
+ public static string KazooPassword = "";
+ public static string KazzoAccount = "";
+ public static string KazooCrossbarApiUrl = @"";
+ public static string KazooCrossbarApiVersion = "";
+
+ public static string OpenViduUrl = "";
+ public static string OpenViduSecret = "";
+ }
+
+ ///
+ /// Possible backend voip providers
+ ///
+ public enum VoipProviderTypes
+ {
+ Kazoo = 0,
+ OpenVidu = 1
+ }
+}
diff --git a/Core/Resgrid.Framework/ConfigHelper.cs b/Core/Resgrid.Framework/ConfigHelper.cs
new file mode 100644
index 00000000..c9b30d64
--- /dev/null
+++ b/Core/Resgrid.Framework/ConfigHelper.cs
@@ -0,0 +1,15 @@
+using Resgrid.Config;
+
+namespace Resgrid.Framework
+{
+ public static class ConfigHelper
+ {
+ public static bool CanTransmit(int departmentId)
+ {
+ if (SystemBehaviorConfig.BypassDoNotBroadcastDepartments.Contains(departmentId))
+ return true;
+
+ return !SystemBehaviorConfig.DoNotBroadcast;
+ }
+ }
+}
diff --git a/Core/Resgrid.Framework/Hashing.cs b/Core/Resgrid.Framework/Hashing.cs
new file mode 100644
index 00000000..2d707bf5
--- /dev/null
+++ b/Core/Resgrid.Framework/Hashing.cs
@@ -0,0 +1,60 @@
+using Resgrid.Config;
+using System.Security.Cryptography;
+using System.Text;
+
+namespace Resgrid.Framework
+{
+ public static class Hashing
+ {
+ public static string ComputeSha256Hash(string rawData)
+ {
+ // Create a SHA256
+ using (SHA256 sha256Hash = SHA256.Create())
+ {
+ // ComputeHash - returns byte array
+ byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(rawData + SymmetricEncryptionConfig.SaltValue));
+
+ // Convert byte array to a string
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i < bytes.Length; i++)
+ {
+ builder.Append(bytes[i].ToString("x2"));
+ }
+ return builder.ToString();
+ }
+ }
+
+ public static string ComputeMD5Hash(string input)
+ {
+ using (MD5 md5 = MD5.Create())
+ {
+ byte[] inputBytes = Encoding.ASCII.GetBytes(input);
+ byte[] hashBytes = md5.ComputeHash(inputBytes);
+
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < hashBytes.Length; i++)
+ {
+ sb.Append(hashBytes[i].ToString("x2"));
+ }
+ return sb.ToString();
+ }
+ }
+
+ public static string ComputeSHA1Hash(string input)
+ {
+ using (SHA1Managed sha1 = new SHA1Managed())
+ {
+ var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(input));
+ var sb = new StringBuilder(hash.Length * 2);
+
+ foreach (byte b in hash)
+ {
+ // can be "x2" if you want lowercase
+ sb.Append(b.ToString("x2"));
+ }
+
+ return sb.ToString();
+ }
+ }
+ }
+}
diff --git a/Core/Resgrid.Framework/LocationHelpers.cs b/Core/Resgrid.Framework/LocationHelpers.cs
index b7936f60..c77eff4d 100644
--- a/Core/Resgrid.Framework/LocationHelpers.cs
+++ b/Core/Resgrid.Framework/LocationHelpers.cs
@@ -36,9 +36,13 @@ public static double ConvertDegreeAngleToDouble(string point)
var multiplier = (point.Contains("S") || point.Contains("W")) ? -1 : 1; //handle south and west
- point = Regex.Replace(point, "[^0-9. ]", ""); //remove the characters
+ var newPoint = point.Replace("°", " ");
+ newPoint = newPoint.Replace("'", " ");
+ newPoint = newPoint.Replace(" ", " ");
- var pointArray = point.Trim().Split(' '); //split the string.
+ newPoint = Regex.Replace(newPoint, "[^0-9. ]", ""); //remove the characters
+
+ var pointArray = newPoint.Trim().Split(' '); //split the string.
//Decimal degrees =
// whole number of degrees,
diff --git a/Core/Resgrid.Framework/Logging.cs b/Core/Resgrid.Framework/Logging.cs
index 25f9ec38..7f99e3a9 100644
--- a/Core/Resgrid.Framework/Logging.cs
+++ b/Core/Resgrid.Framework/Logging.cs
@@ -36,9 +36,11 @@ public static void Initialize(string key)
{
o.MinimumBreadcrumbLevel = LogEventLevel.Debug;
o.MinimumEventLevel = LogEventLevel.Error;
- o.Dsn = new Dsn(dsn);
+ o.Dsn = dsn;
o.AttachStacktrace = true;
o.SendDefaultPii = true;
+ o.Environment = ExternalErrorConfig.Environment;
+ o.Release = Assembly.GetEntryAssembly().GetName().Version.ToString();
}).CreateLogger();
}
else if (SystemBehaviorConfig.ErrorLoggerType == ErrorLoggerTypes.Elk)
@@ -64,12 +66,12 @@ private static void ShowConsole()
}
}
- public static void LogException(Exception exception, string extraMessage = "",
+ public static void LogException(Exception exception, string extraMessage = "", string correlationId = "",
[CallerFilePath] string callerFilePath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = 0)
{
Initialize(null);
- string msgToLog = string.Format("{0}\r\n{4}\r\n\r\nAssemblyName:{5}\r\nCallerFilePath:{1}\r\nCallerMemberName:{2}\r\nCallerLineNumber:{3}", extraMessage,
- callerFilePath, callerMemberName, callerLineNumber, exception.ToString(), Assembly.GetExecutingAssembly().FullName);
+ string msgToLog = string.Format("{0}\r\n{4}\r\n\r\nAssemblyName:{5}\r\nCallerFilePath:{1}\r\nCallerMemberName:{2}\r\nCallerLineNumber:{3}r\nCorrelationId:{6}", extraMessage,
+ callerFilePath, callerMemberName, callerLineNumber, exception.ToString(), Assembly.GetExecutingAssembly().FullName, correlationId);
if (_logger != null)
diff --git a/Core/Resgrid.Framework/OS.cs b/Core/Resgrid.Framework/OS.cs
new file mode 100644
index 00000000..f5143af2
--- /dev/null
+++ b/Core/Resgrid.Framework/OS.cs
@@ -0,0 +1,16 @@
+using System.Runtime.InteropServices;
+
+namespace Resgrid.Framework
+{
+ public static class OS
+ {
+ public static bool IsWindows() =>
+ RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
+
+ public static bool IsMacOS() =>
+ RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
+
+ public static bool IsLinux() =>
+ RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
+ }
+}
diff --git a/Core/Resgrid.Framework/ObjectCopier.cs b/Core/Resgrid.Framework/ObjectCopier.cs
index 2eca1518..b3944932 100644
--- a/Core/Resgrid.Framework/ObjectCopier.cs
+++ b/Core/Resgrid.Framework/ObjectCopier.cs
@@ -56,7 +56,26 @@ public static T CloneJson(this T source)
return default(T);
}
- return ObjectSerialization.Deserialize(ObjectSerialization.Serialize(source));
+ //return ObjectSerialization.Deserialize(ObjectSerialization.Serialize(source));
+ return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(source));
+ }
+
+ ///
+ /// Perform a deep Copy of the object, using Json as a serialisation method returns a string
+ ///
+ /// The type of object being copied.
+ /// The object instance to copy.
+ /// The copied object as a json string
+ public static string CloneJsonToString(this T source)
+ {
+ // Don't serialize a null object, simply return the default for that object
+ if (Object.ReferenceEquals(source, null))
+ {
+ return "";
+ }
+
+ //return ObjectSerialization.Deserialize(ObjectSerialization.Serialize(source));
+ return JsonConvert.SerializeObject(source);
}
}
}
diff --git a/Core/Resgrid.Framework/Resgrid.Framework.csproj b/Core/Resgrid.Framework/Resgrid.Framework.csproj
index c0c8e675..2eac3fdb 100644
--- a/Core/Resgrid.Framework/Resgrid.Framework.csproj
+++ b/Core/Resgrid.Framework/Resgrid.Framework.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ netstandard2.1
Resgrid.Framework
Resgrid, LLC
Resgrid OSS CAD
@@ -15,17 +15,17 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Core/Resgrid.Framework/SymmetricEncryption.cs b/Core/Resgrid.Framework/SymmetricEncryption.cs
index de859b2f..de7bdee5 100644
--- a/Core/Resgrid.Framework/SymmetricEncryption.cs
+++ b/Core/Resgrid.Framework/SymmetricEncryption.cs
@@ -109,6 +109,7 @@ public static string Decrypt(string cipherText, string passPhrase)
// It is reasonable to set encryption mode to Cipher Block Chaining
// (CBC). Use default options for other symmetric key parameters.
symmetricKey.Mode = CipherMode.CBC;
+ symmetricKey.Padding = PaddingMode.PKCS7;
// Generate decryptor from the existing key bytes and initialization
// vector. Key size will be defined based on the number of the key
@@ -128,12 +129,25 @@ public static string Decrypt(string cipherText, string passPhrase)
// Since at this point we don't know what the size of decrypted data
// will be, allocate the buffer long enough to hold ciphertext;
// plaintext is never longer than ciphertext.
- byte[] plainTextBytes = new byte[cipherTextBytes.Length];
+ byte[] plainTextBytes = null;// = new byte[cipherTextBytes.Length];
// Start decrypting.
- int decryptedByteCount = cryptoStream.Read(plainTextBytes,
- 0,
- plainTextBytes.Length);
+ //int decryptedByteCount = cryptoStream.Read(plainTextBytes,
+ // 0,
+ // plainTextBytes.Length);
+
+ string plainText = null;
+ //using (var plainTextReader = new StreamReader(cryptoStream))
+ //{
+ // plainText = plainTextReader.ReadToEnd();
+ //}
+
+ using (var plainTextStream = new MemoryStream())
+ {
+ cryptoStream.CopyTo(plainTextStream);
+ plainTextBytes = plainTextStream.ToArray();
+ plainText = Encoding.UTF8.GetString(plainTextBytes, 0, plainTextBytes.Length);
+ }
// Close both streams.
memoryStream.Close();
@@ -141,9 +155,9 @@ public static string Decrypt(string cipherText, string passPhrase)
// Convert decrypted data into a string.
// Let us assume that the original plaintext string was UTF8-encoded.
- string plainText = Encoding.UTF8.GetString(plainTextBytes,
- 0,
- decryptedByteCount);
+ //string plainText = Encoding.UTF8.GetString(plainTextBytes,
+ // 0,
+ // totalRead);
// Return decrypted string.
return plainText;
diff --git a/Core/Resgrid.Model/ActionLog.cs b/Core/Resgrid.Model/ActionLog.cs
index 92da47b5..ae26166a 100644
--- a/Core/Resgrid.Model/ActionLog.cs
+++ b/Core/Resgrid.Model/ActionLog.cs
@@ -5,6 +5,7 @@
using System.Linq;
using ProtoBuf;
using System.Collections.Generic;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
@@ -65,6 +66,7 @@ public class ActionLog : IEntity
public virtual Department Department { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return ActionLogId; }
@@ -78,7 +80,10 @@ public object IdValue
public string IdName => "ActionLogId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "User", "EtaPulledOn", "Eta" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "User", "EtaPulledOn", "Eta" };
public string GetActionText()
{
diff --git a/Core/Resgrid.Model/Address.cs b/Core/Resgrid.Model/Address.cs
index 63de7f5e..2d93b15c 100644
--- a/Core/Resgrid.Model/Address.cs
+++ b/Core/Resgrid.Model/Address.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -46,12 +47,16 @@ public class Address : IEntity
[NotMapped]
public string IdName => "AddressId";
+ [NotMapped]
+ public int IdType => 0;
+
public string FormatAddress()
{
return string.Format("{0} {1} {2} {3} {4}", Address1, City, State, PostalCode, Country);
}
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return AddressId; }
@@ -59,6 +64,6 @@ public object IdValue
}
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/Affiliate.cs b/Core/Resgrid.Model/Affiliate.cs
index adbff658..7356d616 100644
--- a/Core/Resgrid.Model/Affiliate.cs
+++ b/Core/Resgrid.Model/Affiliate.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -60,7 +61,8 @@ public class Affiliate : IEntity
public DateTime? RejectedOn { get; set; }
[NotMapped]
- public object IdValue
+ [JsonIgnore]
+ public object IdValue
{
get { return AffiliateId; }
set { AffiliateId = (int)value; }
@@ -73,6 +75,9 @@ public object IdValue
public string IdName => "AffiliateId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/ApplicationUserExt.cs b/Core/Resgrid.Model/ApplicationUserExt.cs
index d8541bd4..72034702 100644
--- a/Core/Resgrid.Model/ApplicationUserExt.cs
+++ b/Core/Resgrid.Model/ApplicationUserExt.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
@@ -29,6 +30,7 @@ public class ApplicationUserExt: IEntity
public DateTime? LastActivityDate { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return UserId; }
@@ -42,6 +44,9 @@ public object IdValue
public string IdName => "UserId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/AuditLog.cs b/Core/Resgrid.Model/AuditLog.cs
index db5cfa86..6dae1b64 100644
--- a/Core/Resgrid.Model/AuditLog.cs
+++ b/Core/Resgrid.Model/AuditLog.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -37,6 +38,7 @@ public class AuditLog : IEntity
public DateTime? LoggedOn { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return AuditLogId; }
@@ -50,6 +52,9 @@ public object IdValue
public string IdName => "AuditLogId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/Automation.cs b/Core/Resgrid.Model/Automation.cs
index 0e14399c..ff322a10 100644
--- a/Core/Resgrid.Model/Automation.cs
+++ b/Core/Resgrid.Model/Automation.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -28,6 +29,7 @@ public class Automation : IEntity
public DateTime CreatedOn { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return AutomationId; }
@@ -41,6 +43,9 @@ public object IdValue
public string IdName => "AutomationId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/CalendarItem.cs b/Core/Resgrid.Model/CalendarItem.cs
index 4d7eb036..6308d3f0 100644
--- a/Core/Resgrid.Model/CalendarItem.cs
+++ b/Core/Resgrid.Model/CalendarItem.cs
@@ -4,6 +4,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
+using Newtonsoft.Json;
using Resgrid.Framework;
namespace Resgrid.Model
@@ -96,6 +97,7 @@ public class CalendarItem: IEntity
public virtual ICollection Attendees { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CalendarItemId; }
@@ -110,7 +112,10 @@ public object IdValue
public string IdName => "CalendarItemId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Attendees", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Attendees", "Department" };
public bool IsUserAttending(string userId)
{
diff --git a/Core/Resgrid.Model/CalendarItemAttendee.cs b/Core/Resgrid.Model/CalendarItemAttendee.cs
index f4569e53..251e5cbc 100644
--- a/Core/Resgrid.Model/CalendarItemAttendee.cs
+++ b/Core/Resgrid.Model/CalendarItemAttendee.cs
@@ -4,6 +4,7 @@
using Resgrid.Model.Identity;
using ProtoBuf;
using System.Collections.Generic;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
@@ -40,6 +41,7 @@ public class CalendarItemAttendee: IEntity
public string Note { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CalendarItemAttendeeId; }
@@ -53,6 +55,9 @@ public object IdValue
public string IdName => "CalendarItemAttendeeId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "CalendarItem", "User" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "CalendarItem", "User" };
}
}
diff --git a/Core/Resgrid.Model/CalendarItemType.cs b/Core/Resgrid.Model/CalendarItemType.cs
index d71f28aa..20ba96c1 100644
--- a/Core/Resgrid.Model/CalendarItemType.cs
+++ b/Core/Resgrid.Model/CalendarItemType.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -24,6 +25,7 @@ public class CalendarItemType: IEntity
public string Color { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CalendarItemTypeId; }
@@ -37,6 +39,9 @@ public object IdValue
public string IdName => "CalendarItemTypeId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/Call.cs b/Core/Resgrid.Model/Call.cs
index a96db4de..f2ea955f 100644
--- a/Core/Resgrid.Model/Call.cs
+++ b/Core/Resgrid.Model/Call.cs
@@ -5,6 +5,7 @@
using Resgrid.Model.Identity;
using System.Linq;
using ProtoBuf;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
@@ -154,7 +155,14 @@ public class Call : IEntity
[NotMapped]
public int PreviousDispatchCount { get; set; }
+ public string CallFormData { get; set; }
+
+ public DateTime? DispatchOn { get; set; }
+
+ public bool? HasBeenDispatched { get; set; }
+
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallId; }
@@ -168,7 +176,10 @@ public object IdValue
public string IdName => "CallId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "ReportingUser", "ClosedByUser", "Department", "Dispatches", "Attachments", "CallNotes", "GroupDispatches", "UnitDispatches", "RoleDispatches", "Protocols", "ShortenedAudioUrl", "ShortenedCallUrl", "CallPriority", "PreviousDispatchCount" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "ReportingUser", "ClosedByUser", "Department", "Dispatches", "Attachments", "CallNotes", "GroupDispatches", "UnitDispatches", "RoleDispatches", "Protocols", "ShortenedAudioUrl", "ShortenedCallUrl", "CallPriority", "PreviousDispatchCount" };
public string GetIdentifier()
{
diff --git a/Core/Resgrid.Model/CallAttachment.cs b/Core/Resgrid.Model/CallAttachment.cs
index bbeba900..62ce277a 100644
--- a/Core/Resgrid.Model/CallAttachment.cs
+++ b/Core/Resgrid.Model/CallAttachment.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
using Resgrid.Framework;
@@ -56,6 +57,7 @@ public class CallAttachment: IEntity
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallAttachmentId; }
@@ -69,6 +71,9 @@ public object IdValue
public string IdName => "CallAttachmentId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Call" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Call" };
}
}
diff --git a/Core/Resgrid.Model/CallDispatch.cs b/Core/Resgrid.Model/CallDispatch.cs
index 705f9f48..b9b37e03 100644
--- a/Core/Resgrid.Model/CallDispatch.cs
+++ b/Core/Resgrid.Model/CallDispatch.cs
@@ -4,6 +4,7 @@
using Resgrid.Model.Identity;
using ProtoBuf;
using System.Collections.Generic;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
@@ -46,6 +47,7 @@ public class CallDispatch: IEntity
public virtual ActionLog ActionLog { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallDispatchId; }
@@ -60,6 +62,9 @@ public object IdValue
public string IdName => "CallDispatchId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "ActionLog", "User", "Call" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "ActionLog", "User", "Call" };
}
}
diff --git a/Core/Resgrid.Model/CallDispatchGroup.cs b/Core/Resgrid.Model/CallDispatchGroup.cs
index 443d0953..fe9e01d0 100644
--- a/Core/Resgrid.Model/CallDispatchGroup.cs
+++ b/Core/Resgrid.Model/CallDispatchGroup.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -34,6 +35,7 @@ public class CallDispatchGroup : IEntity
public DateTime? LastDispatchedOn { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallDispatchGroupId; }
@@ -47,6 +49,9 @@ public object IdValue
public string IdName => "CallDispatchGroupId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Group", "Call" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Group", "Call" };
}
}
diff --git a/Core/Resgrid.Model/CallDispatchRole.cs b/Core/Resgrid.Model/CallDispatchRole.cs
index 6229012b..0822419a 100644
--- a/Core/Resgrid.Model/CallDispatchRole.cs
+++ b/Core/Resgrid.Model/CallDispatchRole.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -35,6 +36,7 @@ public class CallDispatchRole : IEntity
public DateTime? LastDispatchedOn { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallDispatchRoleId; }
@@ -48,6 +50,9 @@ public object IdValue
public string IdName => "CallDispatchRoleId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Role", "Call" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Role", "Call" };
}
}
diff --git a/Core/Resgrid.Model/CallDispatchUnit.cs b/Core/Resgrid.Model/CallDispatchUnit.cs
index ddb59c6d..6e5bc4f1 100644
--- a/Core/Resgrid.Model/CallDispatchUnit.cs
+++ b/Core/Resgrid.Model/CallDispatchUnit.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -36,6 +37,7 @@ public class CallDispatchUnit : IEntity
public DateTime? LastDispatchedOn { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallDispatchUnitId; }
@@ -49,6 +51,9 @@ public object IdValue
public string IdName => "CallDispatchUnitId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Unit", "Call" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Unit", "Call" };
}
}
diff --git a/Core/Resgrid.Model/CallLog.cs b/Core/Resgrid.Model/CallLog.cs
index 789f5e29..8911d094 100644
--- a/Core/Resgrid.Model/CallLog.cs
+++ b/Core/Resgrid.Model/CallLog.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -35,6 +36,7 @@ public class CallLog : IEntity
public virtual IdentityUser LoggedBy { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallLogId; }
@@ -48,6 +50,9 @@ public object IdValue
public string IdName => "CallLogId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Call", "Department", "LoggedBy" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Call", "Department", "LoggedBy" };
}
}
diff --git a/Core/Resgrid.Model/CallNote.cs b/Core/Resgrid.Model/CallNote.cs
index 7bac95a3..98ba7195 100644
--- a/Core/Resgrid.Model/CallNote.cs
+++ b/Core/Resgrid.Model/CallNote.cs
@@ -5,6 +5,7 @@
using ProtoBuf;
using Resgrid.Framework;
using System.Collections.Generic;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
@@ -49,6 +50,7 @@ public class CallNote : IEntity
public decimal? Longitude { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallNoteId; }
@@ -62,6 +64,9 @@ public object IdValue
public string IdName => "CallNoteId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Call", "User" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Call", "User" };
}
}
diff --git a/Core/Resgrid.Model/CallProtocol.cs b/Core/Resgrid.Model/CallProtocol.cs
index 522f930a..f5902824 100644
--- a/Core/Resgrid.Model/CallProtocol.cs
+++ b/Core/Resgrid.Model/CallProtocol.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -40,6 +41,7 @@ public class CallProtocol : IEntity
public string Data { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallProtocolId; }
@@ -54,6 +56,9 @@ public object IdValue
public string IdName => "CallProtocolId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Call", "Protocol" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Call", "Protocol" };
}
}
diff --git a/Core/Resgrid.Model/CallQuickTemplate.cs b/Core/Resgrid.Model/CallQuickTemplate.cs
index eb4edbb3..80f94956 100644
--- a/Core/Resgrid.Model/CallQuickTemplate.cs
+++ b/Core/Resgrid.Model/CallQuickTemplate.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -38,6 +39,7 @@ public class CallQuickTemplate : IEntity
public DateTime CreatedOn { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallQuickTemplateId; }
@@ -51,6 +53,9 @@ public object IdValue
public string IdName => "CallQuickTemplateId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "CreatedByUser" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "CreatedByUser" };
}
}
diff --git a/Core/Resgrid.Model/CallType.cs b/Core/Resgrid.Model/CallType.cs
index 7b81feba..12c83ef5 100644
--- a/Core/Resgrid.Model/CallType.cs
+++ b/Core/Resgrid.Model/CallType.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -24,6 +25,7 @@ public class CallType : IEntity
public string Type { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallTypeId; }
@@ -37,6 +39,9 @@ public object IdValue
public string IdName => "CallTypeId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/CallUnit.cs b/Core/Resgrid.Model/CallUnit.cs
index 34aef46e..338ba2ab 100644
--- a/Core/Resgrid.Model/CallUnit.cs
+++ b/Core/Resgrid.Model/CallUnit.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -43,6 +44,7 @@ public class CallUnit : IEntity
public virtual UnitState UnitState { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CallUnitId; }
@@ -56,6 +58,9 @@ public object IdValue
public string IdName => "CallUnitId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Unit", "UnitState" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Unit", "UnitState" };
}
}
diff --git a/Core/Resgrid.Model/CommandDefinition.cs b/Core/Resgrid.Model/CommandDefinition.cs
index 9cf8f67d..c2c6e1f1 100644
--- a/Core/Resgrid.Model/CommandDefinition.cs
+++ b/Core/Resgrid.Model/CommandDefinition.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -32,6 +33,7 @@ public class CommandDefinition : IEntity
public virtual ICollection Assignments { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CommandDefinitionId; }
@@ -45,6 +47,9 @@ public object IdValue
public string IdName => "CommandDefinitionId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "CallType", "Assignments" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "CallType", "Assignments" };
}
}
diff --git a/Core/Resgrid.Model/CommandDefinitionRole.cs b/Core/Resgrid.Model/CommandDefinitionRole.cs
index c0592502..f10d7e55 100644
--- a/Core/Resgrid.Model/CommandDefinitionRole.cs
+++ b/Core/Resgrid.Model/CommandDefinitionRole.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -41,6 +42,7 @@ public class CommandDefinitionRole : IEntity
public virtual ICollection RequiredRoles { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CommandDefinitionRoleId; }
@@ -54,6 +56,9 @@ public object IdValue
public string IdName => "CommandDefinitionRoleId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Command", "RequiredUnitTypes", "RequiredCerts", "RequiredRoles" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Command", "RequiredUnitTypes", "RequiredCerts", "RequiredRoles" };
}
}
diff --git a/Core/Resgrid.Model/CommandDefinitionRoleCert.cs b/Core/Resgrid.Model/CommandDefinitionRoleCert.cs
index 0b7765f5..2bd2ac59 100644
--- a/Core/Resgrid.Model/CommandDefinitionRoleCert.cs
+++ b/Core/Resgrid.Model/CommandDefinitionRoleCert.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -25,6 +26,7 @@ public class CommandDefinitionRoleCert : IEntity
public virtual DepartmentCertificationType Certification { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CommandDefinitionRoleCertId; }
@@ -38,6 +40,9 @@ public object IdValue
public string IdName => "CommandDefinitionRoleCertId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "CommandRole", "Certification" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "CommandRole", "Certification" };
}
}
diff --git a/Core/Resgrid.Model/CommandDefinitionRolePersonnelRole.cs b/Core/Resgrid.Model/CommandDefinitionRolePersonnelRole.cs
index e177201e..0efe7559 100644
--- a/Core/Resgrid.Model/CommandDefinitionRolePersonnelRole.cs
+++ b/Core/Resgrid.Model/CommandDefinitionRolePersonnelRole.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -25,6 +26,7 @@ public class CommandDefinitionRolePersonnelRole : IEntity
public virtual PersonnelRole Role { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CommandDefinitionRolePersonnelRoleId; }
@@ -38,6 +40,9 @@ public object IdValue
public string IdName => "CommandDefinitionRolePersonnelRoleId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "CommandRole", "Role" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "CommandRole", "Role" };
}
}
diff --git a/Core/Resgrid.Model/CommandDefinitionRoleUnitType.cs b/Core/Resgrid.Model/CommandDefinitionRoleUnitType.cs
index cd77c7bb..93d7a744 100644
--- a/Core/Resgrid.Model/CommandDefinitionRoleUnitType.cs
+++ b/Core/Resgrid.Model/CommandDefinitionRoleUnitType.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -25,6 +26,7 @@ public class CommandDefinitionRoleUnitType : IEntity
public virtual UnitType UnitType { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CommandDefinitionRoleUnitTypeId; }
@@ -38,6 +40,9 @@ public object IdValue
public string IdName => "CommandDefinitionRoleUnitTypeId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "CommandRole", "UnitType" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "CommandRole", "UnitType" };
}
}
diff --git a/Core/Resgrid.Model/CustomState.cs b/Core/Resgrid.Model/CustomState.cs
index 64b535f8..fc2eb7f4 100644
--- a/Core/Resgrid.Model/CustomState.cs
+++ b/Core/Resgrid.Model/CustomState.cs
@@ -2,6 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -49,6 +50,7 @@ public List GetActiveDetails()
}
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CustomStateId; }
@@ -62,6 +64,9 @@ public object IdValue
public string IdName => "CustomStateId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Details" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Details" };
}
}
diff --git a/Core/Resgrid.Model/CustomStateDetail.cs b/Core/Resgrid.Model/CustomStateDetail.cs
index 0b88b1dd..eeab7c89 100644
--- a/Core/Resgrid.Model/CustomStateDetail.cs
+++ b/Core/Resgrid.Model/CustomStateDetail.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
using ProtoBuf.Meta;
@@ -50,6 +51,7 @@ public class CustomStateDetail : IEntity
public bool IsDeleted { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return CustomStateDetailId; }
@@ -63,7 +65,10 @@ public object IdValue
public string IdName => "CustomStateDetailId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "CustomState" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "CustomState" };
public string ButtonClassToColor()
{
diff --git a/Core/Resgrid.Model/Department.cs b/Core/Resgrid.Model/Department.cs
index 6e7bbd2c..a35edc88 100644
--- a/Core/Resgrid.Model/Department.cs
+++ b/Core/Resgrid.Model/Department.cs
@@ -5,6 +5,7 @@
using Resgrid.Model.Identity;
using System.Linq;
using ProtoBuf;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
@@ -86,6 +87,7 @@ public Department()
public string LinkCode { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentId; }
@@ -99,7 +101,10 @@ public object IdValue
public string IdName => "DepartmentId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "ManagingUser", "Address", "Members", "AdminUsers" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "ManagingUser", "Address", "Members", "AdminUsers" };
[ProtoMember(18)]
[NotMapped]
@@ -126,5 +131,16 @@ public bool IsUserAnAdmin(string userId)
return false;
}
+
+ public bool IsUserInDepartment(string userId)
+ {
+ if (userId == ManagingUserId)
+ return true;
+
+ if (Members != null && Members.Any())
+ return Members.Any(x => x.UserId == userId);
+
+ return false;
+ }
}
}
diff --git a/Core/Resgrid.Model/DepartmentCallEmail.cs b/Core/Resgrid.Model/DepartmentCallEmail.cs
index bd405413..f4becd28 100644
--- a/Core/Resgrid.Model/DepartmentCallEmail.cs
+++ b/Core/Resgrid.Model/DepartmentCallEmail.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -44,6 +45,7 @@ public class DepartmentCallEmail : IEntity
public string ErrorMessage { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentCallEmailId; }
@@ -57,6 +59,9 @@ public object IdValue
public string IdName => "DepartmentCallEmailId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentCallPriority.cs b/Core/Resgrid.Model/DepartmentCallPriority.cs
index fdb2f356..ac1af6d5 100644
--- a/Core/Resgrid.Model/DepartmentCallPriority.cs
+++ b/Core/Resgrid.Model/DepartmentCallPriority.cs
@@ -1,4 +1,5 @@
-using ProtoBuf;
+using Newtonsoft.Json;
+using ProtoBuf;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -59,6 +60,7 @@ public class DepartmentCallPriority : IEntity
public bool IsSystemPriority { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentCallPriorityId; }
@@ -73,6 +75,9 @@ public object IdValue
public string IdName => "DepartmentCallPriorityId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "IsSystemPriority" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "IsSystemPriority" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentCallPruning.cs b/Core/Resgrid.Model/DepartmentCallPruning.cs
index 9af596e4..4711bf16 100644
--- a/Core/Resgrid.Model/DepartmentCallPruning.cs
+++ b/Core/Resgrid.Model/DepartmentCallPruning.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -28,6 +29,7 @@ public class DepartmentCallPruning: IEntity
public int? EmailImportCallPruneInterval { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentCallPruningId; }
@@ -41,6 +43,9 @@ public object IdValue
public string IdName => "DepartmentCallPruningId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentCertificationType.cs b/Core/Resgrid.Model/DepartmentCertificationType.cs
index b2fb688e..1c2bbde9 100644
--- a/Core/Resgrid.Model/DepartmentCertificationType.cs
+++ b/Core/Resgrid.Model/DepartmentCertificationType.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -23,6 +24,7 @@ public class DepartmentCertificationType : IEntity
public string Type { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentCertificationTypeId; }
@@ -36,6 +38,9 @@ public object IdValue
public string IdName => "DepartmentCertificationTypeId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentFile.cs b/Core/Resgrid.Model/DepartmentFile.cs
index d94253aa..1ffeb8cf 100644
--- a/Core/Resgrid.Model/DepartmentFile.cs
+++ b/Core/Resgrid.Model/DepartmentFile.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -36,6 +37,7 @@ public class DepartmentFile : IEntity
public byte[] Data { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentFileId; }
@@ -49,6 +51,9 @@ public object IdValue
public string IdName => "DepartmentFileId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentGroup.cs b/Core/Resgrid.Model/DepartmentGroup.cs
index 1929a9db..afc7a0fd 100644
--- a/Core/Resgrid.Model/DepartmentGroup.cs
+++ b/Core/Resgrid.Model/DepartmentGroup.cs
@@ -79,7 +79,7 @@ public class DepartmentGroup : IEntity
public string FaxNumber { get; set; }
[NotMapped]
- public object IdValue
+ [JsonIgnore]public object IdValue
{
get { return DepartmentGroupId; }
set { DepartmentGroupId = (int)value; }
@@ -92,7 +92,10 @@ public object IdValue
public string IdName => "DepartmentGroupId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Parent", "Members", "Children", "Address" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Parent", "Members", "Children", "Address" };
public bool IsUserGroupAdmin(string userId)
{
diff --git a/Core/Resgrid.Model/DepartmentGroupMember.cs b/Core/Resgrid.Model/DepartmentGroupMember.cs
index e2298cbe..3a1e8597 100644
--- a/Core/Resgrid.Model/DepartmentGroupMember.cs
+++ b/Core/Resgrid.Model/DepartmentGroupMember.cs
@@ -32,7 +32,7 @@ public class DepartmentGroupMember : IEntity
public bool? IsAdmin { get; set; }
[NotMapped]
- public object IdValue
+ [JsonIgnore]public object IdValue
{
get { return DepartmentGroupMemberId; }
set { DepartmentGroupMemberId = (int)value; }
@@ -45,6 +45,9 @@ public object IdValue
public string IdName => "DepartmentGroupMemberId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "DepartmentGroup", "User" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "DepartmentGroup", "User" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentLink.cs b/Core/Resgrid.Model/DepartmentLink.cs
index edd67026..c3ac7d2c 100644
--- a/Core/Resgrid.Model/DepartmentLink.cs
+++ b/Core/Resgrid.Model/DepartmentLink.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -50,6 +51,7 @@ public class DepartmentLink: IEntity
public DateTime? LinkAccepted { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentLinkId; }
@@ -63,6 +65,9 @@ public object IdValue
public string IdName => "DepartmentLinkId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "LinkedDepartment" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "LinkedDepartment" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentMember.cs b/Core/Resgrid.Model/DepartmentMember.cs
index cc1045b0..c4ef9414 100644
--- a/Core/Resgrid.Model/DepartmentMember.cs
+++ b/Core/Resgrid.Model/DepartmentMember.cs
@@ -3,6 +3,7 @@
using Resgrid.Model.Identity;
using ProtoBuf;
using System.Collections.Generic;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
@@ -66,9 +67,13 @@ public class DepartmentMember : IEntity
public string IdName => "DepartmentMemberId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "User", "Rank" };
+ public int IdType => 0;
[NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "User", "Rank" };
+
+ [NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentMemberId; }
diff --git a/Core/Resgrid.Model/DepartmentNotification.cs b/Core/Resgrid.Model/DepartmentNotification.cs
index eb2723f7..2727cf70 100644
--- a/Core/Resgrid.Model/DepartmentNotification.cs
+++ b/Core/Resgrid.Model/DepartmentNotification.cs
@@ -3,6 +3,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
+using Newtonsoft.Json;
using Resgrid.Framework;
using Resgrid.Model.Events;
@@ -39,6 +40,7 @@ public class DepartmentNotification : IEntity
public string Data { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentNotificationId; }
@@ -52,7 +54,10 @@ public object IdValue
public string IdName => "DepartmentNotificationId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
public void AddUserToNotify(string userId)
{
diff --git a/Core/Resgrid.Model/DepartmentProfile.cs b/Core/Resgrid.Model/DepartmentProfile.cs
index a1355854..9ae7d55a 100644
--- a/Core/Resgrid.Model/DepartmentProfile.cs
+++ b/Core/Resgrid.Model/DepartmentProfile.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -125,6 +126,7 @@ public class DepartmentProfile : IEntity
public string PhoneNumber { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentProfileId; }
@@ -138,6 +140,9 @@ public object IdValue
public string IdName => "DepartmentProfileId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Address" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Address" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentProfileArticle.cs b/Core/Resgrid.Model/DepartmentProfileArticle.cs
index 668d788f..c0d35c7c 100644
--- a/Core/Resgrid.Model/DepartmentProfileArticle.cs
+++ b/Core/Resgrid.Model/DepartmentProfileArticle.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -45,6 +46,7 @@ public class DepartmentProfileArticle : IEntity
public bool Deleted { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentProfileArticleId; }
@@ -58,6 +60,9 @@ public object IdValue
public string IdName => "DepartmentProfileArticleId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Profile", "CreatedByUser" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Profile", "CreatedByUser" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentProfileInvite.cs b/Core/Resgrid.Model/DepartmentProfileInvite.cs
index bc6c6db4..63398804 100644
--- a/Core/Resgrid.Model/DepartmentProfileInvite.cs
+++ b/Core/Resgrid.Model/DepartmentProfileInvite.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -24,6 +25,7 @@ public class DepartmentProfileInvite : IEntity
public DateTime? UsedOn { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentProfileInviteId; }
@@ -37,6 +39,9 @@ public object IdValue
public string IdName => "DepartmentProfileInviteId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Profile" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Profile" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentProfileMessage.cs b/Core/Resgrid.Model/DepartmentProfileMessage.cs
index 9058a3be..8eb85968 100644
--- a/Core/Resgrid.Model/DepartmentProfileMessage.cs
+++ b/Core/Resgrid.Model/DepartmentProfileMessage.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -65,6 +66,7 @@ public class DepartmentProfileMessage : IEntity
public bool Deleted { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentProfileMessageId; }
@@ -78,6 +80,9 @@ public object IdValue
public string IdName => "DepartmentProfileMessageId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Profile", "ReplyToMessage", "Call" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Profile", "ReplyToMessage", "Call" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentProfileUser.cs b/Core/Resgrid.Model/DepartmentProfileUser.cs
index 74ac0898..062b3115 100644
--- a/Core/Resgrid.Model/DepartmentProfileUser.cs
+++ b/Core/Resgrid.Model/DepartmentProfileUser.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -22,6 +23,7 @@ public class DepartmentProfileUser : IEntity
public string Email { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentProfileUserId; }
@@ -35,6 +37,9 @@ public object IdValue
public string IdName => "DepartmentProfileUserId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentProfileUserFollow.cs b/Core/Resgrid.Model/DepartmentProfileUserFollow.cs
index d6dd416d..d93a138d 100644
--- a/Core/Resgrid.Model/DepartmentProfileUserFollow.cs
+++ b/Core/Resgrid.Model/DepartmentProfileUserFollow.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -26,6 +27,7 @@ public class DepartmentProfileUserFollow : IEntity
public virtual DepartmentProfile DepartmentProfile { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentProfileUserFollowId; }
@@ -39,6 +41,9 @@ public object IdValue
public string IdName => "DepartmentProfileUserFollowId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "DepartmentProfileUser", "DepartmentProfile" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "DepartmentProfileUser", "DepartmentProfile" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentSetting.cs b/Core/Resgrid.Model/DepartmentSetting.cs
index 8bd16451..e4cad8e4 100644
--- a/Core/Resgrid.Model/DepartmentSetting.cs
+++ b/Core/Resgrid.Model/DepartmentSetting.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -32,6 +33,7 @@ public class DepartmentSetting : IEntity
public string Setting { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DepartmentSettingId; }
@@ -45,6 +47,9 @@ public object IdValue
public string IdName => "DepartmentSettingId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/DepartmentVoice.cs b/Core/Resgrid.Model/DepartmentVoice.cs
new file mode 100644
index 00000000..80390b68
--- /dev/null
+++ b/Core/Resgrid.Model/DepartmentVoice.cs
@@ -0,0 +1,41 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Text;
+
+namespace Resgrid.Model
+{
+ public class DepartmentVoice : IEntity
+ {
+ public string DepartmentVoiceId { get; set; }
+
+ public int DepartmentId { get; set; }
+
+ public virtual Department Department { get; set; }
+
+ public int StartConferenceNumber { get; set; }
+
+ public virtual List Channels { get; set; }
+
+ [NotMapped]
+ [JsonIgnore]
+ public object IdValue
+ {
+ get { return DepartmentVoiceId; }
+ set { DepartmentVoiceId = (string)value; }
+ }
+
+ [NotMapped]
+ public string TableName => "DepartmentVoices";
+
+ [NotMapped]
+ public string IdName => "DepartmentVoiceId";
+
+ [NotMapped]
+ public int IdType => 1;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Channels" };
+ }
+}
diff --git a/Core/Resgrid.Model/DepartmentVoiceChannel.cs b/Core/Resgrid.Model/DepartmentVoiceChannel.cs
new file mode 100644
index 00000000..f15b04d9
--- /dev/null
+++ b/Core/Resgrid.Model/DepartmentVoiceChannel.cs
@@ -0,0 +1,49 @@
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Resgrid.Model
+{
+ public class DepartmentVoiceChannel : IEntity
+ {
+ public string DepartmentVoiceChannelId { get; set; }
+
+ public string DepartmentVoiceId { get; set; }
+
+ public virtual DepartmentVoice DepartmentVoice { get; set; }
+
+ public int DepartmentId { get; set; }
+
+ public virtual Department Department { get; set; }
+
+ public string Name { get; set; }
+
+ public string SystemConferenceId { get; set; }
+
+ public string SystemCallflowId { get; set; }
+
+ public int ConferenceNumber { get; set; }
+
+ public bool IsDefault { get; set; }
+
+ [NotMapped]
+ [JsonIgnore]
+ public object IdValue
+ {
+ get { return DepartmentVoiceChannelId; }
+ set { DepartmentVoiceChannelId = (string)value; }
+ }
+
+ [NotMapped]
+ public string TableName => "DepartmentVoiceChannels";
+
+ [NotMapped]
+ public string IdName => "DepartmentVoiceChannelId";
+
+ [NotMapped]
+ public int IdType => 1;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "DepartmentVoice", "Department" };
+ }
+}
diff --git a/Core/Resgrid.Model/DepartmentVoiceUser.cs b/Core/Resgrid.Model/DepartmentVoiceUser.cs
new file mode 100644
index 00000000..5238bb38
--- /dev/null
+++ b/Core/Resgrid.Model/DepartmentVoiceUser.cs
@@ -0,0 +1,43 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Text;
+
+namespace Resgrid.Model
+{
+ public class DepartmentVoiceUser : IEntity
+ {
+ public string DepartmentVoiceUserId { get; set; }
+
+ public string DepartmentVoiceId { get; set; }
+
+ public virtual DepartmentVoice DepartmentVoice { get; set; }
+
+ public string UserId { get; set; }
+
+ public string SystemUserId { get; set; }
+
+ public string SystemDeviceId { get; set; }
+
+ [NotMapped]
+ [JsonIgnore]
+ public object IdValue
+ {
+ get { return DepartmentVoiceUserId; }
+ set { DepartmentVoiceUserId = (string)value; }
+ }
+
+ [NotMapped]
+ public string TableName => "DepartmentVoiceUsers";
+
+ [NotMapped]
+ public string IdName => "DepartmentVoiceUserId";
+
+ [NotMapped]
+ public int IdType => 1;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "DepartmentVoice" };
+ }
+}
diff --git a/Core/Resgrid.Model/DispatchProtocol.cs b/Core/Resgrid.Model/DispatchProtocol.cs
index db8e40df..f0b842cf 100644
--- a/Core/Resgrid.Model/DispatchProtocol.cs
+++ b/Core/Resgrid.Model/DispatchProtocol.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -27,12 +28,12 @@ public class DispatchProtocol : IEntity
public string Code { get; set; }
public bool IsDisabled { get; set; }
-
+
[MaxLength(500)]
public string Description { get; set; }
public string ProtocolText { get; set; }
-
+
[Required]
public DateTime CreatedOn { get; set; }
@@ -56,6 +57,7 @@ public class DispatchProtocol : IEntity
public ProtocolStates State { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DispatchProtocolId; }
@@ -69,6 +71,9 @@ public object IdValue
public string IdName => "DispatchProtocolId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Triggers", "Attachments", "Questions", "State" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Triggers", "Attachments", "Questions", "State" };
}
}
diff --git a/Core/Resgrid.Model/DispatchProtocolAttachment.cs b/Core/Resgrid.Model/DispatchProtocolAttachment.cs
index 98c5c1e0..93251557 100644
--- a/Core/Resgrid.Model/DispatchProtocolAttachment.cs
+++ b/Core/Resgrid.Model/DispatchProtocolAttachment.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -25,6 +26,7 @@ public class DispatchProtocolAttachment : IEntity
public byte[] Data { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DispatchProtocolAttachmentId; }
@@ -38,6 +40,9 @@ public object IdValue
public string IdName => "DispatchProtocolAttachmentId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Protocol" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Protocol" };
}
}
diff --git a/Core/Resgrid.Model/DispatchProtocolQuestion.cs b/Core/Resgrid.Model/DispatchProtocolQuestion.cs
index 379ea9d2..c84cf4af 100644
--- a/Core/Resgrid.Model/DispatchProtocolQuestion.cs
+++ b/Core/Resgrid.Model/DispatchProtocolQuestion.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -23,6 +24,7 @@ public class DispatchProtocolQuestion : IEntity
public virtual ICollection Answers { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DispatchProtocolQuestionId; }
@@ -36,6 +38,9 @@ public object IdValue
public string IdName => "DispatchProtocolQuestionId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Protocol", "Answers" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Protocol", "Answers" };
}
}
diff --git a/Core/Resgrid.Model/DispatchProtocolQuestionAnswer.cs b/Core/Resgrid.Model/DispatchProtocolQuestionAnswer.cs
index 5879c44d..742c25f4 100644
--- a/Core/Resgrid.Model/DispatchProtocolQuestionAnswer.cs
+++ b/Core/Resgrid.Model/DispatchProtocolQuestionAnswer.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -23,6 +24,7 @@ public class DispatchProtocolQuestionAnswer : IEntity
public int Weight { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DispatchProtocolQuestionAnswerId; }
@@ -36,6 +38,9 @@ public object IdValue
public string IdName => "DispatchProtocolQuestionAnswerId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Question" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Question" };
}
}
diff --git a/Core/Resgrid.Model/DispatchProtocolTrigger.cs b/Core/Resgrid.Model/DispatchProtocolTrigger.cs
index d8eb0265..e40bf2b3 100644
--- a/Core/Resgrid.Model/DispatchProtocolTrigger.cs
+++ b/Core/Resgrid.Model/DispatchProtocolTrigger.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -32,6 +33,7 @@ public class DispatchProtocolTrigger : IEntity
public string Geofence { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DispatchProtocolTriggerId; }
@@ -45,6 +47,9 @@ public object IdValue
public string IdName => "DispatchProtocolTriggerId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Protocol" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Protocol" };
}
}
diff --git a/Core/Resgrid.Model/DistributionList.cs b/Core/Resgrid.Model/DistributionList.cs
index ad872757..e69a21c5 100644
--- a/Core/Resgrid.Model/DistributionList.cs
+++ b/Core/Resgrid.Model/DistributionList.cs
@@ -1,4 +1,5 @@
-using ProtoBuf;
+using Newtonsoft.Json;
+using ProtoBuf;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -60,13 +61,14 @@ public class DistributionList : IEntity
public string ErrorMessage { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DistributionListId; }
set { DistributionListId = (int)value; }
}
-
+
[NotMapped]
public string TableName => "DistributionLists";
@@ -74,6 +76,9 @@ public object IdValue
public string IdName => "DistributionListId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Members" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Members" };
}
}
diff --git a/Core/Resgrid.Model/DistributionListMember.cs b/Core/Resgrid.Model/DistributionListMember.cs
index 9b380639..98a7c393 100644
--- a/Core/Resgrid.Model/DistributionListMember.cs
+++ b/Core/Resgrid.Model/DistributionListMember.cs
@@ -3,12 +3,13 @@
using Resgrid.Model.Identity;
using ProtoBuf;
using System.Collections.Generic;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
[ProtoContract]
[Table("DistributionListMembers")]
- public class DistributionListMember: IEntity
+ public class DistributionListMember : IEntity
{
[Key]
[Required]
@@ -31,6 +32,7 @@ public class DistributionListMember: IEntity
public virtual IdentityUser User { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DistributionListMemberId; }
@@ -44,6 +46,9 @@ public object IdValue
public string IdName => "DistributionListMemberId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "DistributionList", "User" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "DistributionList", "User" };
}
}
diff --git a/Core/Resgrid.Model/Document.cs b/Core/Resgrid.Model/Document.cs
index 77682d62..68f9f470 100644
--- a/Core/Resgrid.Model/Document.cs
+++ b/Core/Resgrid.Model/Document.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -46,6 +47,7 @@ public class Document : IEntity
public DateTime? RemoveOn { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return DocumentId; }
@@ -59,7 +61,10 @@ public object IdValue
public string IdName => "DocumentId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "User" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "User" };
public string GetIconType()
{
diff --git a/Core/Resgrid.Model/EventingTypes.cs b/Core/Resgrid.Model/EventingTypes.cs
index 8a292a3a..d158b1fb 100644
--- a/Core/Resgrid.Model/EventingTypes.cs
+++ b/Core/Resgrid.Model/EventingTypes.cs
@@ -2,9 +2,11 @@
{
public enum EventingTypes
{
- PersonnelStatusUpdated = 1,
+ PersonnelStatusUpdated = 1,
UnitStatusUpdated = 2,
CallsUpdated = 3,
- PersonnelStaffingUpdated = 4
+ PersonnelStaffingUpdated = 4,
+ CallAdded = 5,
+ CallClosed = 6
}
-}
\ No newline at end of file
+}
diff --git a/Core/Resgrid.Model/Events/AuditEvent.cs b/Core/Resgrid.Model/Events/AuditEvent.cs
index a887b6d0..19c24061 100644
--- a/Core/Resgrid.Model/Events/AuditEvent.cs
+++ b/Core/Resgrid.Model/Events/AuditEvent.cs
@@ -6,6 +6,9 @@ namespace Resgrid.Model.Events
[ProtoContract]
public class AuditEvent
{
+ [ProtoMember(7)]
+ public string EventId { get; set; }
+
[ProtoMember(1)]
public int DepartmentId { get; set; }
@@ -14,10 +17,19 @@ public class AuditEvent
[ProtoMember(3)]
public AuditLogTypes Type { get; set; }
- public Object Before { get; set; }
- public Object After { get; set; }
+
+ [ProtoMember(5)]
+ public string Before { get; set; }
+
+ [ProtoMember(6)]
+ public string After { get; set; }
[ProtoMember(4)]
public string Difference { get; set; }
+
+ public AuditEvent()
+ {
+ EventId = Guid.NewGuid().ToString();
+ }
}
}
diff --git a/Core/Resgrid.Model/Events/CallClosedEvent.cs b/Core/Resgrid.Model/Events/CallClosedEvent.cs
new file mode 100644
index 00000000..1363e4cf
--- /dev/null
+++ b/Core/Resgrid.Model/Events/CallClosedEvent.cs
@@ -0,0 +1,8 @@
+namespace Resgrid.Model.Events
+{
+ public class CallClosedEvent
+ {
+ public int DepartmentId { get; set; }
+ public Call Call { get; set; }
+ }
+}
diff --git a/Core/Resgrid.Model/Events/CallUpdatedEvent.cs b/Core/Resgrid.Model/Events/CallUpdatedEvent.cs
new file mode 100644
index 00000000..3798b783
--- /dev/null
+++ b/Core/Resgrid.Model/Events/CallUpdatedEvent.cs
@@ -0,0 +1,8 @@
+namespace Resgrid.Model.Events
+{
+ public class CallUpdatedEvent
+ {
+ public int DepartmentId { get; set; }
+ public Call Call { get; set; }
+ }
+}
diff --git a/Core/Resgrid.Model/Facades/Stripe/IStripeSubscriptionServiceFacade.cs b/Core/Resgrid.Model/Facades/Stripe/IStripeSubscriptionServiceFacade.cs
index ba999f86..109173a2 100644
--- a/Core/Resgrid.Model/Facades/Stripe/IStripeSubscriptionServiceFacade.cs
+++ b/Core/Resgrid.Model/Facades/Stripe/IStripeSubscriptionServiceFacade.cs
@@ -1,14 +1,17 @@
using System.Collections.Generic;
+using System.Threading.Tasks;
using Stripe;
namespace Resgrid.Model.Facades.Stripe
{
public interface IStripeSubscriptionServiceFacade
{
- Subscription Get(string customerId, string subscriptionId);
- Subscription Create(string customerId, string planId, SubscriptionCreateOptions createOptions = null);
- Subscription Update(string customerId, string subscriptionId, SubscriptionUpdateOptions updateOptions);
+ Task Get(string customerId, string subscriptionId);
+ Task Create(string customerId, string planId, SubscriptionCreateOptions createOptions = null);
+ Task Update(string customerId, string subscriptionId, SubscriptionUpdateOptions updateOptions);
Subscription Cancel(string customerId, string subscriptionId, bool cancelAtPeriodEnd = false);
- IEnumerable List(string customerId, ListOptions listOptions = null);
+ Task> List(string customerId, ListOptions listOptions = null);
+ Task GetCurrentActiveSub(string customerId);
+ Task AddAddonToSubscription(string customerId, string addonId);
}
}
diff --git a/Core/Resgrid.Model/File.cs b/Core/Resgrid.Model/File.cs
index b571ce5f..6e13be65 100644
--- a/Core/Resgrid.Model/File.cs
+++ b/Core/Resgrid.Model/File.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -35,6 +36,7 @@ public class File : IEntity
public DateTime Timestamp { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return FileId; }
@@ -45,10 +47,13 @@ public object IdValue
public string TableName => "Files";
[NotMapped]
- public string IdName => "DepartmentId";
+ public string IdName => "FileId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Message" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Message" };
public string GetIconType()
{
diff --git a/Core/Resgrid.Model/Form.cs b/Core/Resgrid.Model/Form.cs
new file mode 100644
index 00000000..1981d362
--- /dev/null
+++ b/Core/Resgrid.Model/Form.cs
@@ -0,0 +1,60 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Resgrid.Model
+{
+ public class Form : IEntity
+ {
+ [Required]
+ public string FormId { get; set; }
+
+ [Required]
+ public int DepartmentId { get; set; }
+
+ public virtual Department Department { get; set; }
+
+ [Required]
+ public string Name { get; set; }
+
+ public int Type { get; set; }
+
+ public bool IsActive { get; set; }
+
+ public bool IsDeleted { get; set; }
+
+ public string Data { get; set; }
+
+ public DateTime CreatedOn { get; set; }
+
+ public string CreatedBy { get; set; }
+
+ public DateTime? UpdatedOn { get; set; }
+
+ public string UpdatedBy { get; set; }
+
+ public virtual ICollection Automations { get; set; }
+
+ [NotMapped]
+ [JsonIgnore]
+ public object IdValue
+ {
+ get { return FormId; }
+ set { FormId = (string)value; }
+ }
+
+ [NotMapped]
+ public string TableName => "Forms";
+
+ [NotMapped]
+ public string IdName => "FormId";
+
+ [NotMapped]
+ public int IdType => 1;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Automations" };
+ }
+}
diff --git a/Core/Resgrid.Model/FormAutomation.cs b/Core/Resgrid.Model/FormAutomation.cs
new file mode 100644
index 00000000..a68ad80f
--- /dev/null
+++ b/Core/Resgrid.Model/FormAutomation.cs
@@ -0,0 +1,49 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Resgrid.Model
+{
+ public class FormAutomation : IEntity
+ {
+ [Required]
+ public string FormAutomationId { get; set; }
+
+ [Required]
+ public string FormId { get; set; }
+
+ public virtual Form Form { get; set; }
+
+ [Required]
+ public string TriggerField { get; set; }
+
+ public string TriggerValue { get; set; }
+
+ public int OperationType { get; set; }
+
+ public string OperationValue { get; set; }
+
+
+ [NotMapped]
+ [JsonIgnore]
+ public object IdValue
+ {
+ get { return FormAutomationId; }
+ set { FormAutomationId = (string)value; }
+ }
+
+ [NotMapped]
+ public string TableName => "FormAutomations";
+
+ [NotMapped]
+ public string IdName => "FormAutomationId";
+
+ [NotMapped]
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Message" };
+ }
+}
diff --git a/Core/Resgrid.Model/FormAutomationData.cs b/Core/Resgrid.Model/FormAutomationData.cs
new file mode 100644
index 00000000..785830aa
--- /dev/null
+++ b/Core/Resgrid.Model/FormAutomationData.cs
@@ -0,0 +1,9 @@
+namespace Resgrid.Model
+{
+ public class FormAutomationData
+ {
+ public int Type { get; set; }
+ public string Option1 { get; set; }
+ public string Option2 { get; set; }
+ }
+}
diff --git a/Core/Resgrid.Model/FormTypes.cs b/Core/Resgrid.Model/FormTypes.cs
new file mode 100644
index 00000000..0213aa53
--- /dev/null
+++ b/Core/Resgrid.Model/FormTypes.cs
@@ -0,0 +1,18 @@
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+
+namespace Resgrid.Model
+{
+ ///
+ /// The types of a form
+ ///
+ public enum FormTypes
+ {
+ ///
+ /// Form is for New Call creation
+ ///
+ [Display(Name = "New Call Form")]
+ [Description("New Call Form")]
+ NewCallForm = 0,
+ }
+}
diff --git a/Core/Resgrid.Model/Helpers/TimeConverterHelper.cs b/Core/Resgrid.Model/Helpers/TimeConverterHelper.cs
index 53b0610c..93ae0cad 100644
--- a/Core/Resgrid.Model/Helpers/TimeConverterHelper.cs
+++ b/Core/Resgrid.Model/Helpers/TimeConverterHelper.cs
@@ -105,7 +105,7 @@ public static TimeSpan GetOffsetForDepartment(Department department)
if (!String.IsNullOrEmpty(department.TimeZone))
timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(DateTimeHelpers.ConvertTimeZoneString(department.TimeZone));
else
- timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); // Default to Pacific as it's better then UTC
+ timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(DateTimeHelpers.WindowsToIana("Pacific Standard Time")); // Default to Pacific as it's better then UTC
timeSpan = timeZoneInfo.BaseUtcOffset;
var currentDateTime = DateTime.UtcNow.TimeConverter(department);
diff --git a/Core/Resgrid.Model/IEntity.cs b/Core/Resgrid.Model/IEntity.cs
index 4520152f..50f7fc79 100644
--- a/Core/Resgrid.Model/IEntity.cs
+++ b/Core/Resgrid.Model/IEntity.cs
@@ -10,6 +10,8 @@ public interface IEntity
string IdName { get; }
+ int IdType { get; }
+
IEnumerable IgnoredProperties { get; }
}
}
diff --git a/Core/Resgrid.Model/Identity/IdentityRole.cs b/Core/Resgrid.Model/Identity/IdentityRole.cs
index 2765dab6..e8066d2d 100644
--- a/Core/Resgrid.Model/Identity/IdentityRole.cs
+++ b/Core/Resgrid.Model/Identity/IdentityRole.cs
@@ -1,4 +1,5 @@
-using ProtoBuf;
+using Newtonsoft.Json;
+using ProtoBuf;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
@@ -28,6 +29,7 @@ public IdentityRole(string roleName) : this()
}
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return Id; }
@@ -41,7 +43,10 @@ public object IdValue
public string IdName => "Id";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
diff --git a/Core/Resgrid.Model/Identity/IdentityRoleClaim.cs b/Core/Resgrid.Model/Identity/IdentityRoleClaim.cs
index cf3ee45b..018bbff0 100644
--- a/Core/Resgrid.Model/Identity/IdentityRoleClaim.cs
+++ b/Core/Resgrid.Model/Identity/IdentityRoleClaim.cs
@@ -1,4 +1,5 @@
-using ProtoBuf;
+using Newtonsoft.Json;
+using ProtoBuf;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
@@ -13,8 +14,9 @@ public IdentityRoleClaim()
Id = Guid.NewGuid().ToString();
}
-
+
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return Id; }
@@ -27,8 +29,11 @@ public object IdValue
[NotMapped]
public string IdName => "Id";
+ [NotMapped]
+ public int IdType => 0;
+
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
diff --git a/Core/Resgrid.Model/Identity/IdentityUser.cs b/Core/Resgrid.Model/Identity/IdentityUser.cs
index f8a38fa1..57799401 100644
--- a/Core/Resgrid.Model/Identity/IdentityUser.cs
+++ b/Core/Resgrid.Model/Identity/IdentityUser.cs
@@ -1,4 +1,5 @@
-using ProtoBuf;
+using Newtonsoft.Json;
+using ProtoBuf;
using System;
using System.Collections.Generic;
@@ -156,6 +157,7 @@ public string UserId
public DateTime CreateDate { get; set; }
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return Id; }
@@ -169,7 +171,10 @@ public object IdValue
public string IdName => "Id";
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [System.ComponentModel.DataAnnotations.Schema.NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
diff --git a/Core/Resgrid.Model/Identity/IdentityUserClaim.cs b/Core/Resgrid.Model/Identity/IdentityUserClaim.cs
index 9d7a418f..38d101fd 100644
--- a/Core/Resgrid.Model/Identity/IdentityUserClaim.cs
+++ b/Core/Resgrid.Model/Identity/IdentityUserClaim.cs
@@ -1,4 +1,5 @@
-using ProtoBuf;
+using Newtonsoft.Json;
+using ProtoBuf;
using System;
using System.Collections.Generic;
@@ -7,6 +8,7 @@ namespace Resgrid.Model.Identity
public class IdentityUserClaim : IdentityUserClaim, IEntity
{
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return Id; }
@@ -20,7 +22,10 @@ public object IdValue
public string IdName => "Id";
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [System.ComponentModel.DataAnnotations.Schema.NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
diff --git a/Core/Resgrid.Model/Identity/IdentityUserLoginInfo.cs b/Core/Resgrid.Model/Identity/IdentityUserLoginInfo.cs
index 6db57117..4b9f344f 100644
--- a/Core/Resgrid.Model/Identity/IdentityUserLoginInfo.cs
+++ b/Core/Resgrid.Model/Identity/IdentityUserLoginInfo.cs
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Identity;
+using Newtonsoft.Json;
namespace Resgrid.Model.Identity
{
- public class IdentityUserLoginInfo: IEntity
+ public class IdentityUserLoginInfo : IEntity
{
public string UserId { get; set; }
@@ -37,6 +38,7 @@ public class IdentityUserLoginInfo: IEntity
public string ProviderDisplayName { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return UserId; }
@@ -50,6 +52,9 @@ public object IdValue
public string IdName => "UserId";
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [System.ComponentModel.DataAnnotations.Schema.NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/Identity/IdentityUserRole.cs b/Core/Resgrid.Model/Identity/IdentityUserRole.cs
index 5e889033..de4e1dbb 100644
--- a/Core/Resgrid.Model/Identity/IdentityUserRole.cs
+++ b/Core/Resgrid.Model/Identity/IdentityUserRole.cs
@@ -1,4 +1,5 @@
-using ProtoBuf;
+using Newtonsoft.Json;
+using ProtoBuf;
using System;
using System.Collections.Generic;
@@ -7,6 +8,7 @@ namespace Resgrid.Model.Identity
public class IdentityUserRole : IdentityUserRole, IEntity
{
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return Id; }
@@ -20,7 +22,10 @@ public object IdValue
public string IdName => "Id";
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [System.ComponentModel.DataAnnotations.Schema.NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
[ProtoContract]
diff --git a/Core/Resgrid.Model/InboundMessageEvent.cs b/Core/Resgrid.Model/InboundMessageEvent.cs
index a7b612a0..1ac2b15b 100644
--- a/Core/Resgrid.Model/InboundMessageEvent.cs
+++ b/Core/Resgrid.Model/InboundMessageEvent.cs
@@ -1,48 +1,53 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Resgrid.Model
{
- [Table("InboundMessageEvents")]
- public class InboundMessageEvent : IEntity
- {
- [Key]
- [Required]
- [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
- public int InboundMessageEventId { get; set; }
+ [Table("InboundMessageEvents")]
+ public class InboundMessageEvent : IEntity
+ {
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int InboundMessageEventId { get; set; }
- [Required]
- public int MessageType { get; set; }
+ [Required]
+ public int MessageType { get; set; }
- [Required]
- public string CustomerId { get; set; }
+ [Required]
+ public string CustomerId { get; set; }
- [Required]
- public DateTime RecievedOn { get; set; }
+ [Required]
+ public DateTime RecievedOn { get; set; }
- [Required]
- public string Data { get; set; }
+ [Required]
+ public string Data { get; set; }
- public string Type { get; set; }
+ public string Type { get; set; }
- public bool? Processed { get; set; }
+ public bool? Processed { get; set; }
- [NotMapped]
- public object IdValue
- {
- get { return InboundMessageEventId; }
- set { InboundMessageEventId = (int)value; }
- }
+ [NotMapped]
+ [JsonIgnore]
+ public object IdValue
+ {
+ get { return InboundMessageEventId; }
+ set { InboundMessageEventId = (int)value; }
+ }
- [NotMapped]
- public string TableName => "InboundMessageEvents";
+ [NotMapped]
+ public string TableName => "InboundMessageEvents";
- [NotMapped]
- public string IdName => "InboundMessageEventId";
+ [NotMapped]
+ public string IdName => "InboundMessageEventId";
+
+ [NotMapped]
+ public int IdType => 0;
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
- }
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
+ }
}
diff --git a/Core/Resgrid.Model/Incident.cs b/Core/Resgrid.Model/Incident.cs
index 819417df..fff24f2c 100644
--- a/Core/Resgrid.Model/Incident.cs
+++ b/Core/Resgrid.Model/Incident.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -42,13 +43,14 @@ public class Incident : IEntity
public virtual ICollection Logs { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return IncidentId; }
set { IncidentId = (int)value; }
}
-
+
[NotMapped]
public string TableName => "Incidents";
@@ -56,6 +58,9 @@ public object IdValue
public string IdName => "IncidentId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Call", "Definition", "Logs" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Call", "Definition", "Logs" };
}
}
diff --git a/Core/Resgrid.Model/IncidentLog.cs b/Core/Resgrid.Model/IncidentLog.cs
index 21f9bf79..ae75c91c 100644
--- a/Core/Resgrid.Model/IncidentLog.cs
+++ b/Core/Resgrid.Model/IncidentLog.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -37,6 +38,7 @@ public class IncidentLog : IEntity
public string Description { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return IncidentLogId; }
@@ -50,6 +52,9 @@ public object IdValue
public string IdName => "IncidentLogId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Incident", "Unit" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Incident", "Unit" };
}
}
diff --git a/Core/Resgrid.Model/Inventory.cs b/Core/Resgrid.Model/Inventory.cs
index 3459b953..3dbd191e 100644
--- a/Core/Resgrid.Model/Inventory.cs
+++ b/Core/Resgrid.Model/Inventory.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -49,6 +50,7 @@ public class Inventory : IEntity
public virtual Unit Unit { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return InventoryId; }
@@ -62,6 +64,9 @@ public object IdValue
public string IdName => "InventoryId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Group", "AddedBy", "Unit", "Type" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Group", "AddedBy", "Unit", "Type" };
}
}
diff --git a/Core/Resgrid.Model/InventoryType.cs b/Core/Resgrid.Model/InventoryType.cs
index f0d3ecee..c399d01e 100644
--- a/Core/Resgrid.Model/InventoryType.cs
+++ b/Core/Resgrid.Model/InventoryType.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -31,6 +32,7 @@ public class InventoryType : IEntity
public virtual ICollection Inventories { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return InventoryTypeId; }
@@ -44,6 +46,9 @@ public object IdValue
public string IdName => "InventoryTypeId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Inventories" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Inventories" };
}
}
diff --git a/Core/Resgrid.Model/Invite.cs b/Core/Resgrid.Model/Invite.cs
index 58009788..7826f7c2 100644
--- a/Core/Resgrid.Model/Invite.cs
+++ b/Core/Resgrid.Model/Invite.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -40,6 +41,7 @@ public class Invite : IEntity
public virtual Department Department { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return InviteId; }
@@ -53,6 +55,9 @@ public object IdValue
public string IdName => "InviteId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "SendingUser", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "SendingUser", "Department" };
}
}
diff --git a/Core/Resgrid.Model/Job.cs b/Core/Resgrid.Model/Job.cs
index a6c55db6..f105b80c 100644
--- a/Core/Resgrid.Model/Job.cs
+++ b/Core/Resgrid.Model/Job.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -28,6 +29,7 @@ public class Job : IEntity
public DateTime? LastResetTimestamp { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return JobId; }
@@ -41,6 +43,9 @@ public object IdValue
public string IdName => "JobId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/Log.cs b/Core/Resgrid.Model/Log.cs
index b1242aa8..15f30fa6 100644
--- a/Core/Resgrid.Model/Log.cs
+++ b/Core/Resgrid.Model/Log.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -92,6 +93,7 @@ public class Log : IEntity
public virtual ICollection Users { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return LogId; }
@@ -105,6 +107,9 @@ public object IdValue
public string IdName => "LogId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "StationGroup", "InvestigatedBy", "LoggedBy", "Officer", "Call", "Units", "Users" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "StationGroup", "InvestigatedBy", "LoggedBy", "Officer", "Call", "Units", "Users" };
}
}
diff --git a/Core/Resgrid.Model/LogAttachment.cs b/Core/Resgrid.Model/LogAttachment.cs
index 70654b2e..b99ec0e5 100644
--- a/Core/Resgrid.Model/LogAttachment.cs
+++ b/Core/Resgrid.Model/LogAttachment.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -41,6 +42,7 @@ public class LogAttachment : IEntity
public int Size { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return LogAttachmentId; }
@@ -54,6 +56,9 @@ public object IdValue
public string IdName => "LogAttachmentId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Log" };
- }
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Log" };
+ }
}
diff --git a/Core/Resgrid.Model/LogEntry.cs b/Core/Resgrid.Model/LogEntry.cs
index 2593cdda..1719c264 100644
--- a/Core/Resgrid.Model/LogEntry.cs
+++ b/Core/Resgrid.Model/LogEntry.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -19,6 +20,7 @@ public class LogEntry : IEntity
public string logger { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return id; }
@@ -32,6 +34,9 @@ public object IdValue
public string IdName => "id";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/LogUnit.cs b/Core/Resgrid.Model/LogUnit.cs
index daebbabc..16822a54 100644
--- a/Core/Resgrid.Model/LogUnit.cs
+++ b/Core/Resgrid.Model/LogUnit.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -36,6 +37,7 @@ public class LogUnit : IEntity
public DateTime? InQuarters { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return LogUnitId; }
@@ -49,6 +51,9 @@ public object IdValue
public string IdName => "LogUnitId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Log", "Unit" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Log", "Unit" };
}
}
diff --git a/Core/Resgrid.Model/LogUser.cs b/Core/Resgrid.Model/LogUser.cs
index e0b71969..8c68ffbc 100644
--- a/Core/Resgrid.Model/LogUser.cs
+++ b/Core/Resgrid.Model/LogUser.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -18,7 +19,7 @@ public class LogUser : IEntity
public int LogId { get; set; }
public virtual Log Log { get; set; }
-
+
[ForeignKey("Unit"), DatabaseGenerated(DatabaseGeneratedOption.None)]
public int? UnitId { get; set; }
@@ -30,6 +31,7 @@ public class LogUser : IEntity
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return LogUserId; }
@@ -43,6 +45,9 @@ public object IdValue
public string IdName => "LogUserId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Log", "Unit", "User" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Log", "Unit", "User" };
}
}
diff --git a/Core/Resgrid.Model/Message.cs b/Core/Resgrid.Model/Message.cs
index bd590661..9a818d25 100644
--- a/Core/Resgrid.Model/Message.cs
+++ b/Core/Resgrid.Model/Message.cs
@@ -5,6 +5,7 @@
using Resgrid.Model.Identity;
using System.Linq;
using ProtoBuf;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
@@ -60,7 +61,7 @@ public class Message : IEntity
[ProtoMember(12)]
public int Type { get; set; }
-
+
[ProtoMember(13)]
public DateTime? ExpireOn { get; set; }
@@ -68,6 +69,7 @@ public class Message : IEntity
public virtual ICollection MessageRecipients { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return MessageId; }
@@ -81,7 +83,10 @@ public object IdValue
public string IdName => "MessageId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "SendingUser", "ReceivingUser", "MessageRecipients" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "SendingUser", "ReceivingUser", "MessageRecipients" };
public List GetRecipients()
{
diff --git a/Core/Resgrid.Model/MessageRecipient.cs b/Core/Resgrid.Model/MessageRecipient.cs
index 8c3d2991..ee12d944 100644
--- a/Core/Resgrid.Model/MessageRecipient.cs
+++ b/Core/Resgrid.Model/MessageRecipient.cs
@@ -5,6 +5,7 @@
using ProtoBuf;
using Resgrid.Framework;
using System.Collections.Generic;
+using Newtonsoft.Json;
namespace Resgrid.Model
{
@@ -54,6 +55,7 @@ public class MessageRecipient : IEntity
public decimal? Longitude { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return MessageRecipientId; }
@@ -67,6 +69,9 @@ public object IdValue
public string IdName => "MessageRecipientId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Message", "User"};
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Message", "User" };
}
}
diff --git a/Core/Resgrid.Model/MobileCarriers.cs b/Core/Resgrid.Model/MobileCarriers.cs
index 606fdc06..9497b1d8 100644
--- a/Core/Resgrid.Model/MobileCarriers.cs
+++ b/Core/Resgrid.Model/MobileCarriers.cs
@@ -138,6 +138,21 @@ public enum MobileCarriers
[Description("Spark")]
Spark = 42, // SMS Direct Send
+
+ [Description("Mint")]
+ Mint = 43, // SMS Direct Send
+
+ [Description("Chatr")]
+ Chatr = 44, // SMS Direct Send
+
+ [Description("Eastlink")]
+ Eastlink = 45, // SMS Direct Send
+
+ [Description("Freedom Mobile")]
+ FreedomMobile = 46, // SMS Direct Send
+
+ [Description("FSM Telecom")]
+ FSMTC = 47, // SMS Direct Send
}
public static class Carriers
@@ -185,7 +200,12 @@ public static class Carriers
{MobileCarriers.EE, "Direct"},
{MobileCarriers.MTSMobility, "{0}@text.mtsmobility.com"},
{MobileCarriers.Fido, "Direct"},
- {MobileCarriers.Spark, "Direct"}
+ {MobileCarriers.Spark, "Direct"},
+ {MobileCarriers.Mint, "{0}@tmomail.net"},
+ {MobileCarriers.Chatr, "Direct"},
+ {MobileCarriers.Eastlink, "Direct"},
+ {MobileCarriers.FreedomMobile, "Direct"},
+ {MobileCarriers.FSMTC, "Direct"},
};
public static Dictionary> CarriersNumberLength = new Dictionary>()
@@ -242,7 +262,12 @@ public static class Carriers
MobileCarriers.BellMobility,
MobileCarriers.SaskTel,
MobileCarriers.Spark,
- MobileCarriers.Koodo
+ MobileCarriers.Koodo,
+ MobileCarriers.Mint,
+ MobileCarriers.Chatr,
+ MobileCarriers.Eastlink,
+ MobileCarriers.FreedomMobile,
+ MobileCarriers.FSMTC
};
public static HashSet OnPremSmsGatewayCarriers = new HashSet()
diff --git a/Core/Resgrid.Model/Note.cs b/Core/Resgrid.Model/Note.cs
index 837c4dae..4e6741b0 100644
--- a/Core/Resgrid.Model/Note.cs
+++ b/Core/Resgrid.Model/Note.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -6,7 +7,7 @@
namespace Resgrid.Model
{
[Table("Notes")]
- public class Note: IEntity
+ public class Note : IEntity
{
[Key]
[Required]
@@ -41,6 +42,7 @@ public class Note: IEntity
public DateTime AddedOn { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return NoteId; }
@@ -54,6 +56,9 @@ public object IdValue
public string IdName => "NoteId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/NotificationAlert.cs b/Core/Resgrid.Model/NotificationAlert.cs
index cd15226a..bb404506 100644
--- a/Core/Resgrid.Model/NotificationAlert.cs
+++ b/Core/Resgrid.Model/NotificationAlert.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -6,7 +7,7 @@
namespace Resgrid.Model
{
[Table("NotificationAlerts")]
- public class NotificationAlert: IEntity
+ public class NotificationAlert : IEntity
{
[Key]
[Required]
@@ -37,13 +38,14 @@ public class NotificationAlert: IEntity
public string ManualNote { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return NotificationAlertId; }
set { NotificationAlertId = (int)value; }
}
-
+
[NotMapped]
public string TableName => "NotificationAlerts";
@@ -51,6 +53,9 @@ public object IdValue
public string IdName => "NotificationAlertId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Group" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Group" };
}
}
diff --git a/Core/Resgrid.Model/Payment.cs b/Core/Resgrid.Model/Payment.cs
index 63319178..ee90c1d4 100644
--- a/Core/Resgrid.Model/Payment.cs
+++ b/Core/Resgrid.Model/Payment.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
using Resgrid.Framework;
using Resgrid.Model.Identity;
@@ -95,13 +96,14 @@ public class Payment : IEntity
public string SubscriptionId { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PaymentId; }
set { PaymentId = (int)value; }
}
-
+
[NotMapped]
public string TableName => "Payments";
@@ -109,13 +111,16 @@ public object IdValue
public string IdName => "PaymentId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Plan", "UpgradedPayment" , "PurchasingUser" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Plan", "UpgradedPayment", "PurchasingUser" };
public DateTime GetEndDate()
{
if (Plan != null)
{
- switch ((PlanFrequency) Plan.Frequency)
+ switch ((PlanFrequency)Plan.Frequency)
{
case PlanFrequency.Never:
return DateTime.MaxValue;
diff --git a/Core/Resgrid.Model/PaymentAddon.cs b/Core/Resgrid.Model/PaymentAddon.cs
new file mode 100644
index 00000000..8923747b
--- /dev/null
+++ b/Core/Resgrid.Model/PaymentAddon.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
+using ProtoBuf;
+using Resgrid.Framework;
+using Resgrid.Model.Identity;
+
+namespace Resgrid.Model
+{
+ [Table("PaymentAddons")]
+ [ProtoContract]
+ public class PaymentAddon : IEntity
+ {
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ [ProtoMember(1)]
+ public string PaymentAddonId { get; set; }
+
+ [Required]
+ [ProtoMember(2)]
+ public int DepartmentId { get; set; }
+
+ [ProtoMember(3)]
+ public virtual Department Department { get; set; }
+
+ [Required]
+ [ProtoMember(4)]
+ public string PlanAddonId { get; set; }
+
+ [ForeignKey("PlanAddonId")]
+ [ProtoMember(5)]
+ public virtual PlanAddon PlanAddon { get; set; }
+
+ [ProtoMember(11)]
+ public string Description { get; set; }
+
+ [ProtoMember(12)]
+ [Required]
+ public DateTime PurchaseOn { get; set; }
+
+ [ProtoMember(13)]
+ [Required]
+ public DateTime EffectiveOn { get; set; }
+
+ [ProtoMember(14)]
+ public DateTime EndingOn { get; set; }
+
+ [ProtoMember(15)]
+ public double Amount { get; set; }
+
+ [ProtoMember(17)]
+ public string TransactionId { get; set; }
+
+ [ProtoMember(19)]
+ public bool Cancelled { get; set; }
+
+ [ProtoMember(20)]
+ public DateTime? CancelledOn { get; set; }
+
+ [ProtoMember(21)]
+ public string CancelledData { get; set; }
+
+ [ProtoMember(22)]
+ public string Data { get; set; }
+
+ [ProtoMember(23)]
+ public string SubscriptionId { get; set; }
+
+ [NotMapped]
+ [JsonIgnore]
+ public object IdValue
+ {
+ get { return PaymentAddonId; }
+ set { PaymentAddonId = (string)value; }
+ }
+
+
+ [NotMapped]
+ public string TableName => "PaymentAddons";
+
+ [NotMapped]
+ public string IdName => "PaymentAddonId";
+
+ [NotMapped]
+ public int IdType => 1;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "PlanAddon" };
+ }
+}
diff --git a/Core/Resgrid.Model/PaymentProviderEvent.cs b/Core/Resgrid.Model/PaymentProviderEvent.cs
index 60478e11..38b26853 100644
--- a/Core/Resgrid.Model/PaymentProviderEvent.cs
+++ b/Core/Resgrid.Model/PaymentProviderEvent.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -6,7 +7,7 @@
namespace Resgrid.Model
{
[Table("PaymentProviderEvents")]
- public class PaymentProviderEvent: IEntity
+ public class PaymentProviderEvent : IEntity
{
[Key]
[Required]
@@ -30,6 +31,7 @@ public class PaymentProviderEvent: IEntity
public bool? Processed { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PaymentProviderEventId; }
@@ -43,6 +45,9 @@ public object IdValue
public string IdName => "PaymentProviderEventId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/Permission.cs b/Core/Resgrid.Model/Permission.cs
index 99754000..5da6f2ef 100644
--- a/Core/Resgrid.Model/Permission.cs
+++ b/Core/Resgrid.Model/Permission.cs
@@ -2,13 +2,14 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
{
[Table("Permissions")]
[ProtoContract]
- public class Permission: IEntity
+ public class Permission : IEntity
{
[Key]
[Required]
@@ -41,6 +42,7 @@ public class Permission: IEntity
public bool LockToGroup { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PermissionId; }
@@ -54,6 +56,9 @@ public object IdValue
public string IdName => "PermissionId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department" };
}
}
diff --git a/Core/Resgrid.Model/PersonnelCertification.cs b/Core/Resgrid.Model/PersonnelCertification.cs
index 2d623225..01b1fe69 100644
--- a/Core/Resgrid.Model/PersonnelCertification.cs
+++ b/Core/Resgrid.Model/PersonnelCertification.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -47,6 +48,7 @@ public class PersonnelCertification : IEntity
public byte[] Data { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PersonnelCertificationId; }
@@ -60,6 +62,9 @@ public object IdValue
public string IdName => "PersonnelCertificationId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "User" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "User" };
}
}
diff --git a/Core/Resgrid.Model/PersonnelRole.cs b/Core/Resgrid.Model/PersonnelRole.cs
index ac19d2db..33e29e1c 100644
--- a/Core/Resgrid.Model/PersonnelRole.cs
+++ b/Core/Resgrid.Model/PersonnelRole.cs
@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -30,6 +31,7 @@ public class PersonnelRole : IEntity
public virtual ICollection Users { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PersonnelRoleId; }
@@ -43,7 +45,10 @@ public object IdValue
public string IdName => "PersonnelRoleId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Users" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Users" };
public bool IsUserInRole(string userId)
{
diff --git a/Core/Resgrid.Model/PersonnelRoleUser.cs b/Core/Resgrid.Model/PersonnelRoleUser.cs
index bee5916d..4ad9e8e2 100644
--- a/Core/Resgrid.Model/PersonnelRoleUser.cs
+++ b/Core/Resgrid.Model/PersonnelRoleUser.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using Resgrid.Model.Identity;
namespace Resgrid.Model
@@ -28,13 +29,14 @@ public class PersonnelRoleUser : IEntity
public IdentityUser User { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PersonnelRoleUserId; }
set { PersonnelRoleUserId = (int)value; }
}
-
+
[NotMapped]
public string TableName => "PersonnelRoleUsers";
@@ -42,6 +44,9 @@ public object IdValue
public string IdName => "PersonnelRoleUserId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Role", "User" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Role", "User" };
}
}
diff --git a/Core/Resgrid.Model/Plan.cs b/Core/Resgrid.Model/Plan.cs
index 9364c6ba..b3a4c024 100644
--- a/Core/Resgrid.Model/Plan.cs
+++ b/Core/Resgrid.Model/Plan.cs
@@ -2,6 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -33,7 +34,7 @@ public class Plan : IEntity
public string GetLimitForType(PlanLimitTypes limitType)
{
- var limt = PlanLimits.FirstOrDefault(x => x.LimitType == (int) limitType);
+ var limt = PlanLimits.FirstOrDefault(x => x.LimitType == (int)limitType);
if (limt != null)
return limt.LimitValue.ToString();
@@ -46,15 +47,21 @@ public int GetLimitForTypeAsInt(PlanLimitTypes limitType)
if (Config.SystemBehaviorConfig.RedirectHomeToLogin)
return int.MaxValue;
- var limt = PlanLimits.FirstOrDefault(x => x.LimitType == (int)limitType);
+ if (PlanLimits != null && PlanLimits.Any())
+ {
+ var limt = PlanLimits.FirstOrDefault(x => x.LimitType == (int)limitType);
- if (limt != null)
- return limt.LimitValue;
- else
- return int.MaxValue;
+ if (limt != null)
+ return limt.LimitValue;
+ else
+ return int.MaxValue;
+ }
+
+ return int.MaxValue;
}
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PlanId; }
@@ -68,6 +75,9 @@ public object IdValue
public string IdName => "PlanId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Role", "User" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Role", "User" };
}
}
diff --git a/Core/Resgrid.Model/PlanAddon.cs b/Core/Resgrid.Model/PlanAddon.cs
new file mode 100644
index 00000000..0e86d9b0
--- /dev/null
+++ b/Core/Resgrid.Model/PlanAddon.cs
@@ -0,0 +1,41 @@
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Resgrid.Model
+{
+ public class PlanAddon : IEntity
+ {
+ public string PlanAddonId { get; set; }
+
+ public int PlanId { get; set; }
+
+ public virtual Plan Plan { get; set; }
+
+ public int AddonType { get; set; }
+
+ public double Cost { get; set; }
+
+ public string ExternalId { get; set; }
+
+ [NotMapped]
+ [JsonIgnore]
+ public object IdValue
+ {
+ get { return PlanAddonId; }
+ set { PlanAddonId = (string)value; }
+ }
+
+ [NotMapped]
+ public string TableName => "PlanAddons";
+
+ [NotMapped]
+ public string IdName => "PlanAddonId";
+
+ [NotMapped]
+ public int IdType => 1;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Plan" };
+ }
+}
diff --git a/Core/Resgrid.Model/PlanAddonTypes.cs b/Core/Resgrid.Model/PlanAddonTypes.cs
new file mode 100644
index 00000000..871f751e
--- /dev/null
+++ b/Core/Resgrid.Model/PlanAddonTypes.cs
@@ -0,0 +1,7 @@
+namespace Resgrid.Model
+{
+ public enum PlanAddonTypes
+ {
+ PTT = 1
+ }
+}
diff --git a/Core/Resgrid.Model/PlanLimit.cs b/Core/Resgrid.Model/PlanLimit.cs
index 0fc84a8a..f08ae07e 100644
--- a/Core/Resgrid.Model/PlanLimit.cs
+++ b/Core/Resgrid.Model/PlanLimit.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -28,6 +29,7 @@ public class PlanLimit : IEntity
public int LimitValue { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PlanLimitId; }
@@ -41,6 +43,9 @@ public object IdValue
public string IdName => "PlanLimitId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Plan" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Plan" };
}
}
diff --git a/Core/Resgrid.Model/PlanLimitTypes.cs b/Core/Resgrid.Model/PlanLimitTypes.cs
index fdeb3b4c..aba4bfa8 100644
--- a/Core/Resgrid.Model/PlanLimitTypes.cs
+++ b/Core/Resgrid.Model/PlanLimitTypes.cs
@@ -1,10 +1,11 @@
-namespace Resgrid.Model
+ namespace Resgrid.Model
{
public enum PlanLimitTypes
{
Personnel = 1,
Groups = 2,
Units = 3,
- Roles = 4
+ Roles = 4,
+ InvoicesPerMonth = 5
}
-}
\ No newline at end of file
+}
diff --git a/Core/Resgrid.Model/Poi.cs b/Core/Resgrid.Model/Poi.cs
index 29befe48..c0a1f529 100644
--- a/Core/Resgrid.Model/Poi.cs
+++ b/Core/Resgrid.Model/Poi.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -25,13 +26,14 @@ public class Poi : IEntity
public string Note { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PoiId; }
set { PoiId = (int)value; }
}
-
+
[NotMapped]
public string TableName => "Pois";
@@ -39,6 +41,9 @@ public object IdValue
public string IdName => "PoiId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Type" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Type" };
}
}
diff --git a/Core/Resgrid.Model/PoiType.cs b/Core/Resgrid.Model/PoiType.cs
index daa8779e..566920b2 100644
--- a/Core/Resgrid.Model/PoiType.cs
+++ b/Core/Resgrid.Model/PoiType.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Newtonsoft.Json;
+using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -38,6 +39,7 @@ public class PoiType : IEntity
public int Count { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return PoiTypeId; }
@@ -51,6 +53,9 @@ public object IdValue
public string IdName => "PoiTypeId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName", "Department", "Pois", "Count" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName", "Department", "Pois", "Count" };
}
}
diff --git a/Core/Resgrid.Model/ProcessLog.cs b/Core/Resgrid.Model/ProcessLog.cs
index 4af3e048..06a51a82 100644
--- a/Core/Resgrid.Model/ProcessLog.cs
+++ b/Core/Resgrid.Model/ProcessLog.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
+using Newtonsoft.Json;
using ProtoBuf;
namespace Resgrid.Model
@@ -29,13 +30,14 @@ public class ProcessLog : IEntity
public DateTime Timestamp { get; set; }
[NotMapped]
+ [JsonIgnore]
public object IdValue
{
get { return ProcessLogId; }
set { ProcessLogId = (int)value; }
}
-
+
[NotMapped]
public string TableName => "ProcessLogs";
@@ -43,6 +45,9 @@ public object IdValue
public string IdName => "ProcessLogId";
[NotMapped]
- public IEnumerable IgnoredProperties => new string[] { "IdValue", "TableName", "IdName" };
+ public int IdType => 0;
+
+ [NotMapped]
+ public IEnumerable IgnoredProperties => new string[] { "IdValue", "IdType", "TableName", "IdName" };
}
}
diff --git a/Core/Resgrid.Model/Providers/IAuditEventProvider.cs b/Core/Resgrid.Model/Providers/IAuditEventProvider.cs
new file mode 100644
index 00000000..1f2d80b8
--- /dev/null
+++ b/Core/Resgrid.Model/Providers/IAuditEventProvider.cs
@@ -0,0 +1,10 @@
+using Resgrid.Model.Events;
+using System.Threading.Tasks;
+
+namespace Resgrid.Model.Providers
+{
+ public interface IAuditEventProvider
+ {
+ Task EnqueueAuditEventAsync(AuditEvent auditEvent);
+ }
+}
diff --git a/Core/Resgrid.Model/Providers/IEmailMarketingProvider.cs b/Core/Resgrid.Model/Providers/IEmailMarketingProvider.cs
index 61c21e57..b16697de 100644
--- a/Core/Resgrid.Model/Providers/IEmailMarketingProvider.cs
+++ b/Core/Resgrid.Model/Providers/IEmailMarketingProvider.cs
@@ -1,10 +1,12 @@
-namespace Resgrid.Model.Providers
+using System.Threading.Tasks;
+
+namespace Resgrid.Model.Providers
{
public interface IEmailMarketingProvider
{
- void Unsubscribe(string emailAddress);
- void SubscribeUserToAdminList(string firstName, string lastName, string emailAddress);
- void SubscribeUserToUsersList(string firstName, string lastName, string emailAddress);
- void IncreaseStatusPageMetric(string metric);
+ Task Unsubscribe(string emailAddress);
+ Task SubscribeUserToAdminList(string firstName, string lastName, string emailAddress);
+ Task SubscribeUserToUsersList(string firstName, string lastName, string emailAddress);
+ Task IncreaseStatusPageMetric(string metric);
}
}
diff --git a/Core/Resgrid.Model/Providers/IGeoLocationProvider.cs b/Core/Resgrid.Model/Providers/IGeoLocationProvider.cs
index adcaf4e9..e919e011 100644
--- a/Core/Resgrid.Model/Providers/IGeoLocationProvider.cs
+++ b/Core/Resgrid.Model/Providers/IGeoLocationProvider.cs
@@ -9,10 +9,10 @@ public interface IGeoLocationProvider
Task GetLatLonFromAddress(string address);
Task GetRoute(string start, string end);
Task GetRoute(double startLat, double startLon, double endLat, double endLon);
- Coordinates GetCoordinatesFromW3W(string words);
- string GetW3WFromCoordinates(Coordinates coordinates);
- Coordinates GetLatLonFromAddressLocationIQ(string address);
- string GetAddressFromLatLonLocationIQ(string lat, string lon);
+ Task GetCoordinatesFromW3W(string words);
+ Task GetW3WFromCoordinates(Coordinates coordinates);
+ Task GetLatLonFromAddressLocationIQ(string address);
+ Task GetAddressFromLatLonLocationIQ(string lat, string lon);
Task GetCoordinatesFromW3WAsync(string words);
}
}
diff --git a/Core/Resgrid.Model/Providers/INumberProvider.cs b/Core/Resgrid.Model/Providers/INumberProvider.cs
index 85f36913..5b8ee190 100644
--- a/Core/Resgrid.Model/Providers/INumberProvider.cs
+++ b/Core/Resgrid.Model/Providers/INumberProvider.cs
@@ -1,11 +1,12 @@
using System.Collections.Generic;
+using System.Threading.Tasks;
namespace Resgrid.Model.Providers
{
public interface INumberProvider
{
- List GetAvailableNumbers(string country, string areaCode);
- bool ProvisionNumber(string country, string number);
+ Task> GetAvailableNumbers(string country, string areaCode);
+ Task ProvisionNumber(string country, string number);
string ConvertCountryToCode(string country);
}
-}
\ No newline at end of file
+}
diff --git a/Core/Resgrid.Model/Providers/IPrinterProvider.cs b/Core/Resgrid.Model/Providers/IPrinterProvider.cs
index c602e059..e3228433 100644
--- a/Core/Resgrid.Model/Providers/IPrinterProvider.cs
+++ b/Core/Resgrid.Model/Providers/IPrinterProvider.cs
@@ -1,14 +1,15 @@
using Resgrid.Model.Providers.Models.PrintNode;
using System.Collections.Generic;
+using System.Threading.Tasks;
namespace Resgrid.Model.Providers
{
public interface IPrinterProvider
{
- Whoami Whoami(string apiKey);
- List GetComputers(string apiKey);
- List GetPrinters(string apiKey);
- List GetPrintJobs(string apiKey);
- bool SubmitPrintJob(string apiKey, int printerId, string title, string url);
+ Task Whoami(string apiKey);
+ Task> GetComputers(string apiKey);
+ Task> GetPrinters(string apiKey);
+ Task> GetPrintJobs(string apiKey);
+ Task SubmitPrintJob(string apiKey, int printerId, string title, string url);
}
}
diff --git a/Core/Resgrid.Model/Providers/IRabbitInboundEventProvider.cs b/Core/Resgrid.Model/Providers/IRabbitInboundEventProvider.cs
index bf82783c..2dfd6bf4 100644
--- a/Core/Resgrid.Model/Providers/IRabbitInboundEventProvider.cs
+++ b/Core/Resgrid.Model/Providers/IRabbitInboundEventProvider.cs
@@ -5,6 +5,8 @@ namespace Resgrid.Model.Providers
{
public interface IRabbitInboundEventProvider
{
- void RegisterForEvents(Func personnelStatusChanged, Func unitStatusChanged, Func callStatusChanged, Func personnelStaffingChanged);
+ void RegisterForEvents(Func personnelStatusChanged, Func unitStatusChanged,
+ Func callStatusChanged, Func personnelStaffingChanged,
+ Func callAdded, Func callClosed);
}
}
diff --git a/Core/Resgrid.Model/Providers/IRabbitOutboundQueueProvider.cs b/Core/Resgrid.Model/Providers/IRabbitOutboundQueueProvider.cs
index fe46b191..cf40ef60 100644
--- a/Core/Resgrid.Model/Providers/IRabbitOutboundQueueProvider.cs
+++ b/Core/Resgrid.Model/Providers/IRabbitOutboundQueueProvider.cs
@@ -1,4 +1,5 @@
-using Resgrid.Model.Queue;
+using Resgrid.Model.Events;
+using Resgrid.Model.Queue;
namespace Resgrid.Model.Providers
{
@@ -10,6 +11,7 @@ public interface IRabbitOutboundQueueProvider
bool EnqueueNotification(NotificationItem notificationQueue);
bool EnqueueShiftNotification(ShiftQueueItem shiftQueueItem);
bool EnqueueCqrsEvent(CqrsEvent cqrsEvent);
+ bool EnqueueAuditEvent(AuditEvent auditEvent);
bool VerifyAndCreateClients();
}
}
diff --git a/Core/Resgrid.Model/Providers/ITextMessageProvider.cs b/Core/Resgrid.Model/Providers/ITextMessageProvider.cs
index df77dd83..2bccbcd1 100644
--- a/Core/Resgrid.Model/Providers/ITextMessageProvider.cs
+++ b/Core/Resgrid.Model/Providers/ITextMessageProvider.cs
@@ -1,7 +1,9 @@
-namespace Resgrid.Model.Providers
+using System.Threading.Tasks;
+
+namespace Resgrid.Model.Providers
{
public interface ITextMessageProvider
{
- void SendTextMessage(string number, string message, string departmentNumber, MobileCarriers carrier, int departmentId, bool forceGateway = false, bool isCall = false);
+ Task