diff --git a/src/Yavsc.Server/Settings/SiteSettings.cs b/src/Yavsc.Server/Settings/SiteSettings.cs
index ede3c086..dc5ae869 100644
--- a/src/Yavsc.Server/Settings/SiteSettings.cs
+++ b/src/Yavsc.Server/Settings/SiteSettings.cs
@@ -7,21 +7,21 @@ namespace Yavsc
public string Title { get; set; }
public string Slogan { get; set; }
- public string StyleSheet { get; set; }
- public string FavIcon { get; set; }
- public string Logo { get; set; }
+ public string StyleSheet { get; set; }
+ public string FavIcon { get; set; }
+ public string Logo { get; set; }
///
/// Conceptually,
/// This authorisation server only has this present site as unique audience.
///
///
- public string Audience { get; set; }
+ public string Audience { get; set; }
///
/// it's a very small company, with one domaine name only,
/// so let it be the same as in the Audience field.
///
///
- public string Authority { get; set; }
+ public string Authority { get; set; }
///
/// Owner's email
///
@@ -34,16 +34,16 @@ namespace Yavsc
public Contact Admin { get; set; }
public string DataDir { get; set; }
- public string Avatars { get; set; }
- public long Quota { get; set; }
- public string Blog { get; set; }
- public string Bills { get; set; }
+ public string Avatars { get; set; } = "avatars";
+ public long Quota { get; set; }
+ public string Blog { get; set; } = "blogs";
+ public string Bills { get; set; } = "bills";
public string GitRepository { get; set; } = "sources";
- public string BusinessName { get; set; }
- public string Street { get; set; }
- public string PostalCode { get; set; }
- public string CountryCode { get; set; }
+ public string BusinessName { get; set; }
+ public string Street { get; set; }
+ public string PostalCode { get; set; }
+ public string CountryCode { get; set; }
public string HomeViewName { get; set; }
///
@@ -51,7 +51,7 @@ namespace Yavsc
/// generated pdf files using pandoc
///
/// The temporary directory to use
- public string TempDir { get; set; } = "Temp";
+ public string TempDir { get; set; } = "temp";
///
/// Only one performer will capture payments
diff --git a/src/Yavsc/Controllers/HomeController.cs b/src/Yavsc/Controllers/HomeController.cs
index ddf01adb..9edbe1f1 100644
--- a/src/Yavsc/Controllers/HomeController.cs
+++ b/src/Yavsc/Controllers/HomeController.cs
@@ -1,31 +1,132 @@
-using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Yavsc.Models;
+using Yavsc.Helpers;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc.Localization;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.AspNetCore.Diagnostics;
+using Microsoft.Extensions.Options;
-namespace Yavsc.Controllers;
-
-public class HomeController : Controller
+namespace Yavsc.Controllers
{
- private readonly ILogger _logger;
- public HomeController(ILogger logger)
+ [AllowAnonymous]
+ public class HomeController : Controller
{
- _logger = logger;
- }
+ readonly ApplicationDbContext _dbContext;
- public IActionResult Index()
- {
- return View();
- }
+ readonly IHtmlLocalizer _localizer;
- public IActionResult Privacy()
- {
- return View();
- }
+ private SiteSettings siteSettings;
+ public HomeController(ILogger logger,
+ IHtmlLocalizer localizer,
+ ApplicationDbContext context,
+ IOptions settingsOptions)
+ {
+ _localizer = localizer;
+ _dbContext = context;
+ siteSettings = settingsOptions.Value;
+ }
+
+ public async Task Index(string id)
+ {
+ ViewBag.IsFromSecureProx = Request.Headers.ContainsKey(Constants.SshHeaderKey) && Request.Headers[Constants.SshHeaderKey] == "on";
+ ViewBag.SecureHomeUrl = "https://" + Request.Headers["X-Forwarded-Host"];
+ ViewBag.SshHeaderKey = Request.Headers[Constants.SshHeaderKey];
+ var uid = User.GetUserId();
+ long[] clicked = null;
+ if (uid == null)
+ {
+ await HttpContext.Session.LoadAsync();
+ var strclicked = HttpContext.Session.GetString("clicked");
+ if (strclicked != null) clicked = strclicked.Split(':').Select(c => long.Parse(c)).ToArray();
+ if (clicked == null) clicked = new long[0];
+ }
+ else clicked = _dbContext.DimissClicked.Where(d => d.UserId == uid).Select(d => d.NotificationId).ToArray();
+ var notes = _dbContext.Notification.Where(
+ n => !clicked.Contains(n.Id)
+ );
+ if (notes.Any()) this.Notify(notes);
+
+ ViewData["HaircutCommandCount"] = _dbContext.HairCutQueries.Where(
+ q => q.ClientId == uid && q.Status < QueryStatus.Failed
+ ).Count();
+ var toShow = _dbContext.Activities
+ .Include(a => a.Forms)
+ .Include(a => a.Parent)
+ .Include(a => a.Children)
+ .Where(a => !a.Hidden)
+ .Where(a => a.ParentCode == id)
+ .OrderByDescending(a => a.Rate).ToList();
+
+ foreach (var a in toShow)
+ {
+ a.Children = a.Children.Where(c => !c.Hidden).ToList();
+ }
+ return View(toShow);
+ }
+ public async Task About()
+ {
+ FileInfo fi = new FileInfo("wwwroot/version");
+ return View("About", fi.Exists ? _localizer["Version logicielle: "] + await fi.OpenText().ReadToEndAsync() : _localizer["Aucune information sur la version logicielle n'est publiée."]);
+ }
+ public IActionResult Privacy()
+ {
+ return View();
+ }
+ public IActionResult AboutMarkdown()
+ {
+ return View();
+ }
+
+ public IActionResult Contact()
+ {
+ return View();
+ }
+ public IActionResult Dash()
+ {
+ return View();
+ }
+ public ActionResult Chat()
+ {
+ if (User.Identity.IsAuthenticated)
+ {
+ ViewBag.IsAuthenticated = true;
+ string uid = User.GetUserId();
+ ViewBag.Contacts = _dbContext.Contact.Where(c => c.OwnerId == uid)
+ ;
+ }
+ else ViewBag.IsAuthenticated = false;
+ return View();
+ }
+
+ public IActionResult Error()
+ {
+ var feature = this.HttpContext.Features.Get();
+
+ return View("~/Views/Shared/Error.cshtml", feature?.Error);
+ }
+ public IActionResult Status(int id)
+ {
+ ViewBag.StatusCode = id;
+ return View("~/Views/Shared/Status.cshtml");
+ }
+ public IActionResult Todo()
+ {
+ User.GetUserId();
+
+ return View();
+ }
+
+ public IActionResult VideoChat()
+ {
+ return View();
+ }
+
+ public IActionResult Audio()
+ {
+ return View();
+ }
- [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
- public IActionResult Error()
- {
- return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
diff --git a/src/Yavsc/Controllers/HomeController.cs.new b/src/Yavsc/Controllers/HomeController.cs.new
new file mode 100644
index 00000000..ddf01adb
--- /dev/null
+++ b/src/Yavsc/Controllers/HomeController.cs.new
@@ -0,0 +1,31 @@
+using System.Diagnostics;
+using Microsoft.AspNetCore.Mvc;
+using Yavsc.Models;
+
+namespace Yavsc.Controllers;
+
+public class HomeController : Controller
+{
+ private readonly ILogger _logger;
+
+ public HomeController(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ public IActionResult Index()
+ {
+ return View();
+ }
+
+ public IActionResult Privacy()
+ {
+ return View();
+ }
+
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public IActionResult Error()
+ {
+ return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+ }
+}
diff --git a/src/Yavsc/Helpers/ControllerHelpers.cs b/src/Yavsc/Helpers/ControllerHelpers.cs
index e071723d..6b89b104 100644
--- a/src/Yavsc/Helpers/ControllerHelpers.cs
+++ b/src/Yavsc/Helpers/ControllerHelpers.cs
@@ -16,7 +16,8 @@ namespace Yavsc.Helpers
var notifs = SetupNotificationList(controller);
notifs.Add(new Notification { title = title, body = body });
}
- public static void Notify(this Controller controller, IEnumerable notes)
+
+ public static void Notify(this Controller controller, IEnumerable notes)
{
var notifs = SetupNotificationList(controller);
notifs.AddRange(notes);
diff --git a/src/Yavsc/Migrations/2018/20180625113528_Git.cs b/src/Yavsc/Migrations/2018/20180625113528_Git.cs
index bbfc7c13..4164ac0d 100644
--- a/src/Yavsc/Migrations/2018/20180625113528_Git.cs
+++ b/src/Yavsc/Migrations/2018/20180625113528_Git.cs
@@ -99,7 +99,7 @@ namespace Yavsc.Migrations
column: x => x.PaymentId,
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
- onDelete: ReferentialAction.Restrict);
+ onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Project_PerformerProfile_PerformerId",
column: x => x.PerformerId,
diff --git a/src/Yavsc/Migrations/20230326173049_net7.Designer.cs b/src/Yavsc/Migrations/20230326173049_net7.Designer.cs
new file mode 100644
index 00000000..d5878557
--- /dev/null
+++ b/src/Yavsc/Migrations/20230326173049_net7.Designer.cs
@@ -0,0 +1,3554 @@
+//
+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("20230326173049_net7")]
+ partial class net7
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.4")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ 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")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("BillingAddressId")
+ .HasColumnType("bigint");
+
+ b.Property("EMail")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Phone")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("UserId");
+
+ b.ToTable("ClientProviderInfo");
+ });
+
+ 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")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserModified")
+ .IsRequired()
+ .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.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")
+ .IsRequired()
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)")
+ .HasDefaultValue("/images/Users/icon_user.png");
+
+ b.Property("BankInfoId")
+ .HasColumnType("bigint");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
+
+ b.Property("DateCreated")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DateModified")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DedicatedGoogleCalendar")
+ .IsRequired()
+ .HasMaxLength(512)
+ .HasColumnType("character varying(512)");
+
+ b.Property("DiskQuota")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasDefaultValue(524288000L);
+
+ b.Property("DiskUsage")
+ .HasColumnType("bigint");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property("FullName")
+ .IsRequired()
+ .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")
+ .IsRequired()
+ .HasColumnType("bigint");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("text");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("boolean");
+
+ b.Property("UserCreated")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserModified")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BankInfoId");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.HasIndex("PostalAddressId");
+
+ b.ToTable("AspNetUsers", (string)null);
+ });
+
+ modelBuilder.Entity("Yavsc.Models.Auth.Client", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("Active")
+ .HasColumnType("boolean");
+
+ b.Property("DisplayName")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("LogoutRedirectUri")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("character varying(100)");
+
+ b.Property("RedirectUri")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("RefreshTokenLifeTime")
+ .HasColumnType("integer");
+
+ b.Property("Secret")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Type")
+ .HasColumnType("integer");
+
+ b.HasKey("Id");
+
+ b.ToTable("Applications");
+ });
+
+ modelBuilder.Entity("Yavsc.Models.Auth.OAuth2Tokens", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("text");
+
+ b.Property("AccessToken")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Expiration")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ExpiresIn")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("RefreshToken")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("TokenType")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("UserId");
+
+ b.ToTable("OAuth2Tokens");
+ });
+
+ modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("ClientId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.Property("ExpiresUtc")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("IssuedUtc")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("ProtectedTicket")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Subject")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("character varying(50)");
+
+ b.HasKey("Id");
+
+ b.ToTable("RefreshTokens");
+ });
+
+ 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("BankBook");
+ });
+
+ 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("WicketCode")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ 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")
+ .IsRequired()
+ .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")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("OwnerId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Title")
+ .IsRequired()
+ .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.Blog.BlogPost", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AuthorId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("DateCreated")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("DateModified")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("Lang")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Photo")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Rate")
+ .HasColumnType("integer");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserCreated")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserModified")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Visible")
+ .HasColumnType("boolean");
+
+ 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("AuthorId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Content")
+ .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("PostId")
+ .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("PostId");
+
+ b.ToTable("Comment");
+ });
+
+ 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")
+ .IsRequired()
+ .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")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Topic")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserCreated")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserModified")
+ .IsRequired()
+ .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")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserCreated")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("UserModified")
+ .IsRequired()
+ .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")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Red")
+ .HasColumnType("smallint");
+
+ b.HasKey("Id");
+
+ b.ToTable("Color");
+ });
+
+ modelBuilder.Entity("Yavsc.Models.Forms.Form", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("Summary")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Form");
+ });
+
+ 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")
+ .IsRequired()
+ .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