From 466a380db53af8d6f62da3753701680847d4d2e7 Mon Sep 17 00:00:00 2001 From: Sann Lynn Htun Date: Sun, 4 Aug 2024 19:00:48 +0630 Subject: [PATCH 01/28] feat: package.lock.json --- REMS.Database/packages.lock.json | 485 +++++++++++++++++++++++++++++++ REMS.Models/packages.lock.json | 443 ++++++++++++++++++++++++++++ REMS.Shared/packages.lock.json | 449 ++++++++++++++++++++++++++++ 3 files changed, 1377 insertions(+) create mode 100644 REMS.Database/packages.lock.json create mode 100644 REMS.Models/packages.lock.json create mode 100644 REMS.Shared/packages.lock.json diff --git a/REMS.Database/packages.lock.json b/REMS.Database/packages.lock.json new file mode 100644 index 0000000..f572507 --- /dev/null +++ b/REMS.Database/packages.lock.json @@ -0,0 +1,485 @@ +{ + "version": 1, + "dependencies": { + "net7.0": { + "Microsoft.EntityFrameworkCore": { + "type": "Direct", + "requested": "[7.0.20, )", + "resolved": "7.0.20", + "contentHash": "Wvmktob+dBPvMZdTj2yRrfDi3ERL/RRcE8EWjr3DuIjWn+6giqD81+oNM/09IthwZ3IsSMHgpiVVmTwAW92gEQ==", + "dependencies": { + "Microsoft.EntityFrameworkCore.Abstractions": "7.0.20", + "Microsoft.EntityFrameworkCore.Analyzers": "7.0.20", + "Microsoft.Extensions.Caching.Memory": "7.0.0", + "Microsoft.Extensions.DependencyInjection": "7.0.0", + "Microsoft.Extensions.Logging": "7.0.0" + } + }, + "Microsoft.EntityFrameworkCore.SqlServer": { + "type": "Direct", + "requested": "[7.0.20, )", + "resolved": "7.0.20", + "contentHash": "ukRrvvgDRbs5At/4zQv84gxi+arXvuwRvUHL1cQOdWyOAvSBBieVSmbFhR8ihbbE1Czo3MduxJ+eF2ztHVYC3A==", + "dependencies": { + "Microsoft.Data.SqlClient": "5.1.5", + "Microsoft.EntityFrameworkCore.Relational": "7.0.20" + } + }, + "Microsoft.EntityFrameworkCore.Tools": { + "type": "Direct", + "requested": "[7.0.20, )", + "resolved": "7.0.20", + "contentHash": "tu4A/gRuWxAg0c+7i+SzP5VYDwPUTgcND6ymNxwgcLBXr24tG16sNqUn7/fpMhBTeXIpceHu5DgQ2RJTtwoJag==", + "dependencies": { + "Microsoft.EntityFrameworkCore.Design": "7.0.20" + } + }, + "Azure.Core": { + "type": "Transitive", + "resolved": "1.35.0", + "contentHash": "hENcx03Jyuqv05F4RBEPbxz29UrM3Nbhnr6Wl6NQpoU9BCIbL3XLentrxDCTrH54NLS11Exxi/o8MYgT/cnKFA==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Azure.Identity": { + "type": "Transitive", + "resolved": "1.10.3", + "contentHash": "l1Xm2MWOF2Mzcwuarlw8kWQXLZk3UeB55aQXVyjj23aBfDwOZ3gu5GP2kJ6KlmZeZv2TCzw7x4L3V36iNr3gww==", + "dependencies": { + "Azure.Core": "1.35.0", + "Microsoft.Identity.Client": "4.56.0", + "Microsoft.Identity.Client.Extensions.Msal": "4.56.0", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.7.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Humanizer.Core": { + "type": "Transitive", + "resolved": "2.14.1", + "contentHash": "lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==" + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==" + }, + "Microsoft.Data.SqlClient": { + "type": "Transitive", + "resolved": "5.1.5", + "contentHash": "6kvhQjY5uBCdBccezFD2smfnpQjQ33cZtUZVrNvxlwoBu6uopM5INH6uSgLI7JRLtlQ3bMPwnhMq4kchsXeZ5w==", + "dependencies": { + "Azure.Identity": "1.10.3", + "Microsoft.Data.SqlClient.SNI.runtime": "5.1.1", + "Microsoft.Identity.Client": "4.56.0", + "Microsoft.IdentityModel.JsonWebTokens": "6.35.0", + "Microsoft.IdentityModel.Protocols.OpenIdConnect": "6.35.0", + "Microsoft.SqlServer.Server": "1.0.0", + "System.Configuration.ConfigurationManager": "6.0.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Runtime.Caching": "6.0.0", + "System.Security.Cryptography.Cng": "5.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encoding.CodePages": "6.0.0", + "System.Text.Encodings.Web": "6.0.0" + } + }, + "Microsoft.Data.SqlClient.SNI.runtime": { + "type": "Transitive", + "resolved": "5.1.1", + "contentHash": "wNGM5ZTQCa2blc9ikXQouybGiyMd6IHPVJvAlBEPtr6JepZEOYeDxGyprYvFVeOxlCXs7avridZQ0nYkHzQWCQ==" + }, + "Microsoft.EntityFrameworkCore.Abstractions": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "ds6XFVrh34AWYAedlMo8tVkmxsxyXnwP0N6FTjlq4p1oR6TQktIabUDkSMKgStVYt4c4b4Rus3H/Oad9I4uSlQ==" + }, + "Microsoft.EntityFrameworkCore.Analyzers": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "doouHLWFcYcd08QUh9+4aZu3sk4WySp/aSOHeIzNhMJ58ESQXUAGDvB1sjJ4HmE0tmCea51NGzgtHE5IBmFLGg==" + }, + "Microsoft.EntityFrameworkCore.Design": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "rjxhuC9nUzBdZYxvTpKxuUGzIlGPf5Aj01HzOj7Y4G00PDM4QM5GdRUHGSujNkuwB3oD2j2zHPxwhIqQCznRfg==", + "dependencies": { + "Humanizer.Core": "2.14.1", + "Microsoft.EntityFrameworkCore.Relational": "7.0.20", + "Microsoft.Extensions.DependencyModel": "7.0.0", + "Mono.TextTemplating": "2.2.1" + } + }, + "Microsoft.EntityFrameworkCore.Relational": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "25GWyYLMm4T+iuxJLhXR/GTzeYR7tIhYUOCIaWkSFTI4FB39yQz8wg5EfyhPUL4Jfhjk94X+yFsff/HoNaCVIA==", + "dependencies": { + "Microsoft.EntityFrameworkCore": "7.0.20", + "Microsoft.Extensions.Configuration.Abstractions": "7.0.0" + } + }, + "Microsoft.Extensions.Caching.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "IeimUd0TNbhB4ded3AbgBLQv2SnsiVugDyGV1MvspQFVlA07nDC7Zul7kcwH5jWN3JiTcp/ySE83AIJo8yfKjg==", + "dependencies": { + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.Caching.Memory": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "xpidBs2KCE2gw1JrD0quHE72kvCaI3xFql5/Peb2GRtUuZX+dYPoK/NTdVMiM67Svym0M0Df9A3xyU0FbMQhHw==", + "dependencies": { + "Microsoft.Extensions.Caching.Abstractions": "7.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", + "Microsoft.Extensions.Logging.Abstractions": "7.0.0", + "Microsoft.Extensions.Options": "7.0.0", + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "f34u2eaqIjNO9YLHBz8rozVZ+TcFiFs0F3r7nUJd7FRkVSxk8u4OpoK226mi49MwexHOR2ibP9MFvRUaLilcQQ==", + "dependencies": { + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "elNeOmkeX3eDVG6pYVeV82p29hr+UKDaBhrZyWvWLw/EVZSYEkZlQdkp0V39k/Xehs2Qa0mvoCvkVj3eQxNQ1Q==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "h3j/QfmFN4S0w4C2A6X7arXij/M/OVw3uQHSOFxnND4DyAzO1F9eMX7Eti7lU/OkSthEE0WzRsfT/Dmx86jzCw==" + }, + "Microsoft.Extensions.DependencyModel": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "oONNYd71J3LzkWc4fUHl3SvMfiQMYUCo/mDHDEu76hYYxdhdrPYv6fvGv9nnKVyhE9P0h20AU8RZB5OOWQcAXg==", + "dependencies": { + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0" + } + }, + "Microsoft.Extensions.Logging": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "Nw2muoNrOG5U5qa2ZekXwudUn2BJcD41e65zwmDHb1fQegTX66UokLWZkJRpqSSHXDOWZ5V0iqhbxOEky91atA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "7.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", + "Microsoft.Extensions.Logging.Abstractions": "7.0.0", + "Microsoft.Extensions.Options": "7.0.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "lP1yBnTTU42cKpMozuafbvNtQ7QcBjr/CcK3bYOGEMH55Fjt+iecXjT6chR7vbgCMqy3PG3aNQSZgo/EuY/9qQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "um1KU5kxcRp3CNuI8o/GrZtD4AIOXDk+RLsytjZ9QPok3ttLUelLKpilVPuaFT3TFjOhSibUAso0odbOaCDj3Q==" + }, + "Microsoft.Identity.Client": { + "type": "Transitive", + "resolved": "4.56.0", + "contentHash": "rr4zbidvHy9r4NvOAs5hdd964Ao2A0pAeFBJKR95u1CJAVzbd1p6tPTXUZ+5ld0cfThiVSGvz6UHwY6JjraTpA==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.22.0" + } + }, + "Microsoft.Identity.Client.Extensions.Msal": { + "type": "Transitive", + "resolved": "4.56.0", + "contentHash": "H12YAzEGK55vZ+QpxUzozhW8ZZtgPDuWvgA0JbdIR9UhMUplj29JhIgE2imuH8W2Nw9D8JKygR1uxRFtpSNcrg==", + "dependencies": { + "Microsoft.Identity.Client": "4.56.0", + "System.IO.FileSystem.AccessControl": "5.0.0", + "System.Security.Cryptography.ProtectedData": "4.5.0" + } + }, + "Microsoft.IdentityModel.Abstractions": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "xuR8E4Rd96M41CnUSCiOJ2DBh+z+zQSmyrYHdYhD6K4fXBcQGVnRCFQ0efROUYpP+p0zC1BLKr0JRpVuujTZSg==" + }, + "Microsoft.IdentityModel.JsonWebTokens": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "9wxai3hKgZUb4/NjdRKfQd0QJvtXKDlvmGMYACbEC8DFaicMFCFhQFZq9ZET1kJLwZahf2lfY5Gtcpsx8zYzbg==", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "6.35.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + } + }, + "Microsoft.IdentityModel.Logging": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "jePrSfGAmqT81JDCNSY+fxVWoGuJKt9e6eJ+vT7+quVS55nWl//jGjUQn4eFtVKt4rt5dXaleZdHRB9J9AJZ7Q==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.35.0" + } + }, + "Microsoft.IdentityModel.Protocols": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "BPQhlDzdFvv1PzaUxNSk+VEPwezlDEVADIKmyxubw7IiELK18uJ06RQ9QKKkds30XI+gDu9n8j24XQ8w7fjWcg==", + "dependencies": { + "Microsoft.IdentityModel.Logging": "6.35.0", + "Microsoft.IdentityModel.Tokens": "6.35.0" + } + }, + "Microsoft.IdentityModel.Protocols.OpenIdConnect": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "LMtVqnECCCdSmyFoCOxIE5tXQqkOLrvGrL7OxHg41DIm1bpWtaCdGyVcTAfOQpJXvzND9zUKIN/lhngPkYR8vg==", + "dependencies": { + "Microsoft.IdentityModel.Protocols": "6.35.0", + "System.IdentityModel.Tokens.Jwt": "6.35.0" + } + }, + "Microsoft.IdentityModel.Tokens": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "RN7lvp7s3Boucg1NaNAbqDbxtlLj5Qeb+4uSS1TeK5FSBVM40P4DKaTKChT43sHyKfh7V0zkrMph6DdHvyA4bg==", + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "Microsoft.IdentityModel.Logging": "6.35.0", + "System.Security.Cryptography.Cng": "4.5.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.NETCore.Targets": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" + }, + "Microsoft.SqlServer.Server": { + "type": "Transitive", + "resolved": "1.0.0", + "contentHash": "N4KeF3cpcm1PUHym1RmakkzfkEv3GRMyofVv40uXsQhCQeglr2OHNcUk2WOG51AKpGO8ynGpo9M/kFXSzghwug==" + }, + "Microsoft.Win32.SystemEvents": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==" + }, + "Mono.TextTemplating": { + "type": "Transitive", + "resolved": "2.2.1", + "contentHash": "KZYeKBET/2Z0gY1WlTAK7+RHTl7GSbtvTLDXEZZojUdAPqpQNDL6tHv7VUpqfX5VEOh+uRGKaZXkuD253nEOBQ==", + "dependencies": { + "System.CodeDom": "4.4.0" + } + }, + "System.CodeDom": { + "type": "Transitive", + "resolved": "4.4.0", + "contentHash": "2sCCb7doXEwtYAbqzbF/8UAeDRMNmPaQbU2q50Psg1J9KzumyVVCgKQY8s53WIPTufNT0DpSe9QRvVjOzfDWBA==" + }, + "System.Configuration.ConfigurationManager": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "jXw9MlUu/kRfEU0WyTptAVueupqIeE3/rl0EZDMlf8pcvJnitQ8HeVEp69rZdaStXwTV72boi/Bhw8lOeO+U2w==", + "dependencies": { + "System.Security.Cryptography.ProtectedData": "6.0.0", + "System.Security.Permissions": "6.0.0" + } + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Drawing.Common": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==", + "dependencies": { + "Microsoft.Win32.SystemEvents": "6.0.0" + } + }, + "System.Formats.Asn1": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==" + }, + "System.IdentityModel.Tokens.Jwt": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "yxGIQd3BFK7F6S62/7RdZk3C/mfwyVxvh6ngd1VYMBmbJ1YZZA9+Ku6suylVtso0FjI0wbElpJ0d27CdsyLpBQ==", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "6.35.0", + "Microsoft.IdentityModel.Tokens": "6.35.0" + } + }, + "System.IO.FileSystem.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "SxHB3nuNrpptVk+vZ/F+7OHEpoHUIKKMl02bUmYHQr1r+glbZQxs7pRtsf4ENO29TVm2TH3AEeep2fJcy92oYw==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + }, + "System.Memory.Data": { + "type": "Transitive", + "resolved": "1.0.2", + "contentHash": "JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.6.0" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Runtime": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "System.Runtime.Caching": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "E0e03kUp5X2k+UAoVl6efmI7uU7JRBWi5EIdlQ7cr0NpBGjHG4fWII35PgsBY9T4fJQ8E4QPsL0rKksU9gcL5A==", + "dependencies": { + "System.Configuration.ConfigurationManager": "6.0.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==" + }, + "System.Security.Cryptography.Cng": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Cryptography.ProtectedData": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "rp1gMNEZpvx9vP0JW0oHLxlf8oSiQgtno77Y4PLUBjSiDYoD77Y8uXHr1Ea5XG4/pIKhqAdxZ8v8OTUtqo9PeQ==" + }, + "System.Security.Permissions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==", + "dependencies": { + "System.Security.AccessControl": "6.0.0", + "System.Windows.Extensions": "6.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, + "System.Text.Encoding": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.CodePages": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "OP6umVGxc0Z0MvZQBVigj4/U31Pw72ITihDWP9WiWDm+q5aoe0GaJivsfYGq53o6dxH7DcXWiCTl7+0o2CGdmg==" + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "DaGSsVqKsn/ia6RG8frjwmJonfos0srquhw09TlT8KRw5I43E+4gs+/bZj4K0vShJ5H9imCuXupb4RmS+dBy3w==", + "dependencies": { + "System.Text.Encodings.Web": "7.0.0" + } + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" + }, + "System.Windows.Extensions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==", + "dependencies": { + "System.Drawing.Common": "6.0.0" + } + } + } + } +} \ No newline at end of file diff --git a/REMS.Models/packages.lock.json b/REMS.Models/packages.lock.json new file mode 100644 index 0000000..cfc930b --- /dev/null +++ b/REMS.Models/packages.lock.json @@ -0,0 +1,443 @@ +{ + "version": 1, + "dependencies": { + "net7.0": { + "Azure.Core": { + "type": "Transitive", + "resolved": "1.35.0", + "contentHash": "hENcx03Jyuqv05F4RBEPbxz29UrM3Nbhnr6Wl6NQpoU9BCIbL3XLentrxDCTrH54NLS11Exxi/o8MYgT/cnKFA==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Azure.Identity": { + "type": "Transitive", + "resolved": "1.10.3", + "contentHash": "l1Xm2MWOF2Mzcwuarlw8kWQXLZk3UeB55aQXVyjj23aBfDwOZ3gu5GP2kJ6KlmZeZv2TCzw7x4L3V36iNr3gww==", + "dependencies": { + "Azure.Core": "1.35.0", + "Microsoft.Identity.Client": "4.56.0", + "Microsoft.Identity.Client.Extensions.Msal": "4.56.0", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.7.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==" + }, + "Microsoft.Data.SqlClient": { + "type": "Transitive", + "resolved": "5.1.5", + "contentHash": "6kvhQjY5uBCdBccezFD2smfnpQjQ33cZtUZVrNvxlwoBu6uopM5INH6uSgLI7JRLtlQ3bMPwnhMq4kchsXeZ5w==", + "dependencies": { + "Azure.Identity": "1.10.3", + "Microsoft.Data.SqlClient.SNI.runtime": "5.1.1", + "Microsoft.Identity.Client": "4.56.0", + "Microsoft.IdentityModel.JsonWebTokens": "6.35.0", + "Microsoft.IdentityModel.Protocols.OpenIdConnect": "6.35.0", + "Microsoft.SqlServer.Server": "1.0.0", + "System.Configuration.ConfigurationManager": "6.0.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Runtime.Caching": "6.0.0", + "System.Security.Cryptography.Cng": "5.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encoding.CodePages": "6.0.0", + "System.Text.Encodings.Web": "6.0.0" + } + }, + "Microsoft.Data.SqlClient.SNI.runtime": { + "type": "Transitive", + "resolved": "5.1.1", + "contentHash": "wNGM5ZTQCa2blc9ikXQouybGiyMd6IHPVJvAlBEPtr6JepZEOYeDxGyprYvFVeOxlCXs7avridZQ0nYkHzQWCQ==" + }, + "Microsoft.EntityFrameworkCore": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "Wvmktob+dBPvMZdTj2yRrfDi3ERL/RRcE8EWjr3DuIjWn+6giqD81+oNM/09IthwZ3IsSMHgpiVVmTwAW92gEQ==", + "dependencies": { + "Microsoft.EntityFrameworkCore.Abstractions": "7.0.20", + "Microsoft.EntityFrameworkCore.Analyzers": "7.0.20", + "Microsoft.Extensions.Caching.Memory": "7.0.0", + "Microsoft.Extensions.DependencyInjection": "7.0.0", + "Microsoft.Extensions.Logging": "7.0.0" + } + }, + "Microsoft.EntityFrameworkCore.Abstractions": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "ds6XFVrh34AWYAedlMo8tVkmxsxyXnwP0N6FTjlq4p1oR6TQktIabUDkSMKgStVYt4c4b4Rus3H/Oad9I4uSlQ==" + }, + "Microsoft.EntityFrameworkCore.Analyzers": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "doouHLWFcYcd08QUh9+4aZu3sk4WySp/aSOHeIzNhMJ58ESQXUAGDvB1sjJ4HmE0tmCea51NGzgtHE5IBmFLGg==" + }, + "Microsoft.EntityFrameworkCore.Relational": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "25GWyYLMm4T+iuxJLhXR/GTzeYR7tIhYUOCIaWkSFTI4FB39yQz8wg5EfyhPUL4Jfhjk94X+yFsff/HoNaCVIA==", + "dependencies": { + "Microsoft.EntityFrameworkCore": "7.0.20", + "Microsoft.Extensions.Configuration.Abstractions": "7.0.0" + } + }, + "Microsoft.EntityFrameworkCore.SqlServer": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "ukRrvvgDRbs5At/4zQv84gxi+arXvuwRvUHL1cQOdWyOAvSBBieVSmbFhR8ihbbE1Czo3MduxJ+eF2ztHVYC3A==", + "dependencies": { + "Microsoft.Data.SqlClient": "5.1.5", + "Microsoft.EntityFrameworkCore.Relational": "7.0.20" + } + }, + "Microsoft.Extensions.Caching.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "IeimUd0TNbhB4ded3AbgBLQv2SnsiVugDyGV1MvspQFVlA07nDC7Zul7kcwH5jWN3JiTcp/ySE83AIJo8yfKjg==", + "dependencies": { + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.Caching.Memory": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "xpidBs2KCE2gw1JrD0quHE72kvCaI3xFql5/Peb2GRtUuZX+dYPoK/NTdVMiM67Svym0M0Df9A3xyU0FbMQhHw==", + "dependencies": { + "Microsoft.Extensions.Caching.Abstractions": "7.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", + "Microsoft.Extensions.Logging.Abstractions": "7.0.0", + "Microsoft.Extensions.Options": "7.0.0", + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "f34u2eaqIjNO9YLHBz8rozVZ+TcFiFs0F3r7nUJd7FRkVSxk8u4OpoK226mi49MwexHOR2ibP9MFvRUaLilcQQ==", + "dependencies": { + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "elNeOmkeX3eDVG6pYVeV82p29hr+UKDaBhrZyWvWLw/EVZSYEkZlQdkp0V39k/Xehs2Qa0mvoCvkVj3eQxNQ1Q==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "h3j/QfmFN4S0w4C2A6X7arXij/M/OVw3uQHSOFxnND4DyAzO1F9eMX7Eti7lU/OkSthEE0WzRsfT/Dmx86jzCw==" + }, + "Microsoft.Extensions.Logging": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "Nw2muoNrOG5U5qa2ZekXwudUn2BJcD41e65zwmDHb1fQegTX66UokLWZkJRpqSSHXDOWZ5V0iqhbxOEky91atA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "7.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", + "Microsoft.Extensions.Logging.Abstractions": "7.0.0", + "Microsoft.Extensions.Options": "7.0.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "lP1yBnTTU42cKpMozuafbvNtQ7QcBjr/CcK3bYOGEMH55Fjt+iecXjT6chR7vbgCMqy3PG3aNQSZgo/EuY/9qQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "um1KU5kxcRp3CNuI8o/GrZtD4AIOXDk+RLsytjZ9QPok3ttLUelLKpilVPuaFT3TFjOhSibUAso0odbOaCDj3Q==" + }, + "Microsoft.Identity.Client": { + "type": "Transitive", + "resolved": "4.56.0", + "contentHash": "rr4zbidvHy9r4NvOAs5hdd964Ao2A0pAeFBJKR95u1CJAVzbd1p6tPTXUZ+5ld0cfThiVSGvz6UHwY6JjraTpA==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.22.0" + } + }, + "Microsoft.Identity.Client.Extensions.Msal": { + "type": "Transitive", + "resolved": "4.56.0", + "contentHash": "H12YAzEGK55vZ+QpxUzozhW8ZZtgPDuWvgA0JbdIR9UhMUplj29JhIgE2imuH8W2Nw9D8JKygR1uxRFtpSNcrg==", + "dependencies": { + "Microsoft.Identity.Client": "4.56.0", + "System.IO.FileSystem.AccessControl": "5.0.0", + "System.Security.Cryptography.ProtectedData": "4.5.0" + } + }, + "Microsoft.IdentityModel.Abstractions": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "xuR8E4Rd96M41CnUSCiOJ2DBh+z+zQSmyrYHdYhD6K4fXBcQGVnRCFQ0efROUYpP+p0zC1BLKr0JRpVuujTZSg==" + }, + "Microsoft.IdentityModel.JsonWebTokens": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "9wxai3hKgZUb4/NjdRKfQd0QJvtXKDlvmGMYACbEC8DFaicMFCFhQFZq9ZET1kJLwZahf2lfY5Gtcpsx8zYzbg==", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "6.35.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + } + }, + "Microsoft.IdentityModel.Logging": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "jePrSfGAmqT81JDCNSY+fxVWoGuJKt9e6eJ+vT7+quVS55nWl//jGjUQn4eFtVKt4rt5dXaleZdHRB9J9AJZ7Q==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.35.0" + } + }, + "Microsoft.IdentityModel.Protocols": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "BPQhlDzdFvv1PzaUxNSk+VEPwezlDEVADIKmyxubw7IiELK18uJ06RQ9QKKkds30XI+gDu9n8j24XQ8w7fjWcg==", + "dependencies": { + "Microsoft.IdentityModel.Logging": "6.35.0", + "Microsoft.IdentityModel.Tokens": "6.35.0" + } + }, + "Microsoft.IdentityModel.Protocols.OpenIdConnect": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "LMtVqnECCCdSmyFoCOxIE5tXQqkOLrvGrL7OxHg41DIm1bpWtaCdGyVcTAfOQpJXvzND9zUKIN/lhngPkYR8vg==", + "dependencies": { + "Microsoft.IdentityModel.Protocols": "6.35.0", + "System.IdentityModel.Tokens.Jwt": "6.35.0" + } + }, + "Microsoft.IdentityModel.Tokens": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "RN7lvp7s3Boucg1NaNAbqDbxtlLj5Qeb+4uSS1TeK5FSBVM40P4DKaTKChT43sHyKfh7V0zkrMph6DdHvyA4bg==", + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "Microsoft.IdentityModel.Logging": "6.35.0", + "System.Security.Cryptography.Cng": "4.5.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.NETCore.Targets": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" + }, + "Microsoft.SqlServer.Server": { + "type": "Transitive", + "resolved": "1.0.0", + "contentHash": "N4KeF3cpcm1PUHym1RmakkzfkEv3GRMyofVv40uXsQhCQeglr2OHNcUk2WOG51AKpGO8ynGpo9M/kFXSzghwug==" + }, + "Microsoft.Win32.SystemEvents": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==" + }, + "System.Configuration.ConfigurationManager": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "jXw9MlUu/kRfEU0WyTptAVueupqIeE3/rl0EZDMlf8pcvJnitQ8HeVEp69rZdaStXwTV72boi/Bhw8lOeO+U2w==", + "dependencies": { + "System.Security.Cryptography.ProtectedData": "6.0.0", + "System.Security.Permissions": "6.0.0" + } + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Drawing.Common": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==", + "dependencies": { + "Microsoft.Win32.SystemEvents": "6.0.0" + } + }, + "System.Formats.Asn1": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==" + }, + "System.IdentityModel.Tokens.Jwt": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "yxGIQd3BFK7F6S62/7RdZk3C/mfwyVxvh6ngd1VYMBmbJ1YZZA9+Ku6suylVtso0FjI0wbElpJ0d27CdsyLpBQ==", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "6.35.0", + "Microsoft.IdentityModel.Tokens": "6.35.0" + } + }, + "System.IO.FileSystem.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "SxHB3nuNrpptVk+vZ/F+7OHEpoHUIKKMl02bUmYHQr1r+glbZQxs7pRtsf4ENO29TVm2TH3AEeep2fJcy92oYw==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + }, + "System.Memory.Data": { + "type": "Transitive", + "resolved": "1.0.2", + "contentHash": "JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.6.0" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Runtime": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "System.Runtime.Caching": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "E0e03kUp5X2k+UAoVl6efmI7uU7JRBWi5EIdlQ7cr0NpBGjHG4fWII35PgsBY9T4fJQ8E4QPsL0rKksU9gcL5A==", + "dependencies": { + "System.Configuration.ConfigurationManager": "6.0.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==" + }, + "System.Security.Cryptography.Cng": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Cryptography.ProtectedData": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "rp1gMNEZpvx9vP0JW0oHLxlf8oSiQgtno77Y4PLUBjSiDYoD77Y8uXHr1Ea5XG4/pIKhqAdxZ8v8OTUtqo9PeQ==" + }, + "System.Security.Permissions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==", + "dependencies": { + "System.Security.AccessControl": "6.0.0", + "System.Windows.Extensions": "6.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, + "System.Text.Encoding": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.CodePages": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "4.7.2", + "contentHash": "TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" + }, + "System.Windows.Extensions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==", + "dependencies": { + "System.Drawing.Common": "6.0.0" + } + }, + "rems.database": { + "type": "Project", + "dependencies": { + "Microsoft.EntityFrameworkCore": "[7.0.20, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.20, )" + } + } + } + } +} \ No newline at end of file diff --git a/REMS.Shared/packages.lock.json b/REMS.Shared/packages.lock.json new file mode 100644 index 0000000..429d0c7 --- /dev/null +++ b/REMS.Shared/packages.lock.json @@ -0,0 +1,449 @@ +{ + "version": 1, + "dependencies": { + "net7.0": { + "Azure.Core": { + "type": "Transitive", + "resolved": "1.35.0", + "contentHash": "hENcx03Jyuqv05F4RBEPbxz29UrM3Nbhnr6Wl6NQpoU9BCIbL3XLentrxDCTrH54NLS11Exxi/o8MYgT/cnKFA==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Azure.Identity": { + "type": "Transitive", + "resolved": "1.10.3", + "contentHash": "l1Xm2MWOF2Mzcwuarlw8kWQXLZk3UeB55aQXVyjj23aBfDwOZ3gu5GP2kJ6KlmZeZv2TCzw7x4L3V36iNr3gww==", + "dependencies": { + "Azure.Core": "1.35.0", + "Microsoft.Identity.Client": "4.56.0", + "Microsoft.Identity.Client.Extensions.Msal": "4.56.0", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.7.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "1.1.1", + "contentHash": "yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==" + }, + "Microsoft.Data.SqlClient": { + "type": "Transitive", + "resolved": "5.1.5", + "contentHash": "6kvhQjY5uBCdBccezFD2smfnpQjQ33cZtUZVrNvxlwoBu6uopM5INH6uSgLI7JRLtlQ3bMPwnhMq4kchsXeZ5w==", + "dependencies": { + "Azure.Identity": "1.10.3", + "Microsoft.Data.SqlClient.SNI.runtime": "5.1.1", + "Microsoft.Identity.Client": "4.56.0", + "Microsoft.IdentityModel.JsonWebTokens": "6.35.0", + "Microsoft.IdentityModel.Protocols.OpenIdConnect": "6.35.0", + "Microsoft.SqlServer.Server": "1.0.0", + "System.Configuration.ConfigurationManager": "6.0.1", + "System.Diagnostics.DiagnosticSource": "6.0.1", + "System.Runtime.Caching": "6.0.0", + "System.Security.Cryptography.Cng": "5.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encoding.CodePages": "6.0.0", + "System.Text.Encodings.Web": "6.0.0" + } + }, + "Microsoft.Data.SqlClient.SNI.runtime": { + "type": "Transitive", + "resolved": "5.1.1", + "contentHash": "wNGM5ZTQCa2blc9ikXQouybGiyMd6IHPVJvAlBEPtr6JepZEOYeDxGyprYvFVeOxlCXs7avridZQ0nYkHzQWCQ==" + }, + "Microsoft.EntityFrameworkCore": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "Wvmktob+dBPvMZdTj2yRrfDi3ERL/RRcE8EWjr3DuIjWn+6giqD81+oNM/09IthwZ3IsSMHgpiVVmTwAW92gEQ==", + "dependencies": { + "Microsoft.EntityFrameworkCore.Abstractions": "7.0.20", + "Microsoft.EntityFrameworkCore.Analyzers": "7.0.20", + "Microsoft.Extensions.Caching.Memory": "7.0.0", + "Microsoft.Extensions.DependencyInjection": "7.0.0", + "Microsoft.Extensions.Logging": "7.0.0" + } + }, + "Microsoft.EntityFrameworkCore.Abstractions": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "ds6XFVrh34AWYAedlMo8tVkmxsxyXnwP0N6FTjlq4p1oR6TQktIabUDkSMKgStVYt4c4b4Rus3H/Oad9I4uSlQ==" + }, + "Microsoft.EntityFrameworkCore.Analyzers": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "doouHLWFcYcd08QUh9+4aZu3sk4WySp/aSOHeIzNhMJ58ESQXUAGDvB1sjJ4HmE0tmCea51NGzgtHE5IBmFLGg==" + }, + "Microsoft.EntityFrameworkCore.Relational": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "25GWyYLMm4T+iuxJLhXR/GTzeYR7tIhYUOCIaWkSFTI4FB39yQz8wg5EfyhPUL4Jfhjk94X+yFsff/HoNaCVIA==", + "dependencies": { + "Microsoft.EntityFrameworkCore": "7.0.20", + "Microsoft.Extensions.Configuration.Abstractions": "7.0.0" + } + }, + "Microsoft.EntityFrameworkCore.SqlServer": { + "type": "Transitive", + "resolved": "7.0.20", + "contentHash": "ukRrvvgDRbs5At/4zQv84gxi+arXvuwRvUHL1cQOdWyOAvSBBieVSmbFhR8ihbbE1Czo3MduxJ+eF2ztHVYC3A==", + "dependencies": { + "Microsoft.Data.SqlClient": "5.1.5", + "Microsoft.EntityFrameworkCore.Relational": "7.0.20" + } + }, + "Microsoft.Extensions.Caching.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "IeimUd0TNbhB4ded3AbgBLQv2SnsiVugDyGV1MvspQFVlA07nDC7Zul7kcwH5jWN3JiTcp/ySE83AIJo8yfKjg==", + "dependencies": { + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.Caching.Memory": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "xpidBs2KCE2gw1JrD0quHE72kvCaI3xFql5/Peb2GRtUuZX+dYPoK/NTdVMiM67Svym0M0Df9A3xyU0FbMQhHw==", + "dependencies": { + "Microsoft.Extensions.Caching.Abstractions": "7.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", + "Microsoft.Extensions.Logging.Abstractions": "7.0.0", + "Microsoft.Extensions.Options": "7.0.0", + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "f34u2eaqIjNO9YLHBz8rozVZ+TcFiFs0F3r7nUJd7FRkVSxk8u4OpoK226mi49MwexHOR2ibP9MFvRUaLilcQQ==", + "dependencies": { + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "elNeOmkeX3eDVG6pYVeV82p29hr+UKDaBhrZyWvWLw/EVZSYEkZlQdkp0V39k/Xehs2Qa0mvoCvkVj3eQxNQ1Q==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "h3j/QfmFN4S0w4C2A6X7arXij/M/OVw3uQHSOFxnND4DyAzO1F9eMX7Eti7lU/OkSthEE0WzRsfT/Dmx86jzCw==" + }, + "Microsoft.Extensions.Logging": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "Nw2muoNrOG5U5qa2ZekXwudUn2BJcD41e65zwmDHb1fQegTX66UokLWZkJRpqSSHXDOWZ5V0iqhbxOEky91atA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "7.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", + "Microsoft.Extensions.Logging.Abstractions": "7.0.0", + "Microsoft.Extensions.Options": "7.0.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "lP1yBnTTU42cKpMozuafbvNtQ7QcBjr/CcK3bYOGEMH55Fjt+iecXjT6chR7vbgCMqy3PG3aNQSZgo/EuY/9qQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", + "Microsoft.Extensions.Primitives": "7.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "7.0.0", + "contentHash": "um1KU5kxcRp3CNuI8o/GrZtD4AIOXDk+RLsytjZ9QPok3ttLUelLKpilVPuaFT3TFjOhSibUAso0odbOaCDj3Q==" + }, + "Microsoft.Identity.Client": { + "type": "Transitive", + "resolved": "4.56.0", + "contentHash": "rr4zbidvHy9r4NvOAs5hdd964Ao2A0pAeFBJKR95u1CJAVzbd1p6tPTXUZ+5ld0cfThiVSGvz6UHwY6JjraTpA==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.22.0" + } + }, + "Microsoft.Identity.Client.Extensions.Msal": { + "type": "Transitive", + "resolved": "4.56.0", + "contentHash": "H12YAzEGK55vZ+QpxUzozhW8ZZtgPDuWvgA0JbdIR9UhMUplj29JhIgE2imuH8W2Nw9D8JKygR1uxRFtpSNcrg==", + "dependencies": { + "Microsoft.Identity.Client": "4.56.0", + "System.IO.FileSystem.AccessControl": "5.0.0", + "System.Security.Cryptography.ProtectedData": "4.5.0" + } + }, + "Microsoft.IdentityModel.Abstractions": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "xuR8E4Rd96M41CnUSCiOJ2DBh+z+zQSmyrYHdYhD6K4fXBcQGVnRCFQ0efROUYpP+p0zC1BLKr0JRpVuujTZSg==" + }, + "Microsoft.IdentityModel.JsonWebTokens": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "9wxai3hKgZUb4/NjdRKfQd0QJvtXKDlvmGMYACbEC8DFaicMFCFhQFZq9ZET1kJLwZahf2lfY5Gtcpsx8zYzbg==", + "dependencies": { + "Microsoft.IdentityModel.Tokens": "6.35.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + } + }, + "Microsoft.IdentityModel.Logging": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "jePrSfGAmqT81JDCNSY+fxVWoGuJKt9e6eJ+vT7+quVS55nWl//jGjUQn4eFtVKt4rt5dXaleZdHRB9J9AJZ7Q==", + "dependencies": { + "Microsoft.IdentityModel.Abstractions": "6.35.0" + } + }, + "Microsoft.IdentityModel.Protocols": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "BPQhlDzdFvv1PzaUxNSk+VEPwezlDEVADIKmyxubw7IiELK18uJ06RQ9QKKkds30XI+gDu9n8j24XQ8w7fjWcg==", + "dependencies": { + "Microsoft.IdentityModel.Logging": "6.35.0", + "Microsoft.IdentityModel.Tokens": "6.35.0" + } + }, + "Microsoft.IdentityModel.Protocols.OpenIdConnect": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "LMtVqnECCCdSmyFoCOxIE5tXQqkOLrvGrL7OxHg41DIm1bpWtaCdGyVcTAfOQpJXvzND9zUKIN/lhngPkYR8vg==", + "dependencies": { + "Microsoft.IdentityModel.Protocols": "6.35.0", + "System.IdentityModel.Tokens.Jwt": "6.35.0" + } + }, + "Microsoft.IdentityModel.Tokens": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "RN7lvp7s3Boucg1NaNAbqDbxtlLj5Qeb+4uSS1TeK5FSBVM40P4DKaTKChT43sHyKfh7V0zkrMph6DdHvyA4bg==", + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "Microsoft.IdentityModel.Logging": "6.35.0", + "System.Security.Cryptography.Cng": "4.5.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.NETCore.Targets": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" + }, + "Microsoft.SqlServer.Server": { + "type": "Transitive", + "resolved": "1.0.0", + "contentHash": "N4KeF3cpcm1PUHym1RmakkzfkEv3GRMyofVv40uXsQhCQeglr2OHNcUk2WOG51AKpGO8ynGpo9M/kFXSzghwug==" + }, + "Microsoft.Win32.SystemEvents": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "hqTM5628jSsQiv+HGpiq3WKBl2c8v1KZfby2J6Pr7pEPlK9waPdgEO6b8A/+/xn/yZ9ulv8HuqK71ONy2tg67A==" + }, + "System.Configuration.ConfigurationManager": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "jXw9MlUu/kRfEU0WyTptAVueupqIeE3/rl0EZDMlf8pcvJnitQ8HeVEp69rZdaStXwTV72boi/Bhw8lOeO+U2w==", + "dependencies": { + "System.Security.Cryptography.ProtectedData": "6.0.0", + "System.Security.Permissions": "6.0.0" + } + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "6.0.1", + "contentHash": "KiLYDu2k2J82Q9BJpWiuQqCkFjRBWVq4jDzKKWawVi9KWzyD0XG3cmfX0vqTQlL14Wi9EufJrbL0+KCLTbqWiQ==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Drawing.Common": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "NfuoKUiP2nUWwKZN6twGqXioIe1zVD0RIj2t976A+czLHr2nY454RwwXs6JU9Htc6mwqL6Dn/nEL3dpVf2jOhg==", + "dependencies": { + "Microsoft.Win32.SystemEvents": "6.0.0" + } + }, + "System.Formats.Asn1": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "MTvUIktmemNB+El0Fgw9egyqT9AYSIk6DTJeoDSpc3GIHxHCMo8COqkWT1mptX5tZ1SlQ6HJZ0OsSvMth1c12w==" + }, + "System.IdentityModel.Tokens.Jwt": { + "type": "Transitive", + "resolved": "6.35.0", + "contentHash": "yxGIQd3BFK7F6S62/7RdZk3C/mfwyVxvh6ngd1VYMBmbJ1YZZA9+Ku6suylVtso0FjI0wbElpJ0d27CdsyLpBQ==", + "dependencies": { + "Microsoft.IdentityModel.JsonWebTokens": "6.35.0", + "Microsoft.IdentityModel.Tokens": "6.35.0" + } + }, + "System.IO.FileSystem.AccessControl": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "SxHB3nuNrpptVk+vZ/F+7OHEpoHUIKKMl02bUmYHQr1r+glbZQxs7pRtsf4ENO29TVm2TH3AEeep2fJcy92oYw==", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + }, + "System.Memory.Data": { + "type": "Transitive", + "resolved": "1.0.2", + "contentHash": "JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.6.0" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Runtime": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0" + } + }, + "System.Runtime.Caching": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "E0e03kUp5X2k+UAoVl6efmI7uU7JRBWi5EIdlQ7cr0NpBGjHG4fWII35PgsBY9T4fJQ8E4QPsL0rKksU9gcL5A==", + "dependencies": { + "System.Configuration.ConfigurationManager": "6.0.0" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Security.AccessControl": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==" + }, + "System.Security.Cryptography.Cng": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==", + "dependencies": { + "System.Formats.Asn1": "5.0.0" + } + }, + "System.Security.Cryptography.ProtectedData": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "rp1gMNEZpvx9vP0JW0oHLxlf8oSiQgtno77Y4PLUBjSiDYoD77Y8uXHr1Ea5XG4/pIKhqAdxZ8v8OTUtqo9PeQ==" + }, + "System.Security.Permissions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "T/uuc7AklkDoxmcJ7LGkyX1CcSviZuLCa4jg3PekfJ7SU0niF0IVTXwUiNVP9DSpzou2PpxJ+eNY2IfDM90ZCg==", + "dependencies": { + "System.Security.AccessControl": "6.0.0", + "System.Windows.Extensions": "6.0.0" + } + }, + "System.Security.Principal.Windows": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" + }, + "System.Text.Encoding": { + "type": "Transitive", + "resolved": "4.3.0", + "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0", + "Microsoft.NETCore.Targets": "1.1.0", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.CodePages": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "4.7.2", + "contentHash": "TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==" + }, + "System.Windows.Extensions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "IXoJOXIqc39AIe+CIR7koBtRGMiCt/LPM3lI+PELtDIy9XdyeSrwXFdWV9dzJ2Awl0paLWUaknLxFQ5HpHZUog==", + "dependencies": { + "System.Drawing.Common": "6.0.0" + } + }, + "rems.database": { + "type": "Project", + "dependencies": { + "Microsoft.EntityFrameworkCore": "[7.0.20, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.20, )" + } + }, + "rems.models": { + "type": "Project", + "dependencies": { + "REMS.Database": "[1.0.0, )" + } + } + } + } +} \ No newline at end of file From 8ea06f8a0c603a0d5eb187f8874e68e88afe05f5 Mon Sep 17 00:00:00 2001 From: Thein Htay Date: Sun, 4 Aug 2024 22:36:50 +0630 Subject: [PATCH 02/28] fix: update for email and phone number null case --- REMS.Mapper/ChangeModel.cs | 4 +++- REMS.Models/Client/ClientRequestModel.cs | 12 ++++++++---- REMS.Modules/Features/Client/DA_Client.cs | 24 +++++++++++++++-------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/REMS.Mapper/ChangeModel.cs b/REMS.Mapper/ChangeModel.cs index 7272cbe..5c8db65 100644 --- a/REMS.Mapper/ChangeModel.cs +++ b/REMS.Mapper/ChangeModel.cs @@ -79,7 +79,7 @@ public static Client Change(this ClientRequestModel requestModel) return client; } - public static ClientModel Change(this Client dataModel) + public static ClientModel Change(this Client dataModel, User user) { var clientResponseModel = new ClientModel { @@ -88,6 +88,8 @@ public static ClientModel Change(this Client dataModel) FirstName = dataModel.FirstName, LastName = dataModel.LastName, Address = dataModel.Address, + Email = user?.Email, + Phone = user?.Phone }; return clientResponseModel; } diff --git a/REMS.Models/Client/ClientRequestModel.cs b/REMS.Models/Client/ClientRequestModel.cs index 9eb5727..5d0fd69 100644 --- a/REMS.Models/Client/ClientRequestModel.cs +++ b/REMS.Models/Client/ClientRequestModel.cs @@ -1,20 +1,24 @@ -namespace REMS.Models.Client; +using System.Text.Json.Serialization; + +namespace REMS.Models.Client; public class ClientRequestModel { + [JsonIgnore] // Completely hides from API schema public int? UserId { get; set; } - public string FirstName { get; set; } = null!; + public string? FirstName { get; set; } = null!; - public string LastName { get; set; } = null!; + public string? LastName { get; set; } = null!; public string? Phone { get; set; } public string? Email { get; set; } - public string Password { get; set; } + public string? Password { get; set; } public string? Address { get; set; } + [JsonIgnore] public DateTime DateCreate { get; set; } = DateTime.Now; } diff --git a/REMS.Modules/Features/Client/DA_Client.cs b/REMS.Modules/Features/Client/DA_Client.cs index 070c4e2..eae5da7 100644 --- a/REMS.Modules/Features/Client/DA_Client.cs +++ b/REMS.Modules/Features/Client/DA_Client.cs @@ -19,14 +19,20 @@ public async Task> GetClients() var responseModel = new ClientListResponseModel(); try { + //var clients = await _db + // .Clients + // .AsNoTracking() + // .ToListAsync(); + var clients = await _db - .Clients - .AsNoTracking() - .ToListAsync(); + .Clients + .Include(c => c.User) + .AsNoTracking() + .ToListAsync(); var clientResponseModel = clients.Select(client => new ClientResponseModel { - Client = client.Change() + Client = client.Change(client.User) }).ToList(); var clientListResponse = new ClientListResponseModel @@ -62,7 +68,7 @@ public async Task> GetClients(int pageNo = 1, in var clientResponseModel = clients.Select(client => new ClientResponseModel { - Client = client.Change() + Client = client.Change(client.User!) }).ToList(); var clientListResponse = new ClientListResponseModel @@ -89,8 +95,10 @@ public async Task> GetClientById(int id) { var client = await _db .Clients + .Include(c => c.User) // Include the User entity .AsNoTracking() .FirstOrDefaultAsync(x => x.ClientId == id); + if (client is null) { throw new Exception("Client Not Found"); @@ -98,7 +106,7 @@ public async Task> GetClientById(int id) var responseModel = new ClientResponseModel { - Client = client.Change() + Client = client.Change(client.User) }; model = Result.Success(responseModel); @@ -141,7 +149,7 @@ public async Task> CreateClient(ClientRequestModel r var responseModel = new ClientResponseModel { - Client = client.Change(), + Client = client.Change(user), }; model = addClient > 0 @@ -214,7 +222,7 @@ public async Task> UpdateClient(int id, ClientReques var clientResponseModel = new ClientResponseModel { - Client = client.Change() + Client = client.Change(user) }; model = Result.Success(clientResponseModel); From 9c4d85bc45e6f99fa2c75d6552c0866d60dd505c Mon Sep 17 00:00:00 2001 From: Lint Action Date: Sun, 4 Aug 2024 16:12:05 +0000 Subject: [PATCH 03/28] Fix code style issues with dotnet_format --- REMS.BackendApi/Features/Client/ClientController.cs | 2 +- REMS.Modules/Features/Authentication/BL_Signin.cs | 2 +- REMS.Modules/Features/Authentication/DA_Signin.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/REMS.BackendApi/Features/Client/ClientController.cs b/REMS.BackendApi/Features/Client/ClientController.cs index c7e6074..9ddefae 100644 --- a/REMS.BackendApi/Features/Client/ClientController.cs +++ b/REMS.BackendApi/Features/Client/ClientController.cs @@ -4,7 +4,7 @@ namespace REMS.BackendApi.Features.Client; [Route("api/v1/clients")] [ApiController] -[Authorize(Roles ="Agent")] +[Authorize(Roles = "Agent")] public class ClientController : ControllerBase { private readonly BL_Client _blClient; diff --git a/REMS.Modules/Features/Authentication/BL_Signin.cs b/REMS.Modules/Features/Authentication/BL_Signin.cs index 8fb3851..1f73a2b 100644 --- a/REMS.Modules/Features/Authentication/BL_Signin.cs +++ b/REMS.Modules/Features/Authentication/BL_Signin.cs @@ -23,7 +23,7 @@ public async Task> Signin(SigninRequestModel request } model = await _daSignin.Signin(requestModel); - result: + result: return model; } diff --git a/REMS.Modules/Features/Authentication/DA_Signin.cs b/REMS.Modules/Features/Authentication/DA_Signin.cs index 65dbdef..8a3a3f7 100644 --- a/REMS.Modules/Features/Authentication/DA_Signin.cs +++ b/REMS.Modules/Features/Authentication/DA_Signin.cs @@ -38,7 +38,7 @@ public async Task> Signin(SigninRequestModel request model = Result.Success(new SigninResponseModel(accessToken, role)); - result: + result: return model; } @@ -59,7 +59,7 @@ private async Task SaveLogin(User data, string accessToken) public async Task> SignOut(string accessToken) { Result model; - + var item = await _db.Logins .Where(l => l.AccessToken == accessToken) .FirstOrDefaultAsync(); @@ -76,7 +76,7 @@ public async Task> SignOut(string accessToken) await _db.SaveChangesAsync(); model = Result.Success("SignOut successful."); - result: + result: return model; } } \ No newline at end of file From ad6d423a58e821c0260e4c8d6dac8e8d63c5215e Mon Sep 17 00:00:00 2001 From: Thein Htay Date: Sun, 4 Aug 2024 23:15:41 +0630 Subject: [PATCH 04/28] fix: fix issue for GetClient with pagination --- REMS.Modules/Features/Client/DA_Client.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/REMS.Modules/Features/Client/DA_Client.cs b/REMS.Modules/Features/Client/DA_Client.cs index eae5da7..dcbf960 100644 --- a/REMS.Modules/Features/Client/DA_Client.cs +++ b/REMS.Modules/Features/Client/DA_Client.cs @@ -62,6 +62,7 @@ public async Task> GetClients(int pageNo = 1, in var clients = await _db.Clients .AsNoTracking() + .Include(c => c.User) .Skip((pageNo - 1) * pageSize) .Take(pageSize) .ToListAsync(); From 1eb259c16c8c8c92d8c1ba719346811f189c7818 Mon Sep 17 00:00:00 2001 From: Thein Htay Date: Mon, 5 Aug 2024 00:04:20 +0630 Subject: [PATCH 05/28] fix: Email already exist issue in client create --- REMS.Modules/Features/Client/DA_Client.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/REMS.Modules/Features/Client/DA_Client.cs b/REMS.Modules/Features/Client/DA_Client.cs index dcbf960..acc089b 100644 --- a/REMS.Modules/Features/Client/DA_Client.cs +++ b/REMS.Modules/Features/Client/DA_Client.cs @@ -129,11 +129,18 @@ public async Task> CreateClient(ClientRequestModel r throw new ArgumentNullException(nameof(requestModel), "Request model cannot be null"); } + if (CheckEmailDuplicate(requestModel.Email)) + { + model = Result.Error("Client create failed. Email already exist"); + goto result; + } + await _db.Users.AddAsync(requestModel.ChangeUser()); int result = await _db.SaveChangesAsync(); if (result < 0) { model = Result.Error("Client create failed."); + goto result; } //To get UserId for client create @@ -161,6 +168,7 @@ public async Task> CreateClient(ClientRequestModel r { model = Result.Error(ex); } + result: return model; } @@ -176,6 +184,7 @@ public async Task> UpdateClient(int id, ClientReques if (client is null) { return model = Result.Error("Client Not Found"); + goto result; } var user = await _db.Users @@ -185,6 +194,7 @@ public async Task> UpdateClient(int id, ClientReques if (user is null) { return model = Result.Error("User Not Found"); + goto result; } if (!string.IsNullOrWhiteSpace(requestModel.FirstName) || !string.IsNullOrWhiteSpace(requestModel.LastName)) @@ -232,6 +242,7 @@ public async Task> UpdateClient(int id, ClientReques { model = Result.Error(ex); } + result: return model; } @@ -274,4 +285,10 @@ public async Task> DeleteClient(int id) } return model; } + + private bool CheckEmailDuplicate(string email) + { + var isDuplicate = _db.Users.Any(x => x.Email == email); + return isDuplicate; + } } \ No newline at end of file From 33b2a48a48e21cc6e26c074b75b270b0db1df477 Mon Sep 17 00:00:00 2001 From: LinThitHtwe Date: Mon, 5 Aug 2024 00:41:24 +0630 Subject: [PATCH 06/28] [Add] Change Property status endpoint --- .../Features/Property/PropertyController.cs | 25 +++++++++ REMS.Mapper/ChangeModel.cs | 4 +- REMS.Models/EnumStatus.cs | 9 +++ REMS.Models/Property/PropertyRequestModel.cs | 4 -- .../PropertyStatusChangeRequestModel.cs | 9 +++ REMS.Modules/Features/Property/BL_Property.cs | 10 ++++ REMS.Modules/Features/Property/DA_Property.cs | 55 +++++++++++++++---- 7 files changed, 98 insertions(+), 18 deletions(-) create mode 100644 REMS.Models/Property/PropertyStatusChangeRequestModel.cs diff --git a/REMS.BackendApi/Features/Property/PropertyController.cs b/REMS.BackendApi/Features/Property/PropertyController.cs index 82bc23a..997d0e0 100644 --- a/REMS.BackendApi/Features/Property/PropertyController.cs +++ b/REMS.BackendApi/Features/Property/PropertyController.cs @@ -127,6 +127,31 @@ public async Task UpdateProperty(int propertyId, [FromBody] Prope } } + [HttpPut("ChangeStatus")] + public async Task ChangePropertyStatus(PropertyStatusChangeRequestModel requestModel) + { + if (requestModel == null) + { + return BadRequest("Reuqest cannot be null"); + } + + if (requestModel.PropertyId < 1) + { + return BadRequest("Invalid Property Id"); + } + + try + { + var result = await _blProperties.ChangePropertyStatus(requestModel); + return Ok(result); + } + catch (Exception ex) + { + return BadRequest(ex.Message); + } + + } + [HttpDelete("{propertyId}")] public async Task DeleteProperty(int propertyId) { diff --git a/REMS.Mapper/ChangeModel.cs b/REMS.Mapper/ChangeModel.cs index 7272cbe..4398e56 100644 --- a/REMS.Mapper/ChangeModel.cs +++ b/REMS.Mapper/ChangeModel.cs @@ -139,10 +139,8 @@ public static Property Change(this PropertyRequestModel requestModel) NumberOfBathrooms = requestModel.NumberOfBathrooms, YearBuilt = requestModel.YearBuilt, Description = requestModel.Description, - Status = requestModel.Status, AvailiablityType = requestModel.AvailiablityType, - MinrentalPeriod = requestModel.MinRentalPeriod, - Approvedby = requestModel.ApprovedBy, + MinrentalPeriod = requestModel.MinRentalPeriod, }; return property; diff --git a/REMS.Models/EnumStatus.cs b/REMS.Models/EnumStatus.cs index 8f48ef6..ace4ea2 100644 --- a/REMS.Models/EnumStatus.cs +++ b/REMS.Models/EnumStatus.cs @@ -5,4 +5,13 @@ public enum EnumStatus Success, Fail, NotFound +} + +public enum PropertyStatus +{ + Pending, + Approved, + Sold, + Rented, + Canceled } \ No newline at end of file diff --git a/REMS.Models/Property/PropertyRequestModel.cs b/REMS.Models/Property/PropertyRequestModel.cs index 5dffbe5..5307253 100644 --- a/REMS.Models/Property/PropertyRequestModel.cs +++ b/REMS.Models/Property/PropertyRequestModel.cs @@ -26,14 +26,10 @@ public class PropertyRequestModel public string? Description { get; set; } - public string Status { get; set; } - public string AvailiablityType { get; set; } public int? MinRentalPeriod { get; set; } - public string? ApprovedBy { get; set; } - public List Images { get; set; } = new List(); } diff --git a/REMS.Models/Property/PropertyStatusChangeRequestModel.cs b/REMS.Models/Property/PropertyStatusChangeRequestModel.cs new file mode 100644 index 0000000..c6dec25 --- /dev/null +++ b/REMS.Models/Property/PropertyStatusChangeRequestModel.cs @@ -0,0 +1,9 @@ +namespace REMS.Models.Property +{ + public class PropertyStatusChangeRequestModel + { + public int PropertyId { get; set; } + public string PropertyStatus { get; set; } + public string ApprovedBy { get; set; } + } +} \ No newline at end of file diff --git a/REMS.Modules/Features/Property/BL_Property.cs b/REMS.Modules/Features/Property/BL_Property.cs index 500bca6..2f0bd4a 100644 --- a/REMS.Modules/Features/Property/BL_Property.cs +++ b/REMS.Modules/Features/Property/BL_Property.cs @@ -101,6 +101,16 @@ public async Task> UpdateProperty(int propertyId, return response; } + public async Task> ChangePropertyStatus(PropertyStatusChangeRequestModel requestModel) + { + if (requestModel.PropertyId < 1) + { + throw new Exception("Invalid Property Id"); + } + var result = await _daProperty.ChangePropertyStatus(requestModel); + return result; + } + public async Task> DeleteProperty(int propertyId) { if (propertyId < 1) diff --git a/REMS.Modules/Features/Property/DA_Property.cs b/REMS.Modules/Features/Property/DA_Property.cs index d246864..27c0934 100644 --- a/REMS.Modules/Features/Property/DA_Property.cs +++ b/REMS.Modules/Features/Property/DA_Property.cs @@ -157,7 +157,7 @@ public async Task> GetPropertyById(int propertyId) .Include(x => x.PropertyImages) .FirstOrDefaultAsync(x => x.PropertyId == propertyId) ?? throw new Exception("Property Not Found"); - + var propertyResponse = new PropertyResponseModel { Property = property.Change(), @@ -189,6 +189,7 @@ public async Task> CreateProperty(PropertyRequestM var property = requestModel.Change() ?? throw new Exception("Failed to convert request model to property entity"); + property.Status = nameof(PropertyStatus.Pending); await _db.Properties.AddAsync(property); await _db.SaveChangesAsync(); @@ -253,7 +254,6 @@ public async Task> UpdateProperty(int propertyId, property.NumberOfBathrooms = requestModel.NumberOfBathrooms; property.YearBuilt = requestModel.YearBuilt; property.Description = requestModel.Description; - property.Status = requestModel.Status; property.AvailiablityType = requestModel.AvailiablityType; property.MinrentalPeriod = requestModel.MinRentalPeriod; property.Editdate = DateTime.Now; @@ -289,6 +289,48 @@ public async Task> UpdateProperty(int propertyId, } } + public async Task> ChangePropertyStatus(PropertyStatusChangeRequestModel requestModel) + { + Result model = null; + try + { + var property = await _db.Properties + .Include(x => x.PropertyImages) + .FirstOrDefaultAsync(x => x.PropertyId == requestModel.PropertyId) + ?? throw new Exception("Property Not Found"); + + if (!Enum.TryParse(requestModel.PropertyStatus, out var parsedStatus) || !Enum.IsDefined(typeof(PropertyStatus), parsedStatus)) + { + throw new Exception($"Invalid Status; Status should be one of the following: {string.Join(", ", Enum.GetNames(typeof(PropertyStatus)))}"); + } + + property.Status = requestModel.PropertyStatus; + property.Approvedby = requestModel.ApprovedBy; + + _db.Properties.Update(property); + await _db.SaveChangesAsync(); + + var updatedProperty = await _db.Properties + .AsNoTracking() + .Include(x => x.PropertyImages) + .FirstOrDefaultAsync(x => x.PropertyId == property.PropertyId) + ?? throw new Exception("Property Not Found"); + + var responseModel = new PropertyResponseModel + { + Property = updatedProperty.Change(), + Images = updatedProperty.PropertyImages.Select(x => x.Change()).ToList() + }; + model = Result.Success(responseModel); + return model; + } + catch (Exception ex) + { + model = Result.Error(ex); + return model; + } + } + public async Task> DeleteProperty(int propertyId) { Result model = null; @@ -319,15 +361,6 @@ public async Task> DeleteProperty(int propertyId) } } - //private async Task GetPropertyById(int propertyId) - //{ - // var property = await _db.Properties - // .AsNoTracking() - // .Include(x => x.PropertyImages) - // .FirstOrDefaultAsync(x => x.PropertyId == propertyId) - // ?? throw new Exception("Property Not Found"); - //} - private async Task SavePhotoInFolder(string base64Str) { string folderPath = _configuration.GetSection("ImageFolderPath").Value!; From 37b04424a2e86d2372660749e3a02e85e759df13 Mon Sep 17 00:00:00 2001 From: LinThitHtwe Date: Mon, 5 Aug 2024 00:46:29 +0630 Subject: [PATCH 07/28] [Modify] Proeprty Delete --- REMS.Modules/Features/Property/DA_Property.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/REMS.Modules/Features/Property/DA_Property.cs b/REMS.Modules/Features/Property/DA_Property.cs index 27c0934..5a7595a 100644 --- a/REMS.Modules/Features/Property/DA_Property.cs +++ b/REMS.Modules/Features/Property/DA_Property.cs @@ -146,7 +146,6 @@ public async Task> GetPropertiesByAgentId(int } } - public async Task> GetPropertyById(int propertyId) { Result model = null; @@ -341,14 +340,8 @@ public async Task> DeleteProperty(int propertyId) .FirstOrDefaultAsync(x => x.PropertyId == propertyId) ?? throw new Exception("Property Not Found"); - foreach (var propertyImage in property.PropertyImages) - { - RemovePhotoFromFolder(propertyImage.ImageUrl); - } - - _db.Properties.Remove(property); - _db.PropertyImages.RemoveRange(property.PropertyImages); - + property.Status = nameof(PropertyStatus.Canceled); + _db.Properties.Update(property); await _db.SaveChangesAsync(); model = Result.Success(null); From dfffe5339ab9634d85a76c1dfcf656eef5679d5b Mon Sep 17 00:00:00 2001 From: LinThitHtwe Date: Mon, 5 Aug 2024 07:49:11 +0630 Subject: [PATCH 08/28] [Add] Property Status filter for get methods --- .../Features/Property/PropertyController.cs | 18 ++++++++++++++---- REMS.Modules/Features/Property/BL_Property.cs | 8 ++++---- REMS.Modules/Features/Property/DA_Property.cs | 8 ++++++-- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/REMS.BackendApi/Features/Property/PropertyController.cs b/REMS.BackendApi/Features/Property/PropertyController.cs index 997d0e0..0e53d1b 100644 --- a/REMS.BackendApi/Features/Property/PropertyController.cs +++ b/REMS.BackendApi/Features/Property/PropertyController.cs @@ -42,11 +42,16 @@ public async Task GetProperties(int pageNo, int pageSize) } [HttpGet("agent/{agentId}")] - public async Task GetPropertiesByAgentId(int agentId) + public async Task GetPropertiesByAgentId(int agentId,[FromQuery] string propertyStatus = nameof(PropertyStatus.Approved)) { try { - var response = await _blProperties.GetPropertiesByAgentId(agentId); + if (!Enum.TryParse(propertyStatus, out var parsedStatus) || !Enum.IsDefined(typeof(PropertyStatus), parsedStatus)) + { + throw new Exception($"Invalid Status; Status should be one of the following: {string.Join(", ", Enum.GetNames(typeof(PropertyStatus)))}"); + } + + var response = await _blProperties.GetPropertiesByAgentId(agentId, propertyStatus); return Ok(response); } catch (Exception ex) @@ -56,11 +61,16 @@ public async Task GetPropertiesByAgentId(int agentId) } [HttpGet("agent/{agentId}/{pageNo}/{pageSize}")] - public async Task GetPropertiesByAgentId(int agentId,int pageNo,int pageSize) + public async Task GetPropertiesByAgentId(int agentId,int pageNo,int pageSize, [FromQuery] string propertyStatus = nameof(PropertyStatus.Approved)) { try { - var response = await _blProperties.GetPropertiesByAgentId(agentId,pageNo, pageSize); + if (!Enum.TryParse(propertyStatus, out var parsedStatus) || !Enum.IsDefined(typeof(PropertyStatus), parsedStatus)) + { + throw new Exception($"Invalid Status; Status should be one of the following: {string.Join(", ", Enum.GetNames(typeof(PropertyStatus)))}"); + } + + var response = await _blProperties.GetPropertiesByAgentId(agentId,pageNo, pageSize, propertyStatus); return Ok(response); } catch (Exception ex) diff --git a/REMS.Modules/Features/Property/BL_Property.cs b/REMS.Modules/Features/Property/BL_Property.cs index 2f0bd4a..a10f4b8 100644 --- a/REMS.Modules/Features/Property/BL_Property.cs +++ b/REMS.Modules/Features/Property/BL_Property.cs @@ -26,17 +26,17 @@ public async Task> GetProperties(int pageNo, i return response; } - public async Task>> GetPropertiesByAgentId(int agentId) + public async Task>> GetPropertiesByAgentId(int agentId,string propertyStatus) { if (agentId < 1) { throw new Exception("Invalid Agent Id"); } - var response = await _daProperty.GetPropertiesByAgentId(agentId); + var response = await _daProperty.GetPropertiesByAgentId(agentId, propertyStatus); return response; } - public async Task> GetPropertiesByAgentId(int agentId, int pageNo, int pageSize) + public async Task> GetPropertiesByAgentId(int agentId, int pageNo, int pageSize,string propertyStatus) { if (agentId < 1) { @@ -46,7 +46,7 @@ public async Task> GetPropertiesByAgentId(int { throw new Exception("PageNo or PageSize Cannot be less than 1"); } - var response = await _daProperty.GetPropertiesByAgentId(agentId, pageNo, pageSize); + var response = await _daProperty.GetPropertiesByAgentId(agentId, pageNo, pageSize, propertyStatus); return response; } diff --git a/REMS.Modules/Features/Property/DA_Property.cs b/REMS.Modules/Features/Property/DA_Property.cs index 5a7595a..c6686f0 100644 --- a/REMS.Modules/Features/Property/DA_Property.cs +++ b/REMS.Modules/Features/Property/DA_Property.cs @@ -21,6 +21,7 @@ public async Task>> GetProperties() { var properties = await _db.Properties .AsNoTracking() + .Where(x=>x.Status == nameof(PropertyStatus.Approved)) .Include(x => x.PropertyImages) .ToListAsync(); @@ -48,6 +49,7 @@ public async Task> GetProperties(int pageNo = { var properties = await _db.Properties .AsNoTracking() + .Where(x => x.Status == nameof(PropertyStatus.Approved)) .Include(x => x.PropertyImages) .Skip((pageNo - 1) * pageSize) .Take(pageSize) @@ -79,7 +81,7 @@ public async Task> GetProperties(int pageNo = } } - public async Task>> GetPropertiesByAgentId(int agentId) + public async Task>> GetPropertiesByAgentId(int agentId,string propertyStatus) { Result> model = null; try @@ -87,6 +89,7 @@ public async Task>> GetPropertiesByAgentId(in var properties = await _db.Properties .AsNoTracking() .Where(x => x.AgentId == agentId) + .Where(x => x.Status == propertyStatus) .Include(x => x.PropertyImages) .ToListAsync(); @@ -107,7 +110,7 @@ public async Task>> GetPropertiesByAgentId(in } } - public async Task> GetPropertiesByAgentId(int agentId, int pageNo = 1, int pageSize = 10) + public async Task> GetPropertiesByAgentId(int agentId, int pageNo = 1, int pageSize = 10,string propertyStatus = nameof(PropertyStatus.Approved)) { Result model = null; try @@ -115,6 +118,7 @@ public async Task> GetPropertiesByAgentId(int var properties = await _db.Properties .AsNoTracking() .Where(x=>x.AgentId == agentId) + .Where(x=>x.Status == propertyStatus) .Include(x => x.PropertyImages) .Skip((pageNo - 1) * pageSize) .Take(pageSize) From 826b703a522f66e9ac4adf80e67db576af7282ae Mon Sep 17 00:00:00 2001 From: Lint Action Date: Mon, 5 Aug 2024 06:17:10 +0000 Subject: [PATCH 09/28] Fix code style issues with dotnet_format --- .../Features/Property/PropertyController.cs | 6 +++--- REMS.Mapper/ChangeModel.cs | 2 +- REMS.Modules/Features/Property/BL_Property.cs | 4 ++-- REMS.Modules/Features/Property/DA_Property.cs | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/REMS.BackendApi/Features/Property/PropertyController.cs b/REMS.BackendApi/Features/Property/PropertyController.cs index 0e53d1b..0b8fef8 100644 --- a/REMS.BackendApi/Features/Property/PropertyController.cs +++ b/REMS.BackendApi/Features/Property/PropertyController.cs @@ -42,7 +42,7 @@ public async Task GetProperties(int pageNo, int pageSize) } [HttpGet("agent/{agentId}")] - public async Task GetPropertiesByAgentId(int agentId,[FromQuery] string propertyStatus = nameof(PropertyStatus.Approved)) + public async Task GetPropertiesByAgentId(int agentId, [FromQuery] string propertyStatus = nameof(PropertyStatus.Approved)) { try { @@ -61,7 +61,7 @@ public async Task GetPropertiesByAgentId(int agentId,[FromQuery] } [HttpGet("agent/{agentId}/{pageNo}/{pageSize}")] - public async Task GetPropertiesByAgentId(int agentId,int pageNo,int pageSize, [FromQuery] string propertyStatus = nameof(PropertyStatus.Approved)) + public async Task GetPropertiesByAgentId(int agentId, int pageNo, int pageSize, [FromQuery] string propertyStatus = nameof(PropertyStatus.Approved)) { try { @@ -70,7 +70,7 @@ public async Task GetPropertiesByAgentId(int agentId,int pageNo,i throw new Exception($"Invalid Status; Status should be one of the following: {string.Join(", ", Enum.GetNames(typeof(PropertyStatus)))}"); } - var response = await _blProperties.GetPropertiesByAgentId(agentId,pageNo, pageSize, propertyStatus); + var response = await _blProperties.GetPropertiesByAgentId(agentId, pageNo, pageSize, propertyStatus); return Ok(response); } catch (Exception ex) diff --git a/REMS.Mapper/ChangeModel.cs b/REMS.Mapper/ChangeModel.cs index 59791dc..41fed78 100644 --- a/REMS.Mapper/ChangeModel.cs +++ b/REMS.Mapper/ChangeModel.cs @@ -142,7 +142,7 @@ public static Property Change(this PropertyRequestModel requestModel) YearBuilt = requestModel.YearBuilt, Description = requestModel.Description, AvailiablityType = requestModel.AvailiablityType, - MinrentalPeriod = requestModel.MinRentalPeriod, + MinrentalPeriod = requestModel.MinRentalPeriod, Approvedby = requestModel.ApprovedBy, }; diff --git a/REMS.Modules/Features/Property/BL_Property.cs b/REMS.Modules/Features/Property/BL_Property.cs index a10f4b8..54ab462 100644 --- a/REMS.Modules/Features/Property/BL_Property.cs +++ b/REMS.Modules/Features/Property/BL_Property.cs @@ -26,7 +26,7 @@ public async Task> GetProperties(int pageNo, i return response; } - public async Task>> GetPropertiesByAgentId(int agentId,string propertyStatus) + public async Task>> GetPropertiesByAgentId(int agentId, string propertyStatus) { if (agentId < 1) { @@ -36,7 +36,7 @@ public async Task>> GetPropertiesByAgentId(in return response; } - public async Task> GetPropertiesByAgentId(int agentId, int pageNo, int pageSize,string propertyStatus) + public async Task> GetPropertiesByAgentId(int agentId, int pageNo, int pageSize, string propertyStatus) { if (agentId < 1) { diff --git a/REMS.Modules/Features/Property/DA_Property.cs b/REMS.Modules/Features/Property/DA_Property.cs index 67bc792..d102f3a 100644 --- a/REMS.Modules/Features/Property/DA_Property.cs +++ b/REMS.Modules/Features/Property/DA_Property.cs @@ -21,7 +21,7 @@ public async Task>> GetProperties() { var properties = await _db.Properties .AsNoTracking() - .Where(x=>x.Status == nameof(PropertyStatus.Approved)) + .Where(x => x.Status == nameof(PropertyStatus.Approved)) .Include(x => x.PropertyImages) .ToListAsync(); @@ -81,7 +81,7 @@ public async Task> GetProperties(int pageNo = } } - public async Task>> GetPropertiesByAgentId(int agentId,string propertyStatus) + public async Task>> GetPropertiesByAgentId(int agentId, string propertyStatus) { Result> model = null; try @@ -110,15 +110,15 @@ public async Task>> GetPropertiesByAgentId(in } } - public async Task> GetPropertiesByAgentId(int agentId, int pageNo = 1, int pageSize = 10,string propertyStatus = nameof(PropertyStatus.Approved)) + public async Task> GetPropertiesByAgentId(int agentId, int pageNo = 1, int pageSize = 10, string propertyStatus = nameof(PropertyStatus.Approved)) { Result model = null; try { var properties = await _db.Properties .AsNoTracking() - .Where(x=>x.AgentId == agentId) - .Where(x=>x.Status == propertyStatus) + .Where(x => x.AgentId == agentId) + .Where(x => x.Status == propertyStatus) .Include(x => x.PropertyImages) .Skip((pageNo - 1) * pageSize) .Take(pageSize) @@ -160,7 +160,7 @@ public async Task> GetPropertyById(int propertyId) .Include(x => x.PropertyImages) .FirstOrDefaultAsync(x => x.PropertyId == propertyId) ?? throw new Exception("Property Not Found"); - + var propertyResponse = new PropertyResponseModel { Property = property.Change(), From 936cfd4a28e9b20ed7e6a24ae32cdf4e75097610 Mon Sep 17 00:00:00 2001 From: Sann Lynn Htun Date: Mon, 5 Aug 2024 14:03:21 +0630 Subject: [PATCH 10/28] fix: remove Approvedby in Property --- REMS.Mapper/ChangeModel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/REMS.Mapper/ChangeModel.cs b/REMS.Mapper/ChangeModel.cs index 41fed78..77b9ef2 100644 --- a/REMS.Mapper/ChangeModel.cs +++ b/REMS.Mapper/ChangeModel.cs @@ -143,7 +143,6 @@ public static Property Change(this PropertyRequestModel requestModel) Description = requestModel.Description, AvailiablityType = requestModel.AvailiablityType, MinrentalPeriod = requestModel.MinRentalPeriod, - Approvedby = requestModel.ApprovedBy, }; return property; From 90d33e3fd9d2e9b40229d18e25fd0eaeaa3214b2 Mon Sep 17 00:00:00 2001 From: Sann Lynn Htun Date: Mon, 5 Aug 2024 14:30:05 +0630 Subject: [PATCH 11/28] fix: Signin --- .../Authentication/SigninController.cs | 5 ++++- .../Features/Client/ClientController.cs | 2 +- REMS.BackendApi/ModularService.cs | 1 + .../AppDbContextModels/AppDbContext.cs | 20 +++++++++---------- .../Features/Authentication/BL_Signin.cs | 1 + .../Features/Authentication/DA_Signin.cs | 6 +++++- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/REMS.BackendApi/Features/Authentication/SigninController.cs b/REMS.BackendApi/Features/Authentication/SigninController.cs index cd15684..966cce0 100644 --- a/REMS.BackendApi/Features/Authentication/SigninController.cs +++ b/REMS.BackendApi/Features/Authentication/SigninController.cs @@ -1,4 +1,7 @@ -namespace REMS.BackendApi.Features.Authentication; +using REMS.Models.Authentication; +using REMS.Modules.Features.Authentication; + +namespace REMS.BackendApi.Features.Authentication; [Route("api/v1/")] [ApiController] diff --git a/REMS.BackendApi/Features/Client/ClientController.cs b/REMS.BackendApi/Features/Client/ClientController.cs index 9ddefae..391dc36 100644 --- a/REMS.BackendApi/Features/Client/ClientController.cs +++ b/REMS.BackendApi/Features/Client/ClientController.cs @@ -4,7 +4,7 @@ namespace REMS.BackendApi.Features.Client; [Route("api/v1/clients")] [ApiController] -[Authorize(Roles = "Agent")] +//[Authorize(Roles = "Agent")] public class ClientController : ControllerBase { private readonly BL_Client _blClient; diff --git a/REMS.BackendApi/ModularService.cs b/REMS.BackendApi/ModularService.cs index c567ade..970eda8 100644 --- a/REMS.BackendApi/ModularService.cs +++ b/REMS.BackendApi/ModularService.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; +using REMS.Modules.Features.Authentication; using REMS.Shared; namespace REMS.BackendApi; diff --git a/REMS.Database/AppDbContextModels/AppDbContext.cs b/REMS.Database/AppDbContextModels/AppDbContext.cs index 64d5e16..5b60665 100644 --- a/REMS.Database/AppDbContextModels/AppDbContext.cs +++ b/REMS.Database/AppDbContextModels/AppDbContext.cs @@ -39,7 +39,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { - entity.HasKey(e => e.AgentId).HasName("PK__Agents__2C05379EA6EBB571"); + entity.HasKey(e => e.AgentId).HasName("PK__Agents__2C05379E031C7552"); entity.Property(e => e.AgentId).HasColumnName("agent_id"); entity.Property(e => e.Address) @@ -60,7 +60,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.AppointmentId).HasName("PK__Appointm__A50828FC24A54744"); + entity.HasKey(e => e.AppointmentId).HasName("PK__Appointm__A50828FC11F5BF47"); entity.Property(e => e.AppointmentId).HasColumnName("appointment_id"); entity.Property(e => e.AppointmentDate) @@ -85,7 +85,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.ClientId).HasName("PK__Clients__BF21A4249CF6CCE3"); + entity.HasKey(e => e.ClientId).HasName("PK__Clients__BF21A424084C6F3F"); entity.Property(e => e.ClientId).HasColumnName("client_id"); entity.Property(e => e.Address) @@ -128,7 +128,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.MessageId).HasName("PK__Messages__0BBF6EE6D6430682"); + entity.HasKey(e => e.MessageId).HasName("PK__Messages__0BBF6EE6030CF454"); entity.Property(e => e.MessageId).HasColumnName("message_id"); entity.Property(e => e.DateSent) @@ -158,7 +158,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.PropertyId).HasName("PK__Properti__735BA463E2519AE2"); + entity.HasKey(e => e.PropertyId).HasName("PK__Properti__735BA46382020C5F"); entity.Property(e => e.PropertyId).HasColumnName("property_id"); entity.Property(e => e.Adddate) @@ -213,7 +213,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.ImageId).HasName("PK__Property__DC9AC955F55B85D2"); + entity.HasKey(e => e.ImageId).HasName("PK__Property__DC9AC9559298D349"); entity.Property(e => e.ImageId).HasColumnName("image_id"); entity.Property(e => e.DateUploaded) @@ -233,7 +233,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.ReviewId).HasName("PK__Reviews__60883D902BBAE4A3"); + entity.HasKey(e => e.ReviewId).HasName("PK__Reviews__60883D9094BA37F0"); entity.Property(e => e.ReviewId).HasColumnName("review_id"); entity.Property(e => e.Comments).HasColumnName("comments"); @@ -256,7 +256,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.TransactionId).HasName("PK__Transact__85C600AFF7042CF1"); + entity.HasKey(e => e.TransactionId).HasName("PK__Transact__85C600AF52FA1EC6"); entity.Property(e => e.TransactionId).HasColumnName("transaction_id"); entity.Property(e => e.ClientId).HasColumnName("client_id"); @@ -287,9 +287,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.UserId).HasName("PK__Users__B9BE370FBAC9D2EE"); + entity.HasKey(e => e.UserId).HasName("PK__Users__B9BE370F8DDB2A90"); - entity.HasIndex(e => e.Email, "UQ__Users__AB6E6164B090FACB").IsUnique(); + entity.HasIndex(e => e.Email, "UQ__Users__AB6E61643D1F7791").IsUnique(); entity.Property(e => e.UserId).HasColumnName("user_id"); entity.Property(e => e.DateCreated) diff --git a/REMS.Modules/Features/Authentication/BL_Signin.cs b/REMS.Modules/Features/Authentication/BL_Signin.cs index 1f73a2b..ddda4d1 100644 --- a/REMS.Modules/Features/Authentication/BL_Signin.cs +++ b/REMS.Modules/Features/Authentication/BL_Signin.cs @@ -1,6 +1,7 @@ using System.Globalization; using System.Text.RegularExpressions; using REMS.Models; +using REMS.Models.Authentication; namespace REMS.Modules.Features.Authentication; diff --git a/REMS.Modules/Features/Authentication/DA_Signin.cs b/REMS.Modules/Features/Authentication/DA_Signin.cs index 8a3a3f7..1b1bcbf 100644 --- a/REMS.Modules/Features/Authentication/DA_Signin.cs +++ b/REMS.Modules/Features/Authentication/DA_Signin.cs @@ -1,4 +1,8 @@ -namespace REMS.Modules.Features.Authentication; +using REMS.Models.Authentication; +using REMS.Models.Jwt; +using REMS.Shared; + +namespace REMS.Modules.Features.Authentication; public class DA_Signin { From a2f3f04db59558f6a77bef912551f1b7ba3563f8 Mon Sep 17 00:00:00 2001 From: Sann Lynn Htun Date: Mon, 5 Aug 2024 14:45:45 +0630 Subject: [PATCH 12/28] feat: add dynamic port --- REMS.BackendApi/Program.cs | 14 +++++++++++++- REMS.BackendApi/appsettings.json | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/REMS.BackendApi/Program.cs b/REMS.BackendApi/Program.cs index 19ba457..9597031 100644 --- a/REMS.BackendApi/Program.cs +++ b/REMS.BackendApi/Program.cs @@ -3,6 +3,8 @@ var builder = WebApplication.CreateBuilder(args); +builder.Services.Configure(builder.Configuration.GetSection("AppSettings")); + builder.Services.AddControllers(); builder .AddSwagger() @@ -14,6 +16,9 @@ builder.Services.Configure(builder.Configuration.GetSection("Jwt")); var app = builder.Build(); + +var appSettings = builder.Configuration.GetSection("AppSettings").Get(); + //if (app.Environment.IsDevelopment()) //{ // app.UseSwagger(); @@ -28,6 +33,13 @@ app.UseAuthentication(); app.UseAuthorization(); +app.Urls.Add($"http://localhost:{appSettings.Port}"); + app.MapControllers(); -app.Run(); \ No newline at end of file +app.Run(); + +public class AppSettings +{ + public int Port { get; set; } +} \ No newline at end of file diff --git a/REMS.BackendApi/appsettings.json b/REMS.BackendApi/appsettings.json index fc1d60f..ffcca27 100644 --- a/REMS.BackendApi/appsettings.json +++ b/REMS.BackendApi/appsettings.json @@ -18,5 +18,8 @@ "Issuer": "REMS", "Audience": "REMS", "Key": "SU57Ie4vseXyJeUUSL6y8Z1QMFRMb2ZN" + }, + "AppSettings": { + "Port": 8000 } } From 678a24a8c737484860cdc0e3a287c4becadcc079 Mon Sep 17 00:00:00 2001 From: Sann Lynn Htun Date: Mon, 5 Aug 2024 14:51:13 +0630 Subject: [PATCH 13/28] fix: remove dynamic port --- REMS.BackendApi/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMS.BackendApi/Program.cs b/REMS.BackendApi/Program.cs index 9597031..347265c 100644 --- a/REMS.BackendApi/Program.cs +++ b/REMS.BackendApi/Program.cs @@ -33,7 +33,7 @@ app.UseAuthentication(); app.UseAuthorization(); -app.Urls.Add($"http://localhost:{appSettings.Port}"); +//app.Urls.Add($"http://localhost:{appSettings.Port}"); app.MapControllers(); From 5f51d4d10c41cb0c65b703141367c61f52742d02 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Mon, 5 Aug 2024 14:28:19 +0000 Subject: [PATCH 14/28] Fix code style issues with dotnet_format --- REMS.BackendApi/Features/Client/ClientController.cs | 2 +- REMS.Modules/Features/Authentication/BL_Signin.cs | 2 +- REMS.Modules/Features/Authentication/DA_Signin.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/REMS.BackendApi/Features/Client/ClientController.cs b/REMS.BackendApi/Features/Client/ClientController.cs index c7e6074..9ddefae 100644 --- a/REMS.BackendApi/Features/Client/ClientController.cs +++ b/REMS.BackendApi/Features/Client/ClientController.cs @@ -4,7 +4,7 @@ namespace REMS.BackendApi.Features.Client; [Route("api/v1/clients")] [ApiController] -[Authorize(Roles ="Agent")] +[Authorize(Roles = "Agent")] public class ClientController : ControllerBase { private readonly BL_Client _blClient; diff --git a/REMS.Modules/Features/Authentication/BL_Signin.cs b/REMS.Modules/Features/Authentication/BL_Signin.cs index 8fb3851..1f73a2b 100644 --- a/REMS.Modules/Features/Authentication/BL_Signin.cs +++ b/REMS.Modules/Features/Authentication/BL_Signin.cs @@ -23,7 +23,7 @@ public async Task> Signin(SigninRequestModel request } model = await _daSignin.Signin(requestModel); - result: + result: return model; } diff --git a/REMS.Modules/Features/Authentication/DA_Signin.cs b/REMS.Modules/Features/Authentication/DA_Signin.cs index 65dbdef..8a3a3f7 100644 --- a/REMS.Modules/Features/Authentication/DA_Signin.cs +++ b/REMS.Modules/Features/Authentication/DA_Signin.cs @@ -38,7 +38,7 @@ public async Task> Signin(SigninRequestModel request model = Result.Success(new SigninResponseModel(accessToken, role)); - result: + result: return model; } @@ -59,7 +59,7 @@ private async Task SaveLogin(User data, string accessToken) public async Task> SignOut(string accessToken) { Result model; - + var item = await _db.Logins .Where(l => l.AccessToken == accessToken) .FirstOrDefaultAsync(); @@ -76,7 +76,7 @@ public async Task> SignOut(string accessToken) await _db.SaveChangesAsync(); model = Result.Success("SignOut successful."); - result: + result: return model; } } \ No newline at end of file From 6e01241fde727d01927e65a84c57e00b6d0c62e6 Mon Sep 17 00:00:00 2001 From: Sann Lynn Htun Date: Tue, 6 Aug 2024 14:17:52 +0630 Subject: [PATCH 15/28] fix: code changes --- REMS.BackendApi/AppSettings.cs | 4 ++++ REMS.BackendApi/GlobalUsings.cs | 1 + REMS.BackendApi/Program.cs | 24 ++++++++++++------- .../Authentication/SigninRequestModel.cs | 4 +--- .../Authentication/SigninResponseModel.cs | 3 +++ REMS.Models/EnumStatus.cs | 9 ------- .../Property/PropertyImageRequestModel.cs | 7 ++++++ REMS.Models/Property/PropertyRequestModel.cs | 8 +------ REMS.Models/PropertyStatus.cs | 10 ++++++++ 9 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 REMS.BackendApi/AppSettings.cs create mode 100644 REMS.Models/Authentication/SigninResponseModel.cs create mode 100644 REMS.Models/Property/PropertyImageRequestModel.cs create mode 100644 REMS.Models/PropertyStatus.cs diff --git a/REMS.BackendApi/AppSettings.cs b/REMS.BackendApi/AppSettings.cs new file mode 100644 index 0000000..d47dfe4 --- /dev/null +++ b/REMS.BackendApi/AppSettings.cs @@ -0,0 +1,4 @@ +public class AppSettings +{ + public int Port { get; set; } +} \ No newline at end of file diff --git a/REMS.BackendApi/GlobalUsings.cs b/REMS.BackendApi/GlobalUsings.cs index 8bc14b5..5f21086 100644 --- a/REMS.BackendApi/GlobalUsings.cs +++ b/REMS.BackendApi/GlobalUsings.cs @@ -12,6 +12,7 @@ global using REMS.Models.Review; global using REMS.Models.Appointment; global using REMS.Models.Authentication; +global using REMS.Models.Jwt; global using REMS.Models.Transaction; global using REMS.Modules.Features.Agent; global using REMS.Modules.Features.Client; diff --git a/REMS.BackendApi/Program.cs b/REMS.BackendApi/Program.cs index 347265c..b58254f 100644 --- a/REMS.BackendApi/Program.cs +++ b/REMS.BackendApi/Program.cs @@ -1,8 +1,16 @@ - -using REMS.Models.Jwt; - var builder = WebApplication.CreateBuilder(args); +builder.Services.AddCors(options => +{ + options.AddPolicy("AllowAllOrigins", + builder => + { + builder.AllowAnyOrigin() + .AllowAnyHeader() + .AllowAnyMethod(); + }); +}); + builder.Services.Configure(builder.Configuration.GetSection("AppSettings")); builder.Services.AddControllers(); @@ -30,6 +38,9 @@ app.UseHttpsRedirection(); app.UseRouting(); + +app.UseCors("AllowAllOrigins"); + app.UseAuthentication(); app.UseAuthorization(); @@ -37,9 +48,4 @@ app.MapControllers(); -app.Run(); - -public class AppSettings -{ - public int Port { get; set; } -} \ No newline at end of file +app.Run(); \ No newline at end of file diff --git a/REMS.Models/Authentication/SigninRequestModel.cs b/REMS.Models/Authentication/SigninRequestModel.cs index bdc2ff2..b61adf9 100644 --- a/REMS.Models/Authentication/SigninRequestModel.cs +++ b/REMS.Models/Authentication/SigninRequestModel.cs @@ -1,5 +1,3 @@ namespace REMS.Models.Authentication; -public record class SigninRequestModel(string Email, string Password); - -public record class SigninResponseModel(string AccessToken, string Role); \ No newline at end of file +public record class SigninRequestModel(string Email, string Password); \ No newline at end of file diff --git a/REMS.Models/Authentication/SigninResponseModel.cs b/REMS.Models/Authentication/SigninResponseModel.cs new file mode 100644 index 0000000..37264e9 --- /dev/null +++ b/REMS.Models/Authentication/SigninResponseModel.cs @@ -0,0 +1,3 @@ +namespace REMS.Models.Authentication; + +public record class SigninResponseModel(string AccessToken, string Role); \ No newline at end of file diff --git a/REMS.Models/EnumStatus.cs b/REMS.Models/EnumStatus.cs index ace4ea2..8f48ef6 100644 --- a/REMS.Models/EnumStatus.cs +++ b/REMS.Models/EnumStatus.cs @@ -5,13 +5,4 @@ public enum EnumStatus Success, Fail, NotFound -} - -public enum PropertyStatus -{ - Pending, - Approved, - Sold, - Rented, - Canceled } \ No newline at end of file diff --git a/REMS.Models/Property/PropertyImageRequestModel.cs b/REMS.Models/Property/PropertyImageRequestModel.cs new file mode 100644 index 0000000..2ea2d9e --- /dev/null +++ b/REMS.Models/Property/PropertyImageRequestModel.cs @@ -0,0 +1,7 @@ +namespace REMS.Models.Property; + +public class PropertyImageRequestModel +{ + public string? ImgBase64 { get; set; } + public string? Description { get; set; } +} \ No newline at end of file diff --git a/REMS.Models/Property/PropertyRequestModel.cs b/REMS.Models/Property/PropertyRequestModel.cs index 5307253..53c08a7 100644 --- a/REMS.Models/Property/PropertyRequestModel.cs +++ b/REMS.Models/Property/PropertyRequestModel.cs @@ -31,10 +31,4 @@ public class PropertyRequestModel public int? MinRentalPeriod { get; set; } public List Images { get; set; } = new List(); -} - -public class PropertyImageRequestModel -{ - public string? ImgBase64 { get; set; } - public string? Description { get; set; } -} +} \ No newline at end of file diff --git a/REMS.Models/PropertyStatus.cs b/REMS.Models/PropertyStatus.cs new file mode 100644 index 0000000..033fae6 --- /dev/null +++ b/REMS.Models/PropertyStatus.cs @@ -0,0 +1,10 @@ +namespace REMS.Models; + +public enum PropertyStatus +{ + Pending, + Approved, + Sold, + Rented, + Canceled +} \ No newline at end of file From 0400b58e7949192cf02891f294e64715575bebaa Mon Sep 17 00:00:00 2001 From: peekay742 Date: Thu, 8 Aug 2024 12:44:32 +0630 Subject: [PATCH 16/28] fix: issue of review --- .../Features/Review/ReviewController.cs | 12 +- REMS.Mapper/ChangeModel.cs | 5 +- REMS.Models/Review/ReviewListResponseModel.cs | 2 +- REMS.Models/Review/ReviewRequestModel.cs | 23 ++++ REMS.Modules/Features/Review/BL_Review.cs | 12 +- REMS.Modules/Features/Review/DA_Review.cs | 120 ++++++++++++------ 6 files changed, 116 insertions(+), 58 deletions(-) create mode 100644 REMS.Models/Review/ReviewRequestModel.cs diff --git a/REMS.BackendApi/Features/Review/ReviewController.cs b/REMS.BackendApi/Features/Review/ReviewController.cs index 8d13bda..3e4781e 100644 --- a/REMS.BackendApi/Features/Review/ReviewController.cs +++ b/REMS.BackendApi/Features/Review/ReviewController.cs @@ -21,7 +21,7 @@ public async Task GetReview() } catch (Exception ex) { - return BadRequest(ex.Message); + return StatusCode(StatusCodes.Status500InternalServerError, ex.ToString()); } } @@ -49,12 +49,12 @@ public async Task GetReviewById(int reviewId) } catch (Exception ex) { - return BadRequest(ex.Message); + return StatusCode(StatusCodes.Status500InternalServerError, ex.ToString()); } } [HttpPost] - public async Task CreateReview(ReviewModel requestModel) + public async Task CreateReview(ReviewRequestModel requestModel) { try { @@ -68,7 +68,7 @@ public async Task CreateReview(ReviewModel requestModel) } [HttpPatch("{id}")] - public async Task Update(int id, ReviewModel requestModel) + public async Task Update(int id, ReviewRequestModel requestModel) { try { @@ -77,7 +77,7 @@ public async Task Update(int id, ReviewModel requestModel) } catch (Exception ex) { - return BadRequest(ex.Message); + return StatusCode(StatusCodes.Status500InternalServerError, ex.ToString()); } } @@ -91,7 +91,7 @@ public async Task Delete(int id) } catch (Exception ex) { - return BadRequest(ex.Message); + return StatusCode(StatusCodes.Status500InternalServerError, ex.ToString()); } } } \ No newline at end of file diff --git a/REMS.Mapper/ChangeModel.cs b/REMS.Mapper/ChangeModel.cs index 77b9ef2..54db598 100644 --- a/REMS.Mapper/ChangeModel.cs +++ b/REMS.Mapper/ChangeModel.cs @@ -213,22 +213,19 @@ public static ReviewModel Change(this Review dataModel) PropertyId = dataModel.PropertyId, Rating = dataModel.Rating, Comments = dataModel.Comments, - DateCreated = dataModel.DateCreated }; return reviewModel; } - public static Review Change(this ReviewModel dataModel) + public static Review Change(this ReviewRequestModel dataModel) { var review = new Review() { - ReviewId = dataModel.ReviewId, UserId = dataModel.UserId, PropertyId = dataModel.PropertyId, Rating = dataModel.Rating, Comments = dataModel.Comments, - DateCreated = dataModel.DateCreated }; return review; diff --git a/REMS.Models/Review/ReviewListResponseModel.cs b/REMS.Models/Review/ReviewListResponseModel.cs index 0c8bc51..b1d21d6 100644 --- a/REMS.Models/Review/ReviewListResponseModel.cs +++ b/REMS.Models/Review/ReviewListResponseModel.cs @@ -4,7 +4,7 @@ namespace REMS.Models.Review; public class ReviewListResponseModel { - public List DataList { get; set; } + public List DataList { get; set; } public PageSettingModel PageSetting { get; set; } } \ No newline at end of file diff --git a/REMS.Models/Review/ReviewRequestModel.cs b/REMS.Models/Review/ReviewRequestModel.cs new file mode 100644 index 0000000..d228536 --- /dev/null +++ b/REMS.Models/Review/ReviewRequestModel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace REMS.Models.Review +{ + public class ReviewRequestModel + { + public int? UserId { get; set; } + + public int? PropertyId { get; set; } + + public int Rating { get; set; } + + public string? Comments { get; set; } + + [JsonIgnore] + public DateTime? DateCreated { get; set; } = DateTime.Now; + } +} diff --git a/REMS.Modules/Features/Review/BL_Review.cs b/REMS.Modules/Features/Review/BL_Review.cs index f2a3c1b..3cfd042 100644 --- a/REMS.Modules/Features/Review/BL_Review.cs +++ b/REMS.Modules/Features/Review/BL_Review.cs @@ -7,13 +7,13 @@ public class BL_Review public BL_Review(DA_Review daReview) => _daReview = daReview; - public async Task GetReview() + public async Task> GetReview() { var response = await _daReview.GetReview(); return response; } - public async Task GetReviews(int pageNo, int pageSize) + public async Task> GetReviews(int pageNo, int pageSize) { if (pageNo < 1 || pageSize < 1) { @@ -24,7 +24,7 @@ public async Task GetReviews(int pageNo, int pageSize) return response; } - public async Task GetReviewById(int reviewId) + public async Task> GetReviewById(int reviewId) { if (reviewId < 1) { @@ -35,13 +35,13 @@ public async Task GetReviewById(int reviewId) return response; } - public async Task CreateReview(ReviewModel requestModel) + public async Task> CreateReview(ReviewRequestModel requestModel) { var response = await _daReview.CreateReview(requestModel); return response; } - public async Task UpdateReview(int id, ReviewModel requestModel) + public async Task> UpdateReview(int id, ReviewRequestModel requestModel) { if (id <= 0) throw new Exception("ReviewId is null"); //CheckProductNullValue(requestModel); @@ -49,7 +49,7 @@ public async Task UpdateReview(int id, ReviewModel request return response; } - public async Task DeleteReview(int id) + public async Task> DeleteReview(int id) { if (id <= 0) throw new Exception("ReviewId is null"); var response = await _daReview.DeleteReview(id); diff --git a/REMS.Modules/Features/Review/DA_Review.cs b/REMS.Modules/Features/Review/DA_Review.cs index 63d34ba..fbc35bb 100644 --- a/REMS.Modules/Features/Review/DA_Review.cs +++ b/REMS.Modules/Features/Review/DA_Review.cs @@ -6,8 +6,9 @@ public class DA_Review public DA_Review(AppDbContext context) => _context = context; - public async Task GetReview() + public async Task> GetReview() { + Result model = null; var responseModel = new ReviewListResponseModel(); try { @@ -15,87 +16,120 @@ public async Task GetReview() .Reviews .AsNoTracking() .ToListAsync(); - responseModel.DataList = reviews - .Select(x => x.Change()).ToList(); + var reviewResponseModel = reviews.Select(review => new ReviewResponseModel + { + Review = review.Change() + }).ToList(); + + var reviewListResponse = new ReviewListResponseModel + { + DataList = reviewResponseModel, + }; + + model = Result.Success(reviewListResponse); } catch (Exception ex) { - responseModel.DataList = new List(); + model = Result.Error(ex); + return model; } - return responseModel; + return model; } - public async Task GetReviews(int pageNo = 1, int pageSize = 10) + public async Task> GetReviews(int pageNo = 1, int pageSize = 10) { + Result model = null; try { var totalCount = await _context.Reviews.CountAsync(); var pageCount = (int)Math.Ceiling((double)totalCount / pageSize); - var query = await _context - .Reviews + var reviews = await _context.Reviews .AsNoTracking() .Skip((pageNo - 1) * pageSize) .Take(pageSize) .ToListAsync(); - var response = new ReviewListResponseModel + var reviewResponseModel = reviews.Select(review => new ReviewResponseModel { - DataList = query.Select(x => x.Change()).ToList(), + Review = review.Change() + }).ToList(); + var reviewListResponse = new ReviewListResponseModel + { + DataList = reviewResponseModel, PageSetting = new PageSettingModel(pageNo, pageSize, pageCount, totalCount) }; - return response; + model = Result.Success(reviewListResponse); } catch (Exception ex) { - Console.WriteLine(ex); - return null; + model = Result.Error(ex); + return model; } + return model; } - public async Task GetReviewById(int reviewId) + public async Task> GetReviewById(int reviewId) { + Result model = null; try { - var review = await _context.Reviews - .AsNoTracking() - .FirstOrDefaultAsync(x => x.ReviewId == reviewId) - ?? throw new Exception("Review Not Found"); - + var review = await _context + .Reviews + .AsNoTracking() + .FirstOrDefaultAsync(x => x.ReviewId == reviewId); + if (review is null) + { + throw new Exception("review Not Found"); + } var responseModel = new ReviewResponseModel { Review = review.Change() }; - return responseModel; + model = Result.Success(responseModel); } catch (Exception ex) { - Console.WriteLine(ex); - return null; + model = Result.Error(ex); } + + return model; } - public async Task CreateReview(ReviewModel requestModel) + public async Task> CreateReview(ReviewRequestModel requestModel) { + Result model = null; try { - await _context.Reviews.AddAsync(requestModel.Change()); + if (requestModel == null) + { + throw new ArgumentNullException(nameof(requestModel), "Request model cannot be null"); + } + + var review = requestModel.Change(); + await _context.Reviews.AddAsync(review); int addReview = await _context.SaveChangesAsync(); - var response = addReview > 0 - ? new MessageResponseModel(true, "Successfully Saved.") - : new MessageResponseModel(false, "Review Create Failed."); - return response; + var responseModel = new ReviewResponseModel + { + Review = review.Change(), + }; + + model = addReview > 0 + ? Result.Success(responseModel) + : Result.Error("Review create failed."); } catch (Exception ex) { - return new MessageResponseModel(false, ex); + model = Result.Error(ex); } + return model; } - public async Task UpdateReview(int id, ReviewModel requestModel) + public async Task> UpdateReview(int id, ReviewRequestModel requestModel) { + Result model = null; try { var review = await _context.Reviews @@ -139,19 +173,23 @@ public async Task UpdateReview(int id, ReviewModel request _context.Reviews.Update(review); var result = await _context.SaveChangesAsync(); - var response = result > 0 - ? new MessageResponseModel(true, "Update Successfully") - : new MessageResponseModel(false, "Update failed"); - return response; + var reviewResponseModel = new ReviewResponseModel + { + Review = review.Change() + }; + + model = Result.Success(reviewResponseModel); } catch (Exception ex) { - return new MessageResponseModel(false, ex); + model = Result.Error(ex); } + return model; } - public async Task DeleteReview(int id) + public async Task> DeleteReview(int id) { + Result model = null; try { var review = await _context @@ -165,14 +203,14 @@ public async Task DeleteReview(int id) _context.Reviews.Remove(review); var result = await _context.SaveChangesAsync(); - var response = result > 0 - ? new MessageResponseModel(true, "Delete Successfully") - : new MessageResponseModel(false, "Delete Fail"); - return response; + model = result > 0 + ? Result.Success(null) + : Result.Error("Delete failed."); } catch (Exception ex) { - return new MessageResponseModel(false, ex); + return model = Result.Error(ex); } + return model; } } \ No newline at end of file From 9d973a1fe1b9198c3c75b0e4d5692b27a6bb2d34 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Thu, 8 Aug 2024 15:09:20 +0000 Subject: [PATCH 17/28] Fix code style issues with dotnet_format --- REMS.BackendApi/Features/Client/ClientController.cs | 2 +- REMS.Modules/Features/Authentication/BL_Signin.cs | 2 +- REMS.Modules/Features/Authentication/DA_Signin.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/REMS.BackendApi/Features/Client/ClientController.cs b/REMS.BackendApi/Features/Client/ClientController.cs index c7e6074..9ddefae 100644 --- a/REMS.BackendApi/Features/Client/ClientController.cs +++ b/REMS.BackendApi/Features/Client/ClientController.cs @@ -4,7 +4,7 @@ namespace REMS.BackendApi.Features.Client; [Route("api/v1/clients")] [ApiController] -[Authorize(Roles ="Agent")] +[Authorize(Roles = "Agent")] public class ClientController : ControllerBase { private readonly BL_Client _blClient; diff --git a/REMS.Modules/Features/Authentication/BL_Signin.cs b/REMS.Modules/Features/Authentication/BL_Signin.cs index 8fb3851..1f73a2b 100644 --- a/REMS.Modules/Features/Authentication/BL_Signin.cs +++ b/REMS.Modules/Features/Authentication/BL_Signin.cs @@ -23,7 +23,7 @@ public async Task> Signin(SigninRequestModel request } model = await _daSignin.Signin(requestModel); - result: + result: return model; } diff --git a/REMS.Modules/Features/Authentication/DA_Signin.cs b/REMS.Modules/Features/Authentication/DA_Signin.cs index 65dbdef..8a3a3f7 100644 --- a/REMS.Modules/Features/Authentication/DA_Signin.cs +++ b/REMS.Modules/Features/Authentication/DA_Signin.cs @@ -38,7 +38,7 @@ public async Task> Signin(SigninRequestModel request model = Result.Success(new SigninResponseModel(accessToken, role)); - result: + result: return model; } @@ -59,7 +59,7 @@ private async Task SaveLogin(User data, string accessToken) public async Task> SignOut(string accessToken) { Result model; - + var item = await _db.Logins .Where(l => l.AccessToken == accessToken) .FirstOrDefaultAsync(); @@ -76,7 +76,7 @@ public async Task> SignOut(string accessToken) await _db.SaveChangesAsync(); model = Result.Success("SignOut successful."); - result: + result: return model; } } \ No newline at end of file From 64437ad9a07c3f4764db17a085093dd7fc30735f Mon Sep 17 00:00:00 2001 From: Min Khant Thu Date: Fri, 9 Aug 2024 18:23:04 +0630 Subject: [PATCH 18/28] [Complete] Appointment Error Fix --- .../Features/Appointment/AppointmentController.cs | 6 +++--- REMS.Models/Appointment/AppointmentModel.cs | 2 -- REMS.Modules/Features/Appointment/BL_Appointment.cs | 4 ++-- REMS.Modules/Features/Appointment/DA_Appointment.cs | 8 ++++---- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/REMS.BackendApi/Features/Appointment/AppointmentController.cs b/REMS.BackendApi/Features/Appointment/AppointmentController.cs index 1cb37b7..a916a9b 100644 --- a/REMS.BackendApi/Features/Appointment/AppointmentController.cs +++ b/REMS.BackendApi/Features/Appointment/AppointmentController.cs @@ -45,12 +45,12 @@ public async Task DeleteAppointment(int id) } } - [HttpGet("{id}/{pageNo}/{pageSize}")] - public async Task GetAppointmentByAgentId(int id, int pageNo, int pageSize) + [HttpGet("{propertyId}/{pageNo}/{pageSize}")] + public async Task GetAppointmentByAgentId(int propertyId, int pageNo, int pageSize) { try { - var response = await _blAppointment.GetAppointmentByAgentIdAsync(id, pageNo, pageSize); + var response = await _blAppointment.GetAppointmentByPropertyIdAsycn(propertyId, pageNo, pageSize); if (response.IsError) return BadRequest(response); return Ok(response); diff --git a/REMS.Models/Appointment/AppointmentModel.cs b/REMS.Models/Appointment/AppointmentModel.cs index 28afe91..e252b11 100644 --- a/REMS.Models/Appointment/AppointmentModel.cs +++ b/REMS.Models/Appointment/AppointmentModel.cs @@ -10,8 +10,6 @@ public class AppointmentModel { public int AppointmentId { get; set; } - public int? AgentId { get; set; } - public int? ClientId { get; set; } public int? PropertyId { get; set; } diff --git a/REMS.Modules/Features/Appointment/BL_Appointment.cs b/REMS.Modules/Features/Appointment/BL_Appointment.cs index a4cd601..c3e28c8 100644 --- a/REMS.Modules/Features/Appointment/BL_Appointment.cs +++ b/REMS.Modules/Features/Appointment/BL_Appointment.cs @@ -33,14 +33,14 @@ public async Task> DeleteAppointmentAsync(int id) return response; } - public async Task> GetAppointmentByAgentIdAsync(int id, int pageNo, int pageSize) + public async Task> GetAppointmentByPropertyIdAsycn(int id, int pageNo, int pageSize) { var response = CheckPageNoandPageSize(pageNo, pageSize); if (response is not null) { return response; } - return await _daAppointment.GetAppointmentByClientIdAsync(id, pageNo, pageSize); + return await _daAppointment.GetAppointmentByPropertyIdAsycn(id, pageNo, pageSize); } public async Task> UpdateAppointmentAsync(int id, AppointmentRequestModel requestModel) diff --git a/REMS.Modules/Features/Appointment/DA_Appointment.cs b/REMS.Modules/Features/Appointment/DA_Appointment.cs index 3831d21..40f102c 100644 --- a/REMS.Modules/Features/Appointment/DA_Appointment.cs +++ b/REMS.Modules/Features/Appointment/DA_Appointment.cs @@ -77,14 +77,14 @@ public async Task> DeleteAppointmentAsync(int id) return response; } - public async Task> GetAppointmentByClientIdAsync(int id, int pageNo, int pageSize) + public async Task> GetAppointmentByPropertyIdAsycn(int id, int pageNo, int pageSize) { Result response = null; try { var query = _db.Appointments .AsNoTracking() - .Where(x => x.ClientId == id) + .Where(x => x.PropertyId == id) .Select(n => new AppointmentModel { AppointmentId = n.AppointmentId, @@ -130,11 +130,11 @@ public async Task> UpdateAppointmentAsync(int i var appointment = await _db.Appointments .AsNoTracking() - .FirstOrDefaultAsync(x => x.PropertyId == id); ; + .FirstOrDefaultAsync(x => x.AppointmentId == id); if (appointment is null) return Result.Error("appointment not found"); - if (!string.IsNullOrWhiteSpace(requestModel.AppointmentDate.ToString())) + if (requestModel.AppointmentDate!=DateTime.MinValue) { appointment.AppointmentDate = requestModel.AppointmentDate; } From de5f8a727065ddb15fd7f47a31910a76d287d9c5 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Fri, 9 Aug 2024 11:53:50 +0000 Subject: [PATCH 19/28] Fix code style issues with dotnet_format --- REMS.Modules/Features/Appointment/DA_Appointment.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/REMS.Modules/Features/Appointment/DA_Appointment.cs b/REMS.Modules/Features/Appointment/DA_Appointment.cs index 40f102c..8eb1b06 100644 --- a/REMS.Modules/Features/Appointment/DA_Appointment.cs +++ b/REMS.Modules/Features/Appointment/DA_Appointment.cs @@ -130,11 +130,11 @@ public async Task> UpdateAppointmentAsync(int i var appointment = await _db.Appointments .AsNoTracking() - .FirstOrDefaultAsync(x => x.AppointmentId == id); + .FirstOrDefaultAsync(x => x.AppointmentId == id); if (appointment is null) return Result.Error("appointment not found"); - if (requestModel.AppointmentDate!=DateTime.MinValue) + if (requestModel.AppointmentDate != DateTime.MinValue) { appointment.AppointmentDate = requestModel.AppointmentDate; } From bd958d356b2313862fbb31c6a4375e00ac0e21d0 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Fri, 9 Aug 2024 12:59:41 +0000 Subject: [PATCH 20/28] Fix code style issues with dotnet_format --- REMS.Modules/Features/Review/BL_Review.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMS.Modules/Features/Review/BL_Review.cs b/REMS.Modules/Features/Review/BL_Review.cs index 3cfd042..84a814c 100644 --- a/REMS.Modules/Features/Review/BL_Review.cs +++ b/REMS.Modules/Features/Review/BL_Review.cs @@ -35,7 +35,7 @@ public async Task> GetReviewById(int reviewId) return response; } - public async Task> CreateReview(ReviewRequestModel requestModel) + public async Task> CreateReview(ReviewRequestModel requestModel) { var response = await _daReview.CreateReview(requestModel); return response; From 459f8061410c9d77fc12e34d869e906ba1f50df2 Mon Sep 17 00:00:00 2001 From: Hein Htet Date: Sat, 10 Aug 2024 00:43:29 +0630 Subject: [PATCH 21/28] Commit Model Changes --- .../Transaction/TransactionController.cs | 20 +------ REMS.Mapper/ChangeModel.cs | 16 +++--- REMS.Models/Transaction/TransactionModel.cs | 4 +- .../Transaction/TransactionRequestModel.cs | 4 +- .../Features/Transaction/BL_Transaction.cs | 9 ++-- .../Features/Transaction/DA_Transaction.cs | 52 ++----------------- 6 files changed, 17 insertions(+), 88 deletions(-) diff --git a/REMS.BackendApi/Features/Transaction/TransactionController.cs b/REMS.BackendApi/Features/Transaction/TransactionController.cs index f7d821d..bd70707 100644 --- a/REMS.BackendApi/Features/Transaction/TransactionController.cs +++ b/REMS.BackendApi/Features/Transaction/TransactionController.cs @@ -65,30 +65,12 @@ public async Task GetTransactionsByPropertyId(int pageNumber, int } } - [HttpPost("GetTransactionsByPropertyIdAndAgentId/{pageNumber}/{pageSize}/{propertyId}/{agentId}")] - public async Task GetTransactionsByPropertyIdAndAgentId(int pageNumber, int pageSize, int propertyId, int agentId) - { - try - { - var response = await _blTransaction.GetTransactionsByPropertyIdAndAgentIdAsync(pageNumber, pageSize, propertyId, agentId); - if (response.IsError) - { - return BadRequest(response); - } - return Ok(response); - } - catch (Exception ex) - { - return StatusCode(StatusCodes.Status500InternalServerError, ex.ToString()); - } - } - [HttpPost("GetTransactionsByPropertyIdAndBuyerId/{buyerId}/{propertyId}/{pageNumber}/{pageSize}")] public async Task GetTransactionsByPropertyIdAndBuyerId(int pageNumber, int pageSize, int propertyId, int buyerId) { try { - var response = await _blTransaction.GetTransactionsByPropertyIdAndBuyerIdAsync(pageNumber, pageSize, propertyId, buyerId); + var response = await _blTransaction.GetTransactionsByPropertyIdAndClientIdAsync(pageNumber, pageSize, propertyId, buyerId); if (response.IsError) { return BadRequest(response); diff --git a/REMS.Mapper/ChangeModel.cs b/REMS.Mapper/ChangeModel.cs index e6c50fc..1e77e6b 100644 --- a/REMS.Mapper/ChangeModel.cs +++ b/REMS.Mapper/ChangeModel.cs @@ -275,9 +275,9 @@ public static AppointmentModel Change(this Appointment appointment) // { // PropertyId = requestModel.PropertyId, - // BuyerId = requestModel.BuyerId, - // SellerId = requestModel.SellerId, - // AgentId = requestModel.AgentId, + // ClientId = requestModel.ClientId, + // //SellerId = requestModel.SellerId, + // //AgentId = requestModel.AgentId, // TransactionDate = requestModel.TransactionDate, // SalePrice = requestModel.SalePrice, // Commission = requestModel.Commission, @@ -292,9 +292,7 @@ public static AppointmentModel Change(this Appointment appointment) // { // PropertyId = requestModel.PropertyId, - // BuyerId = requestModel.BuyerId, - // SellerId = requestModel.SellerId, - // AgentId = requestModel.AgentId, + // ClientId = requestModel.ClientId, // TransactionDate = requestModel.TransactionDate, // SalePrice = requestModel.SalePrice, // Commission = requestModel.Commission, @@ -327,7 +325,7 @@ public static Transaction Change(this TransactionRequestModel model) { TransactionId = model.TransactionId, PropertyId = model.PropertyId, - ClientId = model.BuyerId, // Assuming BuyerId is ClientId + ClientId = model.ClientId, // Assuming BuyerId is ClientId TransactionDate = model.TransactionDate, SalePrice = model.SalePrice, Commission = model.Commission, @@ -341,9 +339,9 @@ public static TransactionModel Change(this Transaction transaction) { TransactionId = transaction.TransactionId, PropertyId = transaction.PropertyId, - BuyerId = transaction.ClientId, // Assuming ClientId is BuyerId + ClientId = transaction.ClientId, // Assuming ClientId is BuyerId //SellerId = transaction.Property?.OwnerId, // Assuming OwnerId exists in Property class - AgentId = transaction.Property?.AgentId, // Assuming AgentId exists in Property class + //AgentId = transaction.Property?.AgentId, // Assuming AgentId exists in Property class TransactionDate = transaction.TransactionDate, SalePrice = transaction.SalePrice, Commission = transaction.Commission, diff --git a/REMS.Models/Transaction/TransactionModel.cs b/REMS.Models/Transaction/TransactionModel.cs index 984eff5..08f899e 100644 --- a/REMS.Models/Transaction/TransactionModel.cs +++ b/REMS.Models/Transaction/TransactionModel.cs @@ -10,9 +10,7 @@ public class TransactionModel { public int TransactionId { get; set; } public int? PropertyId { get; set; } - public int? BuyerId { get; set; } - public int? SellerId { get; set; } - public int? AgentId { get; set; } + public int? ClientId { get; set; } public DateTime? TransactionDate { get; set; } public Decimal SalePrice { get; set; } public Decimal? Commission { get; set; } diff --git a/REMS.Models/Transaction/TransactionRequestModel.cs b/REMS.Models/Transaction/TransactionRequestModel.cs index 0af4040..77f5b97 100644 --- a/REMS.Models/Transaction/TransactionRequestModel.cs +++ b/REMS.Models/Transaction/TransactionRequestModel.cs @@ -10,9 +10,7 @@ public class TransactionRequestModel { public int TransactionId { get; set; } public int PropertyId { get; set; } - public int BuyerId { get; set; } - public int SellerId { get; set; } - public int AgentId { get; set; } + public int ClientId { get; set; } public DateTime TransactionDate { get; set; } public Decimal SalePrice { get; set; } public Decimal? Commission { get; set; } diff --git a/REMS.Modules/Features/Transaction/BL_Transaction.cs b/REMS.Modules/Features/Transaction/BL_Transaction.cs index 93d27aa..7f4d5c8 100644 --- a/REMS.Modules/Features/Transaction/BL_Transaction.cs +++ b/REMS.Modules/Features/Transaction/BL_Transaction.cs @@ -25,13 +25,10 @@ public async Task> GetTransactionsByPropert { return await _daTransaction.GetTransactionsByPropertyIdAsync(pageNumber, pageSize, propertyId); } - public async Task> GetTransactionsByPropertyIdAndAgentIdAsync(int pageNumber, int pageSize, int propertyId, int agentId) + + public async Task> GetTransactionsByPropertyIdAndClientIdAsync(int pageNumber, int pageSize, int propertyId, int buyerId) { - return await _daTransaction.GetTransactionsByPropertyIdAndAgentIdAsync(pageNumber, pageSize, propertyId, agentId); - } - public async Task> GetTransactionsByPropertyIdAndBuyerIdAsync(int pageNumber, int pageSize, int propertyId, int buyerId) - { - return await _daTransaction.GetTransactionsByPropertyIdAndBuyerIdAsync(pageNumber, pageSize, propertyId, buyerId); + return await _daTransaction.GetTransactionsByPropertyIdAndClientIdAsync(pageNumber, pageSize, propertyId, buyerId); } public async Task> GetTransactionsByPropertyIdAndSellerIdAsync(int pageNumber, int pageSize, int propertyId, int sellerId) { diff --git a/REMS.Modules/Features/Transaction/DA_Transaction.cs b/REMS.Modules/Features/Transaction/DA_Transaction.cs index b9b6526..809e0c8 100644 --- a/REMS.Modules/Features/Transaction/DA_Transaction.cs +++ b/REMS.Modules/Features/Transaction/DA_Transaction.cs @@ -29,34 +29,15 @@ public async Task> CreateTransactionAsync(TransactionRequestModel } var buyerClient = await _db.Clients - .Where(x => x.ClientId == transactionRequestModel.BuyerId) + .Where(x => x.ClientId == transactionRequestModel.ClientId) .FirstOrDefaultAsync(); if (buyerClient is null) { - model = Result.Error("Buyer Not Found!"); + model = Result.Error("Client Not Found!"); goto result; } - var sellerClient = await _db.Clients - .Where(x => x.ClientId == transactionRequestModel.SellerId) - .FirstOrDefaultAsync(); - - if (sellerClient is null) - { - model = Result.Error("Seller Not Found!"); - goto result; - } - - var Agent = await _db.Agents - .Where(x => x.AgentId == transactionRequestModel.AgentId) - .FirstOrDefaultAsync(); - - if (Agent is null) - { - model = Result.Error("Agent Not Found!"); - goto result; - } await _db.Transactions.AddAsync(transactionRequestModel.Change()); int result = await _db.SaveChangesAsync(); model = result > 0 ? Result.Success("Transaction creation success.") : Result.Error("Transaction creation fail."); @@ -120,38 +101,13 @@ public async Task> GetTransactionsByPropert } } - public async Task> GetTransactionsByPropertyIdAndAgentIdAsync(int pageNumber, int pageSize, int propertyId, int agentId) + public async Task> GetTransactionsByPropertyIdAndClientIdAsync(int pageNumber, int pageSize, int propertyId, int clientId) { Result model = null; try { TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); - var transactionList = _db.Transactions.AsNoTracking().Where(x => x.PropertyId == propertyId); - var transaction = await transactionList.Pagination(pageNumber, pageSize).Select(x => x.Change()).ToListAsync(); - - int rowCount = _db.Transactions.Count(); - int pageCount = rowCount / pageSize; - if (pageCount % pageSize > 0) - pageCount++; - - transactionListResponse.pageSetting = new PageSettingModel(pageNumber, pageSize, pageCount, rowCount); - transactionListResponse.lstTransaction = transaction; - model = Result.Success(transactionListResponse); - return model; - } - catch (Exception ex) - { - return model = Result.Error(ex); - } - } - - public async Task> GetTransactionsByPropertyIdAndBuyerIdAsync(int pageNumber, int pageSize, int propertyId, int buyerId) - { - Result model = null; - try - { - TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); - var transactionList = _db.Transactions.AsNoTracking().Where(x => x.PropertyId == propertyId); + var transactionList = _db.Transactions.AsNoTracking().Where(x => x.PropertyId == propertyId && x.ClientId == clientId); var transaction = await transactionList.Pagination(pageNumber, pageSize).Select(x => x.Change()).ToListAsync(); int rowCount = _db.Transactions.Count(); From 8a9aedf5086007ae69cb07486c6a5151d2f5e032 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Fri, 9 Aug 2024 18:14:22 +0000 Subject: [PATCH 22/28] Fix code style issues with dotnet_format --- REMS.Modules/Features/Transaction/BL_Transaction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REMS.Modules/Features/Transaction/BL_Transaction.cs b/REMS.Modules/Features/Transaction/BL_Transaction.cs index 7f4d5c8..a28fc33 100644 --- a/REMS.Modules/Features/Transaction/BL_Transaction.cs +++ b/REMS.Modules/Features/Transaction/BL_Transaction.cs @@ -25,7 +25,7 @@ public async Task> GetTransactionsByPropert { return await _daTransaction.GetTransactionsByPropertyIdAsync(pageNumber, pageSize, propertyId); } - + public async Task> GetTransactionsByPropertyIdAndClientIdAsync(int pageNumber, int pageSize, int propertyId, int buyerId) { return await _daTransaction.GetTransactionsByPropertyIdAndClientIdAsync(pageNumber, pageSize, propertyId, buyerId); From 54bd72a75ac013958b8ff51f21ea1ac66ebda28e Mon Sep 17 00:00:00 2001 From: Hein Htet Date: Sat, 10 Aug 2024 01:22:11 +0630 Subject: [PATCH 23/28] Fixed transaction issue for table design changes --- .../Transaction/TransactionController.cs | 24 ++--------- REMS.Models/PropertyStatus.cs | 16 +++++++- .../Features/Transaction/BL_Transaction.cs | 4 -- .../Features/Transaction/DA_Transaction.cs | 41 ++++++++----------- 4 files changed, 35 insertions(+), 50 deletions(-) diff --git a/REMS.BackendApi/Features/Transaction/TransactionController.cs b/REMS.BackendApi/Features/Transaction/TransactionController.cs index bd70707..6de498b 100644 --- a/REMS.BackendApi/Features/Transaction/TransactionController.cs +++ b/REMS.BackendApi/Features/Transaction/TransactionController.cs @@ -65,30 +65,12 @@ public async Task GetTransactionsByPropertyId(int pageNumber, int } } - [HttpPost("GetTransactionsByPropertyIdAndBuyerId/{buyerId}/{propertyId}/{pageNumber}/{pageSize}")] - public async Task GetTransactionsByPropertyIdAndBuyerId(int pageNumber, int pageSize, int propertyId, int buyerId) + [HttpPost("GetTransactionsByPropertyIdAndClientId/{clientId}/{propertyId}/{pageNumber}/{pageSize}")] + public async Task GetTransactionsByPropertyIdAndClientId(int pageNumber, int pageSize, int propertyId, int clientId) { try { - var response = await _blTransaction.GetTransactionsByPropertyIdAndClientIdAsync(pageNumber, pageSize, propertyId, buyerId); - if (response.IsError) - { - return BadRequest(response); - } - return Ok(response); - } - catch (Exception ex) - { - return StatusCode(StatusCodes.Status500InternalServerError, ex.ToString()); - } - } - - [HttpGet("GetTransactionsByPropertyIdAndSellerId/{pageNumber}/{pageSize}/{propertyId}/{sellerId}")] - public async Task GetTransactionsByPropertyIdAndSellerId(int pageNumber, int pageSize, int propertyId, int sellerId) - { - try - { - var response = await _blTransaction.GetTransactionsByPropertyIdAndSellerIdAsync(pageNumber, pageSize, propertyId, sellerId); + var response = await _blTransaction.GetTransactionsByPropertyIdAndClientIdAsync(pageNumber, pageSize, propertyId, clientId); if (response.IsError) { return BadRequest(response); diff --git a/REMS.Models/PropertyStatus.cs b/REMS.Models/PropertyStatus.cs index 033fae6..0597933 100644 --- a/REMS.Models/PropertyStatus.cs +++ b/REMS.Models/PropertyStatus.cs @@ -7,4 +7,18 @@ public enum PropertyStatus Sold, Rented, Canceled -} \ No newline at end of file +} + +public enum PropertyAvailiableType +{ + Sell, + Rent, +} + +public enum PropertyType +{ + Condominium, + Apartment, + Townhouses +} + diff --git a/REMS.Modules/Features/Transaction/BL_Transaction.cs b/REMS.Modules/Features/Transaction/BL_Transaction.cs index 7f4d5c8..52a499e 100644 --- a/REMS.Modules/Features/Transaction/BL_Transaction.cs +++ b/REMS.Modules/Features/Transaction/BL_Transaction.cs @@ -30,9 +30,5 @@ public async Task> GetTransactionsByPropert { return await _daTransaction.GetTransactionsByPropertyIdAndClientIdAsync(pageNumber, pageSize, propertyId, buyerId); } - public async Task> GetTransactionsByPropertyIdAndSellerIdAsync(int pageNumber, int pageSize, int propertyId, int sellerId) - { - return await _daTransaction.GetTransactionsByPropertyIdAndSellerIdAsync(pageNumber, pageSize, propertyId, sellerId); - } } } diff --git a/REMS.Modules/Features/Transaction/DA_Transaction.cs b/REMS.Modules/Features/Transaction/DA_Transaction.cs index 809e0c8..03631e5 100644 --- a/REMS.Modules/Features/Transaction/DA_Transaction.cs +++ b/REMS.Modules/Features/Transaction/DA_Transaction.cs @@ -40,6 +40,8 @@ public async Task> CreateTransactionAsync(TransactionRequestModel await _db.Transactions.AddAsync(transactionRequestModel.Change()); int result = await _db.SaveChangesAsync(); + if(property.AvailiablityType.Equals()) + property.Status = model = result > 0 ? Result.Success("Transaction creation success.") : Result.Error("Transaction creation fail."); } catch (Exception ex) @@ -83,6 +85,12 @@ public async Task> GetTransactionsByPropert { TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); var transactionList = _db.Transactions.AsNoTracking().Where(x => x.PropertyId == PropertyId); + if (transactionList is null) + { + model = Result.Error("Property Not Found!"); + goto result; + } + var transaction = await transactionList.Pagination(pageNumber, pageSize).Select(x => x.Change()).ToListAsync(); int rowCount = _db.Transactions.Count(); @@ -99,6 +107,8 @@ public async Task> GetTransactionsByPropert { return model = Result.Error(ex); } + result: + return model; } public async Task> GetTransactionsByPropertyIdAndClientIdAsync(int pageNumber, int pageSize, int propertyId, int clientId) @@ -108,31 +118,12 @@ public async Task> GetTransactionsByPropert { TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); var transactionList = _db.Transactions.AsNoTracking().Where(x => x.PropertyId == propertyId && x.ClientId == clientId); - var transaction = await transactionList.Pagination(pageNumber, pageSize).Select(x => x.Change()).ToListAsync(); - - int rowCount = _db.Transactions.Count(); - int pageCount = rowCount / pageSize; - if (pageCount % pageSize > 0) - pageCount++; - - transactionListResponse.pageSetting = new PageSettingModel(pageNumber, pageSize, pageCount, rowCount); - transactionListResponse.lstTransaction = transaction; - model = Result.Success(transactionListResponse); - return model; - } - catch (Exception ex) - { - return model = Result.Error(ex); - } - } + if (transactionList is null) + { + model = Result.Error("Property Not Found!"); + goto result; + } - public async Task> GetTransactionsByPropertyIdAndSellerIdAsync(int pageNumber, int pageSize, int propertyId, int sellerId) - { - Result model = null; - try - { - TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); - var transactionList = _db.Transactions.AsNoTracking().Where(x => x.PropertyId == propertyId); var transaction = await transactionList.Pagination(pageNumber, pageSize).Select(x => x.Change()).ToListAsync(); int rowCount = _db.Transactions.Count(); @@ -149,6 +140,8 @@ public async Task> GetTransactionsByPropert { return model = Result.Error(ex); } + result: + return model; } } } From e45142c2ec99b8e40817e26e77c08198939bcf5d Mon Sep 17 00:00:00 2001 From: Lint Action Date: Fri, 9 Aug 2024 18:52:58 +0000 Subject: [PATCH 24/28] Fix code style issues with dotnet_format --- REMS.Modules/Features/Transaction/DA_Transaction.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/REMS.Modules/Features/Transaction/DA_Transaction.cs b/REMS.Modules/Features/Transaction/DA_Transaction.cs index 03631e5..d080f37 100644 --- a/REMS.Modules/Features/Transaction/DA_Transaction.cs +++ b/REMS.Modules/Features/Transaction/DA_Transaction.cs @@ -40,9 +40,9 @@ public async Task> CreateTransactionAsync(TransactionRequestModel await _db.Transactions.AddAsync(transactionRequestModel.Change()); int result = await _db.SaveChangesAsync(); - if(property.AvailiablityType.Equals()) - property.Status = - model = result > 0 ? Result.Success("Transaction creation success.") : Result.Error("Transaction creation fail."); + if (property.AvailiablityType.Equals()) + property.Status = + model = result > 0 ? Result.Success("Transaction creation success.") : Result.Error("Transaction creation fail."); } catch (Exception ex) { From a2eb3281d18bd71ede6fcecd551226838e432b7f Mon Sep 17 00:00:00 2001 From: Hein Htet Date: Sat, 10 Aug 2024 01:39:24 +0630 Subject: [PATCH 25/28] update table script for REMS --- REMS.sql | 113 +++++++++++++++++++++++++------------------------------ 1 file changed, 51 insertions(+), 62 deletions(-) diff --git a/REMS.sql b/REMS.sql index 3bb81bd..bd4fbd9 100644 --- a/REMS.sql +++ b/REMS.sql @@ -1,6 +1,5 @@ USE [REMS] GO -/****** Object: Table [dbo].[Agents] Script Date: 7/8/2024 8:51:44 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON @@ -10,23 +9,20 @@ CREATE TABLE [dbo].[Agents]( [user_id] [int] NULL, [agency_name] [nvarchar](100) NOT NULL, [license_number] [nvarchar](50) NOT NULL, - [phone] [nvarchar](15) NULL, - [email] [nvarchar](100) NULL, [address] [nvarchar](200) NULL, PRIMARY KEY CLUSTERED ( [agent_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO -/****** Object: Table [dbo].[Appointments] Script Date: 7/8/2024 8:51:44 PM ******/ +/****** Object: Table [dbo].[Appointments] Script Date: 8/10/2024 1:31:22 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Appointments]( [appointment_id] [int] IDENTITY(1,1) NOT NULL, - [agent_id] [int] NULL, [client_id] [int] NULL, [property_id] [int] NULL, [appointment_date] [date] NOT NULL, @@ -36,10 +32,10 @@ CREATE TABLE [dbo].[Appointments]( PRIMARY KEY CLUSTERED ( [appointment_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO -/****** Object: Table [dbo].[Clients] Script Date: 7/8/2024 8:51:44 PM ******/ +/****** Object: Table [dbo].[Clients] Script Date: 8/10/2024 1:31:22 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON @@ -47,44 +43,42 @@ GO CREATE TABLE [dbo].[Clients]( [client_id] [int] IDENTITY(1,1) NOT NULL, [user_id] [int] NULL, - [agent_id] [int] NULL, [first_name] [nvarchar](100) NOT NULL, [last_name] [nvarchar](100) NOT NULL, - [phone] [nvarchar](15) NULL, - [email] [nvarchar](100) NULL, [address] [nvarchar](200) NULL, PRIMARY KEY CLUSTERED ( [client_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO -/****** Object: Table [dbo].[Listings] Script Date: 7/8/2024 8:51:44 PM ******/ +/****** Object: Table [dbo].[Messages] Script Date: 8/10/2024 1:31:22 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -CREATE TABLE [dbo].[Listings]( - [listing_id] [int] IDENTITY(1,1) NOT NULL, +CREATE TABLE [dbo].[Messages]( + [message_id] [int] IDENTITY(1,1) NOT NULL, + [sender_id] [int] NULL, + [receiver_id] [int] NULL, [property_id] [int] NULL, - [agent_id] [int] NULL, - [date_listed] [datetime] NULL, - [listing_price] [decimal](18, 2) NOT NULL, - [status] [nvarchar](50) NOT NULL, - [description] [nvarchar](max) NULL, + [message_content] [nvarchar](max) NOT NULL, + [date_sent] [datetime] NULL, + [status] [nvarchar](50) NULL, PRIMARY KEY CLUSTERED ( - [listing_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + [message_id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO -/****** Object: Table [dbo].[Properties] Script Date: 7/8/2024 8:51:44 PM ******/ +/****** Object: Table [dbo].[Properties] Script Date: 8/10/2024 1:31:22 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Properties]( [property_id] [int] IDENTITY(1,1) NOT NULL, + [agent_id] [int] NULL, [address] [nvarchar](200) NOT NULL, [city] [nvarchar](100) NOT NULL, [state] [nvarchar](50) NOT NULL, @@ -97,14 +91,18 @@ CREATE TABLE [dbo].[Properties]( [year_built] [int] NULL, [description] [nvarchar](max) NULL, [status] [nvarchar](50) NOT NULL, - [date_listed] [datetime] NULL, + [availiablity_type] [nvarchar](50) NOT NULL, + [minrental_period] [int] NULL, + [approvedby] [nvarchar](50) NULL, + [adddate] [datetime] NULL, + [editdate] [datetime] NULL, PRIMARY KEY CLUSTERED ( [property_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO -/****** Object: Table [dbo].[PropertyImages] Script Date: 7/8/2024 8:51:44 PM ******/ +/****** Object: Table [dbo].[PropertyImages] Script Date: 8/10/2024 1:31:22 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON @@ -118,10 +116,10 @@ CREATE TABLE [dbo].[PropertyImages]( PRIMARY KEY CLUSTERED ( [image_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO -/****** Object: Table [dbo].[Reviews] Script Date: 7/8/2024 8:51:44 PM ******/ +/****** Object: Table [dbo].[Reviews] Script Date: 8/10/2024 1:31:22 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON @@ -136,10 +134,10 @@ CREATE TABLE [dbo].[Reviews]( PRIMARY KEY CLUSTERED ( [review_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO -/****** Object: Table [dbo].[Transactions] Script Date: 7/8/2024 8:51:44 PM ******/ +/****** Object: Table [dbo].[Transactions] Script Date: 8/10/2024 1:31:22 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON @@ -147,20 +145,19 @@ GO CREATE TABLE [dbo].[Transactions]( [transaction_id] [int] IDENTITY(1,1) NOT NULL, [property_id] [int] NULL, - [buyer_id] [int] NULL, - [seller_id] [int] NULL, - [agent_id] [int] NULL, + [client_id] [int] NULL, [transaction_date] [datetime] NULL, + [rental_period] [int] NULL, [sale_price] [decimal](18, 2) NOT NULL, [commission] [decimal](18, 2) NULL, [status] [nvarchar](50) NOT NULL, PRIMARY KEY CLUSTERED ( [transaction_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO -/****** Object: Table [dbo].[Users] Script Date: 7/8/2024 8:51:44 PM ******/ +/****** Object: Table [dbo].[Users] Script Date: 8/10/2024 1:31:22 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON @@ -176,20 +173,18 @@ CREATE TABLE [dbo].[Users]( PRIMARY KEY CLUSTERED ( [user_id] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] -) ON [PRIMARY] -GO -SET ANSI_PADDING ON -GO -/****** Object: Index [UQ__Users__AB6E6164A21008DA] Script Date: 7/8/2024 8:51:44 PM ******/ -ALTER TABLE [dbo].[Users] ADD UNIQUE NONCLUSTERED +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY], +UNIQUE NONCLUSTERED ( [email] ASC -)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] +) ON [PRIMARY] GO -ALTER TABLE [dbo].[Listings] ADD DEFAULT (getdate()) FOR [date_listed] +ALTER TABLE [dbo].[Messages] ADD DEFAULT (getdate()) FOR [date_sent] GO -ALTER TABLE [dbo].[Properties] ADD DEFAULT (getdate()) FOR [date_listed] +ALTER TABLE [dbo].[Properties] ADD DEFAULT (getdate()) FOR [adddate] +GO +ALTER TABLE [dbo].[Properties] ADD DEFAULT (getdate()) FOR [editdate] GO ALTER TABLE [dbo].[PropertyImages] ADD DEFAULT (getdate()) FOR [date_uploaded] GO @@ -202,27 +197,27 @@ GO ALTER TABLE [dbo].[Agents] WITH CHECK ADD FOREIGN KEY([user_id]) REFERENCES [dbo].[Users] ([user_id]) GO -ALTER TABLE [dbo].[Appointments] WITH CHECK ADD FOREIGN KEY([agent_id]) -REFERENCES [dbo].[Agents] ([agent_id]) -GO ALTER TABLE [dbo].[Appointments] WITH CHECK ADD FOREIGN KEY([client_id]) REFERENCES [dbo].[Clients] ([client_id]) GO ALTER TABLE [dbo].[Appointments] WITH CHECK ADD FOREIGN KEY([property_id]) REFERENCES [dbo].[Properties] ([property_id]) GO -ALTER TABLE [dbo].[Clients] WITH CHECK ADD FOREIGN KEY([agent_id]) -REFERENCES [dbo].[Agents] ([agent_id]) -GO ALTER TABLE [dbo].[Clients] WITH CHECK ADD FOREIGN KEY([user_id]) REFERENCES [dbo].[Users] ([user_id]) GO -ALTER TABLE [dbo].[Listings] WITH CHECK ADD FOREIGN KEY([agent_id]) -REFERENCES [dbo].[Agents] ([agent_id]) -GO -ALTER TABLE [dbo].[Listings] WITH CHECK ADD FOREIGN KEY([property_id]) +ALTER TABLE [dbo].[Messages] WITH CHECK ADD FOREIGN KEY([property_id]) REFERENCES [dbo].[Properties] ([property_id]) GO +ALTER TABLE [dbo].[Messages] WITH CHECK ADD FOREIGN KEY([receiver_id]) +REFERENCES [dbo].[Users] ([user_id]) +GO +ALTER TABLE [dbo].[Messages] WITH CHECK ADD FOREIGN KEY([sender_id]) +REFERENCES [dbo].[Users] ([user_id]) +GO +ALTER TABLE [dbo].[Properties] WITH CHECK ADD FOREIGN KEY([agent_id]) +REFERENCES [dbo].[Agents] ([agent_id]) +GO ALTER TABLE [dbo].[PropertyImages] WITH CHECK ADD FOREIGN KEY([property_id]) REFERENCES [dbo].[Properties] ([property_id]) GO @@ -232,17 +227,11 @@ GO ALTER TABLE [dbo].[Reviews] WITH CHECK ADD FOREIGN KEY([user_id]) REFERENCES [dbo].[Users] ([user_id]) GO -ALTER TABLE [dbo].[Transactions] WITH CHECK ADD FOREIGN KEY([agent_id]) -REFERENCES [dbo].[Agents] ([agent_id]) -GO -ALTER TABLE [dbo].[Transactions] WITH CHECK ADD FOREIGN KEY([buyer_id]) +ALTER TABLE [dbo].[Transactions] WITH CHECK ADD FOREIGN KEY([client_id]) REFERENCES [dbo].[Clients] ([client_id]) GO ALTER TABLE [dbo].[Transactions] WITH CHECK ADD FOREIGN KEY([property_id]) REFERENCES [dbo].[Properties] ([property_id]) GO -ALTER TABLE [dbo].[Transactions] WITH CHECK ADD FOREIGN KEY([seller_id]) -REFERENCES [dbo].[Clients] ([client_id]) -GO ALTER TABLE [dbo].[Reviews] WITH CHECK ADD CHECK (([rating]>=(1) AND [rating]<=(5))) GO From 83168fe1d49c914556c77d804913020a48d9f4db Mon Sep 17 00:00:00 2001 From: Thein Htay Date: Sat, 10 Aug 2024 19:32:43 +0630 Subject: [PATCH 26/28] fix : Update clients response format --- REMS.Mapper/ChangeModel.cs | 7 ++--- REMS.Models/Client/ClientRequestModel.cs | 2 +- REMS.Models/Client/ClientResponseModel.cs | 17 +++++++++++- REMS.Modules/Features/Client/DA_Client.cs | 33 +++++------------------ 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/REMS.Mapper/ChangeModel.cs b/REMS.Mapper/ChangeModel.cs index a02ab8e..a70e58d 100644 --- a/REMS.Mapper/ChangeModel.cs +++ b/REMS.Mapper/ChangeModel.cs @@ -79,9 +79,9 @@ public static Client Change(this ClientRequestModel requestModel) return client; } - public static ClientModel Change(this Client dataModel, User user) + public static ClientResponseModel Change(this Client dataModel, User user) { - var clientResponseModel = new ClientModel + var clientResponseModel = new ClientResponseModel { ClientId = dataModel.ClientId, UserId = dataModel.UserId, @@ -89,7 +89,8 @@ public static ClientModel Change(this Client dataModel, User user) LastName = dataModel.LastName, Address = dataModel.Address, Email = user?.Email, - Phone = user?.Phone + Phone = user?.Phone, + Role = user?.Role }; return clientResponseModel; } diff --git a/REMS.Models/Client/ClientRequestModel.cs b/REMS.Models/Client/ClientRequestModel.cs index 5d0fd69..51c63ea 100644 --- a/REMS.Models/Client/ClientRequestModel.cs +++ b/REMS.Models/Client/ClientRequestModel.cs @@ -4,7 +4,7 @@ namespace REMS.Models.Client; public class ClientRequestModel { - [JsonIgnore] // Completely hides from API schema + [JsonIgnore] //hides from API schema public int? UserId { get; set; } public string? FirstName { get; set; } = null!; diff --git a/REMS.Models/Client/ClientResponseModel.cs b/REMS.Models/Client/ClientResponseModel.cs index ac7dbec..5eb755c 100644 --- a/REMS.Models/Client/ClientResponseModel.cs +++ b/REMS.Models/Client/ClientResponseModel.cs @@ -8,5 +8,20 @@ namespace REMS.Models.Client; public class ClientResponseModel { - public ClientModel Client { get; set; } + //public ClientModel Client { get; set; } + public int ClientId { get; set; } + + public int? UserId { get; set; } + + public string FirstName { get; set; } = null!; + + public string LastName { get; set; } = null!; + + public string? Phone { get; set; } + + public string? Email { get; set; } + + public string? Address { get; set; } + + public string? Role { get; set; } } diff --git a/REMS.Modules/Features/Client/DA_Client.cs b/REMS.Modules/Features/Client/DA_Client.cs index acc089b..83319ba 100644 --- a/REMS.Modules/Features/Client/DA_Client.cs +++ b/REMS.Modules/Features/Client/DA_Client.cs @@ -1,4 +1,5 @@ using Microsoft.EntityFrameworkCore; +using REMS.Database.AppDbContextModels; using REMS.Models; using System.Data; @@ -19,21 +20,13 @@ public async Task> GetClients() var responseModel = new ClientListResponseModel(); try { - //var clients = await _db - // .Clients - // .AsNoTracking() - // .ToListAsync(); - var clients = await _db .Clients .Include(c => c.User) .AsNoTracking() .ToListAsync(); - var clientResponseModel = clients.Select(client => new ClientResponseModel - { - Client = client.Change(client.User) - }).ToList(); + var clientResponseModel = clients.Select(client => client.Change(client.User)).ToList(); var clientListResponse = new ClientListResponseModel { @@ -67,10 +60,7 @@ public async Task> GetClients(int pageNo = 1, in .Take(pageSize) .ToListAsync(); - var clientResponseModel = clients.Select(client => new ClientResponseModel - { - Client = client.Change(client.User!) - }).ToList(); + var clientResponseModel = clients.Select(client => client.Change(client.User)).ToList(); var clientListResponse = new ClientListResponseModel { @@ -102,13 +92,10 @@ public async Task> GetClientById(int id) if (client is null) { - throw new Exception("Client Not Found"); + return model = Result.Error("Client not found."); } - var responseModel = new ClientResponseModel - { - Client = client.Change(client.User) - }; + var responseModel = client.Change(client.User); model = Result.Success(responseModel); } @@ -155,10 +142,7 @@ public async Task> CreateClient(ClientRequestModel r await _db.Clients.AddAsync(client); int addClient = await _db.SaveChangesAsync(); - var responseModel = new ClientResponseModel - { - Client = client.Change(user), - }; + var responseModel = client.Change(user); model = addClient > 0 ? Result.Success(responseModel) @@ -231,10 +215,7 @@ public async Task> UpdateClient(int id, ClientReques _db.Entry(client).State = EntityState.Modified; int result = await _db.SaveChangesAsync(); - var clientResponseModel = new ClientResponseModel - { - Client = client.Change(user) - }; + var clientResponseModel = client.Change(user); model = Result.Success(clientResponseModel); } From 0c427fe329b8c7b6b000be16b406881660d8d7ed Mon Sep 17 00:00:00 2001 From: Hein Htet Date: Sat, 10 Aug 2024 22:07:34 +0630 Subject: [PATCH 27/28] Added Client Data and Properties Data --- .../Transaction/TransactionController.cs | 18 +++ .../TransactionListResponseModel.cs | 2 +- .../Transaction/TransactionResponseModel.cs | 17 +++ .../Features/Transaction/BL_Transaction.cs | 5 + .../Features/Transaction/DA_Transaction.cs | 122 +++++++++++++++--- 5 files changed, 148 insertions(+), 16 deletions(-) create mode 100644 REMS.Models/Transaction/TransactionResponseModel.cs diff --git a/REMS.BackendApi/Features/Transaction/TransactionController.cs b/REMS.BackendApi/Features/Transaction/TransactionController.cs index 6de498b..62c21ae 100644 --- a/REMS.BackendApi/Features/Transaction/TransactionController.cs +++ b/REMS.BackendApi/Features/Transaction/TransactionController.cs @@ -82,5 +82,23 @@ public async Task GetTransactionsByPropertyIdAndClientId(int page return StatusCode(StatusCodes.Status500InternalServerError, ex.ToString()); } } + + [HttpPost("GetTransactionsByClientId/{clientId}/{pageNumber}/{pageSize}")] + public async Task GetTransactionsByClientId(int pageNumber, int pageSize, int clientId) + { + try + { + var response = await _blTransaction.GetTransactionsByClientIdAsync(pageNumber, pageSize, clientId); + if (response.IsError) + { + return BadRequest(response); + } + return Ok(response); + } + catch (Exception ex) + { + return StatusCode(StatusCodes.Status500InternalServerError, ex.ToString()); + } + } } diff --git a/REMS.Models/Transaction/TransactionListResponseModel.cs b/REMS.Models/Transaction/TransactionListResponseModel.cs index 0453a94..e19d57e 100644 --- a/REMS.Models/Transaction/TransactionListResponseModel.cs +++ b/REMS.Models/Transaction/TransactionListResponseModel.cs @@ -12,6 +12,6 @@ public class TransactionListResponseModel { public PageSettingModel? pageSetting { get; set; } - public List? lstTransaction { get; set; } + public List? lstTransaction { get; set; } } } diff --git a/REMS.Models/Transaction/TransactionResponseModel.cs b/REMS.Models/Transaction/TransactionResponseModel.cs new file mode 100644 index 0000000..5e8f2f5 --- /dev/null +++ b/REMS.Models/Transaction/TransactionResponseModel.cs @@ -0,0 +1,17 @@ +using REMS.Models.Client; +using REMS.Models.Property; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace REMS.Models.Transaction +{ + public class TransactionResponseModel + { + public TransactionModel Transaction { get; set; } + public ClientModel Client { get; set; } + public PropertyModel Property { get; set; } + } +} diff --git a/REMS.Modules/Features/Transaction/BL_Transaction.cs b/REMS.Modules/Features/Transaction/BL_Transaction.cs index 349c646..7695f90 100644 --- a/REMS.Modules/Features/Transaction/BL_Transaction.cs +++ b/REMS.Modules/Features/Transaction/BL_Transaction.cs @@ -30,5 +30,10 @@ public async Task> GetTransactionsByPropert { return await _daTransaction.GetTransactionsByPropertyIdAndClientIdAsync(pageNumber, pageSize, propertyId, buyerId); } + + public async Task> GetTransactionsByClientIdAsync(int pageNumber, int pageSize, int clientId) + { + return await _daTransaction.GetTransactionsByClientIdAsync(pageNumber, pageSize, clientId); + } } } diff --git a/REMS.Modules/Features/Transaction/DA_Transaction.cs b/REMS.Modules/Features/Transaction/DA_Transaction.cs index d080f37..2db87ad 100644 --- a/REMS.Modules/Features/Transaction/DA_Transaction.cs +++ b/REMS.Modules/Features/Transaction/DA_Transaction.cs @@ -1,4 +1,5 @@ -using REMS.Models.Appointment; +using REMS.Mapper; +using REMS.Models.Appointment; using System; using System.Collections.Generic; using System.Linq; @@ -40,9 +41,21 @@ public async Task> CreateTransactionAsync(TransactionRequestModel await _db.Transactions.AddAsync(transactionRequestModel.Change()); int result = await _db.SaveChangesAsync(); - if (property.AvailiablityType.Equals()) - property.Status = - model = result > 0 ? Result.Success("Transaction creation success.") : Result.Error("Transaction creation fail."); + if (result > 0) + { + if (property.AvailiablityType.Equals(PropertyAvailiableType.Sell)) + { + property.Status = PropertyStatus.Sold.ToString(); + } + else + { + property.Status = PropertyStatus.Rented.ToString(); + } + _db.Properties.Update(property); + int propertyResult = await _db.SaveChangesAsync(); + } + + model = result > 0 ? Result.Success("Transaction creation success.") : Result.Error("Transaction creation fail."); } catch (Exception ex) { @@ -59,8 +72,12 @@ public async Task> GetTransactionsAsync(int try { TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); - var transactionList = _db.Transactions.AsNoTracking(); - var transaction = await transactionList.Pagination(pageNumber, pageSize).Select(x => x.Change()).ToListAsync(); + var transactionList =await _db.Transactions.AsNoTracking() + .Include(x => x.Client) + .Include(x => x.Property) + .Skip((pageNumber - 1) * pageSize) + .Take(pageSize) + .ToListAsync(); int rowCount = _db.Transactions.Count(); int pageCount = rowCount / pageSize; @@ -68,7 +85,15 @@ public async Task> GetTransactionsAsync(int pageCount++; transactionListResponse.pageSetting = new PageSettingModel(pageNumber, pageSize, pageCount, rowCount); - transactionListResponse.lstTransaction = transaction; + + var propertyResponseModel = transactionList.Select(Transactions => new TransactionResponseModel + { + Transaction = Transactions.Change(), + Client = Transactions.Client.Change(_db.Users.Where(x => x.UserId == Transactions.Client.UserId).FirstOrDefault()), + Property = Transactions.Property.Change() + + }).ToList(); + transactionListResponse.lstTransaction = propertyResponseModel; model = Result.Success(transactionListResponse); return model; } @@ -84,22 +109,34 @@ public async Task> GetTransactionsByPropert try { TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); - var transactionList = _db.Transactions.AsNoTracking().Where(x => x.PropertyId == PropertyId); + var transactionList = await _db.Transactions.AsNoTracking() + .Include(x => x.Client) + .Include(x => x.Property) + .Where(x => x.PropertyId == PropertyId) + .Skip((pageNumber - 1) * pageSize) + .Take(pageSize) + .ToListAsync(); if (transactionList is null) { - model = Result.Error("Property Not Found!"); + model = Result.Error("This property doesn't have in the transaction!"); goto result; } - var transaction = await transactionList.Pagination(pageNumber, pageSize).Select(x => x.Change()).ToListAsync(); - int rowCount = _db.Transactions.Count(); int pageCount = rowCount / pageSize; if (pageCount % pageSize > 0) pageCount++; transactionListResponse.pageSetting = new PageSettingModel(pageNumber, pageSize, pageCount, rowCount); - transactionListResponse.lstTransaction = transaction; + + var transactionresponseModel = transactionList.Select(Transactions => new TransactionResponseModel + { + Transaction = Transactions.Change(), + Client = Transactions.Client.Change(_db.Users.Where(x => x.UserId == Transactions.Client.UserId).FirstOrDefault()), + Property = Transactions.Property.Change() + + }).ToList(); + transactionListResponse.lstTransaction = transactionresponseModel; model = Result.Success(transactionListResponse); return model; } @@ -117,14 +154,62 @@ public async Task> GetTransactionsByPropert try { TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); - var transactionList = _db.Transactions.AsNoTracking().Where(x => x.PropertyId == propertyId && x.ClientId == clientId); + var transactionList = await _db.Transactions.AsNoTracking() + .Include(x => x.Client) + .Include(x => x.Property) + .Where(x => x.PropertyId == propertyId && x.ClientId == clientId) + .Skip((pageNumber - 1) * pageSize) + .Take(pageSize) + .ToListAsync(); if (transactionList is null) { model = Result.Error("Property Not Found!"); goto result; } - var transaction = await transactionList.Pagination(pageNumber, pageSize).Select(x => x.Change()).ToListAsync(); + int rowCount = _db.Transactions.Count(); + int pageCount = rowCount / pageSize; + if (pageCount % pageSize > 0) + pageCount++; + + transactionListResponse.pageSetting = new PageSettingModel(pageNumber, pageSize, pageCount, rowCount); + var transactionresponseModel = transactionList.Select(Transactions => new TransactionResponseModel + { + Transaction = Transactions.Change(), + Client = Transactions.Client.Change(_db.Users.Where(x => x.UserId == Transactions.Client.UserId).FirstOrDefault()), + Property = Transactions.Property.Change() + + }).ToList(); + transactionListResponse.lstTransaction = transactionresponseModel; + model = Result.Success(transactionListResponse); + return model; + } + catch (Exception ex) + { + return model = Result.Error(ex); + } + result: + return model; + } + + public async Task> GetTransactionsByClientIdAsync(int pageNumber, int pageSize, int clientId) + { + Result model = null; + try + { + TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); + var transactionList = await _db.Transactions.AsNoTracking() + .Include(x => x.Client) + .Include(x => x.Property) + .Where(x => x.ClientId == clientId) + .Skip((pageNumber - 1) * pageSize) + .Take(pageSize) + .ToListAsync(); + if (transactionList is null) + { + model = Result.Error("This client doesn't have in the transaction!!"); + goto result; + } int rowCount = _db.Transactions.Count(); int pageCount = rowCount / pageSize; @@ -132,7 +217,14 @@ public async Task> GetTransactionsByPropert pageCount++; transactionListResponse.pageSetting = new PageSettingModel(pageNumber, pageSize, pageCount, rowCount); - transactionListResponse.lstTransaction = transaction; + var transactionresponseModel = transactionList.Select(Transactions => new TransactionResponseModel + { + Transaction = Transactions.Change(), + Client = Transactions.Client.Change(_db.Users.Where(x => x.UserId == Transactions.Client.UserId).FirstOrDefault()), + Property = Transactions.Property.Change() + + }).ToList(); + transactionListResponse.lstTransaction = transactionresponseModel; model = Result.Success(transactionListResponse); return model; } From cba9f0f847ba8c62e8ef92f2dd77afaf6e9134c6 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Sat, 10 Aug 2024 15:38:13 +0000 Subject: [PATCH 28/28] Fix code style issues with dotnet_format --- REMS.Modules/Features/Transaction/DA_Transaction.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/REMS.Modules/Features/Transaction/DA_Transaction.cs b/REMS.Modules/Features/Transaction/DA_Transaction.cs index 2db87ad..50b6f7b 100644 --- a/REMS.Modules/Features/Transaction/DA_Transaction.cs +++ b/REMS.Modules/Features/Transaction/DA_Transaction.cs @@ -54,7 +54,7 @@ public async Task> CreateTransactionAsync(TransactionRequestModel _db.Properties.Update(property); int propertyResult = await _db.SaveChangesAsync(); } - + model = result > 0 ? Result.Success("Transaction creation success.") : Result.Error("Transaction creation fail."); } catch (Exception ex) @@ -72,7 +72,7 @@ public async Task> GetTransactionsAsync(int try { TransactionListResponseModel transactionListResponse = new TransactionListResponseModel(); - var transactionList =await _db.Transactions.AsNoTracking() + var transactionList = await _db.Transactions.AsNoTracking() .Include(x => x.Client) .Include(x => x.Property) .Skip((pageNumber - 1) * pageSize)