╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────╮ │src/test/event.zig│ ╰──────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │503 // define more test events │ │504 // │ │505 │ │506 - const events_to_consume2 = [_]evt.Event{ │ │506 + const events_to_consume2 = [_]evt.EventWithId{ │ │507 .{ │ │508 - .id = std.fmt.bytesToHex(evt.Event.randomId(prng.random()), .lower), │ │509 - .data = .{ │ │508 + .id = std.fmt.bytesToHex(evt.EventWithId.randomId(prng.random()), .lower), │ │509 + .event = .{ │ │510 .issue = .{ │ │511 .title = "Kanban card status badge falls behind after drag", │ │512 .description = "Moving an issue between columns updates the card position immediately, but the status badge keeps showing the previous state until refresh.",│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │515 }, │ │516 }, │ │517 .{ │ │518 - .id = std.fmt.bytesToHex(evt.Event.randomId(prng.random()), .lower), │ │519 - .data = .{ │ │518 + .id = std.fmt.bytesToHex(evt.EventWithId.randomId(prng.random()), .lower), │ │519 + .event = .{ │ │520 .issue = .{ │ │521 .title = "Assignee autocomplete omits recently invited users", │ │522 .description = "Users invited during the current session do not appear in the assignee picker until the project page is reloaded.",│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │525 }, │ │526 }, │ │527 .{ │ │528 - .id = std.fmt.bytesToHex(evt.Event.randomId(prng.random()), .lower), │ │529 - .data = .{ │ │528 + .id = std.fmt.bytesToHex(evt.EventWithId.randomId(prng.random()), .lower), │ │529 + .event = .{ │ │530 .issue = .{ │ │531 .title = "Add due date warning for issues blocked by dependencies", │ │532 .description = "Show a warning when an issue's due date is earlier than an unresolved blocking issue so planners can adjust the schedule.",│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │619 const first_issue_map = try Repo.DB.HashMap(.read_only).init(first_issue_cursor); │ │620 const first_issue = try evt.read(evt.Issue, Repo.DB, repo_opts.hash, &arena, first_issue_map); │ │621 │ │622 - try std.testing.expectEqualStrings(events_to_consume[0].data.issue.?.description, first_issue.description); │ │623 - try std.testing.expectEqualStrings(events_to_consume[0].data.issue.?.tags, first_issue.tags); │ │622 + try std.testing.expectEqualStrings(events_to_consume[0].event.issue.?.description, first_issue.description);│ │623 + try std.testing.expectEqualStrings(events_to_consume[0].event.issue.?.tags, first_issue.tags); │ │624 } │ │625 │ │626 // make sure one of the new issues is there │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │632 const first_issue_map = try Repo.DB.HashMap(.read_only).init(first_issue_cursor); │ │633 const first_issue = try evt.read(evt.Issue, Repo.DB, repo_opts.hash, &arena, first_issue_map); │ │634 │ │635 - try std.testing.expectEqualStrings(events_to_consume2[0].data.issue.?.description, first_issue.description); │ │636 - try std.testing.expectEqualStrings(events_to_consume2[0].data.issue.?.tags, first_issue.tags); │ │635 + try std.testing.expectEqualStrings(events_to_consume2[0].event.issue.?.description, first_issue.description);│ │636 + try std.testing.expectEqualStrings(events_to_consume2[0].event.issue.?.tags, first_issue.tags); │ │637 } │ │638 } │ │639 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │710 // define test events that modify the same issue in conflicting ways │ │711 // │ │712 │ │713 - const events_to_consume3 = [_]evt.Event{ │ │713 + const events_to_consume3 = [_]evt.EventWithId{ │ │714 .{ │ │715 .id = events_to_consume[0].id, │ │716 - .data = .{ │ │716 + .event = .{ │ │717 .issue = .{ │ │718 .title = "Login form clears password on validation error", │ │719 .description = "Submitting an invalid email address resets the password field. Preserve the field value and show an inline validation message.",│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │723 }, │ │724 .{ │ │725 .id = events_to_consume[0].id, │ │726 - .data = .{ │ │726 + .event = .{ │ │727 .issue = .{ │ │728 .title = "Login form clears password on validation error", │ │729 .description = "Submitting an invalid email address resets the password field. Preserve the field value and show an inline validation message.",│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │817 // │ │818 │ │819 var prng = std.Random.DefaultPrng.init(std.testing.random_seed); │ │820 - const user_event_id = evt.Event.randomId(prng.random()); │ │821 - const repo_event_id = evt.Event.randomId(prng.random()); │ │820 + const user_event_id = evt.EventWithId.randomId(prng.random()); │ │821 + const repo_event_id = evt.EventWithId.randomId(prng.random()); │ │822 │ │823 var first_password_hash_buf: [evt.User.password_hash_max_len]u8 = undefined; │ │824 const first_password_hash = try evt.User.hashPassword("correct horse battery staple", &first_password_hash_buf, io);│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │826 var second_password_hash_buf: [evt.User.password_hash_max_len]u8 = undefined; │ │827 const second_password_hash = try evt.User.hashPassword("Tr0ub4dor&3", &second_password_hash_buf, io);│ │828 │ │829 - const events_to_consume = [_]evt.Event{ │ │829 + const events_to_consume = [_]evt.EventWithId{ │ │830 .{ │ │831 .id = std.fmt.bytesToHex(user_event_id, .lower), │ │832 - .data = .{ │ │832 + .event = .{ │ │833 .user = .{ │ │834 .name = "Alice Example", │ │835 .email = "alice@example.test", │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │840 // this event edits the previous one because it has the same id│ │841 .{ │ │842 .id = std.fmt.bytesToHex(user_event_id, .lower), │ │843 - .data = .{ │ │843 + .event = .{ │ │844 .user = .{ │ │845 .name = "Alice Example", │ │846 .email = "alice@example.test", │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