/
product_order.go
257 lines (185 loc) · 8.53 KB
/
product_order.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
package schema
import (
"github.com/go-openapi/strfmt"
"github.com/qlcchain/go-sonata-server/util"
"github.com/qlcchain/go-sonata-server/models"
)
type ProductOrder struct {
// Technical attribute to extend the API
AtBaseType string `json:"@baseType,omitempty"`
// Technical attribute to extend the API
AtSchemaLocation string `json:"@schemaLocation,omitempty"`
// Technical attribute to extend the API
AtType string `json:"@type,omitempty"`
// billing account
BillingAccount *models.BillingAccountRef `json:"billingAccount,omitempty" gorm:"foreignkey:ID"`
// Buyer order creation date. Format is YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00)
// Format: date-time
BuyerRequestDate strfmt.DateTime `json:"buyerRequestDate,omitempty"`
// Identifies the date the Seller canceled the Order
// Format: date-time
CancellationDate strfmt.DateTime `json:"cancellationDate,omitempty"`
// Indicates reason why buyer requested cancellation
CancellationReason string `json:"cancellationReason,omitempty"`
// The date the order is completed. Format is YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00)
// Format: date-time
CompletionDate strfmt.DateTime `json:"completionDate,omitempty"`
// desired responses
// Required: true
DesiredResponses models.DesiredOrderResponses `json:"desiredResponses"`
// Expected delivery date amended by the provider
// Format: date-time
ExpectedCompletionDate strfmt.DateTime `json:"expectedCompletionDate,omitempty"`
// Indicates that expedited treatment is requested and any charges generated in provisioning this request (e.g., additional engineering charges or labor charges if applicable) will be accepted by the buyer.
ExpeditePriority bool `json:"expeditePriority,omitempty"`
// A number that uniquely identifies an order within the buyer's enterprise.
// Required: true
ExternalID *string `json:"externalId"`
// Hyperlink to access the order
// Required: true
Href *string `json:"href"`
// Unique (within the ordering domain) identifier for the order that is generated by the seller when the order is initially accepted.
// Required: true
ID *string `json:"id"`
// note
Note []*Note `json:"note" gorm:"foreignkey:ID"`
// order activity
// Required: true
OrderActivity models.OrderActivity `json:"orderActivity"`
// Date when the order was created by seller. Format is YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00)
// Required: true
// Format: date-time
OrderDate *strfmt.DateTime `json:"orderDate"`
// order item
// Required: true
// Min Items: 1
OrderItem []*OrderItem `json:"orderItem" gorm:"foreignkey:ID"`
// order message
OrderMessage []*OrderMessage `json:"orderMessage" gorm:"foreignkey:ID"`
// The version number that the Buyer uses to refer to this particular version of the order
// Required: true
OrderVersion *string `json:"orderVersion"`
// pricing method
PricingMethod models.PricingMethod `json:"pricingMethod,omitempty"`
// The identifier references the previously agreed upon pricing terms, as applicable, based on the pricingMethod (e.g. a contract id or tariff id.
PricingReference string `json:"pricingReference,omitempty"`
// The length of the contract in months.
PricingTerm int32 `json:"pricingTerm,omitempty"`
// An integer that specifies that expedited treatment is to be provided in a specific priority.
// This field will be ignored if the Expedite/Priority Indicator is False.
// The valid values and the business/operational rules for this field will be defined by the Seller as part of the contracting or on-boarding process.
Priority int32 `json:"priority,omitempty"`
// An identifier that is used to group Orders that is important to the Buyer. A ProjectId can be used to relate multiple Orders together
ProjectID string `json:"projectId,omitempty"`
// Related Buyer Purchase Order Number (RPON)
RelatedBuyerPON string `json:"relatedBuyerPON,omitempty"`
// related party
// Required: true
RelatedParty []*RelatedParty `json:"relatedParty" gorm:"foreignkey:ID"`
// Identifies the buyer's desired due date (requested delivery date). Cannot be requested on cancelled orders. Format is YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00).
// Required: true
// Format: date-time
RequestedCompletionDate *strfmt.DateTime `json:"requestedCompletionDate"`
// The buyer's requested date that order processing should start. Format is YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00).
// Format: date-time
RequestedStartDate strfmt.DateTime `json:"requestedStartDate,omitempty"`
// state
// Required: true
State models.ProductOrderStateType `json:"state"`
// state change
StateChange []*StateChange `json:"stateChange" gorm:"foreignkey:ID"`
// Within the United States, indicates the provisioning and restoration priority as defined under the TSP Service Vendor Handbook, The valid values are defined in ATIS OBF document: ATIS-0404001
TspRestorationPriority string `json:"tspRestorationPriority,omitempty"`
RequestedCancellationDate *strfmt.DateTime `json:"requestedCancellationDate"`
CancellationDeniedReason string `json:"cancellationDeniedReason,omitempty"`
TaskState *models.TaskStateType `json:"taskState"`
Version string `json:"version,omitempty"`
}
func (po *ProductOrder) To() *models.ProductOrder {
if po == nil {
return nil
}
to := &models.ProductOrder{}
_ = util.Convert(po, to)
return to
}
func (po *ProductOrder) ProductOrderEvent() *models.ProductOrderEvent {
if po == nil {
return nil
}
to := &models.ProductOrderEvent{}
_ = util.Convert(po, to)
return to
}
type OrderMessage struct {
ID *string `json:"id"`
// The code associated with the Message
Code string `json:"code,omitempty"`
// Indicates whether the Buyer must submit an updated Order to resolve the Error/Jeopardy condition.
CorrectionRequired *bool `json:"correctionRequired,omitempty"`
// The field/attribute on the Order associated with message
Field string `json:"field,omitempty"`
// A description of the error condition or information to be conveyed to the Buyer
// Required: true
MessageInformation *string `json:"messageInformation"`
// severity
// Required: true
Severity models.Severity `json:"severity"`
}
type OrderItem struct {
// Target a description file of productOrder extension
AtSchemaLocation string `json:"@schemaLocation,omitempty"`
// Type of productOrder
AtType string `json:"@type,omitempty"`
// action
// Required: true
Action models.ProductActionType `json:"action"`
// billing account
BillingAccount *models.BillingAccountRef `json:"billingAccount,omitempty"`
// Identifier of the line item (generally it is a sequence number 01, 02, 03, ...)
// Required: true
ID *string `json:"id"`
// order item price
OrderItemPrice []*OrderItemPrice `json:"orderItemPrice" gorm:"foreignkey:ID"`
// order item relationship
OrderItemRelationship []*models.OrderItemRelationShip `json:"orderItemRelationship" gorm:"foreignkey:ID"`
// pricing method
PricingMethod models.PricingMethod `json:"pricingMethod,omitempty"`
// The identifier references the previously agreed upon pricing terms, as applicable, based on the pricingMethod (e.g. a contract id or tariff id.
PricingReference string `json:"pricingReference,omitempty"`
// The length of the contract in months
PricingTerm int32 `json:"pricingTerm,omitempty"`
// product
Product *Product `json:"product,omitempty" gorm:"foreignkey:ID"`
// product offering
ProductOffering *models.ProductOfferingRef `json:"productOffering,omitempty" gorm:"foreignkey:ID"`
// qualification
Qualification *QualificationRef `json:"qualification,omitempty" gorm:"foreignkey:ID"`
// quote
Quote *models.QuoteRef `json:"quote,omitempty" gorm:"foreignkey:ID"`
// related party
RelatedParty []*RelatedParty `json:"relatedParty" gorm:"foreignkey:ID"`
// state
// Required: true
State models.ProductOrderItemStateType `json:"state"`
// state change
StateChange []*StateChange `json:"stateChange" gorm:"foreignkey:ID"`
}
type OrderItemPrice struct {
ID *string `json:"id"`
// Technical attribute to extend the class
AtType string `json:"@type,omitempty" gorm:"column:base_type"`
// A narrative that explains in detail the semantics of yhis order item price
Description string `json:"description,omitempty"`
// Name of the product price
// Required: true
Name *string `json:"name"`
// price
// Required: true
Price *models.Price `json:"price" gorm:"embedded"`
// price type
// Required: true
PriceType models.PriceType `json:"priceType"`
// recurring charge period
RecurringChargePeriod models.ChargePeriod `json:"recurringChargePeriod,omitempty"`
}