merge: catch up with feature/helcim-plan-consolidation base

# Conflicts:
#	server/api/auth/member.get.js
#	server/api/members/update-contribution.post.js
#	tests/server/api/update-contribution.test.js
This commit is contained in:
Jennie Robinson Faber 2026-04-19 21:33:40 +01:00
commit 7704557f16
10 changed files with 160 additions and 9 deletions

View file

@ -134,6 +134,9 @@ export const createHelcimSubscription = (subscription, idempotencyKey) =>
errorMessage: 'Subscription creation failed'
})
export const getHelcimSubscription = (id) =>
helcimFetch(`/subscriptions/${id}`, { errorMessage: 'Subscription lookup failed' })
export const cancelHelcimSubscription = (id) =>
helcimFetch(`/subscriptions/${id}`, { method: 'DELETE', errorMessage: 'Subscription cancellation failed' })
@ -188,7 +191,13 @@ export async function listHelcimCustomerTransactions(customerCode) {
? response
: (response?.transactions || response?.data || [])
const sorted = [...rows].sort((a, b) => {
const filtered = rows.filter((t) => {
const type = String(t?.type || '').toLowerCase()
const amount = typeof t?.amount === 'number' ? t.amount : Number(t?.amount) || 0
return type !== 'verify' && amount > 0
})
const sorted = [...filtered].sort((a, b) => {
const da = Date.parse(a?.dateCreated || '') || 0
const db = Date.parse(b?.dateCreated || '') || 0
return db - da