add notif at create order

This commit is contained in:
Efril
2026-05-10 23:36:22 +07:00
parent 4ea8e32a8e
commit f73a5d533c
3 changed files with 87 additions and 4 deletions
+11
View File
@@ -61,6 +61,17 @@ func (r *UserRepositoryImpl) GetActiveUsers(ctx context.Context, organizationID
return users, err
}
func (r *UserRepositoryImpl) GetActiveByOutletID(ctx context.Context, organizationID, outletID uuid.UUID) ([]*entities.User, error) {
var users []*entities.User
err := r.db.WithContext(ctx).
Where(
"organization_id = ? AND is_active = ? AND (outlet_id = ? OR role IN ?)",
organizationID, true, outletID, []string{"admin", "manager"},
).
Find(&users).Error
return users, err
}
func (r *UserRepositoryImpl) Update(ctx context.Context, user *entities.User) error {
return r.db.WithContext(ctx).Save(user).Error
}