{
  "swagger": "2.0",
  "info": {
    "title": "Store Management",
    "version": "1.0.0"
  },
  "tags": [
    {
      "name": "StoresService"
    }
  ],
  "basePath": "/",
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/stores": {
      "get": {
        "summary": "Get a list of stores",
        "operationId": "getStores",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbGetStoresResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "Store"
        ]
      },
      "post": {
        "summary": "Create a new store",
        "operationId": "createStore",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbCreateStoreResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/storespbCreateStoreRequest"
            }
          }
        ],
        "tags": [
          "Store"
        ]
      }
    },
    "/api/stores/participating": {
      "get": {
        "summary": "Get a list of participating stores",
        "operationId": "getParticipatingStores",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbGetParticipatingStoresResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "Participation"
        ]
      }
    },
    "/api/stores/products/{id}": {
      "get": {
        "summary": "Get a store product",
        "operationId": "getProduct",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbGetProductResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Product"
        ]
      },
      "delete": {
        "summary": "Remove a store product",
        "operationId": "removeProduct",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbRemoveProductResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Product"
        ]
      }
    },
    "/api/stores/products/{id}/decreasePrice": {
      "put": {
        "summary": "Decrease the price of a product",
        "operationId": "decreaseProductPrice",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbDecreaseProductPriceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "price": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          }
        ],
        "tags": [
          "Product"
        ]
      }
    },
    "/api/stores/products/{id}/increasePrice": {
      "put": {
        "summary": "Increase the price of a product",
        "operationId": "increaseProductPrice",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbIncreaseProductPriceResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "price": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          }
        ],
        "tags": [
          "Product"
        ]
      }
    },
    "/api/stores/products/{id}/rebrand": {
      "put": {
        "summary": "Change the name and description of a product",
        "operationId": "rebrandProduct",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbRebrandProductResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "tags": [
          "Product"
        ]
      }
    },
    "/api/stores/{id}": {
      "get": {
        "summary": "Get a store",
        "operationId": "getStore",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbGetStoreResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Store"
        ]
      }
    },
    "/api/stores/{id}/participating": {
      "delete": {
        "summary": "Disable store service participation",
        "operationId": "disableParticipation",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbDisableParticipationResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Participation"
        ]
      },
      "put": {
        "summary": "Enable store service participation",
        "operationId": "enableParticipation",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbEnableParticipationResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object"
            }
          }
        ],
        "tags": [
          "Participation"
        ]
      }
    },
    "/api/stores/{id}/rebrand": {
      "put": {
        "operationId": "rebrandStore",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbRebrandStoreResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "tags": [
          "Store"
        ]
      }
    },
    "/api/stores/{storeId}/products": {
      "get": {
        "summary": "Get a list of store products",
        "operationId": "getStoreProducts",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbGetCatalogResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "Product"
        ]
      },
      "post": {
        "summary": "Add a store product",
        "operationId": "addProduct",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/storespbAddProductResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "sku": {
                  "type": "string"
                },
                "price": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          }
        ],
        "tags": [
          "Product"
        ]
      }
    }
  },
  "definitions": {
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "storespbAddProductResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        }
      }
    },
    "storespbCreateStoreRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "location": {
          "type": "string"
        }
      }
    },
    "storespbCreateStoreResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        }
      }
    },
    "storespbDecreaseProductPriceResponse": {
      "type": "object"
    },
    "storespbDisableParticipationResponse": {
      "type": "object"
    },
    "storespbEnableParticipationResponse": {
      "type": "object"
    },
    "storespbGetCatalogResponse": {
      "type": "object",
      "properties": {
        "products": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/storespbProduct"
          }
        }
      }
    },
    "storespbGetParticipatingStoresResponse": {
      "type": "object",
      "properties": {
        "stores": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/storespbStore"
          }
        }
      }
    },
    "storespbGetProductResponse": {
      "type": "object",
      "properties": {
        "product": {
          "$ref": "#/definitions/storespbProduct"
        }
      }
    },
    "storespbGetStoreResponse": {
      "type": "object",
      "properties": {
        "store": {
          "$ref": "#/definitions/storespbStore"
        }
      }
    },
    "storespbGetStoresResponse": {
      "type": "object",
      "properties": {
        "stores": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/storespbStore"
          }
        }
      }
    },
    "storespbIncreaseProductPriceResponse": {
      "type": "object"
    },
    "storespbProduct": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "storeId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "sku": {
          "type": "string"
        },
        "price": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "storespbRebrandProductResponse": {
      "type": "object"
    },
    "storespbRebrandStoreResponse": {
      "type": "object"
    },
    "storespbRemoveProductResponse": {
      "type": "object"
    },
    "storespbStore": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "location": {
          "type": "string"
        },
        "participating": {
          "type": "boolean"
        }
      }
    }
  }
}