feat: add billing and organization workflows

This commit is contained in:
2026-06-24 13:53:52 +01:00
parent 4fd81c923b
commit 44bfb083f9
97 changed files with 10966 additions and 2044 deletions
@@ -45,15 +45,23 @@ export const load: PageServerLoad = async ({ locals, params }) => {
email: record.email ?? '',
phone: record.phone ?? '',
isPrimary: record.isPrimary ? 'true' : 'false',
notes: record.notes ?? ''
receivesInvoices: record.receivesInvoices ? 'true' : 'false',
receivesContracts: record.receivesContracts ? 'true' : 'false'
}
})),
options: await loadOptions(activeOrganizationId),
createForm: await superValidate({ clientId: params.id }, zod4(contactCreateSchema), {
id: 'contacts-create'
id: 'contacts-create',
errors: false
}),
editForm: await superValidate(zod4(contactEditSchema), { id: 'contacts-edit' }),
archiveForm: await superValidate(zod4(archiveSchema), { id: 'contacts-archive' })
editForm: await superValidate(zod4(contactEditSchema), {
id: 'contacts-edit',
errors: false
}),
archiveForm: await superValidate(zod4(archiveSchema), {
id: 'contacts-archive',
errors: false
})
};
};
@@ -78,7 +86,8 @@ export const actions: Actions = {
email: form.data.email || null,
phone: form.data.phone || null,
isPrimary: form.data.isPrimary === 'true',
notes: form.data.notes || null,
receivesInvoices: form.data.receivesInvoices === 'true',
receivesContracts: form.data.receivesContracts === 'true',
updatedAt: new Date(),
createdAt: new Date()
});
@@ -107,7 +116,8 @@ export const actions: Actions = {
email: form.data.email || null,
phone: form.data.phone || null,
isPrimary: form.data.isPrimary === 'true',
notes: form.data.notes || null,
receivesInvoices: form.data.receivesInvoices === 'true',
receivesContracts: form.data.receivesContracts === 'true',
updatedAt: new Date()
})
.where(