// src/lib/utils/defaults.js

import { SUPPORTER_SUBSCRIPTION_MODEL_NAME } from './constants';

/**
 * @returns  {App.Types['subscription']}
 */
export function defaultSubscription() {
	return {
		id: 0,
		name: '',
		details: '',
		conditions: '',
		monthly_fee: 0,
		hourly_rate: 0,
		included_hours_per_year: 0,
		included_hours_per_month: 0
	};
}

/**
 * @returns  {App.Types['membership']}
 */
export function defaultMembership() {
	return {
		id: 0,
		status: 3,
		start_date: '',
		end_date: '',
		parent_member_id: 0,
		subscription_model: defaultSubscription()
	};
}

/**
 * @returns  {App.Types['bankAccount']}
 */
export function defaultBankAccount() {
	return {
		id: 0,
		mandate_date_signed: '',
		bank: '',
		account_holder_name: '',
		iban: '',
		bic: '',
		mandate_reference: ''
	};
}

/**
 * @returns  {App.Types['licence']}
 */
export function defaultLicence() {
	return {
		id: 0,
		status: 0,
		number: '',
		issued_date: '',
		expiration_date: '',
		country: '',
		categories: []
	};
}

/**
 * @returns  {App.Locals['user']}
 */
export function defaultUser() {
	return {
		id: 0,
		email: '',
		first_name: '',
		last_name: '',
		password: '',
		phone: '',
		address: '',
		zip_code: '',
		city: '',
		company: '',
		dateofbirth: '',
		notes: '',
		profile_picture: '',
		payment_status: 0,
		status: 1,
		role_id: 1,
		membership: defaultMembership(),
		licence: defaultLicence(),
		bank_account: defaultBankAccount()
	};
}

/**
 * @returns  {App.Locals['user']}
 */
export function defaultSupporter() {
	let supporter = {
		id: 0,
		email: '',
		first_name: '',
		last_name: '',
		password: '',
		phone: '',
		address: '',
		zip_code: '',
		city: '',
		company: '',
		dateofbirth: '',
		notes: '',
		profile_picture: '',
		payment_status: 0,
		status: 1,
		role_id: 0,
		membership: defaultMembership(),
		licence: defaultLicence(),
		bank_account: defaultBankAccount()
	};
	supporter.membership.subscription_model.name = SUPPORTER_SUBSCRIPTION_MODEL_NAME;
	return supporter;
}
