add architecture skeleton

This commit is contained in:
2026-04-19 13:12:04 +03:00
parent 312708531f
commit 2738f31f26
84 changed files with 2710 additions and 70 deletions
+6
View File
@@ -0,0 +1,6 @@
namespace GymLogAI.Core.Abstractions;
public interface IClock
{
DateTime UtcNow { get; }
}
@@ -0,0 +1,6 @@
namespace GymLogAI.Core.Abstractions;
public interface IIdGenerator
{
Guid New();
}
+12
View File
@@ -0,0 +1,12 @@
namespace GymLogAI.Core.Entities;
public class Exercise
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public float[]? Embedding { get; set; }
public DateTime CreatedAtUtc { get; set; }
public List<WorkoutExercise> WorkoutExercises { get; set; } = [];
}
+15
View File
@@ -0,0 +1,15 @@
namespace GymLogAI.Core.Entities;
public class ExerciseSet
{
public Guid Id { get; set; }
public Guid WorkoutExerciseId { get; set; }
public int Order { get; set; }
public decimal? WeightKg { get; set; }
public int? Repetitions { get; set; }
public int? DurationSeconds { get; set; }
public decimal? DistanceMeters { get; set; }
public string? Notes { get; set; }
public WorkoutExercise? WorkoutExercise { get; set; }
}
+21
View File
@@ -0,0 +1,21 @@
using GymLogAI.Core.Enums;
namespace GymLogAI.Core.Entities;
public class TelegramMessage
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
public long TelegramChatId { get; set; }
public int TelegramMessageId { get; set; }
public string Text { get; set; } = string.Empty;
public DateTime SentAtUtc { get; set; }
public DateTime ImportedAtUtc { get; set; }
public ParsingStatus ParsingStatus { get; set; }
public string? ParsingError { get; set; }
public Guid? WorkoutId { get; set; }
public DateTime? ParsedAtUtc { get; set; }
public User? User { get; set; }
public Workout? Workout { get; set; }
}
+14
View File
@@ -0,0 +1,14 @@
namespace GymLogAI.Core.Entities;
public class User
{
public Guid Id { get; set; }
public long TelegramUserId { get; set; }
public string? Username { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public DateTime CreatedAtUtc { get; set; }
public List<TelegramMessage> TelegramMessages { get; set; } = [];
public List<Workout> Workouts { get; set; } = [];
}
+19
View File
@@ -0,0 +1,19 @@
using GymLogAI.Core.Enums;
namespace GymLogAI.Core.Entities;
public class Workout
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
public Guid? SourceTelegramMessageId { get; set; }
public DateTime PerformedAtUtc { get; set; }
public string? Title { get; set; }
public string? Notes { get; set; }
public WorkoutSourceType SourceType { get; set; }
public DateTime CreatedAtUtc { get; set; }
public User? User { get; set; }
public TelegramMessage? SourceTelegramMessage { get; set; }
public List<WorkoutExercise> WorkoutExercises { get; set; } = [];
}
+14
View File
@@ -0,0 +1,14 @@
namespace GymLogAI.Core.Entities;
public class WorkoutExercise
{
public Guid Id { get; set; }
public Guid WorkoutId { get; set; }
public Guid ExerciseId { get; set; }
public int Order { get; set; }
public string? Notes { get; set; }
public Workout? Workout { get; set; }
public Exercise? Exercise { get; set; }
public List<ExerciseSet> Sets { get; set; } = [];
}
+10
View File
@@ -0,0 +1,10 @@
namespace GymLogAI.Core.Enums;
public enum GoalType
{
Maintain = 0,
Strength = 1,
Hypertrophy = 2,
Endurance = 3,
WeightLoss = 4
}
+9
View File
@@ -0,0 +1,9 @@
namespace GymLogAI.Core.Enums;
public enum ParsingStatus
{
Pending = 0,
Processing = 1,
Parsed = 2,
Failed = 3
}
+8
View File
@@ -0,0 +1,8 @@
namespace GymLogAI.Core.Enums;
public enum WorkoutSourceType
{
Manual = 0,
Telegram = 1,
Imported = 2
}
+9
View File
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>