package com.eactive.eai.rms.ext.djb.webhook.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.UUID;

@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WebhookPayload {

    private String eventType;
    private String eventId;
    private long timestamp;
    private Object data;

    public static WebhookPayload of(String eventType, Object data) {
        return WebhookPayload.builder()
                .eventType(eventType)
                .eventId(UUID.randomUUID().toString())
                .timestamp(System.currentTimeMillis())
                .data(data)
                .build();
    }
}
