feat: add persisted page insight platform

This commit is contained in:
2026-08-21 18:51:00 +08:00
parent 8507b5d017
commit 17e3f1a7d0
18 changed files with 1587 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
package eventcatalog
import "testing"
func TestValidateEventsRejectsIncorrectBlackFridayDate(t *testing.T) {
event := Event{ID: "black-friday-2026", TitleFA: "جمعه سیاه", StartDate: "2026-11-26", EndDate: "2026-11-26", Recurrence: RecurrenceBlackFriday, Type: TypeCommercial, Tone: ToneNeutral, CommercialPosture: PostureCaution, SourceURI: "https://example.test/black-friday", SourceVersion: "2026", InclusionRationale: "رفتار تجاری مرتبط", GeographicScope: "IR", RelevanceBPS: 8000, ConfidenceBPS: 8000}
if err := ValidateEvents([]Event{event}); err == nil {
t.Fatal("expected recurrence mismatch")
}
event.StartDate, event.EndDate = "2026-11-27", "2026-11-27"
if err := ValidateEvents([]Event{event}); err != nil {
t.Fatal(err)
}
}