openapi: 3.0.3
info:
  title: Swagger Explo - OpenAPI 3.0
  description: |-
  termsOfService: http://swagger.io/terms/
  contact:
    email: apiteam@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.12
externalDocs:
  description: Find out more about Swagger
  url: http://swagger.io
servers:
  - url: http://app.vizcab.io
tags:
  - name: explorations
    description: Everything about your explorations
    externalDocs:
      description: Find out more
      url: http://app.vizcab.io
paths:
    /explorations:
      post:
        requestBody:
          required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
        responses:
          '200':
            description: OK
components:
  schemas:
    Project:
      type: object
      properties:
        name:
          type: string
          example: "my new explo project"
        description:
          type: string
          example: "This is my new explo project."
        data:
          $ref: '#/components/schemas/ProjectData'
        buildings: 
          type: array
          description: List of buildings of the project
          items:
            $ref: '#/components/schemas/Building'
    ProjectData:
      type: object
      properties:
        altitude:
          type: integer
          example: 100
          description: altitude of the project, in meter
        departement:
          type: string
          example: "69"
          description: French department number
        localisation:
          type: number
          example: "1"
          enum : [1,2,3]
          description: "1 : campagne, 2 : ville, 3: centre ville"
        surfaceParcelle:
          type: integer
          description: meter
          example: 1000
    Building :
      type: object
      properties:
        name:
          type: string
          example: "Batiment A"
        indexBatiment:
         type: integer
         description: Unique identifier of the building, starts at 0
         example: 0
        variants: 
          type: array
          description: List of variants
          items:
            $ref: '#/components/schemas/Variant'
    Variant :
      type: object
      properties:
        indexVariant:
          type: integer
          description: Unique identifier of the variant, starts at 0
        name:
          type: string  
          example: "Variant Concrete"
          description: Name of the variant
        isReferent:
          type: boolean
        data: 
            $ref: '#/components/schemas/VariantData'
        quantities :
            $ref: '#/components/schemas/BuildingQuantities'
        zones:
          type: array
          description: List of  zones of the building for this variant
          items:
            $ref: '#/components/schemas/Zone'
    VariantData :
      type: object
      properties: 
        nbPark:
           $ref: '#/components/schemas/Parking'
        typeToiture:
          type: integer
          enum: [1, 2,3, 4]
          description: "0 :Terrasse ,1 :Monopente, 2; 2 pans,  3: 3 pans, 4:4 pans"
        performanceThermique: 
          type: integer
          enum: [1, 2,3]
          description: "1: Faible (RT2012), 2: Bonne, 3 : Elevée (Bepos - E2/E+C-)"
        utilisationReseauChaud:
          type: boolean
        utilisationReseauFroid:
          type: boolean
        structurePrincipaleBatiment:
          type: string 
          example: null
    BuildingQuantities:
      type: object
      properties: 
        emprise:
          type: number
        surfaceRefBat:
          type: number
        perimetre:
          type: number
        surfaceParkExt:
          type: number
        hauteurBatiment:
          type: number
        surfaceParkInfra:
          type: number
        surfaceParkSuper:
          type: number
        surfacePark:
          type: number
        nbEtagesBatiment:
          type: number
        surfacePorteEntree:
          type: number
        surfaceParkExtCouv:
          type: number
        nbNiveauxSsol:
          type: number
        surfaceParkExtNoncouv:
          type: number
        longueurRaccordVoirie:
          type: number
    Zone:
      type: object
      properties: 
        name:
          type: string
          example: my zone
        indexZone:
          type: integer
        data: 
          $ref: '#/components/schemas/ZoneData'
        quantities: 
          $ref: '#/components/schemas/ZoneQuantities'
    ZoneQuantities:
      type: object
      properties: 
        nbOcc: 
          type: number
        nbCages: 
          type: number
        surfaceRefZone: 
          type: number
        empriseZone: 
          type: number
        hauteurZone: 
          type: number
        nbEscaliers: 
          type: number
        perimetreZone: 
          type: number
        surfaceFacade: 
          type: number
        surfaceBalcons: 
          type: number
        surfaceHumides: 
          type: number
        surfaceRefends: 
          type: number
        surfaceToiture: 
          type: number
        surfaceCloisons: 
          type: number
        gardeCorpsBalcons: 
          type: number
        longueurGardeCorps: 
          type: number
        surfaceParoisOpaques: 
          type: number
        surfaceParoisVitrees: 
          type: number
        surfaceMenuiseriesInt: 
          type: number
        surfaceMenuiserieCirculation: 
          type: number
        surfacePlancherIntermediaire: 
          type: number
        surfacePlancherOS:
           type: number
           description : "For offices only, open space"
        surfacePlancherIndiv:
          type: number
          description : "For offices only"
        categorieContraintesExterieures: 
          type: string
          enum: ["CE1"]
    ZoneData: 
      type: object
      properties:
        usage:
          type: integer
          enum: [1,2,3]
          description : "2: Logement collectif, 3: Bureaux, 21: Logement étudiant"
        hauteurEtage:
          type: number
        nbEtages:
          type: integer
        typologie:
          type: integer
        typeFacade:
          type: integer
          enum: [0,1]
          description: " // 0 = façade pleine, 1 = murs rideaux"
        hasBalconies:
          type: boolean
        typeToiture :
          type: integer
          enum: [0,1,2,3,4]
          description: "0 :Terrasse ,1 :Monopente, 2; 2 pans,  3: 3 pans, 4:4 pans"
        typeVolumetrie: 
          type: string
          enum: ["Rectangle", "J1", "J2", "H","L", "U", "Z1","Z2", "T" ]
        hasCogeneration: 
          type: boolean
        surfaceRefSimplified : 
          type: integer
        hasPhotovoltaique:
          type: boolean
        hasRefroidissement:
          type: boolean
        isVolumetrieCompact:
         type: boolean
        hasProductionEnergie:
          type: boolean
        isVolumetrieDetailed:
          type: boolean
        isHauteurEtageEqualOnAllFloor:
          type: boolean
        isNombreLogementsEqualOnAllFloor:
          type: boolean
        volumetryTable : 
          type : array
          items :
            $ref: '#/components/schemas/TableVolumetrieItem'
        unitsFloorDistribution: 
          type : array
          description: "Distribution of flat types per floor"
          items :
            $ref: '#/components/schemas/UnitsFloorDistributionItem'
    TableVolumetrieItem:
      type: object
      properties: 
        id:
          type: number
          description: "associated to the segment of the volumetry decided"
        longueur:
          type: number
        tauxOuverture:
          type: number
          description : "between 0 and 100"
    UnitsFloorDistributionItem:
      type: object
      properties: 
        level: 
          type: number
          description: "Floor level"
        nbT1: 
          type: number
          description: "Number of T1"
        nbT2: 
          type: number
          description: "Number of T2"
        nbT3: 
          type: number
          description: "Number of T3"
        nbT4: 
          type: number
          description: "Number of T4"
        nbT5: 
          type: number
          description: "Number of T5"
      
    Parking:
      type: object
      properties: 
        nbParkInfra:
          type: number
        nbParkSupra:
          type: number
        nbParkExtCouv:
          type: number
        nbParkExtNoncouv:
          type: number