openapi: 3.0.3
info:
  title: FlowerRoad
  description: |-
    This is the API documentation for FlowerRoad Backend project.
    
    This is the documentation after the sprint 1
  termsOfService: https://www.linkpoint.ca/
  contact:
    email: fzhang@linkpoint.ca
  version: 1.0.0
externalDocs:
  description: Find out more about FlowerRoad
  url: https://about.gitlab.com/
servers:
  - url: https://flowerrd-api.linkpoint.dev/api
  
tags:
  - name: Customer
    description: Handle creating/updating/retrieving a customer's info and some other use cases
  
  - name: Login
    description: Handle user login
    
  - name: Product
    description: Everything about a product
    
  - name: Tag
    description: Everything about a tag
    
  - name: Category
    description: Everything about a Category
    
  - name: Region
    description: Everything about a Region
    
  - name: Vendor
    description: Everything about a Vendor
    
  - name: Coupon
    description: Everything about a Coupon
    
paths:
  /register/:
    post:
      tags:
        - Customer
      summary: Create a new customer to the FlowerRoad
      description: Add a new customer, guest field is required. If guest is assigned as false, the rest of parameter will be required. If guest is assigned as true, then no other parameter will be needed, this api will return a token as guest.
      operationId: addCustomer
      requestBody:
        description: Create a new customer
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Customer'
        required: true
      responses:
        '201':
          description: Successfully created a new user
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/GuestReturn'
        '406':
          description: Required field is missing or Invalid input
        '404':
          description: Duplicate username
          
  /vendor/:
    post:
      tags:
        - Vendor
      summary: Create a new vendor to the FlowerRoad. The url will still be /register/ but with admin auth required
      description: Add a new vendor
      operationId: addVendor
      requestBody:
        description: Create a new vendor
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Vendor'
          application/xml:
            schema:
              $ref: '#/components/schemas/Vendor'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Vendor'
        required: true
      responses:
        '201':
          description: Successfully created a new user
        '406':
          description: Required field is missing or Invalid input
        '404':
          description: Duplicate username
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /vendor:
    get:
      tags:
        - Vendor
      summary: retrieve all vendor account info from the database
      description: get all vendor's account info
      operationId: getVendor
      responses:
        '200':
          description: Successfully retrieve all users
        '401':
          description: unauthorized
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /vendorUpdateAddress:
    put:
      tags:
        - Vendor
      summary: edit order's address
      description: Allow vendor to edit or add an address to an order which was assigned to them
      operationId: vendorEditAddress
      requestBody:
        description: Create a new vendor
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorEditAddress'
      responses:
        '200':
          description: Successfully retrieve all users
        '401':
          description: unauthorized (not a vendor or this order is not assigned to you)
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /vendorInfo:
    get:
      tags:
        - Vendor
      summary: retrieve current vendor account info from the database
      description: get vendor's account info base on login credential (auth token)
      operationId: getVendorInfo
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderList'        
          description: Successfully retrieve all users
        '401':
          description: unauthorized
          
      security: 
        - OAuth2: 
          - vendor
          
  /vendorUtils/:
    put:
      tags:
        - Vendor
      summary: Edit the order's status
      description: Let vendor edit the status of an order(reject, except or complete), note the image data can only be recognized when status = "complete" 
      operationId: editOrderStatus
      requestBody:
        description: Create a new vendor
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorEditStatus'
      responses:
        '200':
          description: Successfully change the status
        '401':
          description: unauthorized
          
      security: 
        - OAuth2: 
          - vendor
          
  /vendor/{vendor_id}/:
    get:
      tags:
        - Vendor
      summary: retrieve a specific vendor account info from the database
      description: get one specific vendor's account info
      operationId: getOneVendor
      parameters:
        - name: vendor_id
          in: path
          description: ID of vendor
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successfully retrieve all users
        '401':
          description: Unauthorized
        '404':
          description: Not found
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
    
    delete:
      tags:
        - Vendor
      summary: delete a specific vendor account info from the database
      description: delete one specific vendor's account info
      operationId: deleteOneVendor
      parameters:
        - name: vendor_id
          in: path
          description: ID of vendor
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '204':
          description: no context
        '401':
          description: Unauthorized
        '404':
          description: Not found
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
    
    put:
      tags:
        - Vendor
      summary: update a specific vendor account info from the database
      description: update one specific vendor's account info
      operationId: updateOneVendor
      parameters:
        - name: vendor_id
          in: path
          description: ID of vendor
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Create a new vendor
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Vendor'
          application/xml:
            schema:
              $ref: '#/components/schemas/Vendor'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Vendor'
        required: true
      responses:
        '200':
          description: update successfully
        '401':
          description: Unauthorized
        '404':
          description: Not found
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
    
    
    
  /customer:
    get:
      tags:
        - Customer
      summary: Retrieve current user info 
      description: Get user information by his auth token
      operationId: getUserInfo
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/customerInfoReturn'          
        '400':
          description: Invalid tag value
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
  
  /customer/{customerId}/:
    put:
      tags:
        - Customer
      summary: Update current user info 
      description: Update user information by his auth token. Note that we need to make sure the avatar info can be base64 decoded. Otherwise the avatar info will not be saved. This API can also be used when a guest user wants to claim this account.
      operationId: updateUserInfo
      parameters:
        - name: customerId
          in: path
          description: ID of the current login customer
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Update current user info
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateCustomer'
        required: true
        
      responses:
        '200':
          description: update successfully

        '406':
          description: Region info is invalid
          
        '400':
          description: information you provided is invalid
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
            
            
  /Login:
    post:
      tags:
        - Login
      summary: Return the auth token after a successful login
      description: user login case
      operationId: login
      requestBody:
        description: Create a new customer
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Login'
        required: true
      responses:
        '200':
          description: successfully login
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/loginReturn'          

        '406':
          description: required field missing
        '400':
          description: wrong username or password
  
  /password_reset:
    post:
      tags:
        - Login
      summary: Password recovery
      description: send customer an email to process the password recovery procedure
      operationId: passwordReset
      requestBody:
        description: customer's username and customer's email are required
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/password'
        required: true
      responses:
        '200':
          description: successfully login
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/loginReturn'          

        '406':
          description: required field missing
        '400':
          description: email does not exist
          
  /product/:
    post:
      tags:
        - Product
      summary: Create a new product
      description: admin user can create a product by this API
      operationId: createPoduct
      requestBody:
        description: Create a new product
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Product'
        required: true
      responses:
        '200':
          description: successfully login
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product_return_create'          

        '406':
          description: required field missing
        '400':
          description: wrong username or password
      security: 
        - OAuth2: 
          - admin
  /product/{productId}/:
    put:
      tags:
        - Product
      summary: Update a product
      description: admin user can update a product by this API
      operationId: updatePoduct
      parameters:
        - name: productId
          in: path
          description: ID of product
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Update a product
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Product'
        required: true
      responses:
        '200':
          description: This specific product has been successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product_return'    

        '400':
          description: required field missing
      security: 
        - OAuth2: 
          - admin
          
    delete:
      tags:
        - Product
      summary: Delete a product
      description: admin user can delete a product by this API
      operationId: deletePoduct
      parameters:
        - name: productId
          in: path
          description: ID of product
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: This specific product has been successfully updated

        '400':
          description: required field missing
      security: 
        - OAuth2: 
          - admin
  
  /image/{productId}/:
    post:
      tags:
        - Product
      summary: Upload an image to product
      description: admin user can upload an image to product (the first image get uploaded will be the primary one)
      operationId: uploadImage
      parameters:
        - name: productId
          in: path
          description: ID of product
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Update a product
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/image'
        required: true
      responses:
        '200':
          description: Image has been uploaded
        '400':
          description: required field missing
      security: 
        - OAuth2: 
          - admin
  
  /image/{imageId}/: 
    put:
      tags:
        - Product
      summary: Update an image to be the primary one of that product
      description: admin user can select an image to be the primary image of that product.
      operationId: updateImage
      parameters:
        - name: imageId
          in: path
          description: ID of image
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: update successful
        '400':
          description: required field missing
      security: 
        - OAuth2: 
          - admin
          
    delete:
      tags:
        - Product
      summary: delete an image from the product
      description: admin user can delete an image.(One of the rest will be the primary)
      operationId: deleteImage
      parameters:
        - name: imageId
          in: path
          description: ID of image
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: update successful
        '400':
          description: required field missing
      security: 
        - OAuth2: 
          - admin
          
  /product:
    get:
      tags:
        - Product
      summary: Get all products
      description: user with credential can retrieve all products by this API
      operationId: getPoducts
      responses:
        '200':
          description: successfully login
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductList'          

        '404':
          description: Not found
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /product/{productId}:
    get:
      tags:
        - Product
      summary: get a specific product
      description: get a product by its id
      operationId: getPoduct
      parameters:
        - name: productId
          in: path
          description: ID of product
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successfully login
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductInfo'          

        '404':
          description: Not found
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
    
  /product_filter:
    post:
      tags:
        - Product
      summary: Get product list with specific filter
      description: Provide filter than get a list of product as a return
      operationId: getPoductWithFilter
      requestBody:
        description: get a products' list depending on the filter's terms. At least one of the term(tag or category) is required.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Filter'

        required: true
      responses:
        '200':
          description: products have been found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product_filter_return'          

        '400':
          description: one of the required fields or both have not been provided
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /cart:
    get:
      tags:
        - Customer
      summary: Get a customer's cart
      description: Retrieve customer's cart
      operationId: getCart
      responses:
        '200':
          description: products have been added
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Cart'          
        '400':
          description: products have not been found

          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /cart/:
    
    post:
      tags:
        - Customer
      summary: Add a product to customer's cart
      description: Add the specific item to the current customer's cart. The last info field is used to provide total/tax/shipping info.
      operationId: addProductToCart
      requestBody:
        description: Need the specific product id
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/cartBody'
        required: true
      responses:
        '200':
          description: products have been added
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Cart'          

        '400':
          description: products have not been found

          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
  
    delete:
      tags:
        - Customer
      summary: Delete a product from customer's cart
      description: Delete the specific item from the current customer's cart
      requestBody:
        description: Need the specific product id
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/cartBodyDel'
        required: true
      responses:
        '200':
          description: products have been deleted
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/Cart'          

        '400':
          description: products have not been found

          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
    
  /favourite/{productId}/:
    post:
      tags:
        - Customer
      summary: Add a product to customer's wishlist
      description: Add the specific item to the current customer's wishlist
      operationId: addProductToFav
      parameters:
        - name: productId
          in: path
          description: ID of product
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: products have been added
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/customerInfoReturn'          

        '400':
          description: products have not been found

          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin

  
    delete:
      tags:
        - Customer
      summary: Delete a product to customer's wishlist
      description: Delete the specific item from the current customer's wishlist
      operationId: DeleteProductToFav
      parameters:
        - name: productId
          in: path
          description: ID of product
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: products have been deleted
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/customerInfoReturn'          
            application/xml:
              schema:
                  $ref: '#/components/schemas/customerInfoReturn'

        '400':
          description: products have not been found

          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
  
  /tag:
    get:
      tags:
        - Tag
      summary: get all tags
      description: get all tags
      operationId: getTags
      responses:
        '200':
          description: Successfully created a new tag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagList'

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /tag/:
    post:
      tags:
        - Tag
      summary: Create a new tag
      description: Add a new tag
      operationId: addTag
      requestBody:
        description: Create a new Tag
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Tag'
        required: true
      responses:
        '201':
          description: Successfully created a new tag

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
          
  /tag/{tagId}/:
    get:
      tags:
        - Tag
      summary: get a specific tag by its id
      description: get a specific tag
      operationId: getTag
      parameters:
        - name: tagId
          in: path
          description: ID of the tag
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successfully updated this tag
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
    put:
      tags:
        - Tag
      summary: Update a tag
      description: Update a specific tag
      operationId: updateTag
      parameters:
        - name: tagId
          in: path
          description: ID of the tag
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Update a new Tag
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Tag'
        required: true
      responses:
        '200':
          description: Successfully updated this tag

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
    
    delete:
      tags:
        - Tag
      summary: Delete a tag
      description: Delete a specific tag
      operationId: deleteTag
      parameters:
        - name: tagId
          in: path
          description: ID of tag
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successfully deleted this tag

        '400':
          description: Bad request
          
      security: 
        - OAuth2: 
          - admin
          
  /category:
    get:
      tags:
        - Category
      summary: Get all categories
      description: Return all categories
      operationId: allCategories
      responses:
        '200':
          description: Successfully get all the regions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryList'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /category/:
    post:
      tags:
        - Category
      summary: Create a new category
      description: Add a new category
      operationId: addCategory
      requestBody:
        description: Create a new Category
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Category'
        required: true
      responses:
        '201':
          description: Successfully created a new category
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Category'

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
          
  /category/{categoryId}/:
    get:
      tags:
        - Category
      summary: Get a specific category by id
      description: Return the category with this category id
      operationId: getCategory
      parameters:
        - name: categoryId
          in: path
          description: ID of Category
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successfully retrieve the category
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Category'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
    put:
      tags:
        - Category
      summary: Update a Category
      description: Update a specific Category
      operationId: updateCategory
      parameters:
        - name: categoryId
          in: path
          description: ID of Category
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Update a new Category
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Category'
          application/xml:
            schema:
              $ref: '#/components/schemas/Category'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Category'
        required: true
      responses:
        '200':
          description: Successfully updated this Category

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
    
    delete:
      tags:
        - Category
      summary: Delete a Category
      description: Delete a specific Category
      operationId: deleteCategory
      parameters:
        - name: categoryId
          in: path
          description: ID of Category
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successfully deleted this tag

        '400':
          description: Bad request
          
      security: 
        - OAuth2: 
          - admin
  
  /region:
    get:
      tags:
        - Region
      summary: Get all regions
      description: Return all regions
      operationId: allRegion
      responses:
        '200':
          description: Successfully get all the regions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegionList'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /nation:
    get:
      tags:
        - Region
      summary: Get all nations
      description: Return all nations. New field regions has been added which includes a list of corresponding regions' id. 
      operationId: allNations
      responses:
        '200':
          description: Successfully get all the nations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NationList'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
  
  /nation/{nationId}:
    get:
      tags:
        - Region
      summary: Get nation by id
      description: Return nation by id
      operationId: getNation
      parameters:
        - name: nationId
          in: path
          description: ID of nation
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successfully get the nation by id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Nation'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /region/{regionId}:
    get:
      tags:
        - Region
      summary: Get a specific region by id
      description: Return the region with this region id
      operationId: getRegion
      parameters:
        - name: regionId
          in: path
          description: ID of region
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successfully retrieve the region
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Region'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
  
  /region/:
    post:
      tags:
        - Region
      summary: Create a new region
      description: Add a new region
      operationId: addRegion
      
      requestBody:
        description: Create a new region
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Region_onCreate'
        required: true
      responses:
        '201':
          description: Successfully created a new region
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Region'

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
          
  /region/{regionId}/:
    put:
      tags:
        - Region
      summary: Update a region
      description: Update a specific region
      operationId: updateRegion
      parameters:
        - name: regionId
          in: path
          description: ID of region
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Update a new Region
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Region_onCreate'
        required: true
      responses:
        '200':
          description: Successfully updated this Region
        '400':
          description: Bad request
        '403':
          description: Forbidden
      security: 
        - OAuth2: 
          - admin
    
    delete:
      tags:
        - Region
      summary: Delete a region
      description: Delete a specific region
      operationId: deleteRegion
      parameters:
        - name: regionId
          in: path
          description: ID of product
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '204':
          description: Successfully deleted this tag

        '400':
          description: Bad request
          
        '403':
          description: Forbidden
        
        '404':
          description: Not Found
          
      security: 
        - OAuth2: 
          - admin
  
  /region_product:
    post:
      tags:
        - Region
      summary: Add products to the region
      description: Add all the product inside the list to this region
      operationId: addProductToRegion
      
      requestBody:
        description: Add products to a specific region
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Region_Product'
        required: true
      responses:
        '200':
          description: Successfully added these product to this region

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
          
  /coupon:
    get:
      tags:
        - Coupon
      summary: Get all coupons
      description: Return all coupons
      operationId: allCoupons
      responses:
        '200':
          description: Successfully get all the regions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponList'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /coupon/{coupon_id}:
    get:
      tags:
        - Coupon
      summary: Get a specific coupons by id
      description: Return the coupons
      operationId: getCoupons
      parameters:
        - name: coupon_id
          in: path
          description: ID of coupon
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successfully get all the regions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Coupon'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /coupon/:
    post:
      tags:
        - Coupon
      summary: Create a new coupon
      description: create a coupons
      operationId: createCoupons
      requestBody:
        content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponCreate'  
      responses:
        '200':
          description: Successfully get all the regions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Coupon'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
  
  /CouponValidate/:
    post:
      tags:
        - Coupon
      summary: Validate a coupon
      description: validate a coupon by its promo code and return its info
      operationId: validateCoupon
      requestBody:
        content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponValid'  
      responses:
        '200':
          description: Successfully get all the regions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Coupon'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
          - customer
  /coupon/{coupon_id}/:
    put:
      tags:
        - Coupon
      summary: update that specific coupon
      description: update a coupons
      operationId: updateCoupons
      parameters:
        - name: coupon_id
          in: path
          description: ID of coupon
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponCreate'  
      responses:
        '200':
          description: Successfully get all the regions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Coupon'  

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
          
    delete:
      tags:
        - Coupon
      summary: delete that specific coupon
      description: delete a coupons
      operationId: deleteCoupons
      parameters:
        - name: coupon_id
          in: path
          description: ID of coupon
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '204':
          description: Successfully delete this regions

        '400':
          description: Bad request
      security: 
        - OAuth2: 
          - admin
  
  /payment:
    get:
      tags:
        - Customer
      summary: get current user payment info 
      description: get user payment info
      operationId: getPayment
      responses:
        '200':
          description: retrieve successfully
          content:
            application/json:
              schema:
                  $ref: '#/components/schemas/PaymentList'
          
        '400':
          description: information you provided is invalid
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
  
  /payment/:
    post:
      tags:
        - Customer
      summary: Create current user payment info
      description: create user payment information, all fields inside the request body will be required except line2.
      operationId: createUserPayment
      requestBody:
        description: Create a new customer payment
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentCreate'
        required: true
        
      responses:
        '200':
          description: create successfully
          
        '400':
          description: information you provided is invalid
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
    
    put:
      tags:
        - Customer
      summary: update current user's default payment method
      description: set a specific payment method which belongs to the current user to be the default user. 
      operationId: setUserDefaultPayment
      requestBody:
        description: payment_method is the id of that payment
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DefaultPayment'
        required: true
        
      responses:
        '200':
          description: default card has been updated
          
        '400':
          description: info is not valid
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
  
  /updatePayment/{payment_id}/:
    
    delete:
      tags:
        - Customer
      summary: delete one of current user payment info by its Id
      description: delete user payment information
      operationId: deleteUserPayment
      parameters:
        - name: payment_id
          in: path
          description: ID of payment
          required: true
          schema:
            type: integer
            format: int64
      
      responses:
        '204':
          description: no content
          
        '400':
          description: information you provided is invalid
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
          
  /order/:
    get:
      tags:
        - Customer
      summary: returns depend on the authentication
      description: admin can get all orders, user can only retrieve his own orders, vendor will get all the order which relate to them including New/In progress/complete
        
        And there will be one more additional field for vendors' return which is the order id.
      operationId: getOrders
      responses:
        '200':
          description: create successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderList'
          
        '400':
          description: information you provided is invalid
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - vendor
          - admin
      
  
    post:
      tags:
        - Customer
      summary: checkout current user's cart
      description: checkout current user's cart.
      operationId: checkout
      requestBody:
        description: checkout current user's cart
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCreate'
        required: true
        
      responses:
        '200':
          description: create successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
          
        '400':
          description: information you provided is invalid
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - admin
    
    put:
      tags:
        - Vendor
      summary: vendor pick up availble user order
      description: vendor picks a user's order
      operationId: fillOrder
      requestBody: 
        description: order number
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderId'
        required: true
      responses:
        '200':
          description: create successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderExtend'
          
        '400':
          description: information you provided is invalid
          
      security: 
        - OAuth2: 
          - vendor
    
    
    
  /credit:
    get:
      tags:
        - Customer
      summary: returns the credit amount for that user.
      description: Use this api to get how much credits the user can spend on this order
      operationId: getCredit
        
      responses:
        '200':
          description: create successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/number'
          
        '400':
          description: information you provided is invalid
          
      security: 
        - OAuth2: 
          - customer
          - stuff
          - vendor
          - admin

  
 
