Billing - fixes (#19867)

- Uniformize credit formating : In UI, 1$=1credit. In BE 1 UI credit =
1_000_000 BE "crédits"
- Add crédit rollover information + Link to documentation +
Documentation update
<img width="291" height="317" alt="Screenshot 2026-04-17 at 18 22 59"
src="https://github.com/user-attachments/assets/2519fb9f-159d-4c85-95f4-a6e005a8a1a3"
/>
<img width="848" height="763" alt="Screenshot 2026-04-17 at 14 12 20"
src="https://github.com/user-attachments/assets/a3cc0874-f275-49ea-819f-305ec314bdfe"
/>
<img width="797" height="757" alt="Screenshot 2026-04-17 at 14 12 13"
src="https://github.com/user-attachments/assets/9048409b-d5a2-435a-b735-70370705e668"
/>

- Enable direct top-up (or subscription if in trial) from AI chat
<img width="333" height="215" alt="Screenshot 2026-04-17 at 22 52 00"
src="https://github.com/user-attachments/assets/7a20c627-2806-4bcf-a037-b45752232be9"
/>
<img width="457" height="769" alt="Screenshot 2026-04-17 at 22 51 41"
src="https://github.com/user-attachments/assets/d2a90c1b-271f-4fe9-8891-baeb2fabb86d"
/>

- Inform users if credit limit is reached - Banner
<img width="1130" height="127" alt="Screenshot 2026-04-17 at 19 15 11"
src="https://github.com/user-attachments/assets/30723e5e-c07e-462f-8eb8-e08f52bbab1c"
/>
This commit is contained in:
Etienne
2026-04-20 10:43:02 +02:00
committed by GitHub
parent 903ae5cb09
commit e68842c268
45 changed files with 521 additions and 151 deletions
@@ -1,15 +0,0 @@
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
export const useIsSomeMeteredProductCapReached = (): boolean => {
const billingSubscriptionItems = useAtomStateValue(currentWorkspaceState)
?.currentBillingSubscription?.billingSubscriptionItems;
if (!billingSubscriptionItems) {
return false;
}
return billingSubscriptionItems.some(
({ hasReachedCurrentPeriodCap }) => hasReachedCurrentPeriodCap,
);
};
@@ -0,0 +1,18 @@
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { createAtomSelector } from '@/ui/utilities/state/jotai/utils/createAtomSelector';
export const hasReachedCurrentBillingPeriodCapSelector = createAtomSelector({
key: 'hasReachedCurrentBillingPeriodCapSelector',
get: ({ get }) => {
const billingSubscriptionItems = get(currentWorkspaceState)
?.currentBillingSubscription?.billingSubscriptionItems;
if (!billingSubscriptionItems) {
return false;
}
return billingSubscriptionItems.some(
({ hasReachedCurrentPeriodCap }) => hasReachedCurrentPeriodCap,
);
},
});