func MakeProductEvent(natsURL string, pEvent *ProductEvent) error {

	mmsClient, err := NewNatsSenderClient(natsURL)
	if err != nil {
		return fmt.Errorf("failed to create messaging service: %v", err)
	}

	err = mmsClient.PostProductEvent(pEvent)
	if err != nil {
		return fmt.Errorf("failed to post product to messaging service: %v", err)
	}

	mmsClient.cenatsSender.Close(context.Background())

	return nil
}
// MakeProductEvent prepares and sends the product event
MakeProductEvent prepares and sends the product event
// MakeProductEvent prepares and sends the product event
func MakeProductEvent(natsURL string, pEvent *ProductEvent) error {
	mmsClient, err := NewNatsSenderClient(natsURL)
	if err != nil {
		return fmt.Errorf("failed to create messaging service: %v", err)
	}
	err = mmsClient.PostProductEvent(pEvent)
	if err != nil {
		return fmt.Errorf("failed to post product to messaging service: %v", err)
	}
	mmsClient.cenatsSender.Close(context.Background())
	return nil
}
func MakeProductEvent ( natsURL string , pEvent * ProductEvent ) error { mmsClient , err := NewNatsSenderClient ( natsURL ) if err != nil { return fmt . Errorf ( " " , err ) } err = mmsClient . PostProductEvent ( pEvent ) if err != nil { return fmt . Errorf ( " " , err ) } mmsClient . cenatsSender . Close ( context . Background ( ) ) return nil }
MakeProductEvent prepares and sends the product event
MakeProductEvent prepares and sends the product event