From 226f3cedb8acae6740889544708e6179631a84b0 Mon Sep 17 00:00:00 2001
From: Tony AVERTY
Date: Wed, 7 Oct 2026 11:52:09 +0200
Subject: [PATCH] =?UTF-8?q?Espace=20web=20du=20Dirigeant,=20inscription=20?=
=?UTF-8?q?en=20ligne,=20employ=C3=A9s=20et=20cadeaux=20dans=20l'app=20Pro?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- Admin : /inscription (formule, magasin, mot de passe, paiement Stripe) et
/espace (connexion Dirigeant, état de l'abonnement, conception de la carte)
- Admin : formule obligatoire à la création d'un magasin, plus d'essai gratuit,
lien d'abonnement permanent, titre des campagnes
- App Pro : écran Employés (création avec rôle Employé / Dirigeant), Mon compte
(mot de passe), titre des campagnes, remise des cadeaux en caisse, accueil
avant la conception de la carte
- Site : boutons « Choisir » vers l'inscription, avec la périodicité choisie
Co-Authored-By: Claude Opus 5.5
---
.claude/launch.json | 12 ++
admin/src/api.ts | 31 ++++-
admin/src/main.tsx | 37 ++++--
admin/src/pages/BillingTab.tsx | 41 +++---
admin/src/pages/CampaignSender.tsx | 23 +++-
admin/src/pages/CardWizard.tsx | 36 ++++--
admin/src/pages/MerchantSpace.tsx | 137 ++++++++++++++++++++
admin/src/pages/NewStorePage.tsx | 62 +++++++++-
admin/src/pages/PosterPage.tsx | 10 +-
admin/src/pages/SignupPage.tsx | 148 ++++++++++++++++++++++
admin/src/pages/StaffTab.tsx | 2 +-
backend/.env.example | 2 +
backend/src/signup/signup.controller.ts | 9 +-
docs/deploiement.md | 8 ++
pro/app/_layout.tsx | 2 +
pro/app/account.tsx | 51 ++++++++
pro/app/campaigns.tsx | 22 +++-
pro/app/client/[serial]/index.tsx | 40 +++++-
pro/app/index.tsx | 44 ++++++-
pro/app/team.tsx | 158 ++++++++++++++++++++++++
pro/src/api.ts | 3 +
pro/src/useCard.ts | 2 +-
site-src/pricing.js | 4 +-
site/assets/site.js | 4 +
site/tarif/index.html | 6 +-
25 files changed, 823 insertions(+), 71 deletions(-)
create mode 100644 admin/src/pages/MerchantSpace.tsx
create mode 100644 admin/src/pages/SignupPage.tsx
create mode 100644 pro/app/account.tsx
create mode 100644 pro/app/team.tsx
diff --git a/.claude/launch.json b/.claude/launch.json
index af2e1a0..1160bda 100644
--- a/.claude/launch.json
+++ b/.claude/launch.json
@@ -6,6 +6,18 @@
"runtimeExecutable": "npx",
"runtimeArgs": ["--yes", "http-server", "site", "-p", "4300", "-c-1", "--silent"],
"port": 4300
+ },
+ {
+ "name": "api",
+ "runtimeExecutable": "npm",
+ "runtimeArgs": ["--prefix", "backend", "run", "start:dev"],
+ "port": 3100
+ },
+ {
+ "name": "admin",
+ "runtimeExecutable": "npm",
+ "runtimeArgs": ["--prefix", "admin", "run", "dev"],
+ "port": 5173
}
]
}
diff --git a/admin/src/api.ts b/admin/src/api.ts
index 404ba64..a6e63ed 100644
--- a/admin/src/api.ts
+++ b/admin/src/api.ts
@@ -2,6 +2,9 @@
const BASE = import.meta.env.VITE_API_URL ?? '';
const REFRESH_KEY = 'mep.admin.refresh';
+/** Admin MonEspacePro, ou Dirigeant d'un magasin (espace web /espace). */
+const KIND_KEY = 'mep.admin.kind';
+export type SessionKind = 'admin' | 'staff';
let accessToken: string | null = null;
let onLogout: () => void = () => undefined;
@@ -28,10 +31,21 @@ export function hasSession() {
}
}
-function storeTokens(t: { accessToken: string; refreshToken: string }) {
+/** Type de la session ouverte dans ce navigateur, ou null. */
+export function sessionKind(): SessionKind | null {
+ try {
+ if (!localStorage.getItem(REFRESH_KEY)) return null;
+ return localStorage.getItem(KIND_KEY) === 'staff' ? 'staff' : 'admin';
+ } catch {
+ return null;
+ }
+}
+
+function storeTokens(t: { accessToken: string; refreshToken: string }, kind?: SessionKind) {
accessToken = t.accessToken;
try {
localStorage.setItem(REFRESH_KEY, t.refreshToken);
+ if (kind) localStorage.setItem(KIND_KEY, kind);
} catch {
/* navigation privée : la session durera le temps de l'onglet */
}
@@ -41,6 +55,7 @@ export function logout() {
accessToken = null;
try {
localStorage.removeItem(REFRESH_KEY);
+ localStorage.removeItem(KIND_KEY);
} catch {
/* rien */
}
@@ -52,9 +67,21 @@ export async function login(email: string, password: string) {
email,
password,
}, false);
- storeTokens(t);
+ storeTokens(t, 'admin');
}
+/** Connexion du Dirigeant (mêmes identifiants que l'app Pro). */
+export async function loginStaff(email: string, password: string) {
+ const t = await request<{ accessToken: string; refreshToken: string }>('POST', '/api/auth/staff/login', { email, password }, false);
+ storeTokens(t, 'staff');
+}
+
+/** Appel sans session (inscription en ligne). */
+export const publicApi = {
+ get: (path: string) => request('GET', path, undefined, false),
+ post: (path: string, body: unknown) => request('POST', path, body, false),
+};
+
let refreshing: Promise | null = null;
async function refresh(): Promise {
let token: string | null = null;
diff --git a/admin/src/main.tsx b/admin/src/main.tsx
index 8fe7a63..ec0223f 100644
--- a/admin/src/main.tsx
+++ b/admin/src/main.tsx
@@ -1,36 +1,55 @@
import { StrictMode, useEffect, useState } from 'react';
import { createRoot } from 'react-dom/client';
-import { BrowserRouter, Navigate, Route, Routes, useNavigate } from 'react-router-dom';
-import { hasSession, setLogoutHandler } from './api';
+import { BrowserRouter, Navigate, Route, Routes, useLocation, useNavigate } from 'react-router-dom';
+import { SessionKind, sessionKind, setLogoutHandler } from './api';
import { Layout } from './components/Layout';
import { LoginPage } from './pages/LoginPage';
import { StoresPage } from './pages/StoresPage';
import { NewStorePage } from './pages/NewStorePage';
import { StorePage } from './pages/StorePage';
import { PosterPage } from './pages/PosterPage';
+import { SignupPage } from './pages/SignupPage';
+import { MerchantLoginPage, MerchantSpace } from './pages/MerchantSpace';
import './styles.css';
function App() {
const navigate = useNavigate();
- const [authed, setAuthed] = useState(hasSession());
+ const location = useLocation();
+ const [kind, setKind] = useState(sessionKind());
+ const inSpace = location.pathname.startsWith('/espace');
useEffect(() => {
setLogoutHandler(() => {
- setAuthed(false);
- navigate('/connexion');
+ setKind(null);
+ navigate(inSpace ? '/espace' : '/connexion');
});
- }, [navigate]);
+ }, [navigate, inSpace]);
- if (!authed) {
+ // Pages publiques et espace du Dirigeant (commerçants) : même application, autre session.
+ const merchantLogin = setKind('staff')} />;
+ if (kind !== 'admin' || location.pathname === '/inscription') {
return (
- setAuthed(true)} />} />
- } />
+ } />
+ {kind === 'staff' ? (
+ <>
+ } />
+ } />
+ } />
+ >
+ ) : (
+ <>
+
+ setKind('admin')} />} />
+ } />
+ >
+ )}
);
}
return (
+
} />
}>
} />
diff --git a/admin/src/pages/BillingTab.tsx b/admin/src/pages/BillingTab.tsx
index 15b267f..34eedd3 100644
--- a/admin/src/pages/BillingTab.tsx
+++ b/admin/src/pages/BillingTab.tsx
@@ -14,13 +14,13 @@ interface CatalogEntry {
interface Billing {
testMode: boolean;
catalog: CatalogEntry[];
- trialDays: number;
+ /** Lien d'abonnement permanent du magasin. */
+ subscribeUrl: string;
subscription: {
status: SubscriptionStatus;
plan: Plan;
interval: BillingInterval;
legacyPrice: boolean;
- trialEndsAt: string | null;
cancelAtPeriodEnd: boolean;
currentPeriodEnd: string | null;
hasCustomer: boolean;
@@ -48,9 +48,8 @@ export function BillingTab({ storeId, contactEmail, onChange }: { storeId: strin
const [error, setError] = useState(null);
const [link, setLink] = useState<{ url: string; emailedTo: string | null; label: string } | null>(null);
const [busy, setBusy] = useState(false);
- const [plan, setPlan] = useState('PRO');
- const [interval, setInterval] = useState('MONTH');
- const [trial, setTrial] = useState(true);
+ const [plan, setPlan] = useState(null);
+ const [interval, setInterval] = useState(null);
const reload = useCallback(() => {
api.get(`/api/admin/stores/${storeId}/billing`).then(setData).catch((e) => setError(e.message));
@@ -75,9 +74,10 @@ export function BillingTab({ storeId, contactEmail, onChange }: { storeId: strin
if (!data) return error ? {error}
: Chargement…
;
const sub = data.subscription;
const current = sub && sub.status !== 'CANCELED' && sub.hasSubscription ? data.catalog.find((c) => c.plan === sub.plan) : null;
- const trialing = sub?.trialEndsAt && new Date(sub.trialEndsAt) > new Date();
- const trialUsed = !!sub?.trialEndsAt;
const canSubscribe = !current;
+ // Par défaut : la formule choisie à la création (ou à l'inscription).
+ const chosenPlan = plan ?? sub?.plan ?? 'PRO';
+ const chosenInterval = interval ?? sub?.interval ?? 'MONTH';
return (
<>
@@ -96,11 +96,10 @@ export function BillingTab({ storeId, contactEmail, onChange }: { storeId: strin
{sub ? STATUS[sub.status][0] : 'Aucun abonnement'}
- {trialing && Essai gratuit jusqu'au {day(sub!.trialEndsAt!)} : aucun prélèvement avant cette date.
}
{sub?.cancelAtPeriodEnd && sub.currentPeriodEnd && (
Résiliation demandée : l'abonnement s'arrête le {day(sub.currentPeriodEnd)} .
)}
- {sub?.currentPeriodEnd && sub.status === 'ACTIVE' && !sub.cancelAtPeriodEnd && !trialing && (
+ {sub?.currentPeriodEnd && sub.status === 'ACTIVE' && !sub.cancelAtPeriodEnd && (
Prochain prélèvement le {day(sub.currentPeriodEnd)} .
)}
{data.billingSuspended && Magasin suspendu automatiquement pour impayé. Il sera réactivé dès que le paiement passera.
}
@@ -123,21 +122,21 @@ export function BillingTab({ storeId, contactEmail, onChange }: { storeId: strin
Choisir une formule
- setInterval('MONTH')}>Mensuel
- setInterval('YEAR')}>Annuel — 2 mois offerts
+ setInterval('MONTH')}>Mensuel
+ setInterval('YEAR')}>Annuel — 2 mois offerts
-
- setTrial(e.target.checked)} />
-
- Offrir {data.trialDays} jours d'essai gratuit
- {trialUsed && (déjà utilisé par ce magasin) }
-
-
+ Lien permanent (il ne périme pas) : {data.subscribeUrl} .
Le commerçant pourra saisir un code promo sur la page de paiement (codes à créer dans Stripe → Coupons).
- run("Lien d'abonnement", `/api/admin/stores/${storeId}/billing/checkout-link`, { plan, interval, trial: trial && !trialUsed, sendEmail: true })}>
+ run("Lien d'abonnement", `/api/admin/stores/${storeId}/billing/checkout-link`, { plan: chosenPlan, interval: chosenInterval, sendEmail: true })}>
Envoyer le lien à {contactEmail}
- run("Lien d'abonnement", `/api/admin/stores/${storeId}/billing/checkout-link`, { plan, interval, trial: trial && !trialUsed, sendEmail: false })}>
- Créer le lien sans l'envoyer
+ run("Lien d'abonnement", `/api/admin/stores/${storeId}/billing/checkout-link`, { plan: chosenPlan, interval: chosenInterval, sendEmail: false })}>
+ Enregistrer la formule sans envoyer
diff --git a/admin/src/pages/CampaignSender.tsx b/admin/src/pages/CampaignSender.tsx
index 01d012f..2d76f58 100644
--- a/admin/src/pages/CampaignSender.tsx
+++ b/admin/src/pages/CampaignSender.tsx
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useState } from 'react';
import { api } from '../api';
interface Campaign {
+ title: string | null;
id: string;
message: string;
sentByName: string;
@@ -11,6 +12,7 @@ interface Campaign {
}
interface Overview {
+ defaultTitle: string;
allowed: boolean;
maxLength: number;
minIntervalHours: number;
@@ -26,6 +28,7 @@ const when = (d: string) =>
export function CampaignSender({ storeId, storeName }: { storeId: string; storeName: string }) {
const [data, setData] = useState(null);
const [message, setMessage] = useState('');
+ const [title, setTitle] = useState(null);
const [error, setError] = useState(null);
const [notice, setNotice] = useState(null);
const [busy, setBusy] = useState(false);
@@ -45,7 +48,7 @@ export function CampaignSender({ storeId, storeName }: { storeId: string; storeN
setBusy(true);
setError(null);
try {
- await api.post(`/api/admin/stores/${storeId}/campaigns`, { message: text });
+ await api.post(`/api/admin/stores/${storeId}/campaigns`, { message: text, title: (title ?? data!.defaultTitle).trim() });
setMessage('');
setNotice('Campagne envoyée. Les cartes se mettent à jour dans les minutes qui suivent.');
load();
@@ -69,7 +72,19 @@ export function CampaignSender({ storeId, storeName }: { storeId: string; storeN
Audience : {data.audience.cards} cartes, dont {data.audience.appleDevices} iPhone joignables (Google Wallet : tous les clients qui ont ajouté la carte).
- Message
+
+ Titre de la notification
+ setTitle(e.target.value)}
+ disabled={blocked || busy}
+ />
+ Affiché sur Google Wallet. Sur iPhone, le nom du magasin apparaît toujours en titre.
+
+ Message
-
{text.length} / {data.maxLength} caractères · 1 campagne par jour maximum
+
{text.length} / {data.maxLength} caractères · 1 campagne toutes les {data.minIntervalHours} h maximum
{busy ? 'Envoi…' : 'Envoyer la campagne'}
@@ -108,7 +123,7 @@ export function CampaignSender({ storeId, storeName }: { storeId: string; storeN
{data.items.map((c) => (
{when(c.createdAt)}
- {c.message}
+ {c.title && {c.title} · }{c.message}
{c.sentByName}
{c.cards}
diff --git a/admin/src/pages/CardWizard.tsx b/admin/src/pages/CardWizard.tsx
index 7a444e5..31ec2b3 100644
--- a/admin/src/pages/CardWizard.tsx
+++ b/admin/src/pages/CardWizard.tsx
@@ -9,7 +9,7 @@ const STEPS = ['Identité', 'Couleurs', 'Règle de points', 'Récompenses', 'Ré
type Draft = Omit
;
-function defaults(store: StoreDetail): Draft {
+function defaults(store: Pick): Draft {
return {
programName: `Fidélité ${store.name}`.slice(0, 40),
backgroundColor: '#1F2937',
@@ -21,8 +21,25 @@ function defaults(store: StoreDetail): Draft {
};
}
-export function CardWizard({ store, onSaved }: { store: StoreDetail; onSaved: () => void }) {
- const base = `/api/admin/stores/${store.id}/card-design`;
+type WizardStore = Pick;
+
+/**
+ * Conception de la carte. Admin : base par défaut. Espace du Dirigeant :
+ * `base` = /api/staff/card-design, `posterHref` et `draftNote` adaptés.
+ */
+export function CardWizard({
+ store,
+ onSaved,
+ base = `/api/admin/stores/${store.id}/card-design`,
+ posterHref = `/magasins/${store.id}/affichette`,
+ draftNote,
+}: {
+ store: WizardStore;
+ onSaved: () => void;
+ base?: string;
+ posterHref?: string;
+ draftNote?: React.ReactNode;
+}) {
const [step, setStep] = useState(0);
const [draft, setDraft] = useState(null);
const [images, setImages] = useState<{ logoUrl: string | null; stripUrl: string | null }>({ logoUrl: null, stripUrl: null });
@@ -254,14 +271,15 @@ export function CardWizard({ store, onSaved }: { store: StoreDetail; onSaved: ()
Le QR mène à la page d'inscription :
{store.enrollUrl}
-
Imprimer l'affichette (A5 / A6)
+
Imprimer l'affichette (A5 / A6)
- {store.status === 'DRAFT' && (
-
- Utilisez le bouton Activer en haut de la fiche pour ouvrir le programme.
-
- )}
+ {store.status === 'DRAFT' &&
+ (draftNote ?? (
+
+ Le programme s'ouvre automatiquement dès que l'abonnement est payé. Sinon, utilisez le bouton Activer en haut de la fiche.
+
+ ))}
>
)}
diff --git a/admin/src/pages/MerchantSpace.tsx b/admin/src/pages/MerchantSpace.tsx
new file mode 100644
index 0000000..355e98d
--- /dev/null
+++ b/admin/src/pages/MerchantSpace.tsx
@@ -0,0 +1,137 @@
+import { FormEvent, useCallback, useEffect, useState } from 'react';
+import { Link, useNavigate, useSearchParams } from 'react-router-dom';
+import { api, ApiError, loginStaff, logout, Plan, PLAN_LABEL, StoreStatus, SubscriptionStatus } from '../api';
+import { Brand } from '../components/Layout';
+import { CardWizard } from './CardWizard';
+
+interface MerchantStore {
+ id: string;
+ name: string;
+ status: StoreStatus;
+ enrollUrl: string;
+ subscription: { status: SubscriptionStatus; plan: Plan } | null;
+ subscribeUrl: string | null;
+}
+
+/** Connexion du Dirigeant à son espace web. */
+export function MerchantLoginPage({ onLogin }: { onLogin: () => void }) {
+ const navigate = useNavigate();
+ const [params] = useSearchParams();
+ const welcome = params.has('bienvenue');
+ const [email, setEmail] = useState('');
+ const [password, setPassword] = useState('');
+ const [error, setError] = useState(null);
+ const [busy, setBusy] = useState(false);
+
+ async function submit(e: FormEvent) {
+ e.preventDefault();
+ setBusy(true);
+ setError(null);
+ try {
+ await loginStaff(email, password);
+ onLogin();
+ navigate('/espace', { replace: true });
+ } catch (err) {
+ // Juste après le paiement, le webhook Stripe peut avoir quelques secondes de retard.
+ setError(
+ welcome && err instanceof ApiError && err.status === 401
+ ? 'Votre espace est en cours de création. Réessayez dans quelques secondes.'
+ : (err as Error).message,
+ );
+ } finally {
+ setBusy(false);
+ }
+ }
+
+ return (
+
+
+
+ );
+}
+
+/** Espace web du Dirigeant : état du magasin, abonnement, conception de la carte. */
+export function MerchantSpace() {
+ const [store, setStore] = useState(null);
+ const [error, setError] = useState(null);
+
+ const reload = useCallback(() => {
+ api
+ .get('/api/staff/store')
+ .then(setStore)
+ .catch((e) => setError(e instanceof ApiError && e.status === 403 ? 'Cet espace est réservé au Dirigeant du magasin. Utilisez l’app MonEspacePro Pro pour scanner les cartes.' : e.message));
+ }, []);
+ useEffect(reload, [reload]);
+
+ return (
+
+
+
+ {error && {error}
}
+ {!store && !error && Chargement…
}
+ {store && (
+ <>
+
+
{store.name}
+
+ {store.subscription ? `Formule ${PLAN_LABEL[store.subscription.plan]}` : 'Aucune formule'} ·{' '}
+ {store.status === 'ACTIVE' ? 'Programme ouvert à vos clients' : store.status === 'DRAFT' ? 'Programme pas encore ouvert' : 'Programme suspendu'}
+
+
+ {store.subscribeUrl && (
+
+
Votre abonnement n’est pas encore actif : le programme s’ouvrira dès le paiement validé.
+
Activer mon abonnement
+
+ )}
+ {store.status === 'SUSPENDED' && Programme suspendu. Il rouvre automatiquement dès le paiement de l’abonnement régularisé.
}
+ {store.status === 'ACTIVE' && (
+
+ )}
+
+ Employés, modules (campagnes, anniversaire, relances…) et statistiques : dans l’app MonEspacePro Pro, avec les mêmes identifiants.
+
+
+ {store.subscribeUrl
+ ? 'Votre programme s’ouvrira automatiquement dès votre abonnement activé.'
+ : 'Enregistrez la carte : votre programme s’ouvre automatiquement à vos clients.'}
+
+ }
+ />
+ >
+ )}
+
+
+ );
+}
diff --git a/admin/src/pages/NewStorePage.tsx b/admin/src/pages/NewStorePage.tsx
index 1db1862..ddc69b0 100644
--- a/admin/src/pages/NewStorePage.tsx
+++ b/admin/src/pages/NewStorePage.tsx
@@ -1,24 +1,78 @@
+import { useState } from 'react';
import { Link, useNavigate } from 'react-router-dom';
-import { api, Store } from '../api';
+import { api, BillingInterval, Plan, PLAN_LABEL, Store, StaffUser } from '../api';
import { EMPTY_STORE, StoreForm } from '../components/StoreForm';
+type Created = Store & { manager: StaffUser | null; link: { url: string | null; emailedTo: string | null; error?: string } };
+
export function NewStorePage() {
const navigate = useNavigate();
+ const [plan, setPlan] = useState('PRO');
+ const [interval, setInterval] = useState('MONTH');
+ const [created, setCreated] = useState(null);
+
+ if (created) {
+ return (
+ <>
+
+ ← Magasins
+
{created.name} est créé
+
+
+ {created.link.emailedTo ? (
+
+ Lien de paiement (formule {PLAN_LABEL[plan]}, {interval === 'YEAR' ? 'annuelle' : 'mensuelle'}) envoyé à {created.link.emailedTo}
+ {created.manager && ', avec ses identifiants Dirigeant'}. Le magasin s'ouvrira automatiquement dès le paiement validé et la carte conçue.
+
+ ) : (
+ Le lien de paiement n'a pas pu être envoyé : {created.link.error}. Renvoyez-le depuis l'onglet Facturation.
+ )}
+ {created.manager ? (
+ <>
+
+ Compte Dirigeant : {created.manager.email} , mot de passe provisoire :
+
+ {created.manager.provisionalPassword}
+ >
+ ) : (
+ Un compte existe déjà avec l'e-mail du contact : créez le Dirigeant à la main dans l'onglet Employés.
+ )}
+
+ navigate(`/magasins/${created.id}/carte`)}>Concevoir la carte
+
+
+ >
+ );
+ }
+
return (
<>
← Magasins
Nouveau magasin
- Après la création, vous passerez à la conception de la carte de fidélité.
+ À la création, le contact reçoit automatiquement par e-mail le lien de paiement de la formule choisie et ses identifiants Dirigeant.
+
+ Formule *
+
+ {(['ESSENTIEL', 'PRO', 'RESEAU'] as const).map((p) => (
+ setPlan(p)}>
+ {PLAN_LABEL[p]}
+
+ ))}
+
+
+ setInterval('MONTH')}>Mensuel
+ setInterval('YEAR')}>Annuel — 2 mois offerts
+
+
{
- const store = await api.post('/api/admin/stores', v);
- navigate(`/magasins/${store.id}/carte`);
+ setCreated(await api.post('/api/admin/stores', { ...v, plan, interval }));
}}
/>
>
diff --git a/admin/src/pages/PosterPage.tsx b/admin/src/pages/PosterPage.tsx
index 8a4923c..9fd4c89 100644
--- a/admin/src/pages/PosterPage.tsx
+++ b/admin/src/pages/PosterPage.tsx
@@ -4,8 +4,10 @@ import { api, assetUrl, CardDesign, StoreDetail } from '../api';
import { Poster, PosterFormat } from '../components/Poster';
/** Page d'impression de l'affichette, sans la mise en page de l'admin. */
-export function PosterPage() {
+export function PosterPage({ merchant = false }: { merchant?: boolean }) {
const { id } = useParams<{ id: string }>();
+ const storePath = merchant ? '/api/staff/store' : `/api/admin/stores/${id}`;
+ const designPath = merchant ? '/api/staff/card-design' : `/api/admin/stores/${id}/card-design`;
const [params, setParams] = useSearchParams();
const format: PosterFormat = params.get('format') === 'A6' ? 'A6' : 'A5';
const [store, setStore] = useState(null);
@@ -13,13 +15,13 @@ export function PosterPage() {
const [error, setError] = useState(null);
useEffect(() => {
- Promise.all([api.get(`/api/admin/stores/${id}`), api.get(`/api/admin/stores/${id}/card-design`)])
+ Promise.all([api.get(storePath), api.get(designPath)])
.then(([s, d]) => {
setStore(s);
setDesign(d);
})
.catch((e) => setError(e.message));
- }, [id]);
+ }, [storePath, designPath]);
if (error) return {error}
;
if (!store) return Chargement…
;
@@ -29,7 +31,7 @@ export function PosterPage() {
-
← Retour à la carte
+
← Retour à la carte
{(['A5', 'A6'] as const).map((f) => (
setParams({ format: f })}>{f}
diff --git a/admin/src/pages/SignupPage.tsx b/admin/src/pages/SignupPage.tsx
new file mode 100644
index 0000000..4451cad
--- /dev/null
+++ b/admin/src/pages/SignupPage.tsx
@@ -0,0 +1,148 @@
+import { FormEvent, useEffect, useState } from 'react';
+import { Link, useSearchParams } from 'react-router-dom';
+import { BillingInterval, Plan, PLAN_LABEL, publicApi } from '../api';
+import { Brand } from '../components/Layout';
+
+interface PlanInfo {
+ plan: Plan;
+ name: string;
+ tagline: string;
+ priceCents: Record
;
+ modules: { id: string; name: string }[];
+ limits: { maxStaff: number | null };
+}
+
+const euros = (c: number) => (c / 100).toLocaleString('fr-FR', { style: 'currency', currency: 'EUR', minimumFractionDigits: c % 100 ? 2 : 0 });
+const PLANS: Plan[] = ['ESSENTIEL', 'PRO', 'RESEAU'];
+
+const FIELDS = [
+ ['name', 'Nom du commerce', { autoComplete: 'organization', placeholder: 'Boulangerie Kerlann', maxLength: 120 }],
+ ['siret', 'SIRET', { inputMode: 'numeric', placeholder: '123 456 789 00012' }],
+ ['addressLine', 'Adresse', { autoComplete: 'street-address', maxLength: 200 }],
+ ['postalCode', 'Code postal', { autoComplete: 'postal-code', inputMode: 'numeric', maxLength: 5 }],
+ ['city', 'Ville', { autoComplete: 'address-level2', maxLength: 120 }],
+ ['contactName', 'Prénom et nom du dirigeant', { autoComplete: 'name', maxLength: 120 }],
+ ['contactPhone', 'Téléphone', { autoComplete: 'tel', type: 'tel' }],
+ ['contactEmail', 'E-mail (votre identifiant)', { autoComplete: 'email', type: 'email' }],
+] as const;
+
+type Values = Record<(typeof FIELDS)[number][0] | 'password', string>;
+
+/**
+ * Inscription en ligne (lien « Choisir » de la page Tarif) : formule, magasin,
+ * identifiants, puis paiement Stripe. Le magasin et le compte Dirigeant sont
+ * créés automatiquement dès le paiement validé.
+ */
+export function SignupPage() {
+ const [params] = useSearchParams();
+ const wanted = (params.get('formule') ?? '').toUpperCase() as Plan;
+ const [plan, setPlan] = useState(PLANS.includes(wanted) ? wanted : 'PRO');
+ const [interval, setInterval] = useState(params.get('periode') === 'annuel' ? 'YEAR' : 'MONTH');
+ const [catalog, setCatalog] = useState([]);
+ const [v, setV] = useState({ name: '', siret: '', addressLine: '', postalCode: '', city: '', contactName: '', contactPhone: '', contactEmail: '', password: '' });
+ const [cgv, setCgv] = useState(false);
+ const [error, setError] = useState(params.get('annule') ? 'Paiement annulé : rien n’a été prélevé. Vous pouvez reprendre quand vous voulez.' : null);
+ const [busy, setBusy] = useState(false);
+
+ useEffect(() => {
+ publicApi.get('/api/public/signup/plans').then(setCatalog).catch(() => undefined);
+ }, []);
+
+ async function submit(e: FormEvent) {
+ e.preventDefault();
+ setBusy(true);
+ setError(null);
+ try {
+ const { url } = await publicApi.post<{ url: string }>('/api/public/signup', { ...v, plan, interval, cgv });
+ window.location.assign(url);
+ } catch (err) {
+ setError((err as Error).message);
+ setBusy(false);
+ window.scrollTo({ top: 0, behavior: 'smooth' });
+ }
+ }
+
+ const current = catalog.find((c) => c.plan === plan);
+
+ return (
+
+
+
+ );
+}
diff --git a/admin/src/pages/StaffTab.tsx b/admin/src/pages/StaffTab.tsx
index 8c7ca2d..a5c0c1c 100644
--- a/admin/src/pages/StaffTab.tsx
+++ b/admin/src/pages/StaffTab.tsx
@@ -156,7 +156,7 @@ function NewStaffForm({ base, onCancel, onCreated }: { base: string; onCancel: (
{ROLE_LABEL[r]}
- {r === 'MANAGER' ? 'Voit toutes les opérations du magasin' : 'Scanne et crédite, voit ses opérations'}
+ {r === 'MANAGER' ? 'Toute la configuration : carte, modules, campagnes, employés, statistiques' : 'Scanne les cartes et crédite les points, voit ses opérations'}
diff --git a/backend/.env.example b/backend/.env.example
index 1dad5b8..cf05c87 100644
--- a/backend/.env.example
+++ b/backend/.env.example
@@ -13,6 +13,8 @@ SEED_ADMIN_PASSWORD=
PUBLIC_URL=http://localhost:3100
# Adresse des pages clients (/c/…, /carte/…). Production : WEB_URL=https://monespacepro.eu
WEB_URL=
+# Admin et espace web des commerçants (/inscription, /espace). Défaut : https://admin.monespacepro.eu
+ADMIN_URL=
# Apple Wallet — fichiers PEM hors du dépôt (voir docs/wallet.md)
APPLE_PASS_TYPE_ID=
diff --git a/backend/src/signup/signup.controller.ts b/backend/src/signup/signup.controller.ts
index 4d17a5d..b9736ae 100644
--- a/backend/src/signup/signup.controller.ts
+++ b/backend/src/signup/signup.controller.ts
@@ -1,4 +1,4 @@
-import { Body, Controller, HttpCode, Post } from '@nestjs/common';
+import { Body, Controller, Get, HttpCode, Post } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { PickType } from '@nestjs/mapped-types';
import { Throttle } from '@nestjs/throttler';
@@ -6,6 +6,7 @@ import { BillingInterval, Plan } from '@prisma/client';
import { Equals, IsEnum, IsString, Length } from 'class-validator';
import { CreateStoreDto } from '../stores/dto/store.dto';
import { BillingService } from '../billing/billing.service';
+import { publicCatalog } from '../billing/plans';
import { SignupService } from './signup.service';
class SignupDto extends PickType(CreateStoreDto, ['name', 'siret', 'addressLine', 'postalCode', 'city', 'contactName', 'contactEmail', 'contactPhone'] as const) {
@@ -32,6 +33,12 @@ export class SignupController {
private config: ConfigService,
) {}
+ /** Formules et prix affichés sur le formulaire d'inscription. */
+ @Get('plans')
+ plans() {
+ return publicCatalog();
+ }
+
@Post()
@HttpCode(200)
@Throttle({ default: { limit: 5, ttl: 10 * 60_000 } })
diff --git a/docs/deploiement.md b/docs/deploiement.md
index 6ed9a73..4d7f580 100644
--- a/docs/deploiement.md
+++ b/docs/deploiement.md
@@ -78,6 +78,14 @@ Si `node` est introuvable depuis cron, le journal donne le chemin exact à ajout
Mise à jour de l'admin : `npm run build` puis remplacer les fichiers. Pas de redémarrage.
+Ce même site sert aussi les commerçants (aucune configuration en plus) :
+- `/inscription` : inscription en ligne, liée depuis les boutons « Choisir » de la page Tarif ;
+- `/espace` : espace web du Dirigeant (conception de la carte), mêmes identifiants que l'app Pro.
+
+Après le paiement Stripe, le webhook `checkout.session.completed` (déjà abonné) crée le magasin, l'abonnement et le compte
+Dirigeant, puis envoie l'e-mail de bienvenue. Le magasin s'ouvre tout seul dès que la carte est enregistrée.
+Si le site admin change d'adresse, renseigner `ADMIN_URL` dans le `.env` de l'API.
+
## 5 bis. Site vitrine `monespacepro.eu` + pages clients
Les liens montrés aux clients (QR d'inscription `/c/`, lien de la carte `/carte/`) sont sur **monespacepro.eu**
(`WEB_URL=https://monespacepro.eu` dans le `.env` de l'API). Le site vitrine est statique ; nginx transmet ces chemins à l'API.
diff --git a/pro/app/_layout.tsx b/pro/app/_layout.tsx
index 1ba90e7..1900bc7 100644
--- a/pro/app/_layout.tsx
+++ b/pro/app/_layout.tsx
@@ -52,6 +52,8 @@ function Navigator() {
+
+
);
diff --git a/pro/app/account.tsx b/pro/app/account.tsx
new file mode 100644
index 0000000..68d69c1
--- /dev/null
+++ b/pro/app/account.tsx
@@ -0,0 +1,51 @@
+import { useState } from 'react';
+import { ScrollView, TextInput } from 'react-native';
+import { api } from '../src/api';
+import { describe } from '../src/errors';
+import { useSession } from '../src/session';
+import { Banner, Button, T } from '../src/ui';
+import { font, useColors } from '../src/theme';
+
+/** Mon compte : changement du mot de passe (tous les rôles). */
+export default function Account() {
+ const c = useColors();
+ const { me } = useSession();
+ const [current, setCurrent] = useState('');
+ const [next, setNext] = useState('');
+ const [error, setError] = useState(null);
+ const [done, setDone] = useState(false);
+ const [busy, setBusy] = useState(false);
+
+ async function save() {
+ setBusy(true);
+ setError(null);
+ setDone(false);
+ try {
+ await api.post('/api/staff/password', { current, next });
+ setCurrent('');
+ setNext('');
+ setDone(true);
+ } catch (e) {
+ setError(describe(e).detail);
+ } finally {
+ setBusy(false);
+ }
+ }
+
+ const input = { borderWidth: 1, borderColor: c.border, borderRadius: 14, padding: 14, backgroundColor: c.surface, color: c.text, fontFamily: font.regular, fontSize: 16 } as const;
+ return (
+
+
+ {me?.displayName} · {me?.role === 'MANAGER' ? 'Dirigeant' : 'Employé'}
+
+ {error && {error} }
+ {done && Mot de passe modifié. }
+ Mot de passe actuel
+
+ Nouveau mot de passe
+
+ 10 caractères minimum.
+
+
+ );
+}
diff --git a/pro/app/campaigns.tsx b/pro/app/campaigns.tsx
index b6c0f8d..9029bda 100644
--- a/pro/app/campaigns.tsx
+++ b/pro/app/campaigns.tsx
@@ -8,12 +8,13 @@ import { Banner, Button, Card, T } from '../src/ui';
import { font, useColors } from '../src/theme';
interface Overview {
+ defaultTitle: string;
allowed: boolean;
maxLength: number;
minIntervalHours: number;
audience: { cards: number; appleDevices: number };
nextAllowedAt: string | null;
- items: { id: string; message: string; sentByName: string; cards: number; createdAt: string }[];
+ items: { id: string; title: string | null; message: string; sentByName: string; cards: number; createdAt: string }[];
}
const when = (d: string) =>
@@ -25,6 +26,7 @@ export default function Campaigns() {
const store = useStore();
const [data, setData] = useState(null);
const [message, setMessage] = useState('');
+ const [title, setTitle] = useState(null);
const [error, setError] = useState(null);
const [sent, setSent] = useState(false);
const [busy, setBusy] = useState(false);
@@ -46,7 +48,7 @@ export default function Campaigns() {
const blocked = !data || !data.allowed || !!data.nextAllowedAt;
const send = () =>
- Alert.alert('Envoyer la campagne ?', `${data!.audience.cards} cartes de ${store.name} recevront :\n\n« ${text} »`, [
+ Alert.alert('Envoyer la campagne ?', `${data!.audience.cards} cartes de ${store.name} recevront :\n\n${(title ?? data!.defaultTitle).trim()}\n« ${text} »`, [
{ text: 'Annuler', style: 'cancel' },
{
text: 'Envoyer',
@@ -54,7 +56,7 @@ export default function Campaigns() {
setBusy(true);
setError(null);
try {
- await api.post('/api/staff/campaigns', { message: text });
+ await api.post('/api/staff/campaigns', { message: text, title: (title ?? data!.defaultTitle).trim() });
setMessage('');
setSent(true);
await load();
@@ -77,6 +79,19 @@ export default function Campaigns() {
Votre message apparaît en notification sur le téléphone de vos clients et reste visible sur leur carte.
{data ? ` ${data.audience.cards} cartes au total.` : ''}
+ Titre de la notification
+
+ Affiché sur Google Wallet ; sur iPhone, le nom du magasin apparaît toujours.
+ Message
Campagnes envoyées
{data.items.map((i) => (
+ {!!i.title && {i.title} }
{i.message}
{when(i.createdAt)} · {i.sentByName} · {i.cards} cartes
diff --git a/pro/app/client/[serial]/index.tsx b/pro/app/client/[serial]/index.tsx
index a7b2560..94ddb9a 100644
--- a/pro/app/client/[serial]/index.tsx
+++ b/pro/app/client/[serial]/index.tsx
@@ -1,8 +1,10 @@
-import { ActivityIndicator, View } from 'react-native';
+import { useState } from 'react';
+import { ActivityIndicator, Alert, View } from 'react-native';
import { router } from 'expo-router';
import { useStore } from '../../../src/session';
import { useCard } from '../../../src/useCard';
-import { ErrorScreen } from '../../../src/errors';
+import { api, CardInfo } from '../../../src/api';
+import { describe, ErrorScreen } from '../../../src/errors';
import { Banner, Button, Card, Screen, T, unit } from '../../../src/ui';
import { font, useColors } from '../../../src/theme';
@@ -19,7 +21,8 @@ function ago(iso: string) {
export default function ClientCard() {
const c = useColors();
const store = useStore();
- const { serial, card, error, reload } = useCard();
+ const { serial, card, setCard, error, reload } = useCard();
+ const [giving, setGiving] = useState(null);
if (error) return ;
if (!card) return ;
@@ -27,6 +30,25 @@ export default function ClientCard() {
const mode = store.design.pointsMode;
const cheapest = store.design.rewards[0];
const reachable = store.design.rewards.filter((r) => r.cost <= card.balance).length;
+ const SOURCE = { BIRTHDAY: 'Anniversaire', REFERRAL: 'Parrainage', REFERRAL_FRIEND: 'Bienvenue (parrainage)' } as const;
+
+ const give = (g: CardInfo['gifts'][number]) =>
+ Alert.alert('Remettre le cadeau ?', `« ${g.label} » à ${card.firstName}`, [
+ { text: 'Annuler', style: 'cancel' },
+ {
+ text: 'Remis',
+ onPress: async () => {
+ setGiving(g.id);
+ try {
+ setCard(await api.post(`/api/staff/cards/${encodeURIComponent(serial)}/gifts/${g.id}/use`));
+ } catch (e) {
+ Alert.alert('Impossible', describe(e).detail);
+ } finally {
+ setGiving(null);
+ }
+ },
+ },
+ ]);
return (
@@ -52,6 +74,18 @@ export default function ClientCard() {
) : null}
+ {card.gifts?.map((g) => (
+
+
+ 🎁 {g.label}
+
+ {SOURCE[g.source]} · {new Date(g.createdAt).toLocaleDateString('fr-FR', { day: 'numeric', month: 'short' })}
+
+
+ give(g)} />
+
+ ))}
+
{card.nextCreditAt && (
Déjà créditée récemment : nouveau crédit possible à{' '}
diff --git a/pro/app/index.tsx b/pro/app/index.tsx
index 8b2832d..b417145 100644
--- a/pro/app/index.tsx
+++ b/pro/app/index.tsx
@@ -1,11 +1,11 @@
import { useCallback, useState } from 'react';
-import { Alert, Pressable, RefreshControl, ScrollView, View } from 'react-native';
+import { Alert, Linking, Pressable, RefreshControl, ScrollView, View } from 'react-native';
import { router, useFocusEffect } from 'expo-router';
import { SafeAreaView } from 'react-native-safe-area-context';
import Svg, { Path } from 'react-native-svg';
import { api, Summary } from '../src/api';
import { useSession, useStore } from '../src/session';
-import { BrandSymbol, Button, Card, T, unit } from '../src/ui';
+import { Banner, BrandSymbol, Button, Card, T, unit } from '../src/ui';
import { font, useColors } from '../src/theme';
function ScanIcon({ color }: { color: string }) {
@@ -16,7 +16,44 @@ function ScanIcon({ color }: { color: string }) {
);
}
+/** Adresse de l'espace web du Dirigeant (conception de la carte). */
+const ESPACE_URL = 'https://admin.monespacepro.eu/espace';
+
export default function Home() {
+ const { me } = useSession();
+ // Magasin inscrit en ligne : tant que la carte n'est pas conçue, pas de scan possible.
+ return me?.store.cardDesign ? : ;
+}
+
+function NoCardYet() {
+ const c = useColors();
+ const { me, logout, reload } = useSession();
+ const isManager = me?.role === 'MANAGER';
+ return (
+
+
+
+
+ {me?.store.name}
+
+
+ {isManager
+ ? 'Concevez votre carte de fidélité (logo, couleurs, récompenses) sur votre espace web : le scan des cartes s’active ensuite.'
+ : 'La carte de fidélité du magasin n’est pas encore prête. Revenez un peu plus tard.'}
+
+ {isManager && Linking.openURL(ESPACE_URL)} />}
+
+ {isManager && router.push('/team')} />}
+ {isManager && router.push('/loyalty')} />}
+
+ router.push('/account')} />
+
+
+
+ );
+}
+
+function Counter() {
const c = useColors();
const { me, logout } = useSession();
const store = useStore();
@@ -113,8 +150,11 @@ export default function Home() {
{isManager && router.push('/loyalty')} />}
+ {isManager && router.push('/campaigns')} />}
+ {isManager && router.push('/team')} />}
{isManager && router.push('/stats')} />}
router.push('/history')} />
+ router.push('/account')} />
);
diff --git a/pro/app/team.tsx b/pro/app/team.tsx
new file mode 100644
index 0000000..d8bdb46
--- /dev/null
+++ b/pro/app/team.tsx
@@ -0,0 +1,158 @@
+import { useCallback, useState } from 'react';
+import { Alert, Pressable, ScrollView, Share, TextInput, View } from 'react-native';
+import { useFocusEffect } from 'expo-router';
+import { api } from '../src/api';
+import { describe } from '../src/errors';
+import { useSession } from '../src/session';
+import { Banner, Button, Card, T } from '../src/ui';
+import { font, useColors } from '../src/theme';
+
+type Role = 'MANAGER' | 'EMPLOYEE';
+interface Member {
+ id: string;
+ email: string;
+ displayName: string;
+ role: Role;
+ active: boolean;
+ provisionalPassword?: string;
+}
+
+const ROLE: Record = {
+ EMPLOYEE: ['Employé', 'Scanne les cartes et crédite les points'],
+ MANAGER: ['Dirigeant', 'Toute la configuration : modules, campagnes, employés, statistiques'],
+};
+
+/** Employés du magasin (Dirigeant) : création avec rôle, désactivation, nouveau mot de passe. */
+export default function Team() {
+ const c = useColors();
+ const { me } = useSession();
+ const [list, setList] = useState(null);
+ const [error, setError] = useState(null);
+ const [name, setName] = useState('');
+ const [email, setEmail] = useState('');
+ const [role, setRole] = useState('EMPLOYEE');
+ const [busy, setBusy] = useState(false);
+ const [created, setCreated] = useState(null);
+
+ const load = useCallback(async () => {
+ try {
+ setList(await api.get('/api/staff/team'));
+ } catch (e) {
+ setError(describe(e).detail);
+ }
+ }, []);
+ useFocusEffect(
+ useCallback(() => {
+ load();
+ }, [load]),
+ );
+
+ async function run(fn: () => Promise) {
+ setError(null);
+ try {
+ await fn();
+ await load();
+ } catch (e) {
+ setError(describe(e).detail);
+ }
+ }
+
+ async function create() {
+ setBusy(true);
+ setCreated(null);
+ await run(async () => {
+ setCreated(await api.post('/api/staff/team', { displayName: name.trim(), email: email.trim(), role }));
+ setName('');
+ setEmail('');
+ setRole('EMPLOYEE');
+ });
+ setBusy(false);
+ }
+
+ const input = { borderWidth: 1, borderColor: c.border, borderRadius: 14, padding: 14, backgroundColor: c.surface, color: c.text, fontFamily: font.regular, fontSize: 16 } as const;
+
+ return (
+
+ {error && {error} }
+ {created?.provisionalPassword && (
+
+ Compte créé pour {created.displayName}
+ Identifiant : {created.email}
+ {created.provisionalPassword}
+ Mot de passe provisoire : il ne sera plus affiché ensuite.
+ Share.share({ message: `MonEspacePro Pro\nIdentifiant : ${created.email}\nMot de passe : ${created.provisionalPassword}` })}
+ />
+
+ )}
+
+
+ Nouvel employé
+
+
+ {(['EMPLOYEE', 'MANAGER'] as const).map((r) => (
+ setRole(r)}>
+
+ {ROLE[r][0]}
+ {ROLE[r][1]}
+
+
+ ))}
+
+
+
+
+ Comptes
+ {list?.map((m) => {
+ const self = m.id === me?.id;
+ return (
+
+
+
+ {m.displayName}
+ {self ? ' (vous)' : ''}
+
+
+ {m.email} · {ROLE[m.role][0]}
+ {m.active ? '' : ' · désactivé'}
+
+
+ {!self && (
+
+ run(() => api.patch(`/api/staff/team/${m.id}`, { role: m.role === 'MANAGER' ? 'EMPLOYEE' : 'MANAGER' }))}
+ />
+ run(() => api.patch(`/api/staff/team/${m.id}`, { active: !m.active }))} />
+
+ Alert.alert('Nouveau mot de passe ?', `${m.displayName} sera déconnecté(e) de ses appareils.`, [
+ { text: 'Annuler', style: 'cancel' },
+ { text: 'Générer', onPress: () => run(async () => setCreated(await api.post(`/api/staff/team/${m.id}/reset-password`))) },
+ ])
+ }
+ />
+
+ )}
+
+ );
+ })}
+
+
+ );
+}
diff --git a/pro/src/api.ts b/pro/src/api.ts
index 7dadb28..a1b55b5 100644
--- a/pro/src/api.ts
+++ b/pro/src/api.ts
@@ -101,6 +101,7 @@ export const api = {
get: (path: string) => request('GET', path),
post: (path: string, body: unknown = {}) => request('POST', path, body),
put: (path: string, body: unknown) => request('PUT', path, body),
+ patch: (path: string, body: unknown) => request('PATCH', path, body),
};
// ── Types de l'API ─────────────────────────────────────────────
@@ -142,6 +143,8 @@ export interface CardInfo {
memberSince: string;
lastCreditAt: string | null;
nextCreditAt: string | null;
+ /** Cadeaux en nature à remettre (anniversaire, parrainage). */
+ gifts: { id: string; label: string; source: 'BIRTHDAY' | 'REFERRAL' | 'REFERRAL_FRIEND'; createdAt: string }[];
}
export interface Summary {
diff --git a/pro/src/useCard.ts b/pro/src/useCard.ts
index 0ca6725..5421eeb 100644
--- a/pro/src/useCard.ts
+++ b/pro/src/useCard.ts
@@ -21,5 +21,5 @@ export function useCard() {
load();
}, [load]);
- return { serial, card, error, reload: load };
+ return { serial, card, setCard, error, reload: load };
}
diff --git a/site-src/pricing.js b/site-src/pricing.js
index 385eb07..99adc61 100644
--- a/site-src/pricing.js
+++ b/site-src/pricing.js
@@ -40,6 +40,8 @@ const euros = (cents) =>
(cents / 100).toLocaleString('fr-FR', { minimumFractionDigits: cents % 100 ? 2 : 0, maximumFractionDigits: 2 }).replace(/ /g, ' ');
const plans = Object.values(PLANS);
const min = Math.min(...plans.map((p) => p.priceCents.MONTH));
+/** Inscription en ligne (application web, voir admin/src/pages/SignupPage.tsx). */
+const SIGNUP_URL = 'https://admin.monespacepro.eu/inscription';
const FROM = `${euros(min)} €`;
function planCard(def) {
@@ -53,7 +55,7 @@ ${pro ? 'Conseillée ' : ''}
${def.tagline}
${euros(def.priceCents.MONTH)} €/ mois${perStore}
Sans engagement, résiliable à tout moment
-Choisir ${def.name}
+Choisir ${def.name}
${m.intro ? `${m.intro}
` : ''}
${m.items
diff --git a/site/assets/site.js b/site/assets/site.js
index 3d22610..cb28f1b 100644
--- a/site/assets/site.js
+++ b/site/assets/site.js
@@ -43,6 +43,10 @@
document.querySelectorAll('[data-price],[data-per],[data-note]').forEach(function (el) {
el.innerHTML = el.getAttribute('data-' + interval);
});
+ // Les boutons « Choisir » emportent la périodicité vers l'inscription.
+ document.querySelectorAll('[data-plan-link]').forEach(function (a) {
+ a.href = a.href.replace(/&periode=\w+/, '') + (interval === 'year' ? '&periode=annuel' : '');
+ });
renderSim();
});
});
diff --git a/site/tarif/index.html b/site/tarif/index.html
index c5c3020..8dc176a 100644
--- a/site/tarif/index.html
+++ b/site/tarif/index.html
@@ -95,7 +95,7 @@
La carte de fidélité dans le Wallet de vos clients
19 €/ mois
Sans engagement, résiliable à tout moment
-Choisir Essentiel
+Choisir Essentiel
La carte à vos couleurs, dans Apple Wallet et Google Wallet
@@ -114,7 +114,7 @@
Faites revenir vos clients
39 €/ mois
Sans engagement, résiliable à tout moment
-Choisir Pro
+Choisir Pro
Tout Essentiel, plus :
Employés illimités
@@ -136,7 +136,7 @@
Plusieurs magasins, une seule carte
29 €/ mois / magasin
Sans engagement, résiliable à tout moment
-Choisir Réseau
+Choisir Réseau
Tout Pro, plus :
Une carte commune à tous vos magasins Bientôt