dev #21

Merged
Seazn merged 35 commits from dev into main 2026-05-21 17:34:44 +00:00
Showing only changes of commit 1e258e4db0 - Show all commits

View File

@ -13,6 +13,7 @@ import FinanceInvoices from '../components/financeInvoices'
import { useActiveCoffees } from '../../coffee-abonnements/hooks/getActiveCoffees'
import { changeSubscriptionStatus, editSubscriptionContent } from '../hooks/editAbo'
import ConfirmActionModal from '../../components/modals/ConfirmActionModal'
import { getOrderPackError, packsToCapsules } from '../../coffee-abonnements/lib/orderRules'
type UiLifecycleStatus = 'issued' | 'ongoing' | 'finished' | 'pause' | 'cancelled'
@ -157,8 +158,9 @@ export default function ProfileSubscriptionsPage() {
setContentError('Please select at least one coffee with quantity greater than 0.')
return
}
if (draftTotalPacks < 6) {
setContentError('Total must be at least 6 packs (60 capsules).')
const orderPackError = getOrderPackError(draftTotalPacks)
if (orderPackError) {
setContentError(orderPackError)
return
}
@ -425,7 +427,7 @@ export default function ProfileSubscriptionsPage() {
<div className="mt-4 rounded-md border border-gray-200 bg-white/90 p-4">
<div className="flex items-center justify-between gap-2 flex-wrap mb-3">
<h3 className="text-sm font-semibold text-gray-900">{t('autofix.ke24abf9c')}</h3>
<p className="text-xs text-gray-600">Selected packs: {draftTotalPacks} (minimum 6)</p>
<p className="text-xs text-gray-600">Selected: {draftTotalPacks} packs ({packsToCapsules(draftTotalPacks)} capsules) · minimum 6 packs</p>
</div>
{coffeesLoading ? (