feat(postit): migrate editable profile data and admin profile flow

This commit is contained in:
Paul Schneider 2026-10-07 12:20:26 +01:00
commit af1e572f32
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
38 changed files with 6573 additions and 19 deletions

View file

@ -30,6 +30,13 @@ namespace Yavsc
public const string UserNameRegExp = @"^[a-zA-Z][a-zA-Z0-9._-]*$";
public const string UserFileNamePatternRegExp = @"^([a-zA-Z0-9._-]*/)*[a-zA-Z0-9._-]+$";
public const string ResourceUsagePath = "resource-usage";
public const string ResourceUsageCurrentUserRoute = "me";
public const string ResourceUsageAdminRoute = "admin";
public const string ResourceUsageDefaultCurrency = "EUR";
public const string ResourceUsageCurrentUserDisplayName = "current-user";
public const string ResourceUsageAdminDisplayName = "administrator";
public const string SigninPath = "~/signin";
public const string LogoutPath = "~/signout";

View file

@ -1,9 +1,11 @@
#nullable enable
namespace Yavsc.Abstract.Identity {
public class Me : UserInfo
{
public AuthToken Token {
public AuthToken? Token {
get;
set;
}
}
}
}

View file

@ -0,0 +1,9 @@
#nullable enable
namespace Yavsc.Abstract.Identity;
public class ProfileUpdateRequest
{
public string? FullName { get; set; }
public string? Address { get; set; }
}

View file

@ -1,10 +1,11 @@
#nullable enable
namespace Yavsc.Abstract.Identity
{
public class UserInfo {
public UserInfo()
{
}
public UserInfo(string userId, string userName, string email, string avatar)
@ -14,10 +15,14 @@ namespace Yavsc.Abstract.Identity
Email = email;
Avatar = avatar;
}
public string UserId { get; set; }
public string UserName { get; set; }
public string Email { get; }
public string Avatar { get; set; }
public string UserId { get; set; } = string.Empty;
public string? UserName { get; set; }
public string? FullName { get; set; }
public string? Email { get; set; }
public string? Address { get; set; }
public string? Avatar { get; set; }
public string[] Roles { get; set; } = [];
public string? DedicatedGoogleCalendar { get; set; }
}
}

View file

@ -0,0 +1,22 @@
namespace Yavsc.Abstract.Resources;
/// <summary>
/// Lightweight usage snapshot for PostIt / Yavsc resource accounting.
/// The initial implementation is intentionally intentionally small and
/// serialisable so it can be exposed through the API and consumed by the
/// PostIt client without requiring a full database model yet.
/// </summary>
public sealed class ResourceUsageSummary
{
public string UserId { get; set; } = string.Empty;
public string UserName { get; set; } = string.Empty;
public DateTimeOffset RecordedAtUtc { get; set; }
public decimal ApiCalls { get; set; }
public decimal CpuSeconds { get; set; }
public decimal BandwidthMb { get; set; }
public decimal StorageMb { get; set; }
public decimal EstimatedCompensation { get; set; }
public string Currency { get; set; } = Constants.ResourceUsageDefaultCurrency;
}

View file

@ -0,0 +1,15 @@
namespace Yavsc.Abstract.Workflow;
public sealed class PerformerProfileSettings
{
public string PerformerId { get; set; } = string.Empty;
public string UserName { get; set; } = string.Empty;
public string ExerciseCountryCode { get; set; } = "fr";
public string SIREN { get; set; } = string.Empty;
public string WebSite { get; set; } = string.Empty;
public bool Active { get; set; }
public bool AcceptNotifications { get; set; }
public bool AcceptPublicContact { get; set; }
public bool UseGeoLocalizationToReduceDistanceWithClients { get; set; }
public List<string> SelectedActivityCodes { get; set; } = new();
}