diff --git a/.github/workflows/CD_Backend.yml b/.github/workflows/CD_Backend.yml
index 0025cf0..f37f29e 100644
--- a/.github/workflows/CD_Backend.yml
+++ b/.github/workflows/CD_Backend.yml
@@ -1,51 +1,51 @@
-name: CD_Backend
-
-permissions:
- contents: write
-
-on:
- push:
- branches:
- - dev
-
-jobs:
- version-and-release:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Bump version and push tag
- id: tag_version
- uses: mathieudutour/github-tag-action@v6.2
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: login to docker registry
- uses: docker/login-action@v3
- with:
- username: ${{secrets.DOCKERHUB_USERNAME}}
- password: ${{secrets.DOCKERHUB_TOKEN}}
-
- - name: build and push docker image to registry
- uses: docker/build-push-action@v5
- with:
- context: .
- push: true
- tags: mohammadsadeghmontazeri/starback:latest
-
- - name: Create Release
- id: create_release
- uses: actions/create-release@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- tag_name: ${{ steps.tag_version.outputs.new_tag }}
- release_name: Release ${{ steps.tag_version.outputs.new_tag }}
- body: |
- steps.tag_version.outputs.changelog
- draft: false
- prerelease: false
+name: CD_Backend
+
+permissions:
+ contents: write
+
+on:
+ push:
+ branches:
+ - dev
+
+jobs:
+ version-and-release:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Bump version and push tag
+ id: tag_version
+ uses: mathieudutour/github-tag-action@v6.2
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: login to docker registry
+ uses: docker/login-action@v3
+ with:
+ username: ${{secrets.DOCKERHUB_USERNAME}}
+ password: ${{secrets.DOCKERHUB_TOKEN}}
+
+ - name: build and push docker image to registry
+ uses: docker/build-push-action@v5
+ with:
+ context: backend.Dockerfile
+ push: true
+ tags: mohammadsadeghmontazeri/starback:latest
+
+ - name: Create Release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ steps.tag_version.outputs.new_tag }}
+ release_name: Release ${{ steps.tag_version.outputs.new_tag }}
+ body: |
+ steps.tag_version.outputs.changelog
+ draft: false
+ prerelease: false
diff --git a/.github/workflows/CI_Backend.yml b/.github/workflows/CI_Backend.yml
index fe0cdce..e113f27 100644
--- a/.github/workflows/CI_Backend.yml
+++ b/.github/workflows/CI_Backend.yml
@@ -1,28 +1,28 @@
-name: CI_Backend
-
-on:
- pull_request:
- branches:
- - dev
-
-jobs:
- build-and-test:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Setup .NET
- uses: actions/setup-dotnet@v3
- with:
- dotnet-version: "6.0.x"
-
- - name: Restore dependencies
- run: dotnet restore
-
- - name: Build project
- run: dotnet build --configuration Release --no-restore
-
- - name: Run tests
- run: dotnet test --no-build --verbosity normal
+name: CI_Backend
+
+on:
+ pull_request:
+ branches:
+ - dev
+
+jobs:
+ build-and-test:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: "6.0.x"
+
+ - name: Restore dependencies
+ run: dotnet restore
+
+ - name: Build project
+ run: dotnet build --configuration Release --no-restore
+
+ - name: Run tests
+ run: dotnet test --no-build --verbosity normal
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..81221a8
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,32 @@
+name: test
+
+permissions:
+ contents: write
+
+on:
+ push:
+ branches:
+ - fixcompose
+
+jobs:
+ version-and-release:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: login to docker registry
+ uses: docker/login-action@v3
+ with:
+ username: ${{secrets.DOCKERHUB_USERNAME}}
+ password: ${{secrets.DOCKERHUB_TOKEN}}
+
+ - name: build and push docker image to registry
+ uses: docker/build-push-action@v5
+ with:
+ context: migrate.Dockerfile
+ push: true
+ tags: mohammadsadeghmontazeri/migratestar:latest
diff --git a/.gitignore b/.gitignore
index 58c6b19..006474c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,808 +1,808 @@
-# Created by https://www.toptal.com/developers/gitignore/api/dotnetcore,aspnetcore,csharp,rider,visualstudiocode,visualstudio
-# Edit at https://www.toptal.com/developers/gitignore?templates=dotnetcore,aspnetcore,csharp,rider,visualstudiocode,visualstudio
-
-### ASPNETCore ###
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-
-# User-specific files
-*.suo
-*.user
-*.userosscache
-*.sln.docstates
-
-# User-specific files (MonoDevelop/Xamarin Studio)
-*.userprefs
-
-# Build results
-[Dd]ebug/
-[Dd]ebugPublic/
-[Rr]elease/
-[Rr]eleases/
-x64/
-x86/
-bld/
-[Bb]in/
-[Oo]bj/
-[Ll]og/
-
-# Visual Studio 2015 cache/options directory
-.vs/
-# Uncomment if you have tasks that create the project's static files in wwwroot
-#wwwroot/
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-
-# NUNIT
-*.VisualState.xml
-TestResult.xml
-
-# Build Results of an ATL Project
-[Dd]ebugPS/
-[Rr]eleasePS/
-dlldata.c
-
-# DNX
-project.lock.json
-project.fragment.lock.json
-artifacts/
-
-*_i.c
-*_p.c
-*_i.h
-*.ilk
-*.meta
-*.obj
-*.pch
-*.pdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*.log
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.svclog
-*.scc
-
-# Chutzpah Test files
-_Chutzpah*
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opendb
-*.opensdf
-*.sdf
-*.cachefile
-*.VC.db
-*.VC.VC.opendb
-
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-*.sap
-
-# TFS 2012 Local Workspace
-$tf/
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-*.DotSettings.user
-
-# JustCode is a .NET coding add-in
-.JustCode
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# Visual Studio code coverage results
-*.coverage
-*.coveragexml
-
-# NCrunch
-_NCrunch_*
-.*crunch*.local.xml
-nCrunchTemp_*
-
-# MightyMoose
-*.mm.*
-AutoTest.Net/
-
-# Web workbench (sass)
-.sass-cache/
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.[Pp]ublish.xml
-*.azurePubxml
-# TODO: Comment the next line if you want to checkin your web deploy settings
-# but database connection strings (with potential passwords) will be unencrypted
-*.pubxml
-*.publishproj
-
-# Microsoft Azure Web App publish settings. Comment the next line if you want to
-# checkin your Azure Web App publish settings, but sensitive information contained
-# in these scripts will be unencrypted
-PublishScripts/
-
-# NuGet Packages
-*.nupkg
-# The packages folder can be ignored because of Package Restore
-**/packages/*
-# except build/, which is used as an MSBuild target.
-!**/packages/build/
-# Uncomment if necessary however generally it will be regenerated when needed
-#!**/packages/repositories.config
-# NuGet v3's project.json files produces more ignoreable files
-*.nuget.props
-*.nuget.targets
-
-# Microsoft Azure Build Output
-csx/
-*.build.csdef
-
-# Microsoft Azure Emulator
-ecf/
-rcf/
-
-# Windows Store app package directories and files
-AppPackages/
-BundleArtifacts/
-Package.StoreAssociation.xml
-_pkginfo.txt
-
-# Visual Studio cache files
-# files ending in .cache can be ignored
-*.[Cc]ache
-# but keep track of directories ending in .cache
-!*.[Cc]ache/
-
-# Others
-ClientBin/
-~$*
-*~
-*.dbmdl
-*.dbproj.schemaview
-*.jfm
-*.pfx
-*.publishsettings
-node_modules/
-orleans.codegen.cs
-
-# Since there are multiple workflows, uncomment next line to ignore bower_components
-# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
-#bower_components/
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-
-# SQL Server files
-*.mdf
-*.ldf
-
-# Business Intelligence projects
-*.rdl.data
-*.bim.layout
-*.bim_*.settings
-
-# Microsoft Fakes
-FakesAssemblies/
-
-# GhostDoc plugin setting file
-*.GhostDoc.xml
-
-# Node.js Tools for Visual Studio
-.ntvs_analysis.dat
-
-# Visual Studio 6 build log
-*.plg
-
-# Visual Studio 6 workspace options file
-*.opt
-
-# Visual Studio LightSwitch build output
-**/*.HTMLClient/GeneratedArtifacts
-**/*.DesktopClient/GeneratedArtifacts
-**/*.DesktopClient/ModelManifest.xml
-**/*.Server/GeneratedArtifacts
-**/*.Server/ModelManifest.xml
-_Pvt_Extensions
-
-# Paket dependency manager
-.paket/paket.exe
-paket-files/
-
-# FAKE - F# Make
-.fake/
-
-# JetBrains Rider
-.idea/
-*.sln.iml
-
-# CodeRush
-.cr/
-
-# Python Tools for Visual Studio (PTVS)
-__pycache__/
-*.pyc
-
-# Cake - Uncomment if you are using it
-# tools/
-
-### Csharp ###
-##
-## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
-
-# User-specific files
-*.rsuser
-
-# User-specific files (MonoDevelop/Xamarin Studio)
-
-# Mono auto generated files
-mono_crash.*
-
-# Build results
-[Ww][Ii][Nn]32/
-[Aa][Rr][Mm]/
-[Aa][Rr][Mm]64/
-[Ll]ogs/
-
-# Visual Studio 2015/2017 cache/options directory
-# Uncomment if you have tasks that create the project's static files in wwwroot
-
-# Visual Studio 2017 auto generated files
-Generated\ Files/
-
-# MSTest test Results
-
-# NUnit
-nunit-*.xml
-
-# Build Results of an ATL Project
-
-# Benchmark Results
-BenchmarkDotNet.Artifacts/
-
-# .NET Core
-
-# ASP.NET Scaffolding
-ScaffoldingReadMe.txt
-
-# StyleCop
-StyleCopReport.xml
-
-# Files built by Visual Studio
-*_h.h
-*.iobj
-*.ipdb
-*_wpftmp.csproj
-*.tlog
-
-# Chutzpah Test files
-
-# Visual C++ cache files
-
-# Visual Studio profiler
-
-# Visual Studio Trace Files
-*.e2e
-
-# TFS 2012 Local Workspace
-
-# Guidance Automation Toolkit
-
-# ReSharper is a .NET coding add-in
-
-# TeamCity is a build add-in
-
-# DotCover is a Code Coverage Tool
-
-# AxoCover is a Code Coverage Tool
-.axoCover/*
-!.axoCover/settings.json
-
-# Coverlet is a free, cross platform Code Coverage Tool
-coverage*.json
-coverage*.xml
-coverage*.info
-
-# Visual Studio code coverage results
-
-# NCrunch
-
-# MightyMoose
-
-# Web workbench (sass)
-
-# Installshield output folder
-
-# DocProject is a documentation generator add-in
-
-# Click-Once directory
-
-# Publish Web Output
-# Note: Comment the next line if you want to checkin your web deploy settings,
-# but database connection strings (with potential passwords) will be unencrypted
-
-# Microsoft Azure Web App publish settings. Comment the next line if you want to
-# checkin your Azure Web App publish settings, but sensitive information contained
-# in these scripts will be unencrypted
-
-# NuGet Packages
-# NuGet Symbol Packages
-*.snupkg
-# The packages folder can be ignored because of Package Restore
-**/[Pp]ackages/*
-# except build/, which is used as an MSBuild target.
-!**/[Pp]ackages/build/
-# Uncomment if necessary however generally it will be regenerated when needed
-#!**/[Pp]ackages/repositories.config
-# NuGet v3's project.json files produces more ignorable files
-
-# Microsoft Azure Build Output
-
-# Microsoft Azure Emulator
-
-# Windows Store app package directories and files
-*.appx
-*.appxbundle
-*.appxupload
-
-# Visual Studio cache files
-# files ending in .cache can be ignored
-# but keep track of directories ending in .cache
-!?*.[Cc]ache/
-
-# Others
-
-# Including strong name files can present a security risk
-# (https://github.com/github/gitignore/pull/2483#issue-259490424)
-#*.snk
-
-# Since there are multiple workflows, uncomment next line to ignore bower_components
-# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
-
-# RIA/Silverlight projects
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-ServiceFabricBackup/
-*.rptproj.bak
-
-# SQL Server files
-*.ndf
-
-# Business Intelligence projects
-*.rptproj.rsuser
-*- [Bb]ackup.rdl
-*- [Bb]ackup ([0-9]).rdl
-*- [Bb]ackup ([0-9][0-9]).rdl
-
-# Microsoft Fakes
-
-# GhostDoc plugin setting file
-
-# Node.js Tools for Visual Studio
-
-# Visual Studio 6 build log
-
-# Visual Studio 6 workspace options file
-
-# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
-*.vbw
-
-# Visual Studio 6 auto-generated project file (contains which files were open etc.)
-*.vbp
-
-# Visual Studio 6 workspace and project file (working project files containing files to include in project)
-*.dsw
-*.dsp
-
-# Visual Studio 6 technical files
-
-# Visual Studio LightSwitch build output
-
-# Paket dependency manager
-
-# FAKE - F# Make
-
-# CodeRush personal settings
-.cr/personal
-
-# Python Tools for Visual Studio (PTVS)
-
-# Cake - Uncomment if you are using it
-# tools/**
-# !tools/packages.config
-
-# Tabs Studio
-*.tss
-
-# Telerik's JustMock configuration file
-*.jmconfig
-
-# BizTalk build output
-*.btp.cs
-*.btm.cs
-*.odx.cs
-*.xsd.cs
-
-# OpenCover UI analysis results
-OpenCover/
-
-# Azure Stream Analytics local run output
-ASALocalRun/
-
-# MSBuild Binary and Structured Log
-*.binlog
-
-# NVidia Nsight GPU debugger configuration file
-*.nvuser
-
-# MFractors (Xamarin productivity tool) working folder
-.mfractor/
-
-# Local History for Visual Studio
-.localhistory/
-
-# Visual Studio History (VSHistory) files
-.vshistory/
-
-# BeatPulse healthcheck temp database
-healthchecksdb
-
-# Backup folder for Package Reference Convert tool in Visual Studio 2017
-MigrationBackup/
-
-# Ionide (cross platform F# VS Code tools) working folder
-.ionide/
-
-# Fody - auto-generated XML schema
-FodyWeavers.xsd
-
-# VS Code files for those working on multiple tools
-.vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
-*.code-workspace
-
-# Local History for Visual Studio Code
-.history/
-
-# Windows Installer files from build outputs
-*.cab
-*.msi
-*.msix
-*.msm
-*.msp
-
-# JetBrains Rider
-
-### DotnetCore ###
-# .NET Core build folders
-bin/
-obj/
-
-# Common node modules locations
-/node_modules
-/wwwroot/node_modules
-
-### Rider ###
-# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
-# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
-
-# User-specific stuff
-.idea/**/workspace.xml
-.idea/**/tasks.xml
-.idea/**/usage.statistics.xml
-.idea/**/dictionaries
-.idea/**/shelf
-
-# AWS User-specific
-.idea/**/aws.xml
-
-# Generated files
-.idea/**/contentModel.xml
-
-# Sensitive or high-churn files
-.idea/**/dataSources/
-.idea/**/dataSources.ids
-.idea/**/dataSources.local.xml
-.idea/**/sqlDataSources.xml
-.idea/**/dynamic.xml
-.idea/**/uiDesigner.xml
-.idea/**/dbnavigator.xml
-
-# Gradle
-.idea/**/gradle.xml
-.idea/**/libraries
-
-# Gradle and Maven with auto-import
-# When using Gradle or Maven with auto-import, you should exclude module files,
-# since they will be recreated, and may cause churn. Uncomment if using
-# auto-import.
-# .idea/artifacts
-# .idea/compiler.xml
-# .idea/jarRepositories.xml
-# .idea/modules.xml
-# .idea/*.iml
-# .idea/modules
-# *.iml
-# *.ipr
-
-# CMake
-cmake-build-*/
-
-# Mongo Explorer plugin
-.idea/**/mongoSettings.xml
-
-# File-based project format
-*.iws
-
-# IntelliJ
-out/
-
-# mpeltonen/sbt-idea plugin
-.idea_modules/
-
-# JIRA plugin
-atlassian-ide-plugin.xml
-
-# Cursive Clojure plugin
-.idea/replstate.xml
-
-# SonarLint plugin
-.idea/sonarlint/
-
-# Crashlytics plugin (for Android Studio and IntelliJ)
-com_crashlytics_export_strings.xml
-crashlytics.properties
-crashlytics-build.properties
-fabric.properties
-
-# Editor-based Rest Client
-.idea/httpRequests
-
-# Android studio 3.1+ serialized cache file
-.idea/caches/build_file_checksums.ser
-
-### VisualStudioCode ###
-!.vscode/*.code-snippets
-
-# Local History for Visual Studio Code
-
-# Built Visual Studio Code Extensions
-*.vsix
-
-### VisualStudioCode Patch ###
-# Ignore all local history of files
-.history
-.ionide
-
-### VisualStudio ###
-
-# User-specific files
-
-# User-specific files (MonoDevelop/Xamarin Studio)
-
-# Mono auto generated files
-
-# Build results
-
-# Visual Studio 2015/2017 cache/options directory
-# Uncomment if you have tasks that create the project's static files in wwwroot
-
-# Visual Studio 2017 auto generated files
-
-# MSTest test Results
-
-# NUnit
-
-# Build Results of an ATL Project
-
-# Benchmark Results
-
-# .NET Core
-
-# ASP.NET Scaffolding
-
-# StyleCop
-
-# Files built by Visual Studio
-
-# Chutzpah Test files
-
-# Visual C++ cache files
-
-# Visual Studio profiler
-
-# Visual Studio Trace Files
-
-# TFS 2012 Local Workspace
-
-# Guidance Automation Toolkit
-
-# ReSharper is a .NET coding add-in
-
-# TeamCity is a build add-in
-
-# DotCover is a Code Coverage Tool
-
-# AxoCover is a Code Coverage Tool
-
-# Coverlet is a free, cross platform Code Coverage Tool
-
-# Visual Studio code coverage results
-
-# NCrunch
-
-# MightyMoose
-
-# Web workbench (sass)
-
-# Installshield output folder
-
-# DocProject is a documentation generator add-in
-
-# Click-Once directory
-
-# Publish Web Output
-# Note: Comment the next line if you want to checkin your web deploy settings,
-# but database connection strings (with potential passwords) will be unencrypted
-
-# Microsoft Azure Web App publish settings. Comment the next line if you want to
-# checkin your Azure Web App publish settings, but sensitive information contained
-# in these scripts will be unencrypted
-
-# NuGet Packages
-# NuGet Symbol Packages
-# The packages folder can be ignored because of Package Restore
-# except build/, which is used as an MSBuild target.
-# Uncomment if necessary however generally it will be regenerated when needed
-# NuGet v3's project.json files produces more ignorable files
-
-# Microsoft Azure Build Output
-
-# Microsoft Azure Emulator
-
-# Windows Store app package directories and files
-
-# Visual Studio cache files
-# files ending in .cache can be ignored
-# but keep track of directories ending in .cache
-
-# Others
-
-# Including strong name files can present a security risk
-# (https://github.com/github/gitignore/pull/2483#issue-259490424)
-
-# Since there are multiple workflows, uncomment next line to ignore bower_components
-# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
-
-# RIA/Silverlight projects
-
-# Backup & report files from converting an old project file
-# to a newer Visual Studio version. Backup files are not needed,
-# because we have git ;-)
-
-# SQL Server files
-
-# Business Intelligence projects
-
-# Microsoft Fakes
-
-# GhostDoc plugin setting file
-
-# Node.js Tools for Visual Studio
-
-# Visual Studio 6 build log
-
-# Visual Studio 6 workspace options file
-
-# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
-
-# Visual Studio 6 auto-generated project file (contains which files were open etc.)
-
-# Visual Studio 6 workspace and project file (working project files containing files to include in project)
-
-# Visual Studio 6 technical files
-
-# Visual Studio LightSwitch build output
-
-# Paket dependency manager
-
-# FAKE - F# Make
-
-# CodeRush personal settings
-
-# Python Tools for Visual Studio (PTVS)
-
-# Cake - Uncomment if you are using it
-# tools/**
-# !tools/packages.config
-
-# Tabs Studio
-
-# Telerik's JustMock configuration file
-
-# BizTalk build output
-
-# OpenCover UI analysis results
-
-# Azure Stream Analytics local run output
-
-# MSBuild Binary and Structured Log
-
-# NVidia Nsight GPU debugger configuration file
-
-# MFractors (Xamarin productivity tool) working folder
-
-# Local History for Visual Studio
-
-# Visual Studio History (VSHistory) files
-
-# BeatPulse healthcheck temp database
-
-# Backup folder for Package Reference Convert tool in Visual Studio 2017
-
-# Ionide (cross platform F# VS Code tools) working folder
-
-# Fody - auto-generated XML schema
-
-# VS Code files for those working on multiple tools
-
-# Local History for Visual Studio Code
-
-# Windows Installer files from build outputs
-
-# JetBrains Rider
-
-### VisualStudio Patch ###
-# Additional files built by Visual Studio
-
+# Created by https://www.toptal.com/developers/gitignore/api/dotnetcore,aspnetcore,csharp,rider,visualstudiocode,visualstudio
+# Edit at https://www.toptal.com/developers/gitignore?templates=dotnetcore,aspnetcore,csharp,rider,visualstudiocode,visualstudio
+
+### ASPNETCore ###
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/
+
+### Csharp ###
+##
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+# Uncomment if you have tasks that create the project's static files in wwwroot
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+
+# NUnit
+nunit-*.xml
+
+# Build Results of an ATL Project
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_h.h
+*.iobj
+*.ipdb
+*_wpftmp.csproj
+*.tlog
+
+# Chutzpah Test files
+
+# Visual C++ cache files
+
+# Visual Studio profiler
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+
+# Guidance Automation Toolkit
+
+# ReSharper is a .NET coding add-in
+
+# TeamCity is a build add-in
+
+# DotCover is a Code Coverage Tool
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+
+# NCrunch
+
+# MightyMoose
+
+# Web workbench (sass)
+
+# Installshield output folder
+
+# DocProject is a documentation generator add-in
+
+# Click-Once directory
+
+# Publish Web Output
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+
+# NuGet Packages
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+
+# Microsoft Azure Build Output
+
+# Microsoft Azure Emulator
+
+# Windows Store app package directories and files
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+
+# RIA/Silverlight projects
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.ndf
+
+# Business Intelligence projects
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+
+# GhostDoc plugin setting file
+
+# Node.js Tools for Visual Studio
+
+# Visual Studio 6 build log
+
+# Visual Studio 6 workspace options file
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+*.vbp
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+*.dsw
+*.dsp
+
+# Visual Studio 6 technical files
+
+# Visual Studio LightSwitch build output
+
+# Paket dependency manager
+
+# FAKE - F# Make
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# Visual Studio History (VSHistory) files
+.vshistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# JetBrains Rider
+
+### DotnetCore ###
+# .NET Core build folders
+bin/
+obj/
+
+# Common node modules locations
+/node_modules
+/wwwroot/node_modules
+
+### Rider ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# AWS User-specific
+.idea/**/aws.xml
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# SonarLint plugin
+.idea/sonarlint/
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### VisualStudioCode ###
+!.vscode/*.code-snippets
+
+# Local History for Visual Studio Code
+
+# Built Visual Studio Code Extensions
+*.vsix
+
+### VisualStudioCode Patch ###
+# Ignore all local history of files
+.history
+.ionide
+
+### VisualStudio ###
+
+# User-specific files
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+
+# Mono auto generated files
+
+# Build results
+
+# Visual Studio 2015/2017 cache/options directory
+# Uncomment if you have tasks that create the project's static files in wwwroot
+
+# Visual Studio 2017 auto generated files
+
+# MSTest test Results
+
+# NUnit
+
+# Build Results of an ATL Project
+
+# Benchmark Results
+
+# .NET Core
+
+# ASP.NET Scaffolding
+
+# StyleCop
+
+# Files built by Visual Studio
+
+# Chutzpah Test files
+
+# Visual C++ cache files
+
+# Visual Studio profiler
+
+# Visual Studio Trace Files
+
+# TFS 2012 Local Workspace
+
+# Guidance Automation Toolkit
+
+# ReSharper is a .NET coding add-in
+
+# TeamCity is a build add-in
+
+# DotCover is a Code Coverage Tool
+
+# AxoCover is a Code Coverage Tool
+
+# Coverlet is a free, cross platform Code Coverage Tool
+
+# Visual Studio code coverage results
+
+# NCrunch
+
+# MightyMoose
+
+# Web workbench (sass)
+
+# Installshield output folder
+
+# DocProject is a documentation generator add-in
+
+# Click-Once directory
+
+# Publish Web Output
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+
+# NuGet Packages
+# NuGet Symbol Packages
+# The packages folder can be ignored because of Package Restore
+# except build/, which is used as an MSBuild target.
+# Uncomment if necessary however generally it will be regenerated when needed
+# NuGet v3's project.json files produces more ignorable files
+
+# Microsoft Azure Build Output
+
+# Microsoft Azure Emulator
+
+# Windows Store app package directories and files
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+# but keep track of directories ending in .cache
+
+# Others
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+
+# RIA/Silverlight projects
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+
+# SQL Server files
+
+# Business Intelligence projects
+
+# Microsoft Fakes
+
+# GhostDoc plugin setting file
+
+# Node.js Tools for Visual Studio
+
+# Visual Studio 6 build log
+
+# Visual Studio 6 workspace options file
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+
+# Visual Studio 6 auto-generated project file (contains which files were open etc.)
+
+# Visual Studio 6 workspace and project file (working project files containing files to include in project)
+
+# Visual Studio 6 technical files
+
+# Visual Studio LightSwitch build output
+
+# Paket dependency manager
+
+# FAKE - F# Make
+
+# CodeRush personal settings
+
+# Python Tools for Visual Studio (PTVS)
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+
+# Telerik's JustMock configuration file
+
+# BizTalk build output
+
+# OpenCover UI analysis results
+
+# Azure Stream Analytics local run output
+
+# MSBuild Binary and Structured Log
+
+# NVidia Nsight GPU debugger configuration file
+
+# MFractors (Xamarin productivity tool) working folder
+
+# Local History for Visual Studio
+
+# Visual Studio History (VSHistory) files
+
+# BeatPulse healthcheck temp database
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+
+# Ionide (cross platform F# VS Code tools) working folder
+
+# Fody - auto-generated XML schema
+
+# VS Code files for those working on multiple tools
+
+# Local History for Visual Studio Code
+
+# Windows Installer files from build outputs
+
+# JetBrains Rider
+
+### VisualStudio Patch ###
+# Additional files built by Visual Studio
+
# End of https://www.toptal.com/developers/gitignore/api/dotnetcore,aspnetcore,csharp,rider,visualstudiocode,visualstudio
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index dbe76ad..a2c001b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,28 +1,28 @@
-# Use the official .NET SDK image to build the app
-FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
-WORKDIR /app
-
-# Copy everything and restore as distinct layers
-COPY . ./
-RUN dotnet restore
-
-# Build and publish the app to the out directory
-RUN dotnet publish src/Web/Web.csproj -c Release -o out
-
-# Use the official ASP.NET image to serve the app
-FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
-WORKDIR /app
-COPY --from=build /app/out ./
-
-# Environment variables for the database connection
-ENV ASPNETCORE_ENVIRONMENT=Development
-ENV ConnectionStrings__DefaultConnection=Host=db;Database=YourDatabaseName;Username=yourusername;Password=yourpassword
-ENV ASPNETCORE_URLS=http://*:80
-EXPOSE 80
-
-
-# Start the application
-ENTRYPOINT ["dotnet", "Web.dll"]
-
-
-
+# Use the official .NET SDK image to build the app
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+WORKDIR /app
+
+# Copy everything and restore as distinct layers
+COPY . ./
+RUN dotnet restore
+
+# Build and publish the app to the out directory
+RUN dotnet publish src/Web/Web.csproj -c Release -o out
+
+# Use the official ASP.NET image to serve the app
+FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+WORKDIR /app
+COPY --from=build /app/out ./
+
+# Environment variables for the database connection
+ENV ASPNETCORE_ENVIRONMENT=Development
+ENV ConnectionStrings__DefaultConnection=Host=db;Database=YourDatabaseName;Username=yourusername;Password=yourpassword
+ENV ASPNETCORE_URLS=http://*:80
+EXPOSE 80
+
+
+# Start the application
+ENTRYPOINT ["dotnet", "Web.dll"]
+
+
+
diff --git a/Summer1403-Project-Group01-Backend.sln b/Summer1403-Project-Group01-Backend.sln
index e26f675..a2c1933 100644
--- a/Summer1403-Project-Group01-Backend.sln
+++ b/Summer1403-Project-Group01-Backend.sln
@@ -1,40 +1,40 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.0.31903.59
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "src\Domain\Domain.csproj", "{84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "src\Infrastructure\Infrastructure.csproj", "{B358A8CE-2718-4056-94AA-D5A40DD67AEF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application", "src\Application\Application.csproj", "{90C204C7-AB46-45E5-9AE0-912800436545}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web", "src\Web\Web.csproj", "{961DAD51-ECA7-4389-8CD8-04DC47720E37}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}.Release|Any CPU.Build.0 = Release|Any CPU
- {B358A8CE-2718-4056-94AA-D5A40DD67AEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B358A8CE-2718-4056-94AA-D5A40DD67AEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B358A8CE-2718-4056-94AA-D5A40DD67AEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B358A8CE-2718-4056-94AA-D5A40DD67AEF}.Release|Any CPU.Build.0 = Release|Any CPU
- {90C204C7-AB46-45E5-9AE0-912800436545}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {90C204C7-AB46-45E5-9AE0-912800436545}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {90C204C7-AB46-45E5-9AE0-912800436545}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {90C204C7-AB46-45E5-9AE0-912800436545}.Release|Any CPU.Build.0 = Release|Any CPU
- {961DAD51-ECA7-4389-8CD8-04DC47720E37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {961DAD51-ECA7-4389-8CD8-04DC47720E37}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {961DAD51-ECA7-4389-8CD8-04DC47720E37}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {961DAD51-ECA7-4389-8CD8-04DC47720E37}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "src\Domain\Domain.csproj", "{84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "src\Infrastructure\Infrastructure.csproj", "{B358A8CE-2718-4056-94AA-D5A40DD67AEF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application", "src\Application\Application.csproj", "{90C204C7-AB46-45E5-9AE0-912800436545}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web", "src\Web\Web.csproj", "{961DAD51-ECA7-4389-8CD8-04DC47720E37}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {84F8DBE3-ACF4-49A7-AB89-97A97BF6C351}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B358A8CE-2718-4056-94AA-D5A40DD67AEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B358A8CE-2718-4056-94AA-D5A40DD67AEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B358A8CE-2718-4056-94AA-D5A40DD67AEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B358A8CE-2718-4056-94AA-D5A40DD67AEF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {90C204C7-AB46-45E5-9AE0-912800436545}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {90C204C7-AB46-45E5-9AE0-912800436545}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {90C204C7-AB46-45E5-9AE0-912800436545}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {90C204C7-AB46-45E5-9AE0-912800436545}.Release|Any CPU.Build.0 = Release|Any CPU
+ {961DAD51-ECA7-4389-8CD8-04DC47720E37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {961DAD51-ECA7-4389-8CD8-04DC47720E37}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {961DAD51-ECA7-4389-8CD8-04DC47720E37}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {961DAD51-ECA7-4389-8CD8-04DC47720E37}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/backend.Dockerfile b/backend.Dockerfile
new file mode 100644
index 0000000..a2c001b
--- /dev/null
+++ b/backend.Dockerfile
@@ -0,0 +1,28 @@
+# Use the official .NET SDK image to build the app
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+WORKDIR /app
+
+# Copy everything and restore as distinct layers
+COPY . ./
+RUN dotnet restore
+
+# Build and publish the app to the out directory
+RUN dotnet publish src/Web/Web.csproj -c Release -o out
+
+# Use the official ASP.NET image to serve the app
+FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+WORKDIR /app
+COPY --from=build /app/out ./
+
+# Environment variables for the database connection
+ENV ASPNETCORE_ENVIRONMENT=Development
+ENV ConnectionStrings__DefaultConnection=Host=db;Database=YourDatabaseName;Username=yourusername;Password=yourpassword
+ENV ASPNETCORE_URLS=http://*:80
+EXPOSE 80
+
+
+# Start the application
+ENTRYPOINT ["dotnet", "Web.dll"]
+
+
+
diff --git a/docker-compose.yml b/docker-compose.yml
index ccda1aa..a1643b1 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,41 +1,41 @@
-version: '3.8'
-
-services:
- db:
- image: postgres:15
- environment:
- POSTGRES_USER: yourusername
- POSTGRES_PASSWORD: yourpassword
- POSTGRES_DB: YourDatabaseName
- ports:
- - "5432:5432"
- volumes:
- - pgdata:/var/lib/postgresql/data
-
- migrate:
- image: mcr.microsoft.com/dotnet/sdk:8.0
- depends_on:
- - db
- working_dir: /app
- volumes:
- - .:/app
- environment:
- ConnectionStrings__DefaultConnection: Host=db;Database=YourDatabaseName;Username=yourusername;Password=yourpassword
- command: >
- bash -c "dotnet tool install --global dotnet-ef &&
- export PATH=\"$PATH:/root/.dotnet/tools\" &&
- dotnet ef database update --project src/Infrastructure/Infrastructure.csproj --startup-project src/Web/Web.csproj"
-
- web:
- build: .
- depends_on:
- migrate:
- condition: service_completed_successfully
- environment:
- ASPNETCORE_ENVIRONMENT: Development
- ConnectionStrings__DefaultConnection: Host=db;Database=YourDatabaseName;Username=yourusername;Password=yourpassword
- ports:
- - "8080:80"
-
-volumes:
+version: '3.8'
+
+services:
+ db:
+ image: postgres:15
+ environment:
+ POSTGRES_USER: yourusername
+ POSTGRES_PASSWORD: yourpassword
+ POSTGRES_DB: YourDatabaseName
+ ports:
+ - "5432:5432"
+ volumes:
+ - pgdata:/var/lib/postgresql/data
+
+ migrate:
+ image: mcr.microsoft.com/dotnet/sdk:8.0
+ depends_on:
+ - db
+ working_dir: /app
+ volumes:
+ - .:/app
+ environment:
+ ConnectionStrings__DefaultConnection: Host=db;Database=YourDatabaseName;Username=yourusername;Password=yourpassword
+ command: >
+ bash -c "dotnet tool install --global dotnet-ef &&
+ export PATH=\"$PATH:/root/.dotnet/tools\" &&
+ dotnet ef database update --project src/Infrastructure/Infrastructure.csproj --startup-project src/Web/Web.csproj"
+
+ web:
+ image: mohammadsadeghmontazeri/starback:latest
+ depends_on:
+ migrate:
+ condition: service_completed_successfully
+ environment:
+ ASPNETCORE_ENVIRONMENT: Development
+ ConnectionStrings__DefaultConnection: Host=db;Database=YourDatabaseName;Username=yourusername;Password=yourpassword
+ ports:
+ - "8080:80"
+
+volumes:
pgdata:
\ No newline at end of file
diff --git a/migrate.Dockerfile b/migrate.Dockerfile
new file mode 100644
index 0000000..86a231c
--- /dev/null
+++ b/migrate.Dockerfile
@@ -0,0 +1,19 @@
+# Use the .NET SDK image as the base image
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+
+# Set the working directory inside the container
+WORKDIR /app
+
+# Copy the project files into the container
+COPY . .
+
+# Install the dotnet-ef tool globally
+RUN dotnet tool install --global dotnet-ef
+
+# Ensure the global tools are in the PATH
+ENV PATH="$PATH:/root/.dotnet/tools"
+
+
+
+# Run the EF database update command directly
+CMD ["dotnet", "ef", "database", "update", "--project", "src/Infrastructure/Infrastructure.csproj", "--startup-project", "src/Web/Web.csproj"]
diff --git a/src/Application/Application.csproj b/src/Application/Application.csproj
index 633569a..88c78fe 100644
--- a/src/Application/Application.csproj
+++ b/src/Application/Application.csproj
@@ -1,17 +1,17 @@
-
-
-
- net8.0
- enable
- enable
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Application/DTOs/AccountCsv/AccountCsvModel.cs b/src/Application/DTOs/AccountCsv/AccountCsvModel.cs
index 81ee0cb..0fce57a 100644
--- a/src/Application/DTOs/AccountCsv/AccountCsvModel.cs
+++ b/src/Application/DTOs/AccountCsv/AccountCsvModel.cs
@@ -1,15 +1,15 @@
-namespace Application.DTOs.AccountCsv;
-
-public class AccountCsvModel
-{
- public long AccountID { get; set; }
- public long CardID { get; set; }
- public string IBAN { get; set; } = String.Empty;
- public string AccountType { get; set; } = String.Empty;
- public string BranchTelephone { get; set; } = String.Empty;
- public string BranchAdress { get; set; } = String.Empty;
- public string BranchName { get; set; } = String.Empty;
- public string OwnerName { get; set; } = String.Empty;
- public string OwnerLastName { get; set; } = String.Empty;
- public string OwnerID { get; set; } = String.Empty;
+namespace Application.DTOs.AccountCsv;
+
+public class AccountCsvModel
+{
+ public long AccountID { get; set; }
+ public long CardID { get; set; }
+ public string IBAN { get; set; } = String.Empty;
+ public string AccountType { get; set; } = String.Empty;
+ public string BranchTelephone { get; set; } = String.Empty;
+ public string BranchAdress { get; set; } = String.Empty;
+ public string BranchName { get; set; } = String.Empty;
+ public string OwnerName { get; set; } = String.Empty;
+ public string OwnerLastName { get; set; } = String.Empty;
+ public string OwnerID { get; set; } = String.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Identity/ChangeRole/ChangeRoleRequest.cs b/src/Application/DTOs/Identity/ChangeRole/ChangeRoleRequest.cs
index 7cbce05..2d4d905 100644
--- a/src/Application/DTOs/Identity/ChangeRole/ChangeRoleRequest.cs
+++ b/src/Application/DTOs/Identity/ChangeRole/ChangeRoleRequest.cs
@@ -1,7 +1,7 @@
-namespace Application.DTOs.Identity.ChangeRole;
-
-public class ChangeRoleRequest
-{
- public string UserName { get; set; } = string.Empty;
- public string Role { get; set; } = string.Empty;
+namespace Application.DTOs.Identity.ChangeRole;
+
+public class ChangeRoleRequest
+{
+ public string UserName { get; set; } = string.Empty;
+ public string Role { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Identity/CreateUser/CreateUserRequest.cs b/src/Application/DTOs/Identity/CreateUser/CreateUserRequest.cs
index cefb92e..991f117 100644
--- a/src/Application/DTOs/Identity/CreateUser/CreateUserRequest.cs
+++ b/src/Application/DTOs/Identity/CreateUser/CreateUserRequest.cs
@@ -1,13 +1,13 @@
-using System.ComponentModel.DataAnnotations;
-
-namespace Application.DTOs.Identity;
-
-public class CreateUserRequest
-{
- public string FirstName { get; set; } = String.Empty;
- public string LastName { get; set; } = String.Empty;
- public string Email { get; set; } = String.Empty;
- public string UserName { get; set; } = String.Empty;
- public string Password { get; set; } = String.Empty;
- public string Role { get; set; } = String.Empty;
+using System.ComponentModel.DataAnnotations;
+
+namespace Application.DTOs.Identity;
+
+public class CreateUserRequest
+{
+ public string FirstName { get; set; } = String.Empty;
+ public string LastName { get; set; } = String.Empty;
+ public string Email { get; set; } = String.Empty;
+ public string UserName { get; set; } = String.Empty;
+ public string Password { get; set; } = String.Empty;
+ public string Role { get; set; } = String.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Identity/CreateUser/CreateUserResponse.cs b/src/Application/DTOs/Identity/CreateUser/CreateUserResponse.cs
index 875e5d8..24aa8eb 100644
--- a/src/Application/DTOs/Identity/CreateUser/CreateUserResponse.cs
+++ b/src/Application/DTOs/Identity/CreateUser/CreateUserResponse.cs
@@ -1,10 +1,10 @@
-namespace Application.DTOs.Identity;
-
-public class CreateUserResponse
-{
- public string FirstName { get; set; } = String.Empty;
- public string LastName { get; set; } = String.Empty;
- public string Email { get; set; } = String.Empty;
- public string UserName { get; set; } = String.Empty;
- public string Role { get; set; } = String.Empty;
+namespace Application.DTOs.Identity;
+
+public class CreateUserResponse
+{
+ public string FirstName { get; set; } = String.Empty;
+ public string LastName { get; set; } = String.Empty;
+ public string Email { get; set; } = String.Empty;
+ public string UserName { get; set; } = String.Empty;
+ public string Role { get; set; } = String.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Identity/LoginUser/LoginUserRequest.cs b/src/Application/DTOs/Identity/LoginUser/LoginUserRequest.cs
index d10f8a3..15ea49a 100644
--- a/src/Application/DTOs/Identity/LoginUser/LoginUserRequest.cs
+++ b/src/Application/DTOs/Identity/LoginUser/LoginUserRequest.cs
@@ -1,10 +1,10 @@
-using System.ComponentModel.DataAnnotations;
-
-namespace Application.DTOs.Identity;
-
-public class LoginUserRequest
-{
- public string? UserName { get; set; }
- public string? Email { get; set; }
- public string Password { get; set; } = String.Empty;
+using System.ComponentModel.DataAnnotations;
+
+namespace Application.DTOs.Identity;
+
+public class LoginUserRequest
+{
+ public string? UserName { get; set; }
+ public string? Email { get; set; }
+ public string Password { get; set; } = String.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Identity/LoginUser/LoginUserResponse.cs b/src/Application/DTOs/Identity/LoginUser/LoginUserResponse.cs
index 170c2de..30d9362 100644
--- a/src/Application/DTOs/Identity/LoginUser/LoginUserResponse.cs
+++ b/src/Application/DTOs/Identity/LoginUser/LoginUserResponse.cs
@@ -1,11 +1,11 @@
-namespace Application.DTOs.Identity;
-
-public class LoginUserResponse
-{
- public string FirstName { get; set; } = String.Empty;
- public string LastName { get; set; } = String.Empty;
- public string Email { get; set; } = String.Empty;
- public string UserName { get; set; } = String.Empty;
- public string Role { get; set; } = String.Empty;
- public string Token { get; set; } = String.Empty;
+namespace Application.DTOs.Identity;
+
+public class LoginUserResponse
+{
+ public string FirstName { get; set; } = String.Empty;
+ public string LastName { get; set; } = String.Empty;
+ public string Email { get; set; } = String.Empty;
+ public string UserName { get; set; } = String.Empty;
+ public string Role { get; set; } = String.Empty;
+ public string Token { get; set; } = String.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Profile/ChangePassword/ChangePasswordRequest.cs b/src/Application/DTOs/Profile/ChangePassword/ChangePasswordRequest.cs
index 439af56..3ad7a16 100644
--- a/src/Application/DTOs/Profile/ChangePassword/ChangePasswordRequest.cs
+++ b/src/Application/DTOs/Profile/ChangePassword/ChangePasswordRequest.cs
@@ -1,8 +1,8 @@
-namespace Application.DTOs.Profile.ChangePassword;
-
-public class ChangePasswordRequest
-{
- public string UserId { get; set; } = string.Empty;
- public string CurrentPassword { get; set; } = string.Empty;
- public string NewPassword { get; set; } = string.Empty;
+namespace Application.DTOs.Profile.ChangePassword;
+
+public class ChangePasswordRequest
+{
+ public string UserId { get; set; } = string.Empty;
+ public string CurrentPassword { get; set; } = string.Empty;
+ public string NewPassword { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Profile/EditProfile/EditProfileInfoRequest.cs b/src/Application/DTOs/Profile/EditProfile/EditProfileInfoRequest.cs
index b132547..d5d3d92 100644
--- a/src/Application/DTOs/Profile/EditProfile/EditProfileInfoRequest.cs
+++ b/src/Application/DTOs/Profile/EditProfile/EditProfileInfoRequest.cs
@@ -1,9 +1,9 @@
-namespace Application.DTOs.Identity;
-
-public class EditProfileInfoRequest
-{
- public string UserId { get; set; } = string.Empty;
- public string UserName { get; set; } = string.Empty;
- public string FirstName { get; set; } = string.Empty;
- public string LastName { get; set; } = string.Empty;
+namespace Application.DTOs.Identity;
+
+public class EditProfileInfoRequest
+{
+ public string UserId { get; set; } = string.Empty;
+ public string UserName { get; set; } = string.Empty;
+ public string FirstName { get; set; } = string.Empty;
+ public string LastName { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Profile/EditProfile/EditProfileInfoResponse.cs b/src/Application/DTOs/Profile/EditProfile/EditProfileInfoResponse.cs
index 9fa2e26..67c9be3 100644
--- a/src/Application/DTOs/Profile/EditProfile/EditProfileInfoResponse.cs
+++ b/src/Application/DTOs/Profile/EditProfile/EditProfileInfoResponse.cs
@@ -1,9 +1,9 @@
-namespace Application.DTOs.Identity;
-
-public class EditProfileInfoResponse
-{
- public string UserName { get; set; } = string.Empty;
- public string Email { get; set; } = string.Empty;
- public string FirstName { get; set; } = string.Empty;
- public string LastName { get; set; } = string.Empty;
+namespace Application.DTOs.Identity;
+
+public class EditProfileInfoResponse
+{
+ public string UserName { get; set; } = string.Empty;
+ public string Email { get; set; } = string.Empty;
+ public string FirstName { get; set; } = string.Empty;
+ public string LastName { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Profile/GetProfileInfo/GetProfileInfoRequest.cs b/src/Application/DTOs/Profile/GetProfileInfo/GetProfileInfoRequest.cs
index 1b1da1b..4c4c9f3 100644
--- a/src/Application/DTOs/Profile/GetProfileInfo/GetProfileInfoRequest.cs
+++ b/src/Application/DTOs/Profile/GetProfileInfo/GetProfileInfoRequest.cs
@@ -1,6 +1,6 @@
-namespace Application.DTOs.Identity;
-
-public class GetProfileInfoRequest
-{
- public string UserId { get; set; } = String.Empty;
+namespace Application.DTOs.Identity;
+
+public class GetProfileInfoRequest
+{
+ public string UserId { get; set; } = String.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Profile/GetProfileInfo/GetProfileInfoResponse.cs b/src/Application/DTOs/Profile/GetProfileInfo/GetProfileInfoResponse.cs
index c05d18f..ea98334 100644
--- a/src/Application/DTOs/Profile/GetProfileInfo/GetProfileInfoResponse.cs
+++ b/src/Application/DTOs/Profile/GetProfileInfo/GetProfileInfoResponse.cs
@@ -1,10 +1,10 @@
-namespace Application.DTOs.Identity;
-
-public class GetProfileInfoResponse
-{
- public string FirstName { get; set; } = String.Empty;
- public string LastName { get; set; } = String.Empty;
- public string Email { get; set; } = String.Empty;
- public string UserName { get; set; } = String.Empty;
- public string Role { get; set; } = String.Empty;
+namespace Application.DTOs.Identity;
+
+public class GetProfileInfoResponse
+{
+ public string FirstName { get; set; } = String.Empty;
+ public string LastName { get; set; } = String.Empty;
+ public string Email { get; set; } = String.Empty;
+ public string UserName { get; set; } = String.Empty;
+ public string Role { get; set; } = String.Empty;
}
\ No newline at end of file
diff --git a/src/Application/DTOs/Result.cs b/src/Application/DTOs/Result.cs
index 23eb544..e2ed9d1 100644
--- a/src/Application/DTOs/Result.cs
+++ b/src/Application/DTOs/Result.cs
@@ -1,47 +1,47 @@
-namespace Application.DTOs;
-
-public class Result
-{
- public string Message { get; protected set; } = string.Empty;
- public bool Succeed { get; protected set; }
-
- public static Result Ok()
- {
- return new Result
- {
- Succeed = true
- };
- }
-
- public static Result Fail(string message = "failed")
- {
- return new Result
- {
- Succeed = false,
- Message = message
- };
- }
-}
-
-public class Result : Result
-{
- public T? Value { get; private set; }
-
- public static Result Ok(T value)
- {
- return new Result
- {
- Succeed = true,
- Value = value
- };
- }
-
- public static Result Fail(string message = "failed")
- {
- return new Result
- {
- Succeed = false,
- Message = message
- };
- }
+namespace Application.DTOs;
+
+public class Result
+{
+ public string Message { get; protected set; } = string.Empty;
+ public bool Succeed { get; protected set; }
+
+ public static Result Ok()
+ {
+ return new Result
+ {
+ Succeed = true
+ };
+ }
+
+ public static Result Fail(string message = "failed")
+ {
+ return new Result
+ {
+ Succeed = false,
+ Message = message
+ };
+ }
+}
+
+public class Result : Result
+{
+ public T? Value { get; private set; }
+
+ public static Result Ok(T value)
+ {
+ return new Result
+ {
+ Succeed = true,
+ Value = value
+ };
+ }
+
+ public static Result Fail(string message = "failed")
+ {
+ return new Result
+ {
+ Succeed = false,
+ Message = message
+ };
+ }
}
\ No newline at end of file
diff --git a/src/Application/DTOs/TransactionCsv/GetAllTransactionsResponse.cs b/src/Application/DTOs/TransactionCsv/GetAllTransactionsResponse.cs
index 80f5631..5c5ba49 100644
--- a/src/Application/DTOs/TransactionCsv/GetAllTransactionsResponse.cs
+++ b/src/Application/DTOs/TransactionCsv/GetAllTransactionsResponse.cs
@@ -1,17 +1,17 @@
-namespace Web.DTOs.Transaction;
-
-public class GetAllTransactionsResponse
-{
- public List Transactions { get; set; } = new();
-
- public class TransactionDto
- {
- public long TransactionId { get; set; }
- public long SourceAccountId { get; set; }
- public long DestinationAccountId { get; set; }
- public decimal Amount { get; set; }
- public DateTime Date { get; set; }
- public string Type { get; set; } = string.Empty;
- }
-
+namespace Web.DTOs.Transaction;
+
+public class GetAllTransactionsResponse
+{
+ public List Transactions { get; set; } = new();
+
+ public class TransactionDto
+ {
+ public long TransactionId { get; set; }
+ public long SourceAccountId { get; set; }
+ public long DestinationAccountId { get; set; }
+ public decimal Amount { get; set; }
+ public DateTime Date { get; set; }
+ public string Type { get; set; } = string.Empty;
+ }
+
}
\ No newline at end of file
diff --git a/src/Application/DTOs/TransactionCsv/TransactionCsvModel.cs b/src/Application/DTOs/TransactionCsv/TransactionCsvModel.cs
index 895f937..1b1cac9 100644
--- a/src/Application/DTOs/TransactionCsv/TransactionCsvModel.cs
+++ b/src/Application/DTOs/TransactionCsv/TransactionCsvModel.cs
@@ -1,15 +1,15 @@
-using Application.Services.SharedService;
-using CsvHelper.Configuration.Attributes;
-
-namespace Application.DTOs.TransactionCsv;
-
-public class TransactionCsvModel
-{
- public long TransactionID { get; set; }
- public long SourceAcount { get; set; }
- public long DestiantionAccount { get; set; }
- public decimal Amount { get; set; }
- [TypeConverter(typeof(PersianDateConverter))]
- public DateTime Date { get; set; }
- public string Type { get; set; } = string.Empty;
+using Application.Services.SharedService;
+using CsvHelper.Configuration.Attributes;
+
+namespace Application.DTOs.TransactionCsv;
+
+public class TransactionCsvModel
+{
+ public long TransactionID { get; set; }
+ public long SourceAcount { get; set; }
+ public long DestiantionAccount { get; set; }
+ public decimal Amount { get; set; }
+ [TypeConverter(typeof(PersianDateConverter))]
+ public DateTime Date { get; set; }
+ public string Type { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/src/Application/ExtensionMethods/ExtensionMethods.cs b/src/Application/ExtensionMethods/ExtensionMethods.cs
index 408e9ea..d3d5930 100644
--- a/src/Application/ExtensionMethods/ExtensionMethods.cs
+++ b/src/Application/ExtensionMethods/ExtensionMethods.cs
@@ -1,11 +1,11 @@
-using Microsoft.AspNetCore.Identity;
-
-namespace Application.ExtensionMethods;
-
-public static class ExtensionMethods
-{
- public static string FirstMessage(this IEnumerable errors)
- {
- return errors.FirstOrDefault()?.Description ?? "Unknown Error.";
- }
+using Microsoft.AspNetCore.Identity;
+
+namespace Application.ExtensionMethods;
+
+public static class ExtensionMethods
+{
+ public static string FirstMessage(this IEnumerable errors)
+ {
+ return errors.FirstOrDefault()?.Description ?? "Unknown Error.";
+ }
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/IAccountRepository.cs b/src/Application/Interfaces/IAccountRepository.cs
index 19cc5ba..88ca7ad 100644
--- a/src/Application/Interfaces/IAccountRepository.cs
+++ b/src/Application/Interfaces/IAccountRepository.cs
@@ -1,10 +1,10 @@
-using Domain.Entities;
-
-namespace Application.Interfaces;
-
-public interface IAccountRepository
-{
- Task CreateBulkAsync(List accounts);
- Task GetByIdAsync(long accountId);
- Task> GetTransactionsByAccountId(long accountId);
+using Domain.Entities;
+
+namespace Application.Interfaces;
+
+public interface IAccountRepository
+{
+ Task CreateBulkAsync(List accounts);
+ Task GetByIdAsync(long accountId);
+ Task> GetTransactionsByAccountId(long accountId);
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/IJwtGenerator.cs b/src/Application/Interfaces/IJwtGenerator.cs
index 5c9c40c..d0d6041 100644
--- a/src/Application/Interfaces/IJwtGenerator.cs
+++ b/src/Application/Interfaces/IJwtGenerator.cs
@@ -1,8 +1,8 @@
-using Domain.Entities;
-
-namespace Web.Interfaces;
-
-public interface IJwtGenerator
-{
- string GenerateToken(AppUser user, string role);
+using Domain.Entities;
+
+namespace Web.Interfaces;
+
+public interface IJwtGenerator
+{
+ string GenerateToken(AppUser user, string role);
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/IRoleManager.cs b/src/Application/Interfaces/IRoleManager.cs
index 5b20e42..8516595 100644
--- a/src/Application/Interfaces/IRoleManager.cs
+++ b/src/Application/Interfaces/IRoleManager.cs
@@ -1,6 +1,6 @@
-namespace Application.Interfaces;
-
-public interface IRoleManager
-{
- Task RoleExistsAsync(string roleName);
+namespace Application.Interfaces;
+
+public interface IRoleManager
+{
+ Task RoleExistsAsync(string roleName);
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/ITransactionRepository.cs b/src/Application/Interfaces/ITransactionRepository.cs
index 1a96ef2..a73dc45 100644
--- a/src/Application/Interfaces/ITransactionRepository.cs
+++ b/src/Application/Interfaces/ITransactionRepository.cs
@@ -1,9 +1,9 @@
-using Domain.Entities;
-
-namespace Application.Interfaces;
-
-public interface ITransactionRepository
-{
- Task CreateBulkAsync(List transactions);
- Task> GetAllTransactions();
+using Domain.Entities;
+
+namespace Application.Interfaces;
+
+public interface ITransactionRepository
+{
+ Task CreateBulkAsync(List transactions);
+ Task> GetAllTransactions();
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/IUserManager.cs b/src/Application/Interfaces/IUserManager.cs
index 2e9c136..4baf0d7 100644
--- a/src/Application/Interfaces/IUserManager.cs
+++ b/src/Application/Interfaces/IUserManager.cs
@@ -1,19 +1,19 @@
-using Application.DTOs;
-using Domain.Entities;
-using Microsoft.AspNetCore.Identity;
-
-namespace Application.Interfaces;
-
-public interface IUserManager
-{
- Task CreateAsync(AppUser user, string password);
- Task SetRoleAsync(AppUser user, string role);
- Task ChangeRoleAsync(AppUser user, string newRole);
- Task FindByNameAsync(string userName);
- Task FindByEmailAsync(string email);
- Task FindByIdAsync(string userId);
- Task UpdateAsync(AppUser user);
- Task ChangePasswordAsync(AppUser user, string currentPassword, string newPassword);
- Task GetRoleAsync(AppUser user);
- Task CheckPasswordAsync(AppUser user, string password);
+using Application.DTOs;
+using Domain.Entities;
+using Microsoft.AspNetCore.Identity;
+
+namespace Application.Interfaces;
+
+public interface IUserManager
+{
+ Task CreateAsync(AppUser user, string password);
+ Task SetRoleAsync(AppUser user, string role);
+ Task ChangeRoleAsync(AppUser user, string newRole);
+ Task FindByNameAsync(string userName);
+ Task FindByEmailAsync(string email);
+ Task FindByIdAsync(string userId);
+ Task UpdateAsync(AppUser user);
+ Task ChangePasswordAsync(AppUser user, string currentPassword, string newPassword);
+ Task GetRoleAsync(AppUser user);
+ Task CheckPasswordAsync(AppUser user, string password);
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/Services/IAccountService.cs b/src/Application/Interfaces/Services/IAccountService.cs
index 6e41d4c..9a87aeb 100644
--- a/src/Application/Interfaces/Services/IAccountService.cs
+++ b/src/Application/Interfaces/Services/IAccountService.cs
@@ -1,11 +1,11 @@
-using Application.DTOs;
-using Domain.Entities;
-
-namespace Application.Interfaces.Services;
-
-public interface IAccountService
-{
- Task AddAccountsFromCsvAsync(string filePath);
- Task GetAccountByIdAsync(long accountId);
- Task>> GetTransactionsByUserId(long accountId);
+using Application.DTOs;
+using Domain.Entities;
+
+namespace Application.Interfaces.Services;
+
+public interface IAccountService
+{
+ Task AddAccountsFromCsvAsync(string filePath);
+ Task GetAccountByIdAsync(long accountId);
+ Task>> GetTransactionsByUserId(long accountId);
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/Services/IIdentityService.cs b/src/Application/Interfaces/Services/IIdentityService.cs
index a399a97..ae51223 100644
--- a/src/Application/Interfaces/Services/IIdentityService.cs
+++ b/src/Application/Interfaces/Services/IIdentityService.cs
@@ -1,12 +1,12 @@
-using Application.DTOs;
-using Application.DTOs.Identity;
-using Application.DTOs.Identity.ChangeRole;
-
-namespace Application.Interfaces.Services;
-
-public interface IIdentityService
-{
- Task> SignUpUser(CreateUserRequest createIdentityDto);
- Task> Login(LoginUserRequest loginDto);
- Task ChangeRole(ChangeRoleRequest changeRoleRequest);
+using Application.DTOs;
+using Application.DTOs.Identity;
+using Application.DTOs.Identity.ChangeRole;
+
+namespace Application.Interfaces.Services;
+
+public interface IIdentityService
+{
+ Task> SignUpUser(CreateUserRequest createIdentityDto);
+ Task> Login(LoginUserRequest loginDto);
+ Task ChangeRole(ChangeRoleRequest changeRoleRequest);
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/Services/IProfileService.cs b/src/Application/Interfaces/Services/IProfileService.cs
index ccbf8bd..b8de465 100644
--- a/src/Application/Interfaces/Services/IProfileService.cs
+++ b/src/Application/Interfaces/Services/IProfileService.cs
@@ -1,12 +1,12 @@
-using Application.DTOs;
-using Application.DTOs.Identity;
-using Application.DTOs.Profile.ChangePassword;
-
-namespace Application.Interfaces.Services;
-
-public interface IProfileService
-{
- Task> EditProfileInfo(EditProfileInfoRequest infoRequest);
- Task> GetProfileInfo(GetProfileInfoRequest profileRequest);
- Task ChangePassword(ChangePasswordRequest request);
+using Application.DTOs;
+using Application.DTOs.Identity;
+using Application.DTOs.Profile.ChangePassword;
+
+namespace Application.Interfaces.Services;
+
+public interface IProfileService
+{
+ Task> EditProfileInfo(EditProfileInfoRequest infoRequest);
+ Task> GetProfileInfo(GetProfileInfoRequest profileRequest);
+ Task ChangePassword(ChangePasswordRequest request);
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/Services/ITransactionService.cs b/src/Application/Interfaces/Services/ITransactionService.cs
index cb5ffaa..5d5cd4c 100644
--- a/src/Application/Interfaces/Services/ITransactionService.cs
+++ b/src/Application/Interfaces/Services/ITransactionService.cs
@@ -1,10 +1,10 @@
-using Application.DTOs;
-using Web.DTOs.Transaction;
-
-namespace Application.Interfaces.Services;
-
-public interface ITransactionService
-{
- Task AddTransactionsFromCsvAsync(string filePath);
- Task> GetAllTransactions();
+using Application.DTOs;
+using Web.DTOs.Transaction;
+
+namespace Application.Interfaces.Services;
+
+public interface ITransactionService
+{
+ Task AddTransactionsFromCsvAsync(string filePath);
+ Task> GetAllTransactions();
}
\ No newline at end of file
diff --git a/src/Application/Interfaces/SharedService/ICsvService.cs b/src/Application/Interfaces/SharedService/ICsvService.cs
index 58318df..37d4ea7 100644
--- a/src/Application/Interfaces/SharedService/ICsvService.cs
+++ b/src/Application/Interfaces/SharedService/ICsvService.cs
@@ -1,6 +1,6 @@
-namespace Application.Interfaces.SharedService;
-
-public interface ICsvService
-{
-
+namespace Application.Interfaces.SharedService;
+
+public interface ICsvService
+{
+
}
\ No newline at end of file
diff --git a/src/Application/Mappers/IdentityMapper.cs b/src/Application/Mappers/IdentityMapper.cs
index 41414b7..dd67eb0 100644
--- a/src/Application/Mappers/IdentityMapper.cs
+++ b/src/Application/Mappers/IdentityMapper.cs
@@ -1,43 +1,43 @@
-using Application.DTOs.Identity;
-using Domain.Entities;
-
-namespace Application.Mappers;
-
-public static class IdentityMapper
-{
- public static AppUser ToAppUser(this CreateUserRequest createUserRequest)
- {
- return new AppUser
- {
- FirstName = createUserRequest.FirstName,
- LastName = createUserRequest.LastName,
- Email = createUserRequest.Email,
- UserName = createUserRequest.UserName
- };
- }
-
- public static CreateUserResponse ToCreateUserResponse(this AppUser appUser, string role)
- {
- return new CreateUserResponse
- {
- FirstName = appUser.FirstName,
- LastName = appUser.LastName,
- Email = appUser.Email,
- UserName = appUser.UserName,
- Role = role
- };
- }
-
- public static LoginUserResponse ToLoginUserResponse(this AppUser appUser, string role, string token)
- {
- return new LoginUserResponse
- {
- FirstName = appUser.FirstName,
- LastName = appUser.LastName,
- Email = appUser.Email,
- UserName = appUser.UserName,
- Role = role,
- Token = token
- };
- }
+using Application.DTOs.Identity;
+using Domain.Entities;
+
+namespace Application.Mappers;
+
+public static class IdentityMapper
+{
+ public static AppUser ToAppUser(this CreateUserRequest createUserRequest)
+ {
+ return new AppUser
+ {
+ FirstName = createUserRequest.FirstName,
+ LastName = createUserRequest.LastName,
+ Email = createUserRequest.Email,
+ UserName = createUserRequest.UserName
+ };
+ }
+
+ public static CreateUserResponse ToCreateUserResponse(this AppUser appUser, string role)
+ {
+ return new CreateUserResponse
+ {
+ FirstName = appUser.FirstName,
+ LastName = appUser.LastName,
+ Email = appUser.Email,
+ UserName = appUser.UserName,
+ Role = role
+ };
+ }
+
+ public static LoginUserResponse ToLoginUserResponse(this AppUser appUser, string role, string token)
+ {
+ return new LoginUserResponse
+ {
+ FirstName = appUser.FirstName,
+ LastName = appUser.LastName,
+ Email = appUser.Email,
+ UserName = appUser.UserName,
+ Role = role,
+ Token = token
+ };
+ }
}
\ No newline at end of file
diff --git a/src/Application/Mappers/ProfileMapper.cs b/src/Application/Mappers/ProfileMapper.cs
index 7c2982a..a4535f0 100644
--- a/src/Application/Mappers/ProfileMapper.cs
+++ b/src/Application/Mappers/ProfileMapper.cs
@@ -1,29 +1,29 @@
-using Application.DTOs.Identity;
-using Domain.Entities;
-
-namespace Application.Mappers;
-
-public static class ProfileMapper
-{
- public static GetProfileInfoResponse ToGetProfileInfoResponse(this AppUser user, string role)
- {
- return new GetProfileInfoResponse
- {
- FirstName = user.FirstName,
- LastName = user.LastName,
- Email = user.Email,
- UserName = user.UserName,
- Role = role
- };
- }
- public static EditProfileInfoResponse ToEditProfileInfoResponse(this AppUser user)
- {
- return new EditProfileInfoResponse
- {
- FirstName = user.FirstName,
- LastName = user.LastName,
- Email = user.Email,
- UserName = user.UserName
- };
- }
+using Application.DTOs.Identity;
+using Domain.Entities;
+
+namespace Application.Mappers;
+
+public static class ProfileMapper
+{
+ public static GetProfileInfoResponse ToGetProfileInfoResponse(this AppUser user, string role)
+ {
+ return new GetProfileInfoResponse
+ {
+ FirstName = user.FirstName,
+ LastName = user.LastName,
+ Email = user.Email,
+ UserName = user.UserName,
+ Role = role
+ };
+ }
+ public static EditProfileInfoResponse ToEditProfileInfoResponse(this AppUser user)
+ {
+ return new EditProfileInfoResponse
+ {
+ FirstName = user.FirstName,
+ LastName = user.LastName,
+ Email = user.Email,
+ UserName = user.UserName
+ };
+ }
}
\ No newline at end of file
diff --git a/src/Application/Mappers/TransactionMapper.cs b/src/Application/Mappers/TransactionMapper.cs
index f9d0c22..0a27a6d 100644
--- a/src/Application/Mappers/TransactionMapper.cs
+++ b/src/Application/Mappers/TransactionMapper.cs
@@ -1,24 +1,24 @@
-using Web.DTOs.Transaction;
-using Domain.Entities;
-
-namespace Application.Mappers
-{
- public static class TransactionMapper
- {
- public static GetAllTransactionsResponse ToGetAllTransactionsResponse(this List transactions)
- {
- return new GetAllTransactionsResponse
- {
- Transactions = transactions.Select(transaction => new GetAllTransactionsResponse.TransactionDto
- {
- TransactionId = transaction.TransactionId,
- SourceAccountId = transaction.SourceAccountId,
- DestinationAccountId = transaction.DestinationAccountId,
- Amount = transaction.Amount,
- Date = transaction.Date,
- Type = transaction.Type
- }).ToList()
- };
- }
- }
+using Web.DTOs.Transaction;
+using Domain.Entities;
+
+namespace Application.Mappers
+{
+ public static class TransactionMapper
+ {
+ public static GetAllTransactionsResponse ToGetAllTransactionsResponse(this List transactions)
+ {
+ return new GetAllTransactionsResponse
+ {
+ Transactions = transactions.Select(transaction => new GetAllTransactionsResponse.TransactionDto
+ {
+ TransactionId = transaction.TransactionId,
+ SourceAccountId = transaction.SourceAccountId,
+ DestinationAccountId = transaction.DestinationAccountId,
+ Amount = transaction.Amount,
+ Date = transaction.Date,
+ Type = transaction.Type
+ }).ToList()
+ };
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Application/Services/AccountService.cs b/src/Application/Services/AccountService.cs
index 27f70f8..c75e89c 100644
--- a/src/Application/Services/AccountService.cs
+++ b/src/Application/Services/AccountService.cs
@@ -1,57 +1,57 @@
-using Application.DTOs;
-using Application.DTOs.AccountCsv;
-using Application.Interfaces;
-using Application.Interfaces.Services;
-using Application.Services.SharedService;
-using Domain.Entities;
-
-namespace Application.Services;
-
-public class AccountService : IAccountService
-{
- private readonly IAccountRepository _accountRepository;
-
- public AccountService(IAccountRepository accountRepository)
- {
- _accountRepository = accountRepository;
- }
-
- public async Task AddAccountsFromCsvAsync(string filePath)
- {
- var accountCsvModels = CsvReaderService.ReadFromCsv(filePath);
-
- var accounts = accountCsvModels.Select(csvModel => new Account
- {
- AccountId = csvModel.AccountID,
- CardId = csvModel.CardID,
- Iban = csvModel.IBAN,
- AccountType = csvModel.AccountType,
- BranchTelephone = csvModel.BranchTelephone,
- BranchAddress = csvModel.BranchAdress,
- BranchName = csvModel.BranchName,
- OwnerName = csvModel.OwnerName,
- OwnerLastName = csvModel.OwnerLastName,
- OwnerId = csvModel.OwnerID
- }).ToList();
-
- await _accountRepository.CreateBulkAsync(accounts);
- }
-
- public async Task GetAccountByIdAsync(long accountId)
- {
- return await _accountRepository.GetByIdAsync(accountId);
- }
-
- public async Task>> GetTransactionsByUserId(long accountId)
- {
- var account = await _accountRepository.GetByIdAsync(accountId);
-
- if (account == null)
- {
- return Result>.Fail("Account not found");
- }
-
- var transactions = await _accountRepository.GetTransactionsByAccountId(accountId);
- return Result>.Ok(transactions);
- }
+using Application.DTOs;
+using Application.DTOs.AccountCsv;
+using Application.Interfaces;
+using Application.Interfaces.Services;
+using Application.Services.SharedService;
+using Domain.Entities;
+
+namespace Application.Services;
+
+public class AccountService : IAccountService
+{
+ private readonly IAccountRepository _accountRepository;
+
+ public AccountService(IAccountRepository accountRepository)
+ {
+ _accountRepository = accountRepository;
+ }
+
+ public async Task AddAccountsFromCsvAsync(string filePath)
+ {
+ var accountCsvModels = CsvReaderService.ReadFromCsv(filePath);
+
+ var accounts = accountCsvModels.Select(csvModel => new Account
+ {
+ AccountId = csvModel.AccountID,
+ CardId = csvModel.CardID,
+ Iban = csvModel.IBAN,
+ AccountType = csvModel.AccountType,
+ BranchTelephone = csvModel.BranchTelephone,
+ BranchAddress = csvModel.BranchAdress,
+ BranchName = csvModel.BranchName,
+ OwnerName = csvModel.OwnerName,
+ OwnerLastName = csvModel.OwnerLastName,
+ OwnerId = csvModel.OwnerID
+ }).ToList();
+
+ await _accountRepository.CreateBulkAsync(accounts);
+ }
+
+ public async Task GetAccountByIdAsync(long accountId)
+ {
+ return await _accountRepository.GetByIdAsync(accountId);
+ }
+
+ public async Task>> GetTransactionsByUserId(long accountId)
+ {
+ var account = await _accountRepository.GetByIdAsync(accountId);
+
+ if (account == null)
+ {
+ return Result>.Fail("Account not found");
+ }
+
+ var transactions = await _accountRepository.GetTransactionsByAccountId(accountId);
+ return Result>.Ok(transactions);
+ }
}
\ No newline at end of file
diff --git a/src/Application/Services/IdentityService.cs b/src/Application/Services/IdentityService.cs
index 696050c..6343a00 100644
--- a/src/Application/Services/IdentityService.cs
+++ b/src/Application/Services/IdentityService.cs
@@ -1,94 +1,94 @@
-using Application.DTOs;
-using Application.DTOs.Identity;
-using Application.DTOs.Identity.ChangeRole;
-using Application.ExtensionMethods;
-using Application.Interfaces;
-using Application.Interfaces.Services;
-using Application.Mappers;
-using Domain.Entities;
-using Web.Interfaces;
-
-namespace Application.Services;
-
-public class IdentityService : IIdentityService
-{
- private readonly IUserManager _userManager;
- private readonly IRoleManager _roleManager;
- private readonly IJwtGenerator _jwtGenerator;
- public IdentityService(IUserManager userManager,
- IRoleManager roleManager,
- IJwtGenerator jwtGenerator)
- {
- _userManager = userManager;
- _roleManager = roleManager;
- _jwtGenerator = jwtGenerator;
- }
-
- public async Task> SignUpUser(CreateUserRequest createUserRequest)
- {
- if (!await _roleManager.RoleExistsAsync(createUserRequest.Role))
- {
- return Result.Fail("role does not exist");
- }
-
- var appUser = createUserRequest.ToAppUser();
-
- var appUserResult = await _userManager.CreateAsync(appUser, createUserRequest.Password);
- if (!appUserResult.Succeeded)
- {
- return Result.Fail(appUserResult.Errors.FirstMessage());
- }
-
- var roleResult = await _userManager.SetRoleAsync(appUser, createUserRequest.Role);
- if (!roleResult.Succeeded)
- {
- return Result.Fail(roleResult.Errors.FirstMessage());
- }
-
- return Result.Ok(appUser.ToCreateUserResponse(createUserRequest.Role));
- }
-
- public async Task> Login(LoginUserRequest loginUserRequest)
- {
- AppUser? appUser;
-
- if (!string.IsNullOrEmpty(loginUserRequest.UserName))
- {
- appUser = await _userManager.FindByNameAsync(loginUserRequest.UserName);
- }
- else if (!string.IsNullOrEmpty(loginUserRequest.Email))
- {
- appUser = await _userManager.FindByEmailAsync(loginUserRequest.Email);
- }
- else
- {
- return Result.Fail("You should enter email or username!");
- }
-
- if (appUser is null) return Result.Fail("Invalid username/email!");
-
- var succeed = await _userManager.CheckPasswordAsync(appUser, loginUserRequest.Password);
-
- if (!succeed) return Result.Fail("Username/Email not found and/or password incorrect");
-
- var role = await _userManager.GetRoleAsync(appUser);
- var token = _jwtGenerator.GenerateToken(appUser, role);
-
- return Result.Ok(appUser.ToLoginUserResponse(role, token));
- }
-
- public async Task ChangeRole(ChangeRoleRequest request)
- {
- if (!await _roleManager.RoleExistsAsync(request.Role))
- {
- return Result.Fail("role does not exist");
- }
- AppUser? appUser = await _userManager.FindByNameAsync(request.UserName);
-
- if (appUser is null) return Result.Fail("Invalid username");
-
- var result = await _userManager.ChangeRoleAsync(appUser, request.Role);
-
- return result.Succeeded ? Result.Ok() : Result.Fail(result.Errors.FirstMessage());
- }
+using Application.DTOs;
+using Application.DTOs.Identity;
+using Application.DTOs.Identity.ChangeRole;
+using Application.ExtensionMethods;
+using Application.Interfaces;
+using Application.Interfaces.Services;
+using Application.Mappers;
+using Domain.Entities;
+using Web.Interfaces;
+
+namespace Application.Services;
+
+public class IdentityService : IIdentityService
+{
+ private readonly IUserManager _userManager;
+ private readonly IRoleManager _roleManager;
+ private readonly IJwtGenerator _jwtGenerator;
+ public IdentityService(IUserManager userManager,
+ IRoleManager roleManager,
+ IJwtGenerator jwtGenerator)
+ {
+ _userManager = userManager;
+ _roleManager = roleManager;
+ _jwtGenerator = jwtGenerator;
+ }
+
+ public async Task> SignUpUser(CreateUserRequest createUserRequest)
+ {
+ if (!await _roleManager.RoleExistsAsync(createUserRequest.Role))
+ {
+ return Result.Fail("role does not exist");
+ }
+
+ var appUser = createUserRequest.ToAppUser();
+
+ var appUserResult = await _userManager.CreateAsync(appUser, createUserRequest.Password);
+ if (!appUserResult.Succeeded)
+ {
+ return Result.Fail(appUserResult.Errors.FirstMessage());
+ }
+
+ var roleResult = await _userManager.SetRoleAsync(appUser, createUserRequest.Role);
+ if (!roleResult.Succeeded)
+ {
+ return Result.Fail(roleResult.Errors.FirstMessage());
+ }
+
+ return Result.Ok(appUser.ToCreateUserResponse(createUserRequest.Role));
+ }
+
+ public async Task> Login(LoginUserRequest loginUserRequest)
+ {
+ AppUser? appUser;
+
+ if (!string.IsNullOrEmpty(loginUserRequest.UserName))
+ {
+ appUser = await _userManager.FindByNameAsync(loginUserRequest.UserName);
+ }
+ else if (!string.IsNullOrEmpty(loginUserRequest.Email))
+ {
+ appUser = await _userManager.FindByEmailAsync(loginUserRequest.Email);
+ }
+ else
+ {
+ return Result.Fail("You should enter email or username!");
+ }
+
+ if (appUser is null) return Result.Fail("Invalid username/email!");
+
+ var succeed = await _userManager.CheckPasswordAsync(appUser, loginUserRequest.Password);
+
+ if (!succeed) return Result.Fail("Username/Email not found and/or password incorrect");
+
+ var role = await _userManager.GetRoleAsync(appUser);
+ var token = _jwtGenerator.GenerateToken(appUser, role);
+
+ return Result.Ok(appUser.ToLoginUserResponse(role, token));
+ }
+
+ public async Task ChangeRole(ChangeRoleRequest request)
+ {
+ if (!await _roleManager.RoleExistsAsync(request.Role))
+ {
+ return Result.Fail("role does not exist");
+ }
+ AppUser? appUser = await _userManager.FindByNameAsync(request.UserName);
+
+ if (appUser is null) return Result.Fail("Invalid username");
+
+ var result = await _userManager.ChangeRoleAsync(appUser, request.Role);
+
+ return result.Succeeded ? Result.Ok() : Result.Fail(result.Errors.FirstMessage());
+ }
}
\ No newline at end of file
diff --git a/src/Application/Services/ProfileService.cs b/src/Application/Services/ProfileService.cs
index 6c036e7..3bd8ce0 100644
--- a/src/Application/Services/ProfileService.cs
+++ b/src/Application/Services/ProfileService.cs
@@ -1,74 +1,74 @@
-using Application.DTOs;
-using Application.DTOs.Identity;
-using Application.DTOs.Profile.ChangePassword;
-using Application.ExtensionMethods;
-using Application.Interfaces;
-using Application.Interfaces.Services;
-using Application.Mappers;
-
-namespace Application.Services;
-
-public class ProfileService : IProfileService
-{
- private readonly IUserManager _userManager;
-
- public ProfileService(IUserManager userManager)
- {
- _userManager = userManager;
- }
-
- public async Task> EditProfileInfo(EditProfileInfoRequest infoRequest)
- {
- var user = await _userManager.FindByIdAsync(infoRequest.UserId);
- if (user == null)
- return Result.Fail("User not found!");
-
-
- if (user.UserName != infoRequest.UserName)
- {
- var existingUser = await _userManager.FindByNameAsync(infoRequest.UserName);
- if (existingUser != null)
- return Result.Fail("Username is already reserved by another user!");
- }
-
- user.UserName = infoRequest.UserName;
- user.FirstName = infoRequest.FirstName;
- user.LastName = infoRequest.LastName;
-
- var updateResult = await _userManager.UpdateAsync(user);
- if (!updateResult.Succeeded)
- return Result.Fail(updateResult.Errors.FirstMessage());
-
-
- return Result.Ok(user.ToEditProfileInfoResponse());
- }
-
- public async Task> GetProfileInfo(GetProfileInfoRequest getProfileInfoRequest)
- {
- var user = await _userManager.FindByIdAsync(getProfileInfoRequest.UserId);
-
- if (user == null)
- return Result.Fail("User not found!");
-
- var role = await _userManager.GetRoleAsync(user);
-
- return Result.Ok(user.ToGetProfileInfoResponse(role));
- }
-
- public async Task ChangePassword(ChangePasswordRequest request)
- {
- var user = await _userManager.FindByIdAsync(request.UserId);
- if (user == null)
- return Result.Fail("User not found!");
-
- var isPasswordCorrect = await _userManager.CheckPasswordAsync(user, request.CurrentPassword);
- if (!isPasswordCorrect)
- return Result.Fail("Incorrect current password!");
-
- var passwordChangeResult = await _userManager.ChangePasswordAsync(user, request.CurrentPassword, request.NewPassword);
- if (!passwordChangeResult.Succeeded)
- return Result.Fail(passwordChangeResult.Errors.FirstMessage());
-
- return Result.Ok();
- }
+using Application.DTOs;
+using Application.DTOs.Identity;
+using Application.DTOs.Profile.ChangePassword;
+using Application.ExtensionMethods;
+using Application.Interfaces;
+using Application.Interfaces.Services;
+using Application.Mappers;
+
+namespace Application.Services;
+
+public class ProfileService : IProfileService
+{
+ private readonly IUserManager _userManager;
+
+ public ProfileService(IUserManager userManager)
+ {
+ _userManager = userManager;
+ }
+
+ public async Task> EditProfileInfo(EditProfileInfoRequest infoRequest)
+ {
+ var user = await _userManager.FindByIdAsync(infoRequest.UserId);
+ if (user == null)
+ return Result.Fail("User not found!");
+
+
+ if (user.UserName != infoRequest.UserName)
+ {
+ var existingUser = await _userManager.FindByNameAsync(infoRequest.UserName);
+ if (existingUser != null)
+ return Result.Fail("Username is already reserved by another user!");
+ }
+
+ user.UserName = infoRequest.UserName;
+ user.FirstName = infoRequest.FirstName;
+ user.LastName = infoRequest.LastName;
+
+ var updateResult = await _userManager.UpdateAsync(user);
+ if (!updateResult.Succeeded)
+ return Result.Fail(updateResult.Errors.FirstMessage());
+
+
+ return Result.Ok(user.ToEditProfileInfoResponse());
+ }
+
+ public async Task> GetProfileInfo(GetProfileInfoRequest getProfileInfoRequest)
+ {
+ var user = await _userManager.FindByIdAsync(getProfileInfoRequest.UserId);
+
+ if (user == null)
+ return Result.Fail("User not found!");
+
+ var role = await _userManager.GetRoleAsync(user);
+
+ return Result.Ok(user.ToGetProfileInfoResponse(role));
+ }
+
+ public async Task ChangePassword(ChangePasswordRequest request)
+ {
+ var user = await _userManager.FindByIdAsync(request.UserId);
+ if (user == null)
+ return Result.Fail("User not found!");
+
+ var isPasswordCorrect = await _userManager.CheckPasswordAsync(user, request.CurrentPassword);
+ if (!isPasswordCorrect)
+ return Result.Fail("Incorrect current password!");
+
+ var passwordChangeResult = await _userManager.ChangePasswordAsync(user, request.CurrentPassword, request.NewPassword);
+ if (!passwordChangeResult.Succeeded)
+ return Result.Fail(passwordChangeResult.Errors.FirstMessage());
+
+ return Result.Ok();
+ }
}
\ No newline at end of file
diff --git a/src/Application/Services/SharedService/CsvReaderService.cs b/src/Application/Services/SharedService/CsvReaderService.cs
index 53d2424..6217f9d 100644
--- a/src/Application/Services/SharedService/CsvReaderService.cs
+++ b/src/Application/Services/SharedService/CsvReaderService.cs
@@ -1,22 +1,22 @@
-using System.Globalization;
-using Application.DTOs.TransactionCsv;
-using CsvHelper;
-using CsvHelper.Configuration;
-
-namespace Application.Services.SharedService;
-
-public static class CsvReaderService
-{
- public static List ReadFromCsv(string filePath)
- {
- using var reader = new StreamReader(filePath);
- using var csv = new CsvReader(reader, new CsvConfiguration(CultureInfo.InvariantCulture)
- {
- HeaderValidated = null,
- MissingFieldFound = null
- });
-
- var records = csv.GetRecords().ToList();
- return records;
- }
+using System.Globalization;
+using Application.DTOs.TransactionCsv;
+using CsvHelper;
+using CsvHelper.Configuration;
+
+namespace Application.Services.SharedService;
+
+public static class CsvReaderService
+{
+ public static List ReadFromCsv(string filePath)
+ {
+ using var reader = new StreamReader(filePath);
+ using var csv = new CsvReader(reader, new CsvConfiguration(CultureInfo.InvariantCulture)
+ {
+ HeaderValidated = null,
+ MissingFieldFound = null
+ });
+
+ var records = csv.GetRecords().ToList();
+ return records;
+ }
}
\ No newline at end of file
diff --git a/src/Application/Services/SharedService/PersianDateConverter.cs b/src/Application/Services/SharedService/PersianDateConverter.cs
index e571925..efd626f 100644
--- a/src/Application/Services/SharedService/PersianDateConverter.cs
+++ b/src/Application/Services/SharedService/PersianDateConverter.cs
@@ -1,34 +1,34 @@
-using System.Globalization;
-using CsvHelper;
-using CsvHelper.Configuration;
-using CsvHelper.TypeConversion;
-
-namespace Application.Services.SharedService;
-
-public class PersianDateConverter : DateTimeConverter
-{
- public override object ConvertFromString(string? text, IReaderRow row, MemberMapData memberMapData)
- {
- if (string.IsNullOrWhiteSpace(text))
- {
- return DateTime.MinValue;
- }
-
- try
- {
- var persianCalendar = new PersianCalendar();
- var parts = text.Split('/');
-
- var year = int.Parse(parts[0]);
- var month = int.Parse(parts[1]);
- var day = int.Parse(parts[2]);
-
- var gregorianDate = persianCalendar.ToDateTime(year, month, day, 0, 0, 0, 0);
- return DateTime.SpecifyKind(gregorianDate, DateTimeKind.Utc);
- }
- catch (Exception ex)
- {
- throw new TypeConverterException(this, memberMapData, text, row.Context, ex.Message);
- }
- }
+using System.Globalization;
+using CsvHelper;
+using CsvHelper.Configuration;
+using CsvHelper.TypeConversion;
+
+namespace Application.Services.SharedService;
+
+public class PersianDateConverter : DateTimeConverter
+{
+ public override object ConvertFromString(string? text, IReaderRow row, MemberMapData memberMapData)
+ {
+ if (string.IsNullOrWhiteSpace(text))
+ {
+ return DateTime.MinValue;
+ }
+
+ try
+ {
+ var persianCalendar = new PersianCalendar();
+ var parts = text.Split('/');
+
+ var year = int.Parse(parts[0]);
+ var month = int.Parse(parts[1]);
+ var day = int.Parse(parts[2]);
+
+ var gregorianDate = persianCalendar.ToDateTime(year, month, day, 0, 0, 0, 0);
+ return DateTime.SpecifyKind(gregorianDate, DateTimeKind.Utc);
+ }
+ catch (Exception ex)
+ {
+ throw new TypeConverterException(this, memberMapData, text, row.Context, ex.Message);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Application/Services/TransactionService.cs b/src/Application/Services/TransactionService.cs
index 5b5b9af..378e859 100644
--- a/src/Application/Services/TransactionService.cs
+++ b/src/Application/Services/TransactionService.cs
@@ -1,56 +1,56 @@
-using Application.DTOs;
-using Application.DTOs.TransactionCsv;
-using Application.Interfaces;
-using Application.Interfaces.Services;
-using Application.Mappers;
-using Application.Services.SharedService;
-using Domain.Entities;
-using Web.DTOs.Transaction;
-
-namespace Application.Services;
-
-public class TransactionService : ITransactionService
-{
- private readonly ITransactionRepository _transactionRepository;
-
- public TransactionService(ITransactionRepository transactionRepository)
- {
- _transactionRepository = transactionRepository;
- }
-
- public async Task AddTransactionsFromCsvAsync(string filePath)
- {
- var transactionCsvModels = CsvReaderService.ReadFromCsv(filePath);
-
- var transactions = transactionCsvModels.Select(csvModel => new Transaction
- {
- TransactionId = csvModel.TransactionID,
- SourceAccountId = csvModel.SourceAcount,
- DestinationAccountId = csvModel.DestiantionAccount,
- Amount = csvModel.Amount,
- Date = csvModel.Date,
- Type = csvModel.Type
- }).ToList();
-
- await _transactionRepository.CreateBulkAsync(transactions);
- }
-
- public async Task> GetAllTransactions()
- {
- try
- {
- var transactions = await _transactionRepository.GetAllTransactions();
-
- if (transactions.Count == 0)
- {
- return Result.Fail("No transactions found");
- }
- var response = transactions.ToGetAllTransactionsResponse();
- return Result.Ok(response);
- }
- catch (Exception ex)
- {
- return Result.Fail($"An error occurred: {ex.Message}");
- }
- }
+using Application.DTOs;
+using Application.DTOs.TransactionCsv;
+using Application.Interfaces;
+using Application.Interfaces.Services;
+using Application.Mappers;
+using Application.Services.SharedService;
+using Domain.Entities;
+using Web.DTOs.Transaction;
+
+namespace Application.Services;
+
+public class TransactionService : ITransactionService
+{
+ private readonly ITransactionRepository _transactionRepository;
+
+ public TransactionService(ITransactionRepository transactionRepository)
+ {
+ _transactionRepository = transactionRepository;
+ }
+
+ public async Task AddTransactionsFromCsvAsync(string filePath)
+ {
+ var transactionCsvModels = CsvReaderService.ReadFromCsv(filePath);
+
+ var transactions = transactionCsvModels.Select(csvModel => new Transaction
+ {
+ TransactionId = csvModel.TransactionID,
+ SourceAccountId = csvModel.SourceAcount,
+ DestinationAccountId = csvModel.DestiantionAccount,
+ Amount = csvModel.Amount,
+ Date = csvModel.Date,
+ Type = csvModel.Type
+ }).ToList();
+
+ await _transactionRepository.CreateBulkAsync(transactions);
+ }
+
+ public async Task> GetAllTransactions()
+ {
+ try
+ {
+ var transactions = await _transactionRepository.GetAllTransactions();
+
+ if (transactions.Count == 0)
+ {
+ return Result.Fail("No transactions found");
+ }
+ var response = transactions.ToGetAllTransactionsResponse();
+ return Result.Ok(response);
+ }
+ catch (Exception ex)
+ {
+ return Result.Fail($"An error occurred: {ex.Message}");
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Domain/Constants/AppRoles.cs b/src/Domain/Constants/AppRoles.cs
index 51fbebd..a341724 100644
--- a/src/Domain/Constants/AppRoles.cs
+++ b/src/Domain/Constants/AppRoles.cs
@@ -1,8 +1,8 @@
-namespace Domain.Constants;
-
-public static class AppRoles
-{
- public const string Admin = nameof(Admin);
- public const string DataAdmin = nameof(DataAdmin);
- public const string DataAnalyst = nameof(DataAnalyst);
+namespace Domain.Constants;
+
+public static class AppRoles
+{
+ public const string Admin = nameof(Admin);
+ public const string DataAdmin = nameof(DataAdmin);
+ public const string DataAnalyst = nameof(DataAnalyst);
}
\ No newline at end of file
diff --git a/src/Domain/Domain.csproj b/src/Domain/Domain.csproj
index a65825f..9319e71 100644
--- a/src/Domain/Domain.csproj
+++ b/src/Domain/Domain.csproj
@@ -1,13 +1,13 @@
-
-
-
- net8.0
- enable
- enable
-
-
-
-
-
-
-
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
diff --git a/src/Domain/Entities/Account.cs b/src/Domain/Entities/Account.cs
index 40a3b89..fa0b376 100644
--- a/src/Domain/Entities/Account.cs
+++ b/src/Domain/Entities/Account.cs
@@ -1,20 +1,20 @@
-using System.ComponentModel.DataAnnotations.Schema;
-
-namespace Domain.Entities;
-[Table("Accounts")]
-public class Account
-{
- public long AccountId { get; set; }
- public long CardId { get; set; }
- public string Iban { get; set; } = String.Empty;
- public string AccountType { get; set; } = String.Empty;
- public string BranchTelephone { get; set; } = String.Empty;
- public string BranchAddress { get; set; } = String.Empty;
- public string BranchName { get; set; } = String.Empty;
- public string OwnerName { get; set; } = String.Empty;
- public string OwnerLastName { get; set; } = String.Empty;
- public string OwnerId { get; set; } = String.Empty;
-
- public List SourceTransactions { get; set; } = new();
- public List DestinationTransactions { get; set; } = new();
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Domain.Entities;
+[Table("Accounts")]
+public class Account
+{
+ public long AccountId { get; set; }
+ public long CardId { get; set; }
+ public string Iban { get; set; } = String.Empty;
+ public string AccountType { get; set; } = String.Empty;
+ public string BranchTelephone { get; set; } = String.Empty;
+ public string BranchAddress { get; set; } = String.Empty;
+ public string BranchName { get; set; } = String.Empty;
+ public string OwnerName { get; set; } = String.Empty;
+ public string OwnerLastName { get; set; } = String.Empty;
+ public string OwnerId { get; set; } = String.Empty;
+
+ public List SourceTransactions { get; set; } = new();
+ public List DestinationTransactions { get; set; } = new();
}
\ No newline at end of file
diff --git a/src/Domain/Entities/AppUser.cs b/src/Domain/Entities/AppUser.cs
index c41129a..f236d5b 100644
--- a/src/Domain/Entities/AppUser.cs
+++ b/src/Domain/Entities/AppUser.cs
@@ -1,11 +1,11 @@
-using System.ComponentModel.DataAnnotations;
-using Microsoft.AspNetCore.Identity;
-
-namespace Domain.Entities;
-public class AppUser : IdentityUser
-{
- [MaxLength(50)]
- public string FirstName { get; set; } = String.Empty;
- [MaxLength(50)]
- public string LastName { get; set; } = String.Empty;
+using System.ComponentModel.DataAnnotations;
+using Microsoft.AspNetCore.Identity;
+
+namespace Domain.Entities;
+public class AppUser : IdentityUser
+{
+ [MaxLength(50)]
+ public string FirstName { get; set; } = String.Empty;
+ [MaxLength(50)]
+ public string LastName { get; set; } = String.Empty;
}
\ No newline at end of file
diff --git a/src/Domain/Entities/Transaction.cs b/src/Domain/Entities/Transaction.cs
index 1a47fbd..831e247 100644
--- a/src/Domain/Entities/Transaction.cs
+++ b/src/Domain/Entities/Transaction.cs
@@ -1,15 +1,15 @@
-using System.ComponentModel.DataAnnotations.Schema;
-
-namespace Domain.Entities;
-[Table("Transactions")]
-public class Transaction
-{
- public long TransactionId { get; set; }
- public long SourceAccountId { get; set; }
- public Account SourceAccount { get; set; }
- public long DestinationAccountId { get; set; }
- public Account DestinationAccount { get; set; }
- public decimal Amount { get; set; }
- public DateTime Date { get; set; }
- public string Type { get; set; } = String.Empty;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Domain.Entities;
+[Table("Transactions")]
+public class Transaction
+{
+ public long TransactionId { get; set; }
+ public long SourceAccountId { get; set; }
+ public Account SourceAccount { get; set; }
+ public long DestinationAccountId { get; set; }
+ public Account DestinationAccount { get; set; }
+ public decimal Amount { get; set; }
+ public DateTime Date { get; set; }
+ public string Type { get; set; } = String.Empty;
}
\ No newline at end of file
diff --git a/src/Infrastructure/Data/ApplicationDbContext.cs b/src/Infrastructure/Data/ApplicationDbContext.cs
index 47d9d8e..977cdf6 100644
--- a/src/Infrastructure/Data/ApplicationDbContext.cs
+++ b/src/Infrastructure/Data/ApplicationDbContext.cs
@@ -1,38 +1,38 @@
-using Domain.Constants;
-using Domain.Entities;
-using Microsoft.AspNetCore.Identity;
-using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore;
-
-namespace Infrastructure.Data;
-
-public class ApplicationDbContext(DbContextOptions dbContextOptions)
- : IdentityDbContext(dbContextOptions)
-{
- public DbSet Accounts { get; set; }
- public DbSet Transactions { get; set; }
- protected override void OnModelCreating(ModelBuilder modelBuilder)
- {
- base.OnModelCreating(modelBuilder);
-
- List roles =
- [
- new IdentityRole { Name = AppRoles.Admin, NormalizedName = AppRoles.Admin.ToUpper()},
- new IdentityRole { Name = AppRoles.DataAdmin, NormalizedName = AppRoles.DataAdmin.ToUpper()},
- new IdentityRole { Name = AppRoles.DataAnalyst, NormalizedName = AppRoles.DataAnalyst.ToUpper()}
- ];
- modelBuilder.Entity().HasData(roles);
-
- modelBuilder.Entity()
- .HasOne(t => t.SourceAccount)
- .WithMany(a => a.SourceTransactions)
- .HasForeignKey(t => t.SourceAccountId)
- .OnDelete(DeleteBehavior.Restrict);
-
- modelBuilder.Entity()
- .HasOne(t => t.DestinationAccount)
- .WithMany(a => a.DestinationTransactions)
- .HasForeignKey(t => t.DestinationAccountId)
- .OnDelete(DeleteBehavior.Restrict);
- }
+using Domain.Constants;
+using Domain.Entities;
+using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+
+namespace Infrastructure.Data;
+
+public class ApplicationDbContext(DbContextOptions dbContextOptions)
+ : IdentityDbContext(dbContextOptions)
+{
+ public DbSet Accounts { get; set; }
+ public DbSet Transactions { get; set; }
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ base.OnModelCreating(modelBuilder);
+
+ List roles =
+ [
+ new IdentityRole { Name = AppRoles.Admin, NormalizedName = AppRoles.Admin.ToUpper()},
+ new IdentityRole { Name = AppRoles.DataAdmin, NormalizedName = AppRoles.DataAdmin.ToUpper()},
+ new IdentityRole { Name = AppRoles.DataAnalyst, NormalizedName = AppRoles.DataAnalyst.ToUpper()}
+ ];
+ modelBuilder.Entity().HasData(roles);
+
+ modelBuilder.Entity()
+ .HasOne(t => t.SourceAccount)
+ .WithMany(a => a.SourceTransactions)
+ .HasForeignKey(t => t.SourceAccountId)
+ .OnDelete(DeleteBehavior.Restrict);
+
+ modelBuilder.Entity()
+ .HasOne(t => t.DestinationAccount)
+ .WithMany(a => a.DestinationTransactions)
+ .HasForeignKey(t => t.DestinationAccountId)
+ .OnDelete(DeleteBehavior.Restrict);
+ }
}
\ No newline at end of file
diff --git a/src/Infrastructure/Infrastructure.csproj b/src/Infrastructure/Infrastructure.csproj
index b44da95..87ab8bd 100644
--- a/src/Infrastructure/Infrastructure.csproj
+++ b/src/Infrastructure/Infrastructure.csproj
@@ -1,30 +1,30 @@
-
-
-
- net8.0
- enable
- enable
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
-
-
-
-
-
- C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\8.0.7\Microsoft.AspNetCore.Identity.dll
-
-
-
-
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
+
+
+ C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\8.0.7\Microsoft.AspNetCore.Identity.dll
+
+
+
+
diff --git a/src/Infrastructure/Migrations/20240814092051_CompleteUser.Designer.cs b/src/Infrastructure/Migrations/20240814092051_CompleteUser.Designer.cs
index 9713e1c..8ad4fdf 100644
--- a/src/Infrastructure/Migrations/20240814092051_CompleteUser.Designer.cs
+++ b/src/Infrastructure/Migrations/20240814092051_CompleteUser.Designer.cs
@@ -1,307 +1,307 @@
-//
-using System;
-using Infrastructure.Data;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace Infrastructure.Migrations
-{
- [DbContext(typeof(ApplicationDbContext))]
- [Migration("20240814092051_CompleteUser")]
- partial class CompleteUser
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.7")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("Infrastructure.Entities.AppUser", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("AccessFailedCount")
- .HasColumnType("integer");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("EmailConfirmed")
- .HasColumnType("boolean");
-
- b.Property("FirstName")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("LastName")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("LockoutEnabled")
- .HasColumnType("boolean");
-
- b.Property("LockoutEnd")
- .HasColumnType("timestamp with time zone");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("PasswordHash")
- .HasColumnType("text");
-
- b.Property("PhoneNumber")
- .HasColumnType("text");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("boolean");
-
- b.Property("SecurityStamp")
- .HasColumnType("text");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("boolean");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("AspNetRoles", (string)null);
-
- b.HasData(
- new
- {
- Id = "502db14d-ec3d-42f2-a56c-c14ad1217dda",
- Name = "Admin",
- NormalizedName = "ADMIN"
- },
- new
- {
- Id = "1d283a73-9ec4-4897-a709-2f21f1347cd6",
- Name = "DataAdmin",
- NormalizedName = "DATAADMIN"
- },
- new
- {
- Id = "15b3c37c-d76a-4b52-a53f-5ec7e65bedcc",
- Name = "DataAnalyst",
- NormalizedName = "DATAANALYST"
- });
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
-
- b.Property("ClaimType")
- .HasColumnType("text");
-
- b.Property("ClaimValue")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer");
-
- NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
-
- b.Property("ClaimType")
- .HasColumnType("text");
-
- b.Property("ClaimValue")
- .HasColumnType("text");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasColumnType("text");
-
- b.Property("ProviderKey")
- .HasColumnType("text");
-
- b.Property("ProviderDisplayName")
- .HasColumnType("text");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("text");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("LoginProvider")
- .HasColumnType("text");
-
- b.Property("Name")
- .HasColumnType("text");
-
- b.Property("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.HasOne("Infrastructure.Entities.AppUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.HasOne("Infrastructure.Entities.AppUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Infrastructure.Entities.AppUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.HasOne("Infrastructure.Entities.AppUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-#pragma warning restore 612, 618
- }
- }
-}
+//
+using System;
+using Infrastructure.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Infrastructure.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ [Migration("20240814092051_CompleteUser")]
+ partial class CompleteUser
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.7")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Infrastructure.Entities.AppUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("integer");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("boolean");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("PasswordHash")
+ .HasColumnType("text");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("text");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("text");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("boolean");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.ToTable("AspNetUsers", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
+
+ b.ToTable("AspNetRoles", (string)null);
+
+ b.HasData(
+ new
+ {
+ Id = "502db14d-ec3d-42f2-a56c-c14ad1217dda",
+ Name = "Admin",
+ NormalizedName = "ADMIN"
+ },
+ new
+ {
+ Id = "1d283a73-9ec4-4897-a709-2f21f1347cd6",
+ Name = "DataAdmin",
+ NormalizedName = "DATAADMIN"
+ },
+ new
+ {
+ Id = "15b3c37c-d76a-4b52-a53f-5ec7e65bedcc",
+ Name = "DataAnalyst",
+ NormalizedName = "DATAANALYST"
+ });
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasColumnType("text");
+
+ b.Property("ProviderKey")
+ .HasColumnType("text");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("text");
+
+ b.Property("LoginProvider")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.HasOne("Infrastructure.Entities.AppUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.HasOne("Infrastructure.Entities.AppUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole