Skip to content

Commit adc3293

Browse files
authored
Adds source_at to Data Class (#12)
* Adds `source_at` to Data Class * Fixes GitHub Action to Free More Space
1 parent 2e264bd commit adc3293

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: actions/checkout@v2
1515

1616
- name: Free space
17-
run: df -h && rm -rf /opt/hostedtoolcache* && df -h
17+
run: df -h && sudo rm -rf /usr/local/lib/android && sudo rm -rf /opt/ghc && rm -rf /opt/hostedtoolcache* && df -h
1818

1919
- name: Pull Foundation Image
2020
uses: addnab/docker-run-action@v3

RegalyticsRegulatoryArticle.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public class RegalyticsRegulatoryArticle : BaseData
7878
[JsonProperty(PropertyName = "rule_effective_date")]
7979
public DateTime? RuleEffectiveDate { get; set; }
8080

81+
[JsonProperty(PropertyName = "sourced_at")]
82+
public DateTime SourcedAt { get; set; }
83+
8184
[JsonProperty(PropertyName = "latest_update")]
8285
public DateTime LatestUpdate { get; set; }
8386

@@ -158,7 +161,8 @@ public override BaseData Clone()
158161
Agencies = Agencies,
159162
Sector = Sector,
160163
AnnouncementUrl = AnnouncementUrl,
161-
CreatedAt = CreatedAt
164+
CreatedAt = CreatedAt,
165+
SourcedAt = SourcedAt
162166
};
163167
}
164168

tests/RegalyticsRegulatoryArticleTests.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public void BackwardCompatibilityToV2()
6565
var config = new SubscriptionDataConfig(instance.GetType(), Symbol.None, Resolution.Daily, TimeZones.Utc, TimeZones.Utc, false, false, false);
6666
var data = instance.Reader(config, line, new DateTime(2024, 2, 12), false) as RegalyticsRegulatoryArticle;
6767
Assert.AreEqual("2051381", data.Id);
68+
Assert.AreEqual(DateTime.MinValue, data.SourcedAt);
6869
}
6970

7071
private void AssertAreEqual(object expected, object result, bool filterByCustomAttributes = false)
@@ -111,7 +112,8 @@ private BaseData CreateNewInstance()
111112
Agencies = new List<string>{"string"},
112113
Sector = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "value" } } },
113114
AnnouncementUrl = "string",
114-
CreatedAt = DateTime.MinValue
115+
CreatedAt = DateTime.MinValue,
116+
SourcedAt = DateTime.MinValue,
115117
};
116118
}
117119

@@ -145,7 +147,8 @@ private BaseData CreateNewCollectionInstance()
145147
Agencies = new List<string>{"string"},
146148
Sector = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "value" } } },
147149
AnnouncementUrl = "string",
148-
CreatedAt = DateTime.MinValue
150+
CreatedAt = DateTime.MinValue,
151+
SourcedAt = DateTime.MinValue
149152
},
150153
new RegalyticsRegulatoryArticle
151154
{
@@ -173,7 +176,8 @@ private BaseData CreateNewCollectionInstance()
173176
Agencies = new List<string>{"string"},
174177
Sector = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "value" } } },
175178
AnnouncementUrl = "string",
176-
CreatedAt = DateTime.MinValue
179+
CreatedAt = DateTime.MinValue,
180+
SourcedAt = DateTime.MinValue
177181
}
178182
};
179183
}

0 commit comments

Comments
 (0)