feat(rental): Sprint E — emails + plugin toggle + tests #78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/rental-sprint-e"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sprint E — Emails + plugin gear-rental + tests
Finalisation de la marketplace de location matériel : transactionnel, toggle plugin admin, tests unitaires.
Emails (best-effort, dry-run sans
RESEND_API_KEY)3 nouveaux templates :
sendRentalRequestedTenant— récap demande au locataire (1 mail par RentalBooking)sendRentalRequestedProvider— nouvelle demande au prestatairesendRentalConfirmed— confirmation paiement reçuBranchements :
POST /api/rentals/checkoutenvoie tenant + provider à la création (try/catch — n'est jamais bloquant)rental-bundleenvoiesendRentalConfirmedà chaque locataire après l'update CONFIRMED+SUCCEEDEDPlugin
gear-rentalAjout au registry (catégorie business). Activable/désactivable depuis
/admin/plugins.Quand désactivé :
/materiel,/materiel/[itemId],/panier,/mes-locations,/espace-prestataire/**→ 404 (vialayout.tsx+requirePluginOr404)POST /api/rentals/checkout→ 404SiteHeadermasque les liens Matériel / Mes locations / Espace prestataire + le badge 🛒/carbets/[slug]retournenullL'admin reste libre de gérer les providers via
/admin/rental-providers(non guard).Tests vitest (16 tests / fichier)
tests/lib/rentals.test.ts:diffDays(mêmes dates, 1 nuit, 7 jours, end < start)parseCart(null/undefined/garbage/schéma invalide/valide/format date)serializeCart(updatedAt ISO, roundtrip)53 tests passent au total. Build OK.
Test plan
gear-rentalsur/admin/plugins/materielaccessible, liens header présents/materielrenvoie 404, liens header masquésrental-bundle(curl signé) → log dry-runsendRentalConfirmed🤖 Generated with Claude Code