diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8d14b8a2..a4fd4b93 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-ef": { - "version": "7.0.2", + "version": "8.0.0-preview.6.23329.4", "commands": [ "dotnet-ef" ] @@ -21,4 +21,4 @@ ] } } -} \ No newline at end of file +} diff --git a/.dockerignore b/.dockerignore index 04a14442..7ff9bb29 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,10 +1,26 @@ -.idea -.fleet -.vscode -*.sqlite3* -StaticFiles -**/wwwroot/lib -bin -obj -secret.json -published \ No newline at end of file +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/.idea +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +**/.docker +LICENSE +README.md diff --git a/.editorconfig b/.editorconfig index a5a0e743..e5029465 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,83 @@ -root=true +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}] + +# Visual C++ Code Style settings + +cpp_generate_documentation_comments = xml + +# Visual C++ Formatting settings + +cpp_indent_braces = false +cpp_indent_multi_line_relative_to = innermost_parenthesis +cpp_indent_within_parentheses = indent +cpp_indent_preserve_within_parentheses = true +cpp_indent_case_contents = true +cpp_indent_case_labels = false +cpp_indent_case_contents_when_block = false +cpp_indent_lambda_braces_when_parameter = true +cpp_indent_goto_labels = one_left +cpp_indent_preprocessor = leftmost_column +cpp_indent_access_specifiers = false +cpp_indent_namespace_contents = true +cpp_indent_preserve_comments = false +cpp_new_line_before_open_brace_namespace = ignore +cpp_new_line_before_open_brace_type = ignore +cpp_new_line_before_open_brace_function = ignore +cpp_new_line_before_open_brace_block = ignore +cpp_new_line_before_open_brace_lambda = ignore +cpp_new_line_scope_braces_on_separate_lines = false +cpp_new_line_close_brace_same_line_empty_type = false +cpp_new_line_close_brace_same_line_empty_function = false +cpp_new_line_before_catch = true +cpp_new_line_before_else = true +cpp_new_line_before_while_in_do_while = false +cpp_space_before_function_open_parenthesis = remove +cpp_space_within_parameter_list_parentheses = false +cpp_space_between_empty_parameter_list_parentheses = false +cpp_space_after_keywords_in_control_flow_statements = true +cpp_space_within_control_flow_statement_parentheses = false +cpp_space_before_lambda_open_parenthesis = false +cpp_space_within_cast_parentheses = false +cpp_space_after_cast_close_parenthesis = false +cpp_space_within_expression_parentheses = false +cpp_space_before_block_open_brace = true +cpp_space_between_empty_braces = false +cpp_space_before_initializer_list_open_brace = false +cpp_space_within_initializer_list_braces = true +cpp_space_preserve_in_initializer_list = true +cpp_space_before_open_square_bracket = false +cpp_space_within_square_brackets = false +cpp_space_before_empty_square_brackets = false +cpp_space_between_empty_square_brackets = false +cpp_space_group_square_brackets = true +cpp_space_within_lambda_brackets = false +cpp_space_between_empty_lambda_brackets = false +cpp_space_before_comma = false +cpp_space_after_comma = true +cpp_space_remove_around_member_operators = true +cpp_space_before_inheritance_colon = true +cpp_space_before_constructor_colon = true +cpp_space_remove_before_semicolon = true +cpp_space_after_semicolon = true +cpp_space_remove_around_unary_operator = true +cpp_space_around_binary_operator = insert +cpp_space_around_assignment_operator = insert +cpp_space_pointer_reference_alignment = left +cpp_space_around_ternary_operator = insert +cpp_wrap_preserve_blocks = one_liners [*.{cs,vb,razor}] #### Naming styles #### @@ -21,26 +100,31 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case dotnet_naming_symbols.interface.applicable_kinds = interface dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interface.required_modifiers = +dotnet_naming_symbols.interface.required_modifiers = dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types.required_modifiers = +dotnet_naming_symbols.types.required_modifiers = dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = +dotnet_naming_symbols.non_field_members.required_modifiers = # Naming styles dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = dotnet_naming_style.begins_with_i.capitalization = pascal_case -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = dotnet_naming_style.pascal_case.capitalization = pascal_case dotnet_style_operator_placement_when_wrapping = beginning_of_line tab_width = 4 @@ -78,12 +162,12 @@ dotnet_style_qualification_for_method = false:silent dotnet_style_qualification_for_event = false:silent insert_final_newline = false -[*.{cs,vb,razor}] +[*.{cs,razor}] csharp_indent_labels = one_less_than_current csharp_using_directive_placement = outside_namespace:silent csharp_prefer_simple_using_statement = true:suggestion csharp_prefer_braces = true:silent -csharp_style_namespace_declarations = block_scoped:silent +csharp_style_namespace_declarations = file_scoped:suggestion csharp_style_prefer_method_group_conversion = true:silent csharp_style_prefer_top_level_statements = true:silent csharp_style_expression_bodied_methods = false:silent diff --git a/src/Web/Components/wwwroot/.gitkeep b/.github/.gitkeep similarity index 100% rename from src/Web/Components/wwwroot/.gitkeep rename to .github/.gitkeep diff --git a/docker-compose.prod.yaml b/.github/workflows/.gitkeep similarity index 100% rename from docker-compose.prod.yaml rename to .github/workflows/.gitkeep diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000..c5b716d0 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,40 @@ +name: Build and test libraries + +on: + push: + branches: + - dev-* + +jobs: + build: + env: + BUILD_CONFIG: Debug + + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Restore Workloads + run: dotnet workload restore + + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build --no-restore -c ${{ env.BUILD_CONFIG }} + + - name: Test + run: dotnet test -c ${{ env.BUILD_CONFIG }} --no-build diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..e18fe9fc --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,13 @@ +{ + "recommendations": [ + "ms-dotnettools.blazorwasm-companion", + "ms-dotnettools.dotnet-maui", + "editorconfig.editorconfig", + "github.vscode-github-actions", + "ms-dotnettools.vscodeintellicode-csharp", + "ms-dotnettools.csdevkit", + "ms-dotnettools.csharp", + "wayou.vscode-todo-highlight", + "ms-azuretools.vscode-docker" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..f47d3c84 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,49 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": ".NET MAUI", + "type": "maui", + "request": "launch", + "preLaunchTask": "maui: Build" + }, + { + "name": ".NET Launch (service)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build-service", + "program": "${workspaceFolder}/src/service/bin/Debug/net8.0/XClaim.Service.dll", + "args": [], + "cwd": "${workspaceFolder}/src/service", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart", + "launchBrowser": { + "enabled": false, + "args": "${auto-detect-url}", + "windows": { + "command": "cmd.exe", + "args": "/C start ${auto-detect-url}" + }, + "osx": { + "command": "open" + }, + "linux": { + "command": "xdg-open" + } + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_URLS": "https://localhost:5124" + } + }, + { + "name": ".NET Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..c3c8bd6a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "dotnet.defaultSolution": "x-claim.sln", + "editor.bracketPairColorization.enabled": true, + "editor.guides.bracketPairs": true, + "editor.formatOnSave": true +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..20ed720e --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,26 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "clean-service", + "command": "dotnet", + "type": "process", + "args": [ + "clean", + "${workspaceFolder}/src/service/XClaim.Service.csproj" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "build-service", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/src/service/XClaim.Service.csproj" + ], + "problemMatcher": "$msCompile", + "dependsOn":["clean-service"] + } + ] +} diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 00000000..871409fa --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,13 @@ +# Ignore everything +* +**/bin +**/obj + +# Whitelist what you need +!.vscodeignore +!.github +!.config +!docs +!scripts +!src +!tests diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..1e178961 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +# Changelog +All notable changes to this project will be documented in this file. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..b737148a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contributing to Trace + +Thanks for your interest in the project! + +**No contribution is too small and all contributions are valued.** + +## Code of conduct diff --git a/Common.props b/Common.props new file mode 100644 index 00000000..6351e0e0 --- /dev/null +++ b/Common.props @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..3fab47e1 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,35 @@ + + + x-claim + 0.1-preview.1 + Godwin peter .O + An IOU payment management system + git + $(MSBuildThisFileDirectory) + https://github.com/gpproton/x-claim + https://github.com/gpproton/x-claim + true + $(MSBuildThisFileDirectory)LICENSE + MIT + © x-claim Contributors. All rights reserved. + True + + + + net8.0 + enable + enable + preview + + + + + + 7.0.0 + 8.0-preview.19 + 8.0.0-preview.6.23329.11 + 8.0.0-preview.6.23329.7 + 8.0.0-preview.6.23329.4 + + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..8b928a3b --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,101 @@ + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 27ba2b75..00000000 --- a/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine as base -WORKDIR /app -EXPOSE 80 -EXPOSE 443 - -FROM mcr.microsoft.com/dotnet/sdk:7.0 as build -WORKDIR /src -COPY . . -RUN dotnet restore src/Web/XClaim.Web.sln -RUN dotnet build -c Release src/Web/Server/XClaim.Web.Server.csproj - -FROM build AS publish -RUN dotnet publish src/Web/Server/XClaim.Web.Server.csproj -c Release -o /app/published --self-contained - -FROM base as runtime -WORKDIR /app -COPY --from=publish /app/published . -ENTRYPOINT [ "dotnet", "/app/XClaim.Web.Server.dll" ] \ No newline at end of file diff --git a/Native.props b/Native.props new file mode 100644 index 00000000..4e036b92 --- /dev/null +++ b/Native.props @@ -0,0 +1,53 @@ + + + + false + + net8.0-android + + $(TargetFrameworks);net8.0-ios;net8.0-maccatalyst + + $(TargetFrameworks);net8.0-ios;net8.0-maccatalyst;net8.0-windows10.0.19041.0 + Exe + true + true + 8.0 + true + false + + + 1.0 + 1 + + 14.2 + 14.0 + 24.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + Platforms/MacCatalyst/Entitlements.Debug.plist + + + + Platforms/MacCatalyst/Entitlements.Release.plist + true + + + diff --git a/README.md b/README.md index c4286dbc..7132988f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,31 @@ -# x-claim expense platform +# X-CLAIM Expense App - A basic expense request and approval system + A basic organization expense management system + ## Overview +x-claim is an application that allows organizations to manage the expense process of individual in the organization -## Why? +## Roadmap for x-claim + +- [ ] Web version. +- [ ] API Completion + + +## License + +Copyright (c) 2023 [Godwin peter .O](mailto:me@godwin.dev) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/XClaim.sln b/XClaim.sln deleted file mode 100644 index bc2d880b..00000000 --- a/XClaim.sln +++ /dev/null @@ -1,67 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XClaim.Common", "src\Common\XClaim.Common.csproj", "{7296F081-81BD-4E64-A5BF-658B989D8907}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{8F52511B-55D5-45AA-98E1-EE148BEEDA42}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XClaim.Web.Shared", "src\Web\Shared\XClaim.Web.Shared.csproj", "{174C84F6-D887-42BB-9112-6BAE0450FEFA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XClaim.Web.Server", "src\Web\Server\XClaim.Web.Server.csproj", "{99DEBF10-65B6-46CB-9C96-2EAD48EA1A8E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XClaim.Web.Components", "src\Web\Components\XClaim.Web.Components.csproj", "{0690CD4D-1E60-47CF-A386-E9CC8F6970F4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XClaim.Web.Client", "src\Web\Client\XClaim.Web.Client.csproj", "{9B7D4199-1098-4A91-9642-655510A60BE4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "App", "App", "{59BBFC86-EAA2-4342-9EE0-EDAC2582E8E0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XClaim.Mobile", "src\Mobile\XClaim.Mobile.csproj", "{AB4EEFBB-A355-4777-B9F5-C95D024FA35C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7296F081-81BD-4E64-A5BF-658B989D8907}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7296F081-81BD-4E64-A5BF-658B989D8907}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7296F081-81BD-4E64-A5BF-658B989D8907}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7296F081-81BD-4E64-A5BF-658B989D8907}.Release|Any CPU.Build.0 = Release|Any CPU - {174C84F6-D887-42BB-9112-6BAE0450FEFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {174C84F6-D887-42BB-9112-6BAE0450FEFA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {174C84F6-D887-42BB-9112-6BAE0450FEFA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {174C84F6-D887-42BB-9112-6BAE0450FEFA}.Release|Any CPU.Build.0 = Release|Any CPU - {99DEBF10-65B6-46CB-9C96-2EAD48EA1A8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99DEBF10-65B6-46CB-9C96-2EAD48EA1A8E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99DEBF10-65B6-46CB-9C96-2EAD48EA1A8E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99DEBF10-65B6-46CB-9C96-2EAD48EA1A8E}.Release|Any CPU.Build.0 = Release|Any CPU - {0690CD4D-1E60-47CF-A386-E9CC8F6970F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0690CD4D-1E60-47CF-A386-E9CC8F6970F4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0690CD4D-1E60-47CF-A386-E9CC8F6970F4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0690CD4D-1E60-47CF-A386-E9CC8F6970F4}.Release|Any CPU.Build.0 = Release|Any CPU - {9B7D4199-1098-4A91-9642-655510A60BE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9B7D4199-1098-4A91-9642-655510A60BE4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9B7D4199-1098-4A91-9642-655510A60BE4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9B7D4199-1098-4A91-9642-655510A60BE4}.Release|Any CPU.Build.0 = Release|Any CPU - {AB4EEFBB-A355-4777-B9F5-C95D024FA35C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AB4EEFBB-A355-4777-B9F5-C95D024FA35C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AB4EEFBB-A355-4777-B9F5-C95D024FA35C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {AB4EEFBB-A355-4777-B9F5-C95D024FA35C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AB4EEFBB-A355-4777-B9F5-C95D024FA35C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {174C84F6-D887-42BB-9112-6BAE0450FEFA} = {8F52511B-55D5-45AA-98E1-EE148BEEDA42} - {99DEBF10-65B6-46CB-9C96-2EAD48EA1A8E} = {8F52511B-55D5-45AA-98E1-EE148BEEDA42} - {0690CD4D-1E60-47CF-A386-E9CC8F6970F4} = {8F52511B-55D5-45AA-98E1-EE148BEEDA42} - {9B7D4199-1098-4A91-9642-655510A60BE4} = {8F52511B-55D5-45AA-98E1-EE148BEEDA42} - {AB4EEFBB-A355-4777-B9F5-C95D024FA35C} = {59BBFC86-EAA2-4342-9EE0-EDAC2582E8E0} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E0DEB82D-06A1-4B32-A4D8-97C75F7E10E5} - EndGlobalSection -EndGlobal diff --git a/XClaim.sln.DotSettings b/XClaim.sln.DotSettings deleted file mode 100644 index 205f2e8d..00000000 --- a/XClaim.sln.DotSettings +++ /dev/null @@ -1,8 +0,0 @@ - - True - True - True - True - True - True - True \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index c0a0d705..6878626b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,56 +1,34 @@ -version: '3.9' +version: '3.8' volumes: - db: - service-files: + postgres: + driver: local + # mysql: + # driver: local services: - service: - image: gpproton/x-claim:latest - restart: unless-stopped - depends_on: - - db - build: - context: . - dockerfile: Dockerfile + postgres: + image: postgres:15-alpine ports: - - "8000:80" + - 5436:5432 environment: - USER_SECRETS_ID: 836b9b8b-fd89-4aff-9286-809bda60998f - ROOT_URI: "http://localhost:8000" - # postgres | mysql | sqlite - DB_TYPE: postgres - DB_CONNECTION_STRING: "host=postgres_image;port=5432;database=x-claim;username=x-claim;password=x-claim" - ASPNETCORE_URLS: "https://+:443;http://+:80" -# ASPNETCORE_Kestrel__Certificates__Default__Password: dev -# ASPNETCORE_Kestrel__Certificates__Default__Path: /https/aspnetapp.pfx + - POSTGRES_DB=x-claim + - POSTGRES_USER=x-claim + - POSTGRES_PASSWORD=x-claim volumes: - - service-files:/app/StaticFiles/ - - ~/.aspnet/https:/https:ro - - ./secret.json:"/root/.microsoft/usersecrets/${USER_SECRETS_ID}/secret.json:ro" - deploy: - mode: replicated - resources: - limits: - memory: 256M - reservations: - memory: 64M + - postgres:/var/lib/postgresql/data/ - db: - image: postgres:15-alpine - restart: unless-stopped - volumes: - - db:/var/lib/postgresql/data - ports: - - "45432:5432" - environment: - POSTGRES_USER: x-claim - POSTGRES_PASSWORD: x-claim - POSTGRES_DB: x-claim - deploy: - mode: replicated - resources: - limits: - memory: 256M - reservations: - memory: 64M + # mysql: + # image: mysql:8.0 + # cap_add: + # - SYS_NICE + # restart: always + # environment: + # - MYSQL_DATABASE=x-claim + # - MYSQL_USER=x-claim + # - MYSQL_PASSWORD=x-claim + # - MYSQL_ROOT_PASSWORD=x-claim + # ports: + # - 3306:3306 + # volumes: + # - mysql:/var/lib/mysql diff --git a/docs/.gitkeep b/docs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/global.json b/global.json index 9b7db758..dbd27ae7 100644 --- a/global.json +++ b/global.json @@ -1,15 +1,16 @@ { "sdk": { - "version": "7.0.*", - "rollForward": "latestPatch" + "version": "8.0.100-preview.6.23330.14", + "rollForward": "latestFeature" }, "scripts": { - "build": "dotnet build --configuration Debug", - "build:web": "dotnet build src/Web/Server/", - "build:app": "dotnet build src/Mobile/XClaim.Mobile.csproj", - "format": "dotnet format ./XClaim.sln", - "web": "dotnet watch --project src/Web/Server/", - "dev:blazor": "DOTNET_USE_POLLING_FILE_WATCHER=true dotnet watch --project src/Web/Client/", - "dev:web": "DOTNET_USE_POLLING_FILE_WATCHER=true dotnet r web" + "b": "dotnet build --configuration Debug", + "test": "dotnet test --configuration Release", + "ci": "dotnet r build && dotnet r test", + "service": "dotnet run --project ./src/service", + "m:clean": "rm -rf src/service/Migrations/* && rm ./**/*.sqlite*", + "m:sqlite": "dotnet-ef migrations add Initial --output-dir Setup -s ./src/service/XClaim.Service.csproj -p ./src/migration/sqlite/XClaim.Migrate.Sqlite.csproj --verbose -- --provider sqlite", + "m:postgres": "dotnet-ef migrations add Initial --output-dir Setup -s ./src/service/XClaim.Service.csproj -p ./src/migration/postgres/XClaim.Migrate.Postgres.csproj --verbose -- --provider postgres", + "m:all": "dotnet r m:sqlite; dotnet r m:postgres" } } diff --git a/nuget.config b/nuget.config new file mode 100644 index 00000000..128d95e5 --- /dev/null +++ b/nuget.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/scripts/setup.ps1 b/scripts/setup.ps1 new file mode 100644 index 00000000..fa9bcdb7 --- /dev/null +++ b/scripts/setup.ps1 @@ -0,0 +1,2 @@ +dotnet tool restore +dotnet workload restore diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 00000000..93d9c26c --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +dotnet tool restore +dotnet workload restore ./X-Claim.sln diff --git a/src/Common/Base/BaseEntity.cs b/src/Common/Base/BaseEntity.cs deleted file mode 100644 index a53d22f9..00000000 --- a/src/Common/Base/BaseEntity.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace XClaim.Common.Base; - -public abstract class BaseEntity : IBaseEntity { - [Key, Required] public Guid Id { get; set; } -} \ No newline at end of file diff --git a/src/Common/Base/BaseResponse.cs b/src/Common/Base/BaseResponse.cs deleted file mode 100644 index 21a09553..00000000 --- a/src/Common/Base/BaseResponse.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace XClaim.Common.Base; - -public abstract class BaseResponse { - public Guid? Id { get; set; } - public DateTime CreatedAt { get; set; } - public DateTime? ModifiedAt { get; set; } -} \ No newline at end of file diff --git a/src/Common/Base/IBaseEntity.cs b/src/Common/Base/IBaseEntity.cs deleted file mode 100644 index e98a7007..00000000 --- a/src/Common/Base/IBaseEntity.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace XClaim.Common.Base; - -public interface IBaseEntity { - public Guid Id { get; set; } -} \ No newline at end of file diff --git a/src/Common/Base/ITimeEntity.cs b/src/Common/Base/ITimeEntity.cs deleted file mode 100644 index 4b2e71af..00000000 --- a/src/Common/Base/ITimeEntity.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace XClaim.Common.Base; - -public class ITimedEntity : IBaseEntity { - public Guid Id { get; set; } - public DateTime CreatedAt { get; set; } - public DateTime? ModifiedAt { get; set; } - public DateTime? DeletedAt { get; set; } -} \ No newline at end of file diff --git a/src/Common/Base/TimedEntity.cs b/src/Common/Base/TimedEntity.cs deleted file mode 100644 index 60858af7..00000000 --- a/src/Common/Base/TimedEntity.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace XClaim.Common.Base; - -public abstract class TimedEntity : ITimedEntity { - new public DateTime CreatedAt { get; set; } - new public DateTime? ModifiedAt { get; set; } - new public DateTime? DeletedAt { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/AuthResponse.cs b/src/Common/Dtos/AuthResponse.cs deleted file mode 100644 index c84e8bee..00000000 --- a/src/Common/Dtos/AuthResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace XClaim.Common.Dtos; - -public class AuthResponse { - public bool Confirmed { get; set; } - public DateTime? ExpiryTimeStamp { get; set; } - public int ExpiresIn { get; set; } - public string? Token { get; set; } - public string Message { get; set; } = string.Empty; - public string UserName { get; set; } = string.Empty; - public string Role { get; set; } = string.Empty; - public UserResponse? Data { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/BankAccountResponse.cs b/src/Common/Dtos/BankAccountResponse.cs deleted file mode 100644 index 8c5d8f29..00000000 --- a/src/Common/Dtos/BankAccountResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class BankAccountResponse : BaseResponse { - public string FullName { get; set; } = string.Empty; - public BankResponse? Bank { get; set; } - public Guid? BankId { get; set; } - public UserResponse? Owner { get; set; } - public Guid? OwnerId { get; set; } - public string Number { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; -} \ No newline at end of file diff --git a/src/Common/Dtos/BankResponse.cs b/src/Common/Dtos/BankResponse.cs deleted file mode 100644 index e6ccef7b..00000000 --- a/src/Common/Dtos/BankResponse.cs +++ /dev/null @@ -1,10 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class BankResponse : BaseResponse { - public string Name { get; set; } = string.Empty; - public string SwiftCode { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; - public bool Active { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/CategoryResponse.cs b/src/Common/Dtos/CategoryResponse.cs deleted file mode 100644 index 774df54b..00000000 --- a/src/Common/Dtos/CategoryResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class CategoryResponse : BaseResponse { - public string Name { get; set; } = string.Empty; - public CompanyResponse? Company { get; set; } - public Guid? CompanyId { get; set; } - public string Description { get; set; } = string.Empty; - public bool Active { get; set; } - public string Icon { get; set; } = string.Empty; -} \ No newline at end of file diff --git a/src/Common/Dtos/ClaimResponse.cs b/src/Common/Dtos/ClaimResponse.cs deleted file mode 100644 index e3e8b9b9..00000000 --- a/src/Common/Dtos/ClaimResponse.cs +++ /dev/null @@ -1,26 +0,0 @@ -using XClaim.Common.Base; -using XClaim.Common.Enums; - -namespace XClaim.Common.Dtos; - -public class ClaimResponse : BaseResponse { - public string Description { get; set; } = string.Empty; - public string Notes { get; set; } = string.Empty; - public decimal Amount { get; set; } = 100; - public ClaimPriority Priority { get; set; } = ClaimPriority.Normal; - public CategoryResponse? Category { get; set; } - public Guid? CategoryId { get; set; } - public CompanyResponse? Company { get; set; } - public Guid? CompanyId { get; set; } - public CurrencyResponse? Currency { get; set; } - public Guid? CurrencyId { get; set; } - public ClaimStatus Status { get; set; } = ClaimStatus.Pending; - public UserResponse? Owner { get; set; } - public UserResponse? ReviewedBy { get; set; } - public DateTime? ReviewedAt { get; set; } - public UserResponse? ConfirmedBy { get; set; } - public DateTime? ConfirmedAt { get; set; } - public UserResponse? ApprovedBy { get; set; } - public DateTime? ApprovedAt { get; set; } - public ICollection Files { get; set; } = default!; -} \ No newline at end of file diff --git a/src/Common/Dtos/ClaimStateResponse.cs b/src/Common/Dtos/ClaimStateResponse.cs deleted file mode 100644 index 7f369567..00000000 --- a/src/Common/Dtos/ClaimStateResponse.cs +++ /dev/null @@ -1,19 +0,0 @@ -using XClaim.Common.Base; -using XClaim.Common.Enums; - -namespace XClaim.Common.Dtos; - -public class ClaimStateResponse : BaseResponse { - public string? Description { get; set; } - public string? Notes { get; set; } - public string? Currency { get; set; } = "$"; - public decimal Amount { get; set; } - public string? Category { get; set; } - public ClaimStatus Status { get; set; } - public string? Owner { get; set; } - public Guid? OwnerId { get; set; } - public bool Approved { get; set; } - public bool Completed { get; set; } - - public bool Payed { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/CommentResponse.cs b/src/Common/Dtos/CommentResponse.cs deleted file mode 100644 index 91e1735b..00000000 --- a/src/Common/Dtos/CommentResponse.cs +++ /dev/null @@ -1,10 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class CommentResponse : BaseResponse { - public ClaimResponse? Claim { get; set; } - public PaymentResponse? Payment { get; set; } - public UserResponse? Owner { get; set; } - public string Content { get; set; } = string.Empty; -} \ No newline at end of file diff --git a/src/Common/Dtos/CompanyResponse.cs b/src/Common/Dtos/CompanyResponse.cs deleted file mode 100644 index e1b2d55c..00000000 --- a/src/Common/Dtos/CompanyResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class CompanyResponse : BaseResponse { - public string ShortName { get; set; } = string.Empty; - public string FullName { get; set; } = string.Empty; - public string AdminEmail { get; set; } = string.Empty; - public UserResponse? Manager { get; set; } - public Guid? ManagerId { get; set; } - public bool Active { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/CurrencyResponse.cs b/src/Common/Dtos/CurrencyResponse.cs deleted file mode 100644 index 80892b80..00000000 --- a/src/Common/Dtos/CurrencyResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class CurrencyResponse : BaseResponse { - public string Name { get; set; } = string.Empty; - - public string Symbol { get; set; } = string.Empty; - public string Code { get; set; } = string.Empty; - public decimal Rate { get; set; } - public string Description { get; set; } = string.Empty; - public bool Active { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/DomainResponse.cs b/src/Common/Dtos/DomainResponse.cs deleted file mode 100644 index c4952e0b..00000000 --- a/src/Common/Dtos/DomainResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class DomainResponse : BaseResponse { - public string Address { get; set; } = string.Empty; - public bool Active { get; set; } - public string Description { get; set; } = string.Empty; -} \ No newline at end of file diff --git a/src/Common/Dtos/EventResponse.cs b/src/Common/Dtos/EventResponse.cs deleted file mode 100644 index 16db61f7..00000000 --- a/src/Common/Dtos/EventResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -using XClaim.Common.Base; -using XClaim.Common.Enums; - -namespace XClaim.Common.Dtos; - -public class EventResponse : BaseResponse { - public EventType Type { get; set; } = EventType.Claim; - public ClaimResponse? Claim { get; set; } - public PaymentResponse? Payment { get; set; } - public string Description { get; set; } = string.Empty; -} \ No newline at end of file diff --git a/src/Common/Dtos/FileResponse.cs b/src/Common/Dtos/FileResponse.cs deleted file mode 100644 index 0955450f..00000000 --- a/src/Common/Dtos/FileResponse.cs +++ /dev/null @@ -1,10 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class FileResponse : BaseResponse { - public string Name { get; set; } = string.Empty; - public string Path { get; set; } = string.Empty; - public string Extension { get; set; } = string.Empty; - public UserResponse? Owner { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/NotificationResponse.cs b/src/Common/Dtos/NotificationResponse.cs deleted file mode 100644 index e9c5a051..00000000 --- a/src/Common/Dtos/NotificationResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using XClaim.Common.Base; -using XClaim.Common.Enums; - -namespace XClaim.Common.Dtos; - -public class NotificationResponse : BaseResponse { - public UserResponse? Owner { get; set; } - public Guid? OwnerId { get; set; } - public bool Disabled { get; set; } - public ICollection Channels { get; set; } = default!; - public ICollection Types { get; set; } = default!; -} \ No newline at end of file diff --git a/src/Common/Dtos/PaymentResponse.cs b/src/Common/Dtos/PaymentResponse.cs deleted file mode 100644 index 622d5e88..00000000 --- a/src/Common/Dtos/PaymentResponse.cs +++ /dev/null @@ -1,20 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class PaymentResponse : BaseResponse { - public string Description { get; set; } = string.Empty; - public decimal Amount { get; set; } - public string Notes { get; set; } = string.Empty; - public UserResponse? Owner { get; set; } - public Guid? OwnerId { get; set; } - public CompanyResponse? Company { get; set; } - public Guid? CompanyId { get; set; } - public UserResponse? CreatedBy { get; set; } - public Guid? CreatedById { get; set; } - public DateTime? ConfirmedAt { get; set; } - public bool Confirmed => ConfirmedAt != null; - public int Count { get; set; } - public ICollection Claims { get; set; } = default!; - public ICollection Files { get; set; } = default!; -} \ No newline at end of file diff --git a/src/Common/Dtos/PaymentStateResponse.cs b/src/Common/Dtos/PaymentStateResponse.cs deleted file mode 100644 index ecb3c7b0..00000000 --- a/src/Common/Dtos/PaymentStateResponse.cs +++ /dev/null @@ -1,15 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class PaymentStateResponse : BaseResponse { - public string Description { get; set; } = string.Empty; - public decimal Amount { get; set; } - public string Notes { get; set; } = string.Empty; - public string? Owner { get; set; } - public Guid? OwnerId { get; set; } - public string? CreatedBy { get; set; } - public DateTime? ConfirmedAt { get; set; } - public bool Confirmed => ConfirmedAt != null; - public int Count { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/ProfileResponse.cs b/src/Common/Dtos/ProfileResponse.cs deleted file mode 100644 index ced9c1b2..00000000 --- a/src/Common/Dtos/ProfileResponse.cs +++ /dev/null @@ -1,21 +0,0 @@ -using XClaim.Common.Base; -using XClaim.Common.Enums; - -namespace XClaim.Common.Dtos; - -public class ProfileResponse : BaseResponse { - public string Email { get; set; } = string.Empty; - public string FirstName { get; set; } = string.Empty; - public string LastName { get; set; } = string.Empty; - - public string FullName { - get { - return $"{FirstName} {LastName}"; - } - } - - public string Phone { get; set; } = string.Empty; - public UserPermission Permission { get; set; } = UserPermission.Standard; - public decimal Balance { get; set; } - public TeamResponse? Team { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/ServerResponse.cs b/src/Common/Dtos/ServerResponse.cs deleted file mode 100644 index c6c5cda7..00000000 --- a/src/Common/Dtos/ServerResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class ServerResponse : BaseResponse { - public string ServiceName { get; set; } = string.Empty; - public string AdminEmail { get; set; } = string.Empty; - public bool MaintenanceMode { get; set; } - public string MaintenanceText { get; set; } = string.Empty; - public CurrencyResponse? Currency { get; set; } - public Guid? CurrencyId { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/ServerStateResponse.cs b/src/Common/Dtos/ServerStateResponse.cs deleted file mode 100644 index eddba9e0..00000000 --- a/src/Common/Dtos/ServerStateResponse.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace XClaim.Common.Dtos; - -public sealed class ServerStateResponse : ServerResponse { - public bool Online { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/SettingResponse.cs b/src/Common/Dtos/SettingResponse.cs deleted file mode 100644 index cd60ba2d..00000000 --- a/src/Common/Dtos/SettingResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -using XClaim.Common.Base; -using XClaim.Common.Enums; - -namespace XClaim.Common.Dtos; - -public class SettingResponse : BaseResponse { - public UserResponse? Owner { get; set; } - public Guid? OwnerId { get; set; } - public bool DarkMode { get; set; } - public AppLanguage Language { get; set; } = AppLanguage.English; -} \ No newline at end of file diff --git a/src/Common/Dtos/TeamResponse.cs b/src/Common/Dtos/TeamResponse.cs deleted file mode 100644 index dd678be2..00000000 --- a/src/Common/Dtos/TeamResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class TeamResponse : BaseResponse { - public string Name { get; set; } = string.Empty; - public bool Active { get; set; } - public string Description { get; set; } = string.Empty; - public CompanyResponse? Company { get; set; } - public Guid? CompanyId { get; set; } - public UserResponse? Manager { get; set; } - public Guid? ManagerId { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/TransferRequestItem.cs b/src/Common/Dtos/TransferRequestItem.cs deleted file mode 100644 index df6cbc91..00000000 --- a/src/Common/Dtos/TransferRequestItem.cs +++ /dev/null @@ -1,12 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class TransferRequestItem : BaseResponse { - public string? User { get; set; } - public Guid? UserId { get; set; } - public string? Company { get; set; } - public string? PreviousCompany { get; set; } - public string? Email { get; set; } - public bool Completed { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/TransferRequestResponse.cs b/src/Common/Dtos/TransferRequestResponse.cs deleted file mode 100644 index f73f5e6d..00000000 --- a/src/Common/Dtos/TransferRequestResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -using XClaim.Common.Base; - -namespace XClaim.Common.Dtos; - -public class TransferRequestResponse : BaseResponse { - public UserResponse? User { get; set; } - public Guid? UserId { get; set; } - public CompanyResponse? Company { get; set; } - public Guid? CompanyId { get; set; } - public bool Completed { get; set; } -} \ No newline at end of file diff --git a/src/Common/Dtos/UserResponse.cs b/src/Common/Dtos/UserResponse.cs deleted file mode 100644 index 6810a1ac..00000000 --- a/src/Common/Dtos/UserResponse.cs +++ /dev/null @@ -1,30 +0,0 @@ -using XClaim.Common.Base; -using XClaim.Common.Enums; - -namespace XClaim.Common.Dtos; - -public class UserResponse : BaseResponse { - public string Identifier { get; set; } = string.Empty; - public string Email { get; set; } = String.Empty; - public string Phone { get; set; } = String.Empty; - public string FirstName { get; set; } = String.Empty; - public string LastName { get; set; } = String.Empty; - public string FullName => $"{FirstName} {LastName}"; - public decimal Balance { get; set; } - public UserPermission Permission { get; set; } = UserPermission.Standard; - public CompanyResponse? Company { get; set; } - public Guid? CompanyId { get; set; } - public CompanyResponse? CompanyManaged { get; set; } - public TeamResponse? Team { get; set; } - public Guid? TeamId { get; set; } - public TeamResponse? TeamManaged { get; set; } - public CurrencyResponse? Currency { get; set; } - public Guid? CurrencyId { get; set; } - public BankAccountResponse? BankAccount { get; set; } - public NotificationResponse? Notification { get; set; } - public SettingResponse? Setting { get; set; } - - public bool Active { get; set; } - public string Token { get; set; } = String.Empty; - public string? Image { get; set; } -} \ No newline at end of file diff --git a/src/Common/Enums/AppLanguage.cs b/src/Common/Enums/AppLanguage.cs deleted file mode 100644 index a4a70c84..00000000 --- a/src/Common/Enums/AppLanguage.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace XClaim.Common.Enums { - public enum AppLanguage { - English, - French, - Spanish - } -} \ No newline at end of file diff --git a/src/Common/Enums/ClaimPriority.cs b/src/Common/Enums/ClaimPriority.cs deleted file mode 100644 index 839fe4da..00000000 --- a/src/Common/Enums/ClaimPriority.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.ComponentModel; - -namespace XClaim.Common.Enums; - -public enum ClaimPriority { - Normal, - Urgent, - [Description("Show Stopper")] - ShowStopper -} \ No newline at end of file diff --git a/src/Common/Enums/ClaimStatus.cs b/src/Common/Enums/ClaimStatus.cs deleted file mode 100644 index 5797830c..00000000 --- a/src/Common/Enums/ClaimStatus.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace XClaim.Common.Enums; - -public enum ClaimStatus { - Pending, - Rejected, - Cancelled, - Reviewed, - Confirmed, - Approved, - None -} \ No newline at end of file diff --git a/src/Common/Enums/EventType.cs b/src/Common/Enums/EventType.cs deleted file mode 100644 index de26ab2f..00000000 --- a/src/Common/Enums/EventType.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.ComponentModel; - -namespace XClaim.Common.Enums; - -public enum EventType { - Claim, - Payment, - Review, - Comment, - Reminder, - Announcement, - [Description("Weekly Status")] - WeeklyStatus -} \ No newline at end of file diff --git a/src/Common/Enums/NotificationChannels.cs b/src/Common/Enums/NotificationChannels.cs deleted file mode 100644 index 5344b2fe..00000000 --- a/src/Common/Enums/NotificationChannels.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.ComponentModel; - -namespace XClaim.Common.Enums { - public enum NotificationChannels { - [Description("Email Notifications")] - Email, - [Description("Push Notifications")] - Push, - [Description("SMS Notifications")] - Sms, - [Description("Teams Notifications")] - Teams - } -} \ No newline at end of file diff --git a/src/Common/Enums/UserPermission.cs b/src/Common/Enums/UserPermission.cs deleted file mode 100644 index 7dc6333f..00000000 --- a/src/Common/Enums/UserPermission.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel; - -namespace XClaim.Common.Enums; - -public enum UserPermission { - System, - Administrator, - [Description("Finance Manager")] - Finance, - [Description("Department Head")] - Lead, - Cashier, - Standard, - Anonymous -} \ No newline at end of file diff --git a/src/Common/Extensions/DateTimeExtensions.cs b/src/Common/Extensions/DateTimeExtensions.cs deleted file mode 100644 index 06f803d9..00000000 --- a/src/Common/Extensions/DateTimeExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace XClaim.Common.Extensions; - -public static class DateTimeExtensions { - public static TimeOnly ToTimeOnly(this DateTime dateTime) { - return TimeOnly.FromDateTime(dateTime); - } - - public static DateOnly ToDateOnly(this DateTime dateTime) { - return DateOnly.FromDateTime(dateTime); - } - - public static string TimeAgo(this DateTime dateTime) { - var result = string.Empty; - var timeSpan = DateTime.Now.Subtract(dateTime); - - if (timeSpan <= TimeSpan.FromSeconds(60)) - result = string.Format("{0} seconds ago", timeSpan.Seconds); - else if (timeSpan <= TimeSpan.FromMinutes(60)) - result = timeSpan.Minutes > 1 ? string.Format("{0} minutes ago", timeSpan.Minutes) : "a minute ago"; - else if (timeSpan <= TimeSpan.FromHours(24)) - result = timeSpan.Hours > 1 ? string.Format("{0} hours ago", timeSpan.Hours) : "an hour ago"; - else if (timeSpan <= TimeSpan.FromDays(30)) - result = timeSpan.Days > 1 ? string.Format("{0} days ago", timeSpan.Days) : "yesterday"; - else if (timeSpan <= TimeSpan.FromDays(365)) - result = timeSpan.Days > 30 ? string.Format("{0} months ago", timeSpan.Days / 30) : "a month ago"; - else - result = timeSpan.Days > 365 ? string.Format("{0} years ago", timeSpan.Days / 365) : "a year ago"; - - return result; - } -} \ No newline at end of file diff --git a/src/Common/Extensions/LazyResolutionExtension.cs b/src/Common/Extensions/LazyResolutionExtension.cs deleted file mode 100644 index 8d894d7d..00000000 --- a/src/Common/Extensions/LazyResolutionExtension.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; - -namespace XClaim.Common.Extensions; - -public static class LazyResolutionExtension { - public static IServiceCollection AddLazyResolution(this IServiceCollection services) - { - return services.AddTransient( - typeof(Lazy<>), - typeof(LazilyResolved<>)); - } - - private class LazilyResolved : Lazy where T : notnull { - public LazilyResolved(IServiceProvider serviceProvider) - : base(serviceProvider.GetRequiredService) - { - } - } -} \ No newline at end of file diff --git a/src/Common/Extensions/NameValueExtensions.cs b/src/Common/Extensions/NameValueExtensions.cs deleted file mode 100644 index 52f01ead..00000000 --- a/src/Common/Extensions/NameValueExtensions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Specialized; -using System.Web; - -namespace XClaim.Common.Extensions; - -public static class NameValueExtensions { - public static string ToQueryString(this NameValueCollection? source, bool removeEmptyEntries = false) { - if (source == null) return string.Empty; - - return "?" + String.Join("&", source.AllKeys - .Where(key => !removeEmptyEntries || source.GetValues(key)!.Any(value => !String.IsNullOrEmpty(value))) - .SelectMany(key => source.GetValues(key)! - .Where(value => !removeEmptyEntries || !String.IsNullOrEmpty(value)) - .Select(value => $"{HttpUtility.UrlEncode(key)}={(HttpUtility.UrlEncode(value))}")) - .ToArray()); - } -} \ No newline at end of file diff --git a/src/Common/Extensions/ObjectExtensions.cs b/src/Common/Extensions/ObjectExtensions.cs deleted file mode 100644 index 4292125e..00000000 --- a/src/Common/Extensions/ObjectExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Web; - -namespace XClaim.Common.Extensions; - -public static class ObjectExtensions { - public static string GetQueryString(this object? obj) { - if (obj == null) return string.Empty; - var properties = from p in obj.GetType().GetProperties() - where p.GetValue(obj, null) != null - select p.Name + "=" + HttpUtility.UrlEncode(p!.GetValue(obj, null).ToString()); - - return "?" + String.Join("&", properties.ToArray()); - } -} \ No newline at end of file diff --git a/src/Common/Extensions/StringExtensions.cs b/src/Common/Extensions/StringExtensions.cs deleted file mode 100644 index 3f59bcb9..00000000 --- a/src/Common/Extensions/StringExtensions.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace XClaim.Common.Extensions; - -public static class StringExtensions { - public static string Truncate(this string? value, int length = 15) { - if (value == null) return string.Empty; - return value.Length <= length ? value : value[..length] + "..."; - } -} \ No newline at end of file diff --git a/src/Common/HTTP/BankService.cs b/src/Common/HTTP/BankService.cs deleted file mode 100644 index 88353373..00000000 --- a/src/Common/HTTP/BankService.cs +++ /dev/null @@ -1,32 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class BankService : IBankService { - private const string RootApi = "api/v1/bank"; - private readonly IHttpService _http; - - public BankService(IHttpService http) { - _http = http; - } - public async Task>> GetAllAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - public async Task> GetByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/{id}"); - } - public async Task> CreateAsync(BankResponse bank) { - return await _http.Post>(RootApi, bank); - } - public async Task> UpdateAsync(BankResponse bank) { - return await _http.Put>(RootApi, bank); - } - public async Task> ArchiveAsync(Guid id) { - return await _http.Delete>($"{RootApi}/{id}"); - } - public async Task>> ArchiveRangeAsync(List ids) { - return await _http.Delete>>(RootApi, ids); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/CategoryService.cs b/src/Common/HTTP/CategoryService.cs deleted file mode 100644 index 19affd8e..00000000 --- a/src/Common/HTTP/CategoryService.cs +++ /dev/null @@ -1,32 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class CategoryService : ICategoryService { - private const string RootApi = "api/v1/category"; - private readonly IHttpService _http; - - public CategoryService(IHttpService http) { - _http = http; - } - public async Task>> GetAllAsync(object? query = null) => - await _http.Get>>(RootApi, query); - - public async Task> GetByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/{id}"); - } - public async Task> CreateAsync(CategoryResponse bank) { - return await _http.Post>(RootApi, bank); - } - public async Task> UpdateAsync(CategoryResponse bank) { - return await _http.Put>(RootApi, bank); - } - public async Task> ArchiveAsync(Guid id) { - return await _http.Delete>($"{RootApi}/{id}"); - } - public async Task>> ArchiveRangeAsync(List ids) { - return await _http.Delete>>(RootApi, ids); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/ClaimService.cs b/src/Common/HTTP/ClaimService.cs deleted file mode 100644 index 97f6063f..00000000 --- a/src/Common/HTTP/ClaimService.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Text; -using System.Web; -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class ClaimService : IClaimService { - private const string RootApi = "api/v1/claim"; - private readonly IHttpService _http; - - public ClaimService(IHttpService http) { - _http = http; - } - public async Task>> GetAllAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - public async Task>> GetReviewsAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - public async Task> GetByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/{id}"); - } - public async Task> CreateAsync(ClaimResponse claim) { - return await _http.Post>(RootApi, claim); - } - public async Task> UpdateAsync(ClaimResponse claim) { - return await _http.Put>(RootApi, claim); - } - - public async Task> ArchiveAsync(Guid id) { - return await _http.Delete>($"{RootApi}/{id}"); - } - public async Task>> GetReviewAllAsync(object? query = null) { - return await _http.Get>>($"{RootApi}/review", query); - } - public async Task> GetReviewByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/review/{id}"); - } - public async Task> CancelReviewAsync(Guid id) { - return await _http.Put>($"{RootApi}/review/cancel/{id}"); - } - public async Task> RejectReviewAsync(Guid id, string comment) { - var uri = $"{RootApi}/review/reject/{id}"; - return await _http.Put>(uri, new CommentResponse { Content = comment}); - } - public async Task> ValidateReviewAsync(Guid id, string comment) { - var uri = $"{RootApi}/review/validate/{id}"; - return await _http.Put>(uri, new CommentResponse { Content = comment}); - } - public async Task>> GetPendingUserAsync(object? query = null) { - return await _http.Get>>($"{RootApi}/pending-users", query); - } - public async Task>> GetFileAsync(Guid claimId, object? query = null) { - return await _http.Get>>($"{RootApi}/file/{claimId}", query); - } - public async Task>> GetCommentAsync(Guid claimId, object? query = null) { - return await _http.Get>>($"{RootApi}/file/{claimId}", query); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/CompanyService.cs b/src/Common/HTTP/CompanyService.cs deleted file mode 100644 index 9ac68832..00000000 --- a/src/Common/HTTP/CompanyService.cs +++ /dev/null @@ -1,32 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class CompanyService : ICompanyService { - private const string RootApi = "api/v1/company"; - private readonly IHttpService _http; - - public CompanyService(IHttpService http) { - _http = http; - } - public async Task>> GetAllAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - public async Task> GetByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/{id}"); - } - public async Task> CreateAsync(CompanyResponse bank) { - return await _http.Post>(RootApi, bank); - } - public async Task> UpdateAsync(CompanyResponse bank) { - return await _http.Put>(RootApi, bank); - } - public async Task> ArchiveAsync(Guid id) { - return await _http.Delete>($"{RootApi}/{id}"); - } - public async Task>> ArchiveRangeAsync(List ids) { - return await _http.Delete>>(RootApi, ids); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/CurrencyService.cs b/src/Common/HTTP/CurrencyService.cs deleted file mode 100644 index 746b473a..00000000 --- a/src/Common/HTTP/CurrencyService.cs +++ /dev/null @@ -1,32 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class CurrencyService : ICurrencyService { - private const string RootApi = "api/v1/currency"; - private readonly IHttpService _http; - - public CurrencyService(IHttpService http) { - _http = http; - } - public async Task>> GetAllAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - public async Task> GetByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/{id}"); - } - public async Task> CreateAsync(CurrencyResponse bank) { - return await _http.Post>(RootApi, bank); - } - public async Task> UpdateAsync(CurrencyResponse bank) { - return await _http.Put>(RootApi, bank); - } - public async Task> ArchiveAsync(Guid id) { - return await _http.Delete>($"{RootApi}/{id}"); - } - public async Task>> ArchiveRangeAsync(List ids) { - return await _http.Delete>>(RootApi, ids); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/DomainService.cs b/src/Common/HTTP/DomainService.cs deleted file mode 100644 index fd30ad99..00000000 --- a/src/Common/HTTP/DomainService.cs +++ /dev/null @@ -1,33 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class DomainService : IDomainService { - private const string RootApi = "api/v1/domain"; - private readonly IHttpService _http; - - public DomainService(IHttpService http) { - _http = http; - } - - public async Task>> GetAllAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - public async Task> GetByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/{id}"); - } - public async Task> CreateAsync(DomainResponse bank) { - return await _http.Post>(RootApi, bank); - } - public async Task> UpdateAsync(DomainResponse bank) { - return await _http.Put>(RootApi, bank); - } - public async Task> ArchiveAsync(Guid id) { - return await _http.Delete>($"{RootApi}/{id}"); - } - public async Task>> ArchiveRangeAsync(List ids) { - return await _http.Delete>>(RootApi, ids); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/EventService.cs b/src/Common/HTTP/EventService.cs deleted file mode 100644 index 0b47f111..00000000 --- a/src/Common/HTTP/EventService.cs +++ /dev/null @@ -1,21 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; - -namespace XClaim.Common.HTTP; - -public class EventService : IEventService { - private const string RootApi = "api/v1/event"; - private readonly IHttpService _http; - - public EventService(IHttpService http) { - _http = http; - } - - public async Task> GetAllAsync() { - return await _http.Get>($"{RootApi}?Page=1&PerPage=25&SortBy=Ascending&CombineWith=Or"); - } - - public async Task GetByIdAsync(Guid id) { - return await _http.Get($"{RootApi}/{id}"); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/HttpServiceExtensions.cs b/src/Common/HTTP/HttpServiceExtensions.cs deleted file mode 100644 index 0e416afb..00000000 --- a/src/Common/HTTP/HttpServiceExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using XClaim.Common.Extensions; - -namespace XClaim.Common.HTTP; - -public static class HttpServiceExtensions { - public static IServiceCollection UseHttpServices(this IServiceCollection services) { - services.AddLazyResolution(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - - return services; - } -} \ No newline at end of file diff --git a/src/Common/HTTP/IBankService.cs b/src/Common/HTTP/IBankService.cs deleted file mode 100644 index f53846b3..00000000 --- a/src/Common/HTTP/IBankService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface IBankService { - Task>> GetAllAsync(object? query = null); - - Task> GetByIdAsync(Guid id); - - Task> CreateAsync(BankResponse bank); - - Task> UpdateAsync(BankResponse bank); - - Task> ArchiveAsync(Guid id); - - Task>> ArchiveRangeAsync(List ids); -} \ No newline at end of file diff --git a/src/Common/HTTP/ICategoryService.cs b/src/Common/HTTP/ICategoryService.cs deleted file mode 100644 index 8c4f9a51..00000000 --- a/src/Common/HTTP/ICategoryService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface ICategoryService { - Task>> GetAllAsync(object? query = null); - - Task> GetByIdAsync(Guid id); - - Task> CreateAsync(CategoryResponse bank); - - Task> UpdateAsync(CategoryResponse bank); - - Task> ArchiveAsync(Guid id); - - Task>> ArchiveRangeAsync(List ids); -} \ No newline at end of file diff --git a/src/Common/HTTP/IClaimService.cs b/src/Common/HTTP/IClaimService.cs deleted file mode 100644 index 50532de7..00000000 --- a/src/Common/HTTP/IClaimService.cs +++ /dev/null @@ -1,33 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface IClaimService { - Task>> GetAllAsync(object? query = null); - - Task>> GetReviewsAsync(object? query = null); - - Task> GetByIdAsync(Guid id); - - Task> CreateAsync(ClaimResponse claim); - - Task> UpdateAsync(ClaimResponse claim); - - Task> ArchiveAsync(Guid id); - - Task>> GetReviewAllAsync(object? query = null); - - Task> GetReviewByIdAsync(Guid id); - Task> CancelReviewAsync(Guid id); - - Task> RejectReviewAsync(Guid id, string comment); - - Task> ValidateReviewAsync(Guid id, string comment); - - Task>> GetPendingUserAsync(object? query = null); - - Task>> GetFileAsync(Guid claimId, object? query = null); - - Task>> GetCommentAsync(Guid claimId, object? query = null); -} \ No newline at end of file diff --git a/src/Common/HTTP/ICompanyService.cs b/src/Common/HTTP/ICompanyService.cs deleted file mode 100644 index 2dae9876..00000000 --- a/src/Common/HTTP/ICompanyService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface ICompanyService { - Task>> GetAllAsync(object? query = null); - - Task> GetByIdAsync(Guid id); - - Task> CreateAsync(CompanyResponse company); - - Task> UpdateAsync(CompanyResponse company); - - Task> ArchiveAsync(Guid id); - - Task>> ArchiveRangeAsync(List ids); -} \ No newline at end of file diff --git a/src/Common/HTTP/ICurrencyService.cs b/src/Common/HTTP/ICurrencyService.cs deleted file mode 100644 index 58b8c8bc..00000000 --- a/src/Common/HTTP/ICurrencyService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface ICurrencyService { - Task>> GetAllAsync(object? query = null); - - Task> GetByIdAsync(Guid id); - - Task> CreateAsync(CurrencyResponse category); - - Task> UpdateAsync(CurrencyResponse category); - - Task> ArchiveAsync(Guid id); - - Task>> ArchiveRangeAsync(List ids); -} \ No newline at end of file diff --git a/src/Common/HTTP/IDomainService.cs b/src/Common/HTTP/IDomainService.cs deleted file mode 100644 index 6dd8b7cf..00000000 --- a/src/Common/HTTP/IDomainService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface IDomainService { - Task>> GetAllAsync(object? query = null); - - Task> GetByIdAsync(Guid id); - - Task> CreateAsync(DomainResponse bank); - - Task> UpdateAsync(DomainResponse bank); - - Task> ArchiveAsync(Guid id); - - Task>> ArchiveRangeAsync(List ids); -} \ No newline at end of file diff --git a/src/Common/HTTP/IEventService.cs b/src/Common/HTTP/IEventService.cs deleted file mode 100644 index 71208865..00000000 --- a/src/Common/HTTP/IEventService.cs +++ /dev/null @@ -1,8 +0,0 @@ -using XClaim.Common.Dtos; - -namespace XClaim.Common.HTTP; - -public interface IEventService { - Task> GetAllAsync(); - Task GetByIdAsync(Guid id); -} \ No newline at end of file diff --git a/src/Common/HTTP/IPaymentService.cs b/src/Common/HTTP/IPaymentService.cs deleted file mode 100644 index 2473cd16..00000000 --- a/src/Common/HTTP/IPaymentService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface IPaymentService { - Task>> GetAllAsync(object? query = null); - - Task> GetByIdAsync(Guid id); - - Task>> GetAllTransactionAsync(object? query = null); - - Task> GetTransactionByIdAsync(Guid id); - - Task> CreateTransactionAsync(Guid id, List claims); - - Task> UpdateTransactionAsync(Guid id, List claims); - - Task> ConfirmAsync(Guid id); - - Task>> RangedConfirmAsync(List ids); - - Task> CancelAsync(Guid id); -} \ No newline at end of file diff --git a/src/Common/HTTP/IProfileService.cs b/src/Common/HTTP/IProfileService.cs deleted file mode 100644 index 27d3083a..00000000 --- a/src/Common/HTTP/IProfileService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface IProfileService { - Task> GetAccountAsync(); - Task> GetBankAccountAsync(); - Task> UpdateBankAccountAsync(BankAccountResponse account); - - Task> GetSettingAsync(); - Task> UpdateSettingAsync(SettingResponse setting); - - Task> GetNotificationAsync(); - Task> UpdateNotificationAsync(NotificationResponse notification); - Task SignOutAsync(); -} \ No newline at end of file diff --git a/src/Common/HTTP/IServerService.cs b/src/Common/HTTP/IServerService.cs deleted file mode 100644 index ec3a659c..00000000 --- a/src/Common/HTTP/IServerService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface IServerService { - Task> GetAsync(); - Task> UpdateAsync(ServerResponse server); -} \ No newline at end of file diff --git a/src/Common/HTTP/ITeamService.cs b/src/Common/HTTP/ITeamService.cs deleted file mode 100644 index 122054d6..00000000 --- a/src/Common/HTTP/ITeamService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface ITeamService { - Task>> GetAllAsync(object? query = null); - - Task> GetByIdAsync(Guid id); - - Task> CreateAsync(TeamResponse team); - - Task> UpdateAsync(TeamResponse team); - - Task> ArchiveAsync(Guid id); - - Task>> ArchiveRangeAsync(List ids); -} \ No newline at end of file diff --git a/src/Common/HTTP/IUserService.cs b/src/Common/HTTP/IUserService.cs deleted file mode 100644 index 4e836c76..00000000 --- a/src/Common/HTTP/IUserService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public interface IUserService { - Task>> GetAllAsync(object? query = null); - - Task>> GetManagersAsync(object? query = null); - - Task> GetByIdAsync(Guid id); - - Task> RegistrationAsync(UserResponse user); - - Task> UpdateAsync(UserResponse user); - - Task> ArchiveAsync(Guid id); - - Task>> ArchiveRangeAsync(List ids); - Task> GetTransferAsync(); - Task>> GetAllTransferAsync(object? query = null); - Task> CreateTransferAsync(TransferRequestResponse transfer); - Task> ApproveTransferAsync(Guid id); - Task> ArchiveTransferAsync(Guid id); -} \ No newline at end of file diff --git a/src/Common/HTTP/PaymentService.cs b/src/Common/HTTP/PaymentService.cs deleted file mode 100644 index c9ccc503..00000000 --- a/src/Common/HTTP/PaymentService.cs +++ /dev/null @@ -1,49 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class PaymentService : IPaymentService { - private const string RootApi = "api/v1/payment"; - private readonly IHttpService _http; - - public PaymentService(IHttpService http) { - _http = http; - } - public async Task>> GetAllAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - - public async Task> GetByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/{id}"); - } - - public async Task>> GetAllTransactionAsync(object? query = null) { - throw new NotImplementedException(); - } - - public async Task> GetTransactionByIdAsync(Guid id) { - throw new NotImplementedException(); - } - - public async Task> CreateTransactionAsync(Guid id, List claims) { - throw new NotImplementedException(); - } - - public async Task> UpdateTransactionAsync(Guid id, List claims) { - throw new NotImplementedException(); - } - - public async Task> ConfirmAsync(Guid id) { - throw new NotImplementedException(); - } - - public async Task>> RangedConfirmAsync(List ids) { - throw new NotImplementedException(); - } - - public async Task> CancelAsync(Guid id) { - throw new NotImplementedException(); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/ProfileService.cs b/src/Common/HTTP/ProfileService.cs deleted file mode 100644 index 99a37669..00000000 --- a/src/Common/HTTP/ProfileService.cs +++ /dev/null @@ -1,40 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class ProfileService : IProfileService { - private const string RootApi = "api/v1/profile"; - private readonly IHttpService _http; - - public ProfileService(IHttpService http) { - _http = http; - } - - public async Task> GetAccountAsync() { - return await _http.Get>($"{RootApi}/account"); - } - public async Task> GetBankAccountAsync() { - return await _http.Get>($"{RootApi}/bank-account"); - } - public async Task> UpdateBankAccountAsync(BankAccountResponse account) { - return await _http.Put>($"{RootApi}/bank-account", account); - } - public async Task> GetSettingAsync() { - return await _http.Get>($"{RootApi}/setting"); - } - public async Task> UpdateSettingAsync(SettingResponse setting) { - return await _http.Put>($"{RootApi}/setting", setting); - } - public async Task> GetNotificationAsync() { - return await _http.Get>($"{RootApi}/notification"); - } - public async Task> UpdateNotificationAsync(NotificationResponse notification) { - return await _http.Put>($"{RootApi}/notification", notification); - } - - public async Task SignOutAsync() { - return await _http.Post("/auth/sign-out", null); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/ServerService.cs b/src/Common/HTTP/ServerService.cs deleted file mode 100644 index 6d6ceeeb..00000000 --- a/src/Common/HTTP/ServerService.cs +++ /dev/null @@ -1,20 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class ServerService : IServerService { - private const string RootApi = "api/v1/server"; - private readonly IHttpService _http; - public ServerService(IHttpService http) { - _http = http; - } - - public async Task> GetAsync() { - return await _http.Get>(RootApi); - } - public async Task> UpdateAsync(ServerResponse server) { - return await _http.Put>(RootApi, server); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/TeamService.cs b/src/Common/HTTP/TeamService.cs deleted file mode 100644 index 2a830dae..00000000 --- a/src/Common/HTTP/TeamService.cs +++ /dev/null @@ -1,33 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class TeamService : ITeamService { - private const string RootApi = "api/v1/team"; - private readonly IHttpService _http; - - public TeamService(IHttpService http) { - _http = http; - } - - public async Task>> GetAllAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - public async Task> GetByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/{id}"); - } - public async Task> CreateAsync(TeamResponse bank) { - return await _http.Post>(RootApi, bank); - } - public async Task> UpdateAsync(TeamResponse bank) { - return await _http.Put>(RootApi, bank); - } - public async Task> ArchiveAsync(Guid id) { - return await _http.Delete>($"{RootApi}/{id}"); - } - public async Task>> ArchiveRangeAsync(List ids) { - return await _http.Delete>>(RootApi, ids); - } -} \ No newline at end of file diff --git a/src/Common/HTTP/UserService.cs b/src/Common/HTTP/UserService.cs deleted file mode 100644 index 9e84e3c9..00000000 --- a/src/Common/HTTP/UserService.cs +++ /dev/null @@ -1,51 +0,0 @@ -using XClaim.Common.Dtos; -using XClaim.Common.Service; -using XClaim.Common.Wrappers; - -namespace XClaim.Common.HTTP; - -public class UserService : IUserService { - private const string RootApi = "api/v1/user"; - private readonly IHttpService _http; - - public UserService(IHttpService http) { - _http = http; - } - public async Task>> GetAllAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - public async Task>> GetManagersAsync(object? query = null) { - return await _http.Get>>(RootApi, query); - } - - public async Task> GetByIdAsync(Guid id) { - return await _http.Get>($"{RootApi}/{id}"); - } - public async Task> RegistrationAsync(UserResponse user) { - return await _http.Post>(RootApi, user); - } - public async Task> UpdateAsync(UserResponse user) { - return await _http.Put>(RootApi, user); - } - public async Task> ArchiveAsync(Guid id) { - return await _http.Delete>($"{RootApi}/{id}"); - } - public async Task>> ArchiveRangeAsync(List ids) { - return await _http.Delete>>(RootApi, ids); - } - public async Task>> GetAllTransferAsync(object? query = null) { - return await _http.Get>>($"{RootApi}/transfer", query); - } - public async Task> GetTransferAsync() { - return await _http.Get>($"{RootApi}/transfer/profile"); - } - public async Task> CreateTransferAsync(TransferRequestResponse transfer) { - return await _http.Post>($"{RootApi}/transfer", transfer); - } - public async Task> ApproveTransferAsync(Guid id) { - return await _http.Put>($"{RootApi}/transfer/{id}"); - } - public async Task> ArchiveTransferAsync(Guid id) { - return await _http.Delete>($"{RootApi}/transfer/{id}"); - } -} \ No newline at end of file diff --git a/src/Common/Helpers/DateSearchFilter.cs b/src/Common/Helpers/DateSearchFilter.cs deleted file mode 100644 index 48133eac..00000000 --- a/src/Common/Helpers/DateSearchFilter.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace XClaim.Common.Helpers; - -public class DateSearchFilter : SearchFilter { - public DateTime? StartDate { get; set; } = SharedConst.StartDate; - public DateTime? EndDate { get; set; } = SharedConst.EndDate; -} \ No newline at end of file diff --git a/src/Common/Helpers/FactoryLoader.cs b/src/Common/Helpers/FactoryLoader.cs deleted file mode 100644 index fe48453b..00000000 --- a/src/Common/Helpers/FactoryLoader.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace XClaim.Common.Helpers; - -public static class FactoryLoader { - public static IEnumerable LoadClassInstance() { - return typeof(T).Assembly - .GetTypes() - .Where(p => p.IsClass && p.IsAssignableTo(typeof(T))) - .Select(Activator.CreateInstance) - .Cast(); - } -} \ No newline at end of file diff --git a/src/Common/Helpers/PaginationFilter.cs b/src/Common/Helpers/PaginationFilter.cs deleted file mode 100644 index d5c120ac..00000000 --- a/src/Common/Helpers/PaginationFilter.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace XClaim.Common.Helpers; - -public class PaginationFilter { - public int Page { get; set; } = 1; - public int PerPage { get; set; } = 25; - public string SortBy { get; set; } = "Ascending"; - public string CombineWith { get; set; } = "Or"; -} \ No newline at end of file diff --git a/src/Common/Helpers/SearchFilter.cs b/src/Common/Helpers/SearchFilter.cs deleted file mode 100644 index a2d0dc0c..00000000 --- a/src/Common/Helpers/SearchFilter.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace XClaim.Common.Helpers; - -public class SearchFilter : PaginationFilter { - public string? Search { get; set; } -} \ No newline at end of file diff --git a/src/Common/Helpers/StringConverter.cs b/src/Common/Helpers/StringConverter.cs deleted file mode 100644 index cca4468b..00000000 --- a/src/Common/Helpers/StringConverter.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace XClaim.Common.Helpers; - -public class StringConverter : JsonConverter { - public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TokenType == JsonTokenType.Number) return reader.GetInt32().ToString(); - if (reader.TokenType == JsonTokenType.String) - return reader.GetString()!; - - throw new System.Text.Json.JsonException(); - } - - public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options) { - writer.WriteStringValue(value); - } -} \ No newline at end of file diff --git a/src/Common/Helpers/StringHelpers.cs b/src/Common/Helpers/StringHelpers.cs deleted file mode 100644 index cd6077d9..00000000 --- a/src/Common/Helpers/StringHelpers.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; - -namespace XClaim.Common.Helpers; - -public static class StringHelpers { - public static string GetInitialsText(string?[] value) { - if (value.Length < 2) return "FL"; - var f = value[0]?.ToUpper(); - var l = value[^1]?.ToUpper(); - if (f == null || l == null) return "FL"; - try { - return string.Concat(f[0], l[0]); - } catch (Exception) { - // ignore - } - return string.Empty; - } -} \ No newline at end of file diff --git a/src/Common/Service/AbstractHttpService.cs b/src/Common/Service/AbstractHttpService.cs deleted file mode 100644 index 98747a31..00000000 --- a/src/Common/Service/AbstractHttpService.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System.Collections; -using System.Net; -using System.Net.Http.Json; -using System.Text; -using System.Text.Json; -using XClaim.Common.Extensions; -using XClaim.Common.Helpers; - -namespace XClaim.Common.Service; - -public abstract class AbstractHttpService : IHttpService { - private readonly HttpClient _http; - - protected AbstractHttpService(HttpClient http) { - _http = http; - } - - public async Task Get(string uri) { - var request = new HttpRequestMessage(HttpMethod.Get, uri); - return await SendRequest(request); - } - public async Task Get(string uri, object? query) { - string queries = query != null ? query.GetQueryString() : (new PaginationFilter()).GetQueryString(); - var url = uri + queries; - var request = new HttpRequestMessage(HttpMethod.Get, url); - return await SendRequest(request); - } - - public async Task Post(string uri, object? value) { - var request = CreateRequest(HttpMethod.Post, uri, value); - await SendRequest(request); - } - - public async Task Post(string uri) { - var request = CreateRequest(HttpMethod.Post, uri); - return await SendRequest(request); - } - - public async Task Post(string uri, object? value) { - var request = CreateRequest(HttpMethod.Post, uri, value); - return await SendRequest(request); - } - - public async Task Put(string uri, object? value) { - var request = CreateRequest(HttpMethod.Put, uri, value); - await SendRequest(request); - } - - public async Task Put(string uri) { - var request = CreateRequest(HttpMethod.Put, uri); - return await SendRequest(request); - } - - public async Task Put(string uri, object? value) { - var request = CreateRequest(HttpMethod.Put, uri, value); - return await SendRequest(request); - } - - public async Task Delete(string uri) { - var request = CreateRequest(HttpMethod.Delete, uri); - await SendRequest(request); - } - - public async Task Delete(string uri) { - var request = CreateRequest(HttpMethod.Delete, uri); - return await SendRequest(request); - } - - public async Task Delete(string uri, ICollection? values) { - var request = CreateRequest(HttpMethod.Delete, uri, values); - return await SendRequest(request); - } - - private HttpRequestMessage CreateRequest(HttpMethod method, string uri, object? value = null) { - var request = new HttpRequestMessage(method, uri); - if (value != null) - request.Content = new StringContent(JsonSerializer.Serialize(value), Encoding.UTF8, "application/json"); - return request; - } - - private async Task SendRequest(HttpRequestMessage request) { - await AddJwtHeader(request); - try { - using var response = await _http.SendAsync(request); - if (response.StatusCode == HttpStatusCode.Unauthorized) { - await SignOut(); - return; - } - await HandleErrors(response); - } - catch (Exception) { - Console.WriteLine("A HTTP callback error occurred"); - } - } - - private async Task SendRequest(HttpRequestMessage request) { - await AddJwtHeader(request); - try { - using var response = await _http.SendAsync(request); - if (response.StatusCode == HttpStatusCode.Unauthorized) { - await SignOut(); - return default!; - } - await HandleErrors(response); - var options = new JsonSerializerOptions { - PropertyNameCaseInsensitive = true - }; - options.Converters.Add(new StringConverter()); - - return (await response.Content.ReadFromJsonAsync(options))!; - } - catch (Exception) { - Console.WriteLine("A HTTP callback error occurred"); - } - - return default!; - } - - protected abstract Task AddJwtHeader(HttpRequestMessage request); - - protected abstract Task SignOut(); - - private async Task HandleErrors(HttpResponseMessage response) { - if (!response.IsSuccessStatusCode) { - var error = await response.Content.ReadFromJsonAsync>(); - if (error != null) throw new Exception(error["message"]); - } - } -} \ No newline at end of file diff --git a/src/Common/Service/IHttpService.cs b/src/Common/Service/IHttpService.cs deleted file mode 100644 index c999341e..00000000 --- a/src/Common/Service/IHttpService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections; - -namespace XClaim.Common.Service; - -public interface IHttpService { - Task Get(string uri); - Task Get(string uri, object? query); - Task Post(string uri, object? value); - Task Post(string uri, object? value); - Task Post(string uri); - Task Put(string uri, object? value); - Task Put(string uri); - Task Put(string uri, object? value); - Task Delete(string uri); - Task Delete(string uri); - Task Delete(string uri, ICollection? values); -} \ No newline at end of file diff --git a/src/Common/Wrappers/PagedResponse.cs b/src/Common/Wrappers/PagedResponse.cs deleted file mode 100644 index 0243ef83..00000000 --- a/src/Common/Wrappers/PagedResponse.cs +++ /dev/null @@ -1,26 +0,0 @@ -using XClaim.Common.Helpers; - -namespace XClaim.Common.Wrappers; - -public class PagedResponse : Response { - public PagedResponse() { } - - public PagedResponse(T? data, int total, PaginationFilter filter) { - this.Data = data; - this.Message = string.Empty; - this.Total = total; - this.Page = filter.Page; - this.PerPage = filter.PerPage; - } - - public int Page { get; set; } - public int PerPage { get; set; } - public int Total { get; set; } - - public int TotalPages { - get { - var total = ((double)this.Total / this.PerPage); - return Convert.ToInt32(Math.Ceiling(total)); - } - } -} \ No newline at end of file diff --git a/src/Common/Wrappers/Response.cs b/src/Common/Wrappers/Response.cs deleted file mode 100644 index b57f92fb..00000000 --- a/src/Common/Wrappers/Response.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace XClaim.Common.Wrappers; - -public class Response { - public Response() { } - - public Response(T? data) { - Errors = null; - Data = data; - } - - public T? Data { get; set; } - public bool Succeeded { get; set; } - public string[]? Errors { get; set; } - public string Message { get; set; } = String.Empty; -} \ No newline at end of file diff --git a/src/Common/XClaim.Common.csproj b/src/Common/XClaim.Common.csproj deleted file mode 100644 index 184e87c2..00000000 --- a/src/Common/XClaim.Common.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net7.0 - enable - enable - - - - - - - - diff --git a/src/Mobile/.editorconfig b/src/Mobile/.editorconfig deleted file mode 100644 index 9fc60f8c..00000000 --- a/src/Mobile/.editorconfig +++ /dev/null @@ -1,127 +0,0 @@ -root=true - -[*.{cs,vb,razor}] -#### Naming styles #### - -# Naming rules - -dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion -dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface -dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i - -dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.types_should_be_pascal_case.symbols = types -dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case - -# Symbol specifications - -dotnet_naming_symbols.interface.applicable_kinds = interface -dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interface.required_modifiers = - -dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum -dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = - -# Naming styles - -dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = -dotnet_naming_style.begins_with_i.capitalization = pascal_case -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case -dotnet_style_operator_placement_when_wrapping = beginning_of_line -tab_width = 4 -indent_size = 4 -end_of_line = crlf -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_null_propagation = true:suggestion -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion -dotnet_style_prefer_auto_properties = true:silent -dotnet_style_object_initializer = true:suggestion -dotnet_style_collection_initializer = true:suggestion -dotnet_style_prefer_simplified_boolean_expressions = true:suggestion -dotnet_style_prefer_conditional_expression_over_assignment = true:silent -dotnet_style_prefer_conditional_expression_over_return = true:silent -dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_prefer_inferred_tuple_names = true:suggestion -dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion -dotnet_style_prefer_compound_assignment = true:suggestion -dotnet_style_prefer_simplified_interpolation = true:suggestion -dotnet_style_namespace_match_folder = true:suggestion -dotnet_style_readonly_field = true:suggestion -dotnet_style_predefined_type_for_locals_parameters_members = true:silent -dotnet_style_predefined_type_for_member_access = true:silent -dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent -dotnet_style_allow_multiple_blank_lines_experimental = true:silent -dotnet_style_allow_statement_immediately_after_block_experimental = true:silent -dotnet_code_quality_unused_parameters = all:suggestion -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent -dotnet_style_qualification_for_field = false:silent -dotnet_style_qualification_for_property = false:silent -dotnet_style_qualification_for_method = false:silent -dotnet_style_qualification_for_event = false:silent -insert_final_newline = false - -[*.{cs,vb,razor}] -csharp_indent_labels = one_less_than_current -csharp_using_directive_placement = outside_namespace:silent -csharp_prefer_simple_using_statement = true:suggestion -csharp_prefer_braces = true:silent -csharp_style_namespace_declarations = block_scoped:silent -csharp_style_prefer_method_group_conversion = true:silent -csharp_style_prefer_top_level_statements = true:silent -csharp_style_expression_bodied_methods = false:silent -csharp_style_expression_bodied_constructors = false:silent -csharp_style_expression_bodied_operators = false:silent -csharp_style_expression_bodied_properties = true:silent -csharp_style_expression_bodied_indexers = true:silent -csharp_style_expression_bodied_accessors = true:silent -csharp_style_expression_bodied_lambdas = true:silent -csharp_style_expression_bodied_local_functions = false:silent -csharp_space_around_binary_operators = before_and_after -csharp_style_throw_expression = true:suggestion -csharp_prefer_simple_default_expression = true:suggestion -csharp_style_prefer_null_check_over_type_check = true:suggestion -csharp_style_prefer_index_operator = true:suggestion -csharp_style_prefer_local_over_anonymous_function = true:suggestion -csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion -csharp_style_prefer_range_operator = true:suggestion -csharp_style_prefer_tuple_swap = true:suggestion -csharp_style_prefer_utf8_string_literals = true:suggestion -csharp_style_deconstructed_variable_declaration = true:suggestion -csharp_style_inlined_variable_declaration = true:suggestion -csharp_style_unused_value_expression_statement_preference = discard_variable:silent -csharp_style_unused_value_assignment_preference = discard_variable:suggestion -csharp_prefer_static_local_function = true:suggestion -csharp_style_prefer_readonly_struct = true:suggestion -csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent -csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent -csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent -csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent -csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent -csharp_style_conditional_delegate_call = true:suggestion -csharp_style_prefer_switch_expression = true:suggestion -csharp_style_prefer_pattern_matching = true:silent -csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion -csharp_style_pattern_matching_over_as_with_null_check = true:suggestion -csharp_style_prefer_not_pattern = true:suggestion -csharp_style_prefer_extended_property_pattern = true:suggestion -csharp_style_var_for_built_in_types = false:silent -csharp_style_var_when_type_is_apparent = false:silent -csharp_style_var_elsewhere = false:silent -csharp_new_line_before_open_brace = none \ No newline at end of file diff --git a/src/Mobile/App.xaml b/src/Mobile/App.xaml deleted file mode 100644 index 10c6462b..00000000 --- a/src/Mobile/App.xaml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mobile/App.xaml.cs b/src/Mobile/App.xaml.cs deleted file mode 100644 index 55b16687..00000000 --- a/src/Mobile/App.xaml.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.ComponentModel; -using Microsoft.Maui.Platform; -using XClaim.Mobile.Services; - -namespace XClaim.Mobile; - -public partial class App : Application { - public App(AppShell shell) { - InitializeComponent(); - BuildNativeControls(); - - MainPage = shell; - SetTheme(); - SettingsService.Instance.PropertyChanged += OnSettingsPropertyChanged; - // Routing.RegisterRoute(nameof(PaymentPage), typeof(PaymentPage)); - } - - private void OnSettingsPropertyChanged(object sender, PropertyChangedEventArgs e) { - if (e.PropertyName == nameof(SettingsService.Theme)) SetTheme(); - } - - private void SetTheme() { - UserAppTheme = SettingsService.Instance?.Theme != null - ? SettingsService.Instance.Theme.AppTheme - : AppTheme.Unspecified; - } - - private void BuildNativeControls() { - Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping(nameof(CustomEntry), (handler, view) => { - if (view is CustomEntry) { -#if __ANDROID__ - handler.PlatformView.SetBackgroundColor(Colors.Transparent.ToPlatform()); -#elif __IOS__ - handler.PlatformView.BorderStyle = UIKit.UITextBorderStyle.None; -#endif - } - }); - } - - protected override Window CreateWindow(IActivationState activationState) { - var window = base.CreateWindow(activationState); - const int defaultWidth = 800; - const int defaultHeight = 600; - - window.MinimumHeight = defaultHeight; - window.MaximumHeight = defaultHeight; - window.MinimumWidth = defaultWidth; - window.MaximumWidth = defaultWidth; - - return window; - } -} \ No newline at end of file diff --git a/src/Mobile/AppColors.cs b/src/Mobile/AppColors.cs deleted file mode 100644 index cdeffde2..00000000 --- a/src/Mobile/AppColors.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace XClaim.Mobile; - -public static class AppColors { - // Light mode colors - public static Color Primary { get; set; } = Color.Parse("#4E549C"); - public static Color Secondary { get; set; } = Color.Parse("#919AFA"); - public static Color Accent { get; set; } = Color.Parse("#919AFA"); - public static Color Tertiary { get; set; } = Color.Parse("#EBECF9"); - public static Color Neutral { get; set; } = Color.Parse("#969696"); - public static Color Error { get; set; } = Color.Parse("#C00"); - public static Color Warning { get; set; } = Color.Parse("#FFCC00"); - - // Dark mode colors - public static Color BackgroundDark { get; set; } = Color.Parse("#081B25"); - public static Color BackgroundMid { get; set; } = Color.Parse("#152C39"); - public static Color DarkGray { get; set; } = Color.Parse("#212125"); - public static Color MidGray { get; set; } = Color.Parse("#CFCFD3"); - public static Color LightGray { get; set; } = Color.Parse("#EFEFEF"); - - // Standard colors - public static Color Gray100 { get; set; } = Color.Parse("#E1E1E1"); - public static Color Gray200 { get; set; } = Color.Parse("#C8C8C8"); - public static Color Gray300 { get; set; } = Color.Parse("#ACACAC"); - public static Color Gray400 { get; set; } = Color.Parse("#919191"); - public static Color Gray500 { get; set; } = Color.Parse("#6E6E6E"); - public static Color Gray600 { get; set; } = Color.Parse("#404040"); - public static Color Gray900 { get; set; } = Color.Parse("#212121"); - public static Color Gray950 { get; set; } = Color.Parse("#141414"); - - // Typography colors - public static Color TextLight { get; set; } = Color.Parse("#000000"); - public static Color TextDark { get; set; } = Color.Parse("#FFFFFF"); - public static Color TextOnSolidLight { get; set; } = Color.Parse("#FFFFFF"); - public static Color TextOnSolidDark { get; set; } = Color.Parse("#000000"); - public static Color TextSecondaryLight { get; set; } = Color.Parse("#1d1d1d"); - public static Color TextSecondaryDark { get; set; } = Color.Parse("#f1f1f1"); -} \ No newline at end of file diff --git a/src/Mobile/AppConst.cs b/src/Mobile/AppConst.cs deleted file mode 100644 index 0f510c79..00000000 --- a/src/Mobile/AppConst.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace XClaim.Mobile; - -public static class AppConst { - // Auth details - public const string AppId = "xclaim"; - public const string AppUId = "dev.gpproton.xclaim"; - public static readonly string BaseAddress = DeviceInfo.Platform == DevicePlatform.Android - ? "https://10.0.2.2:7001" : "https://localhost:7001"; - public static readonly string AuthUri = $"{BaseAddress}/auth/sign-in/mobile"; - - // Shared constants - public const string Naira = "₦"; - public const string WelcomeGreeting = "Get Started"; - public const string EmptyListText = "No item to display"; - public const string DateTitleText = "Select date range"; - public const string DateStartText = "Start Date"; - public const string DateEndText = "End Date"; - - // Home view constants - public const string HomeGreeting = "Hello"; - public const string HomeCardText = "Pending Claims"; - public const string HomeRecentTitle = "Recents"; - public const string HomeRecentLink = "See all"; - public const string HomeActionText = "New Claim"; -} \ No newline at end of file diff --git a/src/Mobile/AppShell.cs b/src/Mobile/AppShell.cs deleted file mode 100644 index 4c896684..00000000 --- a/src/Mobile/AppShell.cs +++ /dev/null @@ -1,97 +0,0 @@ -using XClaim.Mobile.Views.Profile; -using XClaim.Mobile.Views.Review; -using XClaim.Mobile.Views.Startup; -using XClaim.Mobile.Views.Claim; -using XClaim.Mobile.Views.Home; -using XClaim.Mobile.Views.Payment; - -namespace XClaim.Mobile; - -public class AppShell : Shell { - public AppShell(AppShellViewModel vm) { - FlyoutBehavior = FlyoutBehavior.Disabled; - BindingContext = vm; - - Items.Add(new ShellContent { - FlyoutItemIsVisible = false, - Route = nameof(LoadingView), - ContentTemplate = new DataTemplate(typeof(LoadingView)) - }); - - Items.Add(new ShellContent { - FlyoutItemIsVisible = false, - Route = nameof(AuthView), - ContentTemplate = new DataTemplate(typeof(AuthView)) - }); - - var tabItems = new TabBar { - Items = { - new Tab { - Title = "Home", - Icon = Icons.Home, - Items = { - new ShellContent { - Route = nameof(HomeView), - ContentTemplate = new DataTemplate(typeof(HomeView)) - } - } - }, - new Tab { - Title = "Claims", - Icon = Icons.Claim, - Items = { - new ShellContent { - Route = nameof(ClaimView), - ContentTemplate = new DataTemplate(typeof(ClaimView)) - } - } - }, - new Tab { - Title = "Payments", - Icon = Icons.Payment, - Items = { - new ShellContent { - Route = nameof(PaymentView), - ContentTemplate = new DataTemplate(typeof(PaymentView)) - } - } - } - } - }; - if (tabItems == null) throw new ArgumentNullException(nameof(tabItems)); - - tabItems.Items.Add(new Tab { - Title = "Review", - Icon = Icons.Review, - Items = { - new ShellContent { - Route = nameof(ReviewView), - ContentTemplate = new DataTemplate(typeof(ReviewView)) - } - } - }); - - Items.Add(tabItems); - - Items.Add(new ShellContent { - FlyoutItemIsVisible = false, - Route = $"{nameof(HomeView)}/{nameof(NotificationView)}", - ContentTemplate = new DataTemplate(typeof(NotificationView)) - }); - - Items.Add(new ShellContent { - FlyoutItemIsVisible = false, - Route = nameof(ProfileView), - ContentTemplate = new DataTemplate(typeof(ProfileView)) - }); - } - - private void MobileShell() { } - - private void DesktopShell() { } -} - -public partial class AppShellViewModel : BaseViewModel { - [RelayCommand] - private void SignOut() { } -} \ No newline at end of file diff --git a/src/Mobile/Components/DateRangePop.cs b/src/Mobile/Components/DateRangePop.cs deleted file mode 100644 index 90e72ccb..00000000 --- a/src/Mobile/Components/DateRangePop.cs +++ /dev/null @@ -1,39 +0,0 @@ -using MauiPopup.Views; - -namespace XClaim.Mobile.Components; - -public partial class DateRangePop : BasePopupPage { - [BindableProp(DefaultBindingMode = (int)BindingMode.TwoWay)] - private DateTime _startDate = DateTime.Now.AddDays(-7); - - [BindableProp(DefaultBindingMode = (int)BindingMode.TwoWay)] - private DateTime _endDate = DateTime.Now; - - public DateRangePop() { - HorizontalOptions = LayoutOptions.Fill; - VerticalOptions = LayoutOptions.End; - BackgroundColor = Colors.Transparent; - Content = new VerticalStackLayout { - Padding = 8, - Spacing = 5, - MinimumHeightRequest = 150, - HorizontalOptions = LayoutOptions.Fill, - Children = { - new Label { TextColor = AppColors.Primary }.Text(AppConst.DateTitleText) - .Font(size: 18) - .CenterHorizontal() - .Margins(0, 1, 0, 2), - - new DatePickerField { TextColor = AppColors.Primary, Title = AppConst.DateStartText, Format = "yyyy-MMMM-dd", AllowClear = false } - .Bind(DatePickerField.DateProperty, nameof(StartDate), source: this, mode: BindingMode.TwoWay) - .Margins(0, 8, 0, 0) - .FillHorizontal(), - - new DatePickerField { TextColor = AppColors.Primary, Title = AppConst.DateEndText, Format = "yyyy-MMMM-dd", AllowClear = false } - .Bind(DatePickerField.DateProperty, nameof(EndDate), source: this, mode: BindingMode.TwoWay) - .Margins(0, 8, 0, 0) - .FillHorizontal() - } - }; - } -} \ No newline at end of file diff --git a/src/Mobile/Components/EmptyItemView.cs b/src/Mobile/Components/EmptyItemView.cs deleted file mode 100644 index 0bad819b..00000000 --- a/src/Mobile/Components/EmptyItemView.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace XClaim.Mobile.Components; - -public class EmptyItemView : ContentView { - public EmptyItemView() { - Build(); - } - - private void Build() { - Content = new StackLayout { - Children = { - new Image().Source(Icons.EmptyBanner) - .Height(165) - .CenterHorizontal(), - new Label { TextColor = AppColors.Primary }.Text("No data to display") - .Font(size: 18) - .Margins(0, 24) - .CenterHorizontal() - } - }.Padding(24); - } -} \ No newline at end of file diff --git a/src/Mobile/Components/FilterToolbarView.cs b/src/Mobile/Components/FilterToolbarView.cs deleted file mode 100644 index e88ff498..00000000 --- a/src/Mobile/Components/FilterToolbarView.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Microsoft.Maui.Controls.Shapes; -using XClaim.Common.Extensions; - -namespace XClaim.Mobile.Components; - -public partial class FilterToolbarView : Grid { - private static Page CurrentPage => Application.Current?.MainPage ?? throw new NullReferenceException(); - -#pragma warning disable IDE0051 -#pragma warning disable CS0169 - [BindableProp(DefaultBindingMode = (int)BindingMode.TwoWay)] - private string _search = string.Empty; - - [BindableProp(DefaultBindingMode = (int)BindingMode.TwoWay)] - private bool _showSearch = false; - - [BindableProp(DefaultBindingMode = (int)BindingMode.TwoWay)] - private DateTime _startDate = DateTime.Now.AddDays(-7); - - [BindableProp(DefaultBindingMode = (int)BindingMode.TwoWay)] - private DateTime _endDate = DateTime.Now; - - private enum FrameColumn { - First, - Second, - Third - } - - public FilterToolbarView() { - Build(); - } - - private void Build() { - Margin = new Thickness { Top = 4, Left = 0, Right = 0, Bottom = 0 }; - ColumnDefinitions = Columns.Define( - (FrameColumn.First, Star), - (FrameColumn.Second, Auto) - ); - - Children.Add(new Border { - Content = new Grid { - ColumnDefinitions = Columns.Define( - (FrameColumn.First, Star), - (FrameColumn.Second, Auto) - ), - Children = { - new Grid { - ColumnDefinitions = Columns.Define( - (FrameColumn.First, Auto), - (FrameColumn.Second, Star), - (FrameColumn.Third, Auto) - ), - Children = { - new Label { TextColor = AppColors.Primary } - .Bind(Label.TextProperty, nameof(StartDate), - source: this, - convert: (DateTime time) => time.ToDateOnly().ToString("dd MMM yyyy") - ).CenterVertical() - .Column(FrameColumn.First), - new Rectangle { BackgroundColor = AppColors.Primary } - .Size(12, 4) - .Center() - .Margins(4, 0, 4, 0) - .Column(FrameColumn.Second), - new Label { TextColor = AppColors.Primary } - .CenterVertical() - .Bind(Label.TextProperty, - nameof(EndDate), - source: this, - convert: (DateTime time) => time.ToDateOnly().ToString("dd MMM yyyy") - ).Column(FrameColumn.Third) - } - }.CenterVertical() - .Column(FrameColumn.First) - } - } - }.Style(SharedStyle.BoxFormField) - .Bind(IsVisibleProperty, nameof(ShowSearch), source: this, convert: (bool value) => !value) - .TapGesture(async () => await MauiPopup.PopupAction.DisplayPopup(new DateRangePop() - .Bind(DateRangePop.StartDateProperty, nameof(StartDate), source: this) - .Bind(DateRangePop.EndDateProperty, nameof(EndDate), source: this)) - )); - - Children.Add(new Grid { - Children = { - new Border().Style(SharedStyle.BoxFormField), - new TextField { Keyboard = Keyboard.Text, BorderColor = Colors.Transparent } - .Bind(TextField.TextProperty, nameof(Search), source: this) - } - }.Bind(IsVisibleProperty, nameof(ShowSearch), source: this)); - } -} \ No newline at end of file diff --git a/src/Mobile/Components/Gradients.cs b/src/Mobile/Components/Gradients.cs deleted file mode 100644 index 6ca9a0a2..00000000 --- a/src/Mobile/Components/Gradients.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace XClaim.Mobile.Components; - -internal static class Gradients { - internal static LinearGradientBrush AppGradient => new() { - StartPoint = new Point(0, 0), - EndPoint = new Point(1, 0), - GradientStops = { - new GradientStop { - Offset = 0.1F, - Color = AppColors.Primary - }, - new GradientStop { - Offset = 1.0F, - Color = AppColors.Secondary - } - } - }; -} \ No newline at end of file diff --git a/src/Mobile/Components/Segment.xaml b/src/Mobile/Components/Segment.xaml deleted file mode 100644 index 7d655a50..00000000 --- a/src/Mobile/Components/Segment.xaml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - 10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -