chore: build
ci-api / test (push) Successful in 26m55s
ci-web / test (push) Successful in 14m57s

This commit is contained in:
Xor290
2026-08-18 14:46:05 +02:00
parent 02a5edd1b7
commit 955f2325fb
5 changed files with 87 additions and 0 deletions
@@ -180,6 +180,22 @@ func (s *Service) TransferToPaid(username string) error {
return nil
}
// TransferToPaidByID passe en premium la démo désignée par son id (résout
// le username propriétaire puis délègue à TransferToPaid, qui opère par
// client — un client n'a qu'une démo active à la fois, cf. Create).
// Retourne la démo mise à jour (TypeAbo="premium" déjà appliqué ; la
// migration de namespace tourne en tâche de fond, voir TransferToPaid).
func (s *Service) TransferToPaidByID(id string) (Demo, error) {
d, err := s.Get(id)
if err != nil {
return Demo{}, err
}
if err := s.TransferToPaid(d.Username); err != nil {
return Demo{}, err
}
return s.Get(id)
}
// urlFor construit l'URL publique d'une démo pour un namespace donné. Port
// omis s'il s'agit du 443 standard ; sinon affiché explicitement (ex.
// NodePort HTTPS sans LoadBalancer). Ne concerne que l'URL affichée : le