import { IEmailTemplateSettings, IFeaturesSettings, IScheduleSettings } from '@core/types'
import { Column, Entity } from 'typeorm'
import { UserModifiableEntity } from '../entity'
import { IBillingSettings } from './billing.model'
import { ICustomerAppSettings } from './customer-app.model'
import { IEmailSettings } from './email.model'
import { IKitchenSettings } from './kitchen.model'
import { IReservationSettings } from './reservation.model'
import { IRestaurantSettings } from './restaurant.model'

@Entity()
export class Settings extends UserModifiableEntity<Settings> {
	@Column({
		type: 'json',
		nullable: false,
	})
	customerApp: ICustomerAppSettings

	@Column({
		type: 'json',
		nullable: true,
	})
	schedule?: IScheduleSettings

	@Column({
		type: 'json',
		nullable: false,
	})
	reservation: IReservationSettings

	@Column({
		type: 'json',
		nullable: false,
	})
	features: IFeaturesSettings

	@Column({
		type: 'json',
		nullable: false,
	})
	restaurant: IRestaurantSettings

	@Column({
		type: 'json',
		nullable: false,
	})
	kitchen: IKitchenSettings

	@Column({
		type: 'json',
		nullable: true,
	})
	emailTemplates?: IEmailTemplateSettings

	@Column({
		type: 'json',
		nullable: true,
	})
	email: IEmailSettings

	@Column({
		type: 'json',
		nullable: false,
	})
	billing: IBillingSettings
}
