package model

import (
	"time"

	"go.mongodb.org/mongo-driver/v2/bson"
)

const (
	PaymentStatusUpdatedType = "payment.status.updated"
)

type PaymentStatusUpdated struct {
	EventID     string                   `json:"event_id,omitempty"`
	Type        string                   `json:"type,omitempty"`
	OccurredAt  time.Time                `json:"occurred_at,omitempty"`
	PublishedAt time.Time                `json:"published_at,omitempty"`
	Data        PaymentStatusUpdatedData `json:"data"`
}

type PaymentStatusUpdatedData struct {
	OrganizationRef  bson.ObjectID `json:"organization_ref,omitempty"`
	PaymentRef       string        `json:"payment_ref,omitempty"`
	QuotationRef     string        `json:"quotation_ref,omitempty"`
	ClientPaymentRef string        `json:"client_payment_ref,omitempty"`
	IdempotencyKey   string        `json:"idempotency_key,omitempty"`
	State            string        `json:"state,omitempty"`
	PreviousState    string        `json:"previous_state,omitempty"`
	Version          uint64        `json:"version,omitempty"`
	IsTerminal       bool          `json:"is_terminal"`
	Event            string        `json:"event,omitempty"`
}
