This commit is contained in:
2020-07-23 22:43:58 +00:00
parent 57921d9488
commit 16a0553291
8 changed files with 12 additions and 14 deletions

View File

@@ -296,6 +296,7 @@ namespace AyaNova.Api.Controllers
TranslationKeysToFetch.Add("NotifyEventUnitWarrantyExpiry");
TranslationKeysToFetch.Add("NotifyEventUnitMeterReadingMultipleExceeded");
TranslationKeysToFetch.Add("NotifyEventServerOperationsProblem");
TranslationKeysToFetch.Add("NotifyEventGeneralNotification");
var LT = await TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, translationId);
@@ -327,6 +328,7 @@ namespace AyaNova.Api.Controllers
ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventUnitWarrantyExpiry"], Id = (long)NotifyEventType.UnitWarrantyExpiry });
ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventUnitMeterReadingMultipleExceeded"], Id = (long)NotifyEventType.UnitMeterReadingMultipleExceeded });
ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventServerOperationsProblem"], Id = (long)NotifyEventType.ServerOperationsProblem });
ReturnList.Add(new NameIdItem() { Name = LT["NotifyEventGeneralNotification"], Id = (long)NotifyEventType.GeneralNotification });
}
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(NotifyDeliveryMethod).ToString()).ToLowerInvariant())

View File

@@ -76,7 +76,9 @@ namespace AyaNova.Biz
//this will likely be a development error, not a production error so no need to log etc
throw new System.ArgumentException("NotifyEventProcessor:AddGeneralNotifyEvent: GeneralNotification requires a user id but none was specified");
}
var UserName = await ct.User.Where(z => z.Id == userId).Select(z => z.Name).FirstOrDefaultAsync();
NotifyEvent n = new NotifyEvent() { EventType = eventType, UserId = userId, Message = message, NotifySubscriptionId = 0, Name = UserName };
await ct.NotifyEvent.AddAsync(n);
await ct.SaveChangesAsync();

View File

@@ -10,11 +10,11 @@ namespace AyaNova.Models
[Required]
public long TranslationId { get; set; }
//-------------
[EmailAddress]
public string EmailAddress { get; set; }
public bool CopyGeneralNotificationsToEmail { get; set; }//in addition to deliving general notification in-app, also send a copy to email address
/*
Hexadecimal notation: #RGB[A]
R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (09, AF). A is optional. The three-digit notation (#RGB) is a shorter version of the six-digit form (#RRGGBB). For example, #f09 is the same color as #ff0099. Likewise, the four-digit RGB notation (#RGBA) is a shorter version of the eight-digit form (#RRGGBBAA). For example, #0f38 is the same color as #00ff3388.
@@ -29,7 +29,6 @@ namespace AyaNova.Models
public bool Hour12 { get; set; }
//relations
//https://docs.microsoft.com/en-us/ef/core/modeling/relationships#other-relationship-patterns
[JsonIgnore]//hide from being returned (as null anyway) in routes
@@ -43,7 +42,6 @@ namespace AyaNova.Models
CurrencyName = "USD";
Hour12 = true;
UiColor = "#000000";//black is the default
CopyGeneralNotificationsToEmail = false;
}
}

View File

@@ -1902,6 +1902,5 @@
"ConnectionSecurity": "SMTP-Verbindungssicherheit",
"SmtpServerPort": "SMTP-Server-Port",
"NotifyFromAddress": "SMTP-Benachrichtigungsadresse",
"AyaNovaServerURL": "AyaNova Server URL",
"CopyGeneralNotificationsToEmail":"Senden Sie eine Kopie der allgemeinen Benachrichtigungen an die E-Mail-Adresse"
"AyaNovaServerURL": "AyaNova Server URL"
}

View File

@@ -1902,6 +1902,5 @@
"ConnectionSecurity": "SMTP connection security",
"SmtpServerPort": "SMTP server port",
"NotifyFromAddress": "SMTP notify from address",
"AyaNovaServerURL": "AyaNova server URL",
"CopyGeneralNotificationsToEmail":"Send a copy of general notifications via email"
"AyaNovaServerURL": "AyaNova server URL"
}

View File

@@ -1902,6 +1902,5 @@
"ConnectionSecurity": "Seguridad de conexión del servidor SMTP",
"SmtpServerPort": "Puerto SMTP",
"NotifyFromAddress": "Notificación SMTP desde la dirección",
"AyaNovaServerURL": "URL del servidor AyaNova",
"CopyGeneralNotificationsToEmail":"Enviar una copia de las notificaciones generales a la dirección de correo electrónico"
"AyaNovaServerURL": "URL del servidor AyaNova"
}

View File

@@ -1902,6 +1902,5 @@
"ConnectionSecurity": "Sécurité de la connexion SMTP",
"SmtpServerPort": "Port du serveur SMTP",
"NotifyFromAddress": "Notification SMTP envoyée depuis l'adresse",
"AyaNovaServerURL": "URL du serveur AyaNova",
"CopyGeneralNotificationsToEmail": "Envoyer une copie des notifications générales à l'adresse e-mail"
"AyaNovaServerURL": "URL du serveur AyaNova"
}

View File

@@ -22,7 +22,7 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 12;
internal const long EXPECTED_COLUMN_COUNT = 384;
internal const long EXPECTED_COLUMN_COUNT = 383;
internal const long EXPECTED_INDEX_COUNT = 139;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
@@ -338,7 +338,7 @@ $BODY$;
//Add user options table
await ExecQueryAsync("CREATE TABLE auseroptions (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, " +
"userid bigint not null, translationid bigint not null REFERENCES atranslation (id), languageoverride text, timezoneoverride text, "+
"currencyname text, hour12 bool not null, emailaddress text, copygeneralnotificationstoemail bool not null uicolor varchar(12) not null default '#000000')");
"currencyname text, hour12 bool not null, emailaddress text, uicolor varchar(12) not null default '#000000')");
//Prime the db with the default SuperUser account