@@ -7,40 +7,83 @@ public class MusicContext : DbContext
77 public MusicContext ( DbContextOptions < MusicContext > options ) : base ( options )
88 {
99
10- }
11- public DbSet < Thumbnail > Thumbnails { get ; set ; }
10+ } public DbSet < Thumbnail > Thumbnails { get ; set ; }
1211 public DbSet < Playlist > Playlists { get ; set ; }
1312 public DbSet < PlaylistItem > PlaylistItems { get ; set ; }
1413 public DbSet < Impression > Impressions { get ; set ; }
14+ public DbSet < AnchorDefinitionEntity > AnchorDefinitions { get ; set ; }
15+ public DbSet < UserAnchorEntity > UserAnchors { get ; set ; }
16+ public DbSet < DailyAnchorEntity > DailyAnchors { get ; set ; }
1517}
1618
1719public class Thumbnail
1820{
1921 public int Id { get ; set ; }
20- public string Artist { get ; set ; }
21- public string Album { get ; set ; }
22- public string ThumbnailUrl { get ; set ; }
22+ public string Artist { get ; set ; } = string . Empty ;
23+ public string Album { get ; set ; } = string . Empty ;
24+ public string ThumbnailUrl { get ; set ; } = string . Empty ;
2325}
2426
2527public class Playlist
2628{
2729 public int Id { get ; set ; }
28- public string Name { get ; set ; }
30+ public string Name { get ; set ; } = string . Empty ;
2931 public List < PlaylistItem > Songs { get ; set ; } = new ( ) ;
3032}
3133
3234public class PlaylistItem
3335{
3436 public int Id { get ; set ; }
3537 public int PlaylistId { get ; set ; }
36- public string SongPath { get ; set ; }
38+ public string SongPath { get ; set ; } = string . Empty ;
3739 public int Order { get ; set ; }
3840}
3941
4042public class Impression
4143{
4244 public int Id { get ; set ; }
43- public string SongPath { get ; set ; }
45+ public string SongPath { get ; set ; } = string . Empty ;
4446 public DateTime Timestamp { get ; set ; }
45- public string PlayedBy { get ; set ; }
47+ public string PlayedBy { get ; set ; } = string . Empty ;
48+ }
49+
50+ /// <summary>
51+ /// Entity for anchor definitions (the template)
52+ /// </summary>
53+ public class AnchorDefinitionEntity
54+ {
55+ public int Id { get ; set ; }
56+ public string Name { get ; set ; } = string . Empty ;
57+ public string Description { get ; set ; } = string . Empty ;
58+ public bool IsActive { get ; set ; } = true ;
59+ public DateTime CreatedAt { get ; set ; }
60+ public DateTime ? DeactivatedAt { get ; set ; }
61+ }
62+
63+ /// <summary>
64+ /// Entity for user's current anchors (current active assignments)
65+ /// </summary>
66+ public class UserAnchorEntity
67+ {
68+ public int Id { get ; set ; }
69+ public string UserId { get ; set ; } = string . Empty ;
70+ public int AnchorDefinitionId { get ; set ; }
71+ public DateTime CreatedAt { get ; set ; }
72+ public AnchorDefinitionEntity ? AnchorDefinition { get ; set ; }
73+ }
74+
75+ /// <summary>
76+ /// Entity for daily anchor snapshots (temporal records)
77+ /// </summary>
78+ public class DailyAnchorEntity
79+ {
80+ public int Id { get ; set ; }
81+ public string UserId { get ; set ; } = string . Empty ;
82+ public int AnchorDefinitionId { get ; set ; }
83+ public DateOnly Date { get ; set ; }
84+ public bool IsCompleted { get ; set ; }
85+ public DateTime ? CompletedAt { get ; set ; }
86+ public string AnchorName { get ; set ; } = string . Empty ; // Snapshot of name at time of creation
87+ public string AnchorDescription { get ; set ; } = string . Empty ; // Snapshot of description at time of creation
88+ public DateTime CreatedAt { get ; set ; }
4689}
0 commit comments