Skip to content

Commit

Permalink
fix: Export some enums values #303
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuQingZai committed Aug 12, 2024
1 parent 5880ea0 commit e25b945
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
8 changes: 8 additions & 0 deletions order.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,14 @@ const (
)

// Order represents a Shopify order
//
// Docs:
//
// - [The Order resource]
// - [Retrieve a specific order]
//
// [The Order resource]: https://shopify.dev/docs/api/admin-rest/2024-04/resources/order#resource-object
// [Retrieve a specific order]: https://shopify.dev/docs/api/admin-rest/2024-04/resources/order#get-orders-order-id
type Order struct {
Id uint64 `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Expand Down
20 changes: 12 additions & 8 deletions order_risk.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,21 @@ type OrderRiskResource struct {
type OrdersRisksResource struct {
OrderRisk []OrderRisk `json:"risks"`
}
type orderRiskRecommendation string

// OrderRiskRecommendation The recommended action given to the merchant.
//
// https://shopify.dev/docs/api/admin-rest/2024-04/resources/order-risk#resource-object
type OrderRiskRecommendation string

const (
// order is fraudulent.
OrderRecommendationCancel orderRiskRecommendation = "cancel"
// OrderRecommendationCancel There is a high level of risk that this order is fraudulent. The merchant should cancel the order.
OrderRecommendationCancel OrderRiskRecommendation = "cancel"

// medium level of risk that this order is fraudulent.
OrderRecommendationInvestigate orderRiskRecommendation = "investigate"
// OrderRecommendationInvestigate There is a medium level of risk that this order is fraudulent. The merchant should investigate the order.
OrderRecommendationInvestigate OrderRiskRecommendation = "investigate"

// level of risk that this order is fraudulent.
OrderRecommendationAccept orderRiskRecommendation = "accept"
// OrderRecommendationAccept There is a low level of risk that this order is fraudulent. The order risk found no indication of fraud.
OrderRecommendationAccept OrderRiskRecommendation = "accept"
)

// A struct for all available order Risk list options.
Expand All @@ -68,7 +72,7 @@ type OrderRisk struct {
Message string `json:"message,omitempty"`
Score string `json:"score,omitempty"`
Source string `json:"source,omitempty"`
Recommendation orderRiskRecommendation `json:"recommendation,omitempty"`
Recommendation OrderRiskRecommendation `json:"recommendation,omitempty"`
}

// List OrderRisk
Expand Down

0 comments on commit e25b945

Please sign in to comment.