Skip to content
Extraits de code Groupes Projets
Valider bc83d7f0 rédigé par aimane.chanaa's avatar aimane.chanaa
Parcourir les fichiers

Fix issues

parent ad663458
Branches
Étiquettes
1 requête de fusion!87Integrate backend apis with the front for transactions interface
Pipeline #19403 réussi avec les étapes
in 3 minutes et 36 secondes
......@@ -70,17 +70,16 @@ export type IAbonnementItem = {
expiredAt?: string;
};
// PurchasedSubscription represents a specific subscription instance from a transaction
// Used for intergration in payment interface, can't be changed without consultation
export interface PurchasedSubscription {
id?: string; // ID of the specific subscription instance
title?: string; // Denormalized from planData for convenience
shortDescription?: string; // Denormalized from planData
fullDescription?: string; // Denormalized from planData
interval?: PriceInterval; // The interval for this specific purchase (e.g., 'monthly')
price?: { [key: string]: number }; // The price structure for this purchase, e.g., { "MONTHLY": 9.99 }
amount?: number; // The actual amount for this subscription component of the transaction
plan?: IPlan; // Snapshot of the plan details at time of transaction
pricingPlan?: IPricingPlan; // Snapshot of the pricing plan details
discount?: IDiscount; // Snapshot of any discount applied
// Add other fields that are part of the transformedItem in usePaymentStore if needed
id?: string;
title?: string;
shortDescription?: string;
fullDescription?: string;
interval?: PriceInterval;
price?: { [key: string]: number };
amount?: number;
plan?: IPlan;
pricingPlan?: IPricingPlan;
discount?: IDiscount;
}
const API_BASE = 'http://localhost:7073';
import { GATEWAY_API_URL } from 'src/config-global';
export const endpoints = {
transactions: `${API_BASE}/api/transactions`,
transactionsByPlan: `${API_BASE}/api/transactions/by-plan`,
downloadInvoice: (invoiceId: number | string) => `${API_BASE}/api/invoices/${invoiceId}/download`,
transactions: `${GATEWAY_API_URL}/api/payment/transactions`,
transactionsByPlan: `${GATEWAY_API_URL}/api/payment/transactions/by-plan`,
downloadInvoice: (invoiceId: number | string) =>
`${GATEWAY_API_URL}/api/payment/invoices/${invoiceId}/download`,
};
const API_URL = 'http://localhost:7076';
import { GATEWAY_API_URL } from 'src/config-global';
export const endpoints = {
getAllSubscriptionPlans: `${API_URL}/subscription/plans/all`,
getAllSubscriptionPlans: `${GATEWAY_API_URL}/subscription/plans/all`,
};
import type {
AIModel,
IAbonnementItem,
PurchasedSubscription,
AssistantConfiguration,
} from 'src/contexts/types/abonnement';
......@@ -36,6 +35,10 @@ import { AI_MODEL_COSTS, getIntervalLabel, ABONNEMENT_INTERVALS_OPTIONS } from '
import ConditionalComponent from 'src/shared/components/ConditionalComponent/ConditionalComponent';
export interface PurchasedSubscription extends IAbonnementItem {
interval: string;
}
interface ChangePlanDialogProps {
open: boolean;
onClose: () => void;
......
import type { ChildUser } from 'src/contexts/types/user';
import type { IAbonnementItem } from 'src/contexts/types/abonnement';
import type { Upgrade, UpgradeType } from 'src/contexts/types/common';
import type { IAbonnementItem, PurchasedSubscription } from 'src/contexts/types/abonnement';
import dayjs from 'dayjs';
import React, { useState, useCallback } from 'react';
......@@ -24,6 +24,10 @@ import ConditionalComponent from 'src/shared/components/ConditionalComponent/Con
import { UpgradeDialog } from './UpgradeDialog';
import { ChangePlanDialog } from './ChangePlanDialog';
export interface PurchasedSubscription extends IAbonnementItem {
interval: string;
}
interface SubscriptionTabProps {
open: boolean;
onClose: () => void;
......
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter