add resiliation
This commit is contained in:
@@ -20,6 +20,7 @@ import Store from './pages/app/Store';
|
|||||||
import Checkout from './pages/app/Checkout';
|
import Checkout from './pages/app/Checkout';
|
||||||
import Services from './pages/app/Services';
|
import Services from './pages/app/Services';
|
||||||
import Support from './pages/app/Support';
|
import Support from './pages/app/Support';
|
||||||
|
import BillingHistory from './pages/app/BillingHistory';
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
@@ -49,6 +50,7 @@ export default function App() {
|
|||||||
<Route path="/checkout/:productId" element={<Checkout />} />
|
<Route path="/checkout/:productId" element={<Checkout />} />
|
||||||
<Route path="/services" element={<Services />} />
|
<Route path="/services" element={<Services />} />
|
||||||
<Route path="/support" element={<Support />} />
|
<Route path="/support" element={<Support />} />
|
||||||
|
<Route path="/facturation" element={<BillingHistory />} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
</Route>
|
</Route>
|
||||||
|
|||||||
@@ -246,8 +246,9 @@ export default function WebServiceSubscriptionManager({ order, onClose, onRefres
|
|||||||
// 🛡️ NOUVELLE LOGIQUE DE RÉSILIATION (US 2.1 / 2.2)
|
// 🛡️ NOUVELLE LOGIQUE DE RÉSILIATION (US 2.1 / 2.2)
|
||||||
// ==========================================
|
// ==========================================
|
||||||
const calculateRefundEligibility = () => {
|
const calculateRefundEligibility = () => {
|
||||||
if (!order || !order.created_at) return false;
|
if (!order || !order.activated_at) return false;
|
||||||
const orderDate = new Date(order.created_at);
|
const orderDate = new Date(order.activated_at);
|
||||||
|
console.log("Order Date:", orderDate);
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const diffDays = Math.ceil(Math.abs(now - orderDate) / (1000 * 60 * 60 * 24));
|
const diffDays = Math.ceil(Math.abs(now - orderDate) / (1000 * 60 * 60 * 24));
|
||||||
return diffDays <= 14;
|
return diffDays <= 14;
|
||||||
@@ -508,7 +509,7 @@ export default function WebServiceSubscriptionManager({ order, onClose, onRefres
|
|||||||
<p className="text-emerald-500/80 mt-2">
|
<p className="text-emerald-500/80 mt-2">
|
||||||
Votre abonnement a été activé il y a moins de 14 jours.
|
Votre abonnement a été activé il y a moins de 14 jours.
|
||||||
<strong className="text-emerald-400"> Vous allez être intégralement remboursé</strong>.
|
<strong className="text-emerald-400"> Vous allez être intégralement remboursé</strong>.
|
||||||
Vos services HestiaCP et bases de données seront supprimés immédiatement.
|
Vos services seront supprimés immédiatement.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -74,10 +74,7 @@ export default function AppLayout() {
|
|||||||
</div>
|
</div>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
|
|
||||||
<div className="flex justify-between items-center px-6 py-4 text-[#444] border-l-4 border-transparent uppercase tracking-widest text-sm font-mono cursor-not-allowed select-none">
|
<NavLink className={navLinkClass} to="/facturation">Facturation</NavLink>
|
||||||
<span>Facturation</span>
|
|
||||||
<span className="text-[9px] text-[#333] border border-[#333] px-1.5 py-0.5 rounded font-bold">WIP</span>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-between items-center px-6 py-4 text-[#444] border-l-4 border-transparent uppercase tracking-widest text-sm font-mono cursor-not-allowed select-none">
|
<div className="flex justify-between items-center px-6 py-4 text-[#444] border-l-4 border-transparent uppercase tracking-widest text-sm font-mono cursor-not-allowed select-none">
|
||||||
<span>Profil & Sécurité</span>
|
<span>Profil & Sécurité</span>
|
||||||
<span className="text-[9px] text-[#333] border border-[#333] px-1.5 py-0.5 rounded font-bold">WIP</span>
|
<span className="text-[9px] text-[#333] border border-[#333] px-1.5 py-0.5 rounded font-bold">WIP</span>
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export default function Dashboard() {
|
|||||||
|
|
||||||
// 🌟 Plus besoin de charger les IPs, on ouvre juste la modale comptable !
|
// 🌟 Plus besoin de charger les IPs, on ouvre juste la modale comptable !
|
||||||
const handleManageSubscription = (order) => {
|
const handleManageSubscription = (order) => {
|
||||||
|
console.log("Gestion de l'abonnement pour la commande :", order);
|
||||||
// 1. Détection du type de service
|
// 1. Détection du type de service
|
||||||
const titleLower = (order.title || '').toLowerCase();
|
const titleLower = (order.title || '').toLowerCase();
|
||||||
const isVPS = titleLower.includes('vps') || titleLower.includes('compute');
|
const isVPS = titleLower.includes('vps') || titleLower.includes('compute');
|
||||||
|
|||||||
@@ -305,12 +305,12 @@ export const updateHostingPlan = (order_id, new_plan_id) =>
|
|||||||
// Suppression
|
// Suppression
|
||||||
// Modification
|
// Modification
|
||||||
// Lister
|
// Lister
|
||||||
export const getInvoiceList = () =>
|
export const getInvoiceList = (client_id) =>
|
||||||
apiCall(`${BASE_URL}/api/client/invoice/get_list`);
|
apiCall(`${BASE_URL}/api/client/invoice/get_list`, { client_id: client_id });
|
||||||
|
|
||||||
// Lire
|
// Lire
|
||||||
export const getInvoiceDetails = (InvoiceHash) =>
|
export const getInvoiceDetails = (invoiceHash) =>
|
||||||
apiCall(`${BASE_URL}/api/client/invoice/get`);
|
apiCall(`${BASE_URL}/api/client/invoice/get`, { hash: invoiceHash });
|
||||||
|
|
||||||
|
|
||||||
// ==========================================
|
// ==========================================
|
||||||
|
|||||||
Reference in New Issue
Block a user