Complete 4-layer notification module as reference template: domain → infrastructure → application → interfaces. 10 unit tests covering all service methods with mock repository.
14 lines
610 B
Go
14 lines
610 B
Go
package domain
|
|
|
|
import "context"
|
|
|
|
type NotificationRepository interface {
|
|
Create(ctx context.Context, notification *Notification) error
|
|
FindByID(ctx context.Context, tenantID string, id uint) (*Notification, error)
|
|
FindByUser(ctx context.Context, tenantID string, userID uint, page, pageSize int) ([]Notification, int64, error)
|
|
MarkAsRead(ctx context.Context, tenantID string, id uint) error
|
|
MarkAllAsRead(ctx context.Context, tenantID string, userID uint) error
|
|
CountUnread(ctx context.Context, tenantID string, userID uint) (int64, error)
|
|
Delete(ctx context.Context, tenantID string, id uint) error
|
|
}
|