fix(temporal): added Format to the DateIndex

This commit is contained in:
Dylan R. E. Moonfire 2022-06-28 00:20:07 -05:00
parent ca13ae34d0
commit 603c692d7f
3 changed files with 9 additions and 3 deletions

View file

@ -113,7 +113,7 @@ public partial class CreateDateIndexes : OperationBase, IResolvingOperation
: new List<Entity>(); : new List<Entity>();
// Create the index then add it to the output list. // Create the index then add it to the output list.
var index = new DateIndex(pair.Key, childEntities, childIndexes); var index = new DateIndex(pair.Key, this.Formats[i], childEntities, childIndexes);
Entity? indexEntity = this.CreateIndex!(index); Entity? indexEntity = this.CreateIndex!(index);
output.Add(indexEntity); output.Add(indexEntity);

View file

@ -6,9 +6,10 @@ namespace Nitride.Temporal;
public class DateIndex public class DateIndex
{ {
public DateIndex(string key, IReadOnlyList<Entity> entries, IReadOnlyList<Entity> indexes) public DateIndex(string key, string format, IReadOnlyList<Entity> entries, IReadOnlyList<Entity> indexes)
{ {
this.Key = key; this.Key = key;
this.Format = format;
this.Entries = entries; this.Entries = entries;
this.Indexes = indexes; this.Indexes = indexes;
} }
@ -18,6 +19,11 @@ public class DateIndex
/// </summary> /// </summary>
public IReadOnlyList<Entity> Entries { get; } public IReadOnlyList<Entity> Entries { get; }
/// <summary>
/// Gets the format used to create this index.
/// </summary>
public string Format { get; }
/// <summary> /// <summary>
/// Gets the ordered list of nested indexes, if there are any. This will be an /// Gets the ordered list of nested indexes, if there are any. This will be an
/// empty list if the index has no /// empty list if the index has no