Giter VIP home page Giter VIP logo

letsrock-backend's People

Watchers

 avatar  avatar  avatar

letsrock-backend's Issues

Отображение списка реп. баз

Запуск до первой репетиции

Запрашиваются реп. базы в городе пользователя.
Ранжирование происходит в следующем порядке:

  • по рейтингу;
  • по расстоянию.

Сначала показываются репбазы с рейтингом 5, и они уже ранижруются по расстоянию от пользователя (сначала наиболее близкие к пользователю).
Аналогично отображаются репбазы с рейтингом 4.
Если у репбазы рейтинг меньше 4 или отсутствует, то рейтинг не учитывается, и отображаются по расстоянию от пользователя.

Запрос:

{
    "uuid": 1011299,
    "repetition_base": true,
    "drum_room": false,
    "studio": false, 
    "position": {
        "latitude": 55.751244, 
        "longitude": 37.618423
    }    
}

Ответ:

{
  "organizations": [
    {
      "uuid": 1356,
      "name": "Old Age",
      "rate": 5,
      "distance": 14.7,
      "images": [        
          "binary",
          "binary",
          "binary",
          "binary"        
      ],
      "position": {
        "latitude": 55.124,
        "longitude": 37.124124
      }
    },
    {
      "uuid": 1357,
      "name": "Hendrix Studio",
      "rate": 5,
      "distance": 17.2,
      "images": [
        [
          "binary",
          "binary",
          "binary",
          "binary"
        ]
      ],
      "position": {
        "latitude": 55.14,
        "longitude": 37.4
      }
    },
    {
      "uuid": 1358,
      "name": "Rock Base",
      "rate": 4,
      "distance": 13.1,
      "images": [
        [
          "binary",
          "binary",
          "binary",
          "binary"
        ]
      ],
      "position": {
        "latitude": 55.214,
        "longitude": 37.014
      }
    },
    {
      
    }
  ]
}

Запуск после первой репетиции

Если на сервере есть информация о том, что пользователь уже репетировал, то в вершине списка будет последняя репетиционная база в которой пользователь был:

{
  "organizations": [
    {
      "uuid": 2416,
      "name": "Orange Station",
      "rate": 5,
      "distance": 17.7,
      "images": [
        "binary",
        "binary",
        "binary",
        "binary"
      ],
      "position": {
        "latitude": 55.11224,
        "longitude": 37.4124
      }
    },
    {
      "uuid": 1356,
      "name": "Old Age",
      "rate": 5,
      "distance": 14.7,
      "images": [        
          "binary",
          "binary",
          "binary",
          "binary"
        
      ],
      "position": {
        "latitude": 55.124,
        "longitude": 37.124124
      }
    },
    {
      "uuid": 1357,
      "name": "Hendrix Studio",
      "rate": 5,
      "distance": 17.2,
      "images": [        
          "binary",
          "binary",
          "binary",
          "binary"        
      ],
      "position": {
        "latitude": 55.14,
        "longitude": 37.4
      }
    },
    {
      "uuid": 1358,
      "name": "Rock Base",
      "rate": 4,
      "distance": 13.1,
      "images": [        
          "binary",
          "binary",
          "binary",
          "binary"        
      ],
      "position": {
        "latitude": 55.214,
        "longitude": 37.014
      }
    },
    {
      
    }
  ]
}

Добавление комнат

Запрос:

{
    "name": "Old Age",
    "rooms":
    [
    {
      "name": "Маленькая 1",
      "services": [1],
      "square": 12,
      "photos":
      [
        "binary", "binary", "binary"  
      ],
      "equipment":
      [
        
      ]
    },
    {
      "name": "Маленькая 2",
      "services": [1],
      "square": 13,
      "photos":
      [
        "binary", "binary", "binary", "binary"  
      ],
      "equipment":
      [
        
      ]
    },
    {
      "name": "Большая 1",
      "services": [1, 10],
      "square": 18,
      "photos":
      [
        "binary", "binary", "binary", "binary"  
      ],
      "equipment":
      [
        
      ]
    },
    {
      "name": "Большая 2",
      "services": [1, 10, 5],
      "square": 20,
      "photos":
      [
        "binary", "binary", "binary", "binary",  "binary"
      ],
      "equipment":
      [
        
      ]
    }
    ]
}

Добавление помещения

Юридическая информация об организации, должна быть в соответствии с местным законодательством.

Поля запроса для каждой страны / штата будут отличаться.
Для каждой страны должен быть создана таблица, поля которой представляют юридически значимую информацию. Применяется наследование таблиц от базовой Country.

Алгоритм:

  1. Определение страны - поле "country" в запросе;
  2. Подгружаем поля "owner" для страны (из словаря (если есть))
  3. Поле "owner" парсится и записывается в соответствующую таблицу для страны.

Ниже приведён запрос для России:

{
    "uuid":11235,
    "name": "Old Age",
    "building":
    {
      "address":
      {
      "country": "Russia",
      "region": "Moscow",
      "city": "Moscow",
      "street": "Kransoproletarskaya",
      "building": 5
      },
      "rooms_count": 4,
      "services": [1, 10, 5]
    },
    "owner":
    {
      "taxpayer_identification_number": 771717,
      "organizational_legal_form": "Limited Liability Company (LLC)",
      "name": "Centralniy Zhil-Stroy",
      "person":
      [
      {
        "name": "Mikhail",
        "lastname": "Suvorov",
        "passport_id": 4808654277
      }
      ]
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.