package de.effigenix.infrastructure.masterdata.web.dto;

import de.effigenix.shared.common.ContactInfo;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(requiredProperties = {"phone", "email", "contactPerson"})
public record ContactInfoResponse(
        String phone,
        String email,
        String contactPerson
) {
    public static ContactInfoResponse from(ContactInfo ci) {
        if (ci == null) return null;
        return new ContactInfoResponse(ci.phone(), ci.email(), ci.contactPerson());
    }
}
