Skip to content

Foi criada o model ClientAccount com migretion e nova gem omniauth foi adicionada#10

Open
AtanaelVmax22 wants to merge 41 commits intomainfrom
featura/client_account
Open

Foi criada o model ClientAccount com migretion e nova gem omniauth foi adicionada#10
AtanaelVmax22 wants to merge 41 commits intomainfrom
featura/client_account

Conversation

@AtanaelVmax22
Copy link
Copy Markdown
Contributor

Relatório de Atualizações

Foi criada uma nova model ClientAccount para atender às necessidades do projeto. Devido a conflitos de rota resultantes de duplicidade de código, foram realizadas modificações nas rotas para garantir a funcionalidade do projeto. Além disso, foi incluída a nova gem omniauth, a qual é essencial para a funcionalidade de autenticação do sistema.

Detalhes das Modificações

  • Model: Criação da model ClientAccount.
  • Rotas: Ajustes realizados para evitar conflitos e duplicidade.
  • Gem: Inclusão da gem omniauth para suporte à autenticação.

Se houver necessidade de mais informações ou esclarecimentos sobre as implementações, estou à disposição.😊😊

silvio-cavalcanti and others added 30 commits September 10, 2024 10:03
criamos o arquivo docker para criar o banco de dados de desenvolvimento
adicionou as configureaçoes do banco de dados de desenvolvimento no projeto
…base

Adicionar configuração de banco de dados e dotenv
…o a validação no migration que não permite nomes nulos.
Configuração inicial do Devise: inclusão do Devise, criação do modelo User e geração da migração
…nt-entity

Adicionar Entidade CorporateClient
Criando entidade endereco e suas validacoes.
…-token-auth

correção do conflito da migração
Comment thread app/models/client_account.rb Outdated
@@ -0,0 +1,14 @@
class ClientAccount < ApplicationRecord
# Include default devise modules.
devise :database_authenticatable, :registerable,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ajustar indentação

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment thread app/models/client_account.rb Outdated
validates :email, presence: true, uniqueness: true, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i }
validates :password, presence: true, length: { minimum: 8 }, if: :password_required?

devise :database_authenticatable, :registerable,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logica duplicada.

Comment thread app/models/client_account.rb Outdated
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable

include DeviseTokenAuth::Concerns::User
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logica duplicada.

Comment thread config/routes.rb Outdated

mount_devise_token_auth_for 'User', at: 'auth'

mount_devise_token_auth_for 'ClientAccount', at: 'auth'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As rotas do devise devem estar localizadas nas primeiras linhas do arquivo

Isso foi testado?
Se sim, como?

Existe um conflito ali no at: 'auth'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

não foi testado, apenas rodou aplicação no rails server

class DeviseTokenAuthCreateClientAccounts < ActiveRecord::Migration[7.0]
def change

create_table(:client_accounts) do |t|
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existem dois create_table(:client_accounts)

@@ -0,0 +1,42 @@
class DeviseCreateClientAccounts < ActiveRecord::Migration[7.0]
def change
create_table :client_accounts do |t|
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existem dois create_table(:client_accounts)

Comment thread app/models/client_account.rb Outdated
@@ -0,0 +1,14 @@
class ClientAccount < ApplicationRecord
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClientAccount é um nome fora do padrão
Isso deveria ser algo com ClientUser, ou algo do tipo
O model não representa uma conta, o model representa um usuário do tipo cliente

Comment thread db/schema.rb Outdated
end


create_table "contract", force: :cascade do |t|
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precisamos conversar
Existe commit na main que adicionou um monte de coisa não revisada, fora de um PR e com vários erros.

@@ -0,0 +1,5 @@
class AddPhysicalClientToEnderecos < ActiveRecord::Migration[7.0]
def change
add_reference :enderecos, :physical_client, null: false, foreign_key: true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Como discutimos quinta passada, endereço vai ser polimórfico e pra ser dessa forma esta migração está incompleta e a proxima é desnecessaria

@@ -0,0 +1,5 @@
class AddCorporateClientToEndereco < ActiveRecord::Migration[7.0]
def change
add_reference :enderecos, :corporate_client, null: false, foreign_key: true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ver o comentario anterior

@@ -0,0 +1,12 @@
class CreateClientUsers < ActiveRecord::Migration[7.0]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se a migração do devise já adicionaria todas essas informações, esta migração é desnecessária.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants