Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9c248c6
test(v4): golden harness for V4 repository dedup behaviour
ryceg Jun 27, 2026
5929b01
test(v4): per-type dedup + LegacyId-only goldens (full baseline)
ryceg Jun 27, 2026
c0f8d19
test(v4): pin delta baselines (D1/D3/D7) + harden grouping goldens
ryceg Jun 27, 2026
2936c44
refactor(v4): V4RepositoryBase + migrate Calibration (behaviour-prese…
ryceg Jun 27, 2026
0ab042f
docs(v4): note IV4TimeSeriesEntity mapping invariant + Calibration lo…
ryceg Jun 27, 2026
1799558
refactor(v4): migrate Bolus onto V4RepositoryBase (shared CRUD only)
ryceg Jun 27, 2026
1acc2c8
test(v4): pin 7-arg GetAsync non-primary filter via generic interface…
ryceg Jun 27, 2026
c261ca0
refactor(v4): migrate CarbIntake onto V4RepositoryBase
ryceg Jun 27, 2026
8b2b11d
refactor(v4): migrate SensorGlucose onto V4RepositoryBase
ryceg Jun 27, 2026
aedd4a1
refactor(v4): migrate BGCheck onto V4RepositoryBase
ryceg Jun 27, 2026
43a5a13
refactor(v4): migrate DeviceEvent onto V4RepositoryBase
ryceg Jun 27, 2026
2f998b0
refactor(v4): migrate Note onto V4RepositoryBase
ryceg Jun 27, 2026
c971635
refactor(v4): migrate BolusCalculation onto V4RepositoryBase
ryceg Jun 27, 2026
97673c2
refactor(v4): migrate MeterGlucose onto V4RepositoryBase
ryceg Jun 27, 2026
39bde05
refactor(v4): migrate BasalSchedule onto V4RepositoryBase
ryceg Jun 27, 2026
edeaae0
refactor(v4): migrate CarbRatioSchedule onto V4RepositoryBase
ryceg Jun 27, 2026
350a8e5
refactor(v4): migrate SensitivitySchedule onto V4RepositoryBase
ryceg Jun 27, 2026
73599a1
refactor(v4): migrate TargetRangeSchedule onto V4RepositoryBase
ryceg Jun 27, 2026
5914856
refactor(v4): migrate TherapySettings onto V4RepositoryBase
ryceg Jun 27, 2026
0412d89
test(v4): pin D2 union-feed vs inserts-only as observable
ryceg Jun 27, 2026
d117197
test(v4): baseline D5 audit-on-delete behaviour
ryceg Jun 27, 2026
530ad31
refactor(v4): D5 — audit all soft-deletes in the base
ryceg Jun 27, 2026
e0df76b
refactor(v4): D4 — dedup after commit for Bolus and CarbIntake
ryceg Jun 27, 2026
ca89249
refactor(v4): D6/D1 — BasalInjection bulk atomic + audit-aware + Sync…
ryceg Jun 27, 2026
bbecdd8
refactor(v4): D3 — SensorGlucose single CreateAsync upserts on SyncId
ryceg Jun 28, 2026
ef7f6c9
refactor(v4): D7 — CountAsync excludes non-primary for all dedup part…
ryceg Jun 28, 2026
d47ee00
refactor(v4): D2 — dedup feed inserts-only (SensorGlucose) + CarbInta…
ryceg Jun 28, 2026
3514eb9
refactor(v4): BulkCreateAsync template + SplitUpserts/PostCommitDedup…
ryceg Jun 28, 2026
faa9c27
refactor(v4): migrate Bolus BulkCreateAsync onto base hooks
ryceg Jun 28, 2026
8c12279
refactor(v4): migrate CarbIntake BulkCreateAsync onto base hooks
ryceg Jun 28, 2026
36adf21
refactor(v4): migrate SensorGlucose BulkCreateAsync onto base hooks
ryceg Jun 28, 2026
1f0f9b1
refactor(v4): migrate BGCheck BulkCreateAsync onto base hooks
ryceg Jun 28, 2026
b034631
refactor(v4): migrate DeviceEvent BulkCreateAsync onto base hooks
ryceg Jun 28, 2026
6f85763
refactor(v4): migrate Note BulkCreateAsync onto base hooks
ryceg Jun 28, 2026
9ded756
refactor(v4): migrate BolusCalculation BulkCreateAsync onto base hooks
ryceg Jun 28, 2026
b8788b4
refactor(v4): review nits — SensorGlucose PostCommitDedup empty early…
ryceg Jun 28, 2026
66e527a
fix(v4): let cancellation propagate through best-effort PostCommitDedup
ryceg Jun 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Nocturne.Infrastructure.Data.Entities;

/// <summary>
/// A V4 record entity that carries the canonical time-series columns the shared
/// <see cref="Repositories.V4.V4RepositoryBase{TModel,TEntity}"/> filters, orders, and watermarks
/// on. Extends <see cref="IV4Entity"/> (Id, LegacyId, TenantId, DeletedAt) with the domain
/// timestamp, data source, and device. Span-shaped types (e.g. TempBasal, which keys on
/// StartTimestamp) deliberately do NOT implement this and stay off the shared base.
///
/// Implementers MUST map these three members as ordinary EF columns (plain auto-properties with a
/// <c>[Column]</c> mapping) — not explicit-interface implementations, backing-field-only, or
/// <c>[NotMapped]</c> — so the base's generic <c>ctx.Set&lt;TEntity&gt;()</c> queries translate the
/// interface-member access to SQL (the same way it already does for ITenantScoped.TenantId and
/// ISoftDeletable.DeletedAt).
/// </summary>
public interface IV4TimeSeriesEntity : IV4Entity
{
DateTime Timestamp { get; set; }

Check warning on line 18 in src/Infrastructure/Nocturne.Infrastructure.Data/Entities/IV4TimeSeriesEntity.cs

View workflow job for this annotation

GitHub Actions / build-and-push

Missing XML comment for publicly visible type or member 'IV4TimeSeriesEntity.Timestamp'

Check warning on line 18 in src/Infrastructure/Nocturne.Infrastructure.Data/Entities/IV4TimeSeriesEntity.cs

View workflow job for this annotation

GitHub Actions / unit

Missing XML comment for publicly visible type or member 'IV4TimeSeriesEntity.Timestamp'

Check warning on line 18 in src/Infrastructure/Nocturne.Infrastructure.Data/Entities/IV4TimeSeriesEntity.cs

View workflow job for this annotation

GitHub Actions / integration-db

Missing XML comment for publicly visible type or member 'IV4TimeSeriesEntity.Timestamp'
string? DataSource { get; set; }

Check warning on line 19 in src/Infrastructure/Nocturne.Infrastructure.Data/Entities/IV4TimeSeriesEntity.cs

View workflow job for this annotation

GitHub Actions / build-and-push

Missing XML comment for publicly visible type or member 'IV4TimeSeriesEntity.DataSource'

Check warning on line 19 in src/Infrastructure/Nocturne.Infrastructure.Data/Entities/IV4TimeSeriesEntity.cs

View workflow job for this annotation

GitHub Actions / unit

Missing XML comment for publicly visible type or member 'IV4TimeSeriesEntity.DataSource'

Check warning on line 19 in src/Infrastructure/Nocturne.Infrastructure.Data/Entities/IV4TimeSeriesEntity.cs

View workflow job for this annotation

GitHub Actions / integration-db

Missing XML comment for publicly visible type or member 'IV4TimeSeriesEntity.DataSource'
string? Device { get; set; }

Check warning on line 20 in src/Infrastructure/Nocturne.Infrastructure.Data/Entities/IV4TimeSeriesEntity.cs

View workflow job for this annotation

GitHub Actions / build-and-push

Missing XML comment for publicly visible type or member 'IV4TimeSeriesEntity.Device'

Check warning on line 20 in src/Infrastructure/Nocturne.Infrastructure.Data/Entities/IV4TimeSeriesEntity.cs

View workflow job for this annotation

GitHub Actions / unit

Missing XML comment for publicly visible type or member 'IV4TimeSeriesEntity.Device'

Check warning on line 20 in src/Infrastructure/Nocturne.Infrastructure.Data/Entities/IV4TimeSeriesEntity.cs

View workflow job for this annotation

GitHub Actions / integration-db

Missing XML comment for publicly visible type or member 'IV4TimeSeriesEntity.Device'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.BGCheck
/// </summary>
[Table("bg_checks")]
public class BGCheckEntity : ITenantScoped, ISoftDeletable, IV4Entity, ISystemTimestamped
public class BGCheckEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.BasalInjection.
/// </summary>
[Table("basal_injections")]
public class BasalInjectionEntity : ITenantScoped, IAuditable, ISoftDeletable, ISystemTimestamped
public class BasalInjectionEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4Entity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.BasalSchedule
/// </summary>
[Table("basal_schedules")]
public class BasalScheduleEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4Entity, ISystemTimestamped
public class BasalScheduleEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.BolusCalculation
/// </summary>
[Table("bolus_calculations")]
public class BolusCalculationEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4Entity, ISystemTimestamped
public class BolusCalculationEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.Bolus
/// </summary>
[Table("boluses")]
public class BolusEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4Entity, ISystemTimestamped
public class BolusEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.Calibration
/// </summary>
[Table("calibrations")]
public class CalibrationEntity : ITenantScoped, ISoftDeletable, IV4Entity, ISystemTimestamped
public class CalibrationEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.CarbIntake
/// </summary>
[Table("carb_intakes")]
public class CarbIntakeEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4Entity, ISystemTimestamped
public class CarbIntakeEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.CarbRatioSchedule
/// </summary>
[Table("carb_ratio_schedules")]
public class CarbRatioScheduleEntity : ITenantScoped, ISoftDeletable, IV4Entity, ISystemTimestamped
public class CarbRatioScheduleEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.DeviceEvent
/// </summary>
[Table("device_events")]
public class DeviceEventEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4Entity, ISystemTimestamped
public class DeviceEventEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.MeterGlucose
/// </summary>
[Table("meter_glucose")]
public class MeterGlucoseEntity : ITenantScoped, ISoftDeletable, IV4Entity, ISystemTimestamped
public class MeterGlucoseEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.Note
/// </summary>
[Table("notes")]
public class NoteEntity : ITenantScoped, ISoftDeletable, IV4Entity, ISystemTimestamped
public class NoteEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.SensitivitySchedule
/// </summary>
[Table("sensitivity_schedules")]
public class SensitivityScheduleEntity : ITenantScoped, ISoftDeletable, IV4Entity, ISystemTimestamped
public class SensitivityScheduleEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.SensorGlucose
/// </summary>
[Table("sensor_glucose")]
public class SensorGlucoseEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4Entity, ISystemTimestamped
public class SensorGlucoseEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.TargetRangeSchedule
/// </summary>
[Table("target_range_schedules")]
public class TargetRangeScheduleEntity : ITenantScoped, ISoftDeletable, IV4Entity, ISystemTimestamped
public class TargetRangeScheduleEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Nocturne.Infrastructure.Data.Entities.V4;
/// Maps to Nocturne.Core.Models.V4.TherapySettings
/// </summary>
[Table("therapy_settings")]
public class TherapySettingsEntity : ITenantScoped, ISoftDeletable, IV4Entity, ISystemTimestamped
public class TherapySettingsEntity : ITenantScoped, IAuditable, ISoftDeletable, IV4TimeSeriesEntity, ISystemTimestamped
{
/// <summary>
/// The unique identifier of the tenant this record belongs to.
Expand Down
Loading
Loading