diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 69dac582..7e6dd684 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -20,7 +20,11 @@ jobs:
- name: Docker build and push
run: |
echo ${{env.PRODUCTION_SETTINGS_FILE}}
- sed -i 's/"__AUTH0_AUDIENCE",/"${{ vars.AUTH0_AUDIENCE }}",/g' ${{env.PRODUCTION_SETTINGS_FILE}}
+ sed -i 's/"__GOOGLE_CLIENT_ID",/"${{ vars.GOOGLE_CLIENT_ID }}",/g' ${{env.PRODUCTION_SETTINGS_FILE}}
+ sed -i 's/"__GOOGLE_CLIENT_SECRET",/"${{ vars.GOOGLE_CLIENT_SECRET }}",/g' ${{env.PRODUCTION_SETTINGS_FILE}}
+ sed -i 's/"__AUTH_GITHUB_CLIENT_ID",/"${{ vars.AUTH_GITHUB_CLIENT_ID }}",/g' ${{env.PRODUCTION_SETTINGS_FILE}}
+ sed -i 's/"__AUTH_GITHUB_CLIENT_SECRET",/"${{ vars.AUTH_GITHUB_CLIENT_SECRET }}",/g' ${{env.PRODUCTION_SETTINGS_FILE}}
+ sed -i 's/"__JWT_SECRET",/"${{ vars.JWT_SECRET }}",/g' ${{env.PRODUCTION_SETTINGS_FILE}}
sed -i 's/"__DATABASE_CONNECTION_STRING",/"${{ vars.DATABASE_CONNECTION_STRING }}",/g' ${{env.PRODUCTION_SETTINGS_FILE}}
sed -i 's/"__TELEGRAM_BOT_KEY",/"${{ secrets.TELEGRAM_BOT_KEY }}",/g' ${{env.PRODUCTION_SETTINGS_FILE}}
sed -i 's/"__PROFILE_GITHUB_BOT_KEY",/"${{ secrets.PROFILE_GITHUB_BOT_KEY }}",/g' ${{env.PRODUCTION_SETTINGS_FILE}}
diff --git a/src/Domain.Tests/Entities/AiAnalysisRecordTests.cs b/src/Domain.Tests/Entities/AiAnalysisRecordTests.cs
index d2cb3e61..69bb1230 100644
--- a/src/Domain.Tests/Entities/AiAnalysisRecordTests.cs
+++ b/src/Domain.Tests/Entities/AiAnalysisRecordTests.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.StatData;
+using Domain.Entities.StatData;
using Domain.Entities.StatData.Salary;
using TestUtils.Fakes;
using Xunit;
diff --git a/src/Domain.Tests/Entities/Companies/CompanyReviewTests.cs b/src/Domain.Tests/Entities/Companies/CompanyReviewTests.cs
index 2677a0ec..c7358654 100644
--- a/src/Domain.Tests/Entities/Companies/CompanyReviewTests.cs
+++ b/src/Domain.Tests/Entities/Companies/CompanyReviewTests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Entities.Companies;
using Domain.Enums;
using TestUtils.Fakes;
diff --git a/src/Domain.Tests/Entities/Companies/CompanyTest.cs b/src/Domain.Tests/Entities/Companies/CompanyTest.cs
index 99dd23bb..a18f6ac3 100644
--- a/src/Domain.Tests/Entities/Companies/CompanyTest.cs
+++ b/src/Domain.Tests/Entities/Companies/CompanyTest.cs
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
using System.Threading.Tasks;
using Domain.Enums;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Domain.Tests/Totp/TotpCodeTests.cs b/src/Domain.Tests/Totp/TotpCodeTests.cs
index 64404974..6e0b7f6e 100644
--- a/src/Domain.Tests/Totp/TotpCodeTests.cs
+++ b/src/Domain.Tests/Totp/TotpCodeTests.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Totp;
using Xunit;
diff --git a/src/Domain.Tests/ValueObjects/CompanySlugTests.cs b/src/Domain.Tests/ValueObjects/CompanySlugTests.cs
index cbc58737..1dc33f32 100644
--- a/src/Domain.Tests/ValueObjects/CompanySlugTests.cs
+++ b/src/Domain.Tests/ValueObjects/CompanySlugTests.cs
@@ -1,4 +1,4 @@
-using Domain.ValueObjects;
+using Domain.ValueObjects;
using Xunit;
namespace Domain.Tests.ValueObjects;
diff --git a/src/Domain.Tests/ValueObjects/KebabCaseSlugTests.cs b/src/Domain.Tests/ValueObjects/KebabCaseSlugTests.cs
index 7ad96788..24f0d115 100644
--- a/src/Domain.Tests/ValueObjects/KebabCaseSlugTests.cs
+++ b/src/Domain.Tests/ValueObjects/KebabCaseSlugTests.cs
@@ -1,4 +1,4 @@
-using Domain.ValueObjects;
+using Domain.ValueObjects;
using Xunit;
namespace Domain.Tests.ValueObjects;
diff --git a/src/Domain.Tests/ValueObjects/SalaryGradeRangesTests.cs b/src/Domain.Tests/ValueObjects/SalaryGradeRangesTests.cs
index bd5df5dc..3783a248 100644
--- a/src/Domain.Tests/ValueObjects/SalaryGradeRangesTests.cs
+++ b/src/Domain.Tests/ValueObjects/SalaryGradeRangesTests.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using Domain.Entities.Enums;
using Domain.Entities.StatData.Salary;
using Domain.ValueObjects;
diff --git a/src/Domain.Tests/ValueObjects/SalaryShortFormattedValueTests.cs b/src/Domain.Tests/ValueObjects/SalaryShortFormattedValueTests.cs
index fec3ade3..6a490006 100644
--- a/src/Domain.Tests/ValueObjects/SalaryShortFormattedValueTests.cs
+++ b/src/Domain.Tests/ValueObjects/SalaryShortFormattedValueTests.cs
@@ -1,4 +1,4 @@
-using Domain.ValueObjects;
+using Domain.ValueObjects;
using Xunit;
namespace Domain.Tests.ValueObjects;
diff --git a/src/Domain.Tests/ValueObjects/SalarySpaceFormattedValueTests.cs b/src/Domain.Tests/ValueObjects/SalarySpaceFormattedValueTests.cs
index 2bab8ead..0bfdbe2f 100644
--- a/src/Domain.Tests/ValueObjects/SalarySpaceFormattedValueTests.cs
+++ b/src/Domain.Tests/ValueObjects/SalarySpaceFormattedValueTests.cs
@@ -1,4 +1,4 @@
-using Domain.ValueObjects;
+using Domain.ValueObjects;
using Xunit;
namespace Domain.Tests.ValueObjects;
diff --git a/src/Domain/Attributes/CollectionNotEmptyBaseAttribute.cs b/src/Domain/Attributes/CollectionNotEmptyBaseAttribute.cs
index 43ac4e22..f92e819e 100644
--- a/src/Domain/Attributes/CollectionNotEmptyBaseAttribute.cs
+++ b/src/Domain/Attributes/CollectionNotEmptyBaseAttribute.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
diff --git a/src/Domain/Attributes/GroupAttribute.cs b/src/Domain/Attributes/GroupAttribute.cs
index fa712e76..6b14ff87 100644
--- a/src/Domain/Attributes/GroupAttribute.cs
+++ b/src/Domain/Attributes/GroupAttribute.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Entities.Enums;
using Domain.Enums;
diff --git a/src/Domain/Attributes/NotDefaultValueAttribute.cs b/src/Domain/Attributes/NotDefaultValueAttribute.cs
index 111f9eee..ddeeec40 100644
--- a/src/Domain/Attributes/NotDefaultValueAttribute.cs
+++ b/src/Domain/Attributes/NotDefaultValueAttribute.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
diff --git a/src/Domain/Domain.csproj b/src/Domain/Domain.csproj
index f68b03f0..7b3b5e96 100644
--- a/src/Domain/Domain.csproj
+++ b/src/Domain/Domain.csproj
@@ -8,6 +8,7 @@
+
diff --git a/src/Domain/Entities/Auth/M2mClient.cs b/src/Domain/Entities/Auth/M2mClient.cs
new file mode 100644
index 00000000..9a9f0cfb
--- /dev/null
+++ b/src/Domain/Entities/Auth/M2mClient.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using Domain.Entities.Users;
+using Domain.Validation;
+
+namespace Domain.Entities.Auth;
+
+public class M2mClient : BaseModel, IHasDeletedAt
+{
+ protected M2mClient()
+ {
+ }
+
+ public M2mClient(
+ string name,
+ string description,
+ long createdByUserId)
+ {
+ Name = name.ThrowIfNullOrEmpty(nameof(name));
+ Description = description;
+ ClientId = Guid.NewGuid().ToString("N");
+ IsActive = true;
+ CreatedByUserId = createdByUserId;
+ Scopes = new List();
+ }
+
+ public string Name { get; protected set; }
+
+ public string Description { get; protected set; }
+
+ public string ClientId { get; protected set; }
+
+ public string ClientSecretHash { get; protected set; }
+
+ public bool IsActive { get; protected set; }
+
+ public DateTimeOffset? DeletedAt { get; protected set; }
+
+ public virtual List Scopes { get; protected set; }
+
+ public long CreatedByUserId { get; protected set; }
+
+ public virtual User CreatedByUser { get; protected set; }
+
+ public DateTimeOffset? LastUsedAt { get; protected set; }
+
+ public string LastUsedIpAddress { get; protected set; }
+
+ public int? RateLimitPerMinute { get; protected set; }
+
+ public int? RateLimitPerDay { get; protected set; }
+
+ public void SetClientSecret(string hashedSecret)
+ {
+ ClientSecretHash = hashedSecret;
+ }
+
+ public void Deactivate()
+ {
+ IsActive = false;
+ }
+
+ public void Activate()
+ {
+ IsActive = true;
+ }
+
+ public void RecordUsage(string ipAddress)
+ {
+ LastUsedAt = DateTimeOffset.UtcNow;
+ LastUsedIpAddress = ipAddress;
+ }
+
+ public void Update(
+ string name,
+ string description,
+ int? rateLimitPerMinute,
+ int? rateLimitPerDay)
+ {
+ if (!string.IsNullOrWhiteSpace(name))
+ {
+ Name = name;
+ }
+
+ Description = description;
+ RateLimitPerMinute = rateLimitPerMinute;
+ RateLimitPerDay = rateLimitPerDay;
+ }
+
+ public void Delete()
+ {
+ if (DeletedAt.HasValue)
+ {
+ throw new InvalidOperationException($"M2M Client Id:{Id} is already deleted");
+ }
+
+ DeletedAt = DateTimeOffset.UtcNow;
+ IsActive = false;
+ }
+}
diff --git a/src/Domain/Entities/Auth/M2mClientScope.cs b/src/Domain/Entities/Auth/M2mClientScope.cs
new file mode 100644
index 00000000..6b547199
--- /dev/null
+++ b/src/Domain/Entities/Auth/M2mClientScope.cs
@@ -0,0 +1,24 @@
+using Domain.Validation;
+
+namespace Domain.Entities.Auth;
+
+public class M2mClientScope : BaseModel
+{
+ protected M2mClientScope()
+ {
+ }
+
+ public M2mClientScope(
+ long m2mClientId,
+ string scope)
+ {
+ M2mClientId = m2mClientId;
+ Scope = scope.ThrowIfNullOrEmpty(nameof(scope));
+ }
+
+ public long M2mClientId { get; protected set; }
+
+ public virtual M2mClient M2mClient { get; protected set; }
+
+ public string Scope { get; protected set; }
+}
diff --git a/src/Domain/Entities/Auth/RefreshToken.cs b/src/Domain/Entities/Auth/RefreshToken.cs
new file mode 100644
index 00000000..1a216edc
--- /dev/null
+++ b/src/Domain/Entities/Auth/RefreshToken.cs
@@ -0,0 +1,46 @@
+using System;
+using Domain.Entities.Users;
+
+namespace Domain.Entities.Auth;
+
+public class RefreshToken : BaseModel
+{
+ protected RefreshToken()
+ {
+ }
+
+ public RefreshToken(
+ long userId,
+ string token,
+ DateTimeOffset expiresAt,
+ string deviceInfo = null)
+ {
+ UserId = userId;
+ Token = token;
+ ExpiresAt = expiresAt;
+ DeviceInfo = deviceInfo;
+ IsRevoked = false;
+ }
+
+ public string Token { get; protected set; }
+
+ public long UserId { get; protected set; }
+
+ public virtual User User { get; protected set; }
+
+ public DateTimeOffset ExpiresAt { get; protected set; }
+
+ public bool IsRevoked { get; protected set; }
+
+ public string DeviceInfo { get; protected set; }
+
+ public void Revoke()
+ {
+ IsRevoked = true;
+ }
+
+ public bool IsValid()
+ {
+ return !IsRevoked && ExpiresAt > DateTimeOffset.UtcNow;
+ }
+}
diff --git a/src/Domain/Entities/BaseModel.cs b/src/Domain/Entities/BaseModel.cs
index eea46758..dc408aca 100644
--- a/src/Domain/Entities/BaseModel.cs
+++ b/src/Domain/Entities/BaseModel.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Domain.Entities;
diff --git a/src/Domain/Entities/CSV/UserCsvDownload.cs b/src/Domain/Entities/CSV/UserCsvDownload.cs
index 0c757c4d..3ed66619 100644
--- a/src/Domain/Entities/CSV/UserCsvDownload.cs
+++ b/src/Domain/Entities/CSV/UserCsvDownload.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Entities.Users;
using Domain.Enums;
diff --git a/src/Domain/Entities/Companies/Company.cs b/src/Domain/Entities/Companies/Company.cs
index e149d8b0..51c0fe4e 100644
--- a/src/Domain/Entities/Companies/Company.cs
+++ b/src/Domain/Entities/Companies/Company.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using Domain.Validation.Exceptions;
diff --git a/src/Domain/Entities/Companies/CompanyEmploymentType.cs b/src/Domain/Entities/Companies/CompanyEmploymentType.cs
index da3c11f5..9f4c9f0e 100644
--- a/src/Domain/Entities/Companies/CompanyEmploymentType.cs
+++ b/src/Domain/Entities/Companies/CompanyEmploymentType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Companies
+namespace Domain.Entities.Companies
{
public enum CompanyEmploymentType
{
diff --git a/src/Domain/Entities/Companies/CompanyOpenAiAnalysis.cs b/src/Domain/Entities/Companies/CompanyOpenAiAnalysis.cs
index fe88dd8d..85679dbd 100644
--- a/src/Domain/Entities/Companies/CompanyOpenAiAnalysis.cs
+++ b/src/Domain/Entities/Companies/CompanyOpenAiAnalysis.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
diff --git a/src/Domain/Entities/Companies/CompanyRatingHistory.cs b/src/Domain/Entities/Companies/CompanyRatingHistory.cs
index 9b1f5e98..efeb54a3 100644
--- a/src/Domain/Entities/Companies/CompanyRatingHistory.cs
+++ b/src/Domain/Entities/Companies/CompanyRatingHistory.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Entities.Companies;
diff --git a/src/Domain/Entities/Companies/CompanyReview.cs b/src/Domain/Entities/Companies/CompanyReview.cs
index 006e1652..cee3b4ec 100644
--- a/src/Domain/Entities/Companies/CompanyReview.cs
+++ b/src/Domain/Entities/Companies/CompanyReview.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
diff --git a/src/Domain/Entities/Companies/CompanyReviewVote.cs b/src/Domain/Entities/Companies/CompanyReviewVote.cs
index 7457cec0..7cc36c36 100644
--- a/src/Domain/Entities/Companies/CompanyReviewVote.cs
+++ b/src/Domain/Entities/Companies/CompanyReviewVote.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Entities.Users;
namespace Domain.Entities.Companies;
diff --git a/src/Domain/Entities/Companies/CompanyReviewVoteType.cs b/src/Domain/Entities/Companies/CompanyReviewVoteType.cs
index 7337b69d..374c62fc 100644
--- a/src/Domain/Entities/Companies/CompanyReviewVoteType.cs
+++ b/src/Domain/Entities/Companies/CompanyReviewVoteType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Companies;
+namespace Domain.Entities.Companies;
public enum CompanyReviewVoteType
{
diff --git a/src/Domain/Entities/Currencies/CurrenciesCollection.cs b/src/Domain/Entities/Currencies/CurrenciesCollection.cs
index 8ae19370..65257507 100644
--- a/src/Domain/Entities/Currencies/CurrenciesCollection.cs
+++ b/src/Domain/Entities/Currencies/CurrenciesCollection.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using Domain.Entities.Salaries;
diff --git a/src/Domain/Entities/Currencies/CurrencyContent.cs b/src/Domain/Entities/Currencies/CurrencyContent.cs
index 00477667..95a0cd9d 100644
--- a/src/Domain/Entities/Currencies/CurrencyContent.cs
+++ b/src/Domain/Entities/Currencies/CurrencyContent.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Globalization;
using System.Xml.Linq;
using Domain.Entities.Salaries;
diff --git a/src/Domain/Entities/Currencies/KztCurrencyContent.cs b/src/Domain/Entities/Currencies/KztCurrencyContent.cs
index 9725a502..eea6e14b 100644
--- a/src/Domain/Entities/Currencies/KztCurrencyContent.cs
+++ b/src/Domain/Entities/Currencies/KztCurrencyContent.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Entities.Salaries;
namespace Domain.Entities.Currencies;
diff --git a/src/Domain/Entities/Enums/DeveloperGrade.cs b/src/Domain/Entities/Enums/DeveloperGrade.cs
index d98cb63e..235b8b69 100644
--- a/src/Domain/Entities/Enums/DeveloperGrade.cs
+++ b/src/Domain/Entities/Enums/DeveloperGrade.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel;
+using System.ComponentModel;
using Domain.Attributes;
using Domain.Enums;
diff --git a/src/Domain/Entities/Github/GithubPersonalUserToken.cs b/src/Domain/Entities/Github/GithubPersonalUserToken.cs
index 39412eaf..781990ca 100644
--- a/src/Domain/Entities/Github/GithubPersonalUserToken.cs
+++ b/src/Domain/Entities/Github/GithubPersonalUserToken.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Entities.Github;
diff --git a/src/Domain/Entities/Github/GithubProfile.cs b/src/Domain/Entities/Github/GithubProfile.cs
index 813092b6..4fd3e173 100644
--- a/src/Domain/Entities/Github/GithubProfile.cs
+++ b/src/Domain/Entities/Github/GithubProfile.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
diff --git a/src/Domain/Entities/Github/GithubProfileBotChat.cs b/src/Domain/Entities/Github/GithubProfileBotChat.cs
index 989699b1..51534fd1 100644
--- a/src/Domain/Entities/Github/GithubProfileBotChat.cs
+++ b/src/Domain/Entities/Github/GithubProfileBotChat.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
namespace Domain.Entities.Github;
diff --git a/src/Domain/Entities/Github/GithubProfileBotMessage.cs b/src/Domain/Entities/Github/GithubProfileBotMessage.cs
index e405d29c..55a817b2 100644
--- a/src/Domain/Entities/Github/GithubProfileBotMessage.cs
+++ b/src/Domain/Entities/Github/GithubProfileBotMessage.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Entities.Github;
diff --git a/src/Domain/Entities/Github/GithubProfileData.cs b/src/Domain/Entities/Github/GithubProfileData.cs
index 60cbda3c..5a433534 100644
--- a/src/Domain/Entities/Github/GithubProfileData.cs
+++ b/src/Domain/Entities/Github/GithubProfileData.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Domain/Entities/Github/GithubProfileProcessingJob.cs b/src/Domain/Entities/Github/GithubProfileProcessingJob.cs
index 8020ad01..80962ba6 100644
--- a/src/Domain/Entities/Github/GithubProfileProcessingJob.cs
+++ b/src/Domain/Entities/Github/GithubProfileProcessingJob.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Github;
+namespace Domain.Entities.Github;
public class GithubProfileProcessingJob : HasDatesBase
{
diff --git a/src/Domain/Entities/HasDatesBase.cs b/src/Domain/Entities/HasDatesBase.cs
index 5ca321a1..1594e799 100644
--- a/src/Domain/Entities/HasDatesBase.cs
+++ b/src/Domain/Entities/HasDatesBase.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.ValueObjects.Dates.Interfaces;
namespace Domain.Entities;
diff --git a/src/Domain/Entities/HistoricalRecords/SalariesHistoricalDataRecord.cs b/src/Domain/Entities/HistoricalRecords/SalariesHistoricalDataRecord.cs
index 2f78be69..cd2d10b2 100644
--- a/src/Domain/Entities/HistoricalRecords/SalariesHistoricalDataRecord.cs
+++ b/src/Domain/Entities/HistoricalRecords/SalariesHistoricalDataRecord.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Entities.StatData.Salary;
namespace Domain.Entities.HistoricalRecords;
diff --git a/src/Domain/Entities/HistoricalRecords/SalariesHistoricalDataRecordTemplate.cs b/src/Domain/Entities/HistoricalRecords/SalariesHistoricalDataRecordTemplate.cs
index f1c1befd..177cccea 100644
--- a/src/Domain/Entities/HistoricalRecords/SalariesHistoricalDataRecordTemplate.cs
+++ b/src/Domain/Entities/HistoricalRecords/SalariesHistoricalDataRecordTemplate.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using Domain.Validation.Exceptions;
diff --git a/src/Domain/Entities/IBaseModel.cs b/src/Domain/Entities/IBaseModel.cs
index 139d074f..8768d8d9 100644
--- a/src/Domain/Entities/IBaseModel.cs
+++ b/src/Domain/Entities/IBaseModel.cs
@@ -1,4 +1,4 @@
-using Domain.ValueObjects.Dates.Interfaces;
+using Domain.ValueObjects.Dates.Interfaces;
namespace Domain.Entities;
diff --git a/src/Domain/Entities/IHasDeletedAt.cs b/src/Domain/Entities/IHasDeletedAt.cs
index 54f4fb00..a401d801 100644
--- a/src/Domain/Entities/IHasDeletedAt.cs
+++ b/src/Domain/Entities/IHasDeletedAt.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Entities;
diff --git a/src/Domain/Entities/IHasId.cs b/src/Domain/Entities/IHasId.cs
index 649199b4..681a4224 100644
--- a/src/Domain/Entities/IHasId.cs
+++ b/src/Domain/Entities/IHasId.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities;
+namespace Domain.Entities;
public interface IHasId : IHasIdBase
{
diff --git a/src/Domain/Entities/IHasIdBase.cs b/src/Domain/Entities/IHasIdBase.cs
index 1e7ea2ed..218d14aa 100644
--- a/src/Domain/Entities/IHasIdBase.cs
+++ b/src/Domain/Entities/IHasIdBase.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities;
+namespace Domain.Entities;
public interface IHasIdBase
where TKey : struct
diff --git a/src/Domain/Entities/Interviews/Interview.cs b/src/Domain/Entities/Interviews/Interview.cs
index 2089cacf..ee260c86 100644
--- a/src/Domain/Entities/Interviews/Interview.cs
+++ b/src/Domain/Entities/Interviews/Interview.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
diff --git a/src/Domain/Entities/Interviews/InterviewSubject.cs b/src/Domain/Entities/Interviews/InterviewSubject.cs
index eb652e61..d9eead35 100644
--- a/src/Domain/Entities/Interviews/InterviewSubject.cs
+++ b/src/Domain/Entities/Interviews/InterviewSubject.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
using Domain.Entities.Enums;
namespace Domain.Entities.Interviews;
diff --git a/src/Domain/Entities/Interviews/InterviewTemplate.cs b/src/Domain/Entities/Interviews/InterviewTemplate.cs
index fc4d2524..1b7376df 100644
--- a/src/Domain/Entities/Interviews/InterviewTemplate.cs
+++ b/src/Domain/Entities/Interviews/InterviewTemplate.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
diff --git a/src/Domain/Entities/Interviews/InterviewTemplateSubject.cs b/src/Domain/Entities/Interviews/InterviewTemplateSubject.cs
index c194d837..381c9734 100644
--- a/src/Domain/Entities/Interviews/InterviewTemplateSubject.cs
+++ b/src/Domain/Entities/Interviews/InterviewTemplateSubject.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
namespace Domain.Entities.Interviews;
diff --git a/src/Domain/Entities/Interviews/ShareLink.cs b/src/Domain/Entities/Interviews/ShareLink.cs
index ff43b90c..472f106f 100644
--- a/src/Domain/Entities/Interviews/ShareLink.cs
+++ b/src/Domain/Entities/Interviews/ShareLink.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Entities.Interviews
{
diff --git a/src/Domain/Entities/Labels/EntityLabelBase.cs b/src/Domain/Entities/Labels/EntityLabelBase.cs
index bf3945ce..c78001df 100644
--- a/src/Domain/Entities/Labels/EntityLabelBase.cs
+++ b/src/Domain/Entities/Labels/EntityLabelBase.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
using Domain.Entities.Users;
using Domain.Enums;
using Domain.Validation.Exceptions;
diff --git a/src/Domain/Entities/Labels/HasLabelsEntity.cs b/src/Domain/Entities/Labels/HasLabelsEntity.cs
index 75c7f37a..96668682 100644
--- a/src/Domain/Entities/Labels/HasLabelsEntity.cs
+++ b/src/Domain/Entities/Labels/HasLabelsEntity.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
namespace Domain.Entities.Labels;
diff --git a/src/Domain/Entities/Labels/UserLabel.cs b/src/Domain/Entities/Labels/UserLabel.cs
index 4c47cc83..8a5bc585 100644
--- a/src/Domain/Entities/Labels/UserLabel.cs
+++ b/src/Domain/Entities/Labels/UserLabel.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using Domain.Entities.Interviews;
using Domain.Entities.Users;
using Domain.ValueObjects;
diff --git a/src/Domain/Entities/ModelExtensions.cs b/src/Domain/Entities/ModelExtensions.cs
index 924a5686..4ed37ca5 100644
--- a/src/Domain/Entities/ModelExtensions.cs
+++ b/src/Domain/Entities/ModelExtensions.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Entities;
diff --git a/src/Domain/Entities/Prompts/AiEngine.cs b/src/Domain/Entities/Prompts/AiEngine.cs
index fd09b86b..961c2ff1 100644
--- a/src/Domain/Entities/Prompts/AiEngine.cs
+++ b/src/Domain/Entities/Prompts/AiEngine.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Prompts;
+namespace Domain.Entities.Prompts;
public enum AiEngine
{
diff --git a/src/Domain/Entities/Prompts/OpenAiPrompt.cs b/src/Domain/Entities/Prompts/OpenAiPrompt.cs
index 67b53160..08b3d672 100644
--- a/src/Domain/Entities/Prompts/OpenAiPrompt.cs
+++ b/src/Domain/Entities/Prompts/OpenAiPrompt.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
namespace Domain.Entities.Prompts;
diff --git a/src/Domain/Entities/Prompts/OpenAiPromptType.cs b/src/Domain/Entities/Prompts/OpenAiPromptType.cs
index 88c3ceb2..e5005730 100644
--- a/src/Domain/Entities/Prompts/OpenAiPromptType.cs
+++ b/src/Domain/Entities/Prompts/OpenAiPromptType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Prompts;
+namespace Domain.Entities.Prompts;
public enum OpenAiPromptType
{
diff --git a/src/Domain/Entities/Questions/ExpectationReplyType.cs b/src/Domain/Entities/Questions/ExpectationReplyType.cs
index 05efec4f..c392b122 100644
--- a/src/Domain/Entities/Questions/ExpectationReplyType.cs
+++ b/src/Domain/Entities/Questions/ExpectationReplyType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Questions;
+namespace Domain.Entities.Questions;
public enum ExpectationReplyType
{
diff --git a/src/Domain/Entities/Questions/SalariesSurveyQuestion.cs b/src/Domain/Entities/Questions/SalariesSurveyQuestion.cs
index cb1816a6..825e0684 100644
--- a/src/Domain/Entities/Questions/SalariesSurveyQuestion.cs
+++ b/src/Domain/Entities/Questions/SalariesSurveyQuestion.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using Domain.Entities.Users;
diff --git a/src/Domain/Entities/Questions/SalariesSurveyReply.cs b/src/Domain/Entities/Questions/SalariesSurveyReply.cs
index 89bc2dab..e933f8d2 100644
--- a/src/Domain/Entities/Questions/SalariesSurveyReply.cs
+++ b/src/Domain/Entities/Questions/SalariesSurveyReply.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using Domain.Entities.Users;
using Domain.Validation.Exceptions;
diff --git a/src/Domain/Entities/Questions/SurveyUsefulnessReplyType.cs b/src/Domain/Entities/Questions/SurveyUsefulnessReplyType.cs
index a940554b..56ea7efe 100644
--- a/src/Domain/Entities/Questions/SurveyUsefulnessReplyType.cs
+++ b/src/Domain/Entities/Questions/SurveyUsefulnessReplyType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Questions;
+namespace Domain.Entities.Questions;
public enum SurveyUsefulnessReplyType
{
diff --git a/src/Domain/Entities/Salaries/CompanyType.cs b/src/Domain/Entities/Salaries/CompanyType.cs
index 79d26d61..f3fa0233 100644
--- a/src/Domain/Entities/Salaries/CompanyType.cs
+++ b/src/Domain/Entities/Salaries/CompanyType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Salaries;
+namespace Domain.Entities.Salaries;
public enum CompanyType
{
diff --git a/src/Domain/Entities/Salaries/Currency.cs b/src/Domain/Entities/Salaries/Currency.cs
index da6adef5..4e78131f 100644
--- a/src/Domain/Entities/Salaries/Currency.cs
+++ b/src/Domain/Entities/Salaries/Currency.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Salaries;
+namespace Domain.Entities.Salaries;
public enum Currency
{
diff --git a/src/Domain/Entities/Salaries/Profession.cs b/src/Domain/Entities/Salaries/Profession.cs
index 030552de..59df67a2 100644
--- a/src/Domain/Entities/Salaries/Profession.cs
+++ b/src/Domain/Entities/Salaries/Profession.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using Domain.Entities.Labels;
diff --git a/src/Domain/Entities/Salaries/SalarySourceType.cs b/src/Domain/Entities/Salaries/SalarySourceType.cs
index 9e15fcd8..816faf97 100644
--- a/src/Domain/Entities/Salaries/SalarySourceType.cs
+++ b/src/Domain/Entities/Salaries/SalarySourceType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Salaries;
+namespace Domain.Entities.Salaries;
public enum SalarySourceType
{
diff --git a/src/Domain/Entities/Salaries/Skill.cs b/src/Domain/Entities/Salaries/Skill.cs
index f2515b9a..ffbfe6fa 100644
--- a/src/Domain/Entities/Salaries/Skill.cs
+++ b/src/Domain/Entities/Salaries/Skill.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using Domain.Entities.Labels;
using Domain.Entities.Users;
using Domain.ValueObjects;
diff --git a/src/Domain/Entities/Salaries/UserProfessionEnum.cs b/src/Domain/Entities/Salaries/UserProfessionEnum.cs
index 4b643c53..5bcb360a 100644
--- a/src/Domain/Entities/Salaries/UserProfessionEnum.cs
+++ b/src/Domain/Entities/Salaries/UserProfessionEnum.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Salaries;
+namespace Domain.Entities.Salaries;
public enum UserProfessionEnum
{
diff --git a/src/Domain/Entities/Salaries/UserSalary.cs b/src/Domain/Entities/Salaries/UserSalary.cs
index 0a54a720..fa6a4aed 100644
--- a/src/Domain/Entities/Salaries/UserSalary.cs
+++ b/src/Domain/Entities/Salaries/UserSalary.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.ComponentModel.DataAnnotations;
using Domain.Attributes;
using Domain.Entities.Enums;
diff --git a/src/Domain/Entities/Salaries/WorkIndustry.cs b/src/Domain/Entities/Salaries/WorkIndustry.cs
index 3442ee8e..81599264 100644
--- a/src/Domain/Entities/Salaries/WorkIndustry.cs
+++ b/src/Domain/Entities/Salaries/WorkIndustry.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using Domain.Entities.Labels;
using Domain.Entities.Users;
using Domain.ValueObjects;
diff --git a/src/Domain/Entities/StatData/AiAnalysisRecord.cs b/src/Domain/Entities/StatData/AiAnalysisRecord.cs
index d52f12ab..f1dda198 100644
--- a/src/Domain/Entities/StatData/AiAnalysisRecord.cs
+++ b/src/Domain/Entities/StatData/AiAnalysisRecord.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Text.Json;
using Domain.Entities.StatData.CompanyReviews;
using Domain.Entities.StatData.Salary;
diff --git a/src/Domain/Entities/StatData/CompanyReviews/LastWeekCompanyReviewsSubscription.cs b/src/Domain/Entities/StatData/CompanyReviews/LastWeekCompanyReviewsSubscription.cs
index 82093e86..e650083b 100644
--- a/src/Domain/Entities/StatData/CompanyReviews/LastWeekCompanyReviewsSubscription.cs
+++ b/src/Domain/Entities/StatData/CompanyReviews/LastWeekCompanyReviewsSubscription.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Domain/Entities/StatData/Salary/JobPostingMessageSubscription.cs b/src/Domain/Entities/StatData/Salary/JobPostingMessageSubscription.cs
index 3244bb5c..d7eafe15 100644
--- a/src/Domain/Entities/StatData/Salary/JobPostingMessageSubscription.cs
+++ b/src/Domain/Entities/StatData/Salary/JobPostingMessageSubscription.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Domain/Entities/StatData/Salary/SalariesStatDataCacheItemSalaryData.cs b/src/Domain/Entities/StatData/Salary/SalariesStatDataCacheItemSalaryData.cs
index 67605128..e9050ab8 100644
--- a/src/Domain/Entities/StatData/Salary/SalariesStatDataCacheItemSalaryData.cs
+++ b/src/Domain/Entities/StatData/Salary/SalariesStatDataCacheItemSalaryData.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Linq;
using Domain.Enums;
using Domain.Extensions;
diff --git a/src/Domain/Entities/StatData/Salary/SalaryBaseData.cs b/src/Domain/Entities/StatData/Salary/SalaryBaseData.cs
index 92ad98af..6997d502 100644
--- a/src/Domain/Entities/StatData/Salary/SalaryBaseData.cs
+++ b/src/Domain/Entities/StatData/Salary/SalaryBaseData.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Entities.Enums;
using Domain.Entities.Salaries;
diff --git a/src/Domain/Entities/StatData/Salary/StatDataChangeSubscription.cs b/src/Domain/Entities/StatData/Salary/StatDataChangeSubscription.cs
index dfaa5eee..534d5b48 100644
--- a/src/Domain/Entities/StatData/Salary/StatDataChangeSubscription.cs
+++ b/src/Domain/Entities/StatData/Salary/StatDataChangeSubscription.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using Domain.Validation.Exceptions;
diff --git a/src/Domain/Entities/StatData/Salary/StatDataChangeSubscriptionRecord.cs b/src/Domain/Entities/StatData/Salary/StatDataChangeSubscriptionRecord.cs
index 4b039b2c..208a01a8 100644
--- a/src/Domain/Entities/StatData/Salary/StatDataChangeSubscriptionRecord.cs
+++ b/src/Domain/Entities/StatData/Salary/StatDataChangeSubscriptionRecord.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
namespace Domain.Entities.StatData.Salary;
diff --git a/src/Domain/Entities/StatData/SubscriptionEntityBase.cs b/src/Domain/Entities/StatData/SubscriptionEntityBase.cs
index 70b94113..543f26d0 100644
--- a/src/Domain/Entities/StatData/SubscriptionEntityBase.cs
+++ b/src/Domain/Entities/StatData/SubscriptionEntityBase.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Entities.StatData;
diff --git a/src/Domain/Entities/StatData/SubscriptionRegularityType.cs b/src/Domain/Entities/StatData/SubscriptionRegularityType.cs
index 8efe2ea9..6123f808 100644
--- a/src/Domain/Entities/StatData/SubscriptionRegularityType.cs
+++ b/src/Domain/Entities/StatData/SubscriptionRegularityType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.StatData;
+namespace Domain.Entities.StatData;
public enum SubscriptionRegularityType
{
diff --git a/src/Domain/Entities/StatData/SubscriptionTelegramMessage.cs b/src/Domain/Entities/StatData/SubscriptionTelegramMessage.cs
index 67a74f9f..1b61a194 100644
--- a/src/Domain/Entities/StatData/SubscriptionTelegramMessage.cs
+++ b/src/Domain/Entities/StatData/SubscriptionTelegramMessage.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Entities.StatData.CompanyReviews;
using Domain.Entities.StatData.Salary;
diff --git a/src/Domain/Entities/Telegram/SalariesBotMessage.cs b/src/Domain/Entities/Telegram/SalariesBotMessage.cs
index cbaec237..d063bd0a 100644
--- a/src/Domain/Entities/Telegram/SalariesBotMessage.cs
+++ b/src/Domain/Entities/Telegram/SalariesBotMessage.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Validation.Exceptions;
namespace Domain.Entities.Telegram;
diff --git a/src/Domain/Entities/Telegram/TelegramBotType.cs b/src/Domain/Entities/Telegram/TelegramBotType.cs
index 7557103b..4ca4318a 100644
--- a/src/Domain/Entities/Telegram/TelegramBotType.cs
+++ b/src/Domain/Entities/Telegram/TelegramBotType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Telegram;
+namespace Domain.Entities.Telegram;
public enum TelegramBotType
{
diff --git a/src/Domain/Entities/Telegram/TelegramBotUsageType.cs b/src/Domain/Entities/Telegram/TelegramBotUsageType.cs
index 06d6f139..03f5621e 100644
--- a/src/Domain/Entities/Telegram/TelegramBotUsageType.cs
+++ b/src/Domain/Entities/Telegram/TelegramBotUsageType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Telegram;
+namespace Domain.Entities.Telegram;
public enum TelegramBotUsageType
{
diff --git a/src/Domain/Entities/Telegram/TelegramInlineReply.cs b/src/Domain/Entities/Telegram/TelegramInlineReply.cs
index e6e731c7..fc7a5aad 100644
--- a/src/Domain/Entities/Telegram/TelegramInlineReply.cs
+++ b/src/Domain/Entities/Telegram/TelegramInlineReply.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Entities.Telegram;
diff --git a/src/Domain/Entities/Telegram/TelegramUserSettings.cs b/src/Domain/Entities/Telegram/TelegramUserSettings.cs
index 1b47e4d1..a77c0c90 100644
--- a/src/Domain/Entities/Telegram/TelegramUserSettings.cs
+++ b/src/Domain/Entities/Telegram/TelegramUserSettings.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.ComponentModel.DataAnnotations;
using Domain.Entities.Users;
diff --git a/src/Domain/Entities/Users/User.cs b/src/Domain/Entities/Users/User.cs
index c4f3e896..91398af3 100644
--- a/src/Domain/Entities/Users/User.cs
+++ b/src/Domain/Entities/Users/User.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
@@ -24,6 +24,27 @@ protected User()
{
}
+ public static User CreateFromGoogleAuth(
+ string email,
+ string firstName,
+ string lastName,
+ string identityId,
+ string profilePicture,
+ List roles)
+ {
+ var user = new User(
+ email,
+ firstName,
+ lastName,
+ roles.ToArray());
+
+ user.SetIdentityId(identityId);
+ user.ConfirmEmail();
+ user.SetProfilePicture(profilePicture);
+
+ return user;
+ }
+
public User(
string email,
string firstName,
@@ -88,6 +109,20 @@ public User(
public DateTimeOffset? LastLoginAt { get; protected set; }
+ public string PasswordHash { get; protected set; }
+
+ public string PasswordResetToken { get; protected set; }
+
+ public DateTimeOffset? PasswordResetTokenExpiresAt { get; protected set; }
+
+ public string EmailVerificationToken { get; protected set; }
+
+ public DateTimeOffset? EmailVerificationTokenExpiresAt { get; protected set; }
+
+ public int FailedLoginAttempts { get; protected set; }
+
+ public DateTimeOffset? LockedUntil { get; protected set; }
+
public virtual List UserRoles { get; protected set; } = new ();
public virtual List Salaries { get; protected set; } = new ();
@@ -403,4 +438,71 @@ public void UnsubscribeFromAll()
{
UnsubscribeMeFromAll = true;
}
+
+ public void SetPassword(string passwordHash)
+ {
+ PasswordHash = passwordHash;
+ }
+
+ public void SetEmailVerificationToken(string token, TimeSpan validity)
+ {
+ EmailVerificationToken = token;
+ EmailVerificationTokenExpiresAt = DateTimeOffset.UtcNow.Add(validity);
+ }
+
+ public void ClearEmailVerificationToken()
+ {
+ EmailVerificationToken = null;
+ EmailVerificationTokenExpiresAt = null;
+ }
+
+ public void SetPasswordResetToken(string token, TimeSpan validity)
+ {
+ PasswordResetToken = token;
+ PasswordResetTokenExpiresAt = DateTimeOffset.UtcNow.Add(validity);
+ }
+
+ public void ClearPasswordResetToken()
+ {
+ PasswordResetToken = null;
+ PasswordResetTokenExpiresAt = null;
+ }
+
+ public void IncrementFailedLoginAttempts()
+ {
+ FailedLoginAttempts++;
+ if (FailedLoginAttempts >= 5)
+ {
+ LockedUntil = DateTimeOffset.UtcNow.AddMinutes(15);
+ }
+ }
+
+ public void ResetFailedLoginAttempts()
+ {
+ FailedLoginAttempts = 0;
+ LockedUntil = null;
+ }
+
+ public bool IsLockedOut => LockedUntil.HasValue && LockedUntil > DateTimeOffset.UtcNow;
+
+ public bool IsLocalAuth()
+ {
+ return IdentityId != null &&
+ IdentityId.StartsWith(CurrentUser.LocalPrefix);
+ }
+
+ public void SetIdentityId(string identityId)
+ {
+ IdentityId = identityId;
+ }
+
+ public void SetProfilePicture(string profilePicture)
+ {
+ ProfilePicture = profilePicture;
+ }
+
+ public void RecordLogin()
+ {
+ LastLoginAt = DateTimeOffset.UtcNow;
+ }
}
\ No newline at end of file
diff --git a/src/Domain/Entities/Users/UserEmail.cs b/src/Domain/Entities/Users/UserEmail.cs
index 79a96c45..b50e19ad 100644
--- a/src/Domain/Entities/Users/UserEmail.cs
+++ b/src/Domain/Entities/Users/UserEmail.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
diff --git a/src/Domain/Entities/Users/UserEmailType.cs b/src/Domain/Entities/Users/UserEmailType.cs
index 6e3adfaa..d6a7ec08 100644
--- a/src/Domain/Entities/Users/UserEmailType.cs
+++ b/src/Domain/Entities/Users/UserEmailType.cs
@@ -1,4 +1,4 @@
-namespace Domain.Entities.Users;
+namespace Domain.Entities.Users;
public enum UserEmailType
{
diff --git a/src/Domain/Entities/Users/UserRole.cs b/src/Domain/Entities/Users/UserRole.cs
index 129f72d7..f96cabe6 100644
--- a/src/Domain/Entities/Users/UserRole.cs
+++ b/src/Domain/Entities/Users/UserRole.cs
@@ -1,4 +1,4 @@
-using Domain.Enums;
+using Domain.Enums;
using Domain.Validation;
namespace Domain.Entities.Users;
diff --git a/src/Domain/Enums/Gender.cs b/src/Domain/Enums/Gender.cs
index c256804e..dbd3729a 100644
--- a/src/Domain/Enums/Gender.cs
+++ b/src/Domain/Enums/Gender.cs
@@ -1,4 +1,4 @@
-namespace Domain.Enums;
+namespace Domain.Enums;
public enum Gender
{
diff --git a/src/Domain/Enums/GradeGroup.cs b/src/Domain/Enums/GradeGroup.cs
index 77749bd4..c0c919c2 100644
--- a/src/Domain/Enums/GradeGroup.cs
+++ b/src/Domain/Enums/GradeGroup.cs
@@ -1,4 +1,4 @@
-namespace Domain.Enums;
+namespace Domain.Enums;
public enum GradeGroup
{
diff --git a/src/Domain/Enums/KazakhstanCity.cs b/src/Domain/Enums/KazakhstanCity.cs
index e6d70bac..3a04c5b6 100644
--- a/src/Domain/Enums/KazakhstanCity.cs
+++ b/src/Domain/Enums/KazakhstanCity.cs
@@ -1,4 +1,4 @@
-namespace Domain.Enums;
+namespace Domain.Enums;
public enum KazakhstanCity : long
{
diff --git a/src/Domain/Enums/M2mScope.cs b/src/Domain/Enums/M2mScope.cs
new file mode 100644
index 00000000..b377a016
--- /dev/null
+++ b/src/Domain/Enums/M2mScope.cs
@@ -0,0 +1,33 @@
+using System.Linq;
+
+namespace Domain.Enums;
+
+public static class M2mScope
+{
+ public const string SalariesRead = "salaries:read";
+ public const string SalariesWrite = "salaries:write";
+
+ public const string InterviewsRead = "interviews:read";
+ public const string InterviewsWrite = "interviews:write";
+
+ public const string CompaniesRead = "companies:read";
+ public const string CompaniesWrite = "companies:write";
+
+ public const string UsersRead = "users:read";
+ public const string UsersWrite = "users:write";
+
+ public const string StatsRead = "stats:read";
+
+ public const string FullAccess = "*";
+
+ public static readonly string[] AllScopes = new[]
+ {
+ SalariesRead, SalariesWrite,
+ InterviewsRead, InterviewsWrite,
+ CompaniesRead, CompaniesWrite,
+ UsersRead, UsersWrite,
+ StatsRead, FullAccess,
+ };
+
+ public static bool IsValidScope(string scope) => AllScopes.Contains(scope);
+}
diff --git a/src/Domain/Enums/Role.cs b/src/Domain/Enums/Role.cs
index 2183c5f7..f3498b14 100644
--- a/src/Domain/Enums/Role.cs
+++ b/src/Domain/Enums/Role.cs
@@ -1,4 +1,4 @@
-namespace Domain.Enums;
+namespace Domain.Enums;
public enum Role : long
{
diff --git a/src/Domain/Extensions/ClaimHelper.cs b/src/Domain/Extensions/ClaimHelper.cs
index 29ad3b06..819af1f0 100644
--- a/src/Domain/Extensions/ClaimHelper.cs
+++ b/src/Domain/Extensions/ClaimHelper.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
diff --git a/src/Domain/Extensions/CollectionExtensions.cs b/src/Domain/Extensions/CollectionExtensions.cs
index e44b1c55..cdf73b0b 100644
--- a/src/Domain/Extensions/CollectionExtensions.cs
+++ b/src/Domain/Extensions/CollectionExtensions.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
diff --git a/src/Domain/Extensions/CompareHelpers.cs b/src/Domain/Extensions/CompareHelpers.cs
index f2b63672..a038962d 100644
--- a/src/Domain/Extensions/CompareHelpers.cs
+++ b/src/Domain/Extensions/CompareHelpers.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Extensions;
diff --git a/src/Domain/Extensions/EnumHelper.cs b/src/Domain/Extensions/EnumHelper.cs
index eed5e278..abc51082 100644
--- a/src/Domain/Extensions/EnumHelper.cs
+++ b/src/Domain/Extensions/EnumHelper.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
diff --git a/src/Domain/Extensions/ExpressionExtensions.cs b/src/Domain/Extensions/ExpressionExtensions.cs
index f8594644..58e8a312 100644
--- a/src/Domain/Extensions/ExpressionExtensions.cs
+++ b/src/Domain/Extensions/ExpressionExtensions.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
diff --git a/src/Domain/Totp/TotpCode.cs b/src/Domain/Totp/TotpCode.cs
index 507b478b..acd9c2f5 100644
--- a/src/Domain/Totp/TotpCode.cs
+++ b/src/Domain/Totp/TotpCode.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using OtpNet;
namespace Domain.Totp;
diff --git a/src/Domain/Totp/TotpSecretKey.cs b/src/Domain/Totp/TotpSecretKey.cs
index cdd15049..5faaeb19 100644
--- a/src/Domain/Totp/TotpSecretKey.cs
+++ b/src/Domain/Totp/TotpSecretKey.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using OtpNet;
namespace Domain.Totp;
diff --git a/src/Domain/Validation/EmailValidRegex.cs b/src/Domain/Validation/EmailValidRegex.cs
index 71710daf..53fb57fc 100644
--- a/src/Domain/Validation/EmailValidRegex.cs
+++ b/src/Domain/Validation/EmailValidRegex.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Globalization;
using System.Text.RegularExpressions;
diff --git a/src/Domain/Validation/EntityValidator.cs b/src/Domain/Validation/EntityValidator.cs
index 371ace21..d5ab4e78 100644
--- a/src/Domain/Validation/EntityValidator.cs
+++ b/src/Domain/Validation/EntityValidator.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
diff --git a/src/Domain/Validation/EntityValidatorExtensions.cs b/src/Domain/Validation/EntityValidatorExtensions.cs
index f4709d33..b1260954 100644
--- a/src/Domain/Validation/EntityValidatorExtensions.cs
+++ b/src/Domain/Validation/EntityValidatorExtensions.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Validation.Exceptions;
using Domain.ValueObjects.Dates;
using Domain.ValueObjects.Dates.Interfaces;
diff --git a/src/Domain/Validation/Exceptions/BadRequestException.cs b/src/Domain/Validation/Exceptions/BadRequestException.cs
index e1bf6bd2..dd7ba133 100644
--- a/src/Domain/Validation/Exceptions/BadRequestException.cs
+++ b/src/Domain/Validation/Exceptions/BadRequestException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Validation.Exceptions;
diff --git a/src/Domain/Validation/Exceptions/DatabaseException.cs b/src/Domain/Validation/Exceptions/DatabaseException.cs
index 4d345e1a..ddfeb416 100644
--- a/src/Domain/Validation/Exceptions/DatabaseException.cs
+++ b/src/Domain/Validation/Exceptions/DatabaseException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Validation.Exceptions;
diff --git a/src/Domain/Validation/Exceptions/DbUpdateConcurrencyException.cs b/src/Domain/Validation/Exceptions/DbUpdateConcurrencyException.cs
index b3168841..548d2e88 100644
--- a/src/Domain/Validation/Exceptions/DbUpdateConcurrencyException.cs
+++ b/src/Domain/Validation/Exceptions/DbUpdateConcurrencyException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Validation.Exceptions;
diff --git a/src/Domain/Validation/Exceptions/EntityInvalidException.cs b/src/Domain/Validation/Exceptions/EntityInvalidException.cs
index 3440af4b..5b1a507c 100644
--- a/src/Domain/Validation/Exceptions/EntityInvalidException.cs
+++ b/src/Domain/Validation/Exceptions/EntityInvalidException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Domain/Validation/Exceptions/InputValidationException.cs b/src/Domain/Validation/Exceptions/InputValidationException.cs
index 20329edc..65aaef72 100644
--- a/src/Domain/Validation/Exceptions/InputValidationException.cs
+++ b/src/Domain/Validation/Exceptions/InputValidationException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Validation.Exceptions;
diff --git a/src/Domain/Validation/Exceptions/InvalidDateRangeException.cs b/src/Domain/Validation/Exceptions/InvalidDateRangeException.cs
index 30048b8f..1d4c303f 100644
--- a/src/Domain/Validation/Exceptions/InvalidDateRangeException.cs
+++ b/src/Domain/Validation/Exceptions/InvalidDateRangeException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Validation.Exceptions
{
diff --git a/src/Domain/Validation/Exceptions/MismatchedIdentitiesException.cs b/src/Domain/Validation/Exceptions/MismatchedIdentitiesException.cs
index 093bc569..b675f1c8 100644
--- a/src/Domain/Validation/Exceptions/MismatchedIdentitiesException.cs
+++ b/src/Domain/Validation/Exceptions/MismatchedIdentitiesException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Entities.Users;
using Domain.ValueObjects;
diff --git a/src/Domain/Validation/Exceptions/NoPermissionsException.cs b/src/Domain/Validation/Exceptions/NoPermissionsException.cs
index d3423962..29673a53 100644
--- a/src/Domain/Validation/Exceptions/NoPermissionsException.cs
+++ b/src/Domain/Validation/Exceptions/NoPermissionsException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Validation.Exceptions;
diff --git a/src/Domain/Validation/Exceptions/NotFoundException.cs b/src/Domain/Validation/Exceptions/NotFoundException.cs
index ebf7ac61..27b95834 100644
--- a/src/Domain/Validation/Exceptions/NotFoundException.cs
+++ b/src/Domain/Validation/Exceptions/NotFoundException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Validation.Exceptions;
diff --git a/src/Domain/Validation/Exceptions/PasswordExpiredException.cs b/src/Domain/Validation/Exceptions/PasswordExpiredException.cs
index 289076d0..676bc7e1 100644
--- a/src/Domain/Validation/Exceptions/PasswordExpiredException.cs
+++ b/src/Domain/Validation/Exceptions/PasswordExpiredException.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.Validation.Exceptions;
diff --git a/src/Domain/Validation/Exceptions/UnauthorizedException.cs b/src/Domain/Validation/Exceptions/UnauthorizedException.cs
new file mode 100644
index 00000000..d77d32e4
--- /dev/null
+++ b/src/Domain/Validation/Exceptions/UnauthorizedException.cs
@@ -0,0 +1,16 @@
+using System;
+
+namespace Domain.Validation.Exceptions;
+
+public class UnauthorizedException : Exception
+{
+ public UnauthorizedException(string message)
+ : base(message)
+ {
+ }
+
+ public UnauthorizedException()
+ : this("Unauthorized")
+ {
+ }
+}
diff --git a/src/Domain/Validation/ValidateUtilities.cs b/src/Domain/Validation/ValidateUtilities.cs
index 9b70858d..aafc1db7 100644
--- a/src/Domain/Validation/ValidateUtilities.cs
+++ b/src/Domain/Validation/ValidateUtilities.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using Domain.Validation.Exceptions;
diff --git a/src/Domain/ValueObjects/CompanySlug.cs b/src/Domain/ValueObjects/CompanySlug.cs
index 49ffc7d7..c28759f7 100644
--- a/src/Domain/ValueObjects/CompanySlug.cs
+++ b/src/Domain/ValueObjects/CompanySlug.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.ValueObjects;
diff --git a/src/Domain/ValueObjects/CurrentUser.cs b/src/Domain/ValueObjects/CurrentUser.cs
index aabb44ba..adca85f5 100644
--- a/src/Domain/ValueObjects/CurrentUser.cs
+++ b/src/Domain/ValueObjects/CurrentUser.cs
@@ -1,5 +1,6 @@
-using System;
+using System;
using System.Collections.Generic;
+using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Claims;
using Domain.Enums;
@@ -11,8 +12,11 @@ namespace Domain.ValueObjects;
public record CurrentUser
{
public const string GoogleOAuth2Prefix = "google-oauth2|";
+ public const string GooglePrefix = "google|";
public const string GithubPrefix = "github|";
public const string Auth0Prefix = "auth0|";
+ public const string LocalPrefix = "local|";
+ public const string M2mPrefix = "m2m|";
// For test purposes
protected CurrentUser()
@@ -29,7 +33,8 @@ public CurrentUser(
throw new ArgumentException("Principal does not have any claim");
}
- UserId = principal.GetClaimValue(ClaimTypes.NameIdentifier);
+ UserId = principal.GetClaimValue(ClaimTypes.NameIdentifier, false)
+ ?? principal.GetClaimValue(JwtRegisteredClaimNames.Sub);
Email = principal.GetClaimValue(ClaimTypes.Email, false) ?? principal.GetClaimValue("email");
IsEmailVerified = principal.GetClaimValue("email_verified", false) == "true";
FirstName = principal.GetClaimValue(ClaimTypes.GivenName, false);
@@ -38,17 +43,20 @@ public CurrentUser(
if (LastName is null && FirstName is null)
{
- var fullname = principal.GetClaimValue(ClaimTypes.Name);
- var names = fullname.Split(' ');
- if (names.Length == 1)
+ var fullname = principal.GetClaimValue(ClaimTypes.Name, false);
+ if (fullname != null)
{
- FirstName = names[0];
- LastName = "-";
- }
- else
- {
- FirstName = names[0];
- LastName = names[1];
+ var names = fullname.Split(' ');
+ if (names.Length == 1)
+ {
+ FirstName = names[0];
+ LastName = "-";
+ }
+ else
+ {
+ FirstName = names[0];
+ LastName = names[1];
+ }
}
}
@@ -56,10 +64,15 @@ public CurrentUser(
.Where(x => x.Type == ClaimTypes.Role)
.Select(x => x.Value.ToEnum())
.ToArray();
+
+ Scopes = principal.Claims
+ .Where(x => x.Type == "scope")
+ .Select(x => x.Value)
+ .ToArray();
}
///
- /// Auth0 will store there smth like 'google-oauth2|12345' or 'github'.
+ /// User identity ID with provider prefix (e.g., 'google|12345', 'github|789', 'local|abc', 'm2m|clientid').
///
public string UserId { get; protected set; }
@@ -78,6 +91,11 @@ public CurrentUser(
public IReadOnlyCollection Roles { get; protected set; }
+ ///
+ /// M2M client scopes (for machine-to-machine authentication).
+ ///
+ public IReadOnlyCollection Scopes { get; protected set; } = Array.Empty();
+
public bool Has(Role role)
{
return Roles.Contains(role);
@@ -99,12 +117,12 @@ public bool HasAny(IReadOnlyCollection roles)
public string Fullname => $"{FirstName} {LastName}";
- public string EmailUpper => Email.ToUpperInvariant();
+ public string EmailUpper => Email?.ToUpperInvariant();
public bool IsGoogleAuth()
{
return UserId != null &&
- UserId.StartsWith(GoogleOAuth2Prefix);
+ (UserId.StartsWith(GoogleOAuth2Prefix) || UserId.StartsWith(GooglePrefix));
}
public bool IsGithubAuth()
@@ -118,4 +136,29 @@ public bool IsAuth0Auth()
return UserId != null &&
UserId.StartsWith(Auth0Prefix);
}
+
+ public bool IsLocalAuth()
+ {
+ return UserId != null &&
+ UserId.StartsWith(LocalPrefix);
+ }
+
+ public bool IsM2mClient()
+ {
+ return UserId != null &&
+ UserId.StartsWith(M2mPrefix);
+ }
+
+ ///
+ /// Gets the M2M client ID without the prefix.
+ ///
+ public string M2mClientId => IsM2mClient() ? UserId[M2mPrefix.Length..] : null;
+
+ ///
+ /// Checks if the current user (M2M client) has the specified scope.
+ ///
+ public bool HasScope(string scope)
+ {
+ return Scopes.Contains("*") || Scopes.Contains(scope);
+ }
}
\ No newline at end of file
diff --git a/src/Domain/ValueObjects/DateTimeRangeSplitter.cs b/src/Domain/ValueObjects/DateTimeRangeSplitter.cs
index cd90e01e..c1d72d71 100644
--- a/src/Domain/ValueObjects/DateTimeRangeSplitter.cs
+++ b/src/Domain/ValueObjects/DateTimeRangeSplitter.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/src/Domain/ValueObjects/DateTimeRoundedRangeSplitter.cs b/src/Domain/ValueObjects/DateTimeRoundedRangeSplitter.cs
index d82e4082..b5a2a341 100644
--- a/src/Domain/ValueObjects/DateTimeRoundedRangeSplitter.cs
+++ b/src/Domain/ValueObjects/DateTimeRoundedRangeSplitter.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.ValueObjects;
diff --git a/src/Domain/ValueObjects/Dates/Date.cs b/src/Domain/ValueObjects/Dates/Date.cs
index fa6e5fd1..37eacc06 100644
--- a/src/Domain/ValueObjects/Dates/Date.cs
+++ b/src/Domain/ValueObjects/Dates/Date.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Globalization;
using Domain.Validation;
diff --git a/src/Domain/ValueObjects/Dates/DateCompareHelpers.cs b/src/Domain/ValueObjects/Dates/DateCompareHelpers.cs
index f9222e7d..dc6ac97d 100644
--- a/src/Domain/ValueObjects/Dates/DateCompareHelpers.cs
+++ b/src/Domain/ValueObjects/Dates/DateCompareHelpers.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Validation;
namespace Domain.ValueObjects.Dates
diff --git a/src/Domain/ValueObjects/Dates/DateQuarter.cs b/src/Domain/ValueObjects/Dates/DateQuarter.cs
index 4927fcf3..62dc41ca 100644
--- a/src/Domain/ValueObjects/Dates/DateQuarter.cs
+++ b/src/Domain/ValueObjects/Dates/DateQuarter.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.ValueObjects.Dates;
diff --git a/src/Domain/ValueObjects/Dates/DayRange.cs b/src/Domain/ValueObjects/Dates/DayRange.cs
index cbdcf88e..21fcee9f 100644
--- a/src/Domain/ValueObjects/Dates/DayRange.cs
+++ b/src/Domain/ValueObjects/Dates/DayRange.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Validation;
namespace Domain.ValueObjects.Dates
diff --git a/src/Domain/ValueObjects/Dates/HasFromToDatesExtensions.cs b/src/Domain/ValueObjects/Dates/HasFromToDatesExtensions.cs
index 031f77a0..f44a275b 100644
--- a/src/Domain/ValueObjects/Dates/HasFromToDatesExtensions.cs
+++ b/src/Domain/ValueObjects/Dates/HasFromToDatesExtensions.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Domain.Validation.Exceptions;
using Domain.ValueObjects.Dates.Interfaces;
diff --git a/src/Domain/ValueObjects/Dates/Interfaces/IHasDates.cs b/src/Domain/ValueObjects/Dates/Interfaces/IHasDates.cs
index 89e351a6..eaa78c0d 100644
--- a/src/Domain/ValueObjects/Dates/Interfaces/IHasDates.cs
+++ b/src/Domain/ValueObjects/Dates/Interfaces/IHasDates.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.ValueObjects.Dates.Interfaces
{
diff --git a/src/Domain/ValueObjects/Dates/Interfaces/IHasFromToDates.cs b/src/Domain/ValueObjects/Dates/Interfaces/IHasFromToDates.cs
index c2970d77..45a7c3e9 100644
--- a/src/Domain/ValueObjects/Dates/Interfaces/IHasFromToDates.cs
+++ b/src/Domain/ValueObjects/Dates/Interfaces/IHasFromToDates.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.ValueObjects.Dates.Interfaces
{
diff --git a/src/Domain/ValueObjects/Dates/Interfaces/IHasTimeRange.cs b/src/Domain/ValueObjects/Dates/Interfaces/IHasTimeRange.cs
index d8111d48..0a2de6e0 100644
--- a/src/Domain/ValueObjects/Dates/Interfaces/IHasTimeRange.cs
+++ b/src/Domain/ValueObjects/Dates/Interfaces/IHasTimeRange.cs
@@ -1,4 +1,4 @@
-namespace Domain.ValueObjects.Dates.Interfaces
+namespace Domain.ValueObjects.Dates.Interfaces
{
public interface IHasTimeRange : IHasFromToDates
{
diff --git a/src/Domain/ValueObjects/Dates/Month.cs b/src/Domain/ValueObjects/Dates/Month.cs
index ed655bb6..1b5ed4f8 100644
--- a/src/Domain/ValueObjects/Dates/Month.cs
+++ b/src/Domain/ValueObjects/Dates/Month.cs
@@ -1,4 +1,4 @@
-namespace Domain.ValueObjects.Dates
+namespace Domain.ValueObjects.Dates
{
public enum Month
{
diff --git a/src/Domain/ValueObjects/Dates/MonthRange.cs b/src/Domain/ValueObjects/Dates/MonthRange.cs
index 3c51ff88..775c7b0f 100644
--- a/src/Domain/ValueObjects/Dates/MonthRange.cs
+++ b/src/Domain/ValueObjects/Dates/MonthRange.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using Domain.Validation;
diff --git a/src/Domain/ValueObjects/Dates/TimeRange.cs b/src/Domain/ValueObjects/Dates/TimeRange.cs
index f538ff9c..2a7c5cba 100644
--- a/src/Domain/ValueObjects/Dates/TimeRange.cs
+++ b/src/Domain/ValueObjects/Dates/TimeRange.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using Domain.Validation;
diff --git a/src/Domain/ValueObjects/HexColor.cs b/src/Domain/ValueObjects/HexColor.cs
index 62df9d97..c8235aa5 100644
--- a/src/Domain/ValueObjects/HexColor.cs
+++ b/src/Domain/ValueObjects/HexColor.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.ValueObjects;
diff --git a/src/Domain/ValueObjects/ISalariesChartQueryParams.cs b/src/Domain/ValueObjects/ISalariesChartQueryParams.cs
index d62a981f..64dfb76c 100644
--- a/src/Domain/ValueObjects/ISalariesChartQueryParams.cs
+++ b/src/Domain/ValueObjects/ISalariesChartQueryParams.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using Domain.Entities.Enums;
using Domain.Entities.Salaries;
diff --git a/src/Domain/ValueObjects/IntArrayParameter.cs b/src/Domain/ValueObjects/IntArrayParameter.cs
index 4709171a..abb60498 100644
--- a/src/Domain/ValueObjects/IntArrayParameter.cs
+++ b/src/Domain/ValueObjects/IntArrayParameter.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Domain/ValueObjects/KebabCaseSlug.cs b/src/Domain/ValueObjects/KebabCaseSlug.cs
index 5fe68467..02fcde5f 100644
--- a/src/Domain/ValueObjects/KebabCaseSlug.cs
+++ b/src/Domain/ValueObjects/KebabCaseSlug.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Text.RegularExpressions;
namespace Domain.ValueObjects;
diff --git a/src/Domain/ValueObjects/OAuth/OAuthTokenResponse.cs b/src/Domain/ValueObjects/OAuth/OAuthTokenResponse.cs
new file mode 100644
index 00000000..c22fe76d
--- /dev/null
+++ b/src/Domain/ValueObjects/OAuth/OAuthTokenResponse.cs
@@ -0,0 +1,21 @@
+using System.Text.Json.Serialization;
+
+namespace Domain.ValueObjects.OAuth;
+
+public record OAuthTokenResponse
+{
+ [JsonPropertyName("access_token")]
+ public string AccessToken { get; init; }
+
+ [JsonPropertyName("token_type")]
+ public string TokenType { get; init; }
+
+ [JsonPropertyName("expires_in")]
+ public int ExpiresIn { get; init; }
+
+ [JsonPropertyName("refresh_token")]
+ public string RefreshToken { get; init; }
+
+ [JsonPropertyName("scope")]
+ public string Scope { get; init; }
+}
diff --git a/src/Domain/ValueObjects/OAuth/OAuthUserInfo.cs b/src/Domain/ValueObjects/OAuth/OAuthUserInfo.cs
new file mode 100644
index 00000000..40a22a94
--- /dev/null
+++ b/src/Domain/ValueObjects/OAuth/OAuthUserInfo.cs
@@ -0,0 +1,18 @@
+namespace Domain.ValueObjects.OAuth;
+
+public record OAuthUserInfo
+{
+ public string Id { get; init; }
+
+ public string Email { get; init; }
+
+ public bool EmailVerified { get; init; }
+
+ public string GivenName { get; init; }
+
+ public string FamilyName { get; init; }
+
+ public string Name { get; init; }
+
+ public string Picture { get; init; }
+}
diff --git a/src/Domain/ValueObjects/Pagination/PageModel.cs b/src/Domain/ValueObjects/Pagination/PageModel.cs
index 475e6eb3..52b86686 100644
--- a/src/Domain/ValueObjects/Pagination/PageModel.cs
+++ b/src/Domain/ValueObjects/Pagination/PageModel.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
namespace Domain.ValueObjects.Pagination;
diff --git a/src/Domain/ValueObjects/Pagination/Pageable.cs b/src/Domain/ValueObjects/Pagination/Pageable.cs
index 2ef1037b..158941e8 100644
--- a/src/Domain/ValueObjects/Pagination/Pageable.cs
+++ b/src/Domain/ValueObjects/Pagination/Pageable.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
namespace Domain.ValueObjects.Pagination;
diff --git a/src/Domain/ValueObjects/Pagination/PaginatedListBase.cs b/src/Domain/ValueObjects/Pagination/PaginatedListBase.cs
index edb08cf9..33d257c7 100644
--- a/src/Domain/ValueObjects/Pagination/PaginatedListBase.cs
+++ b/src/Domain/ValueObjects/Pagination/PaginatedListBase.cs
@@ -1,4 +1,4 @@
-namespace Domain.ValueObjects.Pagination;
+namespace Domain.ValueObjects.Pagination;
public abstract record PaginatedListBase
{
diff --git a/src/Domain/ValueObjects/PercentileCollection.cs b/src/Domain/ValueObjects/PercentileCollection.cs
index facfd7a8..4b4250da 100644
--- a/src/Domain/ValueObjects/PercentileCollection.cs
+++ b/src/Domain/ValueObjects/PercentileCollection.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Domain/ValueObjects/Ranges/CustomRange.cs b/src/Domain/ValueObjects/Ranges/CustomRange.cs
index 261d6bb1..653916aa 100644
--- a/src/Domain/ValueObjects/Ranges/CustomRange.cs
+++ b/src/Domain/ValueObjects/Ranges/CustomRange.cs
@@ -1,4 +1,4 @@
-namespace Domain.ValueObjects.Ranges;
+namespace Domain.ValueObjects.Ranges;
public record CustomRange
where T : struct
diff --git a/src/Domain/ValueObjects/Ranges/DoublesRange.cs b/src/Domain/ValueObjects/Ranges/DoublesRange.cs
index ffa22e02..3d359755 100644
--- a/src/Domain/ValueObjects/Ranges/DoublesRange.cs
+++ b/src/Domain/ValueObjects/Ranges/DoublesRange.cs
@@ -1,4 +1,4 @@
-namespace Domain.ValueObjects.Ranges;
+namespace Domain.ValueObjects.Ranges;
public record DoublesRange : CustomRange
{
diff --git a/src/Domain/ValueObjects/Ranges/IntRange.cs b/src/Domain/ValueObjects/Ranges/IntRange.cs
index 00ca1fe5..fc54eecf 100644
--- a/src/Domain/ValueObjects/Ranges/IntRange.cs
+++ b/src/Domain/ValueObjects/Ranges/IntRange.cs
@@ -1,4 +1,4 @@
-namespace Domain.ValueObjects.Ranges;
+namespace Domain.ValueObjects.Ranges;
public record IntRange : CustomRange
{
diff --git a/src/Domain/ValueObjects/RoundedValuesByRangesSplitter.cs b/src/Domain/ValueObjects/RoundedValuesByRangesSplitter.cs
index 6701809f..3c5313f3 100644
--- a/src/Domain/ValueObjects/RoundedValuesByRangesSplitter.cs
+++ b/src/Domain/ValueObjects/RoundedValuesByRangesSplitter.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
namespace Domain.ValueObjects;
diff --git a/src/Domain/ValueObjects/SalariesChartQueryParamsBase.cs b/src/Domain/ValueObjects/SalariesChartQueryParamsBase.cs
index 239a54bb..bf3bcc0b 100644
--- a/src/Domain/ValueObjects/SalariesChartQueryParamsBase.cs
+++ b/src/Domain/ValueObjects/SalariesChartQueryParamsBase.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using Domain.Entities.Enums;
using Domain.Entities.Salaries;
diff --git a/src/Domain/ValueObjects/SalaryGradeRanges.cs b/src/Domain/ValueObjects/SalaryGradeRanges.cs
index 8343cc02..ef16ebdb 100644
--- a/src/Domain/ValueObjects/SalaryGradeRanges.cs
+++ b/src/Domain/ValueObjects/SalaryGradeRanges.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using Domain.Entities.Enums;
diff --git a/src/Domain/ValueObjects/SalaryShortFormattedValue.cs b/src/Domain/ValueObjects/SalaryShortFormattedValue.cs
index cf9ae4c0..3e6bcdd5 100644
--- a/src/Domain/ValueObjects/SalaryShortFormattedValue.cs
+++ b/src/Domain/ValueObjects/SalaryShortFormattedValue.cs
@@ -1,4 +1,4 @@
-using System.Globalization;
+using System.Globalization;
namespace Domain.ValueObjects;
diff --git a/src/Domain/ValueObjects/SalarySpaceFormattedValue.cs b/src/Domain/ValueObjects/SalarySpaceFormattedValue.cs
index f0aaae4a..29dc9f3d 100644
--- a/src/Domain/ValueObjects/SalarySpaceFormattedValue.cs
+++ b/src/Domain/ValueObjects/SalarySpaceFormattedValue.cs
@@ -1,4 +1,4 @@
-using System.Globalization;
+using System.Globalization;
namespace Domain.ValueObjects;
diff --git a/src/Domain/ValueObjects/ValuesByRangesSplitter.cs b/src/Domain/ValueObjects/ValuesByRangesSplitter.cs
index 124b8233..b7e7c77f 100644
--- a/src/Domain/ValueObjects/ValuesByRangesSplitter.cs
+++ b/src/Domain/ValueObjects/ValuesByRangesSplitter.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections;
using System.Collections.Generic;
using Domain.ValueObjects.Ranges;
diff --git a/src/Infrastructure/Ai/AiChatResult.cs b/src/Infrastructure/Ai/AiChatResult.cs
index c7b9b743..c184b9c1 100644
--- a/src/Infrastructure/Ai/AiChatResult.cs
+++ b/src/Infrastructure/Ai/AiChatResult.cs
@@ -1,4 +1,4 @@
-namespace Infrastructure.Ai;
+namespace Infrastructure.Ai;
public record AiChatResult
{
diff --git a/src/Infrastructure/Ai/AiChoice.cs b/src/Infrastructure/Ai/AiChoice.cs
index fa0480ae..0aaeea88 100644
--- a/src/Infrastructure/Ai/AiChoice.cs
+++ b/src/Infrastructure/Ai/AiChoice.cs
@@ -1,4 +1,4 @@
-using Infrastructure.Ai.ChatGpt;
+using Infrastructure.Ai.ChatGpt;
using Infrastructure.Ai.Claude;
namespace Infrastructure.Ai;
diff --git a/src/Infrastructure/Ai/AiProviderFactory.cs b/src/Infrastructure/Ai/AiProviderFactory.cs
index 917d4d9a..8691d305 100644
--- a/src/Infrastructure/Ai/AiProviderFactory.cs
+++ b/src/Infrastructure/Ai/AiProviderFactory.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Prompts;
+using Domain.Entities.Prompts;
using Infrastructure.Ai.ChatGpt;
using Infrastructure.Ai.Claude;
using Microsoft.Extensions.DependencyInjection;
diff --git a/src/Infrastructure/Ai/ChatGpt/ChatGptChoice.cs b/src/Infrastructure/Ai/ChatGpt/ChatGptChoice.cs
index c628a646..c0d034cc 100644
--- a/src/Infrastructure/Ai/ChatGpt/ChatGptChoice.cs
+++ b/src/Infrastructure/Ai/ChatGpt/ChatGptChoice.cs
@@ -1,4 +1,4 @@
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;
namespace Infrastructure.Ai.ChatGpt;
diff --git a/src/Infrastructure/Ai/ChatGpt/ChatGptMessage.cs b/src/Infrastructure/Ai/ChatGpt/ChatGptMessage.cs
index 4eb09ebd..f231659b 100644
--- a/src/Infrastructure/Ai/ChatGpt/ChatGptMessage.cs
+++ b/src/Infrastructure/Ai/ChatGpt/ChatGptMessage.cs
@@ -1,4 +1,4 @@
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;
namespace Infrastructure.Ai.ChatGpt;
diff --git a/src/Infrastructure/Ai/ChatGpt/ChatGptProvider.cs b/src/Infrastructure/Ai/ChatGpt/ChatGptProvider.cs
index 6bb49b1c..337cd2b2 100644
--- a/src/Infrastructure/Ai/ChatGpt/ChatGptProvider.cs
+++ b/src/Infrastructure/Ai/ChatGpt/ChatGptProvider.cs
@@ -1,4 +1,4 @@
-using System.Net.Http.Headers;
+using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using Microsoft.Extensions.Configuration;
diff --git a/src/Infrastructure/Ai/ChatGpt/ChatGptRequest.cs b/src/Infrastructure/Ai/ChatGpt/ChatGptRequest.cs
index 48397105..1152eeb2 100644
--- a/src/Infrastructure/Ai/ChatGpt/ChatGptRequest.cs
+++ b/src/Infrastructure/Ai/ChatGpt/ChatGptRequest.cs
@@ -1,4 +1,4 @@
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;
namespace Infrastructure.Ai.ChatGpt;
diff --git a/src/Infrastructure/Ai/ChatGpt/ChatGptResponse.cs b/src/Infrastructure/Ai/ChatGpt/ChatGptResponse.cs
index b873b9d7..f309de63 100644
--- a/src/Infrastructure/Ai/ChatGpt/ChatGptResponse.cs
+++ b/src/Infrastructure/Ai/ChatGpt/ChatGptResponse.cs
@@ -1,4 +1,4 @@
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;
namespace Infrastructure.Ai.ChatGpt;
diff --git a/src/Infrastructure/Ai/Claude/ClaudeAiProvider.cs b/src/Infrastructure/Ai/Claude/ClaudeAiProvider.cs
index 1a9b388b..4ce318b2 100644
--- a/src/Infrastructure/Ai/Claude/ClaudeAiProvider.cs
+++ b/src/Infrastructure/Ai/Claude/ClaudeAiProvider.cs
@@ -1,4 +1,4 @@
-using System.Text;
+using System.Text;
using System.Text.Json;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
diff --git a/src/Infrastructure/Ai/Claude/ClaudeChatContentItem.cs b/src/Infrastructure/Ai/Claude/ClaudeChatContentItem.cs
index 868b9dcb..61c987f7 100644
--- a/src/Infrastructure/Ai/Claude/ClaudeChatContentItem.cs
+++ b/src/Infrastructure/Ai/Claude/ClaudeChatContentItem.cs
@@ -1,4 +1,4 @@
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;
namespace Infrastructure.Ai.Claude;
diff --git a/src/Infrastructure/Ai/Claude/ClaudeChatMessage.cs b/src/Infrastructure/Ai/Claude/ClaudeChatMessage.cs
index 35065655..baa746f8 100644
--- a/src/Infrastructure/Ai/Claude/ClaudeChatMessage.cs
+++ b/src/Infrastructure/Ai/Claude/ClaudeChatMessage.cs
@@ -1,4 +1,4 @@
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;
namespace Infrastructure.Ai.Claude;
diff --git a/src/Infrastructure/Ai/Claude/ClaudeChatResponse.cs b/src/Infrastructure/Ai/Claude/ClaudeChatResponse.cs
index 5bf214b5..9f9b4862 100644
--- a/src/Infrastructure/Ai/Claude/ClaudeChatResponse.cs
+++ b/src/Infrastructure/Ai/Claude/ClaudeChatResponse.cs
@@ -1,4 +1,4 @@
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;
namespace Infrastructure.Ai.Claude;
diff --git a/src/Infrastructure/Ai/Claude/ClaudeRequest.cs b/src/Infrastructure/Ai/Claude/ClaudeRequest.cs
index 3b4b00fe..406584c6 100644
--- a/src/Infrastructure/Ai/Claude/ClaudeRequest.cs
+++ b/src/Infrastructure/Ai/Claude/ClaudeRequest.cs
@@ -1,4 +1,4 @@
-using System.Text.Json.Serialization;
+using System.Text.Json.Serialization;
namespace Infrastructure.Ai.Claude;
diff --git a/src/Infrastructure/Ai/IAiProvider.cs b/src/Infrastructure/Ai/IAiProvider.cs
index 3b4c2878..1fcc8474 100644
--- a/src/Infrastructure/Ai/IAiProvider.cs
+++ b/src/Infrastructure/Ai/IAiProvider.cs
@@ -1,4 +1,4 @@
-namespace Infrastructure.Ai;
+namespace Infrastructure.Ai;
public interface IAiProvider
{
diff --git a/src/Infrastructure/Ai/IAiProviderFactory.cs b/src/Infrastructure/Ai/IAiProviderFactory.cs
index 33732de9..ff7c9ed7 100644
--- a/src/Infrastructure/Ai/IAiProviderFactory.cs
+++ b/src/Infrastructure/Ai/IAiProviderFactory.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Prompts;
+using Domain.Entities.Prompts;
namespace Infrastructure.Ai;
diff --git a/src/Infrastructure/Authentication/AuthorizationService.cs b/src/Infrastructure/Authentication/AuthorizationService.cs
index ef7456d6..1fe26993 100644
--- a/src/Infrastructure/Authentication/AuthorizationService.cs
+++ b/src/Infrastructure/Authentication/AuthorizationService.cs
@@ -1,4 +1,4 @@
-using System.Security.Authentication;
+using System.Security.Authentication;
using Domain.Entities.Users;
using Domain.Enums;
using Domain.ValueObjects;
diff --git a/src/Infrastructure/Authentication/Contracts/IAuthorization.cs b/src/Infrastructure/Authentication/Contracts/IAuthorization.cs
index 024848be..6235ead5 100644
--- a/src/Infrastructure/Authentication/Contracts/IAuthorization.cs
+++ b/src/Infrastructure/Authentication/Contracts/IAuthorization.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Users;
+using Domain.Entities.Users;
using Domain.Enums;
using Domain.ValueObjects;
diff --git a/src/Infrastructure/Authentication/Contracts/IHttpContext.cs b/src/Infrastructure/Authentication/Contracts/IHttpContext.cs
index cd554b46..38eefb2a 100644
--- a/src/Infrastructure/Authentication/Contracts/IHttpContext.cs
+++ b/src/Infrastructure/Authentication/Contracts/IHttpContext.cs
@@ -1,4 +1,4 @@
-using Domain.ValueObjects;
+using Domain.ValueObjects;
namespace Infrastructure.Authentication.Contracts;
diff --git a/src/Infrastructure/Authentication/Contracts/IPasswordHasher.cs b/src/Infrastructure/Authentication/Contracts/IPasswordHasher.cs
new file mode 100644
index 00000000..c040c1e0
--- /dev/null
+++ b/src/Infrastructure/Authentication/Contracts/IPasswordHasher.cs
@@ -0,0 +1,8 @@
+namespace Infrastructure.Authentication.Contracts;
+
+public interface IPasswordHasher
+{
+ string Hash(string password);
+
+ bool Verify(string password, string hash);
+}
diff --git a/src/Infrastructure/Authentication/M2mClientService.cs b/src/Infrastructure/Authentication/M2mClientService.cs
new file mode 100644
index 00000000..ab3b5736
--- /dev/null
+++ b/src/Infrastructure/Authentication/M2mClientService.cs
@@ -0,0 +1,222 @@
+using System.Security.Cryptography;
+using Domain.Entities.Auth;
+using Domain.Enums;
+using Infrastructure.Authentication.Contracts;
+using Infrastructure.Database;
+using Microsoft.EntityFrameworkCore;
+
+namespace Infrastructure.Authentication;
+
+public interface IM2mClientService
+{
+ Task ValidateClientCredentialsAsync(string clientId, string clientSecret);
+
+ Task<(M2mClient Client, string PlainSecret)> CreateClientAsync(
+ string name,
+ string description,
+ string[] scopes,
+ long createdByUserId);
+
+ Task RegenerateSecretAsync(long clientId);
+
+ Task GetByClientIdAsync(string clientId);
+
+ Task GetByIdAsync(long id);
+
+ Task> GetAllAsync();
+
+ Task RecordUsageAsync(string clientId, string ipAddress);
+
+ Task UpdateScopesAsync(long clientId, string[] scopes);
+
+ Task DeactivateAsync(long clientId);
+
+ Task ActivateAsync(long clientId);
+
+ Task DeleteAsync(long clientId);
+}
+
+public class M2mClientService : IM2mClientService
+{
+ private readonly DatabaseContext _context;
+ private readonly IPasswordHasher _passwordHasher;
+
+ public M2mClientService(
+ DatabaseContext context,
+ IPasswordHasher passwordHasher)
+ {
+ _context = context;
+ _passwordHasher = passwordHasher;
+ }
+
+ public async Task ValidateClientCredentialsAsync(string clientId, string clientSecret)
+ {
+ var client = await _context.Set()
+ .Include(c => c.Scopes)
+ .FirstOrDefaultAsync(c => c.ClientId == clientId && c.IsActive && c.DeletedAt == null);
+
+ if (client == null)
+ {
+ return null;
+ }
+
+ if (!_passwordHasher.Verify(clientSecret, client.ClientSecretHash))
+ {
+ return null;
+ }
+
+ return client;
+ }
+
+ public async Task<(M2mClient Client, string PlainSecret)> CreateClientAsync(
+ string name,
+ string description,
+ string[] scopes,
+ long createdByUserId)
+ {
+ var client = new M2mClient(name, description, createdByUserId);
+
+ var plainSecret = GenerateSecureSecret();
+ client.SetClientSecret(_passwordHasher.Hash(plainSecret));
+
+ _context.Set().Add(client);
+ await _context.TrySaveChangesAsync();
+
+ foreach (var scope in scopes.Where(M2mScope.IsValidScope))
+ {
+ var clientScope = new M2mClientScope(client.Id, scope);
+ _context.Set().Add(clientScope);
+ }
+
+ await _context.TrySaveChangesAsync();
+
+ return (client, plainSecret);
+ }
+
+ public async Task RegenerateSecretAsync(long clientId)
+ {
+ var client = await _context.Set()
+ .FirstOrDefaultAsync(c => c.Id == clientId && c.DeletedAt == null);
+
+ if (client == null)
+ {
+ throw new InvalidOperationException($"M2M client with ID {clientId} not found");
+ }
+
+ var plainSecret = GenerateSecureSecret();
+ client.SetClientSecret(_passwordHasher.Hash(plainSecret));
+ await _context.TrySaveChangesAsync();
+
+ return plainSecret;
+ }
+
+ public async Task GetByClientIdAsync(string clientId)
+ {
+ return await _context.Set()
+ .Include(c => c.Scopes)
+ .Include(c => c.CreatedByUser)
+ .FirstOrDefaultAsync(c => c.ClientId == clientId && c.DeletedAt == null);
+ }
+
+ public async Task GetByIdAsync(long id)
+ {
+ return await _context.Set()
+ .Include(c => c.Scopes)
+ .Include(c => c.CreatedByUser)
+ .FirstOrDefaultAsync(c => c.Id == id && c.DeletedAt == null);
+ }
+
+ public async Task> GetAllAsync()
+ {
+ return await _context.Set()
+ .Include(c => c.Scopes)
+ .Include(c => c.CreatedByUser)
+ .Where(c => c.DeletedAt == null)
+ .OrderByDescending(c => c.CreatedAt)
+ .ToListAsync();
+ }
+
+ public async Task RecordUsageAsync(string clientId, string ipAddress)
+ {
+ var client = await _context.Set()
+ .FirstOrDefaultAsync(c => c.ClientId == clientId);
+
+ if (client != null)
+ {
+ client.RecordUsage(ipAddress);
+ await _context.TrySaveChangesAsync();
+ }
+ }
+
+ public async Task UpdateScopesAsync(long clientId, string[] scopes)
+ {
+ var client = await _context.Set()
+ .Include(c => c.Scopes)
+ .FirstOrDefaultAsync(c => c.Id == clientId && c.DeletedAt == null);
+
+ if (client == null)
+ {
+ throw new InvalidOperationException($"M2M client with ID {clientId} not found");
+ }
+
+ var existingScopes = client.Scopes.ToList();
+ _context.Set().RemoveRange(existingScopes);
+
+ foreach (var scope in scopes.Where(M2mScope.IsValidScope))
+ {
+ _context.Set().Add(new M2mClientScope(clientId, scope));
+ }
+
+ await _context.TrySaveChangesAsync();
+ }
+
+ public async Task DeactivateAsync(long clientId)
+ {
+ var client = await _context.Set()
+ .FirstOrDefaultAsync(c => c.Id == clientId && c.DeletedAt == null);
+
+ if (client == null)
+ {
+ throw new InvalidOperationException($"M2M client with ID {clientId} not found");
+ }
+
+ client.Deactivate();
+ await _context.TrySaveChangesAsync();
+ }
+
+ public async Task ActivateAsync(long clientId)
+ {
+ var client = await _context.Set()
+ .FirstOrDefaultAsync(c => c.Id == clientId && c.DeletedAt == null);
+
+ if (client == null)
+ {
+ throw new InvalidOperationException($"M2M client with ID {clientId} not found");
+ }
+
+ client.Activate();
+ await _context.TrySaveChangesAsync();
+ }
+
+ public async Task DeleteAsync(long clientId)
+ {
+ var client = await _context.Set()
+ .FirstOrDefaultAsync(c => c.Id == clientId && c.DeletedAt == null);
+
+ if (client == null)
+ {
+ throw new InvalidOperationException($"M2M client with ID {clientId} not found");
+ }
+
+ client.Delete();
+ await _context.TrySaveChangesAsync();
+ }
+
+ private static string GenerateSecureSecret()
+ {
+ var bytes = new byte[32];
+ using var rng = RandomNumberGenerator.Create();
+ rng.GetBytes(bytes);
+ return $"sk_live_{Convert.ToBase64String(bytes).Replace("+", string.Empty).Replace("/", string.Empty).Replace("=", string.Empty)}";
+ }
+}
diff --git a/src/Infrastructure/Authentication/OAuth/GitHubOAuthProvider.cs b/src/Infrastructure/Authentication/OAuth/GitHubOAuthProvider.cs
new file mode 100644
index 00000000..680a1cfd
--- /dev/null
+++ b/src/Infrastructure/Authentication/OAuth/GitHubOAuthProvider.cs
@@ -0,0 +1,143 @@
+using System.Net.Http.Headers;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Domain.ValueObjects.OAuth;
+using Microsoft.Extensions.Configuration;
+
+namespace Infrastructure.Authentication.OAuth;
+
+public class GitHubOAuthProvider : IOAuthProvider
+{
+ private const string AuthorizationEndpoint = "https://github.com/login/oauth/authorize";
+ private const string TokenEndpoint = "https://github.com/login/oauth/access_token";
+ private const string UserInfoEndpoint = "https://api.github.com/user";
+ private const string UserEmailsEndpoint = "https://api.github.com/user/emails";
+
+ private readonly IConfiguration _configuration;
+ private readonly IHttpClientFactory _httpClientFactory;
+
+ public GitHubOAuthProvider(
+ IConfiguration configuration,
+ IHttpClientFactory httpClientFactory)
+ {
+ _configuration = configuration;
+ _httpClientFactory = httpClientFactory;
+ }
+
+ public string GetAuthorizationUrl(string state, string redirectUri = null)
+ {
+ var clientId = _configuration["OAuth:GitHub:ClientId"];
+ redirectUri ??= _configuration["OAuth:GitHub:RedirectUri"];
+
+ return $"{AuthorizationEndpoint}" +
+ $"?client_id={Uri.EscapeDataString(clientId)}" +
+ $"&redirect_uri={Uri.EscapeDataString(redirectUri)}" +
+ "&scope=read:user%20user:email" +
+ $"&state={Uri.EscapeDataString(state)}";
+ }
+
+ public async Task ExchangeCodeAsync(string code, string redirectUri = null)
+ {
+ var clientId = _configuration["OAuth:GitHub:ClientId"];
+ var clientSecret = _configuration["OAuth:GitHub:ClientSecret"];
+ redirectUri ??= _configuration["OAuth:GitHub:RedirectUri"];
+
+ using var client = _httpClientFactory.CreateClient();
+ client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
+
+ var content = new FormUrlEncodedContent(new Dictionary
+ {
+ ["code"] = code,
+ ["client_id"] = clientId,
+ ["client_secret"] = clientSecret,
+ ["redirect_uri"] = redirectUri,
+ });
+
+ var response = await client.PostAsync(TokenEndpoint, content);
+ response.EnsureSuccessStatusCode();
+
+ var json = await response.Content.ReadAsStringAsync();
+ return JsonSerializer.Deserialize(json);
+ }
+
+ public async Task GetUserInfoAsync(string accessToken)
+ {
+ using var client = _httpClientFactory.CreateClient();
+ client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+ client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("TechInterview", "1.0"));
+
+ var userResponse = await client.GetAsync(UserInfoEndpoint);
+ userResponse.EnsureSuccessStatusCode();
+
+ var userJson = await userResponse.Content.ReadAsStringAsync();
+ var githubUser = JsonSerializer.Deserialize(userJson);
+
+ string primaryEmail = githubUser.Email;
+ if (string.IsNullOrEmpty(primaryEmail))
+ {
+ primaryEmail = await GetPrimaryEmailAsync(client);
+ }
+
+ var nameParts = (githubUser.Name ?? githubUser.Login ?? string.Empty).Split(' ', 2);
+
+ return new OAuthUserInfo
+ {
+ Id = githubUser.Id.ToString(),
+ Email = primaryEmail,
+ EmailVerified = !string.IsNullOrEmpty(primaryEmail),
+ GivenName = nameParts.Length > 0 ? nameParts[0] : githubUser.Login,
+ FamilyName = nameParts.Length > 1 ? nameParts[1] : "-",
+ Name = githubUser.Name ?? githubUser.Login,
+ Picture = githubUser.AvatarUrl,
+ };
+ }
+
+ private async Task GetPrimaryEmailAsync(HttpClient client)
+ {
+ try
+ {
+ var response = await client.GetAsync(UserEmailsEndpoint);
+ response.EnsureSuccessStatusCode();
+
+ var json = await response.Content.ReadAsStringAsync();
+ var emails = JsonSerializer.Deserialize>(json);
+
+ var primaryEmail = emails?.FirstOrDefault(e => e.Primary && e.Verified);
+ return primaryEmail?.Email ?? emails?.FirstOrDefault(e => e.Verified)?.Email;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ private record GitHubUserInfo
+ {
+ [JsonPropertyName("id")]
+ public long Id { get; init; }
+
+ [JsonPropertyName("login")]
+ public string Login { get; init; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; init; }
+
+ [JsonPropertyName("email")]
+ public string Email { get; init; }
+
+ [JsonPropertyName("avatar_url")]
+ public string AvatarUrl { get; init; }
+ }
+
+ private record GitHubEmail
+ {
+ [JsonPropertyName("email")]
+ public string Email { get; init; }
+
+ [JsonPropertyName("primary")]
+ public bool Primary { get; init; }
+
+ [JsonPropertyName("verified")]
+ public bool Verified { get; init; }
+ }
+}
diff --git a/src/Infrastructure/Authentication/OAuth/GoogleOAuthProvider.cs b/src/Infrastructure/Authentication/OAuth/GoogleOAuthProvider.cs
new file mode 100644
index 00000000..cc3495fe
--- /dev/null
+++ b/src/Infrastructure/Authentication/OAuth/GoogleOAuthProvider.cs
@@ -0,0 +1,110 @@
+using System.Net.Http.Headers;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Domain.ValueObjects.OAuth;
+using Microsoft.Extensions.Configuration;
+
+namespace Infrastructure.Authentication.OAuth;
+
+public class GoogleOAuthProvider : IOAuthProvider
+{
+ private const string AuthorizationEndpoint = "https://accounts.google.com/o/oauth2/v2/auth";
+ private const string TokenEndpoint = "https://oauth2.googleapis.com/token";
+ private const string UserInfoEndpoint = "https://www.googleapis.com/oauth2/v3/userinfo";
+
+ private readonly IConfiguration _configuration;
+ private readonly IHttpClientFactory _httpClientFactory;
+
+ public GoogleOAuthProvider(
+ IConfiguration configuration,
+ IHttpClientFactory httpClientFactory)
+ {
+ _configuration = configuration;
+ _httpClientFactory = httpClientFactory;
+ }
+
+ public string GetAuthorizationUrl(string state, string redirectUri = null)
+ {
+ var clientId = _configuration["OAuth:Google:ClientId"];
+ redirectUri ??= _configuration["OAuth:Google:RedirectUri"];
+
+ return $"{AuthorizationEndpoint}" +
+ $"?client_id={Uri.EscapeDataString(clientId)}" +
+ $"&redirect_uri={Uri.EscapeDataString(redirectUri)}" +
+ "&response_type=code" +
+ "&scope=openid%20email%20profile" +
+ $"&state={Uri.EscapeDataString(state)}" +
+ "&access_type=offline" +
+ "&prompt=consent";
+ }
+
+ public async Task ExchangeCodeAsync(string code, string redirectUri = null)
+ {
+ var clientId = _configuration["OAuth:Google:ClientId"];
+ var clientSecret = _configuration["OAuth:Google:ClientSecret"];
+ redirectUri ??= _configuration["OAuth:Google:RedirectUri"];
+
+ using var client = _httpClientFactory.CreateClient();
+ var content = new FormUrlEncodedContent(new Dictionary
+ {
+ ["code"] = code,
+ ["client_id"] = clientId,
+ ["client_secret"] = clientSecret,
+ ["redirect_uri"] = redirectUri,
+ ["grant_type"] = "authorization_code",
+ });
+
+ var response = await client.PostAsync(TokenEndpoint, content);
+ response.EnsureSuccessStatusCode();
+
+ var json = await response.Content.ReadAsStringAsync();
+ return JsonSerializer.Deserialize(json);
+ }
+
+ public async Task GetUserInfoAsync(string accessToken)
+ {
+ using var client = _httpClientFactory.CreateClient();
+ client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
+
+ var response = await client.GetAsync(UserInfoEndpoint);
+ response.EnsureSuccessStatusCode();
+
+ var json = await response.Content.ReadAsStringAsync();
+ var googleUser = JsonSerializer.Deserialize(json);
+
+ return new OAuthUserInfo
+ {
+ Id = googleUser.Sub,
+ Email = googleUser.Email,
+ EmailVerified = googleUser.EmailVerified,
+ GivenName = googleUser.GivenName,
+ FamilyName = googleUser.FamilyName,
+ Name = googleUser.Name,
+ Picture = googleUser.Picture,
+ };
+ }
+
+ private record GoogleUserInfo
+ {
+ [JsonPropertyName("sub")]
+ public string Sub { get; init; }
+
+ [JsonPropertyName("email")]
+ public string Email { get; init; }
+
+ [JsonPropertyName("email_verified")]
+ public bool EmailVerified { get; init; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; init; }
+
+ [JsonPropertyName("given_name")]
+ public string GivenName { get; init; }
+
+ [JsonPropertyName("family_name")]
+ public string FamilyName { get; init; }
+
+ [JsonPropertyName("picture")]
+ public string Picture { get; init; }
+ }
+}
diff --git a/src/Infrastructure/Authentication/OAuth/IOAuthProvider.cs b/src/Infrastructure/Authentication/OAuth/IOAuthProvider.cs
new file mode 100644
index 00000000..5d30b7b8
--- /dev/null
+++ b/src/Infrastructure/Authentication/OAuth/IOAuthProvider.cs
@@ -0,0 +1,12 @@
+using Domain.ValueObjects.OAuth;
+
+namespace Infrastructure.Authentication.OAuth;
+
+public interface IOAuthProvider
+{
+ string GetAuthorizationUrl(string state, string redirectUri = null);
+
+ Task ExchangeCodeAsync(string code, string redirectUri = null);
+
+ Task GetUserInfoAsync(string accessToken);
+}
diff --git a/src/Infrastructure/Authentication/OAuth/OAuthProviderFactory.cs b/src/Infrastructure/Authentication/OAuth/OAuthProviderFactory.cs
new file mode 100644
index 00000000..9a368b41
--- /dev/null
+++ b/src/Infrastructure/Authentication/OAuth/OAuthProviderFactory.cs
@@ -0,0 +1,28 @@
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Infrastructure.Authentication.OAuth;
+
+public interface IOAuthProviderFactory
+{
+ IOAuthProvider GetProvider(string providerName);
+}
+
+public class OAuthProviderFactory : IOAuthProviderFactory
+{
+ private readonly IServiceProvider _serviceProvider;
+
+ public OAuthProviderFactory(IServiceProvider serviceProvider)
+ {
+ _serviceProvider = serviceProvider;
+ }
+
+ public IOAuthProvider GetProvider(string providerName)
+ {
+ return providerName.ToLowerInvariant() switch
+ {
+ "google" => _serviceProvider.GetRequiredService(),
+ "github" => _serviceProvider.GetRequiredService(),
+ _ => throw new ArgumentException($"Unknown OAuth provider: {providerName}", nameof(providerName)),
+ };
+ }
+}
diff --git a/src/Infrastructure/Authentication/PasswordHasher.cs b/src/Infrastructure/Authentication/PasswordHasher.cs
new file mode 100644
index 00000000..8c4d6bf9
--- /dev/null
+++ b/src/Infrastructure/Authentication/PasswordHasher.cs
@@ -0,0 +1,30 @@
+using Infrastructure.Authentication.Contracts;
+
+namespace Infrastructure.Authentication;
+
+public class PasswordHasher : IPasswordHasher
+{
+ private const int WorkFactor = 12;
+
+ public string Hash(string password)
+ {
+ return BCrypt.Net.BCrypt.HashPassword(password, WorkFactor);
+ }
+
+ public bool Verify(string password, string hash)
+ {
+ if (string.IsNullOrEmpty(password) || string.IsNullOrEmpty(hash))
+ {
+ return false;
+ }
+
+ try
+ {
+ return BCrypt.Net.BCrypt.Verify(password, hash);
+ }
+ catch
+ {
+ return false;
+ }
+ }
+}
diff --git a/src/Infrastructure/Configs/DotEnvConfig.cs b/src/Infrastructure/Configs/DotEnvConfig.cs
index 5c2ba142..bf3867b6 100644
--- a/src/Infrastructure/Configs/DotEnvConfig.cs
+++ b/src/Infrastructure/Configs/DotEnvConfig.cs
@@ -1,4 +1,4 @@
-using dotenv.net;
+using dotenv.net;
namespace Infrastructure.Configs;
diff --git a/src/Infrastructure/Currencies/Contracts/ICurrencyService.cs b/src/Infrastructure/Currencies/Contracts/ICurrencyService.cs
index 7ebe27c0..b7b208d6 100644
--- a/src/Infrastructure/Currencies/Contracts/ICurrencyService.cs
+++ b/src/Infrastructure/Currencies/Contracts/ICurrencyService.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Currencies;
+using Domain.Entities.Currencies;
using Domain.Entities.Salaries;
namespace Infrastructure.Currencies.Contracts
diff --git a/src/Infrastructure/Currencies/CurrenciesHttpService.cs b/src/Infrastructure/Currencies/CurrenciesHttpService.cs
index 088892f1..3bcecd75 100644
--- a/src/Infrastructure/Currencies/CurrenciesHttpService.cs
+++ b/src/Infrastructure/Currencies/CurrenciesHttpService.cs
@@ -1,4 +1,4 @@
-using System.Xml.Linq;
+using System.Xml.Linq;
using Domain.Entities.Currencies;
using Domain.Entities.Salaries;
using Domain.Extensions;
diff --git a/src/Infrastructure/Currencies/CurrencyService.cs b/src/Infrastructure/Currencies/CurrencyService.cs
index 4c80a8fa..db1598dd 100644
--- a/src/Infrastructure/Currencies/CurrencyService.cs
+++ b/src/Infrastructure/Currencies/CurrencyService.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Currencies;
+using Domain.Entities.Currencies;
using Domain.Entities.Salaries;
using Infrastructure.Currencies.Contracts;
using Infrastructure.Database;
diff --git a/src/Infrastructure/Currencies/ICurrenciesHttpService.cs b/src/Infrastructure/Currencies/ICurrenciesHttpService.cs
index b3febe95..63bb9276 100644
--- a/src/Infrastructure/Currencies/ICurrenciesHttpService.cs
+++ b/src/Infrastructure/Currencies/ICurrenciesHttpService.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Currencies;
+using Domain.Entities.Currencies;
using Domain.Entities.Salaries;
namespace Infrastructure.Currencies;
diff --git a/src/Infrastructure/Database/Config/AiAnalysisRecordEntityConfig.cs b/src/Infrastructure/Database/Config/AiAnalysisRecordEntityConfig.cs
index c5840796..075f78fd 100644
--- a/src/Infrastructure/Database/Config/AiAnalysisRecordEntityConfig.cs
+++ b/src/Infrastructure/Database/Config/AiAnalysisRecordEntityConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.StatData;
+using Domain.Entities.StatData;
using Domain.Entities.StatData.Salary;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/CompanyEntityConfiguration.cs b/src/Infrastructure/Database/Config/CompanyEntityConfiguration.cs
index 4b0d4da9..55e8088e 100644
--- a/src/Infrastructure/Database/Config/CompanyEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/CompanyEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Companies;
+using Domain.Entities.Companies;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/CompanyRatingHistoryEntityConfiguration.cs b/src/Infrastructure/Database/Config/CompanyRatingHistoryEntityConfiguration.cs
index 5d334a18..4292fb26 100644
--- a/src/Infrastructure/Database/Config/CompanyRatingHistoryEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/CompanyRatingHistoryEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Companies;
+using Domain.Entities.Companies;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/CompanyReviewEntityConfiguration.cs b/src/Infrastructure/Database/Config/CompanyReviewEntityConfiguration.cs
index f08f0529..857fb2aa 100644
--- a/src/Infrastructure/Database/Config/CompanyReviewEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/CompanyReviewEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Companies;
+using Domain.Entities.Companies;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/CompanyReviewVoteEntityConfig.cs b/src/Infrastructure/Database/Config/CompanyReviewVoteEntityConfig.cs
index d4454f82..4bc07619 100644
--- a/src/Infrastructure/Database/Config/CompanyReviewVoteEntityConfig.cs
+++ b/src/Infrastructure/Database/Config/CompanyReviewVoteEntityConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Companies;
+using Domain.Entities.Companies;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/CurrenciesCollectionEntityConfiguration.cs b/src/Infrastructure/Database/Config/CurrenciesCollectionEntityConfiguration.cs
index a0149530..24c0b86f 100644
--- a/src/Infrastructure/Database/Config/CurrenciesCollectionEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/CurrenciesCollectionEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Currencies;
+using Domain.Entities.Currencies;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/Github/GithubPersonalUserTokenEntityConfiguration.cs b/src/Infrastructure/Database/Config/Github/GithubPersonalUserTokenEntityConfiguration.cs
index 09d8c9f9..7fb32208 100644
--- a/src/Infrastructure/Database/Config/Github/GithubPersonalUserTokenEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/Github/GithubPersonalUserTokenEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Github;
+using Domain.Entities.Github;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/Github/GithubProfileBotChatEntityConfiguration.cs b/src/Infrastructure/Database/Config/Github/GithubProfileBotChatEntityConfiguration.cs
index 22af4edd..b2b83f2d 100644
--- a/src/Infrastructure/Database/Config/Github/GithubProfileBotChatEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/Github/GithubProfileBotChatEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Github;
+using Domain.Entities.Github;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/Github/GithubProfileBotMessageEntityConfiguration.cs b/src/Infrastructure/Database/Config/Github/GithubProfileBotMessageEntityConfiguration.cs
index c3c14e62..567bc63d 100644
--- a/src/Infrastructure/Database/Config/Github/GithubProfileBotMessageEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/Github/GithubProfileBotMessageEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Github;
+using Domain.Entities.Github;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/Github/GithubProfileEntityConfiguration.cs b/src/Infrastructure/Database/Config/Github/GithubProfileEntityConfiguration.cs
index 48dea573..3600d63d 100644
--- a/src/Infrastructure/Database/Config/Github/GithubProfileEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/Github/GithubProfileEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Github;
+using Domain.Entities.Github;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/Github/GithubProfileProcessingJobEntityConfiguration.cs b/src/Infrastructure/Database/Config/Github/GithubProfileProcessingJobEntityConfiguration.cs
index b29a9a79..6f0795f7 100644
--- a/src/Infrastructure/Database/Config/Github/GithubProfileProcessingJobEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/Github/GithubProfileProcessingJobEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Github;
+using Domain.Entities.Github;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/HistoricalRecords/SalariesHistoricalDataRecordEntityConfiguration.cs b/src/Infrastructure/Database/Config/HistoricalRecords/SalariesHistoricalDataRecordEntityConfiguration.cs
index 203ffb24..9c24e9db 100644
--- a/src/Infrastructure/Database/Config/HistoricalRecords/SalariesHistoricalDataRecordEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/HistoricalRecords/SalariesHistoricalDataRecordEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.HistoricalRecords;
+using Domain.Entities.HistoricalRecords;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/HistoricalRecords/SalariesHistoricalDataRecordTemplateEntityConfiguration.cs b/src/Infrastructure/Database/Config/HistoricalRecords/SalariesHistoricalDataRecordTemplateEntityConfiguration.cs
index d14e1bce..d0f5014a 100644
--- a/src/Infrastructure/Database/Config/HistoricalRecords/SalariesHistoricalDataRecordTemplateEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/HistoricalRecords/SalariesHistoricalDataRecordTemplateEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.HistoricalRecords;
+using Domain.Entities.HistoricalRecords;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/InterviewConfig.cs b/src/Infrastructure/Database/Config/InterviewConfig.cs
index 382d5f56..caf35675 100644
--- a/src/Infrastructure/Database/Config/InterviewConfig.cs
+++ b/src/Infrastructure/Database/Config/InterviewConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Interviews;
+using Domain.Entities.Interviews;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/InterviewTemplateConfig.cs b/src/Infrastructure/Database/Config/InterviewTemplateConfig.cs
index 8b7e4243..9b3bfdab 100644
--- a/src/Infrastructure/Database/Config/InterviewTemplateConfig.cs
+++ b/src/Infrastructure/Database/Config/InterviewTemplateConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Interviews;
+using Domain.Entities.Interviews;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/JobPostingMessageSubscriptionEntityConfig.cs b/src/Infrastructure/Database/Config/JobPostingMessageSubscriptionEntityConfig.cs
index a48a8186..90ab121d 100644
--- a/src/Infrastructure/Database/Config/JobPostingMessageSubscriptionEntityConfig.cs
+++ b/src/Infrastructure/Database/Config/JobPostingMessageSubscriptionEntityConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.StatData.Salary;
+using Domain.Entities.StatData.Salary;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/LastWeekCompanyReviewsSubscriptionEntityConfiguration.cs b/src/Infrastructure/Database/Config/LastWeekCompanyReviewsSubscriptionEntityConfiguration.cs
index c507ff3d..849eee5a 100644
--- a/src/Infrastructure/Database/Config/LastWeekCompanyReviewsSubscriptionEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/LastWeekCompanyReviewsSubscriptionEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.StatData;
+using Domain.Entities.StatData;
using Domain.Entities.StatData.CompanyReviews;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/M2mClientDbConfig.cs b/src/Infrastructure/Database/Config/M2mClientDbConfig.cs
new file mode 100644
index 00000000..35173e4d
--- /dev/null
+++ b/src/Infrastructure/Database/Config/M2mClientDbConfig.cs
@@ -0,0 +1,61 @@
+using Domain.Entities.Auth;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace Infrastructure.Database.Config;
+
+internal class M2mClientDbConfig :
+ IEntityTypeConfiguration,
+ IEntityTypeConfiguration
+{
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.HasIndex(x => x.ClientId).IsUnique();
+
+ builder.HasIndex(x => x.Name);
+
+ builder
+ .HasOne(x => x.CreatedByUser)
+ .WithMany()
+ .HasForeignKey(x => x.CreatedByUserId)
+ .OnDelete(DeleteBehavior.SetNull);
+
+ builder
+ .Property(x => x.Name)
+ .HasMaxLength(200)
+ .IsRequired();
+
+ builder
+ .Property(x => x.Description)
+ .HasMaxLength(1000);
+
+ builder
+ .Property(x => x.ClientId)
+ .HasMaxLength(100)
+ .IsRequired();
+
+ builder
+ .Property(x => x.ClientSecretHash)
+ .HasMaxLength(200);
+
+ builder
+ .Property(x => x.LastUsedIpAddress)
+ .HasMaxLength(50);
+ }
+
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.HasIndex(x => new { x.M2mClientId, x.Scope }).IsUnique();
+
+ builder
+ .HasOne(x => x.M2mClient)
+ .WithMany(x => x.Scopes)
+ .HasForeignKey(x => x.M2mClientId)
+ .OnDelete(DeleteBehavior.Cascade);
+
+ builder
+ .Property(x => x.Scope)
+ .HasMaxLength(100)
+ .IsRequired();
+ }
+}
diff --git a/src/Infrastructure/Database/Config/OpenAi/CompanyOpenAiAnalysisEntityConfiguration.cs b/src/Infrastructure/Database/Config/OpenAi/CompanyOpenAiAnalysisEntityConfiguration.cs
index 9a9aca73..9961a4c3 100644
--- a/src/Infrastructure/Database/Config/OpenAi/CompanyOpenAiAnalysisEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/OpenAi/CompanyOpenAiAnalysisEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Companies;
+using Domain.Entities.Companies;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/OpenAi/OpenAiPromptEntifyConfiguration.cs b/src/Infrastructure/Database/Config/OpenAi/OpenAiPromptEntifyConfiguration.cs
index 3c46f7ec..83a7cb5b 100644
--- a/src/Infrastructure/Database/Config/OpenAi/OpenAiPromptEntifyConfiguration.cs
+++ b/src/Infrastructure/Database/Config/OpenAi/OpenAiPromptEntifyConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Prompts;
+using Domain.Entities.Prompts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/ProfessionConfig.cs b/src/Infrastructure/Database/Config/ProfessionConfig.cs
index 843e0c56..19a98601 100644
--- a/src/Infrastructure/Database/Config/ProfessionConfig.cs
+++ b/src/Infrastructure/Database/Config/ProfessionConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Salaries;
+using Domain.Entities.Salaries;
using Domain.Extensions;
using Domain.ValueObjects;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Database/Config/RefreshTokenDbConfig.cs b/src/Infrastructure/Database/Config/RefreshTokenDbConfig.cs
new file mode 100644
index 00000000..e90b05e8
--- /dev/null
+++ b/src/Infrastructure/Database/Config/RefreshTokenDbConfig.cs
@@ -0,0 +1,32 @@
+using Domain.Entities.Auth;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace Infrastructure.Database.Config;
+
+internal class RefreshTokenDbConfig : IEntityTypeConfiguration
+{
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.HasIndex(x => x.Token).IsUnique();
+
+ builder.HasIndex(x => x.UserId);
+
+ builder.HasIndex(x => x.ExpiresAt);
+
+ builder
+ .HasOne(x => x.User)
+ .WithMany()
+ .HasForeignKey(x => x.UserId)
+ .OnDelete(DeleteBehavior.Cascade);
+
+ builder
+ .Property(x => x.Token)
+ .HasMaxLength(200)
+ .IsRequired();
+
+ builder
+ .Property(x => x.DeviceInfo)
+ .HasMaxLength(500);
+ }
+}
diff --git a/src/Infrastructure/Database/Config/SalariesSurveyReplyConfig.cs b/src/Infrastructure/Database/Config/SalariesSurveyReplyConfig.cs
index 75d49ae0..ebdfd1df 100644
--- a/src/Infrastructure/Database/Config/SalariesSurveyReplyConfig.cs
+++ b/src/Infrastructure/Database/Config/SalariesSurveyReplyConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Questions;
+using Domain.Entities.Questions;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/ShareLinkConfig.cs b/src/Infrastructure/Database/Config/ShareLinkConfig.cs
index a9b4e22e..a1c70987 100644
--- a/src/Infrastructure/Database/Config/ShareLinkConfig.cs
+++ b/src/Infrastructure/Database/Config/ShareLinkConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Interviews;
+using Domain.Entities.Interviews;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/SkillConfig.cs b/src/Infrastructure/Database/Config/SkillConfig.cs
index a38c540c..66dedeb1 100644
--- a/src/Infrastructure/Database/Config/SkillConfig.cs
+++ b/src/Infrastructure/Database/Config/SkillConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Salaries;
+using Domain.Entities.Salaries;
using Domain.ValueObjects;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/StatDataChangeSubscriptionEntityConfig.cs b/src/Infrastructure/Database/Config/StatDataChangeSubscriptionEntityConfig.cs
index 7da6d0ee..5035905a 100644
--- a/src/Infrastructure/Database/Config/StatDataChangeSubscriptionEntityConfig.cs
+++ b/src/Infrastructure/Database/Config/StatDataChangeSubscriptionEntityConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.StatData;
+using Domain.Entities.StatData;
using Domain.Entities.StatData.Salary;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/StatDataChangeSubscriptionRecordEntityConfig.cs b/src/Infrastructure/Database/Config/StatDataChangeSubscriptionRecordEntityConfig.cs
index 9b24a690..d0968e22 100644
--- a/src/Infrastructure/Database/Config/StatDataChangeSubscriptionRecordEntityConfig.cs
+++ b/src/Infrastructure/Database/Config/StatDataChangeSubscriptionRecordEntityConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.StatData;
+using Domain.Entities.StatData;
using Domain.Entities.StatData.Salary;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/SubscriptionTelegramMessageEntityConfiguration.cs b/src/Infrastructure/Database/Config/SubscriptionTelegramMessageEntityConfiguration.cs
index 686e44c2..7a7ce4b9 100644
--- a/src/Infrastructure/Database/Config/SubscriptionTelegramMessageEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/SubscriptionTelegramMessageEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.StatData;
+using Domain.Entities.StatData;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/TelegramBotUserConfig.cs b/src/Infrastructure/Database/Config/TelegramBotUserConfig.cs
index 7e508cbb..9145f9e2 100644
--- a/src/Infrastructure/Database/Config/TelegramBotUserConfig.cs
+++ b/src/Infrastructure/Database/Config/TelegramBotUserConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Telegram;
+using Domain.Entities.Telegram;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/TelegramInlineReplyEntityConfiguration.cs b/src/Infrastructure/Database/Config/TelegramInlineReplyEntityConfiguration.cs
index 50e530f9..098d768e 100644
--- a/src/Infrastructure/Database/Config/TelegramInlineReplyEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/TelegramInlineReplyEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Telegram;
+using Domain.Entities.Telegram;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/TelegramUserSettingsConfig.cs b/src/Infrastructure/Database/Config/TelegramUserSettingsConfig.cs
index 22e30c57..79bc5009 100644
--- a/src/Infrastructure/Database/Config/TelegramUserSettingsConfig.cs
+++ b/src/Infrastructure/Database/Config/TelegramUserSettingsConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Telegram;
+using Domain.Entities.Telegram;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/UserCsvDownloadConfig.cs b/src/Infrastructure/Database/Config/UserCsvDownloadConfig.cs
index 9fde39dc..b08c6e0e 100644
--- a/src/Infrastructure/Database/Config/UserCsvDownloadConfig.cs
+++ b/src/Infrastructure/Database/Config/UserCsvDownloadConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.CSV;
+using Domain.Entities.CSV;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/UserDbConfig.cs b/src/Infrastructure/Database/Config/UserDbConfig.cs
index e96c18a1..cb8c901c 100644
--- a/src/Infrastructure/Database/Config/UserDbConfig.cs
+++ b/src/Infrastructure/Database/Config/UserDbConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Users;
+using Domain.Entities.Users;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
@@ -23,6 +23,24 @@ public void Configure(EntityTypeBuilder builder)
builder
.HasIndex(x => x.UniqueToken)
.IsUnique();
+
+ builder
+ .Property(x => x.PasswordHash)
+ .HasMaxLength(200);
+
+ builder
+ .Property(x => x.PasswordResetToken)
+ .HasMaxLength(100);
+
+ builder
+ .HasIndex(x => x.PasswordResetToken);
+
+ builder
+ .Property(x => x.EmailVerificationToken)
+ .HasMaxLength(100);
+
+ builder
+ .HasIndex(x => x.EmailVerificationToken);
}
public void Configure(EntityTypeBuilder builder)
diff --git a/src/Infrastructure/Database/Config/UserEmailEntityConfiguration.cs b/src/Infrastructure/Database/Config/UserEmailEntityConfiguration.cs
index 8681b631..a814bbd0 100644
--- a/src/Infrastructure/Database/Config/UserEmailEntityConfiguration.cs
+++ b/src/Infrastructure/Database/Config/UserEmailEntityConfiguration.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Users;
+using Domain.Entities.Users;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/UserLabelConfig.cs b/src/Infrastructure/Database/Config/UserLabelConfig.cs
index e9617266..220887b3 100644
--- a/src/Infrastructure/Database/Config/UserLabelConfig.cs
+++ b/src/Infrastructure/Database/Config/UserLabelConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Labels;
+using Domain.Entities.Labels;
using Domain.ValueObjects;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/UserSalaryConfig.cs b/src/Infrastructure/Database/Config/UserSalaryConfig.cs
index 52b84ab1..2fc9eba4 100644
--- a/src/Infrastructure/Database/Config/UserSalaryConfig.cs
+++ b/src/Infrastructure/Database/Config/UserSalaryConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Salaries;
+using Domain.Entities.Salaries;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/Config/WorkIndustryConfig.cs b/src/Infrastructure/Database/Config/WorkIndustryConfig.cs
index 4ec20015..3267d0ce 100644
--- a/src/Infrastructure/Database/Config/WorkIndustryConfig.cs
+++ b/src/Infrastructure/Database/Config/WorkIndustryConfig.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Salaries;
+using Domain.Entities.Salaries;
using Domain.ValueObjects;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
diff --git a/src/Infrastructure/Database/ContextExtensions.cs b/src/Infrastructure/Database/ContextExtensions.cs
index 7197115a..fc889a37 100644
--- a/src/Infrastructure/Database/ContextExtensions.cs
+++ b/src/Infrastructure/Database/ContextExtensions.cs
@@ -1,4 +1,4 @@
-using System.Linq.Expressions;
+using System.Linq.Expressions;
using Domain.Entities;
using Domain.Validation.Exceptions;
using Domain.ValueObjects.Pagination;
diff --git a/src/Infrastructure/Database/DatabaseConfigExtensions.cs b/src/Infrastructure/Database/DatabaseConfigExtensions.cs
index 1cf8f2cc..41ae076b 100644
--- a/src/Infrastructure/Database/DatabaseConfigExtensions.cs
+++ b/src/Infrastructure/Database/DatabaseConfigExtensions.cs
@@ -1,4 +1,4 @@
-using System.Text.Json;
+using System.Text.Json;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Diagnostics;
diff --git a/src/Infrastructure/Database/DatabaseContext.cs b/src/Infrastructure/Database/DatabaseContext.cs
index a29895e1..4be6cd9c 100644
--- a/src/Infrastructure/Database/DatabaseContext.cs
+++ b/src/Infrastructure/Database/DatabaseContext.cs
@@ -1,4 +1,5 @@
-using Domain.Entities;
+using Domain.Entities;
+using Domain.Entities.Auth;
using Domain.Entities.Companies;
using Domain.Entities.CSV;
using Domain.Entities.Currencies;
@@ -31,6 +32,12 @@ public DatabaseContext(DbContextOptions options)
public DbSet Users { get; set; }
+ public DbSet RefreshTokens { get; set; }
+
+ public DbSet M2mClients { get; set; }
+
+ public DbSet M2mClientScopes { get; set; }
+
public DbSet InterviewTemplates { get; set; }
public DbSet Interviews { get; set; }
diff --git a/src/Infrastructure/Database/DatabaseContextDesignTimeFactoryBase.cs b/src/Infrastructure/Database/DatabaseContextDesignTimeFactoryBase.cs
index 72e55a52..ab035480 100644
--- a/src/Infrastructure/Database/DatabaseContextDesignTimeFactoryBase.cs
+++ b/src/Infrastructure/Database/DatabaseContextDesignTimeFactoryBase.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
diff --git a/src/Infrastructure/Database/Extensions/UserQueryExtensions.cs b/src/Infrastructure/Database/Extensions/UserQueryExtensions.cs
index 68263fbe..325a2d6e 100644
--- a/src/Infrastructure/Database/Extensions/UserQueryExtensions.cs
+++ b/src/Infrastructure/Database/Extensions/UserQueryExtensions.cs
@@ -1,4 +1,4 @@
-using System.Linq.Expressions;
+using System.Linq.Expressions;
using Domain.Entities.Users;
using Domain.Extensions;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/DatabaseContextDesignTimeFactory.cs b/src/Infrastructure/DatabaseContextDesignTimeFactory.cs
index c5ec8671..23aeb297 100644
--- a/src/Infrastructure/DatabaseContextDesignTimeFactory.cs
+++ b/src/Infrastructure/DatabaseContextDesignTimeFactory.cs
@@ -1,4 +1,4 @@
-using Infrastructure.Database;
+using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
diff --git a/src/Infrastructure/Emails/Contracts/IEmailApiSender.cs b/src/Infrastructure/Emails/Contracts/IEmailApiSender.cs
index 96eda197..b25ad34f 100644
--- a/src/Infrastructure/Emails/Contracts/IEmailApiSender.cs
+++ b/src/Infrastructure/Emails/Contracts/IEmailApiSender.cs
@@ -1,4 +1,4 @@
-using Infrastructure.Emails.Contracts.Requests;
+using Infrastructure.Emails.Contracts.Requests;
namespace Infrastructure.Emails.Contracts;
diff --git a/src/Infrastructure/Emails/Contracts/ITechinterviewEmailService.cs b/src/Infrastructure/Emails/Contracts/ITechinterviewEmailService.cs
index 7ca7903f..4dfe47d4 100644
--- a/src/Infrastructure/Emails/Contracts/ITechinterviewEmailService.cs
+++ b/src/Infrastructure/Emails/Contracts/ITechinterviewEmailService.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Users;
+using Domain.Entities.Users;
using Infrastructure.Emails.Contracts.Requests;
namespace Infrastructure.Emails.Contracts;
@@ -19,6 +19,16 @@ Task SalaryUpdateReminderEmailAsync(
User user,
CancellationToken cancellationToken);
+ Task SendEmailVerificationAsync(
+ User user,
+ string verificationUrl,
+ CancellationToken cancellationToken);
+
+ Task SendPasswordResetAsync(
+ User user,
+ string resetUrl,
+ CancellationToken cancellationToken);
+
EmailContent Prepare(
SendGridEmailSendRequest emailContent);
}
\ No newline at end of file
diff --git a/src/Infrastructure/Emails/Contracts/Requests/EmailContent.cs b/src/Infrastructure/Emails/Contracts/Requests/EmailContent.cs
index 3ac17f55..c79239ae 100644
--- a/src/Infrastructure/Emails/Contracts/Requests/EmailContent.cs
+++ b/src/Infrastructure/Emails/Contracts/Requests/EmailContent.cs
@@ -1,4 +1,4 @@
-namespace Infrastructure.Emails.Contracts.Requests;
+namespace Infrastructure.Emails.Contracts.Requests;
public record EmailContent
{
diff --git a/src/Infrastructure/Emails/Contracts/Requests/SendGridEmailSendRequest.cs b/src/Infrastructure/Emails/Contracts/Requests/SendGridEmailSendRequest.cs
index 711cfa93..54f02ae2 100644
--- a/src/Infrastructure/Emails/Contracts/Requests/SendGridEmailSendRequest.cs
+++ b/src/Infrastructure/Emails/Contracts/Requests/SendGridEmailSendRequest.cs
@@ -1,4 +1,4 @@
-namespace Infrastructure.Emails.Contracts.Requests;
+namespace Infrastructure.Emails.Contracts.Requests;
public record SendGridEmailSendRequest
{
diff --git a/src/Infrastructure/Emails/IViewRenderer.cs b/src/Infrastructure/Emails/IViewRenderer.cs
index 193b293f..c4c022bd 100644
--- a/src/Infrastructure/Emails/IViewRenderer.cs
+++ b/src/Infrastructure/Emails/IViewRenderer.cs
@@ -1,4 +1,4 @@
-namespace Infrastructure.Emails;
+namespace Infrastructure.Emails;
public interface IViewRenderer
{
diff --git a/src/Infrastructure/Emails/LocalEmailApiSender.cs b/src/Infrastructure/Emails/LocalEmailApiSender.cs
index 6e0e40fe..874289ff 100644
--- a/src/Infrastructure/Emails/LocalEmailApiSender.cs
+++ b/src/Infrastructure/Emails/LocalEmailApiSender.cs
@@ -1,4 +1,4 @@
-using Infrastructure.Emails.Contracts;
+using Infrastructure.Emails.Contracts;
using Infrastructure.Emails.Contracts.Requests;
using Microsoft.Extensions.Logging;
diff --git a/src/Infrastructure/Emails/ResendEmailApiSender.cs b/src/Infrastructure/Emails/ResendEmailApiSender.cs
index 2f19b31d..4685cc96 100644
--- a/src/Infrastructure/Emails/ResendEmailApiSender.cs
+++ b/src/Infrastructure/Emails/ResendEmailApiSender.cs
@@ -1,4 +1,4 @@
-using Domain.Validation;
+using Domain.Validation;
using Infrastructure.Emails.Contracts;
using Infrastructure.Emails.Contracts.Requests;
using Microsoft.Extensions.Configuration;
diff --git a/src/Infrastructure/Extensions/CompanyExtensions.cs b/src/Infrastructure/Extensions/CompanyExtensions.cs
index 3a067ae4..9a84a161 100644
--- a/src/Infrastructure/Extensions/CompanyExtensions.cs
+++ b/src/Infrastructure/Extensions/CompanyExtensions.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Companies;
+using Domain.Entities.Companies;
using Microsoft.EntityFrameworkCore;
namespace Infrastructure.Extensions;
diff --git a/src/Infrastructure/Extensions/CompanyReviewsExtensions.cs b/src/Infrastructure/Extensions/CompanyReviewsExtensions.cs
index 959fe0d8..969a3866 100644
--- a/src/Infrastructure/Extensions/CompanyReviewsExtensions.cs
+++ b/src/Infrastructure/Extensions/CompanyReviewsExtensions.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Companies;
+using Domain.Entities.Companies;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Extensions/UserExtensions.cs b/src/Infrastructure/Extensions/UserExtensions.cs
index e349aa22..750d7b3b 100644
--- a/src/Infrastructure/Extensions/UserExtensions.cs
+++ b/src/Infrastructure/Extensions/UserExtensions.cs
@@ -1,4 +1,4 @@
-using Domain.Entities.Salaries;
+using Domain.Entities.Salaries;
using Domain.Entities.Users;
using Domain.ValueObjects.Dates;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Images/QRCodeImage.cs b/src/Infrastructure/Images/QRCodeImage.cs
index 64ffd7a2..9b28e397 100644
--- a/src/Infrastructure/Images/QRCodeImage.cs
+++ b/src/Infrastructure/Images/QRCodeImage.cs
@@ -1,4 +1,4 @@
-using QRCoder;
+using QRCoder;
namespace Infrastructure.Images;
diff --git a/src/Infrastructure/Infrastructure.csproj b/src/Infrastructure/Infrastructure.csproj
index 4685047c..792eff79 100644
--- a/src/Infrastructure/Infrastructure.csproj
+++ b/src/Infrastructure/Infrastructure.csproj
@@ -33,6 +33,7 @@
+
diff --git a/src/Infrastructure/Jwt/IJwtTokenService.cs b/src/Infrastructure/Jwt/IJwtTokenService.cs
new file mode 100644
index 00000000..2732f63e
--- /dev/null
+++ b/src/Infrastructure/Jwt/IJwtTokenService.cs
@@ -0,0 +1,16 @@
+using System.Security.Claims;
+using Domain.Entities.Auth;
+using Domain.Entities.Users;
+
+namespace Infrastructure.Jwt;
+
+public interface IJwtTokenService
+{
+ string GenerateAccessToken(User user);
+
+ string GenerateAccessToken(M2mClient client, string[] requestedScopes);
+
+ RefreshToken GenerateRefreshToken(long userId, string deviceInfo = null);
+
+ ClaimsPrincipal ValidateToken(string token);
+}
diff --git a/src/Infrastructure/Jwt/JwtTokenService.cs b/src/Infrastructure/Jwt/JwtTokenService.cs
new file mode 100644
index 00000000..16da2ea4
--- /dev/null
+++ b/src/Infrastructure/Jwt/JwtTokenService.cs
@@ -0,0 +1,149 @@
+using System.IdentityModel.Tokens.Jwt;
+using System.Security.Claims;
+using System.Security.Cryptography;
+using System.Text;
+using Domain.Entities.Auth;
+using Domain.Entities.Users;
+using Microsoft.Extensions.Configuration;
+using Microsoft.IdentityModel.Tokens;
+
+namespace Infrastructure.Jwt;
+
+public class JwtTokenService : IJwtTokenService
+{
+ private readonly IConfiguration _configuration;
+ private readonly JwtSecurityTokenHandler _tokenHandler;
+ private readonly SymmetricSecurityKey _signingKey;
+
+ public JwtTokenService(IConfiguration configuration)
+ {
+ _configuration = configuration;
+ _tokenHandler = new JwtSecurityTokenHandler();
+
+ var secret = _configuration["OAuth:Jwt:Secret"]
+ ?? throw new InvalidOperationException("JWT Secret not configured");
+ _signingKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secret));
+ }
+
+ public string GenerateAccessToken(User user)
+ {
+ var claims = new List
+ {
+ new Claim(JwtRegisteredClaimNames.Sub, user.IdentityId ?? $"user|{user.Id}"),
+ new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
+ new Claim(JwtRegisteredClaimNames.Iat, DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(), ClaimValueTypes.Integer64),
+ new Claim(ClaimTypes.Email, user.Email),
+ new Claim("email_verified", user.EmailConfirmed.ToString().ToLowerInvariant()),
+ new Claim(ClaimTypes.GivenName, user.FirstName ?? string.Empty),
+ new Claim(ClaimTypes.Surname, user.LastName ?? string.Empty),
+ new Claim("token_type", "user"),
+ };
+
+ if (!string.IsNullOrEmpty(user.ProfilePicture))
+ {
+ claims.Add(new Claim("picture", user.ProfilePicture));
+ }
+
+ foreach (var userRole in user.UserRoles)
+ {
+ claims.Add(new Claim(ClaimTypes.Role, userRole.RoleId.ToString()));
+ }
+
+ return GenerateToken(claims, GetAccessTokenExpirationMinutes());
+ }
+
+ public string GenerateAccessToken(M2mClient client, string[] requestedScopes)
+ {
+ var grantedScopes = client.Scopes
+ .Select(s => s.Scope)
+ .Where(s => requestedScopes.Length == 0 || requestedScopes.Contains(s))
+ .ToArray();
+
+ var claims = new List
+ {
+ new Claim(JwtRegisteredClaimNames.Sub, $"m2m|{client.ClientId}"),
+ new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
+ new Claim(JwtRegisteredClaimNames.Iat, DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(), ClaimValueTypes.Integer64),
+ new Claim("client_name", client.Name),
+ new Claim("token_type", "m2m"),
+ };
+
+ foreach (var scope in grantedScopes)
+ {
+ claims.Add(new Claim("scope", scope));
+ }
+
+ return GenerateToken(claims, GetM2mTokenExpirationMinutes());
+ }
+
+ public RefreshToken GenerateRefreshToken(long userId, string deviceInfo = null)
+ {
+ var tokenBytes = new byte[64];
+ using var rng = RandomNumberGenerator.Create();
+ rng.GetBytes(tokenBytes);
+
+ var token = Convert.ToBase64String(tokenBytes)
+ .Replace("+", string.Empty)
+ .Replace("/", string.Empty)
+ .Replace("=", string.Empty);
+
+ var tokenExpirationDays = GetRefreshTokenExpirationDays();
+ return new RefreshToken(
+ userId: userId,
+ token: token,
+ expiresAt: DateTimeOffset.UtcNow.AddDays(tokenExpirationDays),
+ deviceInfo: deviceInfo);
+ }
+
+ public ClaimsPrincipal ValidateToken(string token)
+ {
+ try
+ {
+ var validationParameters = new TokenValidationParameters
+ {
+ ValidateIssuer = true,
+ ValidIssuer = _configuration["OAuth:Jwt:Issuer"],
+ ValidateAudience = true,
+ ValidAudience = _configuration["OAuth:Jwt:Audience"],
+ ValidateIssuerSigningKey = true,
+ IssuerSigningKey = _signingKey,
+ ValidateLifetime = true,
+ ClockSkew = TimeSpan.Zero,
+ };
+
+ var principal = _tokenHandler.ValidateToken(token, validationParameters, out _);
+
+ return principal;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ private string GenerateToken(List claims, int expirationMinutes)
+ {
+ var credentials = new SigningCredentials(_signingKey, SecurityAlgorithms.HmacSha256);
+
+ var token = new JwtSecurityToken(
+ issuer: _configuration["OAuth:Jwt:Issuer"],
+ audience: _configuration["OAuth:Jwt:Audience"],
+ claims: claims,
+ expires: DateTime.UtcNow.AddMinutes(expirationMinutes),
+ signingCredentials: credentials);
+
+ return _tokenHandler.WriteToken(token);
+ }
+
+ private int GetAccessTokenExpirationMinutes() =>
+ int.TryParse(_configuration["OAuth:Jwt:AccessTokenExpirationMinutes"], out var minutes) ? minutes : 60;
+
+ private int GetM2mTokenExpirationMinutes() =>
+ int.TryParse(_configuration["OAuth:Jwt:M2mTokenExpirationMinutes"], out var minutes) ? minutes : 60;
+
+ private int GetRefreshTokenExpirationDays()
+ {
+ var configValue = _configuration["OAuth:Jwt:RefreshTokenExpirationDays"] ?? "10";
+ return int.TryParse(configValue, out var days) ? days : 30;
+ }
+}
diff --git a/src/Infrastructure/Jwt/TechinterviewJwtTokenGenerator.cs b/src/Infrastructure/Jwt/TechinterviewJwtTokenGenerator.cs
index cd188aad..867d6817 100644
--- a/src/Infrastructure/Jwt/TechinterviewJwtTokenGenerator.cs
+++ b/src/Infrastructure/Jwt/TechinterviewJwtTokenGenerator.cs
@@ -1,4 +1,4 @@
-using System.IdentityModel.Tokens.Jwt;
+using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;
using Microsoft.IdentityModel.Tokens;
diff --git a/src/Infrastructure/Migrations/20220212043657_Init.Designer.cs b/src/Infrastructure/Migrations/20220212043657_Init.Designer.cs
index 4ddae8bb..89a0dc1d 100644
--- a/src/Infrastructure/Migrations/20220212043657_Init.Designer.cs
+++ b/src/Infrastructure/Migrations/20220212043657_Init.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220212043657_Init.cs b/src/Infrastructure/Migrations/20220212043657_Init.cs
index 4d8c96cb..ff9ac02e 100644
--- a/src/Infrastructure/Migrations/20220212043657_Init.cs
+++ b/src/Infrastructure/Migrations/20220212043657_Init.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20220310142711_Interviews.Designer.cs b/src/Infrastructure/Migrations/20220310142711_Interviews.Designer.cs
index 2c6de2d6..115fd1c9 100644
--- a/src/Infrastructure/Migrations/20220310142711_Interviews.Designer.cs
+++ b/src/Infrastructure/Migrations/20220310142711_Interviews.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220310142711_Interviews.cs b/src/Infrastructure/Migrations/20220310142711_Interviews.cs
index 7d87096c..1c19e401 100644
--- a/src/Infrastructure/Migrations/20220310142711_Interviews.cs
+++ b/src/Infrastructure/Migrations/20220310142711_Interviews.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20220312143144_InterviewTempaltePublicProp.Designer.cs b/src/Infrastructure/Migrations/20220312143144_InterviewTempaltePublicProp.Designer.cs
index b2ce893b..889135f0 100644
--- a/src/Infrastructure/Migrations/20220312143144_InterviewTempaltePublicProp.Designer.cs
+++ b/src/Infrastructure/Migrations/20220312143144_InterviewTempaltePublicProp.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220312143144_InterviewTempaltePublicProp.cs b/src/Infrastructure/Migrations/20220312143144_InterviewTempaltePublicProp.cs
index 7829bedb..6ba7ce22 100644
--- a/src/Infrastructure/Migrations/20220312143144_InterviewTempaltePublicProp.cs
+++ b/src/Infrastructure/Migrations/20220312143144_InterviewTempaltePublicProp.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20220317011815_StringLengthAttributes.Designer.cs b/src/Infrastructure/Migrations/20220317011815_StringLengthAttributes.Designer.cs
index 974fb78d..2edb6d3f 100644
--- a/src/Infrastructure/Migrations/20220317011815_StringLengthAttributes.Designer.cs
+++ b/src/Infrastructure/Migrations/20220317011815_StringLengthAttributes.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220317011815_StringLengthAttributes.cs b/src/Infrastructure/Migrations/20220317011815_StringLengthAttributes.cs
index b20f5c3d..c8ab219b 100644
--- a/src/Infrastructure/Migrations/20220317011815_StringLengthAttributes.cs
+++ b/src/Infrastructure/Migrations/20220317011815_StringLengthAttributes.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20220414105131_OverallOpinionTemplate.Designer.cs b/src/Infrastructure/Migrations/20220414105131_OverallOpinionTemplate.Designer.cs
index 0c4262a9..4a829b9e 100644
--- a/src/Infrastructure/Migrations/20220414105131_OverallOpinionTemplate.Designer.cs
+++ b/src/Infrastructure/Migrations/20220414105131_OverallOpinionTemplate.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220414105131_OverallOpinionTemplate.cs b/src/Infrastructure/Migrations/20220414105131_OverallOpinionTemplate.cs
index 45ac55aa..ef2edead 100644
--- a/src/Infrastructure/Migrations/20220414105131_OverallOpinionTemplate.cs
+++ b/src/Infrastructure/Migrations/20220414105131_OverallOpinionTemplate.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20220514113010_UserLabels.Designer.cs b/src/Infrastructure/Migrations/20220514113010_UserLabels.Designer.cs
index c78b8230..a8a1da4b 100644
--- a/src/Infrastructure/Migrations/20220514113010_UserLabels.Designer.cs
+++ b/src/Infrastructure/Migrations/20220514113010_UserLabels.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220514113010_UserLabels.cs b/src/Infrastructure/Migrations/20220514113010_UserLabels.cs
index 23800438..d4592425 100644
--- a/src/Infrastructure/Migrations/20220514113010_UserLabels.cs
+++ b/src/Infrastructure/Migrations/20220514113010_UserLabels.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20220709074343_Organizations.Designer.cs b/src/Infrastructure/Migrations/20220709074343_Organizations.Designer.cs
index 55020ab1..9cf04fcf 100644
--- a/src/Infrastructure/Migrations/20220709074343_Organizations.Designer.cs
+++ b/src/Infrastructure/Migrations/20220709074343_Organizations.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220709074343_Organizations.cs b/src/Infrastructure/Migrations/20220709074343_Organizations.cs
index d78a6904..cee2c7d4 100644
--- a/src/Infrastructure/Migrations/20220709074343_Organizations.cs
+++ b/src/Infrastructure/Migrations/20220709074343_Organizations.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20220711102341_CandidateCardOrgId.Designer.cs b/src/Infrastructure/Migrations/20220711102341_CandidateCardOrgId.Designer.cs
index 725b6425..d1d8e2de 100644
--- a/src/Infrastructure/Migrations/20220711102341_CandidateCardOrgId.Designer.cs
+++ b/src/Infrastructure/Migrations/20220711102341_CandidateCardOrgId.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220711102341_CandidateCardOrgId.cs b/src/Infrastructure/Migrations/20220711102341_CandidateCardOrgId.cs
index abe622cf..1920fd30 100644
--- a/src/Infrastructure/Migrations/20220711102341_CandidateCardOrgId.cs
+++ b/src/Infrastructure/Migrations/20220711102341_CandidateCardOrgId.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20220728032822_InterviewsAttachedToOrganizations.Designer.cs b/src/Infrastructure/Migrations/20220728032822_InterviewsAttachedToOrganizations.Designer.cs
index 5f788353..51488195 100644
--- a/src/Infrastructure/Migrations/20220728032822_InterviewsAttachedToOrganizations.Designer.cs
+++ b/src/Infrastructure/Migrations/20220728032822_InterviewsAttachedToOrganizations.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220728032822_InterviewsAttachedToOrganizations.cs b/src/Infrastructure/Migrations/20220728032822_InterviewsAttachedToOrganizations.cs
index 2cdff3e0..ac825208 100644
--- a/src/Infrastructure/Migrations/20220728032822_InterviewsAttachedToOrganizations.cs
+++ b/src/Infrastructure/Migrations/20220728032822_InterviewsAttachedToOrganizations.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20220803044804_OrganizationLabels.Designer.cs b/src/Infrastructure/Migrations/20220803044804_OrganizationLabels.Designer.cs
index ed23eae3..060f921c 100644
--- a/src/Infrastructure/Migrations/20220803044804_OrganizationLabels.Designer.cs
+++ b/src/Infrastructure/Migrations/20220803044804_OrganizationLabels.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220803044804_OrganizationLabels.cs b/src/Infrastructure/Migrations/20220803044804_OrganizationLabels.cs
index 9d01bfc5..9075240c 100644
--- a/src/Infrastructure/Migrations/20220803044804_OrganizationLabels.cs
+++ b/src/Infrastructure/Migrations/20220803044804_OrganizationLabels.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20220812115349_CandidateCardCvFiles.Designer.cs b/src/Infrastructure/Migrations/20220812115349_CandidateCardCvFiles.Designer.cs
index 76ae8fbc..669d6d38 100644
--- a/src/Infrastructure/Migrations/20220812115349_CandidateCardCvFiles.Designer.cs
+++ b/src/Infrastructure/Migrations/20220812115349_CandidateCardCvFiles.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20220812115349_CandidateCardCvFiles.cs b/src/Infrastructure/Migrations/20220812115349_CandidateCardCvFiles.cs
index 908b9358..930921f1 100644
--- a/src/Infrastructure/Migrations/20220812115349_CandidateCardCvFiles.cs
+++ b/src/Infrastructure/Migrations/20220812115349_CandidateCardCvFiles.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20230209150316_IdentityIdAsString.Designer.cs b/src/Infrastructure/Migrations/20230209150316_IdentityIdAsString.Designer.cs
index df1ebb17..4c29f8fa 100644
--- a/src/Infrastructure/Migrations/20230209150316_IdentityIdAsString.Designer.cs
+++ b/src/Infrastructure/Migrations/20230209150316_IdentityIdAsString.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20230209150316_IdentityIdAsString.cs b/src/Infrastructure/Migrations/20230209150316_IdentityIdAsString.cs
index 884e70ac..2a84d1a3 100644
--- a/src/Infrastructure/Migrations/20230209150316_IdentityIdAsString.cs
+++ b/src/Infrastructure/Migrations/20230209150316_IdentityIdAsString.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240109110438_UserSalaryEntity.Designer.cs b/src/Infrastructure/Migrations/20240109110438_UserSalaryEntity.Designer.cs
index d74668a1..24b1a584 100644
--- a/src/Infrastructure/Migrations/20240109110438_UserSalaryEntity.Designer.cs
+++ b/src/Infrastructure/Migrations/20240109110438_UserSalaryEntity.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240109110438_UserSalaryEntity.cs b/src/Infrastructure/Migrations/20240109110438_UserSalaryEntity.cs
index 17524825..4c9e79be 100644
--- a/src/Infrastructure/Migrations/20240109110438_UserSalaryEntity.cs
+++ b/src/Infrastructure/Migrations/20240109110438_UserSalaryEntity.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
diff --git a/src/Infrastructure/Migrations/20240110173852_ProfessionToSalaryProperty.Designer.cs b/src/Infrastructure/Migrations/20240110173852_ProfessionToSalaryProperty.Designer.cs
index 14f6068a..a5bf1a40 100644
--- a/src/Infrastructure/Migrations/20240110173852_ProfessionToSalaryProperty.Designer.cs
+++ b/src/Infrastructure/Migrations/20240110173852_ProfessionToSalaryProperty.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240110173852_ProfessionToSalaryProperty.cs b/src/Infrastructure/Migrations/20240110173852_ProfessionToSalaryProperty.cs
index b3dd15f5..39c2bb31 100644
--- a/src/Infrastructure/Migrations/20240110173852_ProfessionToSalaryProperty.cs
+++ b/src/Infrastructure/Migrations/20240110173852_ProfessionToSalaryProperty.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240115161149_GradePropRename.Designer.cs b/src/Infrastructure/Migrations/20240115161149_GradePropRename.Designer.cs
index e4e91a95..55eb280a 100644
--- a/src/Infrastructure/Migrations/20240115161149_GradePropRename.Designer.cs
+++ b/src/Infrastructure/Migrations/20240115161149_GradePropRename.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240115161149_GradePropRename.cs b/src/Infrastructure/Migrations/20240115161149_GradePropRename.cs
index 85ffbe73..860fd825 100644
--- a/src/Infrastructure/Migrations/20240115161149_GradePropRename.cs
+++ b/src/Infrastructure/Migrations/20240115161149_GradePropRename.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240121123643_SkillEntityAdded.Designer.cs b/src/Infrastructure/Migrations/20240121123643_SkillEntityAdded.Designer.cs
index 278df333..e762b127 100644
--- a/src/Infrastructure/Migrations/20240121123643_SkillEntityAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20240121123643_SkillEntityAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240121123643_SkillEntityAdded.cs b/src/Infrastructure/Migrations/20240121123643_SkillEntityAdded.cs
index e285e99e..58a52196 100644
--- a/src/Infrastructure/Migrations/20240121123643_SkillEntityAdded.cs
+++ b/src/Infrastructure/Migrations/20240121123643_SkillEntityAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240125014654_ShowInStatsProperty.Designer.cs b/src/Infrastructure/Migrations/20240125014654_ShowInStatsProperty.Designer.cs
index 886932b5..4276d654 100644
--- a/src/Infrastructure/Migrations/20240125014654_ShowInStatsProperty.Designer.cs
+++ b/src/Infrastructure/Migrations/20240125014654_ShowInStatsProperty.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240125014654_ShowInStatsProperty.cs b/src/Infrastructure/Migrations/20240125014654_ShowInStatsProperty.cs
index 944fd518..0a9d3c52 100644
--- a/src/Infrastructure/Migrations/20240125014654_ShowInStatsProperty.cs
+++ b/src/Infrastructure/Migrations/20240125014654_ShowInStatsProperty.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240131040940_CityPropertyToSalaryAdded.Designer.cs b/src/Infrastructure/Migrations/20240131040940_CityPropertyToSalaryAdded.Designer.cs
index 09be0b33..5b7cf0e5 100644
--- a/src/Infrastructure/Migrations/20240131040940_CityPropertyToSalaryAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20240131040940_CityPropertyToSalaryAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240131040940_CityPropertyToSalaryAdded.cs b/src/Infrastructure/Migrations/20240131040940_CityPropertyToSalaryAdded.cs
index 4fcb6f92..014db7d1 100644
--- a/src/Infrastructure/Migrations/20240131040940_CityPropertyToSalaryAdded.cs
+++ b/src/Infrastructure/Migrations/20240131040940_CityPropertyToSalaryAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240215172706_WorkIndustryEntityAdded.Designer.cs b/src/Infrastructure/Migrations/20240215172706_WorkIndustryEntityAdded.Designer.cs
index 0a9b8a0c..400f8680 100644
--- a/src/Infrastructure/Migrations/20240215172706_WorkIndustryEntityAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20240215172706_WorkIndustryEntityAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240215172706_WorkIndustryEntityAdded.cs b/src/Infrastructure/Migrations/20240215172706_WorkIndustryEntityAdded.cs
index 3806d80f..289e201f 100644
--- a/src/Infrastructure/Migrations/20240215172706_WorkIndustryEntityAdded.cs
+++ b/src/Infrastructure/Migrations/20240215172706_WorkIndustryEntityAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20240221142805_RemovedOrganizationRelatedEntities.Designer.cs b/src/Infrastructure/Migrations/20240221142805_RemovedOrganizationRelatedEntities.Designer.cs
index 88cb5fe9..40413bd5 100644
--- a/src/Infrastructure/Migrations/20240221142805_RemovedOrganizationRelatedEntities.Designer.cs
+++ b/src/Infrastructure/Migrations/20240221142805_RemovedOrganizationRelatedEntities.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240221142805_RemovedOrganizationRelatedEntities.cs b/src/Infrastructure/Migrations/20240221142805_RemovedOrganizationRelatedEntities.cs
index 3f8e50b8..bc427be8 100644
--- a/src/Infrastructure/Migrations/20240221142805_RemovedOrganizationRelatedEntities.cs
+++ b/src/Infrastructure/Migrations/20240221142805_RemovedOrganizationRelatedEntities.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20240224045729_ProfessionAsEntity.Designer.cs b/src/Infrastructure/Migrations/20240224045729_ProfessionAsEntity.Designer.cs
index cd955afb..ec6734ee 100644
--- a/src/Infrastructure/Migrations/20240224045729_ProfessionAsEntity.Designer.cs
+++ b/src/Infrastructure/Migrations/20240224045729_ProfessionAsEntity.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240224045729_ProfessionAsEntity.cs b/src/Infrastructure/Migrations/20240224045729_ProfessionAsEntity.cs
index f46e1536..935328c3 100644
--- a/src/Infrastructure/Migrations/20240224045729_ProfessionAsEntity.cs
+++ b/src/Infrastructure/Migrations/20240224045729_ProfessionAsEntity.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240229144942_SalaryGenderAndYearsOfExperienceProps.Designer.cs b/src/Infrastructure/Migrations/20240229144942_SalaryGenderAndYearsOfExperienceProps.Designer.cs
index d376c908..77c6deb9 100644
--- a/src/Infrastructure/Migrations/20240229144942_SalaryGenderAndYearsOfExperienceProps.Designer.cs
+++ b/src/Infrastructure/Migrations/20240229144942_SalaryGenderAndYearsOfExperienceProps.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240229144942_SalaryGenderAndYearsOfExperienceProps.cs b/src/Infrastructure/Migrations/20240229144942_SalaryGenderAndYearsOfExperienceProps.cs
index 375e6701..f6498e9d 100644
--- a/src/Infrastructure/Migrations/20240229144942_SalaryGenderAndYearsOfExperienceProps.cs
+++ b/src/Infrastructure/Migrations/20240229144942_SalaryGenderAndYearsOfExperienceProps.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240229150556_SalaryAgeProperty.Designer.cs b/src/Infrastructure/Migrations/20240229150556_SalaryAgeProperty.Designer.cs
index 7b95b7cc..b0305467 100644
--- a/src/Infrastructure/Migrations/20240229150556_SalaryAgeProperty.Designer.cs
+++ b/src/Infrastructure/Migrations/20240229150556_SalaryAgeProperty.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240229150556_SalaryAgeProperty.cs b/src/Infrastructure/Migrations/20240229150556_SalaryAgeProperty.cs
index 9aa54d8a..ab481589 100644
--- a/src/Infrastructure/Migrations/20240229150556_SalaryAgeProperty.cs
+++ b/src/Infrastructure/Migrations/20240229150556_SalaryAgeProperty.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240321162702_TelegramBotUsageAdded.Designer.cs b/src/Infrastructure/Migrations/20240321162702_TelegramBotUsageAdded.Designer.cs
index 5f7cfb23..06a88ee8 100644
--- a/src/Infrastructure/Migrations/20240321162702_TelegramBotUsageAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20240321162702_TelegramBotUsageAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240321162702_TelegramBotUsageAdded.cs b/src/Infrastructure/Migrations/20240321162702_TelegramBotUsageAdded.cs
index 390ec9df..d96e0bfb 100644
--- a/src/Infrastructure/Migrations/20240321162702_TelegramBotUsageAdded.cs
+++ b/src/Infrastructure/Migrations/20240321162702_TelegramBotUsageAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240321174500_TelegramBotUsageReceivedMessageTextProp.Designer.cs b/src/Infrastructure/Migrations/20240321174500_TelegramBotUsageReceivedMessageTextProp.Designer.cs
index 3973ddfe..f5300be1 100644
--- a/src/Infrastructure/Migrations/20240321174500_TelegramBotUsageReceivedMessageTextProp.Designer.cs
+++ b/src/Infrastructure/Migrations/20240321174500_TelegramBotUsageReceivedMessageTextProp.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240321174500_TelegramBotUsageReceivedMessageTextProp.cs b/src/Infrastructure/Migrations/20240321174500_TelegramBotUsageReceivedMessageTextProp.cs
index f5f9b219..ce9861fb 100644
--- a/src/Infrastructure/Migrations/20240321174500_TelegramBotUsageReceivedMessageTextProp.cs
+++ b/src/Infrastructure/Migrations/20240321174500_TelegramBotUsageReceivedMessageTextProp.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240328122810_UserCsvDownloadEntityAdded.Designer.cs b/src/Infrastructure/Migrations/20240328122810_UserCsvDownloadEntityAdded.Designer.cs
index 502b3c18..4c193efe 100644
--- a/src/Infrastructure/Migrations/20240328122810_UserCsvDownloadEntityAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20240328122810_UserCsvDownloadEntityAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240328122810_UserCsvDownloadEntityAdded.cs b/src/Infrastructure/Migrations/20240328122810_UserCsvDownloadEntityAdded.cs
index f7b5364f..23615720 100644
--- a/src/Infrastructure/Migrations/20240328122810_UserCsvDownloadEntityAdded.cs
+++ b/src/Infrastructure/Migrations/20240328122810_UserCsvDownloadEntityAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
diff --git a/src/Infrastructure/Migrations/20240430171902_SalairesSurveyEntitiesAdded.Designer.cs b/src/Infrastructure/Migrations/20240430171902_SalairesSurveyEntitiesAdded.Designer.cs
index 08f40dd7..340a10ae 100644
--- a/src/Infrastructure/Migrations/20240430171902_SalairesSurveyEntitiesAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20240430171902_SalairesSurveyEntitiesAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240430171902_SalairesSurveyEntitiesAdded.cs b/src/Infrastructure/Migrations/20240430171902_SalairesSurveyEntitiesAdded.cs
index 859e0476..982bc1de 100644
--- a/src/Infrastructure/Migrations/20240430171902_SalairesSurveyEntitiesAdded.cs
+++ b/src/Infrastructure/Migrations/20240430171902_SalairesSurveyEntitiesAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240505050837_AdjustedSurveyProps.Designer.cs b/src/Infrastructure/Migrations/20240505050837_AdjustedSurveyProps.Designer.cs
index 8f32938c..3ea992b4 100644
--- a/src/Infrastructure/Migrations/20240505050837_AdjustedSurveyProps.Designer.cs
+++ b/src/Infrastructure/Migrations/20240505050837_AdjustedSurveyProps.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240505050837_AdjustedSurveyProps.cs b/src/Infrastructure/Migrations/20240505050837_AdjustedSurveyProps.cs
index 65bfecbb..448d0cb0 100644
--- a/src/Infrastructure/Migrations/20240505050837_AdjustedSurveyProps.cs
+++ b/src/Infrastructure/Migrations/20240505050837_AdjustedSurveyProps.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240524120258_InterviewLimitationsIncrease.Designer.cs b/src/Infrastructure/Migrations/20240524120258_InterviewLimitationsIncrease.Designer.cs
index dcadcb41..ea6032bf 100644
--- a/src/Infrastructure/Migrations/20240524120258_InterviewLimitationsIncrease.Designer.cs
+++ b/src/Infrastructure/Migrations/20240524120258_InterviewLimitationsIncrease.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240524120258_InterviewLimitationsIncrease.cs b/src/Infrastructure/Migrations/20240524120258_InterviewLimitationsIncrease.cs
index e78f11dd..c1b8613c 100644
--- a/src/Infrastructure/Migrations/20240524120258_InterviewLimitationsIncrease.cs
+++ b/src/Infrastructure/Migrations/20240524120258_InterviewLimitationsIncrease.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240529044640_ShareLinkEntity.Designer.cs b/src/Infrastructure/Migrations/20240529044640_ShareLinkEntity.Designer.cs
index 0a94419a..0818a77e 100644
--- a/src/Infrastructure/Migrations/20240529044640_ShareLinkEntity.Designer.cs
+++ b/src/Infrastructure/Migrations/20240529044640_ShareLinkEntity.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240529044640_ShareLinkEntity.cs b/src/Infrastructure/Migrations/20240529044640_ShareLinkEntity.cs
index b9b1de1d..8573422e 100644
--- a/src/Infrastructure/Migrations/20240529044640_ShareLinkEntity.cs
+++ b/src/Infrastructure/Migrations/20240529044640_ShareLinkEntity.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20240621183209_TelegramUserSettingsEntity.Designer.cs b/src/Infrastructure/Migrations/20240621183209_TelegramUserSettingsEntity.Designer.cs
index 6fe32818..02102678 100644
--- a/src/Infrastructure/Migrations/20240621183209_TelegramUserSettingsEntity.Designer.cs
+++ b/src/Infrastructure/Migrations/20240621183209_TelegramUserSettingsEntity.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240621183209_TelegramUserSettingsEntity.cs b/src/Infrastructure/Migrations/20240621183209_TelegramUserSettingsEntity.cs
index 24efc5a9..6af07d38 100644
--- a/src/Infrastructure/Migrations/20240621183209_TelegramUserSettingsEntity.cs
+++ b/src/Infrastructure/Migrations/20240621183209_TelegramUserSettingsEntity.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
diff --git a/src/Infrastructure/Migrations/20240627122530_SalarySourceTypePropertyAdded.Designer.cs b/src/Infrastructure/Migrations/20240627122530_SalarySourceTypePropertyAdded.Designer.cs
index 379bc1cb..6aa8ad11 100644
--- a/src/Infrastructure/Migrations/20240627122530_SalarySourceTypePropertyAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20240627122530_SalarySourceTypePropertyAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240627122530_SalarySourceTypePropertyAdded.cs b/src/Infrastructure/Migrations/20240627122530_SalarySourceTypePropertyAdded.cs
index f9ff3dc8..4ce48157 100644
--- a/src/Infrastructure/Migrations/20240627122530_SalarySourceTypePropertyAdded.cs
+++ b/src/Infrastructure/Migrations/20240627122530_SalarySourceTypePropertyAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240910130233_StatDataCacheEntities.Designer.cs b/src/Infrastructure/Migrations/20240910130233_StatDataCacheEntities.Designer.cs
index 30b2a909..8c20142c 100644
--- a/src/Infrastructure/Migrations/20240910130233_StatDataCacheEntities.Designer.cs
+++ b/src/Infrastructure/Migrations/20240910130233_StatDataCacheEntities.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240910130233_StatDataCacheEntities.cs b/src/Infrastructure/Migrations/20240910130233_StatDataCacheEntities.cs
index e904dced..409de52c 100644
--- a/src/Infrastructure/Migrations/20240910130233_StatDataCacheEntities.cs
+++ b/src/Infrastructure/Migrations/20240910130233_StatDataCacheEntities.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240910175518_StatDataCacheOneToMany.Designer.cs b/src/Infrastructure/Migrations/20240910175518_StatDataCacheOneToMany.Designer.cs
index 10b22e7d..1f39a6db 100644
--- a/src/Infrastructure/Migrations/20240910175518_StatDataCacheOneToMany.Designer.cs
+++ b/src/Infrastructure/Migrations/20240910175518_StatDataCacheOneToMany.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240910175518_StatDataCacheOneToMany.cs b/src/Infrastructure/Migrations/20240910175518_StatDataCacheOneToMany.cs
index 6a2d70df..e8717006 100644
--- a/src/Infrastructure/Migrations/20240910175518_StatDataCacheOneToMany.cs
+++ b/src/Infrastructure/Migrations/20240910175518_StatDataCacheOneToMany.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20240911183427_StatDataEntitiesAddedAgain.Designer.cs b/src/Infrastructure/Migrations/20240911183427_StatDataEntitiesAddedAgain.Designer.cs
index 024be819..1cc2d3b4 100644
--- a/src/Infrastructure/Migrations/20240911183427_StatDataEntitiesAddedAgain.Designer.cs
+++ b/src/Infrastructure/Migrations/20240911183427_StatDataEntitiesAddedAgain.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20240911183427_StatDataEntitiesAddedAgain.cs b/src/Infrastructure/Migrations/20240911183427_StatDataEntitiesAddedAgain.cs
index c3343558..92ead3f0 100644
--- a/src/Infrastructure/Migrations/20240911183427_StatDataEntitiesAddedAgain.cs
+++ b/src/Infrastructure/Migrations/20240911183427_StatDataEntitiesAddedAgain.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250127170826_UserTotpFieldsAdded.Designer.cs b/src/Infrastructure/Migrations/20250127170826_UserTotpFieldsAdded.Designer.cs
index 22533e9c..38390fdf 100644
--- a/src/Infrastructure/Migrations/20250127170826_UserTotpFieldsAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250127170826_UserTotpFieldsAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250127170826_UserTotpFieldsAdded.cs b/src/Infrastructure/Migrations/20250127170826_UserTotpFieldsAdded.cs
index 3b5f3aff..7a5c06ae 100644
--- a/src/Infrastructure/Migrations/20250127170826_UserTotpFieldsAdded.cs
+++ b/src/Infrastructure/Migrations/20250127170826_UserTotpFieldsAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250214101618_UsefulnessRatingPropertyAdded.Designer.cs b/src/Infrastructure/Migrations/20250214101618_UsefulnessRatingPropertyAdded.Designer.cs
index 5721d7a7..f1fa4dc5 100644
--- a/src/Infrastructure/Migrations/20250214101618_UsefulnessRatingPropertyAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250214101618_UsefulnessRatingPropertyAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250214101618_UsefulnessRatingPropertyAdded.cs b/src/Infrastructure/Migrations/20250214101618_UsefulnessRatingPropertyAdded.cs
index 661448f2..96a3a40d 100644
--- a/src/Infrastructure/Migrations/20250214101618_UsefulnessRatingPropertyAdded.cs
+++ b/src/Infrastructure/Migrations/20250214101618_UsefulnessRatingPropertyAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250423155910_PreventNotificationIfNoDifferencePropAdded.Designer.cs b/src/Infrastructure/Migrations/20250423155910_PreventNotificationIfNoDifferencePropAdded.Designer.cs
index d672cee0..ae4aca33 100644
--- a/src/Infrastructure/Migrations/20250423155910_PreventNotificationIfNoDifferencePropAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250423155910_PreventNotificationIfNoDifferencePropAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250423155910_PreventNotificationIfNoDifferencePropAdded.cs b/src/Infrastructure/Migrations/20250423155910_PreventNotificationIfNoDifferencePropAdded.cs
index bf48b533..57ddb5e4 100644
--- a/src/Infrastructure/Migrations/20250423155910_PreventNotificationIfNoDifferencePropAdded.cs
+++ b/src/Infrastructure/Migrations/20250423155910_PreventNotificationIfNoDifferencePropAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250427043948_CompanyEntitiesAdded.Designer.cs b/src/Infrastructure/Migrations/20250427043948_CompanyEntitiesAdded.Designer.cs
index 7304d141..1a0830f9 100644
--- a/src/Infrastructure/Migrations/20250427043948_CompanyEntitiesAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250427043948_CompanyEntitiesAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250427043948_CompanyEntitiesAdded.cs b/src/Infrastructure/Migrations/20250427043948_CompanyEntitiesAdded.cs
index a3e59cbc..4910f190 100644
--- a/src/Infrastructure/Migrations/20250427043948_CompanyEntitiesAdded.cs
+++ b/src/Infrastructure/Migrations/20250427043948_CompanyEntitiesAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250505145256_AiAnalysisEntityAdded.Designer.cs b/src/Infrastructure/Migrations/20250505145256_AiAnalysisEntityAdded.Designer.cs
index 5f0d4125..a0ddf0ba 100644
--- a/src/Infrastructure/Migrations/20250505145256_AiAnalysisEntityAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250505145256_AiAnalysisEntityAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250505145256_AiAnalysisEntityAdded.cs b/src/Infrastructure/Migrations/20250505145256_AiAnalysisEntityAdded.cs
index 8d29e46a..a6da4303 100644
--- a/src/Infrastructure/Migrations/20250505145256_AiAnalysisEntityAdded.cs
+++ b/src/Infrastructure/Migrations/20250505145256_AiAnalysisEntityAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250507115524_MessageSentBySubscriptionNewEntity.Designer.cs b/src/Infrastructure/Migrations/20250507115524_MessageSentBySubscriptionNewEntity.Designer.cs
index d4d6ba1a..d0f84d9e 100644
--- a/src/Infrastructure/Migrations/20250507115524_MessageSentBySubscriptionNewEntity.Designer.cs
+++ b/src/Infrastructure/Migrations/20250507115524_MessageSentBySubscriptionNewEntity.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250507115524_MessageSentBySubscriptionNewEntity.cs b/src/Infrastructure/Migrations/20250507115524_MessageSentBySubscriptionNewEntity.cs
index c204b2fc..8ee8ec69 100644
--- a/src/Infrastructure/Migrations/20250507115524_MessageSentBySubscriptionNewEntity.cs
+++ b/src/Infrastructure/Migrations/20250507115524_MessageSentBySubscriptionNewEntity.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250510022149_TelegramBotUsageChatIdProperty.Designer.cs b/src/Infrastructure/Migrations/20250510022149_TelegramBotUsageChatIdProperty.Designer.cs
index 94298255..a7a21b75 100644
--- a/src/Infrastructure/Migrations/20250510022149_TelegramBotUsageChatIdProperty.Designer.cs
+++ b/src/Infrastructure/Migrations/20250510022149_TelegramBotUsageChatIdProperty.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250510022149_TelegramBotUsageChatIdProperty.cs b/src/Infrastructure/Migrations/20250510022149_TelegramBotUsageChatIdProperty.cs
index 13dbe5ed..86598893 100644
--- a/src/Infrastructure/Migrations/20250510022149_TelegramBotUsageChatIdProperty.cs
+++ b/src/Infrastructure/Migrations/20250510022149_TelegramBotUsageChatIdProperty.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250510074704_TelegramBotUsagesChatPropsChanged.Designer.cs b/src/Infrastructure/Migrations/20250510074704_TelegramBotUsagesChatPropsChanged.Designer.cs
index 7bbfc6dd..da92f77b 100644
--- a/src/Infrastructure/Migrations/20250510074704_TelegramBotUsagesChatPropsChanged.Designer.cs
+++ b/src/Infrastructure/Migrations/20250510074704_TelegramBotUsagesChatPropsChanged.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250510074704_TelegramBotUsagesChatPropsChanged.cs b/src/Infrastructure/Migrations/20250510074704_TelegramBotUsagesChatPropsChanged.cs
index b2a766aa..2a74417d 100644
--- a/src/Infrastructure/Migrations/20250510074704_TelegramBotUsagesChatPropsChanged.cs
+++ b/src/Infrastructure/Migrations/20250510074704_TelegramBotUsagesChatPropsChanged.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250510083933_TelegramBotInlineUsageNewEntity.Designer.cs b/src/Infrastructure/Migrations/20250510083933_TelegramBotInlineUsageNewEntity.Designer.cs
index 76205426..7cd29012 100644
--- a/src/Infrastructure/Migrations/20250510083933_TelegramBotInlineUsageNewEntity.Designer.cs
+++ b/src/Infrastructure/Migrations/20250510083933_TelegramBotInlineUsageNewEntity.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250510083933_TelegramBotInlineUsageNewEntity.cs b/src/Infrastructure/Migrations/20250510083933_TelegramBotInlineUsageNewEntity.cs
index 123fc7a8..97016448 100644
--- a/src/Infrastructure/Migrations/20250510083933_TelegramBotInlineUsageNewEntity.cs
+++ b/src/Infrastructure/Migrations/20250510083933_TelegramBotInlineUsageNewEntity.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250510133316_UserProfilePicturePropertyAdded.Designer.cs b/src/Infrastructure/Migrations/20250510133316_UserProfilePicturePropertyAdded.Designer.cs
index 4d7d41a9..8f44da0a 100644
--- a/src/Infrastructure/Migrations/20250510133316_UserProfilePicturePropertyAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250510133316_UserProfilePicturePropertyAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250510133316_UserProfilePicturePropertyAdded.cs b/src/Infrastructure/Migrations/20250510133316_UserProfilePicturePropertyAdded.cs
index cf88a5c0..76d24e2e 100644
--- a/src/Infrastructure/Migrations/20250510133316_UserProfilePicturePropertyAdded.cs
+++ b/src/Infrastructure/Migrations/20250510133316_UserProfilePicturePropertyAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250510145709_TelegramInlineUsageReplyPropsAdjusted.Designer.cs b/src/Infrastructure/Migrations/20250510145709_TelegramInlineUsageReplyPropsAdjusted.Designer.cs
index 09ded1d6..b8aadfa3 100644
--- a/src/Infrastructure/Migrations/20250510145709_TelegramInlineUsageReplyPropsAdjusted.Designer.cs
+++ b/src/Infrastructure/Migrations/20250510145709_TelegramInlineUsageReplyPropsAdjusted.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250510145709_TelegramInlineUsageReplyPropsAdjusted.cs b/src/Infrastructure/Migrations/20250510145709_TelegramInlineUsageReplyPropsAdjusted.cs
index c8d3d9e1..f1099b59 100644
--- a/src/Infrastructure/Migrations/20250510145709_TelegramInlineUsageReplyPropsAdjusted.cs
+++ b/src/Infrastructure/Migrations/20250510145709_TelegramInlineUsageReplyPropsAdjusted.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250511153053_CompanyViewsCountPropertyAdded.Designer.cs b/src/Infrastructure/Migrations/20250511153053_CompanyViewsCountPropertyAdded.Designer.cs
index 2fd24650..35f6f013 100644
--- a/src/Infrastructure/Migrations/20250511153053_CompanyViewsCountPropertyAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250511153053_CompanyViewsCountPropertyAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250511153053_CompanyViewsCountPropertyAdded.cs b/src/Infrastructure/Migrations/20250511153053_CompanyViewsCountPropertyAdded.cs
index 76766e1b..7135018b 100644
--- a/src/Infrastructure/Migrations/20250511153053_CompanyViewsCountPropertyAdded.cs
+++ b/src/Infrastructure/Migrations/20250511153053_CompanyViewsCountPropertyAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250513154615_CompanySlugPropertyAdded.Designer.cs b/src/Infrastructure/Migrations/20250513154615_CompanySlugPropertyAdded.Designer.cs
index 2699f159..e319c7f8 100644
--- a/src/Infrastructure/Migrations/20250513154615_CompanySlugPropertyAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250513154615_CompanySlugPropertyAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250513154615_CompanySlugPropertyAdded.cs b/src/Infrastructure/Migrations/20250513154615_CompanySlugPropertyAdded.cs
index 77999265..857449b9 100644
--- a/src/Infrastructure/Migrations/20250513154615_CompanySlugPropertyAdded.cs
+++ b/src/Infrastructure/Migrations/20250513154615_CompanySlugPropertyAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250521130714_SubscriptionRegularityPropAdded.Designer.cs b/src/Infrastructure/Migrations/20250521130714_SubscriptionRegularityPropAdded.Designer.cs
index a9438e58..ee6b7e14 100644
--- a/src/Infrastructure/Migrations/20250521130714_SubscriptionRegularityPropAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250521130714_SubscriptionRegularityPropAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250521130714_SubscriptionRegularityPropAdded.cs b/src/Infrastructure/Migrations/20250521130714_SubscriptionRegularityPropAdded.cs
index 927e430c..f971b291 100644
--- a/src/Infrastructure/Migrations/20250521130714_SubscriptionRegularityPropAdded.cs
+++ b/src/Infrastructure/Migrations/20250521130714_SubscriptionRegularityPropAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250522025014_ReviewsVoteEntitiesAdded.Designer.cs b/src/Infrastructure/Migrations/20250522025014_ReviewsVoteEntitiesAdded.Designer.cs
index 9891e8be..dab51a7c 100644
--- a/src/Infrastructure/Migrations/20250522025014_ReviewsVoteEntitiesAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250522025014_ReviewsVoteEntitiesAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250522025014_ReviewsVoteEntitiesAdded.cs b/src/Infrastructure/Migrations/20250522025014_ReviewsVoteEntitiesAdded.cs
index 0143cc03..9cfe5036 100644
--- a/src/Infrastructure/Migrations/20250522025014_ReviewsVoteEntitiesAdded.cs
+++ b/src/Infrastructure/Migrations/20250522025014_ReviewsVoteEntitiesAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250530095004_UserUniqueTokenAdded.Designer.cs b/src/Infrastructure/Migrations/20250530095004_UserUniqueTokenAdded.Designer.cs
index a078cd8f..0a66010f 100644
--- a/src/Infrastructure/Migrations/20250530095004_UserUniqueTokenAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250530095004_UserUniqueTokenAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250530095004_UserUniqueTokenAdded.cs b/src/Infrastructure/Migrations/20250530095004_UserUniqueTokenAdded.cs
index 7428af17..3e06551a 100644
--- a/src/Infrastructure/Migrations/20250530095004_UserUniqueTokenAdded.cs
+++ b/src/Infrastructure/Migrations/20250530095004_UserUniqueTokenAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250531062240_UserEmailEntityAdded.Designer.cs b/src/Infrastructure/Migrations/20250531062240_UserEmailEntityAdded.Designer.cs
index 9c7def6d..e39568f7 100644
--- a/src/Infrastructure/Migrations/20250531062240_UserEmailEntityAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250531062240_UserEmailEntityAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250531062240_UserEmailEntityAdded.cs b/src/Infrastructure/Migrations/20250531062240_UserEmailEntityAdded.cs
index c514170f..15a723b7 100644
--- a/src/Infrastructure/Migrations/20250531062240_UserEmailEntityAdded.cs
+++ b/src/Infrastructure/Migrations/20250531062240_UserEmailEntityAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250619084441_GithubProfileRelatedEntitiesAdded.Designer.cs b/src/Infrastructure/Migrations/20250619084441_GithubProfileRelatedEntitiesAdded.Designer.cs
index 34c10003..4ba993fc 100644
--- a/src/Infrastructure/Migrations/20250619084441_GithubProfileRelatedEntitiesAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250619084441_GithubProfileRelatedEntitiesAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250619084441_GithubProfileRelatedEntitiesAdded.cs b/src/Infrastructure/Migrations/20250619084441_GithubProfileRelatedEntitiesAdded.cs
index 2e997c09..40b28718 100644
--- a/src/Infrastructure/Migrations/20250619084441_GithubProfileRelatedEntitiesAdded.cs
+++ b/src/Infrastructure/Migrations/20250619084441_GithubProfileRelatedEntitiesAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250629120857_OpenAiEntitiesAdded.Designer.cs b/src/Infrastructure/Migrations/20250629120857_OpenAiEntitiesAdded.Designer.cs
index 798ffa88..c46be2b5 100644
--- a/src/Infrastructure/Migrations/20250629120857_OpenAiEntitiesAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250629120857_OpenAiEntitiesAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250629120857_OpenAiEntitiesAdded.cs b/src/Infrastructure/Migrations/20250629120857_OpenAiEntitiesAdded.cs
index 991e9f71..c8455d4d 100644
--- a/src/Infrastructure/Migrations/20250629120857_OpenAiEntitiesAdded.cs
+++ b/src/Infrastructure/Migrations/20250629120857_OpenAiEntitiesAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20250629163723_OpenAiModelPropertyAdded.Designer.cs b/src/Infrastructure/Migrations/20250629163723_OpenAiModelPropertyAdded.Designer.cs
index c0f16cab..83aa920b 100644
--- a/src/Infrastructure/Migrations/20250629163723_OpenAiModelPropertyAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250629163723_OpenAiModelPropertyAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250629163723_OpenAiModelPropertyAdded.cs b/src/Infrastructure/Migrations/20250629163723_OpenAiModelPropertyAdded.cs
index b75c58ca..f09fd008 100644
--- a/src/Infrastructure/Migrations/20250629163723_OpenAiModelPropertyAdded.cs
+++ b/src/Infrastructure/Migrations/20250629163723_OpenAiModelPropertyAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250702041152_OpenAiModelEnginePropertyAdded.Designer.cs b/src/Infrastructure/Migrations/20250702041152_OpenAiModelEnginePropertyAdded.Designer.cs
index 11b2248e..39596c96 100644
--- a/src/Infrastructure/Migrations/20250702041152_OpenAiModelEnginePropertyAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250702041152_OpenAiModelEnginePropertyAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250702041152_OpenAiModelEnginePropertyAdded.cs b/src/Infrastructure/Migrations/20250702041152_OpenAiModelEnginePropertyAdded.cs
index 5468fc68..f365c38d 100644
--- a/src/Infrastructure/Migrations/20250702041152_OpenAiModelEnginePropertyAdded.cs
+++ b/src/Infrastructure/Migrations/20250702041152_OpenAiModelEnginePropertyAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250702155041_OpenAipromptAdjusted.Designer.cs b/src/Infrastructure/Migrations/20250702155041_OpenAipromptAdjusted.Designer.cs
index 60dcea94..79f7454e 100644
--- a/src/Infrastructure/Migrations/20250702155041_OpenAipromptAdjusted.Designer.cs
+++ b/src/Infrastructure/Migrations/20250702155041_OpenAipromptAdjusted.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250702155041_OpenAipromptAdjusted.cs b/src/Infrastructure/Migrations/20250702155041_OpenAipromptAdjusted.cs
index c215c6ef..78ab5cf6 100644
--- a/src/Infrastructure/Migrations/20250702155041_OpenAipromptAdjusted.cs
+++ b/src/Infrastructure/Migrations/20250702155041_OpenAipromptAdjusted.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20250703181949_SalariesBotEntitiesSimplified.Designer.cs b/src/Infrastructure/Migrations/20250703181949_SalariesBotEntitiesSimplified.Designer.cs
index 3575bb07..adb0209c 100644
--- a/src/Infrastructure/Migrations/20250703181949_SalariesBotEntitiesSimplified.Designer.cs
+++ b/src/Infrastructure/Migrations/20250703181949_SalariesBotEntitiesSimplified.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250703181949_SalariesBotEntitiesSimplified.cs b/src/Infrastructure/Migrations/20250703181949_SalariesBotEntitiesSimplified.cs
index 8a25eb11..7ebb82a8 100644
--- a/src/Infrastructure/Migrations/20250703181949_SalariesBotEntitiesSimplified.cs
+++ b/src/Infrastructure/Migrations/20250703181949_SalariesBotEntitiesSimplified.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
diff --git a/src/Infrastructure/Migrations/20250704124312_UnnecessaryIndexRemoved.Designer.cs b/src/Infrastructure/Migrations/20250704124312_UnnecessaryIndexRemoved.Designer.cs
index da2ba50f..13999f62 100644
--- a/src/Infrastructure/Migrations/20250704124312_UnnecessaryIndexRemoved.Designer.cs
+++ b/src/Infrastructure/Migrations/20250704124312_UnnecessaryIndexRemoved.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250704124312_UnnecessaryIndexRemoved.cs b/src/Infrastructure/Migrations/20250704124312_UnnecessaryIndexRemoved.cs
index 00d5dd8d..9f17461f 100644
--- a/src/Infrastructure/Migrations/20250704124312_UnnecessaryIndexRemoved.cs
+++ b/src/Infrastructure/Migrations/20250704124312_UnnecessaryIndexRemoved.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250704175955_AddedTelegramReplyQuery.Designer.cs b/src/Infrastructure/Migrations/20250704175955_AddedTelegramReplyQuery.Designer.cs
index 2af254cb..5cf13730 100644
--- a/src/Infrastructure/Migrations/20250704175955_AddedTelegramReplyQuery.Designer.cs
+++ b/src/Infrastructure/Migrations/20250704175955_AddedTelegramReplyQuery.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250704175955_AddedTelegramReplyQuery.cs b/src/Infrastructure/Migrations/20250704175955_AddedTelegramReplyQuery.cs
index 3d0a4525..92b5eae0 100644
--- a/src/Infrastructure/Migrations/20250704175955_AddedTelegramReplyQuery.cs
+++ b/src/Infrastructure/Migrations/20250704175955_AddedTelegramReplyQuery.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250706080444_SalariesAiAnalysisRecordModelPropAdded.Designer.cs b/src/Infrastructure/Migrations/20250706080444_SalariesAiAnalysisRecordModelPropAdded.Designer.cs
index 481d9760..4e55187b 100644
--- a/src/Infrastructure/Migrations/20250706080444_SalariesAiAnalysisRecordModelPropAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250706080444_SalariesAiAnalysisRecordModelPropAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250706080444_SalariesAiAnalysisRecordModelPropAdded.cs b/src/Infrastructure/Migrations/20250706080444_SalariesAiAnalysisRecordModelPropAdded.cs
index 02db6e11..f672bde2 100644
--- a/src/Infrastructure/Migrations/20250706080444_SalariesAiAnalysisRecordModelPropAdded.cs
+++ b/src/Infrastructure/Migrations/20250706080444_SalariesAiAnalysisRecordModelPropAdded.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250708113852_CompanyReviewTgSubscriptionAdded.Designer.cs b/src/Infrastructure/Migrations/20250708113852_CompanyReviewTgSubscriptionAdded.Designer.cs
index f66cb6e4..efdff0f8 100644
--- a/src/Infrastructure/Migrations/20250708113852_CompanyReviewTgSubscriptionAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250708113852_CompanyReviewTgSubscriptionAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250708113852_CompanyReviewTgSubscriptionAdded.cs b/src/Infrastructure/Migrations/20250708113852_CompanyReviewTgSubscriptionAdded.cs
index 3fe21296..3ee67094 100644
--- a/src/Infrastructure/Migrations/20250708113852_CompanyReviewTgSubscriptionAdded.cs
+++ b/src/Infrastructure/Migrations/20250708113852_CompanyReviewTgSubscriptionAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250709012632_CompanyReviewTgSubscriptionRename.Designer.cs b/src/Infrastructure/Migrations/20250709012632_CompanyReviewTgSubscriptionRename.Designer.cs
index 2fede7f0..f91dddbb 100644
--- a/src/Infrastructure/Migrations/20250709012632_CompanyReviewTgSubscriptionRename.Designer.cs
+++ b/src/Infrastructure/Migrations/20250709012632_CompanyReviewTgSubscriptionRename.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250709012632_CompanyReviewTgSubscriptionRename.cs b/src/Infrastructure/Migrations/20250709012632_CompanyReviewTgSubscriptionRename.cs
index 04a7c47f..ebb84c5f 100644
--- a/src/Infrastructure/Migrations/20250709012632_CompanyReviewTgSubscriptionRename.cs
+++ b/src/Infrastructure/Migrations/20250709012632_CompanyReviewTgSubscriptionRename.cs
@@ -1,4 +1,4 @@
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20250721120627_JobPostingSubscriptionEntityAdded.Designer.cs b/src/Infrastructure/Migrations/20250721120627_JobPostingSubscriptionEntityAdded.Designer.cs
index 665ed7eb..64b4901a 100644
--- a/src/Infrastructure/Migrations/20250721120627_JobPostingSubscriptionEntityAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20250721120627_JobPostingSubscriptionEntityAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20250721120627_JobPostingSubscriptionEntityAdded.cs b/src/Infrastructure/Migrations/20250721120627_JobPostingSubscriptionEntityAdded.cs
index f0ffd549..5eb460cd 100644
--- a/src/Infrastructure/Migrations/20250721120627_JobPostingSubscriptionEntityAdded.cs
+++ b/src/Infrastructure/Migrations/20250721120627_JobPostingSubscriptionEntityAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20251226151311_SalariesHistoricalEntitiesAdded.Designer.cs b/src/Infrastructure/Migrations/20251226151311_SalariesHistoricalEntitiesAdded.Designer.cs
index 72305192..b93c4134 100644
--- a/src/Infrastructure/Migrations/20251226151311_SalariesHistoricalEntitiesAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20251226151311_SalariesHistoricalEntitiesAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20251226151311_SalariesHistoricalEntitiesAdded.cs b/src/Infrastructure/Migrations/20251226151311_SalariesHistoricalEntitiesAdded.cs
index 11cd8bc0..bede175b 100644
--- a/src/Infrastructure/Migrations/20251226151311_SalariesHistoricalEntitiesAdded.cs
+++ b/src/Infrastructure/Migrations/20251226151311_SalariesHistoricalEntitiesAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20260102102556_CurrencyCollectionEntityAdded.Designer.cs b/src/Infrastructure/Migrations/20260102102556_CurrencyCollectionEntityAdded.Designer.cs
index ccc03a89..da99009e 100644
--- a/src/Infrastructure/Migrations/20260102102556_CurrencyCollectionEntityAdded.Designer.cs
+++ b/src/Infrastructure/Migrations/20260102102556_CurrencyCollectionEntityAdded.Designer.cs
@@ -1,4 +1,4 @@
-//
+//
using System;
using Infrastructure.Database;
using Microsoft.EntityFrameworkCore;
diff --git a/src/Infrastructure/Migrations/20260102102556_CurrencyCollectionEntityAdded.cs b/src/Infrastructure/Migrations/20260102102556_CurrencyCollectionEntityAdded.cs
index 77bcdd18..1dd71aeb 100644
--- a/src/Infrastructure/Migrations/20260102102556_CurrencyCollectionEntityAdded.cs
+++ b/src/Infrastructure/Migrations/20260102102556_CurrencyCollectionEntityAdded.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
diff --git a/src/Infrastructure/Migrations/20260126174501_Auth0RemovedFromSystem.Designer.cs b/src/Infrastructure/Migrations/20260126174501_Auth0RemovedFromSystem.Designer.cs
new file mode 100644
index 00000000..7e6a98e3
--- /dev/null
+++ b/src/Infrastructure/Migrations/20260126174501_Auth0RemovedFromSystem.Designer.cs
@@ -0,0 +1,2183 @@
+//
+using System;
+using Infrastructure.Database;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Domain.Migrations
+{
+ [DbContext(typeof(DatabaseContext))]
+ [Migration("20260126174501_Auth0RemovedFromSystem")]
+ partial class Auth0RemovedFromSystem
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "10.0.1")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("Domain.Entities.Auth.M2mClient", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ClientId")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("ClientSecretHash")
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreatedByUserId")
+ .HasColumnType("bigint");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .HasMaxLength(1000)
+ .HasColumnType("character varying(1000)");
+
+ b.Property("IsActive")
+ .HasColumnType("boolean");
+
+ b.Property("LastUsedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("LastUsedIpAddress")
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("RateLimitPerDay")
+ .HasColumnType("integer");
+
+ b.Property("RateLimitPerMinute")
+ .HasColumnType("integer");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClientId")
+ .IsUnique();
+
+ b.HasIndex("CreatedByUserId");
+
+ b.HasIndex("Name");
+
+ b.ToTable("M2mClients");
+ });
+
+ modelBuilder.Entity("Domain.Entities.Auth.M2mClientScope", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("M2mClientId")
+ .HasColumnType("bigint");
+
+ b.Property("Scope")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("M2mClientId", "Scope")
+ .IsUnique();
+
+ b.ToTable("M2mClientScopes");
+ });
+
+ modelBuilder.Entity("Domain.Entities.Auth.RefreshToken", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DeviceInfo")
+ .HasMaxLength(500)
+ .HasColumnType("character varying(500)");
+
+ b.Property("ExpiresAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("IsRevoked")
+ .HasColumnType("boolean");
+
+ b.Property("Token")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ExpiresAt");
+
+ b.HasIndex("Token")
+ .IsUnique();
+
+ b.HasIndex("UserId");
+
+ b.ToTable("RefreshTokens");
+ });
+
+ modelBuilder.Entity("Domain.Entities.CSV.UserCsvDownload", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserId")
+ .HasColumnType("bigint");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("UserCsvDownloads", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Companies.Company", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DeletedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Links")
+ .HasColumnType("text");
+
+ b.Property("LogoUrl")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("NormalizedName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Rating")
+ .HasColumnType("double precision");
+
+ b.Property("ReviewsCount")
+ .HasColumnType("integer");
+
+ b.Property("Slug")
+ .HasColumnType("text");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ViewsCount")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName");
+
+ b.HasIndex("Slug")
+ .IsUnique();
+
+ b.ToTable("Companies", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Companies.CompanyOpenAiAnalysis", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AnalysisText")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("CompanyId")
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Model")
+ .HasColumnType("text");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompanyId");
+
+ b.ToTable("CompanyOpenAiAnalysisRecords", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Companies.CompanyRatingHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CompanyId")
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Rating")
+ .HasColumnType("double precision");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompanyId");
+
+ b.ToTable("CompanyRatingHistory", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Companies.CompanyReview", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("ApprovedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CareerOpportunities")
+ .HasColumnType("integer");
+
+ b.Property("CodeQuality")
+ .HasColumnType("integer");
+
+ b.Property("CompanyId")
+ .HasColumnType("uuid");
+
+ b.Property("CompensationAndBenefits")
+ .HasColumnType("integer");
+
+ b.Property("Cons")
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CultureAndValues")
+ .HasColumnType("integer");
+
+ b.Property("DislikesCount")
+ .HasColumnType("integer");
+
+ b.Property("IWorkHere")
+ .HasColumnType("boolean");
+
+ b.Property("LikesCount")
+ .HasColumnType("integer");
+
+ b.Property("Management")
+ .HasColumnType("integer");
+
+ b.Property("OutdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Pros")
+ .HasColumnType("text");
+
+ b.Property("TotalRating")
+ .HasColumnType("double precision");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UserEmployment")
+ .HasColumnType("integer");
+
+ b.Property("UserId")
+ .HasColumnType("bigint");
+
+ b.Property("WorkLifeBalance")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompanyId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("CompanyReviews", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Companies.CompanyReviewVote", b =>
+ {
+ b.Property("ReviewId")
+ .HasColumnType("uuid");
+
+ b.Property("UserId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("VoteType")
+ .HasColumnType("integer");
+
+ b.HasKey("ReviewId", "UserId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("CompanyReviewVotes");
+ });
+
+ modelBuilder.Entity("Domain.Entities.Currencies.CurrenciesCollection", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Currencies")
+ .HasColumnType("text");
+
+ b.Property("CurrencyDate")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CurrencyDate")
+ .IsUnique();
+
+ b.ToTable("CurrenciesCollections", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Github.GithubPersonalUserToken", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ExpiresAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Token")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("GithubPersonalUserTokens", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Github.GithubProfile", b =>
+ {
+ b.Property("Username")
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Data")
+ .HasColumnType("text");
+
+ b.Property("DataSyncedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("RequestsCount")
+ .HasColumnType("integer");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Version")
+ .HasColumnType("integer");
+
+ b.HasKey("Username");
+
+ b.ToTable("GithubProfiles", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Github.GithubProfileBotChat", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("ChatId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("IsAdmin")
+ .HasColumnType("boolean");
+
+ b.Property("MessagesCount")
+ .HasColumnType("integer");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Username")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ChatId")
+ .IsUnique();
+
+ b.ToTable("GithubProfileBotChats", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Github.GithubProfileBotMessage", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("GithubProfileBotChatId")
+ .HasColumnType("uuid");
+
+ b.Property("Text")
+ .HasColumnType("text");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("GithubProfileBotChatId");
+
+ b.ToTable("GithubProfileBotMessages", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Github.GithubProfileProcessingJob", b =>
+ {
+ b.Property("Username")
+ .HasColumnType("text");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Username");
+
+ b.ToTable("GithubProfileProcessingJobs", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.HistoricalRecords.SalariesHistoricalDataRecord", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Data")
+ .HasColumnType("text");
+
+ b.Property("Date")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("TemplateId")
+ .HasColumnType("uuid");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Date");
+
+ b.HasIndex("TemplateId");
+
+ b.ToTable("SalariesHistoricalDataRecords", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.HistoricalRecords.SalariesHistoricalDataRecordTemplate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("ProfessionIds")
+ .HasColumnType("text");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("SalariesHistoricalDataRecordTemplates", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Interviews.Interview", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CandidateGrade")
+ .HasColumnType("bigint");
+
+ b.Property("CandidateName")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("character varying(200)");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("InterviewerId")
+ .HasColumnType("bigint");
+
+ b.Property("OverallOpinion")
+ .HasMaxLength(50000)
+ .HasColumnType("character varying(50000)");
+
+ b.Property("Subjects")
+ .HasColumnType("text");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("InterviewerId");
+
+ b.ToTable("Interviews", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Interviews.InterviewTemplate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("AuthorId")
+ .HasColumnType("bigint");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("IsPublic")
+ .HasColumnType("boolean");
+
+ b.Property("OverallOpinion")
+ .HasMaxLength(50000)
+ .HasColumnType("character varying(50000)");
+
+ b.Property("Subjects")
+ .HasColumnType("text");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(150)
+ .HasColumnType("character varying(150)");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuthorId");
+
+ b.ToTable("InterviewTemplates", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Interviews.ShareLink", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("InterviewId")
+ .HasColumnType("uuid");
+
+ b.Property("ShareToken")
+ .HasColumnType("uuid");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("InterviewId")
+ .IsUnique();
+
+ b.ToTable("ShareLinks", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Labels.UserLabel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedById")
+ .HasColumnType("bigint");
+
+ b.Property("HexColor")
+ .IsRequired()
+ .HasMaxLength(7)
+ .HasColumnType("character varying(7)");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.ToTable("UserLabels", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Prompts.OpenAiPrompt", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Engine")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasDefaultValue(1);
+
+ b.Property("IsActive")
+ .HasColumnType("boolean");
+
+ b.Property("Model")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Prompt")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Type")
+ .HasColumnType("integer");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Type", "IsActive");
+
+ b.ToTable("OpenAiPrompts", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Questions.SalariesSurveyReply", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("CreatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("CreatedByUserId")
+ .HasColumnType("bigint");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("UsefulnessRating")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedByUserId");
+
+ b.ToTable("SalariesSurveyReplies", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Salaries.Profession", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedById")
+ .HasColumnType("bigint");
+
+ b.Property("HexColor")
+ .IsRequired()
+ .HasMaxLength(7)
+ .HasColumnType("character varying(7)");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.ToTable("Professions", (string)null);
+
+ b.HasData(
+ new
+ {
+ Id = 1L,
+ HexColor = "#C00C50",
+ Title = "Developer"
+ },
+ new
+ {
+ Id = 2L,
+ HexColor = "#C00C50",
+ Title = "QualityAssurance"
+ },
+ new
+ {
+ Id = 3L,
+ HexColor = "#C00C50",
+ Title = "Tester"
+ },
+ new
+ {
+ Id = 4L,
+ HexColor = "#C00C50",
+ Title = "BusinessAnalyst"
+ },
+ new
+ {
+ Id = 5L,
+ HexColor = "#C00C50",
+ Title = "ProjectManager"
+ },
+ new
+ {
+ Id = 6L,
+ HexColor = "#C00C50",
+ Title = "ScrumMaster"
+ },
+ new
+ {
+ Id = 7L,
+ HexColor = "#C00C50",
+ Title = "DevOps"
+ },
+ new
+ {
+ Id = 8L,
+ HexColor = "#C00C50",
+ Title = "SystemAdministrator"
+ },
+ new
+ {
+ Id = 9L,
+ HexColor = "#C00C50",
+ Title = "ProductOwner"
+ },
+ new
+ {
+ Id = 10L,
+ HexColor = "#C00C50",
+ Title = "TeamLeader"
+ },
+ new
+ {
+ Id = 11L,
+ HexColor = "#C00C50",
+ Title = "Architect"
+ },
+ new
+ {
+ Id = 12L,
+ HexColor = "#C00C50",
+ Title = "DataScientist"
+ },
+ new
+ {
+ Id = 13L,
+ HexColor = "#C00C50",
+ Title = "DataAnalyst"
+ },
+ new
+ {
+ Id = 14L,
+ HexColor = "#C00C50",
+ Title = "DataEngineer"
+ },
+ new
+ {
+ Id = 15L,
+ HexColor = "#C00C50",
+ Title = "DataWarehouseSpecialist"
+ },
+ new
+ {
+ Id = 16L,
+ HexColor = "#C00C50",
+ Title = "DatabaseAdministrator"
+ },
+ new
+ {
+ Id = 17L,
+ HexColor = "#C00C50",
+ Title = "TechLeader"
+ },
+ new
+ {
+ Id = 18L,
+ HexColor = "#C00C50",
+ Title = "SystemAnalyst"
+ },
+ new
+ {
+ Id = 19L,
+ HexColor = "#C00C50",
+ Title = "ItHr"
+ },
+ new
+ {
+ Id = 20L,
+ HexColor = "#C00C50",
+ Title = "ItRecruiter"
+ },
+ new
+ {
+ Id = 21L,
+ HexColor = "#C00C50",
+ Title = "UiDesigner"
+ },
+ new
+ {
+ Id = 22L,
+ HexColor = "#C00C50",
+ Title = "UxDesigner"
+ },
+ new
+ {
+ Id = 23L,
+ HexColor = "#C00C50",
+ Title = "UiUxDesigner"
+ },
+ new
+ {
+ Id = 24L,
+ HexColor = "#C00C50",
+ Title = "ProductAnalyst"
+ },
+ new
+ {
+ Id = 25L,
+ HexColor = "#C00C50",
+ Title = "ProductManager"
+ },
+ new
+ {
+ Id = 26L,
+ HexColor = "#C00C50",
+ Title = "ProductDesigner"
+ },
+ new
+ {
+ Id = 27L,
+ HexColor = "#C00C50",
+ Title = "HrNonIt"
+ },
+ new
+ {
+ Id = 28L,
+ HexColor = "#C00C50",
+ Title = "OneCDeveloper"
+ },
+ new
+ {
+ Id = 29L,
+ HexColor = "#C00C50",
+ Title = "ThreeDModeler"
+ },
+ new
+ {
+ Id = 30L,
+ HexColor = "#C00C50",
+ Title = "AndroidDeveloper"
+ },
+ new
+ {
+ Id = 31L,
+ HexColor = "#C00C50",
+ Title = "IosDeveloper"
+ },
+ new
+ {
+ Id = 32L,
+ HexColor = "#C00C50",
+ Title = "MobileDeveloper"
+ },
+ new
+ {
+ Id = 33L,
+ HexColor = "#C00C50",
+ Title = "FrontendDeveloper"
+ },
+ new
+ {
+ Id = 34L,
+ HexColor = "#C00C50",
+ Title = "BackendDeveloper"
+ },
+ new
+ {
+ Id = 35L,
+ HexColor = "#C00C50",
+ Title = "FullstackDeveloper"
+ },
+ new
+ {
+ Id = 36L,
+ HexColor = "#C00C50",
+ Title = "GameDeveloper"
+ },
+ new
+ {
+ Id = 37L,
+ HexColor = "#C00C50",
+ Title = "EmbeddedDeveloper"
+ },
+ new
+ {
+ Id = 38L,
+ HexColor = "#C00C50",
+ Title = "MachineLearningDeveloper"
+ },
+ new
+ {
+ Id = 39L,
+ HexColor = "#C00C50",
+ Title = "Pentester"
+ },
+ new
+ {
+ Id = 40L,
+ HexColor = "#C00C50",
+ Title = "SecurityEngineer"
+ },
+ new
+ {
+ Id = 41L,
+ HexColor = "#C00C50",
+ Title = "SecurityAnalyst"
+ },
+ new
+ {
+ Id = 42L,
+ HexColor = "#C00C50",
+ Title = "TechnicalWriter"
+ },
+ new
+ {
+ Id = 43L,
+ HexColor = "#C00C50",
+ Title = "BiDeveloper"
+ },
+ new
+ {
+ Id = 44L,
+ HexColor = "#C00C50",
+ Title = "ChiefTechnicalOfficer"
+ },
+ new
+ {
+ Id = 45L,
+ HexColor = "#C00C50",
+ Title = "ChiefExecutiveOfficer"
+ },
+ new
+ {
+ Id = 46L,
+ HexColor = "#C00C50",
+ Title = "HeadOfDepartment"
+ },
+ new
+ {
+ Id = 47L,
+ HexColor = "#C00C50",
+ Title = "DeliveryManager"
+ },
+ new
+ {
+ Id = 48L,
+ HexColor = "#C00C50",
+ Title = "Copywriter"
+ },
+ new
+ {
+ Id = 49L,
+ HexColor = "#C00C50",
+ Title = "GameDesigner"
+ },
+ new
+ {
+ Id = 50L,
+ HexColor = "#C00C50",
+ Title = "SecOps"
+ },
+ new
+ {
+ Id = 51L,
+ HexColor = "#C00C50",
+ Title = "TalentAcquisition"
+ },
+ new
+ {
+ Id = 52L,
+ HexColor = "#C00C50",
+ Title = "CustomerSupport"
+ },
+ new
+ {
+ Id = 53L,
+ HexColor = "#C00C50",
+ Title = "TechnicalSupport"
+ });
+ });
+
+ modelBuilder.Entity("Domain.Entities.Salaries.Skill", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CreatedById")
+ .HasColumnType("bigint");
+
+ b.Property("HexColor")
+ .IsRequired()
+ .HasMaxLength(7)
+ .HasColumnType("character varying(7)");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.ToTable("Skills", (string)null);
+ });
+
+ modelBuilder.Entity("Domain.Entities.Salaries.UserSalary", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property("Age")
+ .HasColumnType("integer");
+
+ b.Property("City")
+ .HasColumnType("bigint");
+
+ b.Property