From b72bc256930ff6992c9b1f41127906cc00bad51f Mon Sep 17 00:00:00 2001 From: "Godwin peter .O" Date: Tue, 2 Apr 2024 15:16:02 +0100 Subject: [PATCH 01/25] revert changes --- .config/dotnet-tools.json | 2 +- XClaim.sln | 67 + XClaim.sln.DotSettings | 8 + global.json | 12 +- src/Common/Base/BaseEntity.cs | 7 + src/Common/Base/BaseResponse.cs | 7 + src/Common/Base/IBaseEntity.cs | 5 + src/Common/Base/ITimeEntity.cs | 8 + src/Common/Base/TimedEntity.cs | 7 + src/Common/Dtos/AuthResponse.cs | 12 + src/Common/Dtos/BankAccountResponse.cs | 13 + src/Common/Dtos/BankResponse.cs | 10 + src/Common/Dtos/CategoryResponse.cs | 12 + src/Common/Dtos/ClaimResponse.cs | 26 + src/Common/Dtos/ClaimStateResponse.cs | 19 + src/Common/Dtos/CommentResponse.cs | 10 + src/Common/Dtos/CompanyResponse.cs | 12 + src/Common/Dtos/CurrencyResponse.cs | 13 + src/Common/Dtos/DomainResponse.cs | 9 + src/Common/Dtos/EventResponse.cs | 11 + src/Common/Dtos/FileResponse.cs | 10 + src/Common/Dtos/NotificationResponse.cs | 12 + src/Common/Dtos/PaymentResponse.cs | 20 + src/Common/Dtos/PaymentStateResponse.cs | 15 + src/Common/Dtos/ProfileResponse.cs | 21 + src/Common/Dtos/ServerResponse.cs | 12 + src/Common/Dtos/ServerStateResponse.cs | 5 + src/Common/Dtos/SettingResponse.cs | 11 + src/Common/Dtos/TeamResponse.cs | 13 + src/Common/Dtos/TransferRequestItem.cs | 12 + src/Common/Dtos/TransferRequestResponse.cs | 11 + src/Common/Dtos/UserResponse.cs | 30 + src/Common/Enums/AppLanguage.cs | 7 + src/Common/Enums/ClaimPriority.cs | 10 + src/Common/Enums/ClaimStatus.cs | 11 + src/Common/Enums/EventType.cs | 14 + src/Common/Enums/NotificationChannels.cs | 14 + src/Common/Enums/UserPermission.cs | 15 + src/Common/Extensions/DateTimeExtensions.cs | 31 + .../Extensions/LazyResolutionExtension.cs | 19 + src/Common/Extensions/NameValueExtensions.cs | 17 + src/Common/Extensions/ObjectExtensions.cs | 14 + src/Common/Extensions/StringExtensions.cs | 8 + src/Common/HTTP/BankService.cs | 32 + src/Common/HTTP/CategoryService.cs | 32 + src/Common/HTTP/ClaimService.cs | 61 + src/Common/HTTP/CompanyService.cs | 32 + src/Common/HTTP/CurrencyService.cs | 32 + src/Common/HTTP/DomainService.cs | 33 + src/Common/HTTP/EventService.cs | 21 + src/Common/HTTP/HttpServiceExtensions.cs | 25 + src/Common/HTTP/IBankService.cs | 18 + src/Common/HTTP/ICategoryService.cs | 18 + src/Common/HTTP/IClaimService.cs | 33 + src/Common/HTTP/ICompanyService.cs | 18 + src/Common/HTTP/ICurrencyService.cs | 18 + src/Common/HTTP/IDomainService.cs | 18 + src/Common/HTTP/IEventService.cs | 8 + src/Common/HTTP/IPaymentService.cs | 24 + src/Common/HTTP/IProfileService.cs | 17 + src/Common/HTTP/IServerService.cs | 9 + src/Common/HTTP/ITeamService.cs | 18 + src/Common/HTTP/IUserService.cs | 25 + src/Common/HTTP/PaymentService.cs | 49 + src/Common/HTTP/ProfileService.cs | 40 + src/Common/HTTP/ServerService.cs | 20 + src/Common/HTTP/TeamService.cs | 33 + src/Common/HTTP/UserService.cs | 51 + src/Common/Helpers/DateSearchFilter.cs | 6 + src/Common/Helpers/FactoryLoader.cs | 11 + src/Common/Helpers/PaginationFilter.cs | 8 + src/Common/Helpers/SearchFilter.cs | 5 + src/Common/Helpers/StringConverter.cs | 18 + src/Common/Helpers/StringHelpers.cs | 18 + src/Common/Service/AbstractHttpService.cs | 129 ++ src/Common/Service/IHttpService.cs | 17 + src/{common/shared => Common}/SharedConst.cs | 4 +- src/Common/Wrappers/PagedResponse.cs | 26 + src/Common/Wrappers/Response.cs | 15 + src/Common/XClaim.Common.csproj | 14 + src/Mobile/.editorconfig | 127 ++ src/Mobile/App.xaml | 21 + src/Mobile/App.xaml.cs | 52 + src/Mobile/AppColors.cs | 37 + src/Mobile/AppConst.cs | 25 + src/Mobile/AppShell.cs | 97 + src/Mobile/Components/DateRangePop.cs | 39 + src/Mobile/Components/EmptyItemView.cs | 21 + src/Mobile/Components/FilterToolbarView.cs | 92 + src/Mobile/Components/Gradients.cs | 18 + src/Mobile/Components/Segment.xaml | 63 + src/Mobile/Components/Segment.xaml.cs | 25 + src/Mobile/DataConst.cs | 17 + src/Mobile/Extensions/Layouts/ColumnLayout.cs | 28 + .../Extensions/Layouts/ColumnLayoutManager.cs | 60 + src/Mobile/Extensions/ViewExtension.cs | 9 + src/Mobile/Globals.cs | 17 + src/Mobile/Handlers/CustomEntry.cs | 3 + src/Mobile/HotReloadService.cs | 15 + src/Mobile/HttpsClientHandlerService.cs | 32 + src/Mobile/MauiProgram.cs | 80 + src/Mobile/Models/BaseModel.cs | 9 + src/Mobile/Models/Events.cs | 5 + src/Mobile/Models/Icons.cs | 15 + src/Mobile/Models/Theme.cs | 21 + .../Platforms/Android/AndroidManifest.xml | 28 + src/Mobile/Platforms/Android/MainActivity.cs | 10 + .../Platforms/Android/MainApplication.cs | 14 + .../Android/Resources/values/colors.xml | 6 + .../Resources/xml/network_security_config.xml | 6 + .../WebAuthenticationCallbackActivity.cs | 18 + .../Platforms/MacCatalyst/AppDelegate.cs | 9 + src/Mobile/Platforms/MacCatalyst/Info.plist | 38 + src/Mobile/Platforms/MacCatalyst/Program.cs | 15 + src/Mobile/Platforms/Tizen/Main.cs | 16 + src/Mobile/Platforms/Tizen/tizen-manifest.xml | 17 + src/Mobile/Platforms/Windows/App.xaml | 8 + src/Mobile/Platforms/Windows/App.xaml.cs | 21 + .../Platforms/Windows/Package.appxmanifest | 51 + src/Mobile/Platforms/Windows/app.manifest | 16 + src/Mobile/Platforms/iOS/AppDelegate.cs | 8 + src/Mobile/Platforms/iOS/Info.plist | 58 + src/Mobile/Platforms/iOS/Program.cs | 13 + src/Mobile/Properties/launchSettings.json | 8 + src/Mobile/Resources/AppIcon/appicon.svg | 10 + src/Mobile/Resources/AppIcon/appiconfg.svg | 17 + .../Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107160 bytes .../Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111048 bytes src/Mobile/Resources/Fonts/Roboto-Bold.ttf | Bin 0 -> 167336 bytes src/Mobile/Resources/Fonts/Roboto-Medium.ttf | Bin 0 -> 168644 bytes src/Mobile/Resources/Fonts/Roboto-Regular.ttf | Bin 0 -> 168260 bytes src/Mobile/Resources/Fonts/Roboto-Thin.ttf | Bin 0 -> 168488 bytes src/Mobile/Resources/Images/apple_icon.svg | 4 + src/Mobile/Resources/Images/auth_vector.svg | 70 + .../Resources/Images/chevron_left_solid.svg | 4 + src/Mobile/Resources/Images/empty_banner.svg | 19 + src/Mobile/Resources/Images/google_icon.svg | 11 + src/Mobile/Resources/Images/icon_claim.svg | 4 + src/Mobile/Resources/Images/icon_home.svg | 5 + src/Mobile/Resources/Images/icon_payment.svg | 4 + src/Mobile/Resources/Images/icon_review.svg | 4 + .../Resources/Images/microsoft_icon.svg | 4 + .../Resources/Images/money_payments.svg | 219 +++ src/Mobile/Resources/Images/money_savings.svg | 51 + .../Resources/Images/welcome_vector.svg | 136 ++ src/Mobile/Resources/Raw/AboutAssets.txt | 15 + src/Mobile/Resources/Splash/splash.svg | 17 + src/Mobile/Resources/Styles/Colors.xaml | 60 + src/Mobile/Resources/Styles/Custom.xaml | 17 + src/Mobile/Resources/Styles/Default.xaml | 432 ++++ src/Mobile/Resources/Styles/Styles.xaml | 52 + src/Mobile/Services/HttpService.cs | 16 + src/Mobile/Services/SettingsService.cs | 12 + src/Mobile/Styles/AppFonts.cs | 9 + src/Mobile/Styles/ButtonStyle.cs | 27 + src/Mobile/Styles/SharedStyle.cs | 21 + src/Mobile/Views/BaseView.cs | 60 + src/Mobile/Views/Claim/ClaimDetailView.cs | 102 + src/Mobile/Views/Claim/ClaimFormView.cs | 207 ++ src/Mobile/Views/Claim/ClaimView.cs | 198 ++ .../Views/Home/Component/HomeEventPop.cs | 64 + src/Mobile/Views/Home/HomeView.cs | 241 +++ src/Mobile/Views/Home/NotificationView.cs | 117 ++ .../Views/Payment/Component/PaymentPop.cs | 65 + src/Mobile/Views/Payment/PaymentView.cs | 154 ++ src/Mobile/Views/Profile/AlertsView.cs | 16 + src/Mobile/Views/Profile/BankView.cs | 62 + src/Mobile/Views/Profile/HelpView.cs | 16 + src/Mobile/Views/Profile/LogView.cs | 16 + src/Mobile/Views/Profile/ProfileView.cs | 160 ++ src/Mobile/Views/Profile/SettingView.cs | 43 + src/Mobile/Views/Profile/ThemeView.cs | 16 + src/Mobile/Views/Review/ReviewActionView.cs | 104 + src/Mobile/Views/Review/ReviewView.cs | 160 ++ src/Mobile/Views/Startup/AuthView.cs | 65 + src/Mobile/Views/Startup/ConfigView.cs | 15 + src/Mobile/Views/Startup/LoadingView.cs | 31 + src/Mobile/Views/Startup/VerifyAccountView.cs | 13 + src/Mobile/Views/Startup/WelcomeView.cs | 50 + src/Mobile/XClaim.Mobile.csproj | 63 + src/Mobile/XClaim.Mobile.sln | 32 + src/Web/.editorconfig | 127 ++ src/Web/Client/App.razor | 84 + src/Web/Client/Handler/CookieHandler.cs | 11 + src/Web/Client/Properties/launchSettings.json | 22 + src/Web/Client/wwwroot/css/app.css | 73 + .../Client}/wwwroot/favicon.png | Bin .../Client}/wwwroot/icon-192.png | Bin .../Client}/wwwroot/icon-512.png | Bin src/Web/Client/wwwroot/index.html | 38 + src/Web/Client/wwwroot/manifest.json | 21 + src/Web/Client/wwwroot/service-worker.js | 5 + .../wwwroot/service-worker.published.js | 48 + src/Web/Components/.editorconfig | 200 ++ .../Components/Controls/ArchiveDialog.razor | 25 + .../Components/Controls/CommentViewer.razor | 5 + .../Controls/ConfirmationDialog.razor | 53 + src/Web/Components/Controls/DateDialog.razor | 23 + src/Web/Components/Controls/FileUpload.razor | 79 + src/Web/Components/Controls/FileViewer.razor | 5 + src/Web/Components/Controls/FormDialog.razor | 43 + .../Components/Controls/FormEditTrigger.razor | 37 + .../Components/Controls/TableLoading.razor | 7 + .../Components/Controls/TableToolbar.razor | 92 + .../Extensions/ComponentServiceExtensions.cs | 11 + src/Web/Components/Layouts/RootLayout.razor | 26 + .../Pages/Account/BankAccount.razor | 87 + src/Web/Components/Pages/Account/Index.razor | 10 + src/Web/Components/Pages/Account/Layout.razor | 37 + .../Pages/Account/Notification.razor | 115 ++ .../Components/Pages/Account/Profile.razor | 109 + .../Components/Pages/Account/Settings.razor | 149 ++ .../Components/Pages/Account/_Imports.razor | 1 + src/Web/Components/Pages/Claims/Index.razor | 92 + .../Components/Pages/Claims/MutateClaim.razor | 152 ++ src/Web/Components/Pages/Help/Index.razor | 11 + src/Web/Components/Pages/Help/_Imports.razor | 1 + src/Web/Components/Pages/Index.razor | 8 + .../Components/Pages/Manage/Bank/Index.razor | 77 + .../Pages/Manage/Bank/MutateBank.razor | 85 + .../Pages/Manage/Category/Index.razor | 82 + .../Manage/Category/MutateCategory.razor | 108 + .../Pages/Manage/Company/Index.razor | 86 + .../Pages/Manage/Company/MutateCompany.razor | 104 + .../Pages/Manage/Currency/Index.razor | 74 + .../Manage/Currency/MutateCurrency.razor | 88 + .../Pages/Manage/Domains/Index.razor | 75 + .../Pages/Manage/Domains/MutateDomain.razor | 83 + src/Web/Components/Pages/Manage/Index.razor | 10 + .../Pages/Manage/ManageLayout.razor | 39 + .../Components/Pages/Manage/Teams/Index.razor | 89 + .../Pages/Manage/Teams/MutateTeam.razor | 125 ++ src/Web/Components/Pages/Overview/Index.razor | 33 + src/Web/Components/Pages/Payments/Index.razor | 72 + .../Pages/Reviews/ClaimDetails.razor | 141 ++ src/Web/Components/Pages/Reviews/Index.razor | 85 + .../Pages/Reviews/MutateReview.razor | 53 + src/Web/Components/Pages/Settings/Index.razor | 15 + .../Components/Pages/Settings/Server.razor | 81 + src/Web/Components/Pages/Startup/Auth.razor | 39 + .../Pages/Startup/Registration.razor | 127 ++ .../Components/Pages/Startup/_Imports.razor | 1 + .../Components/DetailTransaction.razor | 47 + .../Components/MutateTransaction.razor | 79 + .../Components/TransactionUser.razor | 4 + .../Components/Pages/Transactions/Index.razor | 82 + .../Pages/User/Components/MutateUser.razor | 164 ++ src/Web/Components/Pages/User/Index.razor | 95 + src/Web/Components/Pages/User/Layout.razor | 35 + .../Pages/User/TransferRequest.razor | 99 + src/Web/Components/Pages/User/_Imports.razor | 1 + src/Web/Components/Shared/ErrorFound.razor | 12 + src/Web/Components/Shared/NotAuthorized.razor | 18 + .../Web/Components/wwwroot}/.gitkeep | 0 src/Web/Server/Constants.cs | 7 + .../Converters/CollectionValueComparer.cs | 10 + .../EnumCollectionJsonValueConverter.cs | 13 + .../Server/Converters/JsonValueConverter.cs | 9 + src/Web/Server/Data/DbInitializer.cs | 85 + src/Web/Server/Data/ServerContext.cs | 64 + src/Web/Server/Data/ServerContextExtention.cs | 56 + .../Server/Data/SoftDeleteQueryExtension.cs | 27 + src/Web/Server/Entities/AuditHistory.cs | 5 + src/Web/Server/Entities/BankAccountEntity.cs | 18 + src/Web/Server/Entities/BankEntity.cs | 15 + src/Web/Server/Entities/CategoryEntity.cs | 16 + src/Web/Server/Entities/ClaimEntity.cs | 40 + src/Web/Server/Entities/CommentEntity.cs | 15 + src/Web/Server/Entities/CompanyEntity.cs | 18 + src/Web/Server/Entities/CurrencyEntity.cs | 18 + src/Web/Server/Entities/DomainEntity.cs | 9 + src/Web/Server/Entities/EventEntity.cs | 16 + src/Web/Server/Entities/FileEntity.cs | 20 + src/Web/Server/Entities/NotificationEntity.cs | 12 + src/Web/Server/Entities/PaymentEntity.cs | 24 + src/Web/Server/Entities/ServerEntity.cs | 12 + src/Web/Server/Entities/SettingEntity.cs | 11 + src/Web/Server/Entities/TeamEntity.cs | 16 + .../Server/Entities/TransferRequestEntity.cs | 11 + src/Web/Server/Entities/UserEntity.cs | 40 + .../Extensions/DatabaseSetupExtension.cs | 35 + .../Server/Extensions/SessionExtensions.cs | 16 + src/Web/Server/Helpers/ClaimStateResolver.cs | 138 ++ src/Web/Server/Helpers/ConfigHelper.cs | 27 + src/Web/Server/Helpers/DatabaseType.cs | 7 + .../Helpers/FileUploadOperationFilter.cs | 24 +- src/Web/Server/Helpers/FileUploadService.cs | 50 + src/Web/Server/Helpers/IdentityHelper.cs | 178 ++ src/Web/Server/IModule.cs | 33 + src/Web/Server/MapperProfile.cs | 31 + .../20240402132135_Initial.Designer.cs} | 1748 +++++++++-------- .../Migrations/20240402132135_Initial.cs} | 799 ++++---- .../Migrations/ServerContextModelSnapshot.cs} | 1748 +++++++++-------- .../Modules/AnalysisModule/AnalysisModule.cs | 17 + .../Modules/AnalysisModule/AnalysisService.cs | 17 + .../AnalysisModule/IAnalysisService.cs | 9 + .../Server/Modules/AuthModule/AuthModule.cs | 75 + .../Server/Modules/BankModule/BankFilter.cs | 10 + .../Server/Modules/BankModule/BankModule.cs | 51 + .../Server/Modules/BankModule/BankService.cs | 10 + .../Server/Modules/BankModule/IBankService.cs | 5 + .../Modules/CategoryModule/CategoryFilter.cs | 10 + .../Modules/CategoryModule/CategoryModule.cs | 50 + .../Modules/CategoryModule/CategoryService.cs | 96 + .../Server/Modules/ClaimModule/ClaimFilter.cs | 23 + .../Server/Modules/ClaimModule/ClaimModule.cs | 106 + .../Modules/ClaimModule/ClaimService.cs | 300 +++ .../Modules/ClaimModule/IClaimService.cs | 21 + .../Modules/CompanyModule/CompanyFilter.cs | 10 + .../Modules/CompanyModule/CompanyModule.cs | 50 + .../Modules/CompanyModule/CompanyService.cs | 64 + .../Modules/CurrencyModule/CurrencyFilter.cs | 10 + .../Modules/CurrencyModule/CurrencyModule.cs | 50 + .../Modules/CurrencyModule/CurrencyService.cs | 10 + .../Modules/DomainModule/DomainFilter.cs | 10 + .../Modules/DomainModule/DomainModule.cs | 50 + .../Modules/DomainModule/DomainService.cs | 10 + .../Server/Modules/EventModule/EventFilter.cs | 15 + .../Server/Modules/EventModule/EventModule.cs | 27 + .../Modules/EventModule/EventService.cs | 24 + .../Modules/EventModule/IEventService.cs | 11 + src/Web/Server/Modules/GenericEndpoint.cs | 40 + src/Web/Server/Modules/GenericFilter.cs | 12 + src/Web/Server/Modules/GenericService.cs | 140 ++ src/Web/Server/Modules/IService.cs | 24 + .../Modules/PaymentModule/IPaymentService.cs | 29 + .../Modules/PaymentModule/PaymentFilter.cs | 19 + .../Modules/PaymentModule/PaymentModule.cs | 52 + .../Modules/PaymentModule/PaymentService.cs | 241 +++ .../Modules/ProfileModule/IProfileService.cs | 15 + .../Modules/ProfileModule/ProfileModule.cs | 52 + .../Modules/ProfileModule/ProfileService.cs | 195 ++ .../Modules/ServerModule/ServerModule.cs | 28 + .../Modules/ServerModule/ServerService.cs | 83 + src/Web/Server/Modules/SharedModule.cs | 26 + .../Server/Modules/TeamModule/TeamFilter.cs | 11 + .../Server/Modules/TeamModule/TeamModule.cs | 50 + .../Server/Modules/TeamModule/TeamService.cs | 97 + .../Server/Modules/UserModule/IUserService.cs | 14 + .../UserModule/TransferRequestFilter.cs | 14 + .../Server/Modules/UserModule/UserFilter.cs | 11 + .../Server/Modules/UserModule/UserModule.cs | 79 + .../Server/Modules/UserModule/UserService.cs | 271 +++ src/Web/Server/Pages/Error.cshtml | 41 + src/Web/Server/Pages/Error.cshtml.cs | 23 + src/Web/Server/Program.cs | 160 ++ src/Web/Server/Properties/launchSettings.json | 23 + src/Web/Server/XClaim.Web.Server.csproj | 65 + src/Web/Server/config.Development.ini | 11 + src/Web/Server/config.ini | 9 + .../Shared}/States/AppState.cs | 12 +- .../Shared}/States/AuthState.cs | 23 +- .../Shared}/States/RootState.cs | 2 +- src/Web/Shared/States/ThemeState.cs | 37 + src/Web/XClaim.Web.sln | 49 + src/common/context/GenericRepository.cs | 20 - src/common/context/IdentitySetup.cs | 25 - src/common/context/ServiceContext.cs | 129 -- .../context/XClaim.Common.Context.csproj | 24 - src/common/entity/AccountEntity.cs | 35 - src/common/entity/AuditEntity.cs | 16 - src/common/entity/BankAccountEntity.cs | 24 - src/common/entity/BankEntity.cs | 23 - src/common/entity/CategoryEntity.cs | 23 - src/common/entity/ClaimEntity.cs | 46 - src/common/entity/CommentEntity.cs | 24 - src/common/entity/CompanyEntity.cs | 24 - src/common/entity/CurrencyEntity.cs | 26 - src/common/entity/DomainEntity.cs | 19 - src/common/entity/EventEntity.cs | 25 - src/common/entity/FileEntity.cs | 26 - src/common/entity/NotificationEntity.cs | 23 - src/common/entity/PaymentEntity.cs | 30 - src/common/entity/ProfileEntity.cs | 34 - src/common/entity/ProfileTransferEntity.cs | 22 - src/common/entity/ServerEntity.cs | 23 - src/common/entity/SettingsEntity.cs | 22 - src/common/entity/TeamEntity.cs | 25 - src/common/entity/XClaim.Common.Entity.csproj | 20 - src/common/http/Account/IProfileService.cs | 27 - src/common/http/Resources/IBankService.cs | 14 - src/common/http/XClaim.Common.Http.csproj | 17 - src/common/shared/Base/AuditableResponse.cs | 25 - src/common/shared/Base/BaseResponse.cs | 19 - src/common/shared/Enums/AppLanguage.cs | 17 - src/common/shared/Enums/ClaimPriority.cs | 19 - src/common/shared/Enums/ClaimStatus.cs | 21 - src/common/shared/Enums/EventType.cs | 23 - .../shared/Enums/NotificationChannels.cs | 20 - src/common/shared/Enums/UserPermission.cs | 23 - src/common/shared/Responses/AuthResponse.cs | 24 - src/common/shared/Responses/Bank.cs | 20 - src/common/shared/Responses/BankAccount.cs | 23 - src/common/shared/Responses/Category.cs | 22 - src/common/shared/Responses/ClaimResponse.cs | 45 - src/common/shared/Responses/Comment.cs | 23 - src/common/shared/Responses/Company.cs | 23 - src/common/shared/Responses/Currency.cs | 22 - src/common/shared/Responses/Domain.cs | 19 - src/common/shared/Responses/EventResponse.cs | 24 - src/common/shared/Responses/FileResponse.cs | 20 - src/common/shared/Responses/Notification.cs | 22 - src/common/shared/Responses/Payment.cs | 29 - src/common/shared/Responses/Profile.cs | 16 - .../shared/Responses/ProfileTransfer.cs | 21 - src/common/shared/Responses/Server.cs | 22 - src/common/shared/Responses/Settings.cs | 21 - src/common/shared/Responses/Team.cs | 24 - src/common/shared/Responses/User.cs | 43 - src/common/shared/XClaim.Common.csproj | 13 - src/migration/postgres/Marker.cs | 13 - .../postgres/XClaim.Migrate.Postgres.csproj | 29 - src/migration/sqlite/Marker.cs | 13 - .../sqlite/XClaim.Migrate.Sqlite.csproj | 29 - src/service/Components/ServerApp.razor | 31 - src/service/Components/_Imports.razor | 14 - src/service/Constants.cs | 17 - src/service/Data/DatabaseExtensions.cs | 42 - src/service/Data/MigrationService.cs | 43 - src/service/Data/Provider.cs | 19 - src/service/Dockerfile | 21 - .../Extensions/AuthenticationExtensions.cs | 54 - src/service/Extensions/CoreAdminExtension.cs | 41 - src/service/Extensions/FileUploadExtension.cs | 59 - .../Extensions/ServiceDefaultExtensions.cs | 81 - src/service/Extensions/SessionExtension.cs | 24 - src/service/Extensions/SwaggerExtensions.cs | 48 - .../Features/AccountModule/AccountFeature.cs | 34 - .../AccountModule/BankAccountFeature.cs | 31 - .../Interfaces/IAccountService.cs | 14 - .../Interfaces/IProfileTransferService.cs | 14 - .../Interfaces/ISettingService.cs | 14 - .../Features/AccountModule/ProfileFeature.cs | 27 - .../AccountModule/ProfileTransferFeature.cs | 36 - .../Features/AccountModule/SettingFeature.cs | 33 - .../Features/AuthModule/AuthFeature.cs | 25 - .../Features/ClaimModule/ClaimFeature.cs | 35 - .../ClaimModule/Interfaces/IClaimService.cs | 14 - .../ClaimModule/Interfaces/IPaymentService.cs | 14 - .../Features/ClaimModule/PaymentFeature.cs | 32 - .../Features/GroupModule/CategoryFeature.cs | 31 - .../Features/GroupModule/CompanyFeature.cs | 31 - .../Interfaces/ICategoryService.cs | 14 - .../GroupModule/Interfaces/ITeamService.cs | 14 - .../Features/GroupModule/TeamFeature.cs | 31 - .../Features/ReportModule/ReportFeature.cs | 23 - .../Features/ResourceModule/BankFeature.cs | 33 - .../Features/ResourceModule/CommentFeature.cs | 30 - .../Features/ResourceModule/EventFeature.cs | 33 - .../Interfaces/ICommentService.cs | 14 - .../Interfaces/INotificationService.cs | 14 - .../ResourceModule/NotificationFeature.cs | 30 - .../Features/ServerModule/CurrencyFeature.cs | 33 - .../Features/ServerModule/DomainFeature.cs | 33 - .../ServerModule/Interfaces/IDomainService.cs | 14 - .../Interfaces/IServiceService.cs | 14 - .../ServerModule/ServerOptionFeature.cs | 26 - src/service/Helpers/FileUploadService.cs | 72 - src/service/Pages/Error.razor | 35 - src/service/Program.cs | 43 - src/service/Properties/launchSettings.json | 38 - src/service/XClaim.Service.csproj | 57 - src/service/appsettings.Development.json | 13 - src/service/appsettings.json | 11 - .../PersistentAuthenticationStateProvider.cs | 33 - src/web/client/Program.cs | 20 +- src/web/client/Routes.razor | 35 - src/web/client/XClaim.Web.Client.csproj | 38 +- src/web/client/_Imports.razor | 15 +- src/web/client/wwwroot/readme.txt | 1 - .../AutoComplete/BankAutoComplete.razor | 70 +- .../AutoComplete/CaimUserAutoComplete.razor | 70 +- .../AutoComplete/CategoryAutoComplete.razor | 69 +- .../AutoComplete/CompanyAutoComplete.razor | 68 +- .../AutoComplete/CurrencyAutoComplete.razor | 68 +- .../AutoComplete/TeamAutoComplete.razor | 69 +- .../AutoComplete/UserAutoComplete.razor | 69 +- src/web/components/ClientApp.razor | 5 - src/web/components/Controls/TestControl.razor | 5 - .../Extensions/ComponentClientExtensions.cs | 30 - .../Extensions/ComponentServerExtensions.cs | 20 - src/web/components/Layouts/AuthLayout.razor | 29 +- src/web/components/Layouts/EmptyLayout.razor | 2 +- src/web/components/Layouts/HelpLayout.razor | 58 +- src/web/components/Layouts/MainLayout.razor | 25 +- .../components/Layouts/MainLayout.razor.css | 98 +- src/web/components/Layouts/RootWrapper.razor | 16 - src/web/components/Navigation.cs | 26 +- src/web/components/Pages/Authentication.razor | 7 - src/web/components/Pages/Home.razor | 6 - src/web/components/Shared/AppBar.razor | 16 +- src/web/components/Shared/ErrorNotFound.razor | 5 - .../components/Shared/ErrorUnAuthorized.razor | 10 - src/web/components/Shared/NavMenu.razor | 100 +- src/web/components/Shared/NavMenu.razor.css | 68 +- .../Shared/RedirectToRegistration.razor | 1 - .../components/Shared/RedirectToSignin.razor | 3 +- src/web/components/Shared/Title.razor | 5 +- .../components/XClaim.Web.Components.csproj | 42 +- src/web/components/_Imports.razor | 12 +- src/web/components/wwwroot/css/app.css | 100 - src/web/shared/AuthProvider.cs | 63 +- src/web/shared/HttpService.cs | 34 +- src/web/shared/SessionStorageExtension.cs | 27 +- src/web/shared/SharedServiceExtensions.cs | 12 +- src/web/shared/WebConst.cs | 13 +- src/web/shared/XClaim.Web.Shared.csproj | 17 +- tests/service/UnitTest1.cs | 17 - tests/service/Usings.cs | 11 - .../XClaim.Service.IntegrationTests.csproj | 21 - x-claim.sln | 113 -- x-claim.sln.DotSettings | 13 - 512 files changed, 17367 insertions(+), 6176 deletions(-) create mode 100644 XClaim.sln create mode 100644 XClaim.sln.DotSettings create mode 100644 src/Common/Base/BaseEntity.cs create mode 100644 src/Common/Base/BaseResponse.cs create mode 100644 src/Common/Base/IBaseEntity.cs create mode 100644 src/Common/Base/ITimeEntity.cs create mode 100644 src/Common/Base/TimedEntity.cs create mode 100644 src/Common/Dtos/AuthResponse.cs create mode 100644 src/Common/Dtos/BankAccountResponse.cs create mode 100644 src/Common/Dtos/BankResponse.cs create mode 100644 src/Common/Dtos/CategoryResponse.cs create mode 100644 src/Common/Dtos/ClaimResponse.cs create mode 100644 src/Common/Dtos/ClaimStateResponse.cs create mode 100644 src/Common/Dtos/CommentResponse.cs create mode 100644 src/Common/Dtos/CompanyResponse.cs create mode 100644 src/Common/Dtos/CurrencyResponse.cs create mode 100644 src/Common/Dtos/DomainResponse.cs create mode 100644 src/Common/Dtos/EventResponse.cs create mode 100644 src/Common/Dtos/FileResponse.cs create mode 100644 src/Common/Dtos/NotificationResponse.cs create mode 100644 src/Common/Dtos/PaymentResponse.cs create mode 100644 src/Common/Dtos/PaymentStateResponse.cs create mode 100644 src/Common/Dtos/ProfileResponse.cs create mode 100644 src/Common/Dtos/ServerResponse.cs create mode 100644 src/Common/Dtos/ServerStateResponse.cs create mode 100644 src/Common/Dtos/SettingResponse.cs create mode 100644 src/Common/Dtos/TeamResponse.cs create mode 100644 src/Common/Dtos/TransferRequestItem.cs create mode 100644 src/Common/Dtos/TransferRequestResponse.cs create mode 100644 src/Common/Dtos/UserResponse.cs create mode 100644 src/Common/Enums/AppLanguage.cs create mode 100644 src/Common/Enums/ClaimPriority.cs create mode 100644 src/Common/Enums/ClaimStatus.cs create mode 100644 src/Common/Enums/EventType.cs create mode 100644 src/Common/Enums/NotificationChannels.cs create mode 100644 src/Common/Enums/UserPermission.cs create mode 100644 src/Common/Extensions/DateTimeExtensions.cs create mode 100644 src/Common/Extensions/LazyResolutionExtension.cs create mode 100644 src/Common/Extensions/NameValueExtensions.cs create mode 100644 src/Common/Extensions/ObjectExtensions.cs create mode 100644 src/Common/Extensions/StringExtensions.cs create mode 100644 src/Common/HTTP/BankService.cs create mode 100644 src/Common/HTTP/CategoryService.cs create mode 100644 src/Common/HTTP/ClaimService.cs create mode 100644 src/Common/HTTP/CompanyService.cs create mode 100644 src/Common/HTTP/CurrencyService.cs create mode 100644 src/Common/HTTP/DomainService.cs create mode 100644 src/Common/HTTP/EventService.cs create mode 100644 src/Common/HTTP/HttpServiceExtensions.cs create mode 100644 src/Common/HTTP/IBankService.cs create mode 100644 src/Common/HTTP/ICategoryService.cs create mode 100644 src/Common/HTTP/IClaimService.cs create mode 100644 src/Common/HTTP/ICompanyService.cs create mode 100644 src/Common/HTTP/ICurrencyService.cs create mode 100644 src/Common/HTTP/IDomainService.cs create mode 100644 src/Common/HTTP/IEventService.cs create mode 100644 src/Common/HTTP/IPaymentService.cs create mode 100644 src/Common/HTTP/IProfileService.cs create mode 100644 src/Common/HTTP/IServerService.cs create mode 100644 src/Common/HTTP/ITeamService.cs create mode 100644 src/Common/HTTP/IUserService.cs create mode 100644 src/Common/HTTP/PaymentService.cs create mode 100644 src/Common/HTTP/ProfileService.cs create mode 100644 src/Common/HTTP/ServerService.cs create mode 100644 src/Common/HTTP/TeamService.cs create mode 100644 src/Common/HTTP/UserService.cs create mode 100644 src/Common/Helpers/DateSearchFilter.cs create mode 100644 src/Common/Helpers/FactoryLoader.cs create mode 100644 src/Common/Helpers/PaginationFilter.cs create mode 100644 src/Common/Helpers/SearchFilter.cs create mode 100644 src/Common/Helpers/StringConverter.cs create mode 100644 src/Common/Helpers/StringHelpers.cs create mode 100644 src/Common/Service/AbstractHttpService.cs create mode 100644 src/Common/Service/IHttpService.cs rename src/{common/shared => Common}/SharedConst.cs (74%) create mode 100644 src/Common/Wrappers/PagedResponse.cs create mode 100644 src/Common/Wrappers/Response.cs create mode 100644 src/Common/XClaim.Common.csproj create mode 100644 src/Mobile/.editorconfig create mode 100644 src/Mobile/App.xaml create mode 100644 src/Mobile/App.xaml.cs create mode 100644 src/Mobile/AppColors.cs create mode 100644 src/Mobile/AppConst.cs create mode 100644 src/Mobile/AppShell.cs create mode 100644 src/Mobile/Components/DateRangePop.cs create mode 100644 src/Mobile/Components/EmptyItemView.cs create mode 100644 src/Mobile/Components/FilterToolbarView.cs create mode 100644 src/Mobile/Components/Gradients.cs create mode 100644 src/Mobile/Components/Segment.xaml create mode 100644 src/Mobile/Components/Segment.xaml.cs create mode 100644 src/Mobile/DataConst.cs create mode 100644 src/Mobile/Extensions/Layouts/ColumnLayout.cs create mode 100644 src/Mobile/Extensions/Layouts/ColumnLayoutManager.cs create mode 100644 src/Mobile/Extensions/ViewExtension.cs create mode 100644 src/Mobile/Globals.cs create mode 100644 src/Mobile/Handlers/CustomEntry.cs create mode 100644 src/Mobile/HotReloadService.cs create mode 100644 src/Mobile/HttpsClientHandlerService.cs create mode 100644 src/Mobile/MauiProgram.cs create mode 100644 src/Mobile/Models/BaseModel.cs create mode 100644 src/Mobile/Models/Events.cs create mode 100644 src/Mobile/Models/Icons.cs create mode 100644 src/Mobile/Models/Theme.cs create mode 100644 src/Mobile/Platforms/Android/AndroidManifest.xml create mode 100644 src/Mobile/Platforms/Android/MainActivity.cs create mode 100644 src/Mobile/Platforms/Android/MainApplication.cs create mode 100644 src/Mobile/Platforms/Android/Resources/values/colors.xml create mode 100644 src/Mobile/Platforms/Android/Resources/xml/network_security_config.xml create mode 100644 src/Mobile/Platforms/Android/WebAuthenticationCallbackActivity.cs create mode 100644 src/Mobile/Platforms/MacCatalyst/AppDelegate.cs create mode 100644 src/Mobile/Platforms/MacCatalyst/Info.plist create mode 100644 src/Mobile/Platforms/MacCatalyst/Program.cs create mode 100644 src/Mobile/Platforms/Tizen/Main.cs create mode 100644 src/Mobile/Platforms/Tizen/tizen-manifest.xml create mode 100644 src/Mobile/Platforms/Windows/App.xaml create mode 100644 src/Mobile/Platforms/Windows/App.xaml.cs create mode 100644 src/Mobile/Platforms/Windows/Package.appxmanifest create mode 100644 src/Mobile/Platforms/Windows/app.manifest create mode 100644 src/Mobile/Platforms/iOS/AppDelegate.cs create mode 100644 src/Mobile/Platforms/iOS/Info.plist create mode 100644 src/Mobile/Platforms/iOS/Program.cs create mode 100644 src/Mobile/Properties/launchSettings.json create mode 100644 src/Mobile/Resources/AppIcon/appicon.svg create mode 100644 src/Mobile/Resources/AppIcon/appiconfg.svg create mode 100644 src/Mobile/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 src/Mobile/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 src/Mobile/Resources/Fonts/Roboto-Bold.ttf create mode 100644 src/Mobile/Resources/Fonts/Roboto-Medium.ttf create mode 100644 src/Mobile/Resources/Fonts/Roboto-Regular.ttf create mode 100644 src/Mobile/Resources/Fonts/Roboto-Thin.ttf create mode 100644 src/Mobile/Resources/Images/apple_icon.svg create mode 100644 src/Mobile/Resources/Images/auth_vector.svg create mode 100644 src/Mobile/Resources/Images/chevron_left_solid.svg create mode 100644 src/Mobile/Resources/Images/empty_banner.svg create mode 100644 src/Mobile/Resources/Images/google_icon.svg create mode 100644 src/Mobile/Resources/Images/icon_claim.svg create mode 100644 src/Mobile/Resources/Images/icon_home.svg create mode 100644 src/Mobile/Resources/Images/icon_payment.svg create mode 100644 src/Mobile/Resources/Images/icon_review.svg create mode 100644 src/Mobile/Resources/Images/microsoft_icon.svg create mode 100644 src/Mobile/Resources/Images/money_payments.svg create mode 100644 src/Mobile/Resources/Images/money_savings.svg create mode 100644 src/Mobile/Resources/Images/welcome_vector.svg create mode 100644 src/Mobile/Resources/Raw/AboutAssets.txt create mode 100644 src/Mobile/Resources/Splash/splash.svg create mode 100644 src/Mobile/Resources/Styles/Colors.xaml create mode 100644 src/Mobile/Resources/Styles/Custom.xaml create mode 100644 src/Mobile/Resources/Styles/Default.xaml create mode 100644 src/Mobile/Resources/Styles/Styles.xaml create mode 100644 src/Mobile/Services/HttpService.cs create mode 100644 src/Mobile/Services/SettingsService.cs create mode 100644 src/Mobile/Styles/AppFonts.cs create mode 100644 src/Mobile/Styles/ButtonStyle.cs create mode 100644 src/Mobile/Styles/SharedStyle.cs create mode 100644 src/Mobile/Views/BaseView.cs create mode 100644 src/Mobile/Views/Claim/ClaimDetailView.cs create mode 100644 src/Mobile/Views/Claim/ClaimFormView.cs create mode 100644 src/Mobile/Views/Claim/ClaimView.cs create mode 100644 src/Mobile/Views/Home/Component/HomeEventPop.cs create mode 100644 src/Mobile/Views/Home/HomeView.cs create mode 100644 src/Mobile/Views/Home/NotificationView.cs create mode 100644 src/Mobile/Views/Payment/Component/PaymentPop.cs create mode 100644 src/Mobile/Views/Payment/PaymentView.cs create mode 100644 src/Mobile/Views/Profile/AlertsView.cs create mode 100644 src/Mobile/Views/Profile/BankView.cs create mode 100644 src/Mobile/Views/Profile/HelpView.cs create mode 100644 src/Mobile/Views/Profile/LogView.cs create mode 100644 src/Mobile/Views/Profile/ProfileView.cs create mode 100644 src/Mobile/Views/Profile/SettingView.cs create mode 100644 src/Mobile/Views/Profile/ThemeView.cs create mode 100644 src/Mobile/Views/Review/ReviewActionView.cs create mode 100644 src/Mobile/Views/Review/ReviewView.cs create mode 100644 src/Mobile/Views/Startup/AuthView.cs create mode 100644 src/Mobile/Views/Startup/ConfigView.cs create mode 100644 src/Mobile/Views/Startup/LoadingView.cs create mode 100644 src/Mobile/Views/Startup/VerifyAccountView.cs create mode 100644 src/Mobile/Views/Startup/WelcomeView.cs create mode 100644 src/Mobile/XClaim.Mobile.csproj create mode 100644 src/Mobile/XClaim.Mobile.sln create mode 100644 src/Web/.editorconfig create mode 100644 src/Web/Client/App.razor create mode 100644 src/Web/Client/Handler/CookieHandler.cs create mode 100644 src/Web/Client/Properties/launchSettings.json create mode 100644 src/Web/Client/wwwroot/css/app.css rename src/{web/components => Web/Client}/wwwroot/favicon.png (100%) rename src/{web/components => Web/Client}/wwwroot/icon-192.png (100%) rename src/{web/components => Web/Client}/wwwroot/icon-512.png (100%) create mode 100644 src/Web/Client/wwwroot/index.html create mode 100644 src/Web/Client/wwwroot/manifest.json create mode 100644 src/Web/Client/wwwroot/service-worker.js create mode 100644 src/Web/Client/wwwroot/service-worker.published.js create mode 100644 src/Web/Components/.editorconfig create mode 100644 src/Web/Components/Controls/ArchiveDialog.razor create mode 100644 src/Web/Components/Controls/CommentViewer.razor create mode 100644 src/Web/Components/Controls/ConfirmationDialog.razor create mode 100644 src/Web/Components/Controls/DateDialog.razor create mode 100644 src/Web/Components/Controls/FileUpload.razor create mode 100644 src/Web/Components/Controls/FileViewer.razor create mode 100644 src/Web/Components/Controls/FormDialog.razor create mode 100644 src/Web/Components/Controls/FormEditTrigger.razor create mode 100644 src/Web/Components/Controls/TableLoading.razor create mode 100644 src/Web/Components/Controls/TableToolbar.razor create mode 100644 src/Web/Components/Extensions/ComponentServiceExtensions.cs create mode 100644 src/Web/Components/Layouts/RootLayout.razor create mode 100644 src/Web/Components/Pages/Account/BankAccount.razor create mode 100644 src/Web/Components/Pages/Account/Index.razor create mode 100644 src/Web/Components/Pages/Account/Layout.razor create mode 100644 src/Web/Components/Pages/Account/Notification.razor create mode 100644 src/Web/Components/Pages/Account/Profile.razor create mode 100644 src/Web/Components/Pages/Account/Settings.razor create mode 100644 src/Web/Components/Pages/Account/_Imports.razor create mode 100644 src/Web/Components/Pages/Claims/Index.razor create mode 100644 src/Web/Components/Pages/Claims/MutateClaim.razor create mode 100644 src/Web/Components/Pages/Help/Index.razor create mode 100644 src/Web/Components/Pages/Help/_Imports.razor create mode 100644 src/Web/Components/Pages/Index.razor create mode 100644 src/Web/Components/Pages/Manage/Bank/Index.razor create mode 100644 src/Web/Components/Pages/Manage/Bank/MutateBank.razor create mode 100644 src/Web/Components/Pages/Manage/Category/Index.razor create mode 100644 src/Web/Components/Pages/Manage/Category/MutateCategory.razor create mode 100644 src/Web/Components/Pages/Manage/Company/Index.razor create mode 100644 src/Web/Components/Pages/Manage/Company/MutateCompany.razor create mode 100644 src/Web/Components/Pages/Manage/Currency/Index.razor create mode 100644 src/Web/Components/Pages/Manage/Currency/MutateCurrency.razor create mode 100644 src/Web/Components/Pages/Manage/Domains/Index.razor create mode 100644 src/Web/Components/Pages/Manage/Domains/MutateDomain.razor create mode 100644 src/Web/Components/Pages/Manage/Index.razor create mode 100644 src/Web/Components/Pages/Manage/ManageLayout.razor create mode 100644 src/Web/Components/Pages/Manage/Teams/Index.razor create mode 100644 src/Web/Components/Pages/Manage/Teams/MutateTeam.razor create mode 100644 src/Web/Components/Pages/Overview/Index.razor create mode 100644 src/Web/Components/Pages/Payments/Index.razor create mode 100644 src/Web/Components/Pages/Reviews/ClaimDetails.razor create mode 100644 src/Web/Components/Pages/Reviews/Index.razor create mode 100644 src/Web/Components/Pages/Reviews/MutateReview.razor create mode 100644 src/Web/Components/Pages/Settings/Index.razor create mode 100644 src/Web/Components/Pages/Settings/Server.razor create mode 100644 src/Web/Components/Pages/Startup/Auth.razor create mode 100644 src/Web/Components/Pages/Startup/Registration.razor create mode 100644 src/Web/Components/Pages/Startup/_Imports.razor create mode 100644 src/Web/Components/Pages/Transactions/Components/DetailTransaction.razor create mode 100644 src/Web/Components/Pages/Transactions/Components/MutateTransaction.razor create mode 100644 src/Web/Components/Pages/Transactions/Components/TransactionUser.razor create mode 100644 src/Web/Components/Pages/Transactions/Index.razor create mode 100644 src/Web/Components/Pages/User/Components/MutateUser.razor create mode 100644 src/Web/Components/Pages/User/Index.razor create mode 100644 src/Web/Components/Pages/User/Layout.razor create mode 100644 src/Web/Components/Pages/User/TransferRequest.razor create mode 100644 src/Web/Components/Pages/User/_Imports.razor create mode 100644 src/Web/Components/Shared/ErrorFound.razor create mode 100644 src/Web/Components/Shared/NotAuthorized.razor rename {tests => src/Web/Components/wwwroot}/.gitkeep (100%) create mode 100644 src/Web/Server/Constants.cs create mode 100644 src/Web/Server/Converters/CollectionValueComparer.cs create mode 100644 src/Web/Server/Converters/EnumCollectionJsonValueConverter.cs create mode 100644 src/Web/Server/Converters/JsonValueConverter.cs create mode 100644 src/Web/Server/Data/DbInitializer.cs create mode 100644 src/Web/Server/Data/ServerContext.cs create mode 100644 src/Web/Server/Data/ServerContextExtention.cs create mode 100644 src/Web/Server/Data/SoftDeleteQueryExtension.cs create mode 100644 src/Web/Server/Entities/AuditHistory.cs create mode 100644 src/Web/Server/Entities/BankAccountEntity.cs create mode 100644 src/Web/Server/Entities/BankEntity.cs create mode 100644 src/Web/Server/Entities/CategoryEntity.cs create mode 100644 src/Web/Server/Entities/ClaimEntity.cs create mode 100644 src/Web/Server/Entities/CommentEntity.cs create mode 100644 src/Web/Server/Entities/CompanyEntity.cs create mode 100644 src/Web/Server/Entities/CurrencyEntity.cs create mode 100644 src/Web/Server/Entities/DomainEntity.cs create mode 100644 src/Web/Server/Entities/EventEntity.cs create mode 100644 src/Web/Server/Entities/FileEntity.cs create mode 100644 src/Web/Server/Entities/NotificationEntity.cs create mode 100644 src/Web/Server/Entities/PaymentEntity.cs create mode 100644 src/Web/Server/Entities/ServerEntity.cs create mode 100644 src/Web/Server/Entities/SettingEntity.cs create mode 100644 src/Web/Server/Entities/TeamEntity.cs create mode 100644 src/Web/Server/Entities/TransferRequestEntity.cs create mode 100644 src/Web/Server/Entities/UserEntity.cs create mode 100644 src/Web/Server/Extensions/DatabaseSetupExtension.cs create mode 100644 src/Web/Server/Extensions/SessionExtensions.cs create mode 100644 src/Web/Server/Helpers/ClaimStateResolver.cs create mode 100644 src/Web/Server/Helpers/ConfigHelper.cs create mode 100644 src/Web/Server/Helpers/DatabaseType.cs rename src/{service => Web/Server}/Helpers/FileUploadOperationFilter.cs (57%) create mode 100644 src/Web/Server/Helpers/FileUploadService.cs create mode 100644 src/Web/Server/Helpers/IdentityHelper.cs create mode 100644 src/Web/Server/IModule.cs create mode 100644 src/Web/Server/MapperProfile.cs rename src/{migration/sqlite/Setup/20231117225349_Initial.Designer.cs => Web/Server/Migrations/20240402132135_Initial.Designer.cs} (50%) rename src/{migration/sqlite/Setup/20231117225349_Initial.cs => Web/Server/Migrations/20240402132135_Initial.cs} (56%) rename src/{migration/sqlite/Setup/ServiceContextModelSnapshot.cs => Web/Server/Migrations/ServerContextModelSnapshot.cs} (50%) create mode 100644 src/Web/Server/Modules/AnalysisModule/AnalysisModule.cs create mode 100644 src/Web/Server/Modules/AnalysisModule/AnalysisService.cs create mode 100644 src/Web/Server/Modules/AnalysisModule/IAnalysisService.cs create mode 100644 src/Web/Server/Modules/AuthModule/AuthModule.cs create mode 100644 src/Web/Server/Modules/BankModule/BankFilter.cs create mode 100644 src/Web/Server/Modules/BankModule/BankModule.cs create mode 100644 src/Web/Server/Modules/BankModule/BankService.cs create mode 100644 src/Web/Server/Modules/BankModule/IBankService.cs create mode 100644 src/Web/Server/Modules/CategoryModule/CategoryFilter.cs create mode 100644 src/Web/Server/Modules/CategoryModule/CategoryModule.cs create mode 100644 src/Web/Server/Modules/CategoryModule/CategoryService.cs create mode 100644 src/Web/Server/Modules/ClaimModule/ClaimFilter.cs create mode 100644 src/Web/Server/Modules/ClaimModule/ClaimModule.cs create mode 100644 src/Web/Server/Modules/ClaimModule/ClaimService.cs create mode 100644 src/Web/Server/Modules/ClaimModule/IClaimService.cs create mode 100644 src/Web/Server/Modules/CompanyModule/CompanyFilter.cs create mode 100644 src/Web/Server/Modules/CompanyModule/CompanyModule.cs create mode 100644 src/Web/Server/Modules/CompanyModule/CompanyService.cs create mode 100644 src/Web/Server/Modules/CurrencyModule/CurrencyFilter.cs create mode 100644 src/Web/Server/Modules/CurrencyModule/CurrencyModule.cs create mode 100644 src/Web/Server/Modules/CurrencyModule/CurrencyService.cs create mode 100644 src/Web/Server/Modules/DomainModule/DomainFilter.cs create mode 100644 src/Web/Server/Modules/DomainModule/DomainModule.cs create mode 100644 src/Web/Server/Modules/DomainModule/DomainService.cs create mode 100644 src/Web/Server/Modules/EventModule/EventFilter.cs create mode 100644 src/Web/Server/Modules/EventModule/EventModule.cs create mode 100644 src/Web/Server/Modules/EventModule/EventService.cs create mode 100644 src/Web/Server/Modules/EventModule/IEventService.cs create mode 100644 src/Web/Server/Modules/GenericEndpoint.cs create mode 100644 src/Web/Server/Modules/GenericFilter.cs create mode 100644 src/Web/Server/Modules/GenericService.cs create mode 100644 src/Web/Server/Modules/IService.cs create mode 100644 src/Web/Server/Modules/PaymentModule/IPaymentService.cs create mode 100644 src/Web/Server/Modules/PaymentModule/PaymentFilter.cs create mode 100644 src/Web/Server/Modules/PaymentModule/PaymentModule.cs create mode 100644 src/Web/Server/Modules/PaymentModule/PaymentService.cs create mode 100644 src/Web/Server/Modules/ProfileModule/IProfileService.cs create mode 100644 src/Web/Server/Modules/ProfileModule/ProfileModule.cs create mode 100644 src/Web/Server/Modules/ProfileModule/ProfileService.cs create mode 100644 src/Web/Server/Modules/ServerModule/ServerModule.cs create mode 100644 src/Web/Server/Modules/ServerModule/ServerService.cs create mode 100644 src/Web/Server/Modules/SharedModule.cs create mode 100644 src/Web/Server/Modules/TeamModule/TeamFilter.cs create mode 100644 src/Web/Server/Modules/TeamModule/TeamModule.cs create mode 100644 src/Web/Server/Modules/TeamModule/TeamService.cs create mode 100644 src/Web/Server/Modules/UserModule/IUserService.cs create mode 100644 src/Web/Server/Modules/UserModule/TransferRequestFilter.cs create mode 100644 src/Web/Server/Modules/UserModule/UserFilter.cs create mode 100644 src/Web/Server/Modules/UserModule/UserModule.cs create mode 100644 src/Web/Server/Modules/UserModule/UserService.cs create mode 100644 src/Web/Server/Pages/Error.cshtml create mode 100644 src/Web/Server/Pages/Error.cshtml.cs create mode 100644 src/Web/Server/Program.cs create mode 100644 src/Web/Server/Properties/launchSettings.json create mode 100644 src/Web/Server/XClaim.Web.Server.csproj create mode 100644 src/Web/Server/config.Development.ini create mode 100644 src/Web/Server/config.ini rename src/{web/components => Web/Shared}/States/AppState.cs (78%) rename src/{web/components => Web/Shared}/States/AuthState.cs (84%) rename src/{web/components => Web/Shared}/States/RootState.cs (77%) create mode 100644 src/Web/Shared/States/ThemeState.cs create mode 100644 src/Web/XClaim.Web.sln delete mode 100644 src/common/context/GenericRepository.cs delete mode 100644 src/common/context/IdentitySetup.cs delete mode 100644 src/common/context/ServiceContext.cs delete mode 100644 src/common/context/XClaim.Common.Context.csproj delete mode 100644 src/common/entity/AccountEntity.cs delete mode 100644 src/common/entity/AuditEntity.cs delete mode 100644 src/common/entity/BankAccountEntity.cs delete mode 100644 src/common/entity/BankEntity.cs delete mode 100644 src/common/entity/CategoryEntity.cs delete mode 100644 src/common/entity/ClaimEntity.cs delete mode 100644 src/common/entity/CommentEntity.cs delete mode 100644 src/common/entity/CompanyEntity.cs delete mode 100644 src/common/entity/CurrencyEntity.cs delete mode 100644 src/common/entity/DomainEntity.cs delete mode 100644 src/common/entity/EventEntity.cs delete mode 100644 src/common/entity/FileEntity.cs delete mode 100644 src/common/entity/NotificationEntity.cs delete mode 100644 src/common/entity/PaymentEntity.cs delete mode 100644 src/common/entity/ProfileEntity.cs delete mode 100644 src/common/entity/ProfileTransferEntity.cs delete mode 100644 src/common/entity/ServerEntity.cs delete mode 100644 src/common/entity/SettingsEntity.cs delete mode 100644 src/common/entity/TeamEntity.cs delete mode 100644 src/common/entity/XClaim.Common.Entity.csproj delete mode 100644 src/common/http/Account/IProfileService.cs delete mode 100644 src/common/http/Resources/IBankService.cs delete mode 100644 src/common/http/XClaim.Common.Http.csproj delete mode 100644 src/common/shared/Base/AuditableResponse.cs delete mode 100644 src/common/shared/Base/BaseResponse.cs delete mode 100644 src/common/shared/Enums/AppLanguage.cs delete mode 100644 src/common/shared/Enums/ClaimPriority.cs delete mode 100644 src/common/shared/Enums/ClaimStatus.cs delete mode 100644 src/common/shared/Enums/EventType.cs delete mode 100644 src/common/shared/Enums/NotificationChannels.cs delete mode 100644 src/common/shared/Enums/UserPermission.cs delete mode 100644 src/common/shared/Responses/AuthResponse.cs delete mode 100644 src/common/shared/Responses/Bank.cs delete mode 100644 src/common/shared/Responses/BankAccount.cs delete mode 100644 src/common/shared/Responses/Category.cs delete mode 100644 src/common/shared/Responses/ClaimResponse.cs delete mode 100644 src/common/shared/Responses/Comment.cs delete mode 100644 src/common/shared/Responses/Company.cs delete mode 100644 src/common/shared/Responses/Currency.cs delete mode 100644 src/common/shared/Responses/Domain.cs delete mode 100644 src/common/shared/Responses/EventResponse.cs delete mode 100644 src/common/shared/Responses/FileResponse.cs delete mode 100644 src/common/shared/Responses/Notification.cs delete mode 100644 src/common/shared/Responses/Payment.cs delete mode 100644 src/common/shared/Responses/Profile.cs delete mode 100644 src/common/shared/Responses/ProfileTransfer.cs delete mode 100644 src/common/shared/Responses/Server.cs delete mode 100644 src/common/shared/Responses/Settings.cs delete mode 100644 src/common/shared/Responses/Team.cs delete mode 100644 src/common/shared/Responses/User.cs delete mode 100644 src/common/shared/XClaim.Common.csproj delete mode 100644 src/migration/postgres/Marker.cs delete mode 100644 src/migration/postgres/XClaim.Migrate.Postgres.csproj delete mode 100644 src/migration/sqlite/Marker.cs delete mode 100644 src/migration/sqlite/XClaim.Migrate.Sqlite.csproj delete mode 100644 src/service/Components/ServerApp.razor delete mode 100644 src/service/Components/_Imports.razor delete mode 100644 src/service/Constants.cs delete mode 100644 src/service/Data/DatabaseExtensions.cs delete mode 100644 src/service/Data/MigrationService.cs delete mode 100644 src/service/Data/Provider.cs delete mode 100644 src/service/Dockerfile delete mode 100644 src/service/Extensions/AuthenticationExtensions.cs delete mode 100644 src/service/Extensions/CoreAdminExtension.cs delete mode 100644 src/service/Extensions/FileUploadExtension.cs delete mode 100644 src/service/Extensions/ServiceDefaultExtensions.cs delete mode 100644 src/service/Extensions/SessionExtension.cs delete mode 100644 src/service/Extensions/SwaggerExtensions.cs delete mode 100644 src/service/Features/AccountModule/AccountFeature.cs delete mode 100644 src/service/Features/AccountModule/BankAccountFeature.cs delete mode 100644 src/service/Features/AccountModule/Interfaces/IAccountService.cs delete mode 100644 src/service/Features/AccountModule/Interfaces/IProfileTransferService.cs delete mode 100644 src/service/Features/AccountModule/Interfaces/ISettingService.cs delete mode 100644 src/service/Features/AccountModule/ProfileFeature.cs delete mode 100644 src/service/Features/AccountModule/ProfileTransferFeature.cs delete mode 100644 src/service/Features/AccountModule/SettingFeature.cs delete mode 100644 src/service/Features/AuthModule/AuthFeature.cs delete mode 100644 src/service/Features/ClaimModule/ClaimFeature.cs delete mode 100644 src/service/Features/ClaimModule/Interfaces/IClaimService.cs delete mode 100644 src/service/Features/ClaimModule/Interfaces/IPaymentService.cs delete mode 100644 src/service/Features/ClaimModule/PaymentFeature.cs delete mode 100644 src/service/Features/GroupModule/CategoryFeature.cs delete mode 100644 src/service/Features/GroupModule/CompanyFeature.cs delete mode 100644 src/service/Features/GroupModule/Interfaces/ICategoryService.cs delete mode 100644 src/service/Features/GroupModule/Interfaces/ITeamService.cs delete mode 100644 src/service/Features/GroupModule/TeamFeature.cs delete mode 100644 src/service/Features/ReportModule/ReportFeature.cs delete mode 100644 src/service/Features/ResourceModule/BankFeature.cs delete mode 100644 src/service/Features/ResourceModule/CommentFeature.cs delete mode 100644 src/service/Features/ResourceModule/EventFeature.cs delete mode 100644 src/service/Features/ResourceModule/Interfaces/ICommentService.cs delete mode 100644 src/service/Features/ResourceModule/Interfaces/INotificationService.cs delete mode 100644 src/service/Features/ResourceModule/NotificationFeature.cs delete mode 100644 src/service/Features/ServerModule/CurrencyFeature.cs delete mode 100644 src/service/Features/ServerModule/DomainFeature.cs delete mode 100644 src/service/Features/ServerModule/Interfaces/IDomainService.cs delete mode 100644 src/service/Features/ServerModule/Interfaces/IServiceService.cs delete mode 100644 src/service/Features/ServerModule/ServerOptionFeature.cs delete mode 100644 src/service/Helpers/FileUploadService.cs delete mode 100644 src/service/Pages/Error.razor delete mode 100644 src/service/Program.cs delete mode 100644 src/service/Properties/launchSettings.json delete mode 100644 src/service/XClaim.Service.csproj delete mode 100644 src/service/appsettings.Development.json delete mode 100644 src/service/appsettings.json delete mode 100644 src/web/client/PersistentAuthenticationStateProvider.cs delete mode 100644 src/web/client/Routes.razor delete mode 100644 src/web/client/wwwroot/readme.txt delete mode 100644 src/web/components/ClientApp.razor delete mode 100644 src/web/components/Controls/TestControl.razor delete mode 100644 src/web/components/Extensions/ComponentClientExtensions.cs delete mode 100644 src/web/components/Extensions/ComponentServerExtensions.cs delete mode 100644 src/web/components/Layouts/RootWrapper.razor delete mode 100644 src/web/components/Pages/Authentication.razor delete mode 100644 src/web/components/Pages/Home.razor delete mode 100644 src/web/components/Shared/ErrorNotFound.razor delete mode 100644 src/web/components/Shared/ErrorUnAuthorized.razor delete mode 100644 src/web/components/wwwroot/css/app.css delete mode 100644 tests/service/UnitTest1.cs delete mode 100644 tests/service/Usings.cs delete mode 100644 tests/service/XClaim.Service.IntegrationTests.csproj delete mode 100644 x-claim.sln delete mode 100644 x-claim.sln.DotSettings diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 68bb1fa6..10da06b1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-ef": { - "version": "8.0.0", + "version": "7.0.2", "commands": [ "dotnet-ef" ] diff --git a/XClaim.sln b/XClaim.sln new file mode 100644 index 00000000..bc2d880b --- /dev/null +++ b/XClaim.sln @@ -0,0 +1,67 @@ + +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 new file mode 100644 index 00000000..205f2e8d --- /dev/null +++ b/XClaim.sln.DotSettings @@ -0,0 +1,8 @@ + + True + True + True + True + True + True + True \ No newline at end of file diff --git a/global.json b/global.json index b916b0bb..d0cf17a1 100644 --- a/global.json +++ b/global.json @@ -1,12 +1,18 @@ { "sdk": { - "version": "8.0.100", - "rollForward": "latestFeature" + "version": "7.0.407", + "rollForward": "latestPatch" }, "scripts": { "c": "rm -rf ./**/{bin,obj}", "b": "dotnet build --configuration Debug", "p": "dotnet publish ./src/service -p:PublishDir=output --os linux", + "b:web": "dotnet build src/Web/Server/", + "b: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", "test": "dotnet test --configuration Release", "ci": "dotnet r build && dotnet r test", "service": "dotnet run --project ./src/service", @@ -15,4 +21,4 @@ "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" } -} \ No newline at end of file +} diff --git a/src/Common/Base/BaseEntity.cs b/src/Common/Base/BaseEntity.cs new file mode 100644 index 00000000..a53d22f9 --- /dev/null +++ b/src/Common/Base/BaseEntity.cs @@ -0,0 +1,7 @@ +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 new file mode 100644 index 00000000..21a09553 --- /dev/null +++ b/src/Common/Base/BaseResponse.cs @@ -0,0 +1,7 @@ +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 new file mode 100644 index 00000000..e98a7007 --- /dev/null +++ b/src/Common/Base/IBaseEntity.cs @@ -0,0 +1,5 @@ +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 new file mode 100644 index 00000000..4b2e71af --- /dev/null +++ b/src/Common/Base/ITimeEntity.cs @@ -0,0 +1,8 @@ +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 new file mode 100644 index 00000000..60858af7 --- /dev/null +++ b/src/Common/Base/TimedEntity.cs @@ -0,0 +1,7 @@ +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 new file mode 100644 index 00000000..c84e8bee --- /dev/null +++ b/src/Common/Dtos/AuthResponse.cs @@ -0,0 +1,12 @@ +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 new file mode 100644 index 00000000..8c5d8f29 --- /dev/null +++ b/src/Common/Dtos/BankAccountResponse.cs @@ -0,0 +1,13 @@ +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 new file mode 100644 index 00000000..e6ccef7b --- /dev/null +++ b/src/Common/Dtos/BankResponse.cs @@ -0,0 +1,10 @@ +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 new file mode 100644 index 00000000..774df54b --- /dev/null +++ b/src/Common/Dtos/CategoryResponse.cs @@ -0,0 +1,12 @@ +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 new file mode 100644 index 00000000..e3e8b9b9 --- /dev/null +++ b/src/Common/Dtos/ClaimResponse.cs @@ -0,0 +1,26 @@ +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 new file mode 100644 index 00000000..7f369567 --- /dev/null +++ b/src/Common/Dtos/ClaimStateResponse.cs @@ -0,0 +1,19 @@ +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 new file mode 100644 index 00000000..91e1735b --- /dev/null +++ b/src/Common/Dtos/CommentResponse.cs @@ -0,0 +1,10 @@ +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 new file mode 100644 index 00000000..e1b2d55c --- /dev/null +++ b/src/Common/Dtos/CompanyResponse.cs @@ -0,0 +1,12 @@ +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 new file mode 100644 index 00000000..80892b80 --- /dev/null +++ b/src/Common/Dtos/CurrencyResponse.cs @@ -0,0 +1,13 @@ +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 new file mode 100644 index 00000000..c4952e0b --- /dev/null +++ b/src/Common/Dtos/DomainResponse.cs @@ -0,0 +1,9 @@ +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 new file mode 100644 index 00000000..16db61f7 --- /dev/null +++ b/src/Common/Dtos/EventResponse.cs @@ -0,0 +1,11 @@ +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 new file mode 100644 index 00000000..0955450f --- /dev/null +++ b/src/Common/Dtos/FileResponse.cs @@ -0,0 +1,10 @@ +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 new file mode 100644 index 00000000..e9c5a051 --- /dev/null +++ b/src/Common/Dtos/NotificationResponse.cs @@ -0,0 +1,12 @@ +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 new file mode 100644 index 00000000..622d5e88 --- /dev/null +++ b/src/Common/Dtos/PaymentResponse.cs @@ -0,0 +1,20 @@ +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 new file mode 100644 index 00000000..ecb3c7b0 --- /dev/null +++ b/src/Common/Dtos/PaymentStateResponse.cs @@ -0,0 +1,15 @@ +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 new file mode 100644 index 00000000..ced9c1b2 --- /dev/null +++ b/src/Common/Dtos/ProfileResponse.cs @@ -0,0 +1,21 @@ +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 new file mode 100644 index 00000000..c6c5cda7 --- /dev/null +++ b/src/Common/Dtos/ServerResponse.cs @@ -0,0 +1,12 @@ +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 new file mode 100644 index 00000000..eddba9e0 --- /dev/null +++ b/src/Common/Dtos/ServerStateResponse.cs @@ -0,0 +1,5 @@ +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 new file mode 100644 index 00000000..cd60ba2d --- /dev/null +++ b/src/Common/Dtos/SettingResponse.cs @@ -0,0 +1,11 @@ +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 new file mode 100644 index 00000000..dd678be2 --- /dev/null +++ b/src/Common/Dtos/TeamResponse.cs @@ -0,0 +1,13 @@ +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 new file mode 100644 index 00000000..df6cbc91 --- /dev/null +++ b/src/Common/Dtos/TransferRequestItem.cs @@ -0,0 +1,12 @@ +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 new file mode 100644 index 00000000..f73f5e6d --- /dev/null +++ b/src/Common/Dtos/TransferRequestResponse.cs @@ -0,0 +1,11 @@ +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 new file mode 100644 index 00000000..6810a1ac --- /dev/null +++ b/src/Common/Dtos/UserResponse.cs @@ -0,0 +1,30 @@ +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 new file mode 100644 index 00000000..a4a70c84 --- /dev/null +++ b/src/Common/Enums/AppLanguage.cs @@ -0,0 +1,7 @@ +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 new file mode 100644 index 00000000..839fe4da --- /dev/null +++ b/src/Common/Enums/ClaimPriority.cs @@ -0,0 +1,10 @@ +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 new file mode 100644 index 00000000..5797830c --- /dev/null +++ b/src/Common/Enums/ClaimStatus.cs @@ -0,0 +1,11 @@ +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 new file mode 100644 index 00000000..de26ab2f --- /dev/null +++ b/src/Common/Enums/EventType.cs @@ -0,0 +1,14 @@ +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 new file mode 100644 index 00000000..5344b2fe --- /dev/null +++ b/src/Common/Enums/NotificationChannels.cs @@ -0,0 +1,14 @@ +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 new file mode 100644 index 00000000..7dc6333f --- /dev/null +++ b/src/Common/Enums/UserPermission.cs @@ -0,0 +1,15 @@ +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 new file mode 100644 index 00000000..06f803d9 --- /dev/null +++ b/src/Common/Extensions/DateTimeExtensions.cs @@ -0,0 +1,31 @@ +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 new file mode 100644 index 00000000..8d894d7d --- /dev/null +++ b/src/Common/Extensions/LazyResolutionExtension.cs @@ -0,0 +1,19 @@ +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 new file mode 100644 index 00000000..52f01ead --- /dev/null +++ b/src/Common/Extensions/NameValueExtensions.cs @@ -0,0 +1,17 @@ +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 new file mode 100644 index 00000000..4292125e --- /dev/null +++ b/src/Common/Extensions/ObjectExtensions.cs @@ -0,0 +1,14 @@ +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 new file mode 100644 index 00000000..3f59bcb9 --- /dev/null +++ b/src/Common/Extensions/StringExtensions.cs @@ -0,0 +1,8 @@ +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 new file mode 100644 index 00000000..88353373 --- /dev/null +++ b/src/Common/HTTP/BankService.cs @@ -0,0 +1,32 @@ +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 new file mode 100644 index 00000000..19affd8e --- /dev/null +++ b/src/Common/HTTP/CategoryService.cs @@ -0,0 +1,32 @@ +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 new file mode 100644 index 00000000..97f6063f --- /dev/null +++ b/src/Common/HTTP/ClaimService.cs @@ -0,0 +1,61 @@ +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 new file mode 100644 index 00000000..9ac68832 --- /dev/null +++ b/src/Common/HTTP/CompanyService.cs @@ -0,0 +1,32 @@ +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 new file mode 100644 index 00000000..746b473a --- /dev/null +++ b/src/Common/HTTP/CurrencyService.cs @@ -0,0 +1,32 @@ +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 new file mode 100644 index 00000000..fd30ad99 --- /dev/null +++ b/src/Common/HTTP/DomainService.cs @@ -0,0 +1,33 @@ +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 new file mode 100644 index 00000000..0b47f111 --- /dev/null +++ b/src/Common/HTTP/EventService.cs @@ -0,0 +1,21 @@ +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 new file mode 100644 index 00000000..0e416afb --- /dev/null +++ b/src/Common/HTTP/HttpServiceExtensions.cs @@ -0,0 +1,25 @@ +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 new file mode 100644 index 00000000..f53846b3 --- /dev/null +++ b/src/Common/HTTP/IBankService.cs @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000..8c4f9a51 --- /dev/null +++ b/src/Common/HTTP/ICategoryService.cs @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000..50532de7 --- /dev/null +++ b/src/Common/HTTP/IClaimService.cs @@ -0,0 +1,33 @@ +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 new file mode 100644 index 00000000..2dae9876 --- /dev/null +++ b/src/Common/HTTP/ICompanyService.cs @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000..58b8c8bc --- /dev/null +++ b/src/Common/HTTP/ICurrencyService.cs @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000..6dd8b7cf --- /dev/null +++ b/src/Common/HTTP/IDomainService.cs @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000..71208865 --- /dev/null +++ b/src/Common/HTTP/IEventService.cs @@ -0,0 +1,8 @@ +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 new file mode 100644 index 00000000..2473cd16 --- /dev/null +++ b/src/Common/HTTP/IPaymentService.cs @@ -0,0 +1,24 @@ +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 new file mode 100644 index 00000000..27d3083a --- /dev/null +++ b/src/Common/HTTP/IProfileService.cs @@ -0,0 +1,17 @@ +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 new file mode 100644 index 00000000..ec3a659c --- /dev/null +++ b/src/Common/HTTP/IServerService.cs @@ -0,0 +1,9 @@ +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 new file mode 100644 index 00000000..122054d6 --- /dev/null +++ b/src/Common/HTTP/ITeamService.cs @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000..4e836c76 --- /dev/null +++ b/src/Common/HTTP/IUserService.cs @@ -0,0 +1,25 @@ +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 new file mode 100644 index 00000000..c9ccc503 --- /dev/null +++ b/src/Common/HTTP/PaymentService.cs @@ -0,0 +1,49 @@ +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 new file mode 100644 index 00000000..99a37669 --- /dev/null +++ b/src/Common/HTTP/ProfileService.cs @@ -0,0 +1,40 @@ +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 new file mode 100644 index 00000000..6d6ceeeb --- /dev/null +++ b/src/Common/HTTP/ServerService.cs @@ -0,0 +1,20 @@ +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 new file mode 100644 index 00000000..2a830dae --- /dev/null +++ b/src/Common/HTTP/TeamService.cs @@ -0,0 +1,33 @@ +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 new file mode 100644 index 00000000..9e84e3c9 --- /dev/null +++ b/src/Common/HTTP/UserService.cs @@ -0,0 +1,51 @@ +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 new file mode 100644 index 00000000..48133eac --- /dev/null +++ b/src/Common/Helpers/DateSearchFilter.cs @@ -0,0 +1,6 @@ +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 new file mode 100644 index 00000000..fe48453b --- /dev/null +++ b/src/Common/Helpers/FactoryLoader.cs @@ -0,0 +1,11 @@ +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 new file mode 100644 index 00000000..d5c120ac --- /dev/null +++ b/src/Common/Helpers/PaginationFilter.cs @@ -0,0 +1,8 @@ +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 new file mode 100644 index 00000000..a2d0dc0c --- /dev/null +++ b/src/Common/Helpers/SearchFilter.cs @@ -0,0 +1,5 @@ +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 new file mode 100644 index 00000000..cca4468b --- /dev/null +++ b/src/Common/Helpers/StringConverter.cs @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000..cd6077d9 --- /dev/null +++ b/src/Common/Helpers/StringHelpers.cs @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000..98747a31 --- /dev/null +++ b/src/Common/Service/AbstractHttpService.cs @@ -0,0 +1,129 @@ +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 new file mode 100644 index 00000000..c999341e --- /dev/null +++ b/src/Common/Service/IHttpService.cs @@ -0,0 +1,17 @@ +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/shared/SharedConst.cs b/src/Common/SharedConst.cs similarity index 74% rename from src/common/shared/SharedConst.cs rename to src/Common/SharedConst.cs index 02ffda6e..2e5abff1 100644 --- a/src/common/shared/SharedConst.cs +++ b/src/Common/SharedConst.cs @@ -1,7 +1,7 @@ -namespace XClaim.Common; +namespace XClaim.Common; public static class SharedConst { - public const string ServiceName = "x-claim"; + public const string ServiceName = "X-Claim"; public static int RowsPerPage = 25; public static readonly DateTime StartDate = DateTime.Now.AddDays(-7); public static readonly DateTime EndDate = DateTime.Now.Date; diff --git a/src/Common/Wrappers/PagedResponse.cs b/src/Common/Wrappers/PagedResponse.cs new file mode 100644 index 00000000..0243ef83 --- /dev/null +++ b/src/Common/Wrappers/PagedResponse.cs @@ -0,0 +1,26 @@ +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 new file mode 100644 index 00000000..b57f92fb --- /dev/null +++ b/src/Common/Wrappers/Response.cs @@ -0,0 +1,15 @@ +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 new file mode 100644 index 00000000..184e87c2 --- /dev/null +++ b/src/Common/XClaim.Common.csproj @@ -0,0 +1,14 @@ + + + + net7.0 + enable + enable + + + + + + + + diff --git a/src/Mobile/.editorconfig b/src/Mobile/.editorconfig new file mode 100644 index 00000000..9fc60f8c --- /dev/null +++ b/src/Mobile/.editorconfig @@ -0,0 +1,127 @@ +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 new file mode 100644 index 00000000..10c6462b --- /dev/null +++ b/src/Mobile/App.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Mobile/App.xaml.cs b/src/Mobile/App.xaml.cs new file mode 100644 index 00000000..55b16687 --- /dev/null +++ b/src/Mobile/App.xaml.cs @@ -0,0 +1,52 @@ +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 new file mode 100644 index 00000000..cdeffde2 --- /dev/null +++ b/src/Mobile/AppColors.cs @@ -0,0 +1,37 @@ +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 new file mode 100644 index 00000000..0f510c79 --- /dev/null +++ b/src/Mobile/AppConst.cs @@ -0,0 +1,25 @@ +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 new file mode 100644 index 00000000..4c896684 --- /dev/null +++ b/src/Mobile/AppShell.cs @@ -0,0 +1,97 @@ +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 new file mode 100644 index 00000000..90e72ccb --- /dev/null +++ b/src/Mobile/Components/DateRangePop.cs @@ -0,0 +1,39 @@ +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 new file mode 100644 index 00000000..0bad819b --- /dev/null +++ b/src/Mobile/Components/EmptyItemView.cs @@ -0,0 +1,21 @@ +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 new file mode 100644 index 00000000..e88ff498 --- /dev/null +++ b/src/Mobile/Components/FilterToolbarView.cs @@ -0,0 +1,92 @@ +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 new file mode 100644 index 00000000..6ca9a0a2 --- /dev/null +++ b/src/Mobile/Components/Gradients.cs @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000..7d655a50 --- /dev/null +++ b/src/Mobile/Components/Segment.xaml @@ -0,0 +1,63 @@ + + + + + + + + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +