add delivery & payment data for order struct
This commit is contained in:
parent
7f61b9c20c
commit
0c1f70a796
@ -41,6 +41,14 @@ func main() {
|
|||||||
Quoting: ChannelFeatureReceive,
|
Quoting: ChannelFeatureReceive,
|
||||||
Deleting: ChannelFeatureBoth,
|
Deleting: ChannelFeatureBoth,
|
||||||
},
|
},
|
||||||
|
Product: Product{
|
||||||
|
Creating: ChannelFeatureSend,
|
||||||
|
Deleting: ChannelFeatureSend,
|
||||||
|
},
|
||||||
|
Order: Order{
|
||||||
|
Creating: ChannelFeatureBoth,
|
||||||
|
Deleting: ChannelFeatureSend,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
v1/client.go
16
v1/client.go
@ -39,6 +39,14 @@ func New(url string, token string) *MgClient {
|
|||||||
// Quoting: ChannelFeatureReceive,
|
// Quoting: ChannelFeatureReceive,
|
||||||
// Deleting: ChannelFeatureSend,
|
// Deleting: ChannelFeatureSend,
|
||||||
// },
|
// },
|
||||||
|
// Product: Product{
|
||||||
|
// Creating: ChannelFeatureSend,
|
||||||
|
// Deleting: ChannelFeatureSend,
|
||||||
|
// },
|
||||||
|
// Order: Order{
|
||||||
|
// Creating: ChannelFeatureBoth,
|
||||||
|
// Deleting: ChannelFeatureSend,
|
||||||
|
// },
|
||||||
// },
|
// },
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@ -91,6 +99,14 @@ func (c *MgClient) ActivateTransportChannel(request Channel) (ActivateResponse,
|
|||||||
// Quoting: ChannelFeatureReceive,
|
// Quoting: ChannelFeatureReceive,
|
||||||
// Deleting: ChannelFeatureBoth,
|
// Deleting: ChannelFeatureBoth,
|
||||||
// },
|
// },
|
||||||
|
// Product: Product{
|
||||||
|
// Creating: ChannelFeatureSend,
|
||||||
|
// Deleting: ChannelFeatureSend,
|
||||||
|
// },
|
||||||
|
// Order: Order{
|
||||||
|
// Creating: ChannelFeatureBoth,
|
||||||
|
// Deleting: ChannelFeatureSend,
|
||||||
|
// },
|
||||||
// },
|
// },
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
@ -37,6 +37,14 @@ func TestMgClient_ActivateTransportChannel(t *testing.T) {
|
|||||||
Quoting: ChannelFeatureReceive,
|
Quoting: ChannelFeatureReceive,
|
||||||
Deleting: ChannelFeatureBoth,
|
Deleting: ChannelFeatureBoth,
|
||||||
},
|
},
|
||||||
|
Product: Product{
|
||||||
|
Creating: ChannelFeatureSend,
|
||||||
|
Deleting: ChannelFeatureSend,
|
||||||
|
},
|
||||||
|
Order: Order{
|
||||||
|
Creating: ChannelFeatureBoth,
|
||||||
|
Deleting: ChannelFeatureSend,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,6 +74,14 @@ func TestMgClient_ActivateNewTransportChannel(t *testing.T) {
|
|||||||
Quoting: ChannelFeatureBoth,
|
Quoting: ChannelFeatureBoth,
|
||||||
Deleting: ChannelFeatureSend,
|
Deleting: ChannelFeatureSend,
|
||||||
},
|
},
|
||||||
|
Product: Product{
|
||||||
|
Creating: ChannelFeatureSend,
|
||||||
|
Deleting: ChannelFeatureSend,
|
||||||
|
},
|
||||||
|
Order: Order{
|
||||||
|
Creating: ChannelFeatureBoth,
|
||||||
|
Deleting: ChannelFeatureSend,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,6 +123,14 @@ func TestMgClient_UpdateTransportChannel(t *testing.T) {
|
|||||||
Quoting: ChannelFeatureBoth,
|
Quoting: ChannelFeatureBoth,
|
||||||
Deleting: ChannelFeatureBoth,
|
Deleting: ChannelFeatureBoth,
|
||||||
},
|
},
|
||||||
|
Product: Product{
|
||||||
|
Creating: ChannelFeatureSend,
|
||||||
|
Deleting: ChannelFeatureSend,
|
||||||
|
},
|
||||||
|
Order: Order{
|
||||||
|
Creating: ChannelFeatureBoth,
|
||||||
|
Deleting: ChannelFeatureSend,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
31
v1/types.go
31
v1/types.go
@ -204,12 +204,14 @@ type MessageDataProduct struct {
|
|||||||
|
|
||||||
// MessageDataOrder order data from webhook
|
// MessageDataOrder order data from webhook
|
||||||
type MessageDataOrder struct {
|
type MessageDataOrder struct {
|
||||||
Number string `json:"number"`
|
Number string `json:"number"`
|
||||||
Url string `json:"url,omitempty"`
|
Url string `json:"url,omitempty"`
|
||||||
Date string `json:"date,omitempty"`
|
Date string `json:"date,omitempty"`
|
||||||
Cost *MessageDataOrderCost `json:"cost,omitempty"`
|
Cost *MessageDataOrderCost `json:"cost,omitempty"`
|
||||||
Status *MessageDataOrderStatus `json:"status,omitempty"`
|
Status *MessageDataOrderStatus `json:"status,omitempty"`
|
||||||
Items []MessageDataOrderItem `json:"items,omitempty"`
|
Delivery *MessageDataOrderDelivery `json:"delivery"`
|
||||||
|
Payments []MessageDataOrderPayment `json:"payment"`
|
||||||
|
Items []MessageDataOrderItem `json:"items,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MessageDataOrderStatus struct {
|
type MessageDataOrderStatus struct {
|
||||||
@ -234,6 +236,23 @@ type MessageDataOrderQuantity struct {
|
|||||||
Unit string `json:"unit"`
|
Unit string `json:"unit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MessageDataOrderPayment struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Status *MessageDataOrderPaymentStatus `json:"status"`
|
||||||
|
Amount *MessageDataOrderCost `json:"amount"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MessageDataOrderPaymentStatus struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Payed bool `json:"payed"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MessageDataOrderDelivery struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Amount *MessageDataOrderCost `json:"amount"`
|
||||||
|
Address string `json:"address"`
|
||||||
|
}
|
||||||
|
|
||||||
// TransportRequestMeta request metadata
|
// TransportRequestMeta request metadata
|
||||||
type TransportRequestMeta struct {
|
type TransportRequestMeta struct {
|
||||||
ID uint64 `json:"id"`
|
ID uint64 `json:"id"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user