UserCreateController class

Введение

  1. Описание: Контроллер UserCreateController отвечает за нового юзера в hasura и firebase.
  2. Маршруты: Обрабатываются POST-запрос по маршруту /user/create.

Формат запроса

Тело запроса: JSON-объект, содержащий идентификатор пользователя.

{
  "input": {
    "user": {
      "name": "Mikhail",
      "email": "first@gmail.com",
      "roles": ["driver"],
      "departamentId": 1,
      "metadata": {
        "ce": "string?",
        "dni": "string?",
        "fullname": "string?",
        "ptp": "string?"
      }
    }
  }
}

Валидация и преобразование данных

Основная логика

  1. Создаём юзера в Hasura.
  2. Добавляет metadata юзеру в Hasura.
  3. Создаёт юзера в Firebase.

Взаимодействие с микросервисами

  1. Hasura: создание юзера и добавление metadata.
  2. Firebase: создание юзера в firebase.

Ответы сервера

  1. Успешное создание юзера: Ожидаемый статус - 200 OK.
  2. Ошибка создания: Ожидаемый статус - 400 badRequest.
Inheritance

Constructors

UserCreateController()

Properties

endpoint ↔ String
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
request ↔ Request
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
userRepository → UserRepository
final

Methods

call(Request request) → FutureOr<Response>
inherited
handler() → FutureOr<Response>
Must be implemented
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestAsJson() → Future
Reads request value and parse as json
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited