From e3eed6122ff5f3d5dcafa108dc37d8acd14f08ca Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 16 Nov 2021 23:02:10 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- server/AyaNova/models/GlobalBizSettings.cs | 19 +++++++++++++++++++ server/AyaNova/util/AySchema.cs | 6 ++++-- server/AyaNova/util/Seeder.cs | 21 +++++++++++++++++++-- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 81598112..1871b4f7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -55,7 +55,7 @@ "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles", - "AYANOVA_SERVER_TEST_MODE": "false", + "AYANOVA_SERVER_TEST_MODE": "true", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-8", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin\\" diff --git a/server/AyaNova/models/GlobalBizSettings.cs b/server/AyaNova/models/GlobalBizSettings.cs index 2c5f8bf8..e455c7a1 100644 --- a/server/AyaNova/models/GlobalBizSettings.cs +++ b/server/AyaNova/models/GlobalBizSettings.cs @@ -42,6 +42,25 @@ namespace AyaNova.Models public bool AllowScheduleConflicts { get; set; } = true; + //ADDRESS / CONTACT INFO reporting etc + public string WebAddress { get; set; } + public string EmailAddress { get; set; } + public string Phone1 { get; set; } + public string Phone2 { get; set; } + //POSTAL ADDRESS + public string PostAddress { get; set; } + public string PostCity { get; set; } + public string PostRegion { get; set; } + public string PostCountry { get; set; } + public string PostCode { get; set; } + + //PHYSICAL ADDRESS + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string Country { get; set; } + public decimal? Latitude { get; set; } + public decimal? Longitude { get; set; } //CUSTOMER ACCESS FEATURES AND SETTINGS diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 46595362..f2a8c9e7 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::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! private const int DESIRED_SCHEMA_LEVEL = 1; - internal const long EXPECTED_COLUMN_COUNT = 1304; + internal const long EXPECTED_COLUMN_COUNT = 1319; internal const long EXPECTED_INDEX_COUNT = 153; internal const long EXPECTED_CHECK_CONSTRAINTS = 518; internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 198; @@ -31,7 +31,7 @@ namespace AyaNova.Util //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! - ///////////////////////////////////////////////////////////////// (C1302:I153:CC518:FC198:V11:R2) + ///////////////////////////////////////////////////////////////// C1319:I153:CC518:FC198:V11:R2 @@ -252,6 +252,8 @@ namespace AyaNova.Util //create global biz settings table await ExecQueryAsync("CREATE TABLE aglobalbizsettings (id INTEGER NOT NULL PRIMARY KEY, " + + "webaddress TEXT, phone1 TEXT, phone2 TEXT, emailaddress TEXT, postaddress TEXT, postcity TEXT, postregion TEXT, postcountry TEXT, postcode TEXT, " + + "address TEXT, city TEXT, region TEXT, country TEXT, latitude DECIMAL(9,6), longitude DECIMAL(9,6), " + "filtercasesensitive BOOL DEFAULT FALSE, " + "useinventory BOOL DEFAULT TRUE, " + "allowscheduleconflicts BOOL DEFAULT TRUE, " diff --git a/server/AyaNova/util/Seeder.cs b/server/AyaNova/util/Seeder.cs index 6ef9ea5d..8450542f 100644 --- a/server/AyaNova/util/Seeder.cs +++ b/server/AyaNova/util/Seeder.cs @@ -1659,6 +1659,23 @@ namespace AyaNova.Util { GlobalBizSettingsBiz biz = GlobalBizSettingsBiz.GetBiz(ct); var gbiz = await biz.GetAsync(false); + + gbiz.Latitude = (decimal)Fake.Address.Latitude(); + gbiz.Longitude = (decimal)Fake.Address.Longitude(); + gbiz.Address = Fake.Address.StreetAddress(); + gbiz.City = Fake.Address.City(); + gbiz.Region = Fake.Address.State(); + gbiz.Country = Fake.Address.Country(); + gbiz.PostAddress = Fake.Address.StreetAddress(); + gbiz.PostCity = gbiz.City; + gbiz.PostRegion = gbiz.Region; + gbiz.PostCountry = gbiz.Country; + gbiz.PostCode = Fake.Address.ZipCode(); + gbiz.Phone1 = Fake.Phone.PhoneNumber(); + gbiz.Phone2 = Fake.Phone.PhoneNumber(); + gbiz.WebAddress = Fake.Internet.Protocol() + "://example." + Fake.Internet.DomainSuffix(); + gbiz.EmailAddress = Fake.Internet.ExampleEmail(); + gbiz.TaxPartPurchaseId = TCGoods; gbiz.TaxPartSaleId = TCGoods; gbiz.TaxRateSaleId = TCServices; @@ -1670,9 +1687,9 @@ namespace AyaNova.Util gbiz.CustomerAllowNotifyWOCreated = true; gbiz.CustomerAllowUserSettings = true; gbiz.CustomerAllowViewWO = true; - // gbiz.CustomerDefaultWorkOrderReportId=1; + // gbiz.CustomerDefaultWorkOrderReportId=1; gbiz.CustomerAllowWOWiki = true; - gbiz.CustomerAllowWOAttachments=true; + gbiz.CustomerAllowWOAttachments = true; await biz.PutAsync(gbiz); ServerGlobalBizSettings.Initialize(gbiz, null);