components:
  schemas:
    Cart:
      type: array
      items: 
          $ref: '#/components/schemas/Cart_Item'
      example: {
    "0": {
        "id": 34,
        "number": "1",
        "message": "This will be delivered to .....",
        "user": 35,
        "product": 2
    },
    "1": {
        "id": 36,
        "number": "2",
        "message": "This will be delivered to .....",
        "user": 35,
        "product": 1
    },
    "info": {
        "subTotal": 147.23,
        "tax": 16.2,
        "shipping": 11.0
    }
}
    Cart_Item:
      type: object
      properties:
        id:
          type: string
          example: 1
        number:
          type: string
          example: 3
        user:
          type: string
          example: 5
        product:
          type: string
          example: 2
          
    number:
      type: number
      example: 91.0
        
      
    Region_Product:
      type: object
      required: [region,product,price]
      properties:
        region:
          type: string
          example: 1
        products:
          type: array
          items: 
            $ref: '#/components/schemas/ProductId'
          example: [2,3]
        price:
          type: array
          items:
            type: string
          example: [10,12]
      example:
        {
    "region":1,
    "products":[3,4],
    "price":[10,12]
    
}
          
    Region_onCreate:
      type: object
      required: [name]
      properties:
        name:
          type: string
          example: North Alberta
        country:
          type: string
          example: Canada
        state:
          type: string
          example: Alberta
        city:
          type: string
          example: Edmonton
        iso:
          type: string
          example: CAD
        symbol:
          type: string
          example: C$
          
    Region:
      type: object
      properties:
        id:
          type: string
          example: 1
        name:
          type: string
          example: North Alberta
        state:
          type: string
          example: Alberta
        city:
          type: string
          example: Edmonton
        product:
          type: array
          items: 
            $ref: '#/components/schemas/ProductId'
          example: [2,3]
    
    Nation:
      type: object
      properties:
        id:
          type: string
          example: 1
        name:
          type: string
          example: Canada
        iso:
          type: string
          example: CAD
        symbol:
          type: string
          example: C$
        photo:
          type: string
          
        
    Tag:
      type: object
      required: [name]
      properties:
        name:
          type: string
          example: Sweet Pea
    
    Category:
      type: object
      required: [name]
      properties:
        name:
          type: string
          example: Anniversary
        photo:
          type: string
          format: binary
    
    Customer:
      type: object
      required: [email,password,guest]
      properties:
        guest:
          type: boolean
          example: true
        email:
          type: string
          example: fzhang@linkpoint.ca
        password:
          type: string
          example: 123456
        full_name:
          type: string
          example: Frank Zhang
        phone:
          type: string
          example: (123)1231234
          
    GuestReturn:
      type: object
      properties:
        message: 
          type: string
          example: Successfully created a new user
        token:
          type: string
          example: a7eb6693b232688c9f9c723f823a7bc64db145ee
          
    VendorEditAddress:
      type: object
      required: [id,address]
      properties:
        id: 
          type: string
          example: 8ea23832-439c-11ee-90e1-1418c37e9888
        address:
          type: string
          example: XXXX-XXXstreet XX XXXX Canada
          
    VendorEditStatus:
      type: object
      required: [id,status]
      properties:
        id: 
          type: string
          example: 8ea23832-439c-11ee-90e1-1418c37e9888
        address:
          type: status
          example: accept/reject/complete
        image:
          type: string

        
    Vendor:
      type: object
      required: [email,vendor_name,contact_name,commission_rate,opening,closing,region,address]
      properties:
        email:
          type: string
          example: fzhang@linkpoint.ca
        vendor_name:
          type: string
          example: GoldenFlower
        contact_name:
          type: string
          example: Frank
        commission_rate:
          type: string
          example: 12
        opening:
          type: string
          example: 08:00
        closing:
          type: string
          example: 17:00
        region:
          type: string
          example: 1
        address:
          type: string
          example: 107-112A street NW Edmonton AB
        full_name:
          type: string
          example: Frank Zhang
        phone:
          type: string
          example: 1233211234
      xml:
        name: customer
    
    Login:
      type: object
      required: [password,email]
      properties:
        password:
          type: string
          example: 123456
        email:
          type: string
          example: fzhang@linkpoint.ca
        ip:
          type: string
          example: 192.106.1.1
      xml:
        name: order
    
    loginReturn:
      type: object
      properties:
        token:
          type: string
          example: 03f151ae1a4ea611255f62a5c5a4aefa3f4484d3

      xml:
        name: order
        
    vendorInfo:
      type: object
      properties:
        id:
          type: string
          example: 3
        email:
          type: string
          example: 4615@gmail.com
        address:
          type: string
          example: 111 street
        region_name:
          type: string
          example: Lower Mainland  / Langley
        vendor_name:
          type: string
          example: PlatniumFlower
        contact_name:
          type: string
          example: Frank
        commission_rate:
          type: string
          example: 1.00
        opening:
          type: string
          example: 12:03:00
        closing:
          type: string
          example: 12:03:00
        user:
          type: string
          example: 176

      xml:
        name: order
        
    customerInfoReturn:
      type: object
      properties:
        id:
          type: string
          example: 3
        ip:
          type: string
          example: 192.168.1.2
        full_name:
          type: string
          example: FrankZhang
        phone:
          type: string
          example: 1233211234
        avatar:
          type: string
          example: /media/uploads/man5121_7AWIt95.png
        address:
          type: string
          example: 106street langley BC
        region:
          type: string
          example: 1
        favourite:
          type: array
          items: 
            $ref: '#/components/schemas/ProductId'
          example: [2]
        email:
          type: string
          example: "123@gmail.com"
        

      xml:
        name: order
    
    Filter:
      type: object
      required: [tag,category]
      properties:
        tag:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: [3]
        category:
          type: array
          items: 
            $ref: '#/components/schemas/CategoryId'
          example: [5]
      
    Mod:
      type: object
      required: [mode]
      properties:
        mode:
          type: string
          example: 1
          
    ProductRequest:
      type: object
      required: [product]
      properties:
        product:
          type: string
          example: 3
    
    OrderCreate:
      type: object
      required: [name, phone, time, address, payment]
      properties:
        name:
          type: string
          example: Frank
        phone:
          type: string
          example: 1233211234
        time:
          type: string
          example: 2032-09-04 06:00:00.000000-08:00
        address:
          type: string
          example: 105-112A street Langley BC
        coupon:
          type: string
          example: 2
        payment:
          type: string
          example: 1
        instruction:
          type: string
          example: Please send this to ........
        credit:
          type: number
          example: 12
    
    
    OrderId:
      type: object
      properties:
        order:
          type: string
          example: d222a384-9392-11ed-ac3e-f1ff960df5bf
          
    Order:
      type: object
      properties:
        id:
          type: string
          example: 1
        name:
          type: string
          example: Frank
        phone:
          type: string
          example: 1233211234
        time:
          type: string
          example: 2032-09-04 06:00:00.000000-08:00
        address:
          type: string
          example: 105-112A street Langley BC
        coupon:
          type: string
          example: 2
        payment:
          type: string
          example: 1
        instruction:
          type: string
          example: Please send this to ........
          
    OrderExtend:
      type: object
      properties:
        id:
          type: string
          example: 1
        name:
          type: string
          example: Frank
        phone:
          type: string
          example: 1233211234
        time:
          type: string
          example: 2032-09-04 06:00:00.000000-08:00
        address:
          type: string
          example: 105-112A street Langley BC
        coupon:
          type: string
          example: 2
        payment:
          type: string
          example: 1
        paid:
          type: boolean
          example: true
        instruction:
          type: string
          example: Leave at the main entrance
        value:
          type: string
          example: 44.8
        customer:
          type: string
          example: 2
        region:
          type: string
          example: 1
        vendor:
          type: string
          example: 1
      example:
        {"id":"d222a384-9392-11ed-ac3e-f1ff960df5bf","name":"Frank","phone":"1233211234","time":"2032-09-04T14:00:00Z","address":"105-112A street Langley BC ","paid":true,"payment":"1","instruction":null,"value":"44.80","customer":2,"region":1,"vendor":1,"coupon":2}
        
    OrderList:
      type: array
      items: 
          $ref: '#/components/schemas/Order'
      example:
          [
    {
        "order_number": "FR@2023-03-27 19:23:33with-Order#684-810-1890",
        "name": "Frank",
        "phone": "1233211234",
        "time": "2032-09-04T14:00:00Z",
        "address": "105-112A street Langley BC",
        "region_id": 1,
        "vendor_id": null,
        "paid": false,
        "payment_id": 68,
        "coupon_id": null,
        "instruction": "Please send this to ........",
        "shipping": 11.0,
        "tax": 18.84,
        "value": 201.07,
        "create": "2023-03-27T19:23:33.742642Z",
        "details": [
            {
                "id": 63,
                "order_id": "dd5e39fc-ccd4-11ed-b68e-5cff35d74326",
                "product_id": 2,
                "number": "1",
                "price": 123.23,
                "message": "This will be delivered to ....."
            },
            {
                "id": 64,
                "order_id": "dd5e39fc-ccd4-11ed-b68e-5cff35d74326",
                "product_id": 1,
                "number": "4",
                "price": 12.0,
                "message": "This will be delivered to ....."
            }
        ]
    },
    {
        "order_number": "FR@2023-03-27 19:32:30with-Order#652-863-4706",
        "name": "Frank",
        "phone": "1233211234",
        "time": "2032-09-04T14:00:00Z",
        "address": "105-112A street Langley BC",
        "region_id": 1,
        "vendor_id": null,
        "paid": false,
        "payment_id": 68,
        "coupon_id": null,
        "instruction": "Please send this to ........",
        "shipping": 11.0,
        "tax": 13.56,
        "value": 147.79,
        "create": "2023-03-27T19:32:30.246070Z",
        "details": [
            {
                "id": 65,
                "order_id": "1d26271d-ccd6-11ed-a9bd-5cff35d74326",
                "product_id": 2,
                "number": "1",
                "price": 123.23,
                "message": "This will be delivered to ....."
            }
        ]
    }
]

    DefaultPayment:
      type: object
      required: [payment_method]
      properties:
        payment_method:
          type: string
          example: 56
          
    PaymentCreate:
      type: object
      required: [primary, name, month, year, number,cvc,line1,city,country,postal_code,state]
      properties:
        primary:
          type: boolean
          example: True
        name:
          type: string
          example: Frank Zhang
        month:
          type: string
          example: 11
        year:
          type: string
          example: 2023
        number:
          type: string
          example: 4242424242424242
        cvc:
          type: string
          example: 123
        line1:
          type: string
          example: "Unit#4103"
        line2:
          type: string
          example: "4222 Willingdon Ave"
        city:
          type: string
          example: "Burnaby"
        country:
          type: string
          example: "Canada"
        postal_code:
          type: string
          example: "V2CB3E"
        state:
          type: string
          example: "British Columbia"

          
    Payment:
      type: object
      properties:
        id:
          type: string
          example: 3
        primary:
          type: boolean
          example: True
        end_with:
          type: string
          example: 4499
        month:
          type: string
          example: 11
        year:
          type: string
          example: 2023
        card_type:
          type: string
          example: Mastercard
        
    PaymentList:
      type: array
      items: 
          $ref: '#/components/schemas/Payment'
      example:
          {
    "0": {
        "id": 68,
        "primary": false,
        "end_with": "4242",
        "month": "11",
        "year": "2024",
        "card_type": "Visa"
    },
    "1": {
        "id": 69,
        "primary": false,
        "end_with": "4242",
        "month": "12",
        "year": "2026",
        "card_type": "Visa"
    }
}
    
    CategoryList:
      type: array
      items: 
          $ref: '#/components/schemas/Category'
      example:
          [{"id":3,"name":"Anniversery","photo":"https://flowerrd-api.linkpoint.dev/media/uploads/carnation-and-roses_2SD1ci1.jpg"},{"id":4,"name":"Just Because","photo":null},{"id":5,"name":"Birthday","photo":null},{"id":6,"name":"Sympathy","photo":null},{"id":8,"name":"Graduation","photo":null},{"id":10,"name":"Get Well","photo":null},{"id":7,"name":"Getting Well","photo":"https://flowerrd-api.linkpoint.dev/media/uploads/get-well-soon-messages-featured.jpg"}]
          
    CouponCreate:
      type: object
      required: [region, expiration, percentage, series, total_number, per_customer]
      properties:
        region:
          type: string
          example: 1
        expiration:
          type: string
          example: 2032-09-09 06:00:00.000000-08:00
        percentage:
          type: string
          example: 33
        series:
          type: string
          example: Buy2Get1ForFree
        total_number:
          type: string
          example: 50
        per_customer:
          type: string
          example: 1
          
    Coupon:
      type: object
      required: [region, expiration, percentage, series, total_number, per_customer]
      properties:
        id:
          type: string
          example: 1
        region:
          type: string
          example: 1
        expiration:
          type: string
          example: 2032-09-09 06:00:00.000000-08:00
        percentage:
          type: string
          example: 33
        series:
          type: string
          example: Buy2Get1ForFree
        total_number:
          type: string
          example: 50
        per_customer:
          type: string
          example: 1
    
    CouponValid:
      type: object
      required: [coupon]
      properties:
        coupon:
          type: string
          example: Welcome888
          
    CouponList:
      type: array
      items:
        $ref: '#/components/schemas/Coupon'
      example:
        [
    {
        "id": 2,
        "expiration": "2032-09-04T14:00:00Z",
        "total_number": "50.00",
        "per_customer": "1.00",
        "percentage": "15.00",
        "series": "Welcome888",
        "region": 1
    },
    {
        "id": 3,
        "expiration": "2032-09-09T14:00:00Z",
        "total_number": "50.00",
        "per_customer": "1.00",
        "percentage": "33.00",
        "series": "Buy2Get1ForFree",
        "region": 1
    }
]
      
          
    ProductList:
      type: array
      items: 
          $ref: '#/components/schemas/Product'
      example: [
    {
        "id": 1,
        "images": [
            {
                "id": 129,
                "Product_id": 1,
                "primary": true,
                "photo": "uploads/temp_mhvKHBQ.jpeg"
            }
        ],
        "price": [
            {
                "Region": 1,
                "price": 12.0
            }
        ],
        "prices": 12.0,
        "cat_name": [
            "Love"
        ],
        "label": "Great Vancouver",
        "name": "Summer dream",
        "description": "Summer is the hottest of the four temperate seasons, occurring after spring and before autumn. At or centred on the summer solstice, daylight hours are longest and darkness hours are shortest, with day length decreasing as the season progresses after the solstice.",
        "instruction": "The earliest sunrises and latest sunsets also occur near the date of the solstice. The date of the beginning of summer varies according to climate, tradition, and culture.",
        "featured": true,
        "designByFR": false,
        "create": "2023-03-18T01:19:53.793064Z",
        "height": "3",
        "width": "4",
        "SKU": "FR-123321",
        "tag": [
            1
        ],
        "category": [
            3
        ]
    },
    {
        "id": 3,
        "images": [
            {
                "id": 11,
                "Product_id": 3,
                "primary": true,
                "photo": "uploads/Iris.JPG"
            },
            {
                "id": 49,
                "Product_id": 3,
                "primary": false,
                "photo": "uploads/temp_gQ8WY1c.jpeg"
            }
        ],
        "price": [
            {
                "Region": 1,
                "price": 1.34
            }
        ],
        "prices": 1.34,
        "cat_name": [],
        "label": "Great Vancouver",
        "name": "Iris",
        "description": "",
        "instruction": "As well as being the scientific name, iris is also widely used as a common name for all Iris species, as well as some belonging to other closely related genera.",
        "featured": false,
        "designByFR": false,
        "create": "2023-03-14T23:33:13.195585Z",
        "height": "12",
        "width": "6",
        "SKU": null,
        "tag": [],
        "category": []
    },
    {
        "id": 181,
        "images": [
            {
                "id": 128,
                "Product_id": 181,
                "primary": true,
                "photo": "uploads/temp_XfuOoff.jpeg"
            }
        ],
        "price": [
            {
                "Region": 9,
                "price": 12.0
            }
        ],
        "prices": 12.0,
        "cat_name": [
            "new date",
            "Thanks"
        ],
        "label": "York",
        "name": "test",
        "description": "sdc",
        "instruction": "fddf",
        "featured": true,
        "designByFR": false,
        "create": "2023-03-15T00:02:09.935047Z",
        "height": "14",
        "width": "14",
        "SKU": null,
        "tag": [
            1
        ],
        "category": [
            11,
            4
        ]
    },
    {
        "id": 182,
        "images": [],
        "price": [
            {
                "Region": 1,
                "price": 124.0
            }
        ],
        "prices": 124.0,
        "cat_name": [
            "Love"
        ],
        "label": "Great Vancouver",
        "name": "123",
        "description": "321",
        "instruction": "123",
        "featured": false,
        "designByFR": false,
        "create": "2023-03-18T00:13:22.812070Z",
        "height": null,
        "width": null,
        "SKU": null,
        "tag": [],
        "category": [
            3
        ]
    },
    {
        "id": 2,
        "images": [
            {
                "id": 6,
                "Product_id": 2,
                "primary": true,
                "photo": "uploads/photo-1599421498111-ad70bebb536f.jfif"
            },
            {
                "id": 59,
                "Product_id": 2,
                "primary": false,
                "photo": "uploads/temp.png"
            }
        ],
        "price": [
            {
                "Region": 1,
                "price": 123.23
            }
        ],
        "prices": 123.23,
        "cat_name": [
            "new date",
            "Thanks"
        ],
        "label": "Great Vancouver",
        "name": "Rose",
        "description": "A rose is either a woody",
        "instruction": "There are over three hundred species and tens of thousands of cultivars.",
        "featured": true,
        "designByFR": false,
        "create": "2023-03-18T01:18:12.401280Z",
        "height": "",
        "width": "121",
        "SKU": null,
        "tag": [
            2
        ],
        "category": [
            11,
            4
        ]
    },
    {
        "id": 128,
        "images": [
            {
                "id": 28,
                "Product_id": 128,
                "primary": true,
                "photo": "uploads/temp_D9rOmQX.jpeg"
            },
            {
                "id": 29,
                "Product_id": 128,
                "primary": false,
                "photo": "uploads/temp_IxRvV87.jpeg"
            },
            {
                "id": 54,
                "Product_id": 128,
                "primary": false,
                "photo": "uploads/temp_myM0NDG.jpeg"
            }
        ],
        "price": [
            {
                "Region": 1,
                "price": 14.12
            }
        ],
        "prices": 14.12,
        "cat_name": [],
        "label": "Great Vancouver",
        "name": "Bellisaaa",
        "description": "Bellis perennis (/ˈbɛləs pəˈrɛnəs/), Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres",
        "instruction": "Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres Bellis perennis is a perennial herbaceous plant growing to 20 centimetres",
        "featured": true,
        "designByFR": false,
        "create": "2023-03-14T23:46:33.493670Z",
        "height": "12",
        "width": "12",
        "SKU": null,
        "tag": [],
        "category": []
    }
]
        
        
        
    Product:
      type: object
      required: [name]
      properties:
        name:
          type: string
          example: Tulip
        instruction:
          type: string
          example: There are about 75 species, and these are divided among four subgenera. 
        description:
          type: string
          example: Tulips (Tulipa) are a genus of spring-blooming perennial herbaceous bulbiferous geophytes (having bulbs as storage organs). 
        tag:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: ["2","3"]
        category:
          type: array
          items: 
            $ref: '#/components/schemas/CategoryId'
          example: ["2"]
        feature:
          type: boolean
          example: true
    
    TagList:
      type: array
      items: 
          $ref: '#/components/schemas/Tag'
      example:
          [{"id":1,"name":"Alstroemeria"},{"id":3,"name":"Chrysanthemums"},{"id":4,"name":"Daisies"},{"id":5,"name":"Gerbera Daisies"},{"id":6,"name":"Lilies"},{"id":7,"name":"Roses"}]
    
    image:
      type: object
      properties:
        photo:
          type: string
          
    Product_return_create:
      type: object
      properties:
        id:
          type: string
          example: 1
        
        images:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: []
        price:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: []
        name:
          type: string
          example: Tulip
        
        instruction:
          type: string
          example: There are about 75 species, and these are divided among four subgenera. 
        description:
          type: string
          example: Tulips (Tulipa) are a genus of spring-blooming perennial herbaceous bulbiferous geophytes (having bulbs as storage organs). 
        tag:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: ["2","3"]
        category:
          type: array
          items: 
            $ref: '#/components/schemas/CategoryId'
          example: ["2"]
        feature:
          type: boolean
          example: true
        create:
          type: string
          example: "2023-01-26T18:45:29.361000Z"
          
          
    Product_return:
      type: object
      properties:
        id:
          type: string
          example: 1
        
        images:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: [
        {
            "id": 1,
            "Product_id": 1,
            "primary": true,
            "photo": "uploads/tulips-1.JPG"
        },
        {
            "id": 3,
            "Product_id": 1,
            "primary": false,
            "photo": "uploads/tulips-3.jpg"
        },
        {
            "id": 5,
            "Product_id": 1,
            "primary": false,
            "photo": "uploads/tulips-2_EadXcsU.jpg"
        }
    ]
        price:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: [
        {
            "Region": 1,
            "price": 11.0
        }
    ]
        name:
          type: string
          example: Tulip
        
        instruction:
          type: string
          example: There are about 75 species, and these are divided among four subgenera. 
        description:
          type: string
          example: Tulips (Tulipa) are a genus of spring-blooming perennial herbaceous bulbiferous geophytes (having bulbs as storage organs). 
        tag:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: ["2","3"]
        category:
          type: array
          items: 
            $ref: '#/components/schemas/CategoryId'
          example: ["2"]
        feature:
          type: boolean
          example: true
        create:
          type: string
          example: "2023-01-26T18:45:29.361000Z"
    
    Product_filter_return:
      type: object
      example:
          {
    "0": {
        "id": 1,
        "images": [
            {
                "id": 1,
                "Product_id": 1,
                "primary": true,
                "photo": "uploads/tulips-1.JPG"
            },
            {
                "id": 3,
                "Product_id": 1,
                "primary": false,
                "photo": "uploads/tulips-3.jpg"
            },
            {
                "id": 5,
                "Product_id": 1,
                "primary": false,
                "photo": "uploads/tulips-2_EadXcsU.jpg"
            }
        ],
        "price": [
            {
                "Region": 1,
                "price": 11.0
            }
        ],
        "name": "Tulip",
        "description": "Tulips (Tulipa) are a genus of spring-blooming perennial herbaceous bulbiferous geophytes (having bulbs as storage organs). The flowers are usually large, showy and brightly coloured, generally red, pink, yellow, or white (usually in warm colours).",
        "instruction": "There are about 75 species, and these are divided among four subgenera. The name \"tulip\" is thought to be derived from a Persian word for turban, which it may have been thought to resemble by those who discovered it. Tulips originally were found in a band stretching from Southern Europe to Central Asia, but since the seventeenth century have become widely naturalised and cultivated (see map).",
        "featured": true,
        "create": "2023-01-26T18:45:29.361000Z",
        "tag": [
            3
        ],
        "category": [
            5
        ]
    }
}
    
    RegionList:
      type: array
      items: 
          $ref: '#/components/schemas/Region'
      example: [
    {
        "id": 3,
        "label": "North Alberta",
        "name": "North Alberta",
        "state": "Alberta",
        "city": "Edmonton",
        "photo": null,
        "country": 1,
        "product": []
    },
    {
        "id": 1,
        "label": "Greater Vancouver",
        "name": "Greater Vancouver",
        "state": "British Columbia",
        "city": "Langley",
        "photo": null,
        "country": 1,
        "product": [
            3,
            7,
            2,
            8,
            4,
            1,
            5
        ]
    },
    {
        "id": 4,
        "label": "King County",
        "name": "King County",
        "state": "Washington",
        "city": "Seattle",
        "photo": null,
        "country": 2,
        "product": []
    }
]
    
    NationList:
      type: array
      items: 
          $ref: '#/components/schemas/Nation'
      example: [
    {
        "id": 13,
        "label": "test",
        "regions": [],
        "name": "test",
        "iso": "123",
        "symbol": "3",
        "photo": null
    },
    {
        "id": 1,
        "label": "Canada",
        "regions": [
            1
        ],
        "name": "Canada",
        "iso": "CAD",
        "symbol": "C$",
        "photo": "http://localhost:8000/media/uploads/temp_WyIROTV.jpeg"
    },
    {
        "id": 8,
        "label": "US",
        "regions": [],
        "name": "US",
        "iso": "usd",
        "symbol": "$",
        "photo": "http://localhost:8000/media/uploads/temp_DJyvO1C.jpeg"
    },
    {
        "id": 6,
        "label": "UK",
        "regions": [
            9
        ],
        "name": "UK",
        "iso": "pound sterling",
        "symbol": "£GBP",
        "photo": "http://localhost:8000/media/uploads/temp_fayf6iW.jpeg"
    },
    {
        "id": 5,
        "label": "Mexico",
        "regions": [],
        "name": "Mexico",
        "iso": "Mexico Peso",
        "symbol": "Mex$",
        "photo": "http://localhost:8000/media/uploads/temp_b9y9OvC.jpeg"
    }
]
        
    cartBody:
      type: object
      properties:
          product:
            type: string
            example: 7
          number:
            type: string
            example: 1
          message:
            type: string
            example: This will be delivered to .....
            
    cartBodyDel:
      type: object
      properties:
          product:
            type: string
            example: 7
        
    ProductInfo:
      type: object
      properties:
        id:
          type: string
          example: 1
        
        images:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: [
        {
            "id": 1,
            "Product_id": 1,
            "primary": true,
            "photo": "uploads/tulips-1.JPG"
        },
        {
            "id": 3,
            "Product_id": 1,
            "primary": false,
            "photo": "uploads/tulips-3.jpg"
        },
        {
            "id": 5,
            "Product_id": 1,
            "primary": false,
            "photo": "uploads/tulips-2_EadXcsU.jpg"
        }
    ]
        price:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: [
        {
            "Region": 1,
            "price": 11.0
        }
    ]
        name:
          type: string
          example: Tulip
        
        instruction:
          type: string
          example: There are about 75 species, and these are divided among four subgenera. 
        description:
          type: string
          example: Tulips (Tulipa) are a genus of spring-blooming perennial herbaceous bulbiferous geophytes (having bulbs as storage organs). 
        tag:
          type: array
          items: 
            $ref: '#/components/schemas/TagId'
          example: ["2","3"]
        category:
          type: array
          items: 
            $ref: '#/components/schemas/CategoryId'
          example: ["2"]
        feature:
          type: boolean
          example: true
        create:
          type: string
          example: "2023-01-26T18:45:29.361000Z"
        SKU:
          type: string
          example: "FR-123321"
        height:
          type: string
          example: "3"
        width:
          type: string
          example: "4"
        designByFR:
          type: boolean
          example: false
        
    
    
    updateCustomer:
      type: object
      properties:
        phone:
          type: string
          example: 1233211234
        avatar:
          type: string
        address:
          type: string
          example: 106street langley BC
        region:
          type: string
          example: 1
        email:
          type: string
          example: "123@gmail.com"
        

      xml:
        name: order
        
    TagId:
      type: object
      properties:
        id:
          type: string
          example: 1
      xml:
        name: tag
        
    CategoryId:
      type: object
      properties:
        id:
          type: string
          example: 1
      xml:
        name: category
        
    ProductId:
      type: object
      properties:
        id:
          type: string
          example: 1
      xml:
        name: product
    
    password:
      type: object
      properties:
        email:
          type: string
          example: fzhang@linkpoint.ca
      xml:
        name: address
        
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://example.com/oauth/authorize
          tokenUrl: https://example.com/oauth/token
          scopes:
            customer: Grants customer access
            stuff: Grants stuff access
            vendor: Grants vendor access
            admin: Grants access to admin operations