diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Consumers/FinancialQuestionnaireSubmissionConsumer.cs b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Consumers/FinancialQuestionnaireSubmissionConsumer.cs deleted file mode 100644 index 8d8e78f5..00000000 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Consumers/FinancialQuestionnaireSubmissionConsumer.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 Systemic Pty Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using Sif.Framework.Consumers; -using Sif.Framework.Demo.Au.Consumer.Models; -using Sif.Framework.Model.Infrastructure; - -namespace Sif.Framework.Demo.Au.Consumer.Consumers -{ - internal class FinancialQuestionnaireSubmissionConsumer : BasicConsumer - { - public FinancialQuestionnaireSubmissionConsumer(Environment environment) : base(environment) - { - } - - public FinancialQuestionnaireSubmissionConsumer(string applicationKey, string instanceId = null, string userToken = null, string solutionId = null) - : base(applicationKey, instanceId, userToken, solutionId) - { - } - } -} \ No newline at end of file diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/FinancialQuestionnaireSubmissionConsumerApp.cs b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/FinancialQuestionnaireSubmissionConsumerApp.cs deleted file mode 100644 index 5d539768..00000000 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/FinancialQuestionnaireSubmissionConsumerApp.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2019 Systemic Pty Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using Sif.Framework.Demo.Au.Consumer.Consumers; -using Sif.Framework.Demo.Au.Consumer.Models; -using Sif.Framework.Utils; -using Sif.Specification.DataModel.Au; -using System; -using System.Collections.Generic; - -namespace Sif.Framework.Demo.Au.Consumer -{ - internal class FinancialQuestionnaireSubmissionConsumerApp - { - private static readonly slf4net.ILogger log = slf4net.LoggerFactory.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - - private FinancialQuestionnaireSubmission CreateSubmission() - { - FinancialQuestionnaireSubmission submission = new FinancialQuestionnaireSubmission - { - FQYear = "2018", - ReportingAuthority = "Ballarat Diocese", - ReportingAuthoritySystem = "Vic Catholic", - ReportingAuthorityCommonwealthId = "012345", - SystemSubmission = AUCodeSetsYesOrNoCategoryType.N - }; - - return submission; - } - - private void RunConsumer() - { - FinancialQuestionnaireSubmissionConsumer consumer = new FinancialQuestionnaireSubmissionConsumer( - SettingsManager.ConsumerSettings.ApplicationKey, - SettingsManager.ConsumerSettings.InstanceId, - SettingsManager.ConsumerSettings.UserToken, - SettingsManager.ConsumerSettings.SolutionId); - consumer.Register(); - if (log.IsInfoEnabled) log.Info("Registered the Consumer."); - - try - { - // Create a new submission. - try - { - if (log.IsInfoEnabled) log.Info("*** Create a new submission."); - FinancialQuestionnaireSubmission createdObject = consumer.Create(CreateSubmission()); - if (log.IsInfoEnabled) log.Info($"Created new submission with ID of {createdObject.RefId}."); - } - catch (UnauthorizedAccessException) - { - if (log.IsInfoEnabled) log.Info("Access to create a new submission is rejected."); - } - - // Retrieve all submissions. - if (log.IsInfoEnabled) log.Info("*** Retrieve all submissions."); - IEnumerable retrievedObjects = consumer.Query(0, 10); - - foreach (FinancialQuestionnaireSubmission retrievedObject in retrievedObjects) - { - if (log.IsInfoEnabled) log.Info($"Submission {retrievedObject.RefId} is for {retrievedObject.ReportingAuthority}."); - } - } - catch (UnauthorizedAccessException) - { - if (log.IsInfoEnabled) log.Info($"Access to query submissions is rejected."); - } - catch (Exception e) - { - if (log.IsErrorEnabled) log.Error("Error running the Consumer.\n" + ExceptionUtils.InferErrorResponseMessage(e), e); - } - finally - { - consumer.Unregister(); - if (log.IsInfoEnabled) log.Info("Unregistered the Consumer."); - } - } - - private static void Main(string[] args) - { - FinancialQuestionnaireSubmissionConsumerApp app = new FinancialQuestionnaireSubmissionConsumerApp(); - - try - { - app.RunConsumer(); - } - catch (Exception e) - { - if (log.IsErrorEnabled) log.Error("Error running the Consumer.\n" + ExceptionUtils.InferErrorResponseMessage(e), e); - } - - Console.WriteLine("Press any key to continue ..."); - Console.ReadKey(); - } - } -} \ No newline at end of file diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Models/FinancialQuestionnaireSubmission.cs b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Models/FinancialQuestionnaireSubmission.cs deleted file mode 100644 index c52e14c9..00000000 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Models/FinancialQuestionnaireSubmission.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2019 Systemic Pty Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using Sif.Framework.Model.DataModels; -using Sif.Specification.DataModel.Au; -using System.Xml.Serialization; - -namespace Sif.Framework.Demo.Au.Consumer.Models -{ - [XmlRoot("FinancialQuestionnaireSubmission", Namespace = "http://www.sifassociation.org/datamodel/au/3.4", IsNullable = false)] - [XmlType(Namespace = "http://www.sifassociation.org/datamodel/au/3.4")] - public class FinancialQuestionnaireSubmission : FinancialQuestionnaireSubmissionType, IDataModel - { - } -} \ No newline at end of file diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Sif.Framework.Demo.Au.Consumer.csproj b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Sif.Framework.Demo.Au.Consumer.csproj index 4debe445..464b0948 100644 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Sif.Framework.Demo.Au.Consumer.csproj +++ b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Consumer/Sif.Framework.Demo.Au.Consumer.csproj @@ -47,14 +47,11 @@ - - - @@ -77,7 +74,7 @@ 3.2.1.13 - 3.4.6 + 3.4.6.1 0.1.32.1 diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Controllers/FinancialQuestionnaireSubmissionsProvider.cs b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Controllers/FinancialQuestionnaireSubmissionsProvider.cs deleted file mode 100644 index d43b2b31..00000000 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Controllers/FinancialQuestionnaireSubmissionsProvider.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019 Systemic Pty Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using Sif.Framework.Demo.Au.Provider.Models; -using Sif.Framework.Demo.Au.Provider.Services; -using Sif.Framework.Providers; -using Sif.Framework.WebApi.ModelBinders; -using System.Web.Http; - -namespace Sif.Framework.Demo.Au.Provider.Controllers -{ - public class FinancialQuestionnaireSubmissionsProvider : BasicProvider - { - public FinancialQuestionnaireSubmissionsProvider() : base(new FinancialQuestionnaireSubmissionService()) - { - } - - [NonAction] - public override IHttpActionResult BroadcastEvents(string zoneId = null, string contextId = null) - { - return base.BroadcastEvents(zoneId, contextId); - } - - [Route("~/api/FinancialQuestionnaireSubmissions/FinancialQuestionnaireSubmission")] - public override IHttpActionResult Post(FinancialQuestionnaireSubmission obj, [MatrixParameter] string[] zoneId = null, [MatrixParameter] string[] contextId = null) - { - return base.Post(obj, zoneId, contextId); - } - } -} \ No newline at end of file diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Global.asax.cs b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Global.asax.cs index aa3c8b09..90f54f47 100644 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Global.asax.cs +++ b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Global.asax.cs @@ -34,10 +34,6 @@ protected void Application_Start() // XML Serialisation: For each SIF Data Model Object used by each SIF Provider, the following entries are // required to define the root element for each collection object. - XmlRootAttribute submissionsXmlRootAttribute = new XmlRootAttribute("FinancialQuestionnaireSubmissions") { Namespace = SettingsManager.ProviderSettings.DataModelNamespace, IsNullable = false }; - ISerialiser> submissionsSerialiser = SerialiserFactory.GetXmlSerialiser>(submissionsXmlRootAttribute); - xmlFormatter.SetSerializer>((XmlSerializer)submissionsSerialiser); - XmlRootAttribute schoolInfosXmlRootAttribute = new XmlRootAttribute("SchoolInfos") { Namespace = SettingsManager.ProviderSettings.DataModelNamespace, IsNullable = false }; ISerialiser> schoolInfosSerialiser = SerialiserFactory.GetXmlSerialiser>(schoolInfosXmlRootAttribute); xmlFormatter.SetSerializer>((XmlSerializer)schoolInfosSerialiser); @@ -56,7 +52,6 @@ protected void Application_Start() UseXmlSerializer = true }; xmlToJsonFormatter.AddUriPathExtensionMapping("json", "application/json"); - xmlToJsonFormatter.SetSerializer>((XmlSerializer)submissionsSerialiser); xmlToJsonFormatter.SetSerializer>((XmlSerializer)schoolInfosSerialiser); xmlToJsonFormatter.SetSerializer>((XmlSerializer)studentPersonalsSerialiser); xmlToJsonFormatter.SetSerializer>((XmlSerializer)studentSchoolEnrollmentsSerialiser); diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Models/FinancialQuestionnaireSubmission.cs b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Models/FinancialQuestionnaireSubmission.cs deleted file mode 100644 index d8ec9ce0..00000000 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Models/FinancialQuestionnaireSubmission.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2019 Systemic Pty Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using Sif.Framework.Model.DataModels; -using Sif.Specification.DataModel.Au; -using System.Xml.Serialization; - -namespace Sif.Framework.Demo.Au.Provider.Models -{ - [XmlRoot("FinancialQuestionnaireSubmission", Namespace = "http://www.sifassociation.org/datamodel/au/3.4", IsNullable = false)] - [XmlType(Namespace = "http://www.sifassociation.org/datamodel/au/3.4")] - public class FinancialQuestionnaireSubmission : FinancialQuestionnaireSubmissionType, IDataModel - { - } -} \ No newline at end of file diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Services/FinancialQuestionnaireSubmissionService.cs b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Services/FinancialQuestionnaireSubmissionService.cs deleted file mode 100644 index 1293c8f3..00000000 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Services/FinancialQuestionnaireSubmissionService.cs +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2019 Systemic Pty Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using Sif.Framework.Demo.Au.Provider.Models; -using Sif.Framework.Model.Parameters; -using Sif.Framework.Model.Query; -using Sif.Framework.Service.Providers; -using System; -using System.Collections.Generic; - -namespace Sif.Framework.Demo.Au.Provider.Services -{ - public class FinancialQuestionnaireSubmissionService : IBasicProviderService - { - private static readonly Random random = new Random(); - - private static IDictionary cache = new Dictionary(); - - private static FinancialQuestionnaireSubmission CreateObject() - { - FinancialQuestionnaireSubmission obj = new FinancialQuestionnaireSubmission - { - RefId = Guid.NewGuid().ToString(), - FQYear = random.Next(2016, 2020).ToString(), - ReportingAuthority = "Ballarat Diocese", - ReportingAuthorityCommonwealthId = $"0{random.Next(12000, 12999)}" - }; - - return obj; - } - - private static IDictionary CreateObjects(int count) - { - IDictionary objs = new Dictionary(); - - for (int i = 1; i <= count; i++) - { - FinancialQuestionnaireSubmission obj = CreateObject(); - objs.Add(obj.RefId, obj); - } - - return objs; - } - - static FinancialQuestionnaireSubmissionService() - { - cache = CreateObjects(5); - } - - public FinancialQuestionnaireSubmission Create( - FinancialQuestionnaireSubmission obj, - bool? mustUseAdvisory = null, - string zoneId = null, - string contextId = null, - params RequestParameter[] requestParameters) - { - if (!mustUseAdvisory.HasValue || !mustUseAdvisory.Value) - { - string refId = Guid.NewGuid().ToString(); - obj.RefId = refId; - } - - cache.Add(obj.RefId, obj); - - return obj; - } - - public void Delete( - string refId, - string zoneId = null, - string contextId = null, - params RequestParameter[] requestParameters) - { - throw new NotImplementedException(); - } - - public FinancialQuestionnaireSubmission Retrieve( - string refId, - string zoneId = null, - string contextId = null, - params RequestParameter[] requestParameters) - { - if (!cache.TryGetValue(refId, out FinancialQuestionnaireSubmission obj)) - { - obj = null; - } - - return obj; - } - - public List Retrieve( - uint? pageIndex = null, - uint? pageSize = null, - string zoneId = null, - string contextId = null, - params RequestParameter[] requestParameters) - { - List objs = new List(); - - if (pageIndex.HasValue && pageSize.HasValue) - { - uint index = pageIndex.Value * pageSize.Value; - uint count = pageSize.Value; - - if (cache.Values.Count < (index + count)) - { - count = (uint)cache.Values.Count - index; - } - - if (index <= cache.Values.Count) - { - objs.AddRange(cache.Values); - objs = objs.GetRange((int)index, (int)count); - } - } - else - { - objs.AddRange(cache.Values); - } - - return objs; - } - - public List Retrieve( - FinancialQuestionnaireSubmission obj, - uint? pageIndex = null, - uint? pageSize = null, - string zoneId = null, - string contextId = null, - params RequestParameter[] requestParameters) - { - throw new NotImplementedException(); - } - - public List Retrieve( - IEnumerable conditions, - uint? pageIndex = null, - uint? pageSize = null, - string zoneId = null, - string contextId = null, - params RequestParameter[] requestParameters) - { - throw new NotImplementedException(); - } - - public void Update( - FinancialQuestionnaireSubmission obj, - string zoneId = null, - string contextId = null, - params RequestParameter[] requestParameters) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Sif.Framework.Demo.Au.Provider.csproj b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Sif.Framework.Demo.Au.Provider.csproj index e0679261..b045b193 100644 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Sif.Framework.Demo.Au.Provider.csproj +++ b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/Sif.Framework.Demo.Au.Provider.csproj @@ -76,8 +76,8 @@ ..\packages\Sif.Framework.3.2.1.13\lib\net461\Sif.Framework.dll - - ..\packages\Sif.Specification.DataModel.Au.3.4.6\lib\netstandard2.0\Sif.Specification.DataModel.Au.dll + + ..\packages\Sif.Specification.DataModel.Au.3.4.6.1\lib\netstandard2.0\Sif.Specification.DataModel.Au.dll ..\packages\Sif.Specification.Infrastructure.3.2.1\lib\netstandard2.0\Sif.Specification.Infrastructure.dll @@ -137,19 +137,16 @@ - Global.asax - - diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/packages.config b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/packages.config index 87aa0fc0..098fbc29 100644 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/packages.config +++ b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Au.Provider/packages.config @@ -13,7 +13,7 @@ - + diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Broker/Sif.Framework.Demo.Broker.csproj b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Broker/Sif.Framework.Demo.Broker.csproj index 43d8f6fd..06e0f22a 100644 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Broker/Sif.Framework.Demo.Broker.csproj +++ b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Broker/Sif.Framework.Demo.Broker.csproj @@ -77,8 +77,8 @@ ..\packages\Sif.Framework.3.2.1.13\lib\net461\Sif.Framework.dll - - ..\packages\Sif.Specification.DataModel.Au.3.4.6\lib\netstandard2.0\Sif.Specification.DataModel.Au.dll + + ..\packages\Sif.Specification.DataModel.Au.3.4.6.1\lib\netstandard2.0\Sif.Specification.DataModel.Au.dll ..\packages\Sif.Specification.Infrastructure.3.2.1\lib\netstandard2.0\Sif.Specification.Infrastructure.dll diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Broker/packages.config b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Broker/packages.config index 1c2bb942..7862ef59 100644 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Broker/packages.config +++ b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Broker/packages.config @@ -15,7 +15,7 @@ - + diff --git a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Setup/Data files/AU/Sif3DemoConsumer/EnvironmentResponse.xml b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Setup/Data files/AU/Sif3DemoConsumer/EnvironmentResponse.xml index 1728d018..2a0af416 100644 --- a/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Setup/Data files/AU/Sif3DemoConsumer/EnvironmentResponse.xml +++ b/Code/Sif3FrameworkDemo/Sif.Framework.Demo.Setup/Data files/AU/Sif3DemoConsumer/EnvironmentResponse.xml @@ -58,12 +58,6 @@ REJECTED - - - APPROVED - APPROVED - - diff --git a/Data/Databases/SQLite/SifFrameworkDatabase.db b/Data/Databases/SQLite/SifFrameworkDatabase.db index d7243965..d0589569 100644 Binary files a/Data/Databases/SQLite/SifFrameworkDatabase.db and b/Data/Databases/SQLite/SifFrameworkDatabase.db differ