From b5ee22da1db6c1d9e437f28ae26665e92fd10c0e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 10 Jul 2020 17:09:54 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- server/AyaNova/Controllers/NotifyController.cs | 7 ++----- server/AyaNova/models/Notification.cs | 3 +++ server/AyaNova/util/AySchema.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 33155498..396abc9b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -45,7 +45,7 @@ //"AYANOVA_LOG_LEVEL": "Debug", "AYANOVA_DEFAULT_TRANSLATION": "en", //TRANSLATION MUST BE en for Integration TESTING - "AYANOVA_PERMANENTLY_ERASE_DATABASE": "true", + //"AYANOVA_PERMANENTLY_ERASE_DATABASE": "true", "AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;", "AYANOVA_USE_URLS": "http://*:7575;", "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", diff --git a/server/AyaNova/Controllers/NotifyController.cs b/server/AyaNova/Controllers/NotifyController.cs index 7808d4dc..500e9816 100644 --- a/server/AyaNova/Controllers/NotifyController.cs +++ b/server/AyaNova/Controllers/NotifyController.cs @@ -63,14 +63,11 @@ namespace AyaNova.Api.Controllers if (serverState.IsClosed) return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason)); System.Random rnd = new System.Random(); - int RandomNewCount = rnd.Next(20); + return Ok(ApiOkResponse.Response(RandomNewCount)); } - //TODO: See new count case for gist of it - //todo: see the core-notification.txt spec doc for details and - //todo: see seemingly countless Notification related cases for details :) - + //------------ diff --git a/server/AyaNova/models/Notification.cs b/server/AyaNova/models/Notification.cs index 753ee337..c0d05804 100644 --- a/server/AyaNova/models/Notification.cs +++ b/server/AyaNova/models/Notification.cs @@ -23,10 +23,13 @@ namespace AyaNova.Models [Required] public long SubscriptionId { get; set; } public string Message { get; set; } + [Required] + public bool Fetched {get;set;} public Notification() { Created = DateTime.UtcNow; + Fetched=false; } }//eoc diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 9b6ddab7..802499a9 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -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 = 378; + internal const long EXPECTED_COLUMN_COUNT = 379; internal const long EXPECTED_INDEX_COUNT = 139; //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! @@ -691,7 +691,7 @@ $BODY$; "ayatype integer, objectid bigint, eventtype integer not null, subscriptionid bigint not null, idvalue bigint, decvalue decimal(19,4), eventdate timestamp, message text)"); await ExecQueryAsync("CREATE TABLE anotification (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created timestamp not null, ayatype integer, objectid bigint, eventtype integer not null, " + - "subscriptionid bigint not null, message text)"); + "subscriptionid bigint not null, message text, fetched bool not null)"); await ExecQueryAsync("CREATE TABLE anotifydeliverylog (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, processed timestamp not null, ayatype integer, objectid bigint, " + "eventtype integer not null, subscriptionid bigint not null, idvalue bigint, decvalue decimal(19,4), userid bigint not null, " +