GithubHelp home page GithubHelp logo

m3p-backend-squad1's People

Contributors

adrianovolter avatar filipebratti avatar lab365-operacao avatar luis-vilar avatar wgeovanni avatar

Stargazers

 avatar  avatar

Watchers

 avatar

m3p-backend-squad1's Issues

Task 4 - Migration users_addresses

Criação de migration users_addresses:

  • id (obrigatório, primaryKey, autoIncrement, unique)
  • user_id (Integer, obrigatório, chave estrangeira do id da tabela users)
  • address_id (Integer, obrigatório, chave estrangeira do id da tabela addresses)
  • created_at (Date, obrigatório)
  • updated_at (Date, obrigatório)
  • deleted_at (Date, opcional)

Task 2 - Migration users

Criação de migration da tabela users:

  • id (obrigatório, primaryKey, autoIncrement, unique)
  • full_name (String, obrigatório)
  • cpf (String, obrigatório, unique)
  • birth_date (DateOnly, obrigatório)
  • email (String, obrigatório, unique)
  • phone (String, obrigatório)
  • password (String, obrigatório)
  • created_by (Integer, opcional, default: null)
  • type_user (Enum Administrador, Buyer)
  • created_at (Date, obrigatório)
  • updated_at (Date, obrigatório)
  • deleted_at (Date, opcional)

Task 1 - Criação da base do projeto

Criação da base do sistema contendo a pasta:

Dentro da pasta rode o comando npm init

Em seguida, criar os arquivos:

  • .env_example
  • .gitignore
  • .sequelizerc
  • src

Instalar as dependências:

  • cors
  • dotenv
  • express
  • jsonwebtoken
  • pg
  • sequelize
  • swagger-ui-express
  • nodemon (Dev-dependency)
  • sequelize-cli (Dev-dependency)

Na pasta src devem estar contidos as pastas:

  • config
  • controllers
  • database
  • middleware
  • models
  • routes
  • services

Dentro de cada pasta acima deve-se criar um arquivo index.js

Ainda na pasta src devem ser criados os arquivos:

  • index.js
  • server.js
  • utils.js

Logo após é necessário definir as configurações de conexão com o banco de dados, as variáveis de ambiente e implementação de regra no pull request no github.

Task 6 - Migration sales

Criação de migration da tabela sales:

  • id (obrigatório, primaryKey, autoIncrement, unique)
  • buyer_id (Integer, obrigatório, chave estrangeira do id de users)
  • seller_id (Integer, obrigatório, chave estrangeira do id de users)
  • product_id (Integer, obrigatório, chave estrangeira do id de products)
  • users_addresses_id (Integer, obrigatório, chave estrangeira do id de users_addresses)
  • amount_buy (Integer, obrigatório)
  • total (Number, obrigatório)
  • type_payment (obrigatório, Enum Cartão de crédito, Cartão de débito, Pix, Boleto, Trasferência bancária)
  • created_at (Date, obrigatório)
  • updated_at (Date, obrigatório)
  • deleted_at (Date, opcional)

Task 5 - Migration products

Criação de migration da tabela products:

  • id (obrigatório, primaryKey, autoIncrement, unique)
  • user_id (Integer, chave estrangeira do id da tabela users)
  • name (String, obrigatório)
  • lab_name (String, obrigatório)
  • image_link (String, obrigatório)
  • dosage (String, obrigatório)
  • description (String, opcional, default: null)
  • unit_price (Number, obrigatório)
  • type_product: Enum Controlled Medicine ou Uncontrolled Medication, obrigatório
  • total_stock (Integer, obrigatório)
  • created_at (Date, obrigatório)
  • updated_at (Date, obrigatório)
  • deleted_at (Date, opcional)

Task 3 - Migration addresses

Criação de migration addresses com os atributos e regras:

  • id (obrigatório, primaryKey, autoIncrement, unique)
  • street (String, obrigatório)
  • number_street (Integer, obrigatório)
  • neighborhood (String, obrigatório)
  • city (String, obrigatório)
  • state (String, obrigatório)
  • zip (String, obrigatório)
  • complement (String, opcional, default: null)
  • lat (String, opcional, default: null)
  • long (String, opcional, default: null)
  • created_at (Date, obrigatório)
  • updated_at (Date, obrigatório)
  • deleted_at (Date, opcional)

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.