[MM-29157] Cloud invoices logic (#16056)
* Cloud invoices logic This commit includes all the code needed to get and print invoices from CWS
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8f895908fc
Коммит
b68f171162
@@ -663,3 +663,15 @@ func (c *Context) RequireBotUserId() *Context {
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *Context) RequireInvoiceId() *Context {
|
||||
if c.Err != nil {
|
||||
return c
|
||||
}
|
||||
|
||||
if len(c.Params.InvoiceId) != 27 {
|
||||
c.SetInvalidUrlParam("invoice_id")
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
@@ -80,6 +80,9 @@ type Params struct {
|
||||
FilterParentTeamPermitted bool
|
||||
CategoryId string
|
||||
WarnMetricId string
|
||||
|
||||
// Cloud
|
||||
InvoiceId string
|
||||
}
|
||||
|
||||
func ParamsFromRequest(r *http.Request) *Params {
|
||||
@@ -216,6 +219,10 @@ func ParamsFromRequest(r *http.Request) *Params {
|
||||
params.RemoteId = val
|
||||
}
|
||||
|
||||
if val, ok := props["invoice_id"]; ok {
|
||||
params.InvoiceId = val
|
||||
}
|
||||
|
||||
params.Scope = query.Get("scope")
|
||||
|
||||
if val, err := strconv.Atoi(query.Get("page")); err != nil || val < 0 {
|
||||
|
||||
Ссылка в новой задаче
Block a user