<?php

declare( strict_types=1 );

namespace Brightfern\Invoice\Input;

/**
 * The merchant's own identity + invoicing defaults, sourced from plugin
 * settings. Pure data so the mapper stays testable.
 *
 * `exemptSmallBusiness` (e.g. German Kleinunternehmer §19, the French
 * franchise en base) makes every line VAT-exempt (category E) regardless of the
 * configured tax rate — a real and easy-to-get-wrong case.
 */
final class SellerProfile {
	public string $registrationName = '';
	public string $tradingName = '';
	public string $vatNumber = '';
	public string $companyId = '';
	public string $companyIdScheme = '';

	public string $endpointId = '';
	public string $endpointScheme = '';

	public string $line1 = '';
	public string $line2 = '';
	public string $city = '';
	public string $postalZone = '';
	public string $countrySubentity = '';
	public string $countryCode = '';

	public string $contactName = '';
	public string $contactPhone = '';
	public string $contactEmail = '';

	// Payment defaults (BG-16).
	public string $paymentMeansCode = '30';
	public string $payeeIban = '';
	public string $payeeBic = '';
	public string $paymentTerms = '';

	public bool $exemptSmallBusiness = false;

	public function hasVat(): bool {
		return '' !== trim( $this->vatNumber );
	}
}
