Git Product home page Git Product logo

hsrtech's Introduction

Solução para teste prático HSRTech

Especificação de Desafio testepratico_csharp.pdf.

Solução para o desafio permitindo cadastrar livros, tags e tipos de encadernação.

  • 1º Clonar codigo fonte
    git clone https://github.com/aasf86/HSRTech
  • 2º No diretório raiz do projeto, executar a seguinte linha de comando: "necessário docker"
    docker-compose up -d
  • 3º Demonstração via Swagger Open API

    Uma vez construido o ambiente, na maquina hospedeira é possivel acessar os servicos.

    • Solução HSRTech

    • Ferramentas de infraestrutura

      • SQL Server: port 1433
        drop table if exists Livro;
        go
        
        create table Livro (
            Codigo int primary key identity,
            Titulo varchar(255) not null,
            Autor varchar(255) not null,
            Lancamento date not null
        );
        go
        
        drop table if exists Tag;
        go
        
        create table Tag (
            Codigo int primary key identity,
            Descricao varchar(255) not null,
            LivroCodigo int not null references Livro(Codigo)
        );
        go
        
        drop table if exists TipoEncadernacao;
        go
        
        create table TipoEncadernacao (
            Codigo int primary key identity,
            Nome varchar(255) not null,
            Descricao varchar(255) not null,
            Formato varchar(255) not null
        );    
        go
        
        drop table if exists LivroDigital;
        go
        
        create table LivroDigital (
            Codigo int primary key references Livro(Codigo) on delete cascade,
            Formato varchar(255) not null,    
        );
        go
        
        drop table if exists LivroImpresso;
        go
        
        create table LivroImpresso (
            Id int primary key identity,
            Codigo int not null references Livro(Codigo) on delete cascade,
            Peso decimal(5, 2) not null,
            TipoEncadernacaoCodigo int not null references TipoEncadernacao(Codigo)    
        );
        go
        
        drop view if exists VW_LivroDetails;
        go
        
        create or alter view VW_LivroDetails 
        as
        select 
            l.Codigo,
            l.Lancamento,
            format(l.Lancamento, 'yyyy') Ano,
            format(l.Lancamento, 'MM') Mes,
            l.Titulo,
            l.Autor,
            l.Lancamento DataLancamento,
            'Digital' Tipo,
            ld.Formato,
            null Peso,
            '' Descricao,
            '' TipoEncadernacao
        FROM 
            Livro l,
            LivroDigital ld
        where
            l.Codigo = ld.Codigo    
        UNION ALL
        select 
            l.Codigo,
            l.Lancamento,
            cast(format(l.Lancamento, 'yyyy') as int) Ano,
            cast(format(l.Lancamento, 'MM') as int) Mes,    
            l.Titulo,
            l.Autor,
            l.Lancamento DataLancamento,
            'Digital' Tipo,
            te.Formato,
            li.Peso,
            te.Descricao,
            te.Nome TipoEncadernacao
        FROM 
            Livro l,
            LivroImpresso li,
            TipoEncadernacao te
        where     
            l.Codigo = li.Codigo
        and li.TipoEncadernacaoCodigo = te.Codigo;
        go
        
        create or alter procedure PR_LivrosDetails 
        @mes int, 
        @ano int
        as
        begin
            select *
            from VW_LivroDetails vw
            where ((@ano > 0 and vw.Ano = @ano) or (@ano <= 0))
            and  ((@mes > 0 and vw.Mes = @mes) or (@mes <= 0))
            order by vw.Titulo
        end;
        go            

hsrtech's People

Contributors

aasf86 avatar

Watchers

 avatar

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.