import { PickType } from '@nestjs/mapped-types';
import { UpdateSettingsDto } from './update-settings.dto';

/** The tenant settings Accounting → Invoice Settings may read and change. */
export const INVOICE_SETTINGS_FIELDS = [
  'invoice_company_name',
  'invoice_address',
  'invoice_phone',
  'invoice_email',
  'invoice_trn',
  'invoice_title',
  'invoice_signatory',
  'invoice_payment_terms',
  'invoice_terms',
  'invoice_due_days',
  'invoice_number_prefix',
  'invoice_number_padding',
  'invoice_number_reset',
  'invoice_number_start',
] as const;

/**
 * PATCH /settings/invoice — invoice fields only (same validation as the
 * general settings DTO); anything else is rejected by the whitelist pipe.
 */
export class UpdateInvoiceSettingsDto extends PickType(
  UpdateSettingsDto,
  INVOICE_SETTINGS_FIELDS,
) {}
