refactor: shoved in what i wanted to shove

This commit is contained in:
2025-09-30 18:41:38 +03:00
parent 8c0809d620
commit fc042d126a
64 changed files with 960 additions and 219 deletions

678
.gitignore vendored
View File

@@ -1,16 +1,662 @@
/StoreService/obj/project.assets.json # Created by https://www.toptal.com/developers/gitignore/api/vim,rider,visualstudiocode,git,aspnetcore,csharp,dotnetcore
# Default ignored files # Edit at https://www.toptal.com/developers/gitignore?templates=vim,rider,visualstudiocode,git,aspnetcore,csharp,dotnetcore
/shelf/
/workspace.xml ### ASPNETCore ###
# Rider ignored files ## Ignore Visual Studio temporary files, build results, and
/contentModel.xml ## files generated by popular Visual Studio add-ons.
/projectSettingsUpdater.xml
/modules.xml # User-specific files
/.idea.LCT2025.iml *.suo
# Editor-based HTTP Client requests *.user
/httpRequests/ *.userosscache
# Datasource local storage ignored files *.sln.docstates
/dataSources/
/dataSources.local.xml # User-specific files (MonoDevelop/Xamarin Studio)
*.xml *.userprefs
*.cache
# 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
### Git ###
# Created by git for backups. To disable backups in Git:
# $ git config --global mergetool.keepBackup false
*.orig
# Created by git when using merge tools for conflicts
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
*_BASE_*.txt
*_LOCAL_*.txt
*_REMOTE_*.txt
### 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
### Vim ###
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
### 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
# End of https://www.toptal.com/developers/gitignore/api/vim,rider,visualstudiocode,git,aspnetcore,csharp,dotnetcore

View File

@@ -1,5 +1,5 @@
using System.Security.Claims; using System.Security.Claims;
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services; using LctMonolith.Services;
using LctMonolith.Services.Contracts; using LctMonolith.Services.Contracts;
using LctMonolith.Services.Models; using LctMonolith.Services.Models;

View File

@@ -1,5 +1,5 @@
using System.Security.Claims; using System.Security.Claims;
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services; using LctMonolith.Services;
using LctMonolith.Services.Contracts; using LctMonolith.Services.Contracts;
using LctMonolith.Services.Models; using LctMonolith.Services.Models;

View File

@@ -1,9 +1,9 @@
using System.Diagnostics; using System.Diagnostics;
using LctMonolith.Models; using LctMonolith.Models.Database;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using EventLog = LctMonolith.Models.EventLog; using EventLog = LctMonolith.Models.Database.EventLog;
namespace LctMonolith.Database.Data; namespace LctMonolith.Database.Data;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Serilog; using Serilog;

View File

