stubbed simulations page content: refund
This commit is contained in:
@@ -81,6 +81,7 @@ func Routes(
|
||||
|
||||
simulations := r.Group("/:acctID/simulations")
|
||||
simulations.POST("/sale", response.Handler(as.postNewSale))
|
||||
simulations.POST("/refund", response.Handler(as.postNewRefund))
|
||||
}
|
||||
|
||||
// POST /
|
||||
@@ -765,6 +766,32 @@ func (s *accountSubrouter) postNewSale(c *gin.Context) (response.Response, error
|
||||
return response.StatusCreated(), nil
|
||||
}
|
||||
|
||||
// POST /:acctID/simulations/refund
|
||||
func (s *accountSubrouter) postNewRefund(c *gin.Context) (response.Response, error) {
|
||||
acctID := auth.GetIdentity(c).Account.AccountID
|
||||
|
||||
var (
|
||||
shopID string
|
||||
listingID string
|
||||
count int
|
||||
)
|
||||
|
||||
if err := param.Form("shop-id", param.Text(&shopID)).
|
||||
Form("listing-id", param.Text(&listingID)).
|
||||
Form("count", param.Int(&count)).
|
||||
Unmarshal(c); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s.log.Debugf("refund posted:")
|
||||
s.log.Debugf(" account: %d", acctID)
|
||||
s.log.Debugf(" shop: %s", shopID)
|
||||
s.log.Debugf(" listing: %s", listingID)
|
||||
s.log.Debugf(" count: %d", count)
|
||||
|
||||
return response.StatusCreated(), nil
|
||||
}
|
||||
|
||||
func lowerSnakeCase(s accounts.Platform) string {
|
||||
return strings.ToLower(strings.Join(strings.Split(string(s), " "), "_"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user