fix: scope coupons by tenant

This commit is contained in:
2026-01-09 16:23:42 +08:00
parent 4d90f547e6
commit ad9dc4615f
6 changed files with 81 additions and 18 deletions

View File

@@ -171,15 +171,16 @@ func (s *UserTestSuite) Test_GetNotifications() {
// Mock notifications
_ = models.Q.Notification.WithContext(ctx).Create(&models.Notification{
UserID: userID,
Type: "system",
Title: "Welcome",
Content: "Hello World",
IsRead: false,
TenantID: tenantID,
UserID: userID,
Type: "system",
Title: "Welcome",
Content: "Hello World",
IsRead: false,
})
Convey("should return notifications", func() {
list, err := User.GetNotifications(ctx, userID, "all")
list, err := User.GetNotifications(ctx, tenantID, userID, "all")
So(err, ShouldBeNil)
So(len(list), ShouldEqual, 1)
So(list[0].Title, ShouldEqual, "Welcome")