@@ -1,4 +1,4 @@
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public enum EventType public enum EventType
{ {

View File

@@ -1,7 +1,6 @@
using System.Diagnostics;
using LctMonolith.Database.Repositories; using LctMonolith.Database.Repositories;
using LctMonolith.Models; using LctMonolith.Models.Database;
using EventLog = LctMonolith.Models.EventLog; using EventLog = LctMonolith.Models.Database.EventLog;
namespace LctMonolith.Database.UnitOfWork; namespace LctMonolith.Database.UnitOfWork;
@@ -12,16 +11,13 @@ public interface IUnitOfWork
{ {
IGenericRepository<AppUser> Users { get; } IGenericRepository<AppUser> Users { get; }
IGenericRepository<Rank> Ranks { get; } IGenericRepository<Rank> Ranks { get; }
IGenericRepository<RankRequiredMission> RankRequiredMissions { get; } IGenericRepository<RankMissionRule> RankMissionRules { get; }
IGenericRepository<RankRequiredCompetency> RankRequiredCompetencies { get; } IGenericRepository<RankSkillRule> RankSkillRules { get; }
IGenericRepository<Mission> Missions { get; } IGenericRepository<Mission> Missions { get; }
IGenericRepository<UserMission> UserMissions { get; } IGenericRepository<PlayerMission> PlayerMissions { get; }
IGenericRepository<MissionCompetencyReward> MissionCompetencyRewards { get; } IGenericRepository<MissionSkillReward> MissionSkillRewards { get; }
IGenericRepository<MissionArtifactReward> MissionArtifactRewards { get; } IGenericRepository<Skill> Skills { get; }
IGenericRepository<Competency> Competencies { get; } IGenericRepository<PlayerSkill> PlayerSkills { get; }
IGenericRepository<UserCompetency> UserCompetencies { get; }
IGenericRepository<Artifact> Artifacts { get; }
IGenericRepository<UserArtifact> UserArtifacts { get; }
IGenericRepository<StoreItem> StoreItems { get; } IGenericRepository<StoreItem> StoreItems { get; }
IGenericRepository<UserInventoryItem> UserInventoryItems { get; } IGenericRepository<UserInventoryItem> UserInventoryItems { get; }
IGenericRepository<Transaction> Transactions { get; } IGenericRepository<Transaction> Transactions { get; }

View File

@@ -1,9 +1,9 @@
using LctMonolith.Database.Data; using LctMonolith.Database.Data;
using LctMonolith.Database.Repositories; using LctMonolith.Database.Repositories;
using LctMonolith.Models; using LctMonolith.Models.Database;
using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Storage;
using EventLog = LctMonolith.Models.EventLog; using EventLog = LctMonolith.Models.Database.EventLog;
namespace LctMonolith.Database.UnitOfWork; namespace LctMonolith.Database.UnitOfWork;
@@ -22,16 +22,13 @@ public class UnitOfWork : IUnitOfWork, IAsyncDisposable
private IGenericRepository<AppUser>? _users; private IGenericRepository<AppUser>? _users;
private IGenericRepository<Rank>? _ranks; private IGenericRepository<Rank>? _ranks;
private IGenericRepository<RankRequiredMission>? _rankRequiredMissions; private IGenericRepository<RankMissionRule>? _rankMissionRules;
private IGenericRepository<RankRequiredCompetency>? _rankRequiredCompetencies; private IGenericRepository<RankSkillRule>? _rankSkillRules;
private IGenericRepository<Mission>? _missions; private IGenericRepository<Mission>? _missions;
private IGenericRepository<UserMission>? _userMissions; private IGenericRepository<PlayerMission>? _playerMissions;
private IGenericRepository<MissionCompetencyReward>? _missionCompetencyRewards; private IGenericRepository<MissionSkillReward>? _missionSkillRewards;
private IGenericRepository<MissionArtifactReward>? _missionArtifactRewards; private IGenericRepository<Skill>? _skills;
private IGenericRepository<Competency>? _competencies; private IGenericRepository<PlayerSkill>? _playerSkills;
private IGenericRepository<UserCompetency>? _userCompetencies;
private IGenericRepository<Artifact>? _artifacts;
private IGenericRepository<UserArtifact>? _userArtifacts;
private IGenericRepository<StoreItem>? _storeItems; private IGenericRepository<StoreItem>? _storeItems;
private IGenericRepository<UserInventoryItem>? _userInventoryItems; private IGenericRepository<UserInventoryItem>? _userInventoryItems;
private IGenericRepository<Transaction>? _transactions; private IGenericRepository<Transaction>? _transactions;
@@ -41,16 +38,13 @@ public class UnitOfWork : IUnitOfWork, IAsyncDisposable
public IGenericRepository<AppUser> Users => _users ??= new GenericRepository<AppUser>(_ctx); public IGenericRepository<AppUser> Users => _users ??= new GenericRepository<AppUser>(_ctx);
public IGenericRepository<Rank> Ranks => _ranks ??= new GenericRepository<Rank>(_ctx); public IGenericRepository<Rank> Ranks => _ranks ??= new GenericRepository<Rank>(_ctx);
public IGenericRepository<RankRequiredMission> RankRequiredMissions => _rankRequiredMissions ??= new GenericRepository<RankRequiredMission>(_ctx); public IGenericRepository<RankMissionRule> RankMissionRules => _rankMissionRules ??= new GenericRepository<RankMissionRule>(_ctx);
public IGenericRepository<RankRequiredCompetency> RankRequiredCompetencies => _rankRequiredCompetencies ??= new GenericRepository<RankRequiredCompetency>(_ctx); public IGenericRepository<RankSkillRule> RankSkillRules => _rankSkillRules ??= new GenericRepository<RankSkillRule>(_ctx);
public IGenericRepository<Mission> Missions => _missions ??= new GenericRepository<Mission>(_ctx); public IGenericRepository<Mission> Missions => _missions ??= new GenericRepository<Mission>(_ctx);
public IGenericRepository<UserMission> UserMissions => _userMissions ??= new GenericRepository<UserMission>(_ctx); public IGenericRepository<PlayerMission> PlayerMissions => _playerMissions ??= new GenericRepository<PlayerMission>(_ctx);
public IGenericRepository<MissionCompetencyReward> MissionCompetencyRewards => _missionCompetencyRewards ??= new GenericRepository<MissionCompetencyReward>(_ctx); public IGenericRepository<MissionSkillReward> MissionSkillRewards => _missionSkillRewards ??= new GenericRepository<MissionSkillReward>(_ctx);
public IGenericRepository<MissionArtifactReward> MissionArtifactRewards => _missionArtifactRewards ??= new GenericRepository<MissionArtifactReward>(_ctx); public IGenericRepository<Skill> Skills => _skills ??= new GenericRepository<Skill>(_ctx);
public IGenericRepository<Competency> Competencies => _competencies ??= new GenericRepository<Competency>(_ctx); public IGenericRepository<PlayerSkill> PlayerSkills => _playerSkills ??= new GenericRepository<PlayerSkill>(_ctx);
public IGenericRepository<UserCompetency> UserCompetencies => _userCompetencies ??= new GenericRepository<UserCompetency>(_ctx);
public IGenericRepository<Artifact> Artifacts => _artifacts ??= new GenericRepository<Artifact>(_ctx);
public IGenericRepository<UserArtifact> UserArtifacts => _userArtifacts ??= new GenericRepository<UserArtifact>(_ctx);
public IGenericRepository<StoreItem> StoreItems => _storeItems ??= new GenericRepository<StoreItem>(_ctx); public IGenericRepository<StoreItem> StoreItems => _storeItems ??= new GenericRepository<StoreItem>(_ctx);
public IGenericRepository<UserInventoryItem> UserInventoryItems => _userInventoryItems ??= new GenericRepository<UserInventoryItem>(_ctx); public IGenericRepository<UserInventoryItem> UserInventoryItems => _userInventoryItems ??= new GenericRepository<UserInventoryItem>(_ctx);
public IGenericRepository<Transaction> Transactions => _transactions ??= new GenericRepository<Transaction>(_ctx); public IGenericRepository<Transaction> Transactions => _transactions ??= new GenericRepository<Transaction>(_ctx);

View File

@@ -1,13 +0,0 @@
namespace LctMonolith.Models;
public class Artifact
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Name { get; set; } = null!;
public string? Description { get; set; }
public string? ImageUrl { get; set; }
public ArtifactRarity Rarity { get; set; }
public ICollection<UserArtifact> Users { get; set; } = new List<UserArtifact>();
public ICollection<MissionArtifactReward> MissionRewards { get; set; } = new List<MissionArtifactReward>();
}

View File

@@ -1,3 +0,0 @@
namespace LctMonolith.Models;
public enum ArtifactRarity { Common = 0, Rare = 1, Epic = 2, Legendary = 3 }

View File

@@ -1,11 +0,0 @@
namespace LctMonolith.Models;
public class Competency
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Name { get; set; } = null!;
public string? Description { get; set; }
public ICollection<UserCompetency> UserCompetencies { get; set; } = new List<UserCompetency>();
public ICollection<MissionCompetencyReward> MissionRewards { get; set; } = new List<MissionCompetencyReward>();
public ICollection<RankRequiredCompetency> RankRequirements { get; set; } = new List<RankRequiredCompetency>();
}

View File

@@ -1,7 +1,6 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public class AppUser : IdentityUser<Guid> public class AppUser : IdentityUser<Guid>
{ {

View File

@@ -0,0 +1,9 @@
namespace LctMonolith.Models.Database;
public class AuditableEntity
{
public DateTimeOffset CreatedOn { get; set; }
public string CreatedBy { get; set; } = string.Empty;
public DateTimeOffset UpdatedOn { get; set; }
public string UpdatedBy { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,16 @@
namespace LctMonolith.Models.Database;
public class Dialogue
{
public Guid Id { get; set; }
public Guid MissionId { get; set; }
public required Mission Mission { get; set; }
public Guid InitialDialogueMessageId { get; set; }
public Dialogue? InitialDialogueMessage { get; set; }
public Guid InterimDialogueMessageId { get; set; }
public Dialogue? InterimDialogueMessage { get; set; }
public Guid EndDialogueMessageId { get; set; }
public Dialogue? EndDialogueMessage { get; set; }
}

View File

@@ -0,0 +1,27 @@
using LctMonolith.Models.Enums;
namespace LctMonolith.Models.Database;
public class DialogueMessage
{
public Guid Id { get; set; }
public Character CharacterLeft { get; set; } = Character.None;
public Character CharacterRight { get; set; } = Character.None;
public CharacterAnimation CharacterLeftAnim { get; set; } = CharacterAnimation.Neutral;
public CharacterAnimation CharacterRightAnim { get; set; } = CharacterAnimation.Neutral;
public string CharacterLeftMessage { get; set; } = string.Empty;
public string CharacterRightMessage { get; set; } = string.Empty;
public MessageStyle CharacterLeftMessageStyle { get; set; } = MessageStyle.Normal;
public MessageStyle CharacterRightMessageStyle { get; set; } = MessageStyle.Normal;
public bool AllowMessageAi { get; set; }
public string MessageAiButtonText { get; set; } = string.Empty;
public Guid InitialDialogueId { get; set; }
public Dialogue? InitialDialogue { get; set; }
public Guid InterimDialogueId { get; set; }
public Dialogue? InterimDialogue { get; set; }
public Guid EndDialogueId { get; set; }
public Dialogue? EndDialogue { get; set; }
public ICollection<DialogueMessageResponseOption> DialogueMessageResponseOptions = new List<DialogueMessageResponseOption>();
}

View File

@@ -0,0 +1,16 @@
using LctMonolith.Models.Enums;
namespace LctMonolith.Models.Database;
public class DialogueMessageResponseOption
{
public Guid Id { get; set; }
public string Message { get; set; } = "...";
public MessageStyle MessageStyle { get; set; } = MessageStyle.Normal;
public int z { get; set; }
public Guid ParentDialogueMessageId { get; set; }
public required DialogueMessage ParentDialogueMessage { get; set; }
public Guid DestinationDialogueMessageId { get; set; }
public DialogueMessage? DestinationDialogueMessage { get; set; }
}

View File

@@ -1,4 +1,4 @@
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public class EventLog public class EventLog
{ {

View File

@@ -0,0 +1,24 @@
namespace LctMonolith.Models.Database;
public class Mission
{
public Guid Id { get; set; }
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public MissionCategory? MissionCategory { get; set; }
public long MissionCategoryId { get; set; }
public Mission? ParentMission { get; set; }
public long ParentMissionId { get; set; }
public int ExpReward { get; set; }
public int ManaReward { get; set; }
public Guid DialogueId { get; set; }
public Dialogue? Dialogue { get; set; }
public ICollection<Mission> ChildMissions { get; set; } = new List<Mission>();
public ICollection<PlayerMission> PlayerMissions { get; set; } = new List<PlayerMission>();
public ICollection<MissionItemReward> MissionItemRewards { get; set; } = new List<MissionItemReward>();
public ICollection<MissionSkillReward> MissionSkillRewards { get; set; } = new List<MissionSkillReward>();
public ICollection<MissionRankRule> MissionRankRules { get; set; } = new List<MissionRankRule>();
public ICollection<RankMissionRule> RankMissionRules { get; set; } = new List<RankMissionRule>();
}

View File

@@ -0,0 +1,9 @@
namespace LctMonolith.Models.Database;
public class MissionCategory
{
public Guid Id { get; set; }
public string Title { get; set; } = string.Empty;
public ICollection<Mission> Missions { get; set; } = new List<Mission>();
}

View File

@@ -0,0 +1,9 @@
namespace LctMonolith.Models.Database;
public class MissionItemReward
{
public Guid Id { get; set; }
public Guid ItemId { get; set; }
public Guid MissionId { get; set; }
public required Mission Mission { get; set; }
}

View File

@@ -1,9 +1,10 @@
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public class RankRequiredMission public class MissionRankRule
{ {
public Guid RankId { get; set; } public Guid Id { get; set; }
public Rank Rank { get; set; } = null!;
public Guid MissionId { get; set; } public Guid MissionId { get; set; }
public Mission Mission { get; set; } = null!; public Mission Mission { get; set; } = null!;
public Guid RankId { get; set; }
public Rank Rank { get; set; } = null!;
} }

View File

@@ -0,0 +1,11 @@
namespace LctMonolith.Models.Database;
public class MissionSkillReward
{
public Guid Id { get; set; }
public Guid MissionId { get; set; }
public Mission Mission { get; set; } = null!;
public long SkillId { get; set; }
public Skill Skill { get; set; } = null!;
public int Value { get; set; }
}

View File

@@ -1,4 +1,4 @@
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public class Notification public class Notification
{ {

View File

@@ -0,0 +1,13 @@
namespace LctMonolith.Models.Database;
public class Player
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
public Rank? Rank { get; set; }
public Guid RankId {get; set; }
public int Experience { get; set; }
public ICollection<PlayerMission> PlayerMissions { get; set; } = new List<PlayerMission>();
public ICollection<PlayerSkill> PlayerSkills { get; set; } = new List<PlayerSkill>();
}

View File

@@ -0,0 +1,13 @@
namespace LctMonolith.Models.Database;
public class PlayerMission
{
public Guid Id { get; set; }
public Guid PlayerId { get; set; }
public required Player Player { get; set; }
public Guid MissionId { get; set; }
public required Mission Mission { get; set; }
public DateTime? Started { get; set; }
public DateTime? Completed { get; set; }
public DateTime? RewardsRedeemed { get; set; }
}

View File

@@ -0,0 +1,11 @@
namespace LctMonolith.Models.Database;
public class PlayerSkill
{
public Guid Id { get; set; }
public Guid PlayerId { get; set; }
public Player Player { get; set; } = null!;
public Guid SkillId { get; set; }
public Skill Skill { get; set; } = null!;
public int Score { get; set; }
}

View File

@@ -0,0 +1,13 @@
namespace LctMonolith.Models.Database;
public class Rank
{
public Guid Id { get; set; }
public string Title { get; set; } = string.Empty;
public int ExpNeeded { get; set; }
public ICollection<Player> Players { get; set; } = new List<Player>();
public ICollection<MissionRankRule> MissionRankRules { get; set; } = new List<MissionRankRule>();
public ICollection<RankMissionRule> RankMissionRules { get; set; } = new List<RankMissionRule>();
public ICollection<RankSkillRule> RankSkillRules { get; set; } = new List<RankSkillRule>();
}

View File

@@ -0,0 +1,10 @@
namespace LctMonolith.Models.Database;
public class RankMissionRule
{
public Guid Id { get; set; }
public Guid RankId { get; set; }
public Rank Rank { get; set; } = null!;
public Guid MissionId { get; set; }
public Mission Mission { get; set; } = null!;
}

View File

@@ -0,0 +1,11 @@
namespace LctMonolith.Models.Database;
public class RankSkillRule
{
public Guid Id { get; set; }
public Guid RankId { get; set; }
public Rank Rank { get; set; } = null!;
public Guid SkillId { get; set; }
public Skill Skill { get; set; } = null!;
public int Min { get; set; }
}

View File

@@ -1,4 +1,4 @@
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public class RefreshToken public class RefreshToken
{ {

View File

@@ -0,0 +1,10 @@
namespace LctMonolith.Models.Database;
public class Skill
{
public Guid Id { get; set; }
public string Title { get; set; } = string.Empty;
public ICollection<MissionSkillReward> MissionSkillRewards { get; set; } = new List<MissionSkillReward>();
public ICollection<RankSkillRule> RankSkillRules { get; set; } = new List<RankSkillRule>();
public ICollection<PlayerSkill> PlayerSkills { get; set; } = new List<PlayerSkill>();
}

View File

@@ -1,4 +1,4 @@
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public class StoreItem public class StoreItem
{ {

View File

@@ -1,4 +1,4 @@
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public class Transaction public class Transaction
{ {

View File

@@ -1,3 +1,3 @@
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public enum TransactionType { Purchase = 0, Return = 1, Sale = 2 } public enum TransactionType { Purchase = 0, Return = 1, Sale = 2 }

View File

@@ -1,4 +1,4 @@
namespace LctMonolith.Models; namespace LctMonolith.Models.Database;
public class UserInventoryItem public class UserInventoryItem
{ {

View File

@@ -0,0 +1,11 @@
namespace LctMonolith.Models.Enums;
public enum Character
{
None,
Assistant,
Pilot,
Janitor,
Administrator,
Mechanic
}

View File

@@ -0,0 +1,18 @@
namespace LctMonolith.Models.Enums;
public enum CharacterAnimation
{
Neutral,
Happy,
Laughter,
Mock,
Sad,
Crying,
Annoyed,
Angry,
Threats,
Wave,
Silhouette,
Scared,
Embarassed
}

View File

@@ -0,0 +1,9 @@
namespace LctMonolith.Models.Enums;
public enum MessageStyle
{
Normal,
Loud,
Think,
Action
}

View File

@@ -1,19 +0,0 @@
namespace LctMonolith.Models;
public class Mission
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Title { get; set; } = null!;
public string? Description { get; set; }
public string? Branch { get; set; }
public MissionCategory Category { get; set; }
public Guid? MinRankId { get; set; }
public Rank? MinRank { get; set; }
public int ExperienceReward { get; set; }
public int ManaReward { get; set; }
public bool IsActive { get; set; } = true;
public ICollection<MissionCompetencyReward> CompetencyRewards { get; set; } = new List<MissionCompetencyReward>();
public ICollection<MissionArtifactReward> ArtifactRewards { get; set; } = new List<MissionArtifactReward>();
public ICollection<UserMission> UserMissions { get; set; } = new List<UserMission>();
public ICollection<RankRequiredMission> RanksRequiring { get; set; } = new List<RankRequiredMission>();
}

View File

@@ -1,9 +0,0 @@
namespace LctMonolith.Models;
public class MissionArtifactReward
{
public Guid MissionId { get; set; }
public Mission Mission { get; set; } = null!;
public Guid ArtifactId { get; set; }
public Artifact Artifact { get; set; } = null!;
}

View File

@@ -1,3 +0,0 @@
namespace LctMonolith.Models;
public enum MissionCategory { Quest = 0, Recruiting = 1, Lecture = 2, Simulator = 3 }

View File

@@ -1,11 +0,0 @@
namespace LctMonolith.Models;
public class MissionCompetencyReward
{
public Guid MissionId { get; set; }
public Mission Mission { get; set; } = null!;
public Guid CompetencyId { get; set; }
public Competency Competency { get; set; } = null!;
public int LevelDelta { get; set; }
public int ProgressPointsDelta { get; set; }
}

View File

@@ -1,11 +0,0 @@
namespace LctMonolith.Models;
public enum MissionStatus
{
Locked = 0,
Available = 1,
InProgress = 2,
Submitted = 3,
Completed = 4,
Rejected = 5
}

View File

@@ -1,12 +0,0 @@
namespace LctMonolith.Models;
public class Rank
{
public Guid Id { get; set; } = Guid.NewGuid();
public string Name { get; set; } = null!;
public int Order { get; set; }
public int RequiredExperience { get; set; }
public ICollection<RankRequiredMission> RequiredMissions { get; set; } = new List<RankRequiredMission>();
public ICollection<RankRequiredCompetency> RequiredCompetencies { get; set; } = new List<RankRequiredCompetency>();
public ICollection<AppUser> Users { get; set; } = new List<AppUser>();
}

View File

@@ -1,10 +0,0 @@
namespace LctMonolith.Models;
public class RankRequiredCompetency
{
public Guid RankId { get; set; }
public Rank Rank { get; set; } = null!;
public Guid CompetencyId { get; set; }
public Competency Competency { get; set; } = null!;
public int MinLevel { get; set; }
}

View File

@@ -1,10 +0,0 @@
namespace LctMonolith.Models;
public class UserArtifact
{
public Guid UserId { get; set; }
public AppUser User { get; set; } = null!;
public Guid ArtifactId { get; set; }
public Artifact Artifact { get; set; } = null!;
public DateTime ObtainedAt { get; set; } = DateTime.UtcNow;
}

View File

@@ -1,11 +0,0 @@
namespace LctMonolith.Models;
public class UserCompetency
{
public Guid UserId { get; set; }
public AppUser User { get; set; } = null!;
public Guid CompetencyId { get; set; }
public Competency Competency { get; set; } = null!;
public int Level { get; set; }
public int ProgressPoints { get; set; }
}

View File

@@ -1,12 +0,0 @@
namespace LctMonolith.Models;
public class UserMission
{
public Guid UserId { get; set; }
public AppUser User { get; set; } = null!;
public Guid MissionId { get; set; }
public Mission Mission { get; set; } = null!;
public MissionStatus Status { get; set; } = MissionStatus.Available;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
public string? SubmissionData { get; set; }
}

View File

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using System.Text; using System.Text;
using LctMonolith.Models; // replaced Domain.Entities using LctMonolith.Models.Database; // replaced Domain.Entities
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using LctMonolith.Application.Middleware; using LctMonolith.Application.Middleware;
using LctMonolith.Services; using LctMonolith.Services;
@@ -95,7 +95,7 @@ builder.Services.AddScoped<IUnitOfWork, UnitOfWork>();
// Domain services // Domain services
builder.Services.AddScoped<ITokenService, TokenService>(); builder.Services.AddScoped<ITokenService, TokenService>();
builder.Services.AddScoped<IGamificationService, GamificationService>(); builder.Services.AddScoped<IGamificationService, LctMonolith>();
builder.Services.AddScoped<IMissionService, MissionService>(); builder.Services.AddScoped<IMissionService, MissionService>();
builder.Services.AddScoped<IStoreService, StoreService>(); builder.Services.AddScoped<IStoreService, StoreService>();
builder.Services.AddScoped<INotificationService, NotificationService>(); builder.Services.AddScoped<INotificationService, NotificationService>();

View File

@@ -1,5 +1,5 @@
using LctMonolith.Database.UnitOfWork; using LctMonolith.Database.UnitOfWork;
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services.Models; using LctMonolith.Services.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services.Models; using LctMonolith.Services.Models;
namespace LctMonolith.Services.Contracts; namespace LctMonolith.Services.Contracts;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
namespace LctMonolith.Services.Contracts; namespace LctMonolith.Services.Contracts;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services.Models; using LctMonolith.Services.Models;
namespace LctMonolith.Services.Contracts; namespace LctMonolith.Services.Contracts;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
namespace LctMonolith.Services.Contracts; namespace LctMonolith.Services.Contracts;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
namespace LctMonolith.Services.Contracts; namespace LctMonolith.Services.Contracts;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services.Models; using LctMonolith.Services.Models;
namespace LctMonolith.Services.Contracts; namespace LctMonolith.Services.Contracts;

View File

@@ -1,6 +1,6 @@
using System.Linq; using System.Linq;
using LctMonolith.Database.UnitOfWork; using LctMonolith.Database.UnitOfWork;
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services.Contracts; using LctMonolith.Services.Contracts;
using LctMonolith.Services.Models; using LctMonolith.Services.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;

View File

@@ -1,5 +1,5 @@
using LctMonolith.Database.UnitOfWork; using LctMonolith.Database.UnitOfWork;
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services.Contracts; using LctMonolith.Services.Contracts;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services.Models; using LctMonolith.Services.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Serilog; using Serilog;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
namespace LctMonolith.Services.Models; namespace LctMonolith.Services.Models;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
namespace LctMonolith.Services.Models; namespace LctMonolith.Services.Models;

View File

@@ -1,5 +1,5 @@
using LctMonolith.Database.UnitOfWork; using LctMonolith.Database.UnitOfWork;
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services.Contracts; using LctMonolith.Services.Contracts;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;

View File

@@ -1,4 +1,4 @@
using LctMonolith.Models; using LctMonolith.Models.Database;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Serilog; using Serilog;
using System.Text.Json; using System.Text.Json;

View File

@@ -4,7 +4,7 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using LctMonolith.Application.Options; using LctMonolith.Application.Options;
using LctMonolith.Database.UnitOfWork; using LctMonolith.Database.UnitOfWork;
using LctMonolith.Models; using LctMonolith.Models.Database;
using LctMonolith.Services.Contracts; using LctMonolith.Services.Contracts;
using LctMonolith.Services.Models; using LctMonolith.Services.Models;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;