From 424d523c5e10f8a6fb639c1347ee9b7bca8e4273 Mon Sep 17 00:00:00 2001 From: pb Date: Wed, 9 Jul 2025 16:50:41 +0200 Subject: [PATCH] added the bson tag for DestPeerId which was causing error when deserializing from mongo results --- models/booking/booking.go | 2 +- models/resources/purchase_resource/purchase_resource.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/booking/booking.go b/models/booking/booking.go index 831f443..bf20a91 100644 --- a/models/booking/booking.go +++ b/models/booking/booking.go @@ -23,7 +23,7 @@ type Booking struct { ExecutionMetrics map[string][]models.MetricsSnapshot `json:"metrics,omitempty" bson:"metrics,omitempty"` ExecutionsID string `json:"executions_id,omitempty" bson:"executions_id,omitempty" validate:"required"` // ExecutionsID is the ID of the executions - DestPeerID string `json:"dest_peer_id,omitempty"` // DestPeerID is the ID of the destination peer + DestPeerID string `json:"dest_peer_id,omitempty" bson:"dest_peer_id,omitempty"` // DestPeerID is the ID of the destination peer WorkflowID string `json:"workflow_id,omitempty" bson:"workflow_id,omitempty"` // WorkflowID is the ID of the workflow ExecutionID string `json:"execution_id,omitempty" bson:"execution_id,omitempty" validate:"required"` State enum.BookingStatus `json:"state,omitempty" bson:"state,omitempty" validate:"required"` // State is the state of the booking diff --git a/models/resources/purchase_resource/purchase_resource.go b/models/resources/purchase_resource/purchase_resource.go index ca528ae..077b076 100644 --- a/models/resources/purchase_resource/purchase_resource.go +++ b/models/resources/purchase_resource/purchase_resource.go @@ -10,7 +10,7 @@ import ( type PurchaseResource struct { utils.AbstractObject - DestPeerID string + DestPeerID string `json:"dest_peer_id" bson:"dest_peer_id"` PricedItem pricing.PricedItemITF `json:"priced_item,omitempty" bson:"priced_item,omitempty" validate:"required"` ExecutionsID string `json:"executions_id,omitempty" bson:"executions_id,omitempty" validate:"required"` // ExecutionsID is the ID of the executions EndDate *time.Time `json:"end_buying_date,omitempty" bson:"end_buying_date,omitempty"`