feat: improve gas station management workflow
This commit is contained in:
@@ -46,6 +46,9 @@ func platformMenuAllowsRequest(menus []platformbase.Menu, requestPath, method st
|
||||
(resource == "delivery_basic" || resource == "staff_account") {
|
||||
return true
|
||||
}
|
||||
if method == "GET" && menu.Identity == "gas_basic" && resource == "delivery_basic" {
|
||||
return true
|
||||
}
|
||||
if method == "GET" && relative == "wallet_basic" &&
|
||||
(menu.Identity == "gas_basic" || menu.Identity == "delivery_basic" ||
|
||||
menu.Identity == "staff" || menu.Identity == "user_account" ||
|
||||
|
||||
@@ -58,6 +58,16 @@ func TestOwnerMenusCanReadEmbeddedWallets(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGasManagementCanReadDeliveryPointCounts(t *testing.T) {
|
||||
menus := []platformbase.Menu{{Identity: "gas_basic"}}
|
||||
if !platformMenuAllowsRequest(menus, "/heqi/platform/v1/delivery_basic", "GET") {
|
||||
t.Fatal("gas management could not read its delivery point counts")
|
||||
}
|
||||
if platformMenuAllowsRequest(menus, "/heqi/platform/v1/delivery_basic", "POST") {
|
||||
t.Fatal("gas management unexpectedly received delivery point creation access")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocationScopeValuesAreExplicit(t *testing.T) {
|
||||
if !validLocationScope("standard") || !validLocationScope("precise") {
|
||||
t.Fatal("supported location scopes were rejected")
|
||||
|
||||
Reference in New Issue
Block a user