All files / services/routes routes.ts

92.3% Statements 24/26
91.66% Branches 22/24
84.61% Functions 11/13
90.9% Lines 20/22

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66121x       213x   22x       22x     134x   23x       23x                     26x   13x       13x   125x 146x 119x 147x 265x     22x   7x       7x     100x         2x            
export const routes = {
	index: '/',
	account: {
		register: (options?: { callbackUrl?: string }) => {
			if (!options) return '/account/register'
 
			const queryString = new URLSearchParams({
				...(options.callbackUrl && { callbackUrl: options.callbackUrl }),
			}).toString()
 
			return `/account/register${queryString !== '' ? `?${queryString}` : ''}`
		},
		login: (options?: { callbackUrl?: string }) => {
			if (!options) return '/account/login'
 
			const queryString = new URLSearchParams({
				...(options.callbackUrl && { callbackUrl: options.callbackUrl }),
			}).toString()
 
			return `/account/login${queryString !== '' ? `?${queryString}` : ''}`
		},
		resetPassword: '/account/reset-password',
	},
	profile: {
		myLastWills: '/profile/last-will',
		settings: '/profile/settings',
	},
	lastWill: {
		start: '/last-will/start',
		auth: (options?: { id: string }) => {
			if (!options) return '/last-will/auth'
 
			const queryString = new URLSearchParams({
				...(options.id && { id: options.id }),
			}).toString()
 
			return `/last-will/auth${queryString !== '' ? `?${queryString}` : ''}`
		},
		testator: (id: string) => `/last-will/editor/testator?id=${id}`,
		marriage: (id: string) => `/last-will/editor/marriage?id=${id}`,
		heirs: (id: string) => `/last-will/editor/heirs?id=${id}`,
		inheritance: (id: string) => `/last-will/editor/inheritance?id=${id}`,
		succession: (id: string) => `/last-will/editor/succession?id=${id}`,
		plans: (id: string) => `/last-will/plans?id=${id}`,
		buy: (options?: { id: string }) => {
			if (!options) return '/last-will/buy'
 
			const queryString = new URLSearchParams({
				...(options.id && { id: options.id }),
			}).toString()
 
			return `/last-will/buy${queryString !== '' ? `?${queryString}` : ''}`
		},
		orderConfirmation: (success: boolean) => `/last-will/order-confirmation?success=${success}`,
		final: (id: string) => `/last-will/editor/final?id=${id}`,
	},
	misc: {
		faq: {
			index: '/misc/faq',
			single: (slug: string) => `/misc/faq/${slug}`,
		},
		imprint: '/misc/imprint',
		privacy: '/misc/privacy',
	},
}