package com.yourname.premiumah.model;

import java.util.Collections;
import java.util.Map;

public record ListingCreationResult(boolean success, Listing listing, String messageKey, Map<String, String> placeholders) {
    public static ListingCreationResult success(Listing listing, String messageKey, Map<String, String> placeholders) {
        return new ListingCreationResult(true, listing, messageKey, placeholders == null ? Collections.emptyMap() : placeholders);
    }

    public static ListingCreationResult fail(String messageKey, Map<String, String> placeholders) {
        return new ListingCreationResult(false, null, messageKey, placeholders == null ? Collections.emptyMap() : placeholders);
    }
}
