import type { PageServerLoad } from './$types';
import { getTransaksiRingkasan } from '$lib/server/transaksi';
import { getHutangPiutangList } from '$lib/server/hutang-piutang';

export const load: PageServerLoad = async ({ locals }) => {
	const ringkasan = await getTransaksiRingkasan(locals.member!.id);
	const hutangPiutang = await getHutangPiutangList(locals.member!.id, 'belum_lunas');

	return {
		ringkasan,
		hutangPiutangAktif: hutangPiutang.summary.jumlahBelumLunas
	};
};
