package com.vaessl.app.shared;

import java.util.Map;
import jakarta.validation.constraints.NotNull;

public record ServiceItem(String id, @NotNull String title, String description,
        Map<String, Object> extraData) {

    public String getExtra(String key) {
        if (extraData == null) {
            return null;
        } else {
            Object value = extraData.get(key);

            return value != null ? String.valueOf(value) : null;
        }
    }
}
