diff --git a/src/PostIt/PostIt.Tests/ProviderOngoingRequestsPageViewModelTests.cs b/src/PostIt/PostIt.Tests/ProviderOngoingRequestsPageViewModelTests.cs deleted file mode 100644 index 945072870..000000000 --- a/src/PostIt/PostIt.Tests/ProviderOngoingRequestsPageViewModelTests.cs +++ /dev/null @@ -1,208 +0,0 @@ -using System.Net.Http; -using PostIt.ViewModels; -using Yavsc; -using Yavsc.Api.Client; - -namespace PostIt.Tests; - -public class ProviderOngoingRequestsPageViewModelTests -{ - [Fact] - public async Task RefreshAsync_calls_provider_endpoint_and_filters_out_unknown_billing_codes() - { - var api = new StubProviderApi(); - var client = new BillingApiClient(api, "https://business.example/api/v1/"); - var vm = new ProviderOngoingRequestsPageViewModel(client); - - await vm.InitializeAsync(); - - Assert.Contains("https://business.example/api/v1/bill/provider/ongoing", api.Paths); - Assert.Equal(3, vm.Queries.Count); - Assert.Equal(12, vm.Queries[0].Id); - Assert.Equal(11, vm.Queries[1].Id); - Assert.Equal(10, vm.Queries[2].Id); - } - - [Fact] - public async Task FilterText_filters_by_activity_code_and_status() - { - var api = new StubProviderApi(); - var client = new BillingApiClient(api, "https://business.example/api/v1/"); - var vm = new ProviderOngoingRequestsPageViewModel(client); - - await vm.InitializeAsync(); - - vm.FilterText = "mbrush"; - Assert.Single(vm.Queries); - Assert.Equal("MBrush", vm.Queries[0].BillingCode); - - vm.FilterText = "accepted"; - Assert.Single(vm.Queries); - Assert.Equal(QueryStatus.Accepted, vm.Queries[0].Status); - } - - [Fact] - public async Task OpenSelectedEditorCommand_can_execute_only_when_selection_exists() - { - var api = new StubProviderApi(); - var client = new BillingApiClient(api, "https://business.example/api/v1/"); - var vm = new ProviderOngoingRequestsPageViewModel(client); - - await vm.InitializeAsync(); - - Assert.False(vm.OpenSelectedEditorCommand.CanExecute(null)); - - vm.SelectedQuery = vm.Queries[0]; - - Assert.True(vm.OpenSelectedEditorCommand.CanExecute(null)); - } - - [Fact] - public async Task SelectedSortOption_date_keeps_most_recent_first() - { - var api = new StubProviderApi(); - var client = new BillingApiClient(api, "https://business.example/api/v1/"); - var vm = new ProviderOngoingRequestsPageViewModel(client); - - await vm.InitializeAsync(); - vm.SelectedSortOption = ProviderOngoingRequestsPageViewModel.SortByDate; - - Assert.Equal(new long[] { 12, 11, 10 }, vm.Queries.Select(q => q.Id).ToArray()); - } - - [Fact] - public async Task SelectedSortOption_date_ascending_keeps_oldest_first() - { - var api = new StubProviderApi(); - var client = new BillingApiClient(api, "https://business.example/api/v1/"); - var vm = new ProviderOngoingRequestsPageViewModel(client); - - await vm.InitializeAsync(); - vm.SelectedSortOption = ProviderOngoingRequestsPageViewModel.SortByDateAsc; - - Assert.Equal(new long[] { 10, 11, 12 }, vm.Queries.Select(q => q.Id).ToArray()); - } - - [Fact] - public async Task SelectedSortOption_status_prioritizes_inprogress_then_accepted_then_inserted() - { - var api = new StubProviderApi(); - var client = new BillingApiClient(api, "https://business.example/api/v1/"); - var vm = new ProviderOngoingRequestsPageViewModel(client); - - await vm.InitializeAsync(); - vm.SelectedSortOption = ProviderOngoingRequestsPageViewModel.SortByStatus; - - Assert.Equal(new long[] { 11, 12, 10 }, vm.Queries.Select(q => q.Id).ToArray()); - } - - [Fact] - public void Constructor_reads_saved_sort_option_from_settings() - { - var api = new StubProviderApi(); - var client = new BillingApiClient(api, "https://business.example/api/v1/"); - var settings = new Settings - { - ProviderOngoingRequestsSortOption = ProviderOngoingRequestsPageViewModel.SortByStatus, - }; - - var vm = new ProviderOngoingRequestsPageViewModel(client, settings); - - Assert.Equal(ProviderOngoingRequestsPageViewModel.SortByStatus, vm.SelectedSortOption); - } - - [Fact] - public void Constructor_falls_back_to_default_when_saved_sort_is_invalid() - { - var api = new StubProviderApi(); - var client = new BillingApiClient(api, "https://business.example/api/v1/"); - var settings = new Settings - { - ProviderOngoingRequestsSortOption = "invalide", - }; - - var vm = new ProviderOngoingRequestsPageViewModel(client, settings); - - Assert.Equal(ProviderOngoingRequestsPageViewModel.SortByDate, vm.SelectedSortOption); - } - - private sealed class StubProviderApi : IYavscApiClient - { - public HttpClient Http { get; } = new(); - public List Paths { get; } = new(); - - public Task CallAsync(HttpMethod method, string path, object? body = null, CancellationToken ct = default) - { - Paths.Add(path); - - if (typeof(T) == typeof(List)) - { - var data = new List - { - new() - { - Id = 10, - BillingCode = "Rdv", - ActivityCode = "dev", - PerformerId = "perf-1", - ClientId = "cli-1", - Status = QueryStatus.Inserted, - Description = "Rendez-vous", - EventDate = new DateTime(2026, 9, 10, 10, 0, 0, DateTimeKind.Utc), - }, - new() - { - Id = 11, - BillingCode = "MBrush", - ActivityCode = "hair", - PerformerId = "perf-1", - ClientId = "cli-2", - Status = QueryStatus.InProgress, - Description = "Coupe multiple", - EventDate = new DateTime(2026, 9, 11, 10, 0, 0, DateTimeKind.Utc), - }, - new() - { - Id = 12, - BillingCode = "Brush", - ActivityCode = "hair", - PerformerId = "perf-1", - ClientId = "cli-3", - Status = QueryStatus.Accepted, - Description = "Coupe simple", - EventDate = new DateTime(2026, 9, 12, 10, 0, 0, DateTimeKind.Utc), - }, - new() - { - Id = 13, - BillingCode = "", - ActivityCode = "unknown", - PerformerId = "perf-1", - ClientId = "cli-4", - Status = QueryStatus.Accepted, - Description = "Doit être filtrée", - EventDate = new DateTime(2026, 9, 13, 10, 0, 0, DateTimeKind.Utc), - } - }; - - return Task.FromResult((T)(object)data); - } - - return Task.FromResult(default(T)!); - } - - public Task CallAsync(HttpMethod method, string path, object? body = null, CancellationToken ct = default) - { - Paths.Add(path); - return Task.CompletedTask; - } - - public Task CallAsync(HttpMethod method, string path, Func contentFactory, CancellationToken ct = default) - => CallAsync(method, path, (object?)null, ct); - - public Task CallAsync(HttpMethod method, string path, Func contentFactory, CancellationToken ct = default) - => CallAsync(method, path, (object?)null, ct); - - public ValueTask DisposeAsync() => ValueTask.CompletedTask; - } -} diff --git a/src/PostIt/PostIt/Helpers/ServiceCollectionHelpers.cs b/src/PostIt/PostIt/Helpers/ServiceCollectionHelpers.cs index 0ebd2af19..c87eb9286 100644 --- a/src/PostIt/PostIt/Helpers/ServiceCollectionHelpers.cs +++ b/src/PostIt/PostIt/Helpers/ServiceCollectionHelpers.cs @@ -59,7 +59,6 @@ public static class ServiceCollectionHelpers services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); // ViewModels services.AddSingleton(settings); services.AddSingleton(api); diff --git a/src/PostIt/PostIt/ViewLocator.cs b/src/PostIt/PostIt/ViewLocator.cs index 72bd2559e..97538abbb 100644 --- a/src/PostIt/PostIt/ViewLocator.cs +++ b/src/PostIt/PostIt/ViewLocator.cs @@ -52,7 +52,6 @@ public class ViewLocator : IDataTemplate PostAclDialogViewModel => services.GetRequiredService(), BillingQueriesPageViewModel => services.GetRequiredService(), BillingQueryDetailsPageViewModel => services.GetRequiredService(), - ProviderOngoingRequestsPageViewModel => services.GetRequiredService(), null => new TextBlock { Text = "No view for " }, _ => new TextBlock { Text = $"No view for {data.GetType().Name}" } }; diff --git a/src/PostIt/PostIt/ViewModels/Activity/ProviderOngoingRequestsPageViewModel.cs b/src/PostIt/PostIt/ViewModels/Activity/ProviderOngoingRequestsPageViewModel.cs deleted file mode 100644 index 562f24988..000000000 --- a/src/PostIt/PostIt/ViewModels/Activity/ProviderOngoingRequestsPageViewModel.cs +++ /dev/null @@ -1,356 +0,0 @@ -using System; -using System.Collections.ObjectModel; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using Avalonia; -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; -using PostIt.Helpers; -using Yavsc; -using Yavsc.Abstract.Workflow; -using Yavsc.Api.Client; - -namespace PostIt.ViewModels; - -public partial class ProviderOngoingRequestsPageViewModel : ViewModelBase, IActionStatusViewModel -{ - public const string SortByDate = "Date (plus récent d'abord)"; - public const string SortByDateAsc = "Date (plus ancien d'abord)"; - public const string SortByStatus = "Statut (en cours d'abord)"; - - private readonly BillingApiClient _billingClient; - private readonly Settings? _settings; - private List _allQueries = new(); - - [ObservableProperty] - public partial ObservableCollection Queries { get; set; } = new(); - - [ObservableProperty] - public partial string FilterText { get; set; } = string.Empty; - - public IReadOnlyList SortOptions { get; } = new[] - { - SortByDate, - SortByDateAsc, - SortByStatus, - }; - - [ObservableProperty] - public partial string SelectedSortOption { get; set; } = SortByDate; - - [ObservableProperty, NotifyCanExecuteChangedFor(nameof(OpenSelectedQueryCommand))] - public partial BillingQuerySummaryDto? SelectedQuery { get; set; } - - [ObservableProperty] - public partial bool IsBusy { get; set; } - - [ObservableProperty] - public partial string StatusMessage { get; set; } = "Chargement des demandes fournisseur..."; - - [ObservableProperty] - public partial StatusNotice ActionStatus { get; set; } = StatusNotice.Info("Chargement des demandes fournisseur..."); - - public string Title => "Mes demandes en cours"; - - public override bool CanNavigateNext - { - get => false; - protected set { _ = value; } - } - - public override bool CanNavigatePrevious - { - get => true; - protected set { _ = value; } - } - - public ProviderOngoingRequestsPageViewModel(BillingApiClient billingClient, Settings? settings = null) - { - _billingClient = billingClient ?? throw new ArgumentNullException(nameof(billingClient)); - _settings = settings; - - if (_settings is not null) - { - var preferredSort = NormalizeSortOption(_settings.ProviderOngoingRequestsSortOption); - if (!string.Equals(preferredSort, SelectedSortOption, StringComparison.Ordinal)) - { - SelectedSortOption = preferredSort; - } - } - } - - public Task InitializeAsync() => RefreshAsync(); - - [RelayCommand] - public async Task RefreshAsync() - { - IsBusy = true; - try - { - var items = await _billingClient.GetProviderOngoingQueriesAsync().ConfigureAwait(true) ?? new(); - _allQueries = items - .Where(x => !string.IsNullOrWhiteSpace(x.BillingCode)) - .OrderByDescending(x => x.EventDate ?? DateTime.MinValue) - .ThenByDescending(x => x.Id) - .ToList(); - - ApplyFilter(); - this.SetInfoStatus(_allQueries.Count == 0 - ? "Aucune demande en cours pour votre profil fournisseur." - : $"{_allQueries.Count} demande(s) en cours chargée(s)."); - } - catch (HttpRequestException ex) when (ex.StatusCode is HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden) - { - _allQueries = new List(); - Queries = new ObservableCollection(); - this.SetWarningStatus("Accès refusé au billing (scope 'api'). Déconnectez puis reconnectez-vous."); - } - catch (Exception ex) - { - _allQueries = new List(); - Queries = new ObservableCollection(); - this.SetErrorStatus($"Erreur: {ex.Message}"); - } - finally - { - IsBusy = false; - } - } - - private bool CanOpenSelectedQuery() => SelectedQuery is not null; - - private bool CanOpenSelectedEditor() => SelectedQuery is not null; - - [RelayCommand(CanExecute = nameof(CanOpenSelectedQuery))] - public async Task OpenSelectedQueryAsync() - { - if (SelectedQuery is null) - { - this.SetWarningStatus("Sélectionnez une demande."); - return; - } - - var app = (App?)Application.Current; - if (app is null) - { - throw new InvalidOperationException("Application PostIt indisponible."); - } - - IsBusy = true; - try - { - var details = await _billingClient - .GetQueryAsync(SelectedQuery.BillingCode, SelectedQuery.Id) - .ConfigureAwait(true); - var (activity, performer, form) = BuildNavigationContext(SelectedQuery); - - var vm = new BillingQueryDetailsPageViewModel( - activity, - performer, - form, - _billingClient, - details, - isReadOnly: false); - - await app.PushPageAsync(vm).ConfigureAwait(true); - } - catch (Exception ex) - { - this.SetErrorStatus($"Erreur lors de l'ouverture: {ex.Message}"); - } - finally - { - IsBusy = false; - } - } - - [RelayCommand(CanExecute = nameof(CanOpenSelectedEditor))] - public async Task OpenSelectedEditorAsync() - { - if (SelectedQuery is null) - { - this.SetWarningStatus("Sélectionnez une demande."); - return; - } - - var app = (App?)Application.Current; - if (app is null) - { - throw new InvalidOperationException("Application PostIt indisponible."); - } - - IsBusy = true; - try - { - var details = await _billingClient - .GetQueryAsync(SelectedQuery.BillingCode, SelectedQuery.Id) - .ConfigureAwait(true); - - var (activity, performer, form) = BuildNavigationContext(SelectedQuery); - var vm = form.CreateCommandPageViewModel(activity, performer, _billingClient); - if (vm is null) - { - this.SetWarningStatus($"Le formulaire '{form.ActionName}' n'est pas pris en charge en édition."); - return; - } - - await vm.InitializeAsync(details).ConfigureAwait(true); - await app.PushPageAsync(vm).ConfigureAwait(true); - } - catch (Exception ex) - { - this.SetErrorStatus($"Erreur lors de l'ouverture en édition: {ex.Message}"); - } - finally - { - IsBusy = false; - } - } - - partial void OnFilterTextChanged(string value) - { - ApplyFilter(); - } - - partial void OnSelectedSortOptionChanged(string value) - { - var normalized = NormalizeSortOption(value); - if (!string.Equals(normalized, value, StringComparison.Ordinal)) - { - SelectedSortOption = normalized; - return; - } - - PersistSortPreference(value); - ApplyFilter(); - } - - private void ApplyFilter() - { - var query = FilterText?.Trim(); - var filtered = string.IsNullOrWhiteSpace(query) - ? _allQueries - : _allQueries.Where(x => - ContainsInsensitive(x.Description, query) - || ContainsInsensitive(x.ActivityCode, query) - || ContainsInsensitive(x.BillingCode, query) - || ContainsInsensitive(x.ClientId, query) - || ContainsInsensitive(x.Status.ToString(), query)) - .ToList(); - - var sorted = ApplySort(filtered); - Queries = new ObservableCollection(sorted); - } - - private List ApplySort(IEnumerable source) - { - if (string.Equals(SelectedSortOption, SortByStatus, StringComparison.Ordinal)) - { - return source - .OrderBy(x => GetStatusRank(x.Status)) - .ThenByDescending(x => x.EventDate ?? DateTime.MinValue) - .ThenByDescending(x => x.Id) - .ToList(); - } - - if (string.Equals(SelectedSortOption, SortByDateAsc, StringComparison.Ordinal)) - { - return source - .OrderBy(x => x.EventDate ?? DateTime.MinValue) - .ThenBy(x => x.Id) - .ToList(); - } - - return source - .OrderByDescending(x => x.EventDate ?? DateTime.MinValue) - .ThenByDescending(x => x.Id) - .ToList(); - } - - private void PersistSortPreference(string selectedSort) - { - if (_settings is null) - { - return; - } - - if (string.Equals(_settings.ProviderOngoingRequestsSortOption, selectedSort, StringComparison.Ordinal)) - { - return; - } - - _settings.ProviderOngoingRequestsSortOption = selectedSort; - - try - { - _settings.Save(); - } - catch - { - this.SetWarningStatus("Le tri a été appliqué, mais sa sauvegarde a échoué."); - } - } - - private static string NormalizeSortOption(string? sortOption) - { - if (string.Equals(sortOption, SortByDate, StringComparison.Ordinal) - || string.Equals(sortOption, SortByDateAsc, StringComparison.Ordinal) - || string.Equals(sortOption, SortByStatus, StringComparison.Ordinal)) - { - return sortOption!; - } - - return SortByDate; - } - - private static int GetStatusRank(QueryStatus status) - => status switch - { - QueryStatus.InProgress => 0, - QueryStatus.Accepted => 1, - QueryStatus.Inserted => 2, - QueryStatus.Success => 3, - QueryStatus.Rejected => 4, - QueryStatus.Failed => 5, - _ => 99, - }; - - private static bool ContainsInsensitive(string? source, string query) - => !string.IsNullOrWhiteSpace(source) - && source.Contains(query, StringComparison.OrdinalIgnoreCase); - - private static (ActivityInfo activity, ActivityUserDisplayItem performer, CommandFormSummary form) - BuildNavigationContext(BillingQuerySummaryDto query) - { - var activity = new ActivityInfo - { - Code = query.ActivityCode, - Name = string.IsNullOrWhiteSpace(query.ActivityCode) - ? "Activité" - : query.ActivityCode, - }; - - var performer = new ActivityUserDisplayItem - { - PerformerId = query.PerformerId, - UserName = "Mon profil fournisseur", - AvatarFallbackLabel = "M", - IsPerformerActive = true, - PerformerStatusBadgeLabel = "Actif", - PerformerStatusBadgeBackground = "#E6F7EC", - PerformerStatusBadgeBorder = "#2E7D32", - PerformerStatusBadgeForeground = "#1B5E20", - }; - - var form = new CommandFormSummary - { - ActionName = query.BillingCode, - Title = query.BillingCode, - }; - - return (activity, performer, form); - } -} diff --git a/src/PostIt/PostIt/ViewModels/Layout/HomePageViewModel.cs b/src/PostIt/PostIt/ViewModels/Layout/HomePageViewModel.cs index 673177863..a35c8016d 100644 --- a/src/PostIt/PostIt/ViewModels/Layout/HomePageViewModel.cs +++ b/src/PostIt/PostIt/ViewModels/Layout/HomePageViewModel.cs @@ -5,7 +5,6 @@ using CommunityToolkit.Mvvm.Input; using Microsoft.Extensions.DependencyInjection; using PostIt.Helpers; using PostIt.Services; -using Yavsc.Api.Client; namespace PostIt.ViewModels; public class HomePageViewModel : ViewModelBase @@ -51,24 +50,7 @@ public class HomePageViewModel : ViewModelBase await app.PushPageAsync(vm); } - private async Task OpenProviderRequestsAsync() - { - var app = (App?)Application.Current; - if (app is null) - { - throw new InvalidOperationException("Application PostIt indisponible."); - } - - var billingClient = app.ServiceProvider?.GetRequiredService(); - if (billingClient is null) - { - throw new InvalidOperationException("Client billing indisponible."); - } - - var vm = new ProviderOngoingRequestsPageViewModel(billingClient, Settings); - await vm.InitializeAsync(); - await app.PushPageAsync(vm); - } + private Task OpenProviderRequestsAsync() => OpenActivitiesAsync(); /// /// Avalonia designer constructor. Builds a self-contained VM diff --git a/src/PostIt/PostIt/ViewModels/Settings/Settings.cs b/src/PostIt/PostIt/ViewModels/Settings/Settings.cs index 23e9955f4..0864c1416 100644 --- a/src/PostIt/PostIt/ViewModels/Settings/Settings.cs +++ b/src/PostIt/PostIt/ViewModels/Settings/Settings.cs @@ -32,9 +32,6 @@ public partial class Settings : ViewModelBase [ObservableProperty] public partial string SearchText { get; set; } = string.Empty; - [ObservableProperty] - public partial string ProviderOngoingRequestsSortOption { get; set; } = string.Empty; - [ObservableProperty] [JsonIgnore] public partial StatusNotice ActionStatus { get; set; } = StatusNotice.Info("Pret."); @@ -65,7 +62,6 @@ public partial class Settings : ViewModelBase partial void OnBlogsApiUrlChanged(string value) => MarkDirty(); partial void OnApiUrlChanged(string value) => MarkDirty(); partial void OnSearchTextChanged(string value) => MarkDirty(); - partial void OnProviderOngoingRequestsSortOptionChanged(string value) => MarkDirty(); /// /// Authentication can be reassigned wholesale by @@ -350,7 +346,6 @@ public partial class Settings : ViewModelBase ? settings.ApiUrl : this.ApiUrl; this.SearchText = settings.SearchText ?? string.Empty; - this.ProviderOngoingRequestsSortOption = settings.ProviderOngoingRequestsSortOption ?? string.Empty; if (!(settings.Authentication is null)) { this.Authentication = new AuthenticationSettings(); @@ -429,7 +424,6 @@ public partial class Settings : ViewModelBase this.BlogsApiUrl = "https://blogs.pschneider.fr/api/v1/"; this.ApiUrl = "https://api.pschneider.fr/api/v1/"; this.SearchText = string.Empty; - this.ProviderOngoingRequestsSortOption = string.Empty; } /// @@ -472,7 +466,7 @@ public partial class Settings : ViewModelBase UnixFileMode.UserRead | UnixFileMode.UserWrite); IsDirty = false; SetActionStatus("Parametres sauvegardes.", StatusSeverity.Info); - + Console.WriteLine($"💾 Settings saved to {configPath}"); } catch (Exception ex) diff --git a/src/PostIt/PostIt/Views/Activity/ProviderOngoingRequestsPage.axaml b/src/PostIt/PostIt/Views/Activity/ProviderOngoingRequestsPage.axaml deleted file mode 100644 index 010bab7b5..000000000 --- a/src/PostIt/PostIt/Views/Activity/ProviderOngoingRequestsPage.axaml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - + public void Dispose() + { + if (_serverFixture!=null) + { + _serverFixture.Dispose(); + } + + } + [Fact] public void TestDatabaseMigration() { diff --git a/src/Yavsc.Org.Tests/Smoke/AccountSmokeTests.cs b/src/Yavsc.Org.Tests/Smoke/AccountSmokeTests.cs index 9b24582a3..327c2db4e 100644 --- a/src/Yavsc.Org.Tests/Smoke/AccountSmokeTests.cs +++ b/src/Yavsc.Org.Tests/Smoke/AccountSmokeTests.cs @@ -18,7 +18,7 @@ namespace Yavsc.Org.Tests.Smoke; /// entire pipeline (routing + Razor + IdentityServer + EF + DI) /// is wired correctly end-to-end. /// -public class AccountSmokeTests : IClassFixture +public class AccountSmokeTests : SmokeTestBase, IClassFixture { private readonly TestWebApplicationFactory _factory; @@ -27,7 +27,24 @@ public class AccountSmokeTests : IClassFixture _factory = factory; } + [Fact] + public async Task GetSignin_returns_a_page() + { + using var client = _factory.CreateClient(); + await AssertResponds(client, "/signin"); + } + [Fact] + public async Task GetOpenIdConfiguration_returns_ok() + { + using var client = _factory.CreateClient(); + var response = await GetRaw(client, "/.well-known/openid-configuration"); + var payload = await response.Content.ReadAsStringAsync(); + + Assert.True( + response.IsSuccessStatusCode, + $"GET /.well-known/openid-configuration returned {(int)response.StatusCode} {response.StatusCode}. Body: {payload}"); + } [Fact] public async Task ResourceStore_get_all_resources_does_not_throw() diff --git a/src/Yavsc.Org.Tests/Smoke/BlogSmokeTests.cs b/src/Yavsc.Org.Tests/Smoke/BlogSmokeTests.cs index 3c383ad80..96650ba80 100644 --- a/src/Yavsc.Org.Tests/Smoke/BlogSmokeTests.cs +++ b/src/Yavsc.Org.Tests/Smoke/BlogSmokeTests.cs @@ -14,13 +14,11 @@ namespace Yavsc.Org.Tests.Smoke; /// doc/architecture/decoupage-organisation.md. The smoke /// here asserts the front-end side of the BC. /// -public class BlogSmokeTests : BaseTestContext, IClassFixture +public class BlogSmokeTests : SmokeTestBase, IClassFixture { private readonly TestWebApplicationFactory _factory; - public BlogSmokeTests(TestWebApplicationFactory factory, ITestOutputHelper output, - WebServerFixture webServerFixture) - : base(output, webServerFixture) + public BlogSmokeTests(TestWebApplicationFactory factory) { _factory = factory; } diff --git a/src/Yavsc.Org.Tests/Smoke/SmokeTestBase.cs b/src/Yavsc.Org.Tests/Smoke/SmokeTestBase.cs new file mode 100644 index 000000000..29fd9b461 --- /dev/null +++ b/src/Yavsc.Org.Tests/Smoke/SmokeTestBase.cs @@ -0,0 +1,52 @@ +namespace Yavsc.Org.Tests.Smoke; + +/// +/// Base for the smoke tests covering the production hosts +/// (Yavsc.Org / Yavsc.Api / Yavsc.Blogs). One smoke test per +/// bounded context (BC): each test hits one GET endpoint and +/// asserts a 2xx or 3xx status, with no follow-up redirect. +/// Together they satisfy the 'Tests d'intégration smoke par BC' +/// item of Jalon 0 in ROADMAP.md. +/// +/// Status code policy: +/// - 200 OK : endpoint serves a page. +/// - 302 / 301 : endpoint requires auth and redirects to login +/// (acceptable smoke signal: routing + middleware are wired). +/// - 401 / 403 : endpoint exists but rejects anonymous (acceptable +/// for API smoke tests where the smoke is "the host boots"). +/// Anything else (404, 500, connection refused) is a failure. +/// +public abstract class SmokeTestBase +{ + /// + /// Issue a GET against on the + /// in-memory test server. Returns the raw HttpResponseMessage + /// without following redirects — the test asserts on the first + /// hop, not the eventual page. + /// + protected static async Task GetRaw( + HttpClient client, string relativePath) + { + Assert.NotNull(client); + var request = new HttpRequestMessage(HttpMethod.Get, relativePath); + return await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead); + } + + /// + /// Smoke assertion: a GET on + /// returns 2xx (page served) or 3xx (redirect to login) or + /// 401/403 (anonymous rejected by [Authorize]). Anything else + /// — 404 (route missing), 5xx (server crash), connection + /// refused (host not started) — fails the test. + /// + protected static async Task AssertResponds( + HttpClient client, string relativePath) + { + var response = await GetRaw(client, relativePath); + var status = (int)response.StatusCode; + Assert.True( + status >= 200 && status < 400 || status == 401 || status == 403, + $"GET {relativePath} returned {status} {response.StatusCode}, " + + "expected 2xx/3xx (page or redirect) or 401/403 (auth required)."); + } +} diff --git a/src/Yavsc.Org.Tests/WebServerFixture.cs b/src/Yavsc.Org.Tests/WebServerFixture.cs index f438fd88c..f82771ec6 100644 --- a/src/Yavsc.Org.Tests/WebServerFixture.cs +++ b/src/Yavsc.Org.Tests/WebServerFixture.cs @@ -63,7 +63,6 @@ public sealed class WebServerFixture : WebHostFixture private static string? _sharedTestingUserName; private static string? _sharedTestingUserPassword; private static string? _sharedTestingUserEmail; - private static string? _sharedHttpsAuthority; private static RecordingSmtpClientFactory? _sharedSmtpClientFactory; public IConfiguration? Configuration { get; private set; } @@ -79,19 +78,9 @@ public sealed class WebServerFixture : WebHostFixture public RecordingSmtpClientFactory? SmtpClientFactory { get; private set; } public ILogger? Logger { get; internal set; } - public string? HttpsAuthority { get; private set; } - - protected override WebApplicationOptions CreateBuilderOptions() - { - return new WebApplicationOptions - { - ApplicationName = typeof(Yavsc.Program).Assembly.GetName().Name - }; - } - protected override WebApplication BuildApp(WebApplicationBuilder builder) { - HttpsAuthority = $"https://localhost:{HttpsPort}"; + var authority = $"https://localhost:{_httpsPort}"; // WebApplication.CreateBuilder defaults WebRootPath to // {ContentRoot}/wwwroot. The test assembly runs from @@ -110,7 +99,7 @@ public sealed class WebServerFixture : WebHostFixture ["Smtp:Port"] = "465", ["Smtp:UserName"] = "test-user", ["Smtp:Password"] = "test-pass", - ["Site:Authority"] = HttpsAuthority + ["Site:Authority"] = authority }); Configuration = builder.Configuration; @@ -193,7 +182,6 @@ public sealed class WebServerFixture : WebHostFixture _sharedTestingUserName = TestingUserName; _sharedTestingUserPassword = TestingUserPassword; _sharedTestingUserEmail = TestingUserEmail; - _sharedHttpsAuthority = HttpsAuthority; _sharedLogger = app.Services.GetRequiredService().CreateLogger(); Logger = _sharedLogger; SmtpClientFactory = smtpFactory; @@ -206,42 +194,13 @@ public sealed class WebServerFixture : WebHostFixture using var scope = Services.CreateScope(); var db = scope.ServiceProvider.GetRequiredService(); db.Database.EnsureDeleted(); - db.Database.EnsureCreated(); if (db.Database.IsRelational()) { db.Database.Migrate(); - ReseedAuthTestData(scope); return; } - ReseedAuthTestData(scope); - } - private void ReseedAuthTestData(IServiceScope scope) - { - TestingUserName ??= "Tester"; - TestingUserPassword ??= "Test123!"; - TestingUserEmail ??= "test@no-reply.com"; - TestClientId ??= "testClientId"; - TestClientSecret ??= Guid.CreateVersion7().ToString(); - - TestingUser = null; - EnsureUser(TestingUserName, TestingUserPassword, TestingUserEmail, scope); - - var db = scope.ServiceProvider.GetRequiredService(); - TestingUser = db.Users.FirstOrDefault(u => u.UserName == TestingUserName); - - var configDb = scope.ServiceProvider.GetRequiredService(); - var hasClient = configDb.Set().Any(c => c.ClientId == TestClientId); - if (!hasClient) - { - AddAuthorizedClient(scope, TestClientId, TestClientSecret); - } - - _sharedTestClientId = TestClientId; - _sharedTestClientSecret = TestClientSecret; - _sharedTestingUserName = TestingUserName; - _sharedTestingUserPassword = TestingUserPassword; - _sharedTestingUserEmail = TestingUserEmail; + db.Database.EnsureCreated(); } protected override async Task ConfigurePipelineAsync(WebApplication app) @@ -266,7 +225,6 @@ public sealed class WebServerFixture : WebHostFixture TestingUserName = _sharedTestingUserName; TestingUserPassword = _sharedTestingUserPassword; TestingUserEmail = _sharedTestingUserEmail; - HttpsAuthority = _sharedHttpsAuthority; SmtpClientFactory = _sharedSmtpClientFactory; Configuration = _sharedConfiguration; SiteSettings = _sharedSiteSettings; diff --git a/src/Yavsc.Org/Migrations/20260912114726_genericEstimate.Designer.cs b/src/Yavsc.Org/Migrations/20260912114726_genericEstimate.Designer.cs deleted file mode 100644 index 2b2240e1d..000000000 --- a/src/Yavsc.Org/Migrations/20260912114726_genericEstimate.Designer.cs +++ /dev/null @@ -1,4714 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using Yavsc.Models; - -#nullable disable - -namespace Yavsc.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20260912114726_genericEstimate")] - partial class genericEstimate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "10.0.9") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("AllowedAccessTokenSigningAlgorithms") - .HasColumnType("text"); - - b.Property("Created") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DisplayName") - .HasColumnType("text"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("LastAccessed") - .HasColumnType("timestamp with time zone"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("NonEditable") - .HasColumnType("boolean"); - - b.Property("ShowInDiscoveryDocument") - .HasColumnType("boolean"); - - b.Property("Updated") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.ToTable("ApiResources"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApiResourceId") - .HasColumnType("integer"); - - b.Property("ApiResourceId1") - .HasColumnType("integer"); - - b.Property("Type") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.HasIndex("ApiResourceId1"); - - b.ToTable("ApiResourceClaims"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApiResourceId") - .HasColumnType("integer"); - - b.Property("ApiResourceId1") - .HasColumnType("integer"); - - b.Property("Key") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.HasIndex("ApiResourceId1"); - - b.ToTable("ApiResourceProperties"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApiResourceId") - .HasColumnType("integer"); - - b.Property("ApiResourceId1") - .HasColumnType("integer"); - - b.Property("Scope") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.HasIndex("ApiResourceId1"); - - b.ToTable("ApiResourceScopes"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApiResourceId") - .HasColumnType("integer"); - - b.Property("ApiResourceId1") - .HasColumnType("integer"); - - b.Property("Created") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Expiration") - .HasColumnType("timestamp with time zone"); - - b.Property("Type") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ApiResourceId"); - - b.HasIndex("ApiResourceId1"); - - b.ToTable("ApiResourceSecrets"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DisplayName") - .HasColumnType("text"); - - b.Property("Emphasize") - .HasColumnType("boolean"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Required") - .HasColumnType("boolean"); - - b.Property("ShowInDiscoveryDocument") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.ToTable("ApiScopes"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScopeClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ScopeId") - .HasColumnType("integer"); - - b.Property("ScopeId1") - .HasColumnType("integer"); - - b.Property("Type") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ScopeId"); - - b.HasIndex("ScopeId1"); - - b.ToTable("ApiScopeClaims"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScopeProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Key") - .HasColumnType("text"); - - b.Property("ScopeId") - .HasColumnType("integer"); - - b.Property("ScopeId1") - .HasColumnType("integer"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ScopeId"); - - b.HasIndex("ScopeId1"); - - b.ToTable("ApiScopeProperties"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("AbsoluteRefreshTokenLifetime") - .HasColumnType("integer"); - - b.Property("AccessTokenLifetime") - .HasColumnType("integer"); - - b.Property("AccessTokenType") - .HasColumnType("integer"); - - b.Property("AllowAccessTokensViaBrowser") - .HasColumnType("boolean"); - - b.Property("AllowOfflineAccess") - .HasColumnType("boolean"); - - b.Property("AllowPlainTextPkce") - .HasColumnType("boolean"); - - b.Property("AllowRememberConsent") - .HasColumnType("boolean"); - - b.Property("AllowedIdentityTokenSigningAlgorithms") - .HasColumnType("text"); - - b.Property("AlwaysIncludeUserClaimsInIdToken") - .HasColumnType("boolean"); - - b.Property("AlwaysSendClientClaims") - .HasColumnType("boolean"); - - b.Property("AuthorizationCodeLifetime") - .HasColumnType("integer"); - - b.Property("BackChannelLogoutSessionRequired") - .HasColumnType("boolean"); - - b.Property("BackChannelLogoutUri") - .HasColumnType("text"); - - b.Property("ClientClaimsPrefix") - .HasColumnType("text"); - - b.Property("ClientId") - .HasColumnType("text"); - - b.Property("ClientName") - .HasColumnType("text"); - - b.Property("ClientUri") - .HasColumnType("text"); - - b.Property("ConsentLifetime") - .HasColumnType("integer"); - - b.Property("Created") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DeviceCodeLifetime") - .HasColumnType("integer"); - - b.Property("EnableLocalLogin") - .HasColumnType("boolean"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("FrontChannelLogoutSessionRequired") - .HasColumnType("boolean"); - - b.Property("FrontChannelLogoutUri") - .HasColumnType("text"); - - b.Property("IdentityTokenLifetime") - .HasColumnType("integer"); - - b.Property("IncludeJwtId") - .HasColumnType("boolean"); - - b.Property("LastAccessed") - .HasColumnType("timestamp with time zone"); - - b.Property("LogoUri") - .HasColumnType("text"); - - b.Property("NonEditable") - .HasColumnType("boolean"); - - b.Property("PairWiseSubjectSalt") - .HasColumnType("text"); - - b.Property("ProtocolType") - .HasColumnType("text"); - - b.Property("RefreshTokenExpiration") - .HasColumnType("integer"); - - b.Property("RefreshTokenUsage") - .HasColumnType("integer"); - - b.Property("RequireClientSecret") - .HasColumnType("boolean"); - - b.Property("RequireConsent") - .HasColumnType("boolean"); - - b.Property("RequirePkce") - .HasColumnType("boolean"); - - b.Property("RequireRequestObject") - .HasColumnType("boolean"); - - b.Property("SlidingRefreshTokenLifetime") - .HasColumnType("integer"); - - b.Property("UpdateAccessTokenClaimsOnRefresh") - .HasColumnType("boolean"); - - b.Property("Updated") - .HasColumnType("timestamp with time zone"); - - b.Property("UserCodeType") - .HasColumnType("text"); - - b.Property("UserSsoLifetime") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("Type") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("ClientClaims"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientCorsOrigin", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("ClientId1") - .HasColumnType("integer"); - - b.Property("Origin") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("ClientId1"); - - b.ToTable("ClientCorsOrigins"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientGrantType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("GrantType") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("ClientGrantTypes"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientIdPRestriction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("ClientId1") - .HasColumnType("integer"); - - b.Property("Provider") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("ClientId1"); - - b.ToTable("ClientIdPRestrictions"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("ClientId1") - .HasColumnType("integer"); - - b.Property("PostLogoutRedirectUri") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("ClientId1"); - - b.ToTable("ClientPostLogoutRedirectUris"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("ClientId1") - .HasColumnType("integer"); - - b.Property("Key") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("ClientId1"); - - b.ToTable("ClientProperties"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientRedirectUri", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("RedirectUri") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("ClientRedirectUris"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("Scope") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.ToTable("ClientScopes"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientSecret", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); - - b.Property("ClientId") - .HasColumnType("integer"); - - b.Property("ClientId1") - .HasColumnType("integer"); - - b.Property("Created") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Expiration") - .HasColumnType("timestamp with time zone"); - - b.Property("Type") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("ClientId1"); - - b.ToTable("ClientSecrets"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.DeviceFlowCodes", b => - { - b.Property("UserCode") - .HasColumnType("text"); - - b.Property("DeviceCode") - .HasColumnType("text"); - - b.Property("ClientId") - .HasColumnType("text"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Expiration") - .HasColumnType("timestamp with time zone"); - - b.Property("SessionId") - .HasColumnType("text"); - - b.Property("SubjectId") - .HasColumnType("text"); - - b.HasKey("UserCode", "DeviceCode"); - - b.ToTable("DeviceFlowCodes"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResource", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Created") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("DisplayName") - .HasColumnType("text"); - - b.Property("Emphasize") - .HasColumnType("boolean"); - - b.Property("Enabled") - .HasColumnType("boolean"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("NonEditable") - .HasColumnType("boolean"); - - b.Property("Required") - .HasColumnType("boolean"); - - b.Property("ShowInDiscoveryDocument") - .HasColumnType("boolean"); - - b.Property("Updated") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.ToTable("IdentityResources"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResourceClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("IdentityResourceId") - .HasColumnType("integer"); - - b.Property("Type") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("IdentityResourceId"); - - b.ToTable("IdentityResourceClaims"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResourceProperty", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("IdentityResourceId") - .HasColumnType("integer"); - - b.Property("Key") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("IdentityResourceId"); - - b.ToTable("IdentityResourceProperties"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.PersistedGrant", b => - { - b.Property("Key") - .HasColumnType("text"); - - b.Property("ClientId") - .HasColumnType("text"); - - b.Property("ConsumedTime") - .HasColumnType("timestamp with time zone"); - - b.Property("CreationTime") - .HasColumnType("timestamp with time zone"); - - b.Property("Data") - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Expiration") - .HasColumnType("timestamp with time zone"); - - b.Property("SessionId") - .HasColumnType("text"); - - b.Property("SubjectId") - .HasColumnType("text"); - - b.Property("Type") - .HasColumnType("text"); - - b.HasKey("Key"); - - b.ToTable("PersistedGrants"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("AspNetRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("text"); - - b.Property("ClaimValue") - .HasColumnType("text"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("text"); - - b.Property("ClaimValue") - .HasColumnType("text"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("text"); - - b.Property("ProviderKey") - .HasColumnType("text"); - - b.Property("ProviderDisplayName") - .HasColumnType("text"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("text"); - - b.Property("RoleId") - .HasColumnType("text"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles", (string)null); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("text"); - - b.Property("LoginProvider") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Value") - .HasColumnType("text"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens", (string)null); - }); - - modelBuilder.Entity("Yavsc.Abstract.Identity.ClientProviderInfo", b => - { - b.Property("UserId") - .HasColumnType("text"); - - b.Property("Avatar") - .HasColumnType("text"); - - b.Property("BillingAddressId") - .HasColumnType("bigint"); - - b.Property("EMail") - .HasColumnType("text"); - - b.Property("Phone") - .HasColumnType("text"); - - b.Property("UserName") - .HasColumnType("text"); - - b.HasKey("UserId"); - - b.ToTable("ClientProviderInfo"); - }); - - modelBuilder.Entity("Yavsc.Abstract.Models.Messaging.Notification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Target") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("body") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("click_action") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("color") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("icon") - .ValueGeneratedOnAdd() - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasDefaultValue("exclam"); - - b.Property("sound") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("tag") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("title") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.HasKey("Id"); - - b.ToTable("Notification"); - }); - - modelBuilder.Entity("Yavsc.Models.Access.Ban", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.Property("TargetId") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserCreated") - .HasColumnType("text"); - - b.Property("UserModified") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("TargetId"); - - b.ToTable("Ban"); - }); - - modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.HasIndex("UserId"); - - b.ToTable("BlackListed"); - }); - - modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => - { - b.Property("CircleId") - .HasColumnType("bigint"); - - b.Property("BlogPostId") - .HasColumnType("bigint"); - - b.HasKey("CircleId", "BlogPostId"); - - b.HasIndex("BlogPostId"); - - b.ToTable("CircleAuthorizationToBlogPost"); - }); - - modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToFile", b => - { - b.Property("CircleId") - .HasColumnType("bigint"); - - b.Property("Path") - .HasColumnType("text"); - - b.Property("OwnerId") - .HasColumnType("text"); - - b.Property("Access") - .HasColumnType("smallint"); - - b.HasKey("CircleId", "Path", "OwnerId"); - - b.HasIndex("OwnerId"); - - b.ToTable("CircleAuthorizationToFile"); - }); - - modelBuilder.Entity("Yavsc.Models.AccountBalance", b => - { - b.Property("UserId") - .HasColumnType("text"); - - b.Property("ContactCredits") - .HasColumnType("bigint"); - - b.Property("Credits") - .HasColumnType("numeric"); - - b.HasKey("UserId"); - - b.ToTable("BankStatus"); - }); - - modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("AccessFailedCount") - .HasColumnType("integer"); - - b.Property("AllowMonthlyEmail") - .HasColumnType("boolean"); - - b.Property("Avatar") - .ValueGeneratedOnAdd() - .HasMaxLength(512) - .HasColumnType("character varying(512)") - .HasDefaultValue("/images/Users/icon_user.png"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("text"); - - b.Property("DedicatedGoogleCalendar") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("DiskQuota") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(524288000L); - - b.Property("DiskUsage") - .HasColumnType("bigint"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("boolean"); - - b.Property("FullName") - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("LockoutEnabled") - .HasColumnType("boolean"); - - b.Property("LockoutEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("MaxFileSize") - .HasColumnType("bigint"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("PasswordHash") - .HasColumnType("text"); - - b.Property("PhoneNumber") - .HasColumnType("text"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("boolean"); - - b.Property("PostalAddressId") - .HasColumnType("bigint"); - - b.Property("SecurityStamp") - .HasColumnType("text"); - - b.Property("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasAlternateKey("Email"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.HasIndex("PostalAddressId"); - - b.ToTable("AspNetUsers", (string)null); - }); - - modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("BalanceId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ExecDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Impact") - .HasColumnType("numeric"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("BalanceId"); - - b.ToTable("BalanceImpact"); - }); - - modelBuilder.Entity("Yavsc.Models.Bank.BankIdentity", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AccountNumber") - .IsRequired() - .HasColumnType("text"); - - b.Property("BIC") - .IsRequired() - .HasColumnType("text"); - - b.Property("BankCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("BankedKey") - .HasColumnType("integer"); - - b.Property("IBAN") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("text"); - - b.Property("WicketCode") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("BankIdentity"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Count") - .HasColumnType("integer"); - - b.Property("Currency") - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("EstimateId") - .HasColumnType("bigint"); - - b.Property("EstimateTemplateId") - .HasColumnType("bigint"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.Property("UnitaryCost") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.HasIndex("EstimateId"); - - b.HasIndex("EstimateTemplateId"); - - b.ToTable("CommandLine"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AttachedFilesString") - .IsRequired() - .HasColumnType("text"); - - b.Property("AttachedGraphicsString") - .IsRequired() - .HasColumnType("text"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ClientValidationDate") - .HasColumnType("timestamp with time zone"); - - b.Property("CommandId") - .HasColumnType("bigint"); - - b.Property("CommandType") - .IsRequired() - .HasColumnType("text"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProviderValidationDate") - .HasColumnType("timestamp with time zone"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("CommandId"); - - b.HasIndex("OwnerId"); - - b.ToTable("Estimates"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("EstimateTemplates"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b => - { - b.Property("SIREN") - .HasColumnType("text"); - - b.HasKey("SIREN"); - - b.ToTable("ExceptionsSIREN"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.NominativeServiceCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivityCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Consent") - .HasColumnType("boolean"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(34) - .HasColumnType("character varying(34)"); - - b.Property("PaymentId") - .HasColumnType("text"); - - b.Property("PerformerId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Provisional") - .HasColumnType("numeric"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UserCreated") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserModified") - .IsRequired() - .HasColumnType("text"); - - b.Property("ValidationDate") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ActivityCode"); - - b.HasIndex("ClientId"); - - b.HasIndex("PaymentId"); - - b.HasIndex("PerformerId"); - - b.ToTable("NominativeServiceCommand"); - - b.HasDiscriminator("Discriminator").HasValue("NominativeServiceCommand"); - - b.UseTphMappingStrategy(); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.Signature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CapturedAtUtc") - .HasColumnType("timestamp with time zone"); - - b.Property("CoordinateMax") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(10000); - - b.Property("EstimateId") - .HasColumnType("bigint"); - - b.Property("FilePath") - .IsRequired() - .HasColumnType("text"); - - b.Property("SignerId") - .IsRequired() - .HasColumnType("text"); - - b.PrimitiveCollection("Strokes") - .IsRequired() - .HasColumnType("integer[]"); - - b.Property("Type") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("SignerId"); - - b.HasIndex("EstimateId", "Type") - .IsUnique(); - - b.ToTable("Signatures"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.BlogAttachedFile", b => - { - b.Property("FileId") - .HasColumnType("bigint"); - - b.Property("PostId") - .HasColumnType("bigint"); - - b.HasKey("FileId", "PostId"); - - b.HasIndex("PostId"); - - b.ToTable("BlogAttachedFiles"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Article") - .HasMaxLength(56224) - .HasColumnType("character varying(56224)"); - - b.Property("AuthorId") - .HasColumnType("text"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("Photo") - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(1024) - .HasColumnType("character varying(1024)"); - - b.Property("UserCreated") - .HasColumnType("text"); - - b.Property("UserModified") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("AuthorId"); - - b.ToTable("BlogSpot"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.BlogTag", b => - { - b.Property("PostId") - .HasColumnType("bigint"); - - b.Property("TagId") - .HasColumnType("bigint"); - - b.HasKey("PostId", "TagId"); - - b.HasIndex("TagId"); - - b.ToTable("BlogTag"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Article") - .IsRequired() - .HasColumnType("text"); - - b.Property("AuthorId") - .IsRequired() - .HasColumnType("text"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("ParentId") - .HasColumnType("bigint"); - - b.Property("ReceiverId") - .HasColumnType("bigint"); - - b.Property("UserCreated") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserModified") - .IsRequired() - .HasColumnType("text"); - - b.Property("Visible") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.HasIndex("AuthorId"); - - b.HasIndex("ParentId"); - - b.HasIndex("ReceiverId"); - - b.ToTable("Comment"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.UploadedFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContentType") - .HasColumnType("text"); - - b.Property("Length") - .HasColumnType("bigint"); - - b.Property("Path") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("UploadedFiles"); - }); - - modelBuilder.Entity("Yavsc.Models.BlogSpotPublication", b => - { - b.Property("BlogpostId") - .HasColumnType("bigint"); - - b.HasKey("BlogpostId"); - - b.ToTable("blogSpotPublications"); - }); - - modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => - { - b.Property("OwnerId") - .HasColumnType("text"); - - b.HasKey("OwnerId"); - - b.ToTable("Schedule"); - }); - - modelBuilder.Entity("Yavsc.Models.Calendar.ScheduledEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("PeriodEnd") - .HasColumnType("timestamp with time zone"); - - b.Property("PeriodStart") - .HasColumnType("timestamp with time zone"); - - b.Property("Reccurence") - .HasColumnType("integer"); - - b.Property("ScheduleOwnerId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ScheduleOwnerId"); - - b.HasIndex("PeriodStart", "PeriodEnd"); - - b.ToTable("ScheduledEvent"); - }); - - modelBuilder.Entity("Yavsc.Models.Chat.ChatConnection", b => - { - b.Property("ConnectionId") - .HasColumnType("text"); - - b.Property("ApplicationUserId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Connected") - .HasColumnType("boolean"); - - b.Property("UserAgent") - .HasColumnType("text"); - - b.HasKey("ConnectionId"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("ChatConnection"); - }); - - modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => - { - b.Property("Name") - .HasColumnType("text"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("LatestJoinPart") - .HasColumnType("timestamp with time zone"); - - b.Property("OwnerId") - .HasColumnType("text"); - - b.Property("Topic") - .HasColumnType("text"); - - b.Property("UserCreated") - .HasColumnType("text"); - - b.Property("UserModified") - .HasColumnType("text"); - - b.HasKey("Name"); - - b.HasIndex("OwnerId"); - - b.ToTable("ChatRoom"); - }); - - modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b => - { - b.Property("ChannelName") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("text"); - - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Level") - .HasColumnType("integer"); - - b.HasKey("ChannelName", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ChatRoomAccess"); - }); - - modelBuilder.Entity("Yavsc.Models.Cratie.Option", b => - { - b.Property("Code") - .HasColumnType("text"); - - b.Property("CodeScrutin") - .HasColumnType("text"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("UserCreated") - .HasColumnType("text"); - - b.Property("UserModified") - .HasColumnType("text"); - - b.HasKey("Code", "CodeScrutin"); - - b.ToTable("Option"); - }); - - modelBuilder.Entity("Yavsc.Models.Drawing.Color", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Blue") - .HasColumnType("smallint"); - - b.Property("Green") - .HasColumnType("smallint"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Red") - .HasColumnType("smallint"); - - b.HasKey("Id"); - - b.ToTable("Color"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => - { - b.Property("UserId") - .HasColumnType("text"); - - b.Property("ActionDistance") - .HasColumnType("integer"); - - b.Property("CarePrice") - .HasColumnType("numeric"); - - b.Property("FlatFeeDiscount") - .HasColumnType("numeric"); - - b.Property("HalfBalayagePrice") - .HasColumnType("numeric"); - - b.Property("HalfBrushingPrice") - .HasColumnType("numeric"); - - b.Property("HalfColorPrice") - .HasColumnType("numeric"); - - b.Property("HalfDefrisPrice") - .HasColumnType("numeric"); - - b.Property("HalfFoldingPrice") - .HasColumnType("numeric"); - - b.Property("HalfMechPrice") - .HasColumnType("numeric"); - - b.Property("HalfMultiColorPrice") - .HasColumnType("numeric"); - - b.Property("HalfPermanentPrice") - .HasColumnType("numeric"); - - b.Property("KidCutPrice") - .HasColumnType("numeric"); - - b.Property("LongBalayagePrice") - .HasColumnType("numeric"); - - b.Property("LongBrushingPrice") - .HasColumnType("numeric"); - - b.Property("LongColorPrice") - .HasColumnType("numeric"); - - b.Property("LongDefrisPrice") - .HasColumnType("numeric"); - - b.Property("LongFoldingPrice") - .HasColumnType("numeric"); - - b.Property("LongMechPrice") - .HasColumnType("numeric"); - - b.Property("LongMultiColorPrice") - .HasColumnType("numeric"); - - b.Property("LongPermanentPrice") - .HasColumnType("numeric"); - - b.Property("ManBrushPrice") - .HasColumnType("numeric"); - - b.Property("ManCutPrice") - .HasColumnType("numeric"); - - b.Property("ScheduleOwnerId") - .HasColumnType("text"); - - b.Property("ShampooPrice") - .HasColumnType("numeric"); - - b.Property("ShortBalayagePrice") - .HasColumnType("numeric"); - - b.Property("ShortBrushingPrice") - .HasColumnType("numeric"); - - b.Property("ShortColorPrice") - .HasColumnType("numeric"); - - b.Property("ShortDefrisPrice") - .HasColumnType("numeric"); - - b.Property("ShortFoldingPrice") - .HasColumnType("numeric"); - - b.Property("ShortMechPrice") - .HasColumnType("numeric"); - - b.Property("ShortMultiColorPrice") - .HasColumnType("numeric"); - - b.Property("ShortPermanentPrice") - .HasColumnType("numeric"); - - b.Property("WomenHalfCutPrice") - .HasColumnType("numeric"); - - b.Property("WomenLongCutPrice") - .HasColumnType("numeric"); - - b.Property("WomenShortCutPrice") - .HasColumnType("numeric"); - - b.HasKey("UserId"); - - b.HasIndex("ScheduleOwnerId"); - - b.ToTable("BrusherProfile"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Cares") - .HasColumnType("boolean"); - - b.Property("Cut") - .HasColumnType("boolean"); - - b.Property("Dressing") - .HasColumnType("integer"); - - b.Property("Gender") - .HasColumnType("integer"); - - b.Property("Length") - .HasColumnType("integer"); - - b.Property("Shampoo") - .HasColumnType("boolean"); - - b.Property("Tech") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.ToTable("HairPrestation"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestationCollectionItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("PrestationId") - .HasColumnType("bigint"); - - b.Property("QueryId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("PrestationId"); - - b.HasIndex("QueryId"); - - b.ToTable("HairPrestationCollectionItem"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Brand") - .HasColumnType("text"); - - b.Property("ColorId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ColorId"); - - b.ToTable("HairTaint"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairTaintInstance", b => - { - b.Property("TaintId") - .HasColumnType("bigint"); - - b.Property("PrestationId") - .HasColumnType("bigint"); - - b.HasKey("TaintId", "PrestationId"); - - b.HasIndex("PrestationId"); - - b.ToTable("HairTaintInstance"); - }); - - modelBuilder.Entity("Yavsc.Models.IT.Evolution.Feature", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("ShortName") - .HasColumnType("text"); - - b.Property("Status") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.ToTable("Feature"); - }); - - modelBuilder.Entity("Yavsc.Models.IT.Fixing.Bug", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Description") - .IsRequired() - .HasMaxLength(10240) - .HasColumnType("character varying(10240)"); - - b.Property("FeatureId") - .HasColumnType("bigint"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("FeatureId"); - - b.ToTable("Bug"); - }); - - modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b => - { - b.Property("DeviceId") - .HasColumnType("text"); - - b.Property("DeclarationDate") - .ValueGeneratedOnAdd() - .HasColumnType("timestamp with time zone") - .HasDefaultValueSql("LOCALTIMESTAMP"); - - b.Property("DeviceOwnerId") - .IsRequired() - .HasColumnType("text"); - - b.Property("LatestActivityUpdate") - .HasColumnType("timestamp with time zone"); - - b.Property("Model") - .IsRequired() - .HasColumnType("text"); - - b.Property("Platform") - .IsRequired() - .HasColumnType("text"); - - b.Property("Version") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("DeviceId"); - - b.HasIndex("DeviceOwnerId"); - - b.ToTable("DeviceDeclaration"); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.DeclarationFlag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DeclarationId") - .HasColumnType("bigint"); - - b.Property("MatchExcerpt") - .HasMaxLength(100) - .HasColumnType("character varying(100)"); - - b.Property("PatternId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("DeclarationId"); - - b.HasIndex("PatternId"); - - b.ToTable("DeclarationFlag"); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.ModerationLog", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer"); - - b.Property("DeclarationId") - .HasColumnType("bigint"); - - b.Property("ModeratorId") - .HasColumnType("text"); - - b.Property("ScoreDelta") - .HasColumnType("integer"); - - b.Property("Timestamp") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("DeclarationId"); - - b.HasIndex("ModeratorId"); - - b.HasIndex("Timestamp"); - - b.ToTable("ModerationLogs", t => - { - t.HasCheckConstraint("CK_ModerationLog_Immutable", "1=1"); - }); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.RegexAlertPattern", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Description") - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("IsActive") - .HasColumnType("boolean"); - - b.Property("Pattern") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)"); - - b.Property("Severity") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("IsActive"); - - b.ToTable("RegexAlertPatterns"); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.TrustDeclaration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Content") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("DeclarantTokenId") - .HasColumnType("uuid"); - - b.Property("ScoreDelta") - .HasColumnType("integer"); - - b.Property("Sentiment") - .HasColumnType("integer"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("SubmittedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("TrustTokenId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("SubmittedAt"); - - b.HasIndex("TrustTokenId"); - - b.ToTable("TrustDeclarations"); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.TrustToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone"); - - b.Property("TokenHash") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("TokenSource") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("character varying(32)"); - - b.Property("TrustScore") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("TokenHash") - .IsUnique(); - - b.ToTable("TrustTokens"); - }); - - modelBuilder.Entity("Yavsc.Models.Market.Product", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Depth") - .HasColumnType("numeric"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Height") - .HasColumnType("numeric"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Price") - .HasColumnType("numeric"); - - b.Property("Public") - .HasColumnType("boolean"); - - b.Property("Weight") - .HasColumnType("numeric"); - - b.Property("Width") - .HasColumnType("numeric"); - - b.HasKey("Id"); - - b.ToTable("Products"); - }); - - modelBuilder.Entity("Yavsc.Models.Market.Service", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ContextId") - .HasColumnType("text"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Public") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.HasIndex("ContextId"); - - b.ToTable("Services"); - }); - - modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("For") - .HasColumnType("smallint"); - - b.Property("Message") - .HasColumnType("text"); - - b.Property("OwnerId") - .HasColumnType("text"); - - b.Property("Sender") - .HasColumnType("text"); - - b.Property("Topic") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.ToTable("Announce"); - }); - - modelBuilder.Entity("Yavsc.Models.Messaging.DismissClicked", b => - { - b.Property("UserId") - .HasColumnType("text"); - - b.Property("NotificationId") - .HasColumnType("bigint"); - - b.HasKey("UserId", "NotificationId"); - - b.HasIndex("NotificationId"); - - b.ToTable("DismissClicked"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.Instrument", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.HasKey("Id"); - - b.ToTable("Instrument"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.InstrumentRating", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("InstrumentId") - .HasColumnType("bigint"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Rate") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasAlternateKey("InstrumentId", "OwnerId"); - - b.HasIndex("OwnerId"); - - b.ToTable("InstrumentRating"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => - { - b.Property("OwnerProfileId") - .HasColumnType("text"); - - b.Property("DjSettingsUserId") - .HasColumnType("text"); - - b.Property("MusicLoverSettingsUserId") - .HasColumnType("text"); - - b.Property("Rate") - .HasColumnType("integer"); - - b.Property("TendencyId") - .HasColumnType("bigint"); - - b.HasKey("OwnerProfileId"); - - b.HasIndex("DjSettingsUserId"); - - b.HasIndex("MusicLoverSettingsUserId"); - - b.HasIndex("TendencyId"); - - b.ToTable("MusicalPreference"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.MusicalTendency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)"); - - b.HasKey("Id"); - - b.ToTable("MusicalTendency"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.Profiles.DjSettings", b => - { - b.Property("UserId") - .HasColumnType("text"); - - b.Property("SoundCloudId") - .HasColumnType("text"); - - b.HasKey("UserId"); - - b.ToTable("DjSettings"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => - { - b.Property("InstrumentId") - .HasColumnType("bigint"); - - b.Property("UserId") - .HasColumnType("text"); - - b.HasKey("InstrumentId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("Instrumentation"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.Profiles.MusicLoverSettings", b => - { - b.Property("UserId") - .HasColumnType("text"); - - b.HasKey("UserId"); - - b.ToTable("MusicLoverSettings"); - }); - - modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => - { - b.Property("CreationToken") - .HasColumnType("text"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("ExecutorId") - .IsRequired() - .HasColumnType("text"); - - b.Property("OrderReference") - .HasColumnType("text"); - - b.Property("PaypalPayerId") - .HasColumnType("text"); - - b.Property("State") - .HasColumnType("text"); - - b.Property("UserCreated") - .HasColumnType("text"); - - b.Property("UserModified") - .HasColumnType("text"); - - b.HasKey("CreationToken"); - - b.HasIndex("ExecutorId"); - - b.ToTable("PayPalPayment"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ApplicationUserId") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Public") - .HasColumnType("boolean"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("Circle"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => - { - b.Property("MemberId") - .HasColumnType("text"); - - b.Property("CircleId") - .HasColumnType("bigint"); - - b.HasKey("MemberId", "CircleId"); - - b.HasIndex("CircleId"); - - b.ToTable("CircleMembers"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => - { - b.Property("OwnerId") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("text"); - - b.Property("AddressId") - .HasColumnType("bigint"); - - b.Property("ApplicationUserId") - .HasColumnType("text"); - - b.Property("EMail") - .HasColumnType("text"); - - b.Property("Name") - .HasColumnType("text"); - - b.HasKey("OwnerId", "UserId"); - - b.HasIndex("AddressId"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("Contact"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b => - { - b.Property("HRef") - .HasColumnType("text"); - - b.Property("Method") - .HasColumnType("text"); - - b.Property("BrusherProfileUserId") - .HasColumnType("text"); - - b.Property("ContentType") - .HasColumnType("text"); - - b.Property("PayPalPaymentCreationToken") - .HasColumnType("text"); - - b.Property("Rel") - .HasColumnType("text"); - - b.HasKey("HRef", "Method"); - - b.HasIndex("BrusherProfileUserId"); - - b.HasIndex("PayPalPaymentCreationToken"); - - b.ToTable("HyperLink"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.Location", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.Property("Latitude") - .HasColumnType("double precision"); - - b.Property("Longitude") - .HasColumnType("double precision"); - - b.HasKey("Id"); - - b.ToTable("Locations"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.PostalAddress", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("City") - .HasColumnType("text"); - - b.Property("Country") - .HasColumnType("text"); - - b.Property("PostalCode") - .HasColumnType("text"); - - b.Property("Province") - .HasColumnType("text"); - - b.Property("State") - .HasColumnType("text"); - - b.Property("Street1") - .HasColumnType("text"); - - b.Property("Street2") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("PostalAddress"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.Tag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Tags"); - }); - - modelBuilder.Entity("Yavsc.Models.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("text"); - - b.Property("Rate") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.ToTable("SiteSkills"); - }); - - modelBuilder.Entity("Yavsc.Models.Streaming.LiveFlow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DifferedFileName") - .HasColumnType("text"); - - b.Property("MediaType") - .HasColumnType("text"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Pitch") - .HasColumnType("text"); - - b.Property("SequenceNumber") - .HasColumnType("integer"); - - b.Property("Title") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.ToTable("LiveFlow"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => - { - b.Property("Code") - .HasColumnType("text"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .HasColumnType("text"); - - b.Property("Hidden") - .HasColumnType("boolean"); - - b.Property("Moderated") - .HasColumnType("boolean"); - - b.Property("ModeratorGroupName") - .HasColumnType("text"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("ParentCode") - .HasColumnType("text"); - - b.Property("Photo") - .HasColumnType("text"); - - b.Property("Rate") - .HasColumnType("integer"); - - b.Property("SettingsClassName") - .HasColumnType("text"); - - b.Property("UserCreated") - .HasColumnType("text"); - - b.Property("UserModified") - .HasColumnType("text"); - - b.HasKey("Code"); - - b.HasIndex("ParentCode"); - - b.ToTable("Activities"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("FormationSettingsUserId") - .HasColumnType("text"); - - b.Property("PerformerId") - .HasColumnType("text"); - - b.Property("WorkingForId") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("FormationSettingsUserId"); - - b.HasIndex("PerformerId"); - - b.HasIndex("WorkingForId"); - - b.ToTable("CoWorking"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActionName") - .HasColumnType("text"); - - b.Property("ActivityCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("ActivityCode"); - - b.ToTable("CommandForm"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.Country", b => - { - b.Property("Code") - .HasMaxLength(2) - .HasColumnType("character varying(2)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.HasKey("Code"); - - b.ToTable("Countries"); - - b.HasData( - new - { - Code = "fr", - DisplayName = "France" - }, - new - { - Code = "en", - DisplayName = "England" - }, - new - { - Code = "pt", - DisplayName = "Portugal" - }); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.DictionnaireMetier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DomaineActiviteCode") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Langue") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Nom") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("DomaineActiviteCode", "Langue", "Nom") - .IsUnique(); - - b.ToTable("DictionnaireMetier"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.PerformerCodeInputValidation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CountryCode") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("character varying(2)"); - - b.Property("ErrorMessage") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("RegularExpression") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasIndex("CountryCode"); - - b.ToTable("PerformerCodeInputValidations"); - - b.HasData( - new - { - Id = 1L, - CountryCode = "fr", - ErrorMessage = "Le code FR doit contenir entre 9 et 14 chiffres.", - RegularExpression = "^[0-9]{9,14}$" - }, - new - { - Id = 2L, - CountryCode = "en", - ErrorMessage = "Le code EN doit contenir entre 8 et 14 caracteres alphanumeriques.", - RegularExpression = "^[A-Za-z0-9]{8,14}$" - }, - new - { - Id = 3L, - CountryCode = "pt", - ErrorMessage = "Le code PT doit contenir exactement 9 chiffres.", - RegularExpression = "^[0-9]{9}$" - }); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => - { - b.Property("PerformerId") - .HasColumnType("text"); - - b.Property("AcceptNotifications") - .HasColumnType("boolean"); - - b.Property("AcceptPublicContact") - .HasColumnType("boolean"); - - b.Property("Active") - .HasColumnType("boolean"); - - b.Property("ExerciseCountryCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("MaxDailyCost") - .HasColumnType("integer"); - - b.Property("MinDailyCost") - .HasColumnType("integer"); - - b.Property("OrganizationAddressId") - .HasColumnType("bigint"); - - b.Property("Rate") - .HasColumnType("integer"); - - b.Property("SIREN") - .IsRequired() - .HasColumnType("text"); - - b.Property("UseGeoLocalizationToReduceDistanceWithClients") - .HasColumnType("boolean"); - - b.Property("WebSite") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("PerformerId"); - - b.HasIndex("OrganizationAddressId"); - - b.ToTable("Performers"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => - { - b.Property("UserId") - .HasColumnType("text"); - - b.Property("DisplayName") - .HasColumnType("text"); - - b.HasKey("UserId"); - - b.ToTable("FormationSettings"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.TermeMetier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateSoumission") - .HasColumnType("timestamp with time zone"); - - b.Property("DateValidation") - .HasColumnType("timestamp with time zone"); - - b.Property("Definition") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); - - b.Property("DictionnaireMetierId") - .HasColumnType("bigint"); - - b.Property("Langue") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Mot") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProposeParId") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("StatutValidation") - .HasColumnType("integer"); - - b.Property("ValideParId") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.HasKey("Id"); - - b.HasIndex("ProposeParId"); - - b.HasIndex("ValideParId"); - - b.HasIndex("DictionnaireMetierId", "Langue", "Mot") - .IsUnique(); - - b.ToTable("TermeMetier"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => - { - b.Property("DoesCode") - .HasColumnType("text"); - - b.Property("UserId") - .HasColumnType("text"); - - b.Property("Weight") - .HasColumnType("integer"); - - b.HasKey("DoesCode", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("UserActivities"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.Calendar.Period", b => - { - b.Property("Start") - .HasColumnType("timestamp with time zone"); - - b.Property("End") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Start", "End"); - - b.ToTable("Period"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.EMailing.MailingTemplate", b => - { - b.Property("Id") - .HasColumnType("text"); - - b.Property("Body") - .HasMaxLength(65536) - .HasColumnType("character varying(65536)"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("ReplyToAddress") - .HasColumnType("text"); - - b.Property("ToSend") - .HasColumnType("integer"); - - b.Property("Topic") - .HasColumnType("text"); - - b.Property("UserCreated") - .HasColumnType("text"); - - b.Property("UserModified") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("MailingTemplate"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProjectId") - .HasColumnType("bigint"); - - b.HasKey("Id"); - - b.HasIndex("ProjectId"); - - b.ToTable("ProjectBuildConfiguration"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Branch") - .HasColumnType("text"); - - b.Property("OwnerId") - .HasColumnType("text"); - - b.Property("Path") - .IsRequired() - .HasColumnType("text"); - - b.Property("Url") - .HasColumnType("text"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.ToTable("GitRepositoryReference"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => - { - b.HasBaseType("Yavsc.Models.Billing.NominativeServiceCommand"); - - b.Property("AdditionalInfo") - .IsRequired() - .HasColumnType("text"); - - b.Property("EventDate") - .HasColumnType("timestamp with time zone"); - - b.Property("LocationId") - .HasColumnType("bigint"); - - b.Property("PrestationId") - .HasColumnType("bigint"); - - b.Property("SelectedProfileUserId") - .HasColumnType("text"); - - b.HasIndex("LocationId"); - - b.HasIndex("PrestationId"); - - b.HasIndex("SelectedProfileUserId"); - - b.HasDiscriminator().HasValue("HairCutQuery"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => - { - b.HasBaseType("Yavsc.Models.Billing.NominativeServiceCommand"); - - b.Property("EventDate") - .HasColumnType("timestamp with time zone"); - - b.Property("LocationId") - .HasColumnType("bigint"); - - b.HasIndex("LocationId"); - - b.ToTable("NominativeServiceCommand", t => - { - t.Property("EventDate") - .HasColumnName("HairMultiCutQuery_EventDate"); - - t.Property("LocationId") - .HasColumnName("HairMultiCutQuery_LocationId"); - }); - - b.HasDiscriminator().HasValue("HairMultiCutQuery"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => - { - b.HasBaseType("Yavsc.Models.Billing.NominativeServiceCommand"); - - b.Property("EventDate") - .HasColumnType("timestamp with time zone"); - - b.Property("LocationId") - .HasColumnType("bigint"); - - b.Property("LocationType") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.HasIndex("LocationId"); - - b.ToTable("NominativeServiceCommand", t => - { - t.Property("EventDate") - .HasColumnName("RdvQuery_EventDate"); - - t.Property("LocationId") - .HasColumnName("RdvQuery_LocationId"); - }); - - b.HasDiscriminator().HasValue("RdvQuery"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => - { - b.HasBaseType("Yavsc.Models.Billing.NominativeServiceCommand"); - - b.Property("GitId") - .HasColumnType("bigint"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("OwnerId") - .HasColumnType("text"); - - b.Property("Version") - .HasColumnType("text"); - - b.HasIndex("GitId"); - - b.HasDiscriminator().HasValue("Project"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceClaim", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", null) - .WithMany("UserClaims") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", "ApiResource") - .WithMany() - .HasForeignKey("ApiResourceId1"); - - b.Navigation("ApiResource"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceProperty", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", null) - .WithMany("Properties") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", "ApiResource") - .WithMany() - .HasForeignKey("ApiResourceId1"); - - b.Navigation("ApiResource"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceScope", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", null) - .WithMany("Scopes") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", "ApiResource") - .WithMany() - .HasForeignKey("ApiResourceId1"); - - b.Navigation("ApiResource"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceSecret", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", null) - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", "ApiResource") - .WithMany() - .HasForeignKey("ApiResourceId1"); - - b.Navigation("ApiResource"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScopeClaim", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiScope", null) - .WithMany("UserClaims") - .HasForeignKey("ScopeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiScope", "Scope") - .WithMany() - .HasForeignKey("ScopeId1"); - - b.Navigation("Scope"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScopeProperty", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiScope", null) - .WithMany("Properties") - .HasForeignKey("ScopeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.ApiScope", "Scope") - .WithMany() - .HasForeignKey("ScopeId1"); - - b.Navigation("Scope"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientClaim", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client") - .WithMany("Claims") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientCorsOrigin", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", null) - .WithMany("AllowedCorsOrigins") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client") - .WithMany() - .HasForeignKey("ClientId1"); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientGrantType", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client") - .WithMany("AllowedGrantTypes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientIdPRestriction", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", null) - .WithMany("IdentityProviderRestrictions") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client") - .WithMany() - .HasForeignKey("ClientId1"); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", null) - .WithMany("PostLogoutRedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client") - .WithMany() - .HasForeignKey("ClientId1"); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientProperty", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", null) - .WithMany("Properties") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client") - .WithMany() - .HasForeignKey("ClientId1"); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientRedirectUri", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client") - .WithMany("RedirectUris") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientScope", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client") - .WithMany("AllowedScopes") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ClientSecret", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", null) - .WithMany("ClientSecrets") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("IdentityServer8.EntityFramework.Entities.Client", "Client") - .WithMany() - .HasForeignKey("ClientId1"); - - b.Navigation("Client"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResourceClaim", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.IdentityResource", "IdentityResource") - .WithMany("UserClaims") - .HasForeignKey("IdentityResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("IdentityResource"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResourceProperty", b => - { - b.HasOne("IdentityServer8.EntityFramework.Entities.IdentityResource", "IdentityResource") - .WithMany("Properties") - .HasForeignKey("IdentityResourceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("IdentityResource"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Yavsc.Models.Access.Ban", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "TargetUser") - .WithMany() - .HasForeignKey("TargetId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("TargetUser"); - }); - - modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Owner") - .WithMany("BlackList") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Owner"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => - { - b.HasOne("Yavsc.Models.Blog.BlogPost", "Target") - .WithMany("ACL") - .HasForeignKey("BlogPostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Relationship.Circle", "Allowed") - .WithMany() - .HasForeignKey("CircleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Allowed"); - - b.Navigation("Target"); - }); - - modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToFile", b => - { - b.HasOne("Yavsc.Models.Relationship.Circle", "Allowed") - .WithMany() - .HasForeignKey("CircleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Allowed"); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Yavsc.Models.AccountBalance", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Owner") - .WithOne("AccountBalance") - .HasForeignKey("Yavsc.Models.AccountBalance", "UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => - { - b.HasOne("Yavsc.Models.Relationship.Location", "PostalAddress") - .WithMany() - .HasForeignKey("PostalAddressId"); - - b.Navigation("PostalAddress"); - }); - - modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => - { - b.HasOne("Yavsc.Models.AccountBalance", "Balance") - .WithMany() - .HasForeignKey("BalanceId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Balance"); - }); - - modelBuilder.Entity("Yavsc.Models.Bank.BankIdentity", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "User") - .WithMany("BankInfo") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => - { - b.HasOne("Yavsc.Models.Billing.Estimate", null) - .WithMany("Bill") - .HasForeignKey("EstimateId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Billing.EstimateTemplate", null) - .WithMany("Bill") - .HasForeignKey("EstimateTemplateId"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Client") - .WithMany() - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Billing.NominativeServiceCommand", "Query") - .WithMany() - .HasForeignKey("CommandId"); - - b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Owner") - .WithMany() - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Owner"); - - b.Navigation("Query"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.NominativeServiceCommand", b => - { - b.HasOne("Yavsc.Models.Workflow.Activity", "Context") - .WithMany() - .HasForeignKey("ActivityCode") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "Client") - .WithMany() - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularization") - .WithMany() - .HasForeignKey("PaymentId"); - - b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") - .WithMany() - .HasForeignKey("PerformerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Context"); - - b.Navigation("PerformerProfile"); - - b.Navigation("Regularization"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.Signature", b => - { - b.HasOne("Yavsc.Models.Billing.Estimate", "Estimate") - .WithMany("Signatures") - .HasForeignKey("EstimateId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "Signer") - .WithMany() - .HasForeignKey("SignerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Estimate"); - - b.Navigation("Signer"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.BlogAttachedFile", b => - { - b.HasOne("Yavsc.Models.Blog.UploadedFile", "File") - .WithMany() - .HasForeignKey("FileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") - .WithMany() - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("File"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Author") - .WithMany("Posts") - .HasForeignKey("AuthorId") - .OnDelete(DeleteBehavior.Restrict); - - b.Navigation("Author"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.BlogTag", b => - { - b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") - .WithMany("Tags") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Relationship.Tag", "Tag") - .WithMany() - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Post"); - - b.Navigation("Tag"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Author") - .WithMany("BlogComments") - .HasForeignKey("AuthorId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Yavsc.Models.Blog.Comment", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId"); - - b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") - .WithMany("Comments") - .HasForeignKey("ReceiverId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Author"); - - b.Navigation("Parent"); - - b.Navigation("Post"); - }); - - modelBuilder.Entity("Yavsc.Models.BlogSpotPublication", b => - { - b.HasOne("Yavsc.Models.Blog.BlogPost", "BlogPost") - .WithMany() - .HasForeignKey("BlogpostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BlogPost"); - }); - - modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Yavsc.Models.Calendar.ScheduledEvent", b => - { - b.HasOne("Yavsc.Models.Calendar.Schedule", null) - .WithMany("Events") - .HasForeignKey("ScheduleOwnerId"); - - b.HasOne("Yavsc.Server.Models.Calendar.Period", "Period") - .WithMany() - .HasForeignKey("PeriodStart", "PeriodEnd"); - - b.Navigation("Period"); - }); - - modelBuilder.Entity("Yavsc.Models.Chat.ChatConnection", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Owner") - .WithMany("Connections") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Owner") - .WithMany("Rooms") - .HasForeignKey("OwnerId"); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b => - { - b.HasOne("Yavsc.Models.Chat.ChatRoom", "Room") - .WithMany("Moderation") - .HasForeignKey("ChannelName") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "User") - .WithMany("RoomAccess") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Room"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => - { - b.HasOne("Yavsc.Models.Calendar.Schedule", "Schedule") - .WithMany() - .HasForeignKey("ScheduleOwnerId"); - - b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "BaseProfile") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BaseProfile"); - - b.Navigation("Schedule"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestationCollectionItem", b => - { - b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") - .WithMany() - .HasForeignKey("PrestationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Haircut.HairMultiCutQuery", "Query") - .WithMany("Prestations") - .HasForeignKey("QueryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prestation"); - - b.Navigation("Query"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => - { - b.HasOne("Yavsc.Models.Drawing.Color", "Color") - .WithMany() - .HasForeignKey("ColorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Color"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairTaintInstance", b => - { - b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") - .WithMany("Taints") - .HasForeignKey("PrestationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Haircut.HairTaint", "Taint") - .WithMany() - .HasForeignKey("TaintId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Prestation"); - - b.Navigation("Taint"); - }); - - modelBuilder.Entity("Yavsc.Models.IT.Fixing.Bug", b => - { - b.HasOne("Yavsc.Models.IT.Evolution.Feature", "False") - .WithMany() - .HasForeignKey("FeatureId"); - - b.Navigation("False"); - }); - - modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "DeviceOwner") - .WithMany("DeviceDeclaration") - .HasForeignKey("DeviceOwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("DeviceOwner"); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.DeclarationFlag", b => - { - b.HasOne("Yavsc.Models.Kyc.TrustDeclaration", "Declaration") - .WithMany("Flags") - .HasForeignKey("DeclarationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Kyc.RegexAlertPattern", "Pattern") - .WithMany() - .HasForeignKey("PatternId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Declaration"); - - b.Navigation("Pattern"); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.ModerationLog", b => - { - b.HasOne("Yavsc.Models.Kyc.TrustDeclaration", "Declaration") - .WithMany() - .HasForeignKey("DeclarationId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Declaration"); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.TrustDeclaration", b => - { - b.HasOne("Yavsc.Models.Kyc.TrustToken", "Subject") - .WithMany("Declarations") - .HasForeignKey("TrustTokenId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Subject"); - }); - - modelBuilder.Entity("Yavsc.Models.Market.Service", b => - { - b.HasOne("Yavsc.Models.Workflow.Activity", "Context") - .WithMany("Services") - .HasForeignKey("ContextId"); - - b.Navigation("Context"); - }); - - modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Yavsc.Models.Messaging.DismissClicked", b => - { - b.HasOne("Yavsc.Abstract.Models.Messaging.Notification", "Notified") - .WithMany() - .HasForeignKey("NotificationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Notified"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.InstrumentRating", b => - { - b.HasOne("Yavsc.Models.Musical.Instrument", "Instrument") - .WithMany() - .HasForeignKey("InstrumentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Profile") - .WithMany() - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Instrument"); - - b.Navigation("Profile"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => - { - b.HasOne("Yavsc.Models.Musical.Profiles.DjSettings", null) - .WithMany("SoundColor") - .HasForeignKey("DjSettingsUserId"); - - b.HasOne("Yavsc.Models.Musical.Profiles.MusicLoverSettings", null) - .WithMany("SoundColor") - .HasForeignKey("MusicLoverSettingsUserId"); - - b.HasOne("Yavsc.Models.Musical.MusicalTendency", "MusicalTendency") - .WithMany() - .HasForeignKey("TendencyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("MusicalTendency"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => - { - b.HasOne("Yavsc.Models.Musical.Instrument", "Tool") - .WithMany() - .HasForeignKey("InstrumentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Tool"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Executor") - .WithMany() - .HasForeignKey("ExecutorId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Executor"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", null) - .WithMany("Circles") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => - { - b.HasOne("Yavsc.Models.Relationship.Circle", "Circle") - .WithMany("Members") - .HasForeignKey("CircleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "Member") - .WithMany("Membership") - .HasForeignKey("MemberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Circle"); - - b.Navigation("Member"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => - { - b.HasOne("Yavsc.Models.Relationship.PostalAddress", "PostalAddress") - .WithMany() - .HasForeignKey("AddressId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", null) - .WithMany("Book") - .HasForeignKey("ApplicationUserId"); - - b.Navigation("PostalAddress"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b => - { - b.HasOne("Yavsc.Models.Haircut.BrusherProfile", null) - .WithMany("Links") - .HasForeignKey("BrusherProfileUserId"); - - b.HasOne("Yavsc.Models.Payment.PayPalPayment", null) - .WithMany("Links") - .HasForeignKey("PayPalPaymentCreationToken"); - }); - - modelBuilder.Entity("Yavsc.Models.Streaming.LiveFlow", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => - { - b.HasOne("Yavsc.Models.Workflow.Activity", "Parent") - .WithMany("Children") - .HasForeignKey("ParentCode"); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => - { - b.HasOne("Yavsc.Models.Workflow.Profiles.FormationSettings", null) - .WithMany("CoWorking") - .HasForeignKey("FormationSettingsUserId"); - - b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Performer") - .WithMany() - .HasForeignKey("PerformerId"); - - b.HasOne("Yavsc.Models.ApplicationUser", "WorkingFor") - .WithMany() - .HasForeignKey("WorkingForId"); - - b.Navigation("Performer"); - - b.Navigation("WorkingFor"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => - { - b.HasOne("Yavsc.Models.Workflow.Activity", "Context") - .WithMany("Forms") - .HasForeignKey("ActivityCode") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Context"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.DictionnaireMetier", b => - { - b.HasOne("Yavsc.Models.Workflow.Activity", "DomaineActivite") - .WithMany() - .HasForeignKey("DomaineActiviteCode") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("DomaineActivite"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.PerformerCodeInputValidation", b => - { - b.HasOne("Yavsc.Models.Workflow.Country", "Country") - .WithMany() - .HasForeignKey("CountryCode") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("Country"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => - { - b.HasOne("Yavsc.Models.Relationship.Location", "OrganizationAddress") - .WithMany() - .HasForeignKey("OrganizationAddressId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "Performer") - .WithMany() - .HasForeignKey("PerformerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("OrganizationAddress"); - - b.Navigation("Performer"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.TermeMetier", b => - { - b.HasOne("Yavsc.Models.Workflow.DictionnaireMetier", "DictionnaireMetier") - .WithMany("Termes") - .HasForeignKey("DictionnaireMetierId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "ProposePar") - .WithMany() - .HasForeignKey("ProposeParId"); - - b.HasOne("Yavsc.Models.ApplicationUser", "ValidePar") - .WithMany() - .HasForeignKey("ValideParId"); - - b.Navigation("DictionnaireMetier"); - - b.Navigation("ProposePar"); - - b.Navigation("ValidePar"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => - { - b.HasOne("Yavsc.Models.Workflow.Activity", "Does") - .WithMany() - .HasForeignKey("DoesCode") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "User") - .WithMany("Activity") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Does"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => - { - b.HasOne("Yavsc.Server.Models.IT.Project", "TargetProject") - .WithMany("Configurations") - .HasForeignKey("ProjectId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("TargetProject"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => - { - b.HasOne("Yavsc.Models.Relationship.Location", "Location") - .WithMany() - .HasForeignKey("LocationId"); - - b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") - .WithMany() - .HasForeignKey("PrestationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Haircut.BrusherProfile", "SelectedProfile") - .WithMany() - .HasForeignKey("SelectedProfileUserId"); - - b.Navigation("Location"); - - b.Navigation("Prestation"); - - b.Navigation("SelectedProfile"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => - { - b.HasOne("Yavsc.Models.Relationship.Location", "Location") - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => - { - b.HasOne("Yavsc.Models.Relationship.Location", "Location") - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => - { - b.HasOne("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", "Repository") - .WithMany() - .HasForeignKey("GitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Repository"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResource", b => - { - b.Navigation("Properties"); - - b.Navigation("Scopes"); - - b.Navigation("Secrets"); - - b.Navigation("UserClaims"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiScope", b => - { - b.Navigation("Properties"); - - b.Navigation("UserClaims"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.Client", b => - { - b.Navigation("AllowedCorsOrigins"); - - b.Navigation("AllowedGrantTypes"); - - b.Navigation("AllowedScopes"); - - b.Navigation("Claims"); - - b.Navigation("ClientSecrets"); - - b.Navigation("IdentityProviderRestrictions"); - - b.Navigation("PostLogoutRedirectUris"); - - b.Navigation("Properties"); - - b.Navigation("RedirectUris"); - }); - - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.IdentityResource", b => - { - b.Navigation("Properties"); - - b.Navigation("UserClaims"); - }); - - modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => - { - b.Navigation("AccountBalance"); - - b.Navigation("BankInfo"); - - b.Navigation("BlackList"); - - b.Navigation("BlogComments"); - - b.Navigation("Book"); - - b.Navigation("Circles"); - - b.Navigation("Connections"); - - b.Navigation("DeviceDeclaration"); - - b.Navigation("Membership"); - - b.Navigation("Posts"); - - b.Navigation("RoomAccess"); - - b.Navigation("Rooms"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => - { - b.Navigation("Bill"); - - b.Navigation("Signatures"); - }); - - modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => - { - b.Navigation("Bill"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => - { - b.Navigation("ACL"); - - b.Navigation("Comments"); - - b.Navigation("Tags"); - }); - - modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => - { - b.Navigation("Children"); - }); - - modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => - { - b.Navigation("Events"); - }); - - modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => - { - b.Navigation("Moderation"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => - { - b.Navigation("Links"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => - { - b.Navigation("Taints"); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.TrustDeclaration", b => - { - b.Navigation("Flags"); - }); - - modelBuilder.Entity("Yavsc.Models.Kyc.TrustToken", b => - { - b.Navigation("Declarations"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.Profiles.DjSettings", b => - { - b.Navigation("SoundColor"); - }); - - modelBuilder.Entity("Yavsc.Models.Musical.Profiles.MusicLoverSettings", b => - { - b.Navigation("SoundColor"); - }); - - modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => - { - b.Navigation("Links"); - }); - - modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => - { - b.Navigation("Members"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => - { - b.Navigation("Children"); - - b.Navigation("Forms"); - - b.Navigation("Services"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.DictionnaireMetier", b => - { - b.Navigation("Termes"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => - { - b.Navigation("Activity"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => - { - b.Navigation("CoWorking"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => - { - b.Navigation("Prestations"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => - { - b.Navigation("Configurations"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Yavsc.Org/Migrations/20260912114726_genericEstimate.cs b/src/Yavsc.Org/Migrations/20260912114726_genericEstimate.cs deleted file mode 100644 index cc463e401..000000000 --- a/src/Yavsc.Org/Migrations/20260912114726_genericEstimate.cs +++ /dev/null @@ -1,944 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace Yavsc.Migrations -{ - /// - public partial class genericEstimate : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Estimates_RdvQueries_CommandId", - table: "Estimates"); - - migrationBuilder.DropForeignKey( - name: "FK_HairPrestationCollectionItem_HairMultiCutQueries_QueryId", - table: "HairPrestationCollectionItem"); - - migrationBuilder.DropForeignKey( - name: "FK_ProjectBuildConfiguration_Project_ProjectId", - table: "ProjectBuildConfiguration"); - - migrationBuilder.DropForeignKey( - name: "FK_RdvQueries_Activities_ActivityCode", - table: "RdvQueries"); - - migrationBuilder.DropForeignKey( - name: "FK_RdvQueries_AspNetUsers_ClientId", - table: "RdvQueries"); - - migrationBuilder.DropForeignKey( - name: "FK_RdvQueries_Locations_LocationId", - table: "RdvQueries"); - - migrationBuilder.DropForeignKey( - name: "FK_RdvQueries_PayPalPayment_PaymentId", - table: "RdvQueries"); - - migrationBuilder.DropForeignKey( - name: "FK_RdvQueries_Performers_PerformerId", - table: "RdvQueries"); - - migrationBuilder.DropTable( - name: "HairCutQueries"); - - migrationBuilder.DropTable( - name: "HairMultiCutQueries"); - - migrationBuilder.DropTable( - name: "Project"); - - migrationBuilder.DropPrimaryKey( - name: "PK_RdvQueries", - table: "RdvQueries"); - - migrationBuilder.RenameTable( - name: "RdvQueries", - newName: "NominativeServiceCommand"); - - migrationBuilder.RenameIndex( - name: "IX_RdvQueries_PerformerId", - table: "NominativeServiceCommand", - newName: "IX_NominativeServiceCommand_PerformerId"); - - migrationBuilder.RenameIndex( - name: "IX_RdvQueries_PaymentId", - table: "NominativeServiceCommand", - newName: "IX_NominativeServiceCommand_PaymentId"); - - migrationBuilder.RenameIndex( - name: "IX_RdvQueries_LocationId", - table: "NominativeServiceCommand", - newName: "IX_NominativeServiceCommand_LocationId"); - - migrationBuilder.RenameIndex( - name: "IX_RdvQueries_ClientId", - table: "NominativeServiceCommand", - newName: "IX_NominativeServiceCommand_ClientId"); - - migrationBuilder.RenameIndex( - name: "IX_RdvQueries_ActivityCode", - table: "NominativeServiceCommand", - newName: "IX_NominativeServiceCommand_ActivityCode"); - - migrationBuilder.AlterColumn( - name: "Reason", - table: "NominativeServiceCommand", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "LocationType", - table: "NominativeServiceCommand", - type: "integer", - nullable: true, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "LocationId", - table: "NominativeServiceCommand", - type: "bigint", - nullable: true, - oldClrType: typeof(long), - oldType: "bigint"); - - migrationBuilder.AlterColumn( - name: "EventDate", - table: "NominativeServiceCommand", - type: "timestamp with time zone", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "timestamp with time zone"); - - migrationBuilder.AddColumn( - name: "AdditionalInfo", - table: "NominativeServiceCommand", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "Discriminator", - table: "NominativeServiceCommand", - type: "character varying(34)", - maxLength: 34, - nullable: false, - defaultValue: ""); - - migrationBuilder.AddColumn( - name: "GitId", - table: "NominativeServiceCommand", - type: "bigint", - nullable: true); - - migrationBuilder.AddColumn( - name: "HairMultiCutQuery_EventDate", - table: "NominativeServiceCommand", - type: "timestamp with time zone", - nullable: true); - - migrationBuilder.AddColumn( - name: "HairMultiCutQuery_LocationId", - table: "NominativeServiceCommand", - type: "bigint", - nullable: true); - - migrationBuilder.AddColumn( - name: "Name", - table: "NominativeServiceCommand", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "OwnerId", - table: "NominativeServiceCommand", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "PrestationId", - table: "NominativeServiceCommand", - type: "bigint", - nullable: true); - - migrationBuilder.AddColumn( - name: "RdvQuery_EventDate", - table: "NominativeServiceCommand", - type: "timestamp with time zone", - nullable: true); - - migrationBuilder.AddColumn( - name: "RdvQuery_LocationId", - table: "NominativeServiceCommand", - type: "bigint", - nullable: true); - - migrationBuilder.AddColumn( - name: "SelectedProfileUserId", - table: "NominativeServiceCommand", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "Version", - table: "NominativeServiceCommand", - type: "text", - nullable: true); - - migrationBuilder.AddPrimaryKey( - name: "PK_NominativeServiceCommand", - table: "NominativeServiceCommand", - column: "Id"); - - migrationBuilder.CreateTable( - name: "DictionnaireMetier", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - Nom = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - Langue = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), - DomaineActiviteCode = table.Column(type: "character varying(128)", maxLength: 128, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_DictionnaireMetier", x => x.Id); - table.ForeignKey( - name: "FK_DictionnaireMetier_Activities_DomaineActiviteCode", - column: x => x.DomaineActiviteCode, - principalTable: "Activities", - principalColumn: "Code", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "TermeMetier", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - DictionnaireMetierId = table.Column(type: "bigint", nullable: false), - Mot = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - Definition = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), - Langue = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), - StatutValidation = table.Column(type: "integer", nullable: false), - ProposeParId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - ValideParId = table.Column(type: "character varying(450)", maxLength: 450, nullable: true), - DateSoumission = table.Column(type: "timestamp with time zone", nullable: false), - DateValidation = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_TermeMetier", x => x.Id); - table.ForeignKey( - name: "FK_TermeMetier_AspNetUsers_ProposeParId", - column: x => x.ProposeParId, - principalTable: "AspNetUsers", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_TermeMetier_AspNetUsers_ValideParId", - column: x => x.ValideParId, - principalTable: "AspNetUsers", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_TermeMetier_DictionnaireMetier_DictionnaireMetierId", - column: x => x.DictionnaireMetierId, - principalTable: "DictionnaireMetier", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_NominativeServiceCommand_GitId", - table: "NominativeServiceCommand", - column: "GitId"); - - migrationBuilder.CreateIndex( - name: "IX_NominativeServiceCommand_HairMultiCutQuery_LocationId", - table: "NominativeServiceCommand", - column: "HairMultiCutQuery_LocationId"); - - migrationBuilder.CreateIndex( - name: "IX_NominativeServiceCommand_PrestationId", - table: "NominativeServiceCommand", - column: "PrestationId"); - - migrationBuilder.CreateIndex( - name: "IX_NominativeServiceCommand_RdvQuery_LocationId", - table: "NominativeServiceCommand", - column: "RdvQuery_LocationId"); - - migrationBuilder.CreateIndex( - name: "IX_NominativeServiceCommand_SelectedProfileUserId", - table: "NominativeServiceCommand", - column: "SelectedProfileUserId"); - - migrationBuilder.CreateIndex( - name: "IX_DictionnaireMetier_DomaineActiviteCode_Langue_Nom", - table: "DictionnaireMetier", - columns: new[] { "DomaineActiviteCode", "Langue", "Nom" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_TermeMetier_DictionnaireMetierId_Langue_Mot", - table: "TermeMetier", - columns: new[] { "DictionnaireMetierId", "Langue", "Mot" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_TermeMetier_ProposeParId", - table: "TermeMetier", - column: "ProposeParId"); - - migrationBuilder.CreateIndex( - name: "IX_TermeMetier_ValideParId", - table: "TermeMetier", - column: "ValideParId"); - - migrationBuilder.AddForeignKey( - name: "FK_Estimates_NominativeServiceCommand_CommandId", - table: "Estimates", - column: "CommandId", - principalTable: "NominativeServiceCommand", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_HairPrestationCollectionItem_NominativeServiceCommand_Query~", - table: "HairPrestationCollectionItem", - column: "QueryId", - principalTable: "NominativeServiceCommand", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_Activities_ActivityCode", - table: "NominativeServiceCommand", - column: "ActivityCode", - principalTable: "Activities", - principalColumn: "Code", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_AspNetUsers_ClientId", - table: "NominativeServiceCommand", - column: "ClientId", - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_BrusherProfile_SelectedProfileUser~", - table: "NominativeServiceCommand", - column: "SelectedProfileUserId", - principalTable: "BrusherProfile", - principalColumn: "UserId"); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_GitRepositoryReference_GitId", - table: "NominativeServiceCommand", - column: "GitId", - principalTable: "GitRepositoryReference", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_HairPrestation_PrestationId", - table: "NominativeServiceCommand", - column: "PrestationId", - principalTable: "HairPrestation", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_Locations_HairMultiCutQuery_Locati~", - table: "NominativeServiceCommand", - column: "HairMultiCutQuery_LocationId", - principalTable: "Locations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_Locations_LocationId", - table: "NominativeServiceCommand", - column: "LocationId", - principalTable: "Locations", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_Locations_RdvQuery_LocationId", - table: "NominativeServiceCommand", - column: "RdvQuery_LocationId", - principalTable: "Locations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_PayPalPayment_PaymentId", - table: "NominativeServiceCommand", - column: "PaymentId", - principalTable: "PayPalPayment", - principalColumn: "CreationToken"); - - migrationBuilder.AddForeignKey( - name: "FK_NominativeServiceCommand_Performers_PerformerId", - table: "NominativeServiceCommand", - column: "PerformerId", - principalTable: "Performers", - principalColumn: "PerformerId", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ProjectBuildConfiguration_NominativeServiceCommand_ProjectId", - table: "ProjectBuildConfiguration", - column: "ProjectId", - principalTable: "NominativeServiceCommand", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Estimates_NominativeServiceCommand_CommandId", - table: "Estimates"); - - migrationBuilder.DropForeignKey( - name: "FK_HairPrestationCollectionItem_NominativeServiceCommand_Query~", - table: "HairPrestationCollectionItem"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_Activities_ActivityCode", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_AspNetUsers_ClientId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_BrusherProfile_SelectedProfileUser~", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_GitRepositoryReference_GitId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_HairPrestation_PrestationId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_Locations_HairMultiCutQuery_Locati~", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_Locations_LocationId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_Locations_RdvQuery_LocationId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_PayPalPayment_PaymentId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_NominativeServiceCommand_Performers_PerformerId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropForeignKey( - name: "FK_ProjectBuildConfiguration_NominativeServiceCommand_ProjectId", - table: "ProjectBuildConfiguration"); - - migrationBuilder.DropTable( - name: "TermeMetier"); - - migrationBuilder.DropTable( - name: "DictionnaireMetier"); - - migrationBuilder.DropPrimaryKey( - name: "PK_NominativeServiceCommand", - table: "NominativeServiceCommand"); - - migrationBuilder.DropIndex( - name: "IX_NominativeServiceCommand_GitId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropIndex( - name: "IX_NominativeServiceCommand_HairMultiCutQuery_LocationId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropIndex( - name: "IX_NominativeServiceCommand_PrestationId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropIndex( - name: "IX_NominativeServiceCommand_RdvQuery_LocationId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropIndex( - name: "IX_NominativeServiceCommand_SelectedProfileUserId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "AdditionalInfo", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "Discriminator", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "GitId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "HairMultiCutQuery_EventDate", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "HairMultiCutQuery_LocationId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "Name", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "OwnerId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "PrestationId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "RdvQuery_EventDate", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "RdvQuery_LocationId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "SelectedProfileUserId", - table: "NominativeServiceCommand"); - - migrationBuilder.DropColumn( - name: "Version", - table: "NominativeServiceCommand"); - - migrationBuilder.RenameTable( - name: "NominativeServiceCommand", - newName: "RdvQueries"); - - migrationBuilder.RenameIndex( - name: "IX_NominativeServiceCommand_PerformerId", - table: "RdvQueries", - newName: "IX_RdvQueries_PerformerId"); - - migrationBuilder.RenameIndex( - name: "IX_NominativeServiceCommand_PaymentId", - table: "RdvQueries", - newName: "IX_RdvQueries_PaymentId"); - - migrationBuilder.RenameIndex( - name: "IX_NominativeServiceCommand_LocationId", - table: "RdvQueries", - newName: "IX_RdvQueries_LocationId"); - - migrationBuilder.RenameIndex( - name: "IX_NominativeServiceCommand_ClientId", - table: "RdvQueries", - newName: "IX_RdvQueries_ClientId"); - - migrationBuilder.RenameIndex( - name: "IX_NominativeServiceCommand_ActivityCode", - table: "RdvQueries", - newName: "IX_RdvQueries_ActivityCode"); - - migrationBuilder.AlterColumn( - name: "Reason", - table: "RdvQueries", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "LocationType", - table: "RdvQueries", - type: "integer", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "integer", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "LocationId", - table: "RdvQueries", - type: "bigint", - nullable: false, - defaultValue: 0L, - oldClrType: typeof(long), - oldType: "bigint", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "EventDate", - table: "RdvQueries", - type: "timestamp with time zone", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - oldClrType: typeof(DateTime), - oldType: "timestamp with time zone", - oldNullable: true); - - migrationBuilder.AddPrimaryKey( - name: "PK_RdvQueries", - table: "RdvQueries", - column: "Id"); - - migrationBuilder.CreateTable( - name: "HairCutQueries", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ActivityCode = table.Column(type: "text", nullable: false), - ClientId = table.Column(type: "text", nullable: false), - LocationId = table.Column(type: "bigint", nullable: true), - PaymentId = table.Column(type: "text", nullable: true), - PerformerId = table.Column(type: "text", nullable: false), - PrestationId = table.Column(type: "bigint", nullable: false), - SelectedProfileUserId = table.Column(type: "text", nullable: true), - AdditionalInfo = table.Column(type: "text", nullable: false), - Consent = table.Column(type: "boolean", nullable: false), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false), - DateModified = table.Column(type: "timestamp with time zone", nullable: false), - Description = table.Column(type: "text", nullable: false), - EventDate = table.Column(type: "timestamp with time zone", nullable: true), - Provisional = table.Column(type: "numeric", nullable: true), - Status = table.Column(type: "integer", nullable: false), - UserCreated = table.Column(type: "text", nullable: false), - UserModified = table.Column(type: "text", nullable: false), - ValidationDate = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_HairCutQueries", x => x.Id); - table.ForeignKey( - name: "FK_HairCutQueries_Activities_ActivityCode", - column: x => x.ActivityCode, - principalTable: "Activities", - principalColumn: "Code", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_HairCutQueries_AspNetUsers_ClientId", - column: x => x.ClientId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_HairCutQueries_BrusherProfile_SelectedProfileUserId", - column: x => x.SelectedProfileUserId, - principalTable: "BrusherProfile", - principalColumn: "UserId"); - table.ForeignKey( - name: "FK_HairCutQueries_HairPrestation_PrestationId", - column: x => x.PrestationId, - principalTable: "HairPrestation", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_HairCutQueries_Locations_LocationId", - column: x => x.LocationId, - principalTable: "Locations", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_HairCutQueries_PayPalPayment_PaymentId", - column: x => x.PaymentId, - principalTable: "PayPalPayment", - principalColumn: "CreationToken"); - table.ForeignKey( - name: "FK_HairCutQueries_Performers_PerformerId", - column: x => x.PerformerId, - principalTable: "Performers", - principalColumn: "PerformerId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "HairMultiCutQueries", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ActivityCode = table.Column(type: "text", nullable: false), - ClientId = table.Column(type: "text", nullable: false), - LocationId = table.Column(type: "bigint", nullable: false), - PaymentId = table.Column(type: "text", nullable: true), - PerformerId = table.Column(type: "text", nullable: false), - Consent = table.Column(type: "boolean", nullable: false), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false), - DateModified = table.Column(type: "timestamp with time zone", nullable: false), - Description = table.Column(type: "text", nullable: false), - EventDate = table.Column(type: "timestamp with time zone", nullable: false), - Provisional = table.Column(type: "numeric", nullable: true), - Status = table.Column(type: "integer", nullable: false), - UserCreated = table.Column(type: "text", nullable: false), - UserModified = table.Column(type: "text", nullable: false), - ValidationDate = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_HairMultiCutQueries", x => x.Id); - table.ForeignKey( - name: "FK_HairMultiCutQueries_Activities_ActivityCode", - column: x => x.ActivityCode, - principalTable: "Activities", - principalColumn: "Code", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_HairMultiCutQueries_AspNetUsers_ClientId", - column: x => x.ClientId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_HairMultiCutQueries_Locations_LocationId", - column: x => x.LocationId, - principalTable: "Locations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_HairMultiCutQueries_PayPalPayment_PaymentId", - column: x => x.PaymentId, - principalTable: "PayPalPayment", - principalColumn: "CreationToken"); - table.ForeignKey( - name: "FK_HairMultiCutQueries_Performers_PerformerId", - column: x => x.PerformerId, - principalTable: "Performers", - principalColumn: "PerformerId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Project", - columns: table => new - { - Id = table.Column(type: "bigint", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - ActivityCode = table.Column(type: "text", nullable: false), - ClientId = table.Column(type: "text", nullable: false), - GitId = table.Column(type: "bigint", nullable: false), - PaymentId = table.Column(type: "text", nullable: true), - PerformerId = table.Column(type: "text", nullable: false), - Consent = table.Column(type: "boolean", nullable: false), - DateCreated = table.Column(type: "timestamp with time zone", nullable: false), - DateModified = table.Column(type: "timestamp with time zone", nullable: false), - Description = table.Column(type: "text", nullable: true), - Name = table.Column(type: "text", nullable: false), - OwnerId = table.Column(type: "text", nullable: true), - Provisional = table.Column(type: "numeric", nullable: true), - Status = table.Column(type: "integer", nullable: false), - UserCreated = table.Column(type: "text", nullable: false), - UserModified = table.Column(type: "text", nullable: false), - ValidationDate = table.Column(type: "timestamp with time zone", nullable: true), - Version = table.Column(type: "text", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Project", x => x.Id); - table.ForeignKey( - name: "FK_Project_Activities_ActivityCode", - column: x => x.ActivityCode, - principalTable: "Activities", - principalColumn: "Code", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Project_AspNetUsers_ClientId", - column: x => x.ClientId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Project_GitRepositoryReference_GitId", - column: x => x.GitId, - principalTable: "GitRepositoryReference", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Project_PayPalPayment_PaymentId", - column: x => x.PaymentId, - principalTable: "PayPalPayment", - principalColumn: "CreationToken"); - table.ForeignKey( - name: "FK_Project_Performers_PerformerId", - column: x => x.PerformerId, - principalTable: "Performers", - principalColumn: "PerformerId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_HairCutQueries_ActivityCode", - table: "HairCutQueries", - column: "ActivityCode"); - - migrationBuilder.CreateIndex( - name: "IX_HairCutQueries_ClientId", - table: "HairCutQueries", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_HairCutQueries_LocationId", - table: "HairCutQueries", - column: "LocationId"); - - migrationBuilder.CreateIndex( - name: "IX_HairCutQueries_PaymentId", - table: "HairCutQueries", - column: "PaymentId"); - - migrationBuilder.CreateIndex( - name: "IX_HairCutQueries_PerformerId", - table: "HairCutQueries", - column: "PerformerId"); - - migrationBuilder.CreateIndex( - name: "IX_HairCutQueries_PrestationId", - table: "HairCutQueries", - column: "PrestationId"); - - migrationBuilder.CreateIndex( - name: "IX_HairCutQueries_SelectedProfileUserId", - table: "HairCutQueries", - column: "SelectedProfileUserId"); - - migrationBuilder.CreateIndex( - name: "IX_HairMultiCutQueries_ActivityCode", - table: "HairMultiCutQueries", - column: "ActivityCode"); - - migrationBuilder.CreateIndex( - name: "IX_HairMultiCutQueries_ClientId", - table: "HairMultiCutQueries", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_HairMultiCutQueries_LocationId", - table: "HairMultiCutQueries", - column: "LocationId"); - - migrationBuilder.CreateIndex( - name: "IX_HairMultiCutQueries_PaymentId", - table: "HairMultiCutQueries", - column: "PaymentId"); - - migrationBuilder.CreateIndex( - name: "IX_HairMultiCutQueries_PerformerId", - table: "HairMultiCutQueries", - column: "PerformerId"); - - migrationBuilder.CreateIndex( - name: "IX_Project_ActivityCode", - table: "Project", - column: "ActivityCode"); - - migrationBuilder.CreateIndex( - name: "IX_Project_ClientId", - table: "Project", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_Project_GitId", - table: "Project", - column: "GitId"); - - migrationBuilder.CreateIndex( - name: "IX_Project_PaymentId", - table: "Project", - column: "PaymentId"); - - migrationBuilder.CreateIndex( - name: "IX_Project_PerformerId", - table: "Project", - column: "PerformerId"); - - migrationBuilder.AddForeignKey( - name: "FK_Estimates_RdvQueries_CommandId", - table: "Estimates", - column: "CommandId", - principalTable: "RdvQueries", - principalColumn: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_HairPrestationCollectionItem_HairMultiCutQueries_QueryId", - table: "HairPrestationCollectionItem", - column: "QueryId", - principalTable: "HairMultiCutQueries", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ProjectBuildConfiguration_Project_ProjectId", - table: "ProjectBuildConfiguration", - column: "ProjectId", - principalTable: "Project", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RdvQueries_Activities_ActivityCode", - table: "RdvQueries", - column: "ActivityCode", - principalTable: "Activities", - principalColumn: "Code", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RdvQueries_AspNetUsers_ClientId", - table: "RdvQueries", - column: "ClientId", - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RdvQueries_Locations_LocationId", - table: "RdvQueries", - column: "LocationId", - principalTable: "Locations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RdvQueries_PayPalPayment_PaymentId", - table: "RdvQueries", - column: "PaymentId", - principalTable: "PayPalPayment", - principalColumn: "CreationToken"); - - migrationBuilder.AddForeignKey( - name: "FK_RdvQueries_Performers_PerformerId", - table: "RdvQueries", - column: "PerformerId", - principalTable: "Performers", - principalColumn: "PerformerId", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/src/Yavsc.Org/Migrations/ApplicationDbContextModelSnapshot.cs b/src/Yavsc.Org/Migrations/ApplicationDbContextModelSnapshot.cs index f1651895e..d5c9b130a 100644 --- a/src/Yavsc.Org/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/src/Yavsc.Org/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1427,81 +1427,6 @@ namespace Yavsc.Migrations b.ToTable("ExceptionsSIREN"); }); - modelBuilder.Entity("Yavsc.Models.Billing.NominativeServiceCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ActivityCode") - .IsRequired() - .HasColumnType("text"); - - b.Property("ClientId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Consent") - .HasColumnType("boolean"); - - b.Property("DateCreated") - .HasColumnType("timestamp with time zone"); - - b.Property("DateModified") - .HasColumnType("timestamp with time zone"); - - b.Property("Description") - .IsRequired() - .HasColumnType("text"); - - b.Property("Discriminator") - .IsRequired() - .HasMaxLength(34) - .HasColumnType("character varying(34)"); - - b.Property("PaymentId") - .HasColumnType("text"); - - b.Property("PerformerId") - .IsRequired() - .HasColumnType("text"); - - b.Property("Provisional") - .HasColumnType("numeric"); - - b.Property("Status") - .HasColumnType("integer"); - - b.Property("UserCreated") - .IsRequired() - .HasColumnType("text"); - - b.Property("UserModified") - .IsRequired() - .HasColumnType("text"); - - b.Property("ValidationDate") - .HasColumnType("timestamp with time zone"); - - b.HasKey("Id"); - - b.HasIndex("ActivityCode"); - - b.HasIndex("ClientId"); - - b.HasIndex("PaymentId"); - - b.HasIndex("PerformerId"); - - b.ToTable("NominativeServiceCommand"); - - b.HasDiscriminator("Discriminator").HasValue("NominativeServiceCommand"); - - b.UseTphMappingStrategy(); - }); - modelBuilder.Entity("Yavsc.Models.Billing.Signature", b => { b.Property("Id") @@ -1989,6 +1914,168 @@ namespace Yavsc.Migrations b.ToTable("BrusherProfile"); }); + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("AdditionalInfo") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("PaymentId") + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.Property("Provisional") + .HasColumnType("numeric"); + + b.Property("SelectedProfileUserId") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.HasIndex("PrestationId"); + + b.HasIndex("SelectedProfileUserId"); + + b.ToTable("HairCutQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("PaymentId") + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Provisional") + .HasColumnType("numeric"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("HairMultiCutQueries"); + }); + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => { b.Property("Id") @@ -2979,37 +3066,6 @@ namespace Yavsc.Migrations }); }); - modelBuilder.Entity("Yavsc.Models.Workflow.DictionnaireMetier", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DomaineActiviteCode") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("character varying(128)"); - - b.Property("Langue") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Nom") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.HasKey("Id"); - - b.HasIndex("DomaineActiviteCode", "Langue", "Nom") - .IsUnique(); - - b.ToTable("DictionnaireMetier"); - }); - modelBuilder.Entity("Yavsc.Models.Workflow.PerformerCodeInputValidation", b => { b.Property("Id") @@ -3124,7 +3180,7 @@ namespace Yavsc.Migrations b.ToTable("FormationSettings"); }); - modelBuilder.Entity("Yavsc.Models.Workflow.TermeMetier", b => + modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -3132,51 +3188,77 @@ namespace Yavsc.Migrations NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateSoumission") - .HasColumnType("timestamp with time zone"); - - b.Property("DateValidation") - .HasColumnType("timestamp with time zone"); - - b.Property("Definition") + b.Property("ActivityCode") .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)"); + .HasColumnType("text"); - b.Property("DictionnaireMetierId") + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") .HasColumnType("bigint"); - b.Property("Langue") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)"); - - b.Property("Mot") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)"); - - b.Property("ProposeParId") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); - - b.Property("StatutValidation") + b.Property("LocationType") .HasColumnType("integer"); - b.Property("ValideParId") - .HasMaxLength(450) - .HasColumnType("character varying(450)"); + b.Property("PaymentId") + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Provisional") + .HasColumnType("numeric"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); b.HasKey("Id"); - b.HasIndex("ProposeParId"); + b.HasIndex("ActivityCode"); - b.HasIndex("ValideParId"); + b.HasIndex("ClientId"); - b.HasIndex("DictionnaireMetierId", "Langue", "Mot") - .IsUnique(); + b.HasIndex("LocationId"); - b.ToTable("TermeMetier"); + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("RdvQueries"); }); modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => @@ -3245,6 +3327,86 @@ namespace Yavsc.Migrations b.ToTable("MailingTemplate"); }); + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("GitId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .HasColumnType("text"); + + b.Property("PaymentId") + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Provisional") + .HasColumnType("numeric"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("GitId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("Project"); + }); + modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => { b.Property("Id") @@ -3295,112 +3457,6 @@ namespace Yavsc.Migrations b.ToTable("GitRepositoryReference"); }); - modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => - { - b.HasBaseType("Yavsc.Models.Billing.NominativeServiceCommand"); - - b.Property("AdditionalInfo") - .IsRequired() - .HasColumnType("text"); - - b.Property("EventDate") - .HasColumnType("timestamp with time zone"); - - b.Property("LocationId") - .HasColumnType("bigint"); - - b.Property("PrestationId") - .HasColumnType("bigint"); - - b.Property("SelectedProfileUserId") - .HasColumnType("text"); - - b.HasIndex("LocationId"); - - b.HasIndex("PrestationId"); - - b.HasIndex("SelectedProfileUserId"); - - b.HasDiscriminator().HasValue("HairCutQuery"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => - { - b.HasBaseType("Yavsc.Models.Billing.NominativeServiceCommand"); - - b.Property("EventDate") - .HasColumnType("timestamp with time zone"); - - b.Property("LocationId") - .HasColumnType("bigint"); - - b.HasIndex("LocationId"); - - b.ToTable("NominativeServiceCommand", t => - { - t.Property("EventDate") - .HasColumnName("HairMultiCutQuery_EventDate"); - - t.Property("LocationId") - .HasColumnName("HairMultiCutQuery_LocationId"); - }); - - b.HasDiscriminator().HasValue("HairMultiCutQuery"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => - { - b.HasBaseType("Yavsc.Models.Billing.NominativeServiceCommand"); - - b.Property("EventDate") - .HasColumnType("timestamp with time zone"); - - b.Property("LocationId") - .HasColumnType("bigint"); - - b.Property("LocationType") - .HasColumnType("integer"); - - b.Property("Reason") - .IsRequired() - .HasColumnType("text"); - - b.HasIndex("LocationId"); - - b.ToTable("NominativeServiceCommand", t => - { - t.Property("EventDate") - .HasColumnName("RdvQuery_EventDate"); - - t.Property("LocationId") - .HasColumnName("RdvQuery_LocationId"); - }); - - b.HasDiscriminator().HasValue("RdvQuery"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => - { - b.HasBaseType("Yavsc.Models.Billing.NominativeServiceCommand"); - - b.Property("GitId") - .HasColumnType("bigint"); - - b.Property("Name") - .IsRequired() - .HasColumnType("text"); - - b.Property("OwnerId") - .HasColumnType("text"); - - b.Property("Version") - .HasColumnType("text"); - - b.HasIndex("GitId"); - - b.HasDiscriminator().HasValue("Project"); - }); - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResourceClaim", b => { b.HasOne("IdentityServer8.EntityFramework.Entities.ApiResource", null) @@ -3814,7 +3870,7 @@ namespace Yavsc.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("Yavsc.Models.Billing.NominativeServiceCommand", "Query") + b.HasOne("Yavsc.Models.Workflow.RdvQuery", "Query") .WithMany() .HasForeignKey("CommandId"); @@ -3831,39 +3887,6 @@ namespace Yavsc.Migrations b.Navigation("Query"); }); - modelBuilder.Entity("Yavsc.Models.Billing.NominativeServiceCommand", b => - { - b.HasOne("Yavsc.Models.Workflow.Activity", "Context") - .WithMany() - .HasForeignKey("ActivityCode") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.ApplicationUser", "Client") - .WithMany() - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularization") - .WithMany() - .HasForeignKey("PaymentId"); - - b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") - .WithMany() - .HasForeignKey("PerformerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Context"); - - b.Navigation("PerformerProfile"); - - b.Navigation("Regularization"); - }); - modelBuilder.Entity("Yavsc.Models.Billing.Signature", b => { b.HasOne("Yavsc.Models.Billing.Estimate", "Estimate") @@ -4047,6 +4070,100 @@ namespace Yavsc.Migrations b.Navigation("Schedule"); }); + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId"); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularization") + .WithMany() + .HasForeignKey("PaymentId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany() + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.BrusherProfile", "SelectedProfile") + .WithMany() + .HasForeignKey("SelectedProfileUserId"); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Prestation"); + + b.Navigation("Regularization"); + + b.Navigation("SelectedProfile"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularization") + .WithMany() + .HasForeignKey("PaymentId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularization"); + }); + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestationCollectionItem", b => { b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") @@ -4364,17 +4481,6 @@ namespace Yavsc.Migrations b.Navigation("Context"); }); - modelBuilder.Entity("Yavsc.Models.Workflow.DictionnaireMetier", b => - { - b.HasOne("Yavsc.Models.Workflow.Activity", "DomaineActivite") - .WithMany() - .HasForeignKey("DomaineActiviteCode") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.Navigation("DomaineActivite"); - }); - modelBuilder.Entity("Yavsc.Models.Workflow.PerformerCodeInputValidation", b => { b.HasOne("Yavsc.Models.Workflow.Country", "Country") @@ -4405,27 +4511,45 @@ namespace Yavsc.Migrations b.Navigation("Performer"); }); - modelBuilder.Entity("Yavsc.Models.Workflow.TermeMetier", b => + modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => { - b.HasOne("Yavsc.Models.Workflow.DictionnaireMetier", "DictionnaireMetier") - .WithMany("Termes") - .HasForeignKey("DictionnaireMetierId") + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("Yavsc.Models.ApplicationUser", "ProposePar") + b.HasOne("Yavsc.Models.ApplicationUser", "Client") .WithMany() - .HasForeignKey("ProposeParId"); + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("Yavsc.Models.ApplicationUser", "ValidePar") + b.HasOne("Yavsc.Models.Relationship.Location", "Location") .WithMany() - .HasForeignKey("ValideParId"); + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("DictionnaireMetier"); + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularization") + .WithMany() + .HasForeignKey("PaymentId"); - b.Navigation("ProposePar"); + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("ValidePar"); + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularization"); }); modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => @@ -4447,6 +4571,47 @@ namespace Yavsc.Migrations b.Navigation("User"); }); + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", "Repository") + .WithMany() + .HasForeignKey("GitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularization") + .WithMany() + .HasForeignKey("PaymentId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularization"); + + b.Navigation("Repository"); + }); + modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => { b.HasOne("Yavsc.Server.Models.IT.Project", "TargetProject") @@ -4467,62 +4632,6 @@ namespace Yavsc.Migrations b.Navigation("Owner"); }); - modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => - { - b.HasOne("Yavsc.Models.Relationship.Location", "Location") - .WithMany() - .HasForeignKey("LocationId"); - - b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") - .WithMany() - .HasForeignKey("PrestationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Yavsc.Models.Haircut.BrusherProfile", "SelectedProfile") - .WithMany() - .HasForeignKey("SelectedProfileUserId"); - - b.Navigation("Location"); - - b.Navigation("Prestation"); - - b.Navigation("SelectedProfile"); - }); - - modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => - { - b.HasOne("Yavsc.Models.Relationship.Location", "Location") - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => - { - b.HasOne("Yavsc.Models.Relationship.Location", "Location") - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => - { - b.HasOne("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", "Repository") - .WithMany() - .HasForeignKey("GitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Repository"); - }); - modelBuilder.Entity("IdentityServer8.EntityFramework.Entities.ApiResource", b => { b.Navigation("Properties"); @@ -4637,6 +4746,11 @@ namespace Yavsc.Migrations b.Navigation("Links"); }); + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.Navigation("Prestations"); + }); + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => { b.Navigation("Taints"); @@ -4681,11 +4795,6 @@ namespace Yavsc.Migrations b.Navigation("Services"); }); - modelBuilder.Entity("Yavsc.Models.Workflow.DictionnaireMetier", b => - { - b.Navigation("Termes"); - }); - modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => { b.Navigation("Activity"); @@ -4696,11 +4805,6 @@ namespace Yavsc.Migrations b.Navigation("CoWorking"); }); - modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => - { - b.Navigation("Prestations"); - }); - modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => { b.Navigation("Configurations"); diff --git a/src/Yavsc.Server/Services/YavscMessageSender.cs b/src/Yavsc.Org/Services/YavscMessageSender.cs similarity index 99% rename from src/Yavsc.Server/Services/YavscMessageSender.cs rename to src/Yavsc.Org/Services/YavscMessageSender.cs index 3ab43fbee..7c7f6faa7 100644 --- a/src/Yavsc.Server/Services/YavscMessageSender.cs +++ b/src/Yavsc.Org/Services/YavscMessageSender.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.SignalR; -using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json; using Yavsc.Interface; diff --git a/src/Yavsc.Server/Models/Billing/Estimate.cs b/src/Yavsc.Server/Models/Billing/Estimate.cs index c2912b25a..24cd021a8 100644 --- a/src/Yavsc.Server/Models/Billing/Estimate.cs +++ b/src/Yavsc.Server/Models/Billing/Estimate.cs @@ -21,7 +21,7 @@ namespace Yavsc.Models.Billing /// /// [ForeignKey("CommandId"),JsonIgnore] - public NominativeServiceCommand? Query { get; set; } + public RdvQuery Query { get; set; } public string Description { get; set; } public string Title { get; set; } diff --git a/src/Yavsc.Tests.Shared/WebHostFixture.cs b/src/Yavsc.Tests.Shared/WebHostFixture.cs index ac3356cce..b92adc094 100644 --- a/src/Yavsc.Tests.Shared/WebHostFixture.cs +++ b/src/Yavsc.Tests.Shared/WebHostFixture.cs @@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Hosting.Server; using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.Extensions.DependencyInjection; using System.Net; -using System.Runtime.Loader; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; @@ -38,7 +37,6 @@ public abstract class WebHostFixture : IBackendFixture private static readonly object _sync = new object(); private static WebApplication? _app; private static bool _isInitialized; - private static bool _shutdownHooksRegistered; private static int _instanceCount; private static readonly List _sharedAddresses = new(); private static IServiceProvider? _sharedServices; @@ -65,8 +63,6 @@ public abstract class WebHostFixture : IBackendFixture { lock (_sync) { - RegisterShutdownHooks(); - if (!_isInitialized) { InitializeAsync().GetAwaiter().GetResult(); @@ -118,19 +114,11 @@ public abstract class WebHostFixture : IBackendFixture /// listen port. protected virtual int HttpsPort => 5101; - /// Options used to create the WebApplicationBuilder. - /// Derived fixtures can override (for example, to set - /// ApplicationName for MVC controller discovery). - protected virtual WebApplicationOptions CreateBuilderOptions() - { - return new WebApplicationOptions(); - } - public WebApplication App { get; private set; } private async Task InitializeAsync() { - var builder = WebApplication.CreateBuilder(CreateBuilderOptions()); + var builder = WebApplication.CreateBuilder(); builder.WebHost.ConfigureKestrel(options => { @@ -170,40 +158,23 @@ public abstract class WebHostFixture : IBackendFixture _instanceCount--; } - IsInitialized = _isInitialized; + IsInitialized = false; - // Keep the shared host alive for the whole test process. - // Disposing per class/collection can race with other test - // classes and intermittently drop the listener mid-run. - } - } - - private static void RegisterShutdownHooks() - { - if (_shutdownHooksRegistered) - { - return; - } - - AppDomain.CurrentDomain.ProcessExit += (_, __) => ShutdownSharedHost(); - AssemblyLoadContext.Default.Unloading += _ => ShutdownSharedHost(); - _shutdownHooksRegistered = true; - } - - private static void ShutdownSharedHost() - { - lock (_sync) - { - if (!_isInitialized || _app is null) + if (_instanceCount > 0) { return; } - _app.StopAsync().GetAwaiter().GetResult(); + if (!_isInitialized) + { + return; + } + + _app?.StopAsync().GetAwaiter().GetResult(); _app = null; _isInitialized = false; - _sharedServices = null; _sharedAddresses.Clear(); + _sharedServices = null; } }