package publishers

import "github.com/UpmeshLTD/urus-aio/infrastructure/db/entities"

const (
	BrokerTopicShipmentStatus = "status"
	PrefixShipmentStatus      = "status"
)

type ShipmentStatusPayload struct {
	CartID          string  `json:"cartId"`
	ShippingGroupID *string `json:"shippingGroupId"`
	ShipmentStatus  string  `json:"shipmentStatus"`
	StatusUpdatedAt string  `json:"statusUpdatedAt"`
}

func IsNeedToPublishShipmentStatusChangeMessage(status entities.ShipmentStatus) bool {
	return status == entities.ShipmentStatusFulfillmentRequestSent ||
		status == entities.ShipmentStatusDelivered ||
		status == entities.ShipmentStatusFailedDelivery ||
		status == entities.ShipmentStatusCancelled
}
