├── .editorconfig
├── .gitattributes
├── .gitignore
├── .vscode
└── launch.json
├── Admin.loja
├── .eslintrc.cjs
├── .gitignore
├── .vscode
│ └── extensions.json
├── Admin.loja.esproj
├── README.md
├── env.d.ts
├── index.html
├── nuget.config
├── package-lock.json
├── package.json
├── public
│ └── favicon.ico
├── src
│ ├── App.vue
│ ├── assets
│ │ └── logo.png
│ ├── components
│ │ ├── Layout
│ │ │ ├── Header
│ │ │ │ ├── Header.vue
│ │ │ │ └── style.scss
│ │ │ └── NavBar
│ │ │ │ ├── NavBar.vue
│ │ │ │ └── style.scss
│ │ ├── Toast
│ │ │ ├── ToastUnauthorized.vue
│ │ │ └── style.scss
│ │ └── Utility
│ │ │ ├── FileUpload
│ │ │ ├── UploadComposite.vue
│ │ │ └── script.ts
│ │ │ └── Modals
│ │ │ └── UploadPicture.vue
│ ├── globals
│ │ └── utility.scss
│ ├── main.ts
│ ├── pinia
│ │ ├── Controllers
│ │ │ ├── LogController.ts
│ │ │ ├── dependencyInjectionController.ts
│ │ │ ├── gReCaptcha_v2.ts
│ │ │ ├── requestController.ts
│ │ │ ├── routeController.ts
│ │ │ └── sessionController.ts
│ │ ├── Interfaces
│ │ │ ├── IConfigureToast.ts
│ │ │ └── IDependencyInjection.ts
│ │ ├── Types
│ │ │ ├── Log.ts
│ │ │ ├── mainStore.ts
│ │ │ ├── requestModel.ts
│ │ │ ├── routerInfo.ts
│ │ │ └── session.ts
│ │ └── mainStore.ts
│ ├── router
│ │ └── index.ts
│ ├── style.scss
│ ├── tests
│ │ ├── unit
│ │ │ └── pinia
│ │ │ │ ├── controllers
│ │ │ │ ├── logController.spec.ts
│ │ │ │ ├── requestController.spec.ts
│ │ │ │ ├── routeController.spec.ts
│ │ │ │ └── sessionController.spec.ts
│ │ │ │ ├── dependencyInjection.spec.ts
│ │ │ │ └── mainStore.spec.ts
│ │ └── views
│ │ │ └── components
│ │ │ └── Layout
│ │ │ ├── Header.spec.ts
│ │ │ └── NavBar.spec.ts
│ ├── theme.scss
│ └── views
│ │ ├── Home
│ │ └── HomeView.vue
│ │ ├── Login
│ │ ├── LoginView.vue
│ │ ├── script.ts
│ │ └── style.scss
│ │ └── Store
│ │ ├── Categories
│ │ ├── CategoriesView.vue
│ │ ├── script.ts
│ │ └── style.scss
│ │ └── Users
│ │ └── UsersView.vue
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.node.json
├── vite.config.ts
└── vitest.config.ts
├── Api.loja
├── Api.loja.csproj
├── Contracts
│ ├── AuthenticationContract.cs
│ ├── PraedicamentaContract.cs
│ ├── ProductManagerContract.cs
│ ├── UploadContract.cs
│ └── UsersContract.cs
├── Controllers
│ ├── Admin
│ │ ├── AuthenticationController.cs
│ │ └── CategoriesController.cs
│ ├── BaseController.cs
│ └── Utility
│ │ └── UploadController.cs
├── Middleware
│ └── AuthenticationMiddleware.cs
├── Program.cs
├── Properties
│ └── launchSettings.json
├── Service
│ ├── AuthenticationApplicationService.cs
│ ├── PraedicamentaApplicationService.cs
│ ├── ProductManagerApplicationService.cs
│ ├── UploadApplicationService.cs
│ └── UsersApplicationServices.cs
├── Startup.cs
├── VueApp1.Server.http
├── appsettings.Development.json
└── appsettings.json
├── Dominio.loja
├── Attributes
│ ├── ExcelValidationAttributes.cs
│ └── ValidatePermissionAttribute.cs
├── Dominio.loja.csproj
├── Dto
│ ├── Models
│ │ ├── ExcelImportProducts.cs
│ │ ├── ExcelValidatedCell.cs
│ │ ├── ExcelValidatedRow.cs
│ │ └── ResponseModel.cs
│ └── RabbitMQ
│ │ └── UploadQueueRequest.cs
├── Entity
│ ├── Authentications.cs
│ ├── Categories.cs
│ ├── CategoriesPromotion.cs
│ ├── Clients.cs
│ ├── ClientsProductsCart.cs
│ ├── IPScore.cs
│ ├── Integrations
│ │ └── WFileManager
│ │ │ ├── FileDirectory.cs
│ │ │ ├── FileRelation.cs
│ │ │ ├── FileStorage.cs
│ │ │ └── Relation
│ │ │ └── FileCategories.cs
│ ├── Permissions.cs
│ ├── PermissionsGroup.cs
│ ├── PermissionsRelation.cs
│ ├── Prices.cs
│ ├── Products.cs
│ ├── ProductsCategories.cs
│ ├── ProductsPrices.cs
│ ├── ProductsStorage.cs
│ ├── ProductsSubCategories.cs
│ ├── ProductsSubSubCategories.cs
│ ├── RequestOrders.cs
│ ├── RequestOrdersProducts.cs
│ ├── SubCategories.cs
│ ├── SubCategoriesProducts.cs
│ └── SubSubCategories.cs
├── Enums
│ ├── DateTimeFormatValidation.cs
│ ├── DirectoryType.cs
│ ├── ExcelValidation.cs
│ └── FilterOrder.cs
├── Events
│ ├── Authentication
│ │ ├── Authentication.cs
│ │ ├── AuthenticationEvents.cs
│ │ └── LoginAdmin.cs
│ ├── Clients
│ │ ├── ClientPermission.cs
│ │ └── ClientsEvents.cs
│ ├── FileUpload
│ │ ├── All.cs
│ │ ├── DirectoryRestriction.cs
│ │ ├── Doc.cs
│ │ ├── Excel.cs
│ │ ├── FileManager.cs
│ │ ├── FileManagerEvents.cs
│ │ ├── FileType.cs
│ │ ├── Image.cs
│ │ ├── Pdf.cs
│ │ ├── ValidExtensions.cs
│ │ └── Video.cs
│ ├── Praedicamenta
│ │ ├── Praedicamenta.cs
│ │ └── PraedicamentaEvents.cs
│ └── ProductManager
│ │ └── ProductManager.cs
└── Interfaces
│ ├── Context
│ ├── IAdminControllerContext.cs
│ ├── IAdminStoreCategoriesControllerContext.cs
│ ├── IDbContext.cs
│ ├── IInternalEventHandler.cs
│ ├── IStoreClientsControllerContext.cs
│ ├── IStoreControllerContext.cs
│ └── IStoreProductsControllerContext.cs
│ ├── Files
│ ├── IFileType.cs
│ ├── IFileTypeProperty.cs
│ └── IFileTypeRestriction.cs
│ └── IAuthentication.cs
├── Framework.loja
├── AggregateRoot.cs
├── ControllerResponse.cs
├── CustomAttributes
│ └── FirstLetterUpperCaseAttribute.cs
├── Entity.cs
├── ExtensionMethods
│ └── ExtensionMethods.cs
├── Framework.loja.csproj
├── Interfaces
│ ├── IApplicationService.cs
│ ├── IInternalEventHandler.cs
│ ├── IStringValidationAttribute.cs
│ └── IUnitOfWork.cs
├── InvalidValueException.cs
└── Utility
│ └── Files
│ └── ReadableFileLength.cs
├── FrontEnd.loja_
├── .vscode
│ └── settings.json
├── FrontEnd.loja.njsproj
├── README.md
├── appsettings.json
├── babel.config.js
├── dist
│ ├── css
│ │ ├── app.3f34febc.css
│ │ └── chunk-vendors.08b593cf.css
│ ├── favicon.ico
│ ├── fonts
│ │ ├── Inter-italic.var.958a0b97.woff2
│ │ ├── Inter-roman.var.b2129c00.woff2
│ │ ├── Montserrat-ExtraLight.c82a42c9.ttf
│ │ ├── Montserrat-Light.ac0230b4.ttf
│ │ ├── Montserrat-Medium.62e48611.ttf
│ │ ├── Montserrat-SemiBold.941396b7.ttf
│ │ ├── Montserrat-Thin.434cb22f.ttf
│ │ ├── Montserrat-VariableFont_wght.f595c38f.ttf
│ │ └── Montserrat
│ │ │ ├── Montserrat-Italic-VariableFont_wght.ttf
│ │ │ ├── Montserrat-VariableFont_wght.ttf
│ │ │ ├── OFL.txt
│ │ │ ├── README.txt
│ │ │ └── static
│ │ │ ├── Montserrat-Black.ttf
│ │ │ ├── Montserrat-BlackItalic.ttf
│ │ │ ├── Montserrat-Bold.ttf
│ │ │ ├── Montserrat-BoldItalic.ttf
│ │ │ ├── Montserrat-ExtraBold.ttf
│ │ │ ├── Montserrat-ExtraBoldItalic.ttf
│ │ │ ├── Montserrat-ExtraLight.ttf
│ │ │ ├── Montserrat-ExtraLightItalic.ttf
│ │ │ ├── Montserrat-Italic.ttf
│ │ │ ├── Montserrat-Light.ttf
│ │ │ ├── Montserrat-LightItalic.ttf
│ │ │ ├── Montserrat-Medium.ttf
│ │ │ ├── Montserrat-MediumItalic.ttf
│ │ │ ├── Montserrat-Regular.ttf
│ │ │ ├── Montserrat-SemiBold.ttf
│ │ │ ├── Montserrat-SemiBoldItalic.ttf
│ │ │ ├── Montserrat-Thin.ttf
│ │ │ └── Montserrat-ThinItalic.ttf
│ ├── img
│ │ ├── CreditCard
│ │ │ ├── cielo-1.svg
│ │ │ ├── elo-1.svg
│ │ │ ├── mastercard-6.svg
│ │ │ └── visa-2.svg
│ │ ├── Logo
│ │ │ └── logo.png
│ │ └── icons
│ │ │ └── AppHeader
│ │ │ ├── cart.svg
│ │ │ ├── clock.svg
│ │ │ ├── list.svg
│ │ │ ├── menu.svg
│ │ │ └── user.svg
│ ├── index.html
│ ├── js
│ │ ├── app.dacfab88.js
│ │ ├── app.dacfab88.js.map
│ │ ├── chunk-vendors.08a1fff2.js
│ │ └── chunk-vendors.08a1fff2.js.map
│ ├── manifest.json
│ ├── robots.txt
│ ├── service-worker.js
│ ├── service-worker.js.map
│ ├── workbox-6567b62a.js
│ └── workbox-6567b62a.js.map
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
│ ├── favicon.ico
│ ├── fonts
│ │ └── Montserrat
│ │ │ ├── Montserrat-Italic-VariableFont_wght.ttf
│ │ │ ├── Montserrat-VariableFont_wght.ttf
│ │ │ ├── OFL.txt
│ │ │ ├── README.txt
│ │ │ └── static
│ │ │ ├── Montserrat-Black.ttf
│ │ │ ├── Montserrat-BlackItalic.ttf
│ │ │ ├── Montserrat-Bold.ttf
│ │ │ ├── Montserrat-BoldItalic.ttf
│ │ │ ├── Montserrat-ExtraBold.ttf
│ │ │ ├── Montserrat-ExtraBoldItalic.ttf
│ │ │ ├── Montserrat-ExtraLight.ttf
│ │ │ ├── Montserrat-ExtraLightItalic.ttf
│ │ │ ├── Montserrat-Italic.ttf
│ │ │ ├── Montserrat-Light.ttf
│ │ │ ├── Montserrat-LightItalic.ttf
│ │ │ ├── Montserrat-Medium.ttf
│ │ │ ├── Montserrat-MediumItalic.ttf
│ │ │ ├── Montserrat-Regular.ttf
│ │ │ ├── Montserrat-SemiBold.ttf
│ │ │ ├── Montserrat-SemiBoldItalic.ttf
│ │ │ ├── Montserrat-Thin.ttf
│ │ │ └── Montserrat-ThinItalic.ttf
│ ├── img
│ │ ├── CreditCard
│ │ │ ├── cielo-1.svg
│ │ │ ├── elo-1.svg
│ │ │ ├── mastercard-6.svg
│ │ │ └── visa-2.svg
│ │ ├── Logo
│ │ │ └── logo.png
│ │ └── icons
│ │ │ └── AppHeader
│ │ │ ├── cart.svg
│ │ │ ├── clock.svg
│ │ │ ├── list.svg
│ │ │ ├── menu.svg
│ │ │ └── user.svg
│ ├── index.html
│ └── robots.txt
├── src
│ ├── App.vue
│ ├── Utils
│ │ └── Utility.ts
│ ├── assets
│ │ └── logo.png
│ ├── components
│ │ ├── App
│ │ │ ├── AppFooter
│ │ │ │ ├── AppFooter.vue
│ │ │ │ ├── AppFooterBottom.vue
│ │ │ │ └── style.scss
│ │ │ └── AppHeader
│ │ │ │ ├── AppHeader.vue
│ │ │ │ ├── Buy
│ │ │ │ ├── BuyHeader.vue
│ │ │ │ └── style.scss
│ │ │ │ ├── Category
│ │ │ │ ├── CategoryHeader.vue
│ │ │ │ └── style.scss
│ │ │ │ ├── CategoryBar
│ │ │ │ ├── CategoryBar.vue
│ │ │ │ └── styles.scss
│ │ │ │ ├── Logo
│ │ │ │ └── LogoHeader.vue
│ │ │ │ ├── Search
│ │ │ │ └── SearchHeader.vue
│ │ │ │ └── style.scss
│ │ └── ProductCategory
│ │ │ ├── ProductCategory.vue
│ │ │ ├── ProductComponent
│ │ │ ├── ProductComponent.vue
│ │ │ └── style.scss
│ │ │ └── style.scss
│ ├── index.scss
│ ├── main.ts
│ ├── registerServiceWorker.ts
│ ├── router
│ │ └── index.ts
│ ├── shims-vue.d.ts
│ ├── store
│ │ ├── Controllers
│ │ │ ├── buyStoreController.ts
│ │ │ ├── categoryStoreController.ts
│ │ │ ├── promotionStoreController.ts
│ │ │ ├── requestController.ts
│ │ │ └── storeController.ts
│ │ ├── Entity
│ │ │ ├── requestModel.ts
│ │ │ ├── store.ts
│ │ │ └── toastMessage.ts
│ │ ├── buyStore.ts
│ │ ├── categoryStore.ts
│ │ ├── promotionStore.ts
│ │ └── store.ts
│ ├── variables.scss
│ └── views
│ │ ├── AppBody
│ │ ├── AppBody.vue
│ │ └── style.scss
│ │ ├── BuyList
│ │ ├── BuyList.vue
│ │ └── style.scss
│ │ ├── Login
│ │ ├── LoginView.vue
│ │ └── style.scss
│ │ └── Register
│ │ ├── RegisterView.vue
│ │ └── style.scss
├── tailwind.config.js
├── tests
│ ├── json
│ │ ├── categoryHeader.json
│ │ └── productCategory.json
│ └── unit
│ │ └── Controllers
│ │ ├── categoryStoreController.spec.ts
│ │ ├── compraStoreController.spec.ts
│ │ ├── destaqueStoreController.spec.ts
│ │ └── storeController.spec.ts
├── tsconfig.json
├── vue.config.js
└── yarn.lock
├── Infra.loja
├── Data
│ └── StoreContext.cs
├── Infra.loja.csproj
├── Migrations
│ ├── 20241222233734_initial.Designer.cs
│ ├── 20241222233734_initial.cs
│ └── StoreContextModelSnapshot.cs
└── WConnectionKeyVault.dll
├── Loja.loja
├── .eslintrc.cjs
├── .gitignore
├── .vscode
│ └── extensions.json
├── Loja.loja.esproj
├── README.md
├── env.d.ts
├── index.html
├── nuget.config
├── package-lock.json
├── package.json
├── public
│ └── favicon.ico
├── src
│ ├── App.vue
│ ├── assets
│ │ ├── base.css
│ │ ├── logo.svg
│ │ └── main.css
│ ├── components
│ │ ├── HelloWorld.vue
│ │ ├── TheWelcome.vue
│ │ ├── WelcomeItem.vue
│ │ └── icons
│ │ │ ├── IconCommunity.vue
│ │ │ ├── IconDocumentation.vue
│ │ │ ├── IconEcosystem.vue
│ │ │ ├── IconSupport.vue
│ │ │ └── IconTooling.vue
│ ├── main.ts
│ └── shims-vue.d.ts
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
├── Loja.sln
├── MicroServices
├── Api.ServicesManager
│ ├── Api.ServicesManager.csproj
│ ├── Api.ServicesManager.http
│ ├── Contracts
│ │ ├── QuartzApplicationServicesContract.cs
│ │ └── SMApplicationServicesContract.cs
│ ├── Controllers
│ │ ├── BaseController.cs
│ │ ├── QuartzController.cs
│ │ └── ServicesManagerController.cs
│ ├── Interfaces
│ │ └── IHostedServices.cs
│ ├── Log4net.config
│ ├── MicroService
│ │ ├── HostedServices.cs
│ │ ├── Quartz
│ │ │ └── QuartzMS.cs
│ │ └── WFileManager
│ │ │ └── WFileManagerMS.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── Services
│ │ ├── QuartzApplicationServices.cs
│ │ └── SMApplicationServices.cs
│ ├── Startup.cs
│ ├── appsettings.Development.json
│ └── appsettings.json
└── Integrations
│ ├── QuartzScheduler
│ ├── ConsoleLogProvider.cs
│ ├── Contracts
│ │ └── QuartzSchedullerContracts.cs
│ ├── Interfaces
│ │ └── IQuartzScheduler.cs
│ ├── Jobs
│ │ └── HelloWorldJob.cs
│ ├── QuartzScheduler.cs
│ ├── QuartzScheduler.csproj
│ ├── ScheduleOnStart.cs
│ └── appsettings.json
│ ├── RabbitMQ.loja
│ ├── Configuration
│ │ └── Configurations.cs
│ ├── FileUploadClient.cs
│ ├── FileUploadServer.cs
│ ├── Interfaces
│ │ └── IFileUploadClient.cs
│ ├── RabbitMQ.loja.csproj
│ ├── appsettings.Development.json
│ └── appsettings.json
│ ├── TopShelf
│ ├── Program.cs
│ └── TopShelf.csproj
│ └── WFileUploader
│ ├── Contracts
│ ├── FileManagerLog.cs
│ ├── Image.cs
│ ├── ReadContracts.cs
│ └── UploadContracts.cs
│ ├── Enum
│ └── UploadOptions.cs
│ ├── FileManager.cs
│ ├── Interfaces
│ ├── IFileObserver.cs
│ └── IFileStrategy.cs
│ ├── ReadStrategy
│ └── ReadFile.cs
│ ├── Utility
│ └── FileManagerUtility.cs
│ ├── WFileManager.csproj
│ └── WriteStrategy
│ └── UploadFile.cs
├── README.md
├── Tests.Loja
├── Api
│ ├── ApplicationService
│ │ ├── AuthenticationApplicationServiceTest.cs
│ │ └── UsersApplicationServiceTest.cs
│ └── PraedicamentaService
│ │ └── PraedicamentaApplicationServiceTest.cs
├── Configuration.cs
├── FrameworkTest
│ ├── CustomAttributesTest
│ │ └── FirstLetterUppercaseAttributeTeste.cs
│ ├── ExtensionMethodsTest
│ │ └── EntensionMethodsTest.cs
│ └── UtilityTest
│ │ └── ReadableFileLengthTest.cs
├── Infra
│ └── StoreContextTest.cs
├── MicroService
│ ├── IntegrationsTest
│ │ ├── QuartzScheduler
│ │ │ └── QuartzSchedulerTest.cs
│ │ └── WFileManagerTest
│ │ │ ├── DirectoryRestrictionTest.cs
│ │ │ ├── FileManagerLogTest.cs
│ │ │ ├── FileManagerTest.cs
│ │ │ └── FileManagerUtility.cs
│ └── MicroServicesManager
│ │ └── HostedServicesTest.cs
├── TestAttributes
│ ├── ExcelValidationAttributesTest.cs
│ └── TestClassAttributes.cs
├── TestFiles
│ └── TestImages
│ │ └── testfile.png
├── TestFilesReader.cs
├── Tests.Loja.csproj
└── Utils
│ ├── ERPlusTest.cs
│ └── NPOITest.cs
├── Utils.loja
├── Enums
│ └── NPOISheetStyles.cs
├── Excel
│ └── NPOIExcel.cs
├── Queue
│ └── Queue.cs
└── Utils.loja.csproj
└── yarn.lock
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # IDE0055: Corrigir a formatação
4 | dotnet_diagnostic.IDE0055.severity = none
5 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "type": "chrome",
9 | "request": "launch",
10 | "name": "Launch Chrome against localhost",
11 | "url": "http://localhost:8080",
12 | "webRoot": "${workspaceFolder}"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/Admin.loja/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | require('@rushstack/eslint-patch/modern-module-resolution')
3 |
4 | module.exports = {
5 | root: true,
6 | 'extends': [
7 | 'plugin:vue/vue3-essential',
8 | 'eslint:recommended',
9 | '@vue/eslint-config-typescript'
10 | ],
11 | parserOptions: {
12 | ecmaVersion: 'latest'
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Admin.loja/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .DS_Store
12 | dist
13 | dist-ssr
14 | coverage
15 | *.local
16 |
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode/*
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
30 | *.tsbuildinfo
31 |
--------------------------------------------------------------------------------
/Admin.loja/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "Vue.volar",
4 | "dbaeumer.vscode-eslint"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/Admin.loja/Admin.loja.esproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | npm run dev
4 | .\
5 |
6 | Jest
7 |
8 | false
9 |
10 | $(MSBuildProjectDirectory)\dist
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Admin.loja/README.md:
--------------------------------------------------------------------------------
1 | # vueapp1.client
2 |
3 | This template should help get you started developing with Vue 3 in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
8 |
9 | ## Type Support for `.vue` Imports in TS
10 |
11 | TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
12 |
13 | ## Customize configuration
14 |
15 | See [Vite Configuration Reference](https://vitejs.dev/config/).
16 |
17 | ## Project Setup
18 |
19 | ```sh
20 | npm install
21 | ```
22 |
23 | ### Compile and Hot-Reload for Development
24 |
25 | ```sh
26 | npm run dev
27 | ```
28 |
29 | ### Type-Check, Compile and Minify for Production
30 |
31 | ```sh
32 | npm run build
33 | ```
34 |
35 | ### Lint with [ESLint](https://eslint.org/)
36 |
37 | ```sh
38 | npm run lint
39 | ```
40 |
--------------------------------------------------------------------------------
/Admin.loja/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 |
--------------------------------------------------------------------------------
/Admin.loja/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Admin.loja/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Admin.loja/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waltereidi/Loja/feba7bc63a0f5eb874a1e15b64c26e9e95bbe3e3/Admin.loja/public/favicon.ico
--------------------------------------------------------------------------------
/Admin.loja/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
26 |
--------------------------------------------------------------------------------
/Admin.loja/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waltereidi/Loja/feba7bc63a0f5eb874a1e15b64c26e9e95bbe3e3/Admin.loja/src/assets/logo.png
--------------------------------------------------------------------------------
/Admin.loja/src/components/Layout/Header/Header.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
14 |
15 |
26 |
27 |
--------------------------------------------------------------------------------
/Admin.loja/src/components/Layout/Header/style.scss:
--------------------------------------------------------------------------------
1 | @import '@/globals/utility.scss';
2 |
3 |
4 | .toolbar{
5 | flex: 1 1 auto;
6 | justify-content: space-between;
7 | }
8 | .toolbar-start{
9 | display: flex;
10 | flex-flow:row wrap;
11 | justify-content: end;
12 | }
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Admin.loja/src/components/Layout/NavBar/style.scss:
--------------------------------------------------------------------------------
1 | @import '@/globals/utility.scss';
2 | //normal display
3 | @media (min-width:$md) {
4 | .mobileOpenNavBar{
5 | display: none;
6 | }
7 | .navBar-container {
8 | display: block;
9 | }
10 | .navBar-close > i {
11 | display: none;
12 | }
13 | }
14 | //mobile display
15 | @media(max-width:$md){
16 | .hidden{
17 | display:none;
18 | }
19 | .visible{
20 | display:block;
21 | }
22 | .navBar-container{
23 | position:fixed;
24 | }
25 | .navBar-close > i {
26 | display: block;
27 | }
28 | .mobileOpenNavBar{
29 | display: block;
30 | }
31 | .card{
32 | min-width: calc(100vw - 48px) ;
33 | }
34 | }
--------------------------------------------------------------------------------
/Admin.loja/src/components/Toast/style.scss:
--------------------------------------------------------------------------------
1 | .toast-content {
2 | display: flex;
3 | flex-flow: column;
4 | gap: 20px;
5 | }
6 | .hide {
7 | display: none;
8 | }
9 |
--------------------------------------------------------------------------------
/Admin.loja/src/components/Utility/Modals/UploadPicture.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
19 |
20 |
21 |
22 |
29 |
30 |
--------------------------------------------------------------------------------
/Admin.loja/src/globals/utility.scss:
--------------------------------------------------------------------------------
1 |
2 | $sm:640px;
3 | $md:768px;
4 | $lg:1024px;
5 | $xl:1280px;
6 | $xxl:1536px;
7 |
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Controllers/LogController.ts:
--------------------------------------------------------------------------------
1 | import {Log , LogSeverity} from '@/pinia/Types/Log'
2 | export class LogController{
3 |
4 | constructor(serviceDescription:String){
5 | this.log.push({
6 | Severity : LogSeverity.Initialization,
7 | Description: `${serviceDescription}`,
8 | Created_At: new Date()
9 | })
10 | }
11 |
12 | log:Log[] = []
13 | /**
14 | * a single log with success = false tell the operation has failed
15 | * log with type should be used to improved legibility
16 | * @param { bool } success
17 | * @param { string } description
18 | * @param { int } severity
19 | */
20 | addLog(description:String , severity:LogSeverity ):Number
21 | {
22 | if(import.meta.env.mode && severity == LogSeverity.Error)
23 | console.log(this.getLog())
24 |
25 | return this.log.push({
26 | Description : description ,
27 | Severity : severity ,
28 | Created_At : new Date()
29 | })
30 | }
31 |
32 | /**
33 | * Find if theres an error logged
34 | */
35 | hasError = ():Boolean => this.log
36 | .some(x=>x.Severity === LogSeverity.Error )
37 |
38 | /**
39 | * get entireLog sorted by Id
40 | * @returns []object
41 | */
42 | //@ts-ignore
43 | getLog =():Log[]=> this.log.sort((prev , next) => prev.Created_At - next.Created_At )
44 |
45 |
46 | }
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Controllers/dependencyInjectionController.ts:
--------------------------------------------------------------------------------
1 | import { LogSeverity } from "../Types/Log";
2 | import { IDependencyInjection } from "../Interfaces/IDependencyInjection";
3 | import { LogController } from "./LogController";
4 | import { RequestController } from "./requestController";
5 |
6 | //** OCP must be used only once per dependency request */
7 | export class DepencyInjectionController implements IDependencyInjection
8 | {
9 | public log:LogController = new LogController("DepencyInjectionController")
10 | private serviceName:string;
11 | private params:any;
12 |
13 | constructor( serviceName:string , params?:any ){
14 | this.serviceName = serviceName;
15 | this.params = params;
16 |
17 | this.log.addLog( `constructor ${serviceName} , ${Object.keys(params??{}).join(',') }` , LogSeverity.Initialization);
18 | }
19 |
20 | //** IOC the entire operation must be handled here*/
21 | public getService() : any
22 | {
23 | this.log.addLog( `get Service` , LogSeverity.Event);
24 | switch(this.serviceName.toLocaleLowerCase() ){
25 | case 'request' : return this.getRequest();
26 | default : throw new Error(`Invalid operation exception ${this.serviceName}`);
27 | }
28 | }
29 | private getRequest() : RequestController
30 | {
31 | this.log.addLog( `getRequest` , LogSeverity.Event);
32 | return new RequestController();
33 | }
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Controllers/gReCaptcha_v2.ts:
--------------------------------------------------------------------------------
1 | export class GReCaptcha_v2{
2 |
3 |
4 |
5 | }
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Interfaces/IConfigureToast.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * documentation
3 | * @link https://primevue.org/toast/
4 | */
5 | export interface IConfigureToast{
6 | /** refers to toast color */
7 | severity:ToastSeverity;
8 | /** refers to title */
9 | summary:string;
10 | /** refers to message content */
11 | detail:string;
12 | /** refers to duration in miliseconds */
13 | life: number;
14 | }
15 |
16 | export enum ToastSeverity {
17 | success , //green
18 | info , //light blue
19 | warn, //orange
20 | danger , //red
21 | secondary , //light gray
22 | contrast , //black
23 | }
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Interfaces/IDependencyInjection.ts:
--------------------------------------------------------------------------------
1 |
2 | import { LogController } from "../Controllers/LogController"
3 | export interface IDependencyInjection{
4 | log:LogController
5 | }
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Types/Log.ts:
--------------------------------------------------------------------------------
1 |
2 | export interface Log{
3 | Description:String ,
4 | Severity:LogSeverity,
5 | Created_At:Date
6 | }
7 | /**
8 | * This interface is sensitive to order
9 | * starts in lower severity and end in highest severity
10 | */
11 | export enum LogSeverity{
12 | Event ,
13 | Initialization ,
14 | Parameter,
15 | Error,
16 | }
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Types/mainStore.ts:
--------------------------------------------------------------------------------
1 |
2 | export type MainStoreServices ={
3 | /** refer to toast service instanced in app.vue */
4 | useToast:any,
5 | }
6 |
7 |
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Types/requestModel.ts:
--------------------------------------------------------------------------------
1 | export type RequestModel = {
2 | method: string
3 | url: string
4 | body?: any
5 | }
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Types/routerInfo.ts:
--------------------------------------------------------------------------------
1 |
2 | export type RouterInfo = {
3 | to:any ,
4 | from:any ,
5 | }
6 | export enum RouteCondition
7 | {
8 | HiddenNavBar ,
9 | ShowNavBar ,
10 | RedirectToHome ,
11 | RedirectToLogin ,
12 | Contiue,
13 | }
14 | export type RouteConditionResponse = {
15 | route:RouteCondition ,
16 | ui:RouteCondition ,
17 | user:RouteCondition,
18 | }
19 |
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/Types/session.ts:
--------------------------------------------------------------------------------
1 | export type UserInfo = {
2 | nameInitials:string,
3 | firstName:string,
4 | lastName:string,
5 | jwtToken:JwtToken
6 | }
7 |
8 | export type JwtToken = {
9 | createdAt:Date,
10 | expiresAt:Date,
11 | }
12 |
--------------------------------------------------------------------------------
/Admin.loja/src/pinia/mainStore.ts:
--------------------------------------------------------------------------------
1 | import { defineStore } from 'pinia';
2 | import { MainStoreServices} from '@/pinia/Types/mainStore'
3 | import { ToastSeverity ,IConfigureToast } from './Interfaces/IConfigureToast';
4 | import { useToast } from "primevue/usetoast";
5 | export const useMainStore = defineStore('mainStore', {
6 |
7 | state: () => {
8 | return ({
9 | useToast: useToast(),
10 | } as MainStoreServices )
11 | },
12 | actions: {
13 | async toast(message:string , severity:ToastSeverity , useToast:any = null): Promise
14 | {
15 | this.useToast = this.useToast ?? useToast;
16 | this.useToast.add({
17 | severity: ToastSeverity[severity],
18 | summary: severity.toString() ,
19 | detail: message,
20 | life: 3000
21 | })
22 |
23 | },
24 | async toastMessage(toast:IConfigureToast ) : Promise
25 | {
26 | this.useToast.add({
27 | severity: ToastSeverity[toast.severity],
28 | summary: toast.summary ,
29 | detail: toast.detail,
30 | life: toast.life
31 | })
32 |
33 | },
34 |
35 | },
36 |
37 |
38 |
39 |
40 | });
--------------------------------------------------------------------------------
/Admin.loja/src/router/index.ts:
--------------------------------------------------------------------------------
1 | import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
2 | const routes = [
3 | {
4 | path: '/',
5 | name: 'Login',
6 | component: () => import('../views/Login/LoginView.vue')
7 | },
8 | {
9 | path: '/store/categories',
10 | name: 'store/categories',
11 | component: () => import('../views/Store/Categories/CategoriesView.vue')
12 | },
13 |
14 | ];
15 |
16 | const router = createRouter({
17 | history: createWebHistory(),
18 | routes: routes,
19 | scrollBehavior(to, from, savedPosition) {
20 | return { top: 0 }
21 | },
22 |
23 | })
24 |
25 | export { routes };
26 | export default router
--------------------------------------------------------------------------------
/Admin.loja/src/style.scss:
--------------------------------------------------------------------------------
1 | .navBar {
2 | flex:0 0 auto;
3 | }
4 | .header{
5 | width: 100%;
6 | }
7 | .view-container{
8 |
9 | }
10 |
11 | .app-container {
12 |
13 | display: flex ;
14 | flex-flow: row;
15 |
16 | }
17 | .routerView {
18 | display: flex;
19 | flex:1 1 auto;
20 | justify-content: center;
21 | }
22 |
--------------------------------------------------------------------------------
/Admin.loja/src/tests/unit/pinia/controllers/logController.spec.ts:
--------------------------------------------------------------------------------
1 | import { expect, test } from 'vitest'
2 | import { LogController } from '@/pinia/Controllers/LogController'
3 | import { LogSeverity } from '@/pinia/Types/Log';
4 |
5 | test('add log returns has error when add success false log', () => {
6 | const logger = new LogController("TestCase Log");
7 |
8 | logger.addLog('TestPurposes log' ,0 )
9 | logger.addLog('TestPurposes Log' , LogSeverity.Error )
10 | logger.addLog('TestPurposes Log' ,0)
11 |
12 | expect( logger.hasError() ).toBe(true)
13 | //An aditional log is inserted from logger contructor
14 | expect( logger.getLog().length ).toBe(4)
15 | })
16 |
--------------------------------------------------------------------------------
/Admin.loja/src/tests/unit/pinia/controllers/requestController.spec.ts:
--------------------------------------------------------------------------------
1 | import { expect, test } from 'vitest'
2 | import { RequestController } from '@/pinia/Controllers/requestController'
3 |
4 | const request = new RequestController();
5 | test('request post returns a result',async () => {
6 |
7 | const res =await request.post('https://testCase.com' , null )
8 | //console.log(res)
9 | expect(res.status).to.not.toBeNull()
10 | })
11 | test('request get returns a result',async () => {
12 |
13 | const res =await request.get('https://testCase.com' )
14 | //console.log(res)
15 | expect(res.status).to.not.toBeNull()
16 | })
17 | test('request get returns a result',async () => {
18 |
19 | const res =await request.put('https://testCase.com' ,null)
20 | //console.log(res)
21 | expect(res.status).to.not.toBeNull()
22 | })
23 | test('request get returns a result',async () => {
24 |
25 | const res =await request.delete('https://testCase.com' )
26 | //console.log(res)
27 | expect(res.status).to.not.toBeNull()
28 | })
--------------------------------------------------------------------------------
/Admin.loja/src/tests/unit/pinia/controllers/sessionController.spec.ts:
--------------------------------------------------------------------------------
1 | import { describe, it, expect, vi ,beforeEach , afterEach} from 'vitest';
2 | import { SessionController } from '@/pinia/Controllers/sessionController';
3 |
4 | describe('sessionStorage mock', () => {
5 | //SessionStorage mock
6 | beforeEach(() => {
7 |
8 | const mockStorage = {};
9 | vi.stubGlobal('sessionStorage', {
10 | getItem: vi.fn((key) => mockStorage[key] || null),
11 | setItem: vi.fn((key, value) => {
12 | mockStorage[key] = value;
13 | }),
14 | removeItem: vi.fn((key) => {
15 | delete mockStorage[key];
16 | }),
17 | clear: vi.fn(() => {
18 | for (const key in mockStorage) {
19 | delete mockStorage[key];
20 | }
21 | }),
22 | });
23 | });
24 |
25 | afterEach(() => {
26 | vi.restoreAllMocks();
27 | });
28 |
29 | it('set session and get Session',async ()=>{
30 | // sessionStorage is mocked by 'vitest-localstorage-mock'
31 |
32 |
33 | const session = new SessionController()
34 | const userInfo:UserInfo = {
35 | firstName:"testCase",
36 | lastName:"caseTest",
37 | nameInitials:"TC",
38 | jwtToken:{
39 | createdAt: new Date(),
40 | expiresAt: new Date()
41 | }
42 | };
43 | session.setUserInfoSession(userInfo);
44 | const result = session.getUserInfoSession()
45 |
46 | expect(sessionStorage.getItem).toBeCalledTimes(5);
47 |
48 | expect(userInfo).toMatchObject(result);
49 | })
50 | });
51 |
--------------------------------------------------------------------------------
/Admin.loja/src/tests/unit/pinia/dependencyInjection.spec.ts:
--------------------------------------------------------------------------------
1 | import { expect, test , describe , beforeEach , it } from 'vitest';
2 | import { DepencyInjectionController } from '@/pinia/Controllers/dependencyInjectionController'
3 | import { RequestController } from '@/pinia/Controllers/requestController';
4 |
5 | it( 'di returns request controller' , ()=>{
6 |
7 | const di = new DepencyInjectionController('request')
8 | const request = di.getService();
9 |
10 | expect(request).toBeInstanceOf(RequestController)
11 |
12 | })
--------------------------------------------------------------------------------
/Admin.loja/src/tests/unit/pinia/mainStore.spec.ts:
--------------------------------------------------------------------------------
1 | import { expect, test , describe , beforeEach } from 'vitest';
2 | import { mount ,shallowMount} from '@vue/test-utils'
3 | import { setActivePinia, createPinia } from 'pinia'
4 | import { useMainStore } from '@/pinia/mainStore';
5 | import Toast from 'primevue/toast';
6 | import App from '@/App.vue'
7 | import PrimeVue from 'primevue/config';
8 | describe('Dependency injection store', () => {
9 | beforeEach(() => {
10 | // creates a fresh pinia and makes it active
11 | // so it's automatically picked up by any useStore() call
12 | // without having to pass it to it: `useStore(pinia)`
13 | setActivePinia(createPinia())
14 |
15 |
16 | })
17 |
18 | test('test' ,async () => {
19 | const store = useMainStore()
20 | type toastComponent = Record;
21 | const com:toastComponent = {
22 | "Toast": Toast
23 | }
24 |
25 | const wrapper = mount(App, {
26 | global: {
27 | plugins: [PrimeVue],
28 |
29 | components: { com },
30 |
31 | },
32 |
33 |
34 | })
35 | wrapper.
36 |
37 | expect(wrapper.find('.messagecontent').exists()).toBe(true)
38 |
39 |
40 | })
41 |
42 |
43 |
44 | })
--------------------------------------------------------------------------------
/Admin.loja/src/tests/views/components/Layout/Header.spec.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waltereidi/Loja/feba7bc63a0f5eb874a1e15b64c26e9e95bbe3e3/Admin.loja/src/tests/views/components/Layout/Header.spec.ts
--------------------------------------------------------------------------------
/Admin.loja/src/tests/views/components/Layout/NavBar.spec.ts:
--------------------------------------------------------------------------------
1 | import { expect, test , describe , beforeEach } from 'vitest';
2 | import { mount} from '@vue/test-utils'
3 | import NavBar from '@/components/Layout/NavBar/NavBar.vue'
4 | import PrimeVue from 'primevue/config';
5 | import { createRouter, createWebHistory } from 'vue-router'
6 | import { routes } from "@/router/index.ts"
7 |
8 |
9 | describe('navBar test', () => {
10 |
11 | const router = createRouter({
12 | history: createWebHistory(),
13 | routes: routes,
14 | })
15 |
16 | test('navBar is visible when route is different than /' ,async () => {
17 | const wrapper = mount(NavBar, {
18 | global: {
19 | plugins: [PrimeVue, router],
20 | }
21 | })
22 | router.push('/sdsd')
23 | await router.isReady()
24 |
25 | expect(wrapper.find('.navBar-container').exists()).toBe(true)
26 | })
27 |
28 | })
--------------------------------------------------------------------------------
/Admin.loja/src/theme.scss:
--------------------------------------------------------------------------------
1 | .theme-primary{
2 | background-color:blue;
3 | border-color: teal;
4 | }
--------------------------------------------------------------------------------
/Admin.loja/src/views/Home/HomeView.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | s
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Admin.loja/src/views/Login/script.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/waltereidi/Loja/feba7bc63a0f5eb874a1e15b64c26e9e95bbe3e3/Admin.loja/src/views/Login/script.ts
--------------------------------------------------------------------------------
/Admin.loja/src/views/Login/style.scss:
--------------------------------------------------------------------------------
1 | .center {
2 | display: flex;
3 | align-items: center;
4 | justify-content: center;
5 | }
6 |
7 | .container {
8 | display: flex;
9 | flex-flow: column;
10 | justify-content: space-around;
11 | justify-items: center;
12 | align-content: space-around;
13 | align-items: center;
14 | gap: 20px;
15 |
16 | &--title {
17 | flex: 0 0 auto;
18 | }
19 |
20 | &--content {
21 | flex: 1 1 auto;
22 | max-width: 100%;
23 | }
24 |
25 | @media (max-width: 480px) {
26 | &--actions {
27 | flex: 0 0 100%;
28 | }
29 | }
30 | @media (min-width: 481px) {
31 | &--actions {
32 | flex: 0 0 auto;
33 | }
34 | }
35 | }
36 | .login-img {
37 | max-width: 200px;
38 | }
39 |
--------------------------------------------------------------------------------
/Admin.loja/src/views/Store/Categories/script.ts:
--------------------------------------------------------------------------------
1 |
2 |
49 |
50 |
--------------------------------------------------------------------------------
/Admin.loja/src/views/Store/Categories/style.scss:
--------------------------------------------------------------------------------
1 | .center {
2 | display: flex;
3 | align-items: center;
4 | justify-content: center;
5 | width: 100vw;
6 | height: 100vh;
7 | }
8 |
9 | .container {
10 | display: flex;
11 | flex-flow: column;
12 | justify-content: space-around;
13 | justify-items: center;
14 | align-content: space-around;
15 | align-items: center;
16 | gap: 20px;
17 |
18 | &--title {
19 | flex: 0 0 auto;
20 | }
21 |
22 | &--content {
23 | flex: 1 1 auto;
24 | max-width: 100%;
25 | }
26 |
27 | @media (max-width: 480px) {
28 | &--actions {
29 | flex: 0 0 100%;
30 | }
31 | }
32 | @media (min-width: 481px) {
33 | &--actions {
34 | flex: 0 0 auto;
35 | }
36 | }
37 | }
38 | .login-img {
39 | max-width: 200px;
40 | }
41 |
--------------------------------------------------------------------------------
/Admin.loja/src/views/Store/Users/UsersView.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | s
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Admin.loja/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@vue/tsconfig/tsconfig.dom.json",
3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4 | "exclude": ["src/**/__tests__/*"],
5 | "compilerOptions": {
6 | "composite": true,
7 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
8 |
9 | "baseUrl": ".",
10 | "paths": {
11 | "@/*": ["./src/*"]
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Admin.loja/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "esnext",
5 | "strict": true,
6 | "jsx": "preserve",
7 | "importHelpers": true,
8 | "moduleResolution": "node",
9 | "skipLibCheck": true,
10 | "esModuleInterop": true,
11 | "allowSyntheticDefaultImports": true,
12 | "forceConsistentCasingInFileNames": true,
13 | "useDefineForClassFields": true,
14 | "sourceMap": true,
15 | "resolveJsonModule":true,
16 | "baseUrl": ".",
17 | "types": [
18 | "webpack-env"
19 | ],
20 | "paths": {
21 | "@/*": [
22 | "src/*"
23 | ]
24 | },
25 | "lib": [
26 | "esnext",
27 | "dom",
28 | "dom.iterable",
29 | "scripthost"
30 | ]
31 | },
32 | "include": [
33 | "src/**/*.ts",
34 | "src/**/*.tsx",
35 | "src/**/*.vue",
36 | "tests/**/*.ts",
37 | "tests/**/*.tsx"
38 | , "src/tests/views/App.spec.js" ],
39 | "exclude": [
40 | "node_modules"
41 | ]
42 | }
43 |
--------------------------------------------------------------------------------
/Admin.loja/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/node20/tsconfig.json",
3 | "include": [
4 | "vite.config.*",
5 | "vitest.config.*",
6 | "cypress.config.*",
7 | "nightwatch.conf.*",
8 | "playwright.config.*"
9 | ],
10 | "compilerOptions": {
11 | "composite": true,
12 | "noEmit": true,
13 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
14 |
15 | "module": "ESNext",
16 | "moduleResolution": "Bundler",
17 | "types": ["node"]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Admin.loja/vitest.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vitest/config'
2 | import vue from '@vitejs/plugin-vue'
3 |
4 | export default defineConfig({
5 | plugins: [
6 |
7 | vue({
8 | // Try adding these options if you're having compilation issues
9 | template: {
10 | compilerOptions: {
11 |
12 | // Add any specific compiler options
13 | }
14 | }
15 | })
16 | ],
17 | test: {
18 | alias: {
19 | '@': new URL('./src/', import.meta.url).pathname,
20 |
21 | },
22 | globals: true,
23 | environment: 'jsdom', // Ensure this is set
24 | deps: {
25 | inline: ['vue'] // Sometimes helps with compilation
26 | },
27 | include: ['src/tests/**/*.spec.ts'],
28 | setupFiles: './src/main.ts'
29 | },
30 | })
--------------------------------------------------------------------------------
/Api.loja/Contracts/ProductManagerContract.cs:
--------------------------------------------------------------------------------
1 | namespace Api.loja.Contracts
2 | {
3 | public static class ProductManagerContract
4 | {
5 | public class V1
6 | {
7 |
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Api.loja/Contracts/UploadContract.cs:
--------------------------------------------------------------------------------
1 | namespace Api.loja.Contracts
2 | {
3 | public class UploadContract
4 | {
5 | public class V1
6 | {
7 | public record class UploadFile(IFormFile file, HttpRequest request);
8 | public record class UploadMultipleFiles(IFormFileCollection files, HttpRequest request);
9 | public record class UploadFileResponse();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Api.loja/Contracts/UsersContract.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Api.loja.Contracts
3 | {
4 | public class UsersContract
5 | {
6 | public class V1
7 | {
8 | public class Requests
9 | {
10 | public record GetUsuariosById(int id);
11 |
12 | public record GetUsuarios(int pagination , int amount);
13 | public record AddUsuario(int? id);
14 | public record DeleteUsuario(int id, string reason);
15 | public record UpdateUsuario(int id
16 | , string email
17 | , string password
18 | , string firstName
19 | , string lastName
20 | , string address
21 | , string phoneNumber
22 | );
23 | public record UpdateUserPermission(
24 | int userId
25 |
26 | );
27 | }
28 | public class Responses
29 | {
30 | public record Clients(int? id
31 | , string firstName
32 | , string lastName
33 | , string email
34 | , string address
35 | , DateTime? updated_at
36 | , DateTime created_at);
37 |
38 | }
39 |
40 |
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Api.loja/Controllers/Admin/AuthenticationController.cs:
--------------------------------------------------------------------------------
1 | using Api.loja.Contracts;
2 | using Api.loja.Service;
3 | using Microsoft.AspNetCore.Authorization;
4 | using Microsoft.AspNetCore.Mvc;
5 | using static Api.loja.Contracts.AuthenticationContract;
6 | namespace Api.loja.Controllers.Admin
7 | {
8 | [Route("api/Admin/Authentication/[action]")]
9 | [ApiController]
10 | public class AuthenticationController : BaseController
11 | {
12 | private readonly AuthenticationApplicationService _service;
13 | public AuthenticationController(ILogger logger , AuthenticationApplicationService service ) : base(logger)
14 | {
15 | _service = service;
16 | }
17 | [HttpPost]
18 | [ProducesResponseType(StatusCodes.Status200OK)]
19 | [ProducesResponseType(StatusCodes.Status400BadRequest)]
20 | [ProducesResponseType(StatusCodes.Status500InternalServerError)]
21 | public async Task Login(V1.Request.LoginRequest login)
22 | => await HandleRequest(new V1.Request.LoginRequestContext(login, HttpContext.Request.HttpContext.Connection.RemoteIpAddress , HttpContext ), _service.Handle);
23 |
24 | [HttpGet]
25 | [Authorize]
26 | [ProducesResponseType(StatusCodes.Status200OK)]
27 | public async Task GetUserInfo()
28 | => await HandleRequest(new V1.Request.GetUserInfo(HttpContext), _service.Handle);
29 |
30 | }
31 | }
--------------------------------------------------------------------------------
/Api.loja/Controllers/Utility/UploadController.cs:
--------------------------------------------------------------------------------
1 |
2 | using Api.loja.Service;
3 | using Microsoft.AspNetCore.Authorization;
4 | using Microsoft.AspNetCore.Mvc;
5 | using static Api.loja.Contracts.UploadContract.V1;
6 | namespace Api.loja.Controllers.Utility
7 | {
8 | [Route("api/Utility/[action]")]
9 | [ApiController]
10 | [Authorize]
11 | public class UploadController : BaseController
12 | {
13 | private readonly UploadApplicationService _service;
14 | public UploadController(ILogger logger ,UploadApplicationService service) : base(logger)
15 | {
16 | _service = service;
17 | }
18 | [HttpPost]
19 | public Task UploadFile(IFormFile file ) => HandleRequest(new UploadFile(file , HttpContext.Request), _service.Handle);
20 | [HttpPost]
21 | public Task UploadMultipleFiles(IFormFileCollection files) => HandleRequest(new UploadMultipleFiles(HttpContext.Request.Form.Files, HttpContext.Request), _service.Handle);
22 |
23 | }
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/Api.loja/Middleware/AuthenticationMiddleware.cs:
--------------------------------------------------------------------------------
1 | namespace Api.loja.Middleware
2 | {
3 | public class AuthenticationMiddleware
4 | {
5 |
6 | private readonly RequestDelegate _next;
7 | public AuthenticationMiddleware(RequestDelegate next)
8 | {
9 | _next = next;
10 | }
11 | public async Task InvokeAsync(HttpContext context)
12 | {
13 | // Custom logic to be executed before the next middleware
14 | // …
15 | await _next(context);
16 | // Custom logic to be executed after the next middleware
17 | // …
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Api.loja/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Security.Authentication;
2 |
3 | namespace Api.loja
4 | {
5 | public class Program
6 | {
7 | public static void Main(string[] args)
8 | {
9 | CreateHostBuilder(args).Build().Run();
10 | }
11 | public static IHostBuilder CreateHostBuilder(string[] args) =>
12 | Host.CreateDefaultBuilder(args)
13 | .ConfigureWebHostDefaults(webBuilder =>
14 | {
15 | webBuilder
16 | .UseStartup();
17 | });
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/Api.loja/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "http": {
4 | "commandName": "Project",
5 | "launchBrowser": true,
6 | "launchUrl": "swagger",
7 | "environmentVariables": {
8 | "ASPNETCORE_ENVIRONMENT": "Development",
9 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
10 | },
11 | "dotnetRunMessages": true,
12 | "applicationUrl": "http://localhost:5556"
13 | },
14 | "https": {
15 | "commandName": "Project",
16 | "launchBrowser": true,
17 | "launchUrl": "swagger",
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development",
20 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
21 | },
22 | "dotnetRunMessages": true,
23 | "applicationUrl": "https://localhost:7179;http://localhost:5232"
24 | },
25 | "IIS Express": {
26 | "commandName": "IISExpress",
27 | "launchBrowser": true,
28 | "launchUrl": "swagger",
29 | "environmentVariables": {
30 | "ASPNETCORE_ENVIRONMENT": "Development",
31 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy"
32 | }
33 | }
34 | },
35 | "$schema": "http://json.schemastore.org/launchsettings.json",
36 | "iisSettings": {
37 | "windowsAuthentication": true,
38 | "anonymousAuthentication": true,
39 | "iisExpress": {
40 | "applicationUrl": "http://localhost:34373",
41 | "sslPort": 0
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/Api.loja/Service/ProductManagerApplicationService.cs:
--------------------------------------------------------------------------------
1 | using Api.loja.Data;
2 | using Dominio.loja.Events.Authentication;
3 | using Framework.loja.Interfaces;
4 |
5 | namespace Api.loja.Service
6 | {
7 | public class ProductManagerApplicationService : IApplicationService
8 | {
9 | private readonly StoreContext _context;
10 | public ProductManagerApplicationService(StoreContext context)
11 | {
12 | _context = context;
13 | }
14 |
15 | public async Task