Last active
January 30, 2025 13:22
-
-
Save gildemberg-santos/7f664adb6410b459d1cee16ad61a1475 to your computer and use it in GitHub Desktop.
Installation of the Development Environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Baixa as credenciais | |
# https://drive.google.com/file/d/1eWStF_SlhyRE-Bcsg-a2d8yF3DyO9ONx/view | |
cp -vn docker/env.local.example docker/env.local | |
docker compose build | |
docker compose run --rm app bundle install | |
docker compose run --rm app yarn install --check-files | |
docker compose run --rm -e EDITOR=nano app bundle exec rails credentials:edit | |
docker compose run --rm app bundle exec rails db:migrate | |
docker compose run --rm app bundle exec rake data:migrate | |
docker compose run --rm app bundle exec rake clickhouse:create_structure | |
docker compose up -d --remove-orphans |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
app: | |
build: | |
context: . | |
dockerfile: ./docker/app/Dockerfile | |
env_file: .env.local | |
stdin_open: true | |
tty: true | |
ports: | |
- "3000:3000" | |
volumes: | |
- .:/app | |
- leadster-upgrade-app-gem-cache:/usr/local/bundle | |
depends_on: | |
- postgres | |
- clickhouse | |
- redis | |
worker: | |
build: | |
context: . | |
dockerfile: ./docker/app/Dockerfile | |
command: "bundle exec sidekiq" | |
env_file: .env.local | |
stdin_open: true | |
tty: true | |
volumes: | |
- .:/app | |
- leadster-upgrade-app-gem-cache:/usr/local/bundle | |
postgres: | |
build: | |
context: ./docker/postgres/ | |
dockerfile: Dockerfile | |
volumes: | |
- leadster-upgrade-postgres-data:/var/lib/postgresql/data | |
ports: | |
- "5432:5432" | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=leadsterpass | |
- POSTGRES_MULTIPLE_DATABASES=leadster,leadster_test | |
redis: | |
image: redis:6.2.5 | |
command: --appendonly no | |
ports: | |
- "6379:6379" | |
clickhouse: | |
image: clickhouse:lts | |
environment: | |
- CLICKHOUSE_USER=leadster | |
- CLICKHOUSE_PASSWORD=leadsterpass | |
ports: | |
- 8123:8123 | |
- 9000:9000 | |
volumes: | |
- leadster-upgrade-clickhouse-data:/var/lib/clickhouse | |
mailhog: | |
image: mailhog/mailhog:latest | |
ports: | |
- "1025:1025" # Port 1025 => SMTP. | |
- "8025:8025" # Port 8025 => Web dashboard (http://127.0.0.1:8025). | |
volumes: | |
leadster-upgrade-postgres-data: | |
leadster-upgrade-clickhouse-data: | |
leadster-upgrade-app-gem-cache: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.6.10 | |
ARG UNAME=leadster | |
ARG UID=1000 | |
ARG GID=1000 | |
ARG USE_CHROME=false | |
# Environment Variables | |
ENV LANG C.UTF-8 | |
ENV BUNDLER_VERSION 2.2.17 | |
ENV BUNDLER_LOCAL_PATH /usr/local/bundle | |
ENV RAILS_ENV development | |
ENV CHROMIUM_DRIVER_VERSION 114.0.5735.16 | |
ENV CHROME_VERSION 114.0.5735.198-1 | |
ENV NVM_DIR /usr/local/nvm | |
ENV NODE_VERSION 14.21.2 | |
ENV NVM_VERSION 0.39.3 | |
ENV NODE_PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/lib/node_modules | |
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin:$PATH | |
# System Dependencies | |
# RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | |
# && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
postgresql-client \ | |
libpq-dev \ | |
cmake \ | |
python \ | |
python3 \ | |
vim \ | |
nano \ | |
&& apt-get clean && rm -rf /tmp/* /var/tmp/* | |
# Install Chrome driver if is not MAC | |
# RUN if [ "$USE_CHROME" = true ]; then \ | |
# wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb \ | |
# && apt install -y /tmp/chrome.deb \ | |
# && rm /tmp/chrome.deb \ | |
# && wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/${CHROMIUM_DRIVER_VERSION}/chromedriver_linux64.zip \ | |
# && unzip /tmp/chromedriver.zip chromedriver -d /usr/bin/ \ | |
# && rm /tmp/chromedriver.zip \ | |
# && chmod ugo+rx /usr/bin/chromedriver \ | |
# && apt-mark hold google-chrome-stable \ | |
# ; fi | |
# NVM - Node & Yarn | |
SHELL ["/bin/bash", "-c"] | |
RUN mkdir -p ${NVM_DIR} \ | |
&& curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash \ | |
&& source ${NVM_DIR}/nvm.sh \ | |
&& nvm alias default ${NODE_VERSION} \ | |
&& npm install -g yarn | |
# Application Directory | |
WORKDIR /app | |
# Initialize application | |
COPY ./docker/app/entrypoint.sh /usr/bin/ | |
RUN chmod +x /usr/bin/entrypoint.sh | |
ENTRYPOINT ["entrypoint.sh"] | |
# Group and User | |
RUN groupadd -g $GID -o $UNAME | |
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME | |
USER $UNAME | |
# System Gems and Bundle Application | |
COPY --chown=$UNAME:$UNAME ./Gemfile* ./ | |
RUN gem install bundler -v $BUNDLER_VERSION | |
RUN bundle config set --local path $BUNDLER_LOCAL_PATH | |
RUN bundle install | |
# Application Startup | |
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch ~/.gitignore | |
git config --global core.excludesFile '~/.gitignore' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt install build-essential checkinstall zlib1g-dev libreadline-dev -y | |
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.12.0 | |
. "$HOME/.asdf/asdf.sh" | |
# append completions to fpath | |
fpath=(${ASDF_DIR}/completions $fpath) | |
# initialise completions with ZSH's compinit | |
autoload -Uz compinit && compinit | |
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git | |
asdf install nodejs latest | |
asdf global nodejs latest | |
node --version | |
asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git | |
asdf install ruby 2.6.10 | |
asdf global ruby 2.6.10 | |
ruby --version | |
asdf plugin add golang https://github.com/asdf-community/asdf-golang.git | |
asdf install golang 1.22.1 | |
asdf global golang 1.22.1 | |
go version | |
asdf plugin add python https://github.com/asdf-community/asdf-python.git | |
asdf install python 3.10 | |
asdf global python 3.10 | |
python --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Add Docker's official GPG key: | |
sudo apt-get update | |
sudo apt-get install ca-certificates curl gnupg | |
sudo install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
sudo chmod a+r /etc/apt/keyrings/docker.gpg | |
# Add the repository to Apt sources: | |
echo \ | |
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt-get update | |
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
sudo groupadd docker | |
sudo usermod -aG docker $USER | |
newgrp docker | |
# pagina atualizada | |
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo curl -L "https://github.com/docker/compose/releases/download/2.17.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose | |
docker-compose --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt update | |
sudo apt -y install git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -fsSL https://go.dev/dl/go1.21.4.linux-amd64.tar.gz | |
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.21.4.linux-amd64.tar.gz | |
export PATH=$PATH:/usr/local/go/bin | |
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile | |
go version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt update | |
sudo apt -y install make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt update | |
sudo apt -y install postgresql | |
sudo apt -y install postgresql-contrib | |
/etc/init.d/postgresql stop | |
systemctl disable postgresql | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt install git curl autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev | |
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc | |
echo 'eval "$(rbenv init -)"' >> ~/.zshrc | |
source ~/.zshrc | |
rbenv -v | |
rbenv install -l | |
rbenv install 3.0.2 | |
rbenv install 2.5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
gpg --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | |
\curl -sSL https://get.rvm.io | bash -s stable --rails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt update | |
sudo apt -y install zsh | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# EXPANDIR COMANDO DA ALIAS [Esc + ctrl + e] | |
expand-aliases() { | |
unset 'functions[_expand-aliases]' | |
functions[_expand-aliases]=$BUFFER | |
(($+functions[_expand-aliases])) && | |
BUFFER=${functions[_expand-aliases]#$'\t'} && | |
CURSOR=$#BUFFER | |
} | |
zle -N expand-aliases | |
bindkey '\e^E' expand-aliases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ssh-keygen -t ed25519 -C "[email protected]" | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_ed25519 | |
cat ~/.ssh/id_ed25519.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get current folder name for volumes docker | |
CURRENT_FOLDER_NAME = $(shell basename $(CURDIR)) | |
DATE_SYSTEM = $(shell date | md5sum) | |
IS_MAC = false | |
## Build and start all initialize application components | |
setup: | |
# @cp -vn .env.local.example .env.local | |
@docker compose build --build-arg IS_MAC=$(IS_MAC) | |
@make bundle-install | |
@make assets-install | |
@make setup-database | |
@docker compose up -d --remove-orphans | |
@echo "App (Client): http://localhost:3000" | |
@echo "App (Admin): http://localhost:3000/admin" | |
@echo "Mailhog: http://localhost:8025" | |
## Initialize docker containers | |
start: | |
@make stop | |
@docker compose up -d --remove-orphans | |
## Stop docker containers | |
stop: | |
@docker compose stop | |
## Restart docker containers | |
restart: | |
@make stop | |
@make start | |
## Clear all application data and components | |
prune-app: | |
@docker compose run app yarn cache clean | |
@docker compose run app rm -rf node_modules | |
@docker compose down | |
@make prune-volumes | |
# Drop all volumes created | |
prune-volumes: | |
@docker volume rm $(CURRENT_FOLDER_NAME)_leadster-upgrade-postgres-data | |
@docker volume rm $(CURRENT_FOLDER_NAME)_leadster-upgrade-clickhouse-data | |
@docker volume rm $(CURRENT_FOLDER_NAME)_leadster-upgrade-app-gem-cache | |
## Setup Database | |
setup-database: | |
@make migrate | |
@make data-migrate | |
@docker compose run --rm app bundle exec rake clickhouse:create_structure | |
@docker compose run --rm app bundle exec rake clickhouse:create_structure RAILS_ENV=test | |
## DB Migrate | |
migrate: | |
@docker compose run --rm app bundle exec rails db:migrate | |
## DB Data Migrate | |
data-migrate: | |
@docker compose run --rm app bundle exec rake data:migrate | |
## Create ChangeLog | |
changelog: | |
@docker compose run --rm app bundle exec codelog new | |
## Run pronto checks | |
## Default target branch is "development" | |
## $ make pronto target=another_branch | |
pronto: | |
@if [ -z "$(target)" ]; then \ | |
docker compose run --rm app bundle exec pronto run -c origin/development; \ | |
else \ | |
docker compose run --rm app bundle exec pronto run -c origin/${target}; \ | |
fi | |
pronto-unstaged: | |
@if [ -z "$(target)" ]; then \ | |
docker compose run --rm app bundle exec pronto run --unstaged -c origin/development; \ | |
else \ | |
docker compose run --rm app bundle exec pronto run --unstaged -c origin/${target}; \ | |
fi | |
pronto-staged: | |
@if [ -z "$(target)" ]; then \ | |
docker compose run --rm app bundle exec pronto run --staged -c origin/development; \ | |
else \ | |
docker compose run --rm app bundle exec pronto run --staged -c origin/${target}; \ | |
fi | |
## Create a bump changelog | |
## $ make bump-changelog type=minor | |
## $ make bump-changelog type=patch | |
bump-changelog: | |
@docker compose run --rm app bundle exec codelog bump $(type) | |
## Install / Update frontend packages | |
assets-install: | |
@docker compose run --rm app yarn install --check-files | |
## Precompile assets with i18n | |
assets-precompile: | |
sed -i "2d" app/assets/javascripts/i18n.js.erb | |
sed -i "1 a $(DATE_SYSTEM)" app/assets/javascripts/i18n.js.erb | |
@docker compose run --rm app bundle exec rake assets:precompile | |
@docker compose run --rm app bundle exec rake assets:clean | |
## Precompile assets with i18n | |
mac-assets-precompile: | |
sed -i '' "2d" app/assets/javascripts/i18n.js.erb | |
echo "/*\n $$(md5 -q -s '') -" > temp.js.erb | |
tail -n +2 app/assets/javascripts/i18n.js.erb >> temp.js.erb | |
mv temp.js.erb app/assets/javascripts/i18n.js.erb | |
@docker compose run --rm app bundle exec rake assets:precompile | |
@docker compose run --rm app bundle exec rake assets:clean | |
## Generate Structure.sql | |
structure-sql: | |
rm -rf db/structure.sql | |
@docker compose run --rm -e PGPASSWORD=leadsterpass postgres dropdb leadster_test -h postgres -U postgres --force | |
@docker compose run --rm -e PGPASSWORD=leadsterpass postgres createdb leadster_test -h postgres -U postgres | |
@docker compose run --rm app bundle exec rails db:migrate RAILS_ENV=test | |
## Start react watcher | |
react-watcher: | |
@docker compose exec app ./bin/webpack-dev-server --watch --colors --progress | |
## Start bash in app container | |
console: | |
@docker compose run --rm -it app /bin/bash | |
## Start rails console | |
rails-console: | |
@docker compose run --rm app bundle exec rails c | |
## Run Rspec without Capybara events | |
rspec-fast: | |
@docker compose run --rm app bundle exec rspec ${path} --color --tag ~@feature --tag ~@js | |
rspec-watcher: | |
@docker compose exec app bundle exec guard | |
bundle-install: | |
@docker compose run --rm app bundle install | |
## Clear cache, packs and restart | |
clear-cache: | |
@rm -rf tmp/cache | |
@rm -rf public/packs | |
@make restart | |
## Down Containers | |
down: | |
@docker compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# frozen_string_literal: true | |
# This file should contain all the record creation needed to seed the database with its default values. | |
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). | |
# | |
# Examples: | |
# | |
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) | |
# Character.create(name: 'Luke', movie: movies.first) | |
# Clean database | |
DatabaseCleaner.clean_with(:deletion, { except: %w[data_migrations] }) | |
Administrator.create( | |
id: 1, | |
first_name: "Dev", | |
last_name: "Leadster", | |
email: "[email protected]", | |
password: "123456", | |
impersonate_allowed: true, | |
) | |
IntegrationBlueprint.create( | |
id: 5, | |
name: "email", | |
friendly_name: "E-mail", | |
worker_class_name: "EmailIntegrationWorker", | |
description_html: %{ | |
<ul class="list-unstyled leading-loose"> | |
<li>Envie os leads recebidos para um e-mail da sua escolha.</li> | |
<li></li> | |
</ul> | |
}, | |
image_url: "https://cdn.leadster.com.br/dashboard/integrations/email.png", | |
has_dynamic_schema: false, | |
schema: { | |
title: "E-mail", | |
description: "Seus leads serão enviados para o e-mail de sua escolha", | |
type: "object", | |
required: ["subject"], | |
properties: { | |
to: { | |
type: "string", | |
format: "email", | |
title: "Endereço para Entrega", | |
}, | |
subject: { | |
type: "string", | |
title: "Título do E-mail", | |
}, | |
}, | |
}, | |
ui_schema: {} | |
) | |
Company.create( | |
id: 5, | |
name: "Neurologic.com.br", | |
created_at: "2019-04-17 19:00:51.664", | |
updated_at: "2020-06-11 18:02:30.550", | |
previous_lead_generation_count: 100, | |
contact_emails: "[email protected]", | |
state: :implemented, | |
website: "https://www.leadster.com.br", | |
role: "default", | |
ownership_type: "undefined", | |
uid: "5hNxMevLvS2nkjWm35BmgQrnE" | |
) | |
Subscription.create( | |
company_id: 5, | |
trial_ends_at: "2020-04-02", | |
status: :active, | |
created_at: "2019-04-17 19:02:58.013", | |
updated_at: "2021-03-01 17:43:36.121", | |
identifier: :paid, | |
payment_method: :bank_slip, | |
already_used_trial: true | |
) | |
ScriptRule.create( | |
id: 7748 | |
) | |
Script.create( | |
id: 7995, | |
company_id: 5, | |
name: "Educacional", | |
enabled: false, | |
default: false, | |
discarded_at: nil, | |
ab_test_id: nil, | |
script_version_id: nil, | |
script_rule_id: 7748, | |
privacy_policy_url: nil, | |
migrated: false, | |
uid: "HjcS2FKBznSCanuJ", | |
) | |
ScriptVersion.create( | |
id: 35873, | |
script_id: 7995, | |
content: "{\"to\": [\"[email protected]\"], \"from\": \"[email protected]\", \"side\": \"right\", \"title\": \"Ana - Neurologic\", \"avatar\": \"https://storage.googleapis.com/neuro-cdn/uploads/6280fa321cfb2271a60bde15e57a2931.png\", \"script\": [{\"from\": [\"Sim, começar agora\"], \"save\": \"nosync::0::Iniciar\", \"messages\": [{\"say\": \"Olá, tudo bem?\"}, {\"say\": \"<p class=\\\"p1\\\">Quer ver uma <b>Demonstração Personalizada</b> para seu Site? :sorriso_olhos_sorrindo:</p>\"}]}, {\"say\": \"<p>Ok, qual é a <b>URL do seu site</b>? Vou usar para criar a demonstração :piscando_olho:</p>\"}, {\"save\": \"url\", \"type\": \"url\"}, {\"say\": \"Agora algumas informações rápidas para criar sua conta :fogo:\"}, {\"say\": \"Qual é o seu nome?\"}, {\"save\": \"name\", \"type\": \"name\"}, {\"say\": \"Prazer {previous-word} :abanando:\"}, {\"say\": \"E o seu e-mail?\"}, {\"save\": \"email\", \"type\": \"email\"}, {\"say\": \"<p>Estamos quase finalizando:sorriso_olhos_arregalados: Agora informe um <b>número de telefone</b>:</p>\"}, {\"mask\": \"(99) 99999-9999\", \"save\": \"phone\", \"type\": \"phone\"}, {\"say\": \"Insira uma <b>senha</b> de acesso a sua conta:\"}, {\"save\": \"password\", \"type\": \"password\"}, {\"say\": \"Por último, qual é o <b>volume de acessos</b> do seu site por mês?\"}, {\"from\": [\"Até 1.000\", \"1.000 até 5.000\", \"Mais de 5.000\", \"Não sei\"], \"save\": \"acessos\", \"multi\": false, \"selector\": false}, {\"say\": \"Obrigado! Viu como a nossa conversa é diferente de um formulário? :risadinha:\"}, {\"say\": \"<p>Agora estou preparando sua demonstração...</p>\"}, {\"api\": {\"data\": {\"url\": \"...\"}, \"function\": \"nldAPI_Neurologic_PostMessage\"}}], \"modules\": [\"neurologic.js\"], \"subject\": \"Nova Conta Criada - Popup - [Neurologic]\", \"version\": 2, \"waitTime\": 0, \"modalMode\": true, \"inputColor\": \"#ECAE26\", \"notifications\": [], \"userMainColor\": \"#2196F3\", \"alwaysAutoOpen\": true, \"robotMainColor\": \"#2196F3\", \"tooltipMessage\": \"<p class=\\\"p1\\\">Quer ver uma Demonstração Personalizada para seu Site? :sorriso_olhos_sorrindo:</p>\", \"userLightColor\": \"#eee\", \"robotLightColor\": \"#ECAE26\", \"userAccentColor\": \"#fff\", \"robotAccentColor\": \"#000\", \"gaConversionEvent\": null, \"fbqConversionEvents\": null, \"notificationsEnabled\": true, \"useAbsolutePositioning\": false, \"disable1stPartyBranding\": true, \"notificationsPerSession\": 1, \"notificationsDisplayTime\": 20000}", | |
mobile_content: "{\"to\":[\"[email protected]\"],\"from\":\"[email protected]\",\"side\":\"right\",\"title\":\"Ana - Neurologic\",\"avatar\":\"https://storage.googleapis.com/neuro-cdn/uploads/6280fa321cfb2271a60bde15e57a2931.png\",\"script\":[{\"from\":[\"Sim, começar agora\"],\"save\":\"nosync::0::Iniciar\",\"messages\":[{\"say\":\"Olá, tudo bem?\"},{\"say\":\"<p class=\\\"p1\\\">Quer ver uma <b>Demonstração Personalizada</b> para seu Site? :sorriso_olhos_sorrindo:</p>\"}]},{\"say\":\"<p>Ok, qual é a <b>URL do seu site</b>? Vou usar para criar a demonstração :piscando_olho:</p>\"},{\"save\":\"url\",\"type\":\"url\"},{\"say\":\"Agora algumas informações rápidas para criar sua conta :fogo:\"},{\"say\":\"Qual é o seu nome?\"},{\"save\":\"name\",\"type\":\"name\"},{\"say\":\"Prazer {previous-word} :abanando:\"},{\"say\":\"E o seu e-mail?\"},{\"save\":\"email\",\"type\":\"email\"},{\"say\":\"<p>Estamos quase finalizando:sorriso_olhos_arregalados: Agora informe um <b>número de telefone</b>:</p>\"},{\"mask\":\"(99) 99999-9999\",\"save\":\"phone\",\"type\":\"phone\"},{\"say\":\"Insira uma <b>senha</b> de acesso a sua conta:\"},{\"save\":\"password\",\"type\":\"password\"},{\"say\":\"Por último, qual é o <b>volume de acessos</b> do seu site por mês?\"},{\"from\":[\"Até 1.000\",\"1.000 até 5.000\",\"Mais de 5.000\",\"Não sei\"],\"save\":\"acessos\",\"multi\":false,\"selector\":false},{\"say\":\"Obrigado! Viu como a nossa conversa é diferente de um formulário? :risadinha:\"},{\"say\":\"<p>Agora estou preparando sua demonstração...</p>\"},{\"api\":{\"data\":{\"url\":\"...\"},\"function\":\"nldAPI_Neurologic_PostMessage\"}}],\"modules\":[\"neurologic.js\"],\"subject\":\"Nova Conta Criada - Popup - [Neurologic]\",\"version\":2,\"waitTime\":0,\"modalMode\":true,\"inputColor\":\"#ECAE26\",\"notifications\":[],\"userMainColor\":\"#2196F3\",\"alwaysAutoOpen\":true,\"robotMainColor\":\"#2196F3\",\"tooltipMessage\":\"<p class=\\\"p1\\\">Quer ver uma Demonstração Personalizada para seu Site? :sorriso_olhos_sorrindo:</p>\",\"userLightColor\":\"#eee\",\"robotLightColor\":\"#ECAE26\",\"userAccentColor\":\"#fff\",\"robotAccentColor\":\"#000\",\"gaConversionEvent\":null,\"fbqConversionEvents\":null,\"notificationsEnabled\":true,\"useAbsolutePositioning\":false,\"disable1stPartyBranding\":true,\"notificationsPerSession\":1,\"notificationsDisplayTime\":20000}", | |
has_custom_design_mobile: true, | |
has_custom_notifications_mobile: true, | |
has_custom_script_mobile: true, | |
content_version_key: 1, | |
content_version_hash: nil, | |
content_version_date: nil, | |
mobile_content_version_key: 1, | |
mobile_content_version_hash: nil, | |
mobile_content_version_date: nil, | |
) | |
Script.find_or_initialize_by(id: 7995).update(script_version_id: 35873) | |
TrialPeriods::CreateTrialService.call!(Company.first.subscription) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment