Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions src/LagoVista.Core/Interfaces/IOperationalRecord.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace LagoVista.Core.Interfaces
{
/// <summary>
/// Minimal record contract for compact, mutable operational data.
/// Operational records represent the current working state used to run the platform
/// rather than immutable activity history or document-oriented application data.
/// </summary>
public interface IOperationalRecord
{
string Id { get; set; }
string OrganizationId { get; set; }
string Organization { get; set; }
}
}
20 changes: 20 additions & 0 deletions src/LagoVista.Core/Interfaces/IOperationalRecordStore.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace LagoVista.Core.Interfaces
{
/// <summary>
/// Provider-neutral storage contract for compact, mutable operational records.
/// Implementations may use Cassandra or another backend suitable for high-cardinality
/// keyed state without exposing provider topology to callers.
/// </summary>
public interface IOperationalRecordStore<TRecord>
where TRecord : class, IOperationalRecord
{
Task<TRecord> GetAsync(OperationalRecordKey key, CancellationToken cancellationToken = default);
Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default);
Task UpsertBatchAsync(IEnumerable<TRecord> records, CancellationToken cancellationToken = default);
Task DeleteAsync(OperationalRecordKey key, CancellationToken cancellationToken = default);
}
}
27 changes: 27 additions & 0 deletions src/LagoVista.Core/Interfaces/OperationalRecordKey.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;

namespace LagoVista.Core.Interfaces
{
/// <summary>
/// Provider-neutral identity for an operational record.
/// Scope values describe the logical record boundary (for example repository or instance)
/// without exposing provider-specific partition, shard, table, or collection concepts.
/// </summary>
public sealed class OperationalRecordKey
{
public OperationalRecordKey(string organizationId, string id, IReadOnlyDictionary<string, string> scope = null)
{
if (String.IsNullOrWhiteSpace(organizationId)) throw new ArgumentNullException(nameof(organizationId));
if (String.IsNullOrWhiteSpace(id)) throw new ArgumentNullException(nameof(id));

OrganizationId = organizationId;
Id = id;
Scope = scope ?? new Dictionary<string, string>();
}

public string OrganizationId { get; }
public string Id { get; }
public IReadOnlyDictionary<string, string> Scope { get; }
}
}