Add submission CRUD with pagination and role scoping, challenge/location binding, automatic keyword extraction, a validated status workflow, and domain events for matchmaking and notifications. Create a problem record together with each submission.
67 lines
2.1 KiB
C#
67 lines
2.1 KiB
C#
using Dahomey.Cbor.Attributes;
|
|
|
|
namespace TarninaHub.Infrastructure.Persistence;
|
|
|
|
internal sealed class UserRow
|
|
{
|
|
[CborProperty("id")] public string Id { get; set; } = string.Empty;
|
|
|
|
[CborProperty("phone")] public string Phone { get; set; } = string.Empty;
|
|
|
|
[CborProperty("email")] public string? Email { get; set; }
|
|
|
|
[CborProperty("role")] public string Role { get; set; } = string.Empty;
|
|
|
|
[CborProperty("organization")] public string? Organization { get; set; }
|
|
}
|
|
|
|
internal sealed class PasswordCheckRow
|
|
{
|
|
[CborProperty("password_ok")] public bool PasswordOk { get; set; }
|
|
}
|
|
|
|
internal sealed class ConsentRow
|
|
{
|
|
[CborProperty("id")] public string Id { get; set; } = string.Empty;
|
|
|
|
[CborProperty("user")] public string User { get; set; } = string.Empty;
|
|
|
|
[CborProperty("scope")] public string Scope { get; set; } = string.Empty;
|
|
|
|
[CborProperty("granted_at")] public DateTimeOffset GrantedAt { get; set; }
|
|
|
|
[CborProperty("expires_at")] public DateTimeOffset? ExpiresAt { get; set; }
|
|
|
|
[CborProperty("revoked_at")] public DateTimeOffset? RevokedAt { get; set; }
|
|
}
|
|
|
|
internal sealed class SubmissionRow
|
|
{
|
|
[CborProperty("id")] public string Id { get; set; } = string.Empty;
|
|
|
|
[CborProperty("problem")] public string Problem { get; set; } = string.Empty;
|
|
|
|
[CborProperty("status")] public string Status { get; set; } = string.Empty;
|
|
|
|
[CborProperty("keywords")] public List<string> Keywords { get; set; } = [];
|
|
|
|
[CborProperty("created_at")] public DateTimeOffset CreatedAt { get; set; }
|
|
|
|
[CborProperty("updated_at")] public DateTimeOffset? UpdatedAt { get; set; }
|
|
|
|
[CborProperty("title")] public string Title { get; set; } = string.Empty;
|
|
|
|
[CborProperty("description")] public string Description { get; set; } = string.Empty;
|
|
|
|
[CborProperty("challenge")] public string Challenge { get; set; } = string.Empty;
|
|
|
|
[CborProperty("location")] public string Location { get; set; } = string.Empty;
|
|
|
|
[CborProperty("author")] public string Author { get; set; } = string.Empty;
|
|
}
|
|
|
|
internal sealed class CountRow
|
|
{
|
|
[CborProperty("count")] public int Count { get; set; }
|
|
}
|