package com.social.media.application.company.command;

import java.util.UUID;

/**
 * Command to update company information.
 * Follows Command pattern for CQRS implementation.
 */
public record UpdateCompanyCommand(
    UUID companyId,
    String companyName,
    String tradeName,
    String email,
    String phoneNumber,
    String website,
    String activitySector,
    String street,
    String number,
    String complement,
    String neighborhood,
    String city,
    String state,
    String postalCode,
    String country,
    UUID updatedByUserId
) {
    
    public UpdateCompanyCommand {
        if (companyId == null) {
            throw new IllegalArgumentException("Company ID cannot be null");
        }
        
        if (companyName == null || companyName.trim().isEmpty()) {
            throw new IllegalArgumentException("Company name cannot be null or empty");
        }
        
        if (tradeName == null || tradeName.trim().isEmpty()) {
            throw new IllegalArgumentException("Trade name cannot be null or empty");
        }
        
        if (email == null || email.trim().isEmpty()) {
            throw new IllegalArgumentException("Email cannot be null or empty");
        }
        
        if (phoneNumber == null || phoneNumber.trim().isEmpty()) {
            throw new IllegalArgumentException("Phone number cannot be null or empty");
        }
        
        if (street == null || street.trim().isEmpty()) {
            throw new IllegalArgumentException("Street cannot be null or empty");
        }
        
        if (number == null || number.trim().isEmpty()) {
            throw new IllegalArgumentException("Address number cannot be null or empty");
        }
        
        if (neighborhood == null || neighborhood.trim().isEmpty()) {
            throw new IllegalArgumentException("Neighborhood cannot be null or empty");
        }
        
        if (city == null || city.trim().isEmpty()) {
            throw new IllegalArgumentException("City cannot be null or empty");
        }
        
        if (state == null || state.trim().isEmpty()) {
            throw new IllegalArgumentException("State cannot be null or empty");
        }
        
        if (postalCode == null || postalCode.trim().isEmpty()) {
            throw new IllegalArgumentException("Postal code cannot be null or empty");
        }
        
        if (updatedByUserId == null) {
            throw new IllegalArgumentException("Updated by user ID cannot be null");
        }
    }
}

