fluminus_bot v0.1.0 FluminusBot.Accounts View Source

Accounts context contains domain logic for User management.

Link to this section Summary

Link to this section Functions

Link to this function

delete_user_by_chat_id(chat_id) View Source
delete_user_by_chat_id(integer()) :: :ok | :error

Link to this function

disable_push_for_chat_id(chat_id) View Source

Link to this function

get_all_chat_ids() View Source
get_all_chat_ids() :: [integer()]

Link to this function

get_all_module_luminus_ids() View Source
get_all_module_luminus_ids() :: [String.t()]

Link to this function

get_all_modules() View Source
get_all_modules() :: [
  %FluminusBot.Accounts.Module{
    __meta__: term(),
    code: term(),
    id: term(),
    inserted_at: term(),
    last_announcement_check: term(),
    luminus_id: term(),
    name: term(),
    term: term(),
    updated_at: term(),
    users: term()
  }
]

Link to this function

get_all_users() View Source
get_all_users() :: [
  %FluminusBot.Accounts.User{
    __meta__: term(),
    chat_id: term(),
    first_name: term(),
    id: term(),
    inserted_at: term(),
    jwt: term(),
    last_name: term(),
    modules: term(),
    push_enabled: term(),
    refresh_token: term(),
    updated_at: term(),
    username: term()
  }
]

Link to this function

get_module_by_luminus_id_preload_subscribers(luminus_id) View Source

Link to this function

get_user_by_chat_id(chat_id) View Source
get_user_by_chat_id(integer()) ::
  %FluminusBot.Accounts.User{
    __meta__: term(),
    chat_id: term(),
    first_name: term(),
    id: term(),
    inserted_at: term(),
    jwt: term(),
    last_name: term(),
    modules: term(),
    push_enabled: term(),
    refresh_token: term(),
    updated_at: term(),
    username: term()
  }
  | nil

Link to this function

insert_or_update_module(attrs) View Source

Link to this function

insert_or_update_modules(modules) View Source

Link to this function

insert_or_update_user(attrs) View Source
insert_or_update_user(map()) ::
  {:ok,
   %FluminusBot.Accounts.User{
     __meta__: term(),
     chat_id: term(),
     first_name: term(),
     id: term(),
     inserted_at: term(),
     jwt: term(),
     last_name: term(),
     modules: term(),
     push_enabled: term(),
     refresh_token: term(),
     updated_at: term(),
     username: term()
   }}
  | {:error, Ecto.Changeset.t()}

Link to this function

insert_or_update_user_module_changeset(user, module) View Source

Link to this function

insert_or_update_user_modules(user, modules) View Source

Link to this function

user_push_enabled_count() View Source