Self Order

This commit is contained in:
2026-05-04 16:23:29 +07:00
parent 2c76962959
commit b993da898f
16 changed files with 443 additions and 3 deletions
+13
View File
@@ -170,3 +170,16 @@ func (r *TableRepository) GetByOrderID(ctx context.Context, orderID uuid.UUID) (
}
return &table, nil
}
func (r *TableRepository) GetByToken(ctx context.Context, token string) (*entities.Table, error) {
var table entities.Table
err := r.db.WithContext(ctx).
Preload("Organization").
Preload("Outlet").
Where("token = ? AND is_active = ?", token, true).
First(&table).Error
if err != nil {
return nil, err
}
return &table, nil
}