From f222ea8ca3b722d05533891f2cd6af0a156b8624 Mon Sep 17 00:00:00 2001 From: mairess Date: Thu, 4 Jul 2024 09:51:43 -0300 Subject: [PATCH 1/4] feat: add more seeds --- src/main/resources/import.sql | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/resources/import.sql b/src/main/resources/import.sql index 1c5d0de..279eef4 100644 --- a/src/main/resources/import.sql +++ b/src/main/resources/import.sql @@ -1,6 +1,9 @@ -insert into "customers" ("id", "name", "cpf", "phone", "email", "registration_date") values (1, 'João Silva', '12345678900', '21999999999', 'joao@example.com', current_date), (2, 'Tõe da fruta', '0546489491', '00011122233', 'toe@example.com', current_date); -insert into "addresses" ("city", "state", "zip_code", "address_type", "farm_name", "village") values ('CityName', 'StateName', '12345-678', 'rural', 'FarmName', 'VillageName'); -insert into "addresses" ("city", "state", "zip_code", "address_type", "street", "street_number", "complement", "neighborhood") values ('CityName', 'StateName', '12345-678', 'urban', 'StreetName', 123, 'ComplementName', 'NeighborhoodName'); -insert into "equipments" ("type", "model", "serial_number", "manufacturer") values ('ROUTER', 'Model', 'Serial123', 'ManufacturerName'), ('MODEM', 'Model', 'Serial456', 'ManufacturerName'), ('ROUTER', 'xptz', '65498', 'ManufacturerName'), ('MODEM', 'uuu', '987562131', 'intel'); -insert into "plans" ("name", "speed", "price") values ('PlanName', 100, 99.99), ('Speed Of light', 500, 200); -insert into "technicians" ("name", "phone", "email") values ('TechnicianName', '123456789', 'technician@example.com'), ('Ricardo', '123456789', 'ricardo@example.com'), ('Sandro', '010101', 'sandro@example.com'); \ No newline at end of file +insert into "customers" ("id", "name", "cpf", "phone", "email", "registration_date") values (1, 'João Silva', '12345678900', '21999999999', 'joao.silva@example.com', current_date), (2, 'Maria Oliveira', '23456789001', '21888888888', 'maria.oliveira@example.com', current_date), (3, 'Carlos Pereira', '34567890123', '21777777777', 'carlos.pereira@example.com', current_date), (4, 'Ana Costa', '45678901234', '21666666666', 'ana.costa@example.com', current_date), (5, 'Pedro Souza', '56789012345', '21555555555', 'pedro.souza@example.com', current_date), (6, 'Paula Almeida', '67890123456', '21444444444', 'paula.almeida@example.com', current_date), (7, 'Lucas Lima', '78901234567', '21333333333', 'lucas.lima@example.com', current_date), (8, 'Mariana Santos', '89012345678', '21222222222', 'mariana.santos@example.com', current_date), (9, 'Rafael Fernandes', '90123456789', '21111111111', 'rafael.fernandes@example.com', current_date), (10, 'Julia Gonçalves', '01234567890', '21000000000', 'julia.goncalves@example.com', current_date), (11, 'Rodrigo Martins', '11223344556', '21987654321', 'rodrigo.martins@example.com', current_date), (12, 'Fernanda Rodrigues', '22334455667', '21876543210', 'fernanda.rodrigues@example.com', current_date), (13, 'Marcelo Batista', '33445566778', '21765432109', 'marcelo.batista@example.com', current_date), (14, 'Vanessa Araújo', '44556677889', '21654321098', 'vanessa.araujo@example.com', current_date), (15, 'Bruno Cardoso', '55667788990', '21543210987', 'bruno.cardoso@example.com', current_date), (16, 'Gabriela Mendes', '66778899001', '21432109876', 'gabriela.mendes@example.com', current_date), (17, 'Thiago Ribeiro', '77889900112', '21321098765', 'thiago.ribeiro@example.com', current_date), (18, 'Renata Lopes', '88990011223', '21210987654', 'renata.lopes@example.com', current_date), (19, 'Felipe Nunes', '99001122334', '21109876543', 'felipe.nunes@example.com', current_date), (20, 'Aline Rocha', '10111213141', '21098765432', 'aline.rocha@example.com', current_date); + +insert into "addresses" ("city", "state", "zip_code", "address_type", "farm_name", "village") values ('Rio Branco', 'Acre', '12345-678', 'rural', 'Fazenda Sagarana', 'Vale dos Açudes'), ('Manaus', 'Amazonas', '12345-678', 'urban', 'Rua da Coluna', 'Perto do Bar de Joca', 'Bairro Grande Morada'), ('Belém', 'Pará', '54321-098', 'rural', 'Fazenda São José', 'Vale Verde'), ('São Paulo', 'São Paulo', '09876-543', 'urban', 'Avenida Paulista', 'Próximo ao Metrô', 'Jardins'), ('Curitiba', 'Paraná', '87654-321', 'rural', 'Sítio Primavera', 'Serra do Mar'), ('Belo Horizonte', 'Minas Gerais', '56789-012', 'urban', 'Rua das Flores', 'Perto do Parque', 'Centro'), ('Porto Alegre', 'Rio Grande do Sul', '21098-765', 'rural', 'Chácara das Palmeiras', 'Vale das Pedras'), ('Recife', 'Pernambuco', '43210-987', 'urban', 'Avenida Recife', 'Próximo ao Shopping', 'Boa Viagem'), ('Florianópolis', 'Santa Catarina', '32109-876', 'rural', 'Sítio das Águas', 'Vale das Flores'), ('Goiânia', 'Goiás', '78901-234', 'urban', 'Rua das Acácias', 'Perto do Parque', 'Setor Oeste'), ('Fortaleza', 'Ceará', '45678-901', 'rural', 'Fazenda Boa Vista', 'Vale do Sol'), ('Salvador', 'Bahia', '54321-789', 'urban', 'Avenida da Liberdade', 'Perto do Mercado', 'Barra'), ('João Pessoa', 'Paraíba', '98765-432', 'rural', 'Sítio Santa Fé', 'Vale dos Coqueirais'), ('Natal', 'Rio Grande do Norte', '67890-123', 'urban', 'Rua dos Ventos', 'Perto da Praia', 'Ponta Negra'), ('Porto Velho', 'Rondônia', '23456-789', 'rural', 'Fazenda Esperança', 'Vale do Sol'), ('Teresina', 'Piauí', '89012-345', 'urban', 'Avenida Brasil', 'Perto do Parque', 'Centro'), ('Campo Grande', 'Mato Grosso do Sul', '34567-890', 'rural', 'Chácara das Palmeiras', 'Vale Verde'), ('Cuiabá', 'Mato Grosso', '90123-456', 'urban', 'Rua das Rosas', 'Perto do Shopping', 'Centro Norte'), ('Palmas', 'Tocantins', '45678-901', 'rural', 'Fazenda São Francisco', 'Vale das Águas'), ('Brasília', 'Distrito Federal', '56789-012', 'urban', 'Avenida das Flores', 'Perto do Parque', 'Asa Sul'), ('Vitória', 'Espírito Santo', '21098-765', 'rural', 'Sítio dos Sonhos', 'Vale das Montanhas'), ('Aracaju', 'Sergipe', '43210-987', 'urban', 'Rua da Praia', 'Perto do Teatro', 'Atalaia'), ('Boa Vista', 'Roraima', '32109-876', 'rural', 'Fazenda Esperança', 'Vale dos Ventos'), ('Maceió', 'Alagoas', '78901-234', 'urban', 'Avenida Fernandes', 'Perto do Estádio', 'Pajuçara'), ('Porto Alegre', 'Rio Grande do Sul', '54321-098', 'rural', 'Chácara das Oliveiras', 'Vale das Águas'), ('Belém', 'Pará', '56789-012', 'urban', 'Rua das Mangueiras', 'Perto do Mercado', 'Nazaré'), ('São Luís', 'Maranhão', '67890-123', 'rural', 'Fazenda Santa Cruz', 'Vale dos Lagos'); + +insert into "equipments" ("type", "model", "serial_number", "manufacturer") values ('ROUTER', 'TP-Link Deco M5', 'SN031', 'TP-Link'), ('MODEM', 'Arris SURFboard SBG6700AC', 'SN032', 'Arris'), ('ROUTER', 'Linksys Velop', 'SN033', 'Linksys'), ('MODEM', 'Netgear Nighthawk AC1900', 'SN034', 'Netgear'), ('ROUTER', 'Asus RT-AC88U', 'SN035', 'Asus'), ('MODEM', 'Motorola MG7700', 'SN036', 'Motorola'), ('ROUTER', 'Google Nest Wifi', 'SN037', 'Google'), ('MODEM', 'Zoom Telephonics AC1900', 'SN038', 'Zoom'), ('ROUTER', 'D-Link DIR-867', 'SN039', 'D-Link'), ('MODEM', 'Actiontec C3000A', 'SN040', 'Actiontec'), ('ROUTER', 'Synology RT2600ac', 'SN041', 'Synology'), ('MODEM', 'Hitron CODA-4582', 'SN042', 'Hitron'), ('ROUTER', 'Tenda AC10U', 'SN043', 'Tenda'), ('MODEM', 'Technicolor TC4400', 'SN044', 'Technicolor'), ('ROUTER', 'Buffalo AirStation', 'SN045', 'Buffalo'), ('MODEM', 'Cisco DPC3941T', 'SN046', 'Cisco'), ('ROUTER', 'TP-Link Archer C7', 'SN047', 'TP-Link'), ('MODEM', 'Zyxel C1100Z', 'SN048', 'Zyxel'), ('ROUTER', 'Apple AirPort Extreme', 'SN049', 'Apple'), ('MODEM', 'Hitron CGNM-2250', 'SN050', 'Hitron'), ('ROUTER', 'Huawei WS5200', 'SN051', 'Huawei'), ('MODEM', 'UBEE DDW36C', 'SN052', 'UBEE'), ('ROUTER', 'MikroTik RB3011UiAS-RM', 'SN053', 'MikroTik'), ('MODEM', 'Zoom 5370', 'SN054', 'Zoom'), ('ROUTER', 'Linksys EA7500', 'SN055', 'Linksys'), ('MODEM', 'Motorola MB7621', 'SN056', 'Motorola'), ('ROUTER', 'Asus RT-AX88U', 'SN057', 'Asus'), ('MODEM', 'Netgear CM500', 'SN058', 'Netgear'), ('ROUTER', 'Google Wifi', 'SN059', 'Google'), ('MODEM', 'Arris SB6190', 'SN060', 'Arris'), ('ROUTER', 'D-Link EXO AC2600', 'SN061', 'D-Link'), ('MODEM', 'TP-Link TC-7610', 'SN062', 'TP-Link'), ('ROUTER', 'Synology MR2200ac', 'SN063', 'Synology'), ('MODEM', 'Actiontec GT784WN', 'SN064', 'Actiontec'), ('ROUTER', 'Netgear Nighthawk X6', 'SN065', 'Netgear'), ('MODEM', 'Technicolor TC8717T', 'SN066', 'Technicolor'), ('ROUTER', 'Buffalo WZR-1750DHP', 'SN067', 'Buffalo'), ('MODEM', 'Cisco DPC3010', 'SN068', 'Cisco') + +insert into "plans" ("name", "speed", "price") values ('Starter Plan', 100, 99.99), ('Deluxe Plan', 300, 199.99), ('Platinum Plan', 500, 299.99); + +insert into "technicians" ("name", "phone", "email") values ('Marcos Oliveira', '21987654321', 'marcos@wnet.com'), ('João Silva', '21987654322', 'joao@wnet.com'), ('Ana Souza', '21987654323', 'ana@wnet.com'), ('Pedro Santos', '21987654324', 'pedro@wnet.com'), \ No newline at end of file From d74e42f5f355cd16959ae080122c69c181cf6b0b Mon Sep 17 00:00:00 2001 From: mairess Date: Thu, 4 Jul 2024 10:43:44 -0300 Subject: [PATCH 2/4] feat: fix sql seed --- src/main/java/com/maires/wnet/entity/UrbanAddress.java | 4 ++-- src/main/resources/import.sql | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/maires/wnet/entity/UrbanAddress.java b/src/main/java/com/maires/wnet/entity/UrbanAddress.java index c08770d..e78a6c1 100644 --- a/src/main/java/com/maires/wnet/entity/UrbanAddress.java +++ b/src/main/java/com/maires/wnet/entity/UrbanAddress.java @@ -68,7 +68,7 @@ public void setStreet(String street) { * * @return the street number */ - public int getStreetNumber() { + public Integer getStreetNumber() { return streetNumber; } @@ -77,7 +77,7 @@ public int getStreetNumber() { * * @param streetNumber the street number */ - public void setStreetNumber(int streetNumber) { + public void setStreetNumber(Integer streetNumber) { this.streetNumber = streetNumber; } diff --git a/src/main/resources/import.sql b/src/main/resources/import.sql index 279eef4..f2d463c 100644 --- a/src/main/resources/import.sql +++ b/src/main/resources/import.sql @@ -1,9 +1,11 @@ -insert into "customers" ("id", "name", "cpf", "phone", "email", "registration_date") values (1, 'João Silva', '12345678900', '21999999999', 'joao.silva@example.com', current_date), (2, 'Maria Oliveira', '23456789001', '21888888888', 'maria.oliveira@example.com', current_date), (3, 'Carlos Pereira', '34567890123', '21777777777', 'carlos.pereira@example.com', current_date), (4, 'Ana Costa', '45678901234', '21666666666', 'ana.costa@example.com', current_date), (5, 'Pedro Souza', '56789012345', '21555555555', 'pedro.souza@example.com', current_date), (6, 'Paula Almeida', '67890123456', '21444444444', 'paula.almeida@example.com', current_date), (7, 'Lucas Lima', '78901234567', '21333333333', 'lucas.lima@example.com', current_date), (8, 'Mariana Santos', '89012345678', '21222222222', 'mariana.santos@example.com', current_date), (9, 'Rafael Fernandes', '90123456789', '21111111111', 'rafael.fernandes@example.com', current_date), (10, 'Julia Gonçalves', '01234567890', '21000000000', 'julia.goncalves@example.com', current_date), (11, 'Rodrigo Martins', '11223344556', '21987654321', 'rodrigo.martins@example.com', current_date), (12, 'Fernanda Rodrigues', '22334455667', '21876543210', 'fernanda.rodrigues@example.com', current_date), (13, 'Marcelo Batista', '33445566778', '21765432109', 'marcelo.batista@example.com', current_date), (14, 'Vanessa Araújo', '44556677889', '21654321098', 'vanessa.araujo@example.com', current_date), (15, 'Bruno Cardoso', '55667788990', '21543210987', 'bruno.cardoso@example.com', current_date), (16, 'Gabriela Mendes', '66778899001', '21432109876', 'gabriela.mendes@example.com', current_date), (17, 'Thiago Ribeiro', '77889900112', '21321098765', 'thiago.ribeiro@example.com', current_date), (18, 'Renata Lopes', '88990011223', '21210987654', 'renata.lopes@example.com', current_date), (19, 'Felipe Nunes', '99001122334', '21109876543', 'felipe.nunes@example.com', current_date), (20, 'Aline Rocha', '10111213141', '21098765432', 'aline.rocha@example.com', current_date); +insert into "customers" ("id", "name", "cpf", "phone", "email", "registration_date") values (1, 'João Silva', '12345678900', '21999999999', 'joao.silva@example.com', current_date), (2, 'Maria Oliveira', '23456789001', '21888888888', 'maria.oliveira@example.com', current_date), (3, 'Pedro Souza', '34567890123', '21777777777', 'pedro.souza@example.com', current_date), (4, 'Ana Santos', '45678901224', '21666666666', 'ana.santos@example.com', current_date), (5, 'Carlos Lima', '56789012145', '21555555555', 'carlos.lima@example.com', current_date), (6, 'Mariana Costa', '67890123456', '21444444444', 'mariana.costa@example.com', current_date), (7, 'José Pereira', '78901234567', '21333333333', 'jose.pereira@example.com', current_date), (8, 'Luiza Gomes', '89002345678', '21222222222', 'luiza.gomes@example.com', current_date), (9, 'Fernando Martins', '90123456289', '21111111111', 'fernando.martins@example.com', current_date), (10, 'Aline Mendes', '01214567890', '21999999998', 'aline.mendes@example.com', current_date), (11, 'Rafaela Almeida', '12345678901', '21888888887', 'rafaela.almeida@example.com', current_date), (12, 'Rodrigo Santos', '23456789012', '21777777776', 'rodrigo.santos@example.com', current_date), (13, 'Juliana Lima', '34563790123', '21666666665', 'juliana.lima@example.com', current_date), (14, 'Gustavo Oliveira', '45678901234', '21555555554', 'gustavo.oliveira@example.com', current_date), (15, 'Camila Silva', '56789012345', '21444444443', 'camila.silva@example.com', current_date), (16, 'Marcos Costa', '37890123456', '21333333332', 'marcos.costa@example.com', current_date), (17, 'Carolina Pereira', '70901234567', '21222222221', 'carolina.pereira@example.com', current_date), (18, 'Paulo Gomes', '89012345678', '21111111110', 'paulo.gomes@example.com', current_date), (19, 'Isabela Martins', '90123456789', '21999999997', 'isabela.martins@example.com', current_date), (20, 'Renato Mendes', '01234567890', '21888888886', 'renato.mendes@example.com', current_date); -insert into "addresses" ("city", "state", "zip_code", "address_type", "farm_name", "village") values ('Rio Branco', 'Acre', '12345-678', 'rural', 'Fazenda Sagarana', 'Vale dos Açudes'), ('Manaus', 'Amazonas', '12345-678', 'urban', 'Rua da Coluna', 'Perto do Bar de Joca', 'Bairro Grande Morada'), ('Belém', 'Pará', '54321-098', 'rural', 'Fazenda São José', 'Vale Verde'), ('São Paulo', 'São Paulo', '09876-543', 'urban', 'Avenida Paulista', 'Próximo ao Metrô', 'Jardins'), ('Curitiba', 'Paraná', '87654-321', 'rural', 'Sítio Primavera', 'Serra do Mar'), ('Belo Horizonte', 'Minas Gerais', '56789-012', 'urban', 'Rua das Flores', 'Perto do Parque', 'Centro'), ('Porto Alegre', 'Rio Grande do Sul', '21098-765', 'rural', 'Chácara das Palmeiras', 'Vale das Pedras'), ('Recife', 'Pernambuco', '43210-987', 'urban', 'Avenida Recife', 'Próximo ao Shopping', 'Boa Viagem'), ('Florianópolis', 'Santa Catarina', '32109-876', 'rural', 'Sítio das Águas', 'Vale das Flores'), ('Goiânia', 'Goiás', '78901-234', 'urban', 'Rua das Acácias', 'Perto do Parque', 'Setor Oeste'), ('Fortaleza', 'Ceará', '45678-901', 'rural', 'Fazenda Boa Vista', 'Vale do Sol'), ('Salvador', 'Bahia', '54321-789', 'urban', 'Avenida da Liberdade', 'Perto do Mercado', 'Barra'), ('João Pessoa', 'Paraíba', '98765-432', 'rural', 'Sítio Santa Fé', 'Vale dos Coqueirais'), ('Natal', 'Rio Grande do Norte', '67890-123', 'urban', 'Rua dos Ventos', 'Perto da Praia', 'Ponta Negra'), ('Porto Velho', 'Rondônia', '23456-789', 'rural', 'Fazenda Esperança', 'Vale do Sol'), ('Teresina', 'Piauí', '89012-345', 'urban', 'Avenida Brasil', 'Perto do Parque', 'Centro'), ('Campo Grande', 'Mato Grosso do Sul', '34567-890', 'rural', 'Chácara das Palmeiras', 'Vale Verde'), ('Cuiabá', 'Mato Grosso', '90123-456', 'urban', 'Rua das Rosas', 'Perto do Shopping', 'Centro Norte'), ('Palmas', 'Tocantins', '45678-901', 'rural', 'Fazenda São Francisco', 'Vale das Águas'), ('Brasília', 'Distrito Federal', '56789-012', 'urban', 'Avenida das Flores', 'Perto do Parque', 'Asa Sul'), ('Vitória', 'Espírito Santo', '21098-765', 'rural', 'Sítio dos Sonhos', 'Vale das Montanhas'), ('Aracaju', 'Sergipe', '43210-987', 'urban', 'Rua da Praia', 'Perto do Teatro', 'Atalaia'), ('Boa Vista', 'Roraima', '32109-876', 'rural', 'Fazenda Esperança', 'Vale dos Ventos'), ('Maceió', 'Alagoas', '78901-234', 'urban', 'Avenida Fernandes', 'Perto do Estádio', 'Pajuçara'), ('Porto Alegre', 'Rio Grande do Sul', '54321-098', 'rural', 'Chácara das Oliveiras', 'Vale das Águas'), ('Belém', 'Pará', '56789-012', 'urban', 'Rua das Mangueiras', 'Perto do Mercado', 'Nazaré'), ('São Luís', 'Maranhão', '67890-123', 'rural', 'Fazenda Santa Cruz', 'Vale dos Lagos'); +insert into "addresses" ("city", "state", "zip_code", "address_type", "farm_name", "village") values ('Rio Branco', 'Acre', '12345-678', 'rural', 'Fazenda Sagarana', 'Vale dos Açudes'), ('Porto Velho', 'Rondônia', '78900-000', 'rural', 'Fazenda Esperança', 'Vale Verde'), ('Manaus', 'Amazonas', '23456-789', 'urban', 'Rua das Flores', 'Centro'), ('Belém', 'Pará', '45678-901', 'urban', 'Av. da Independência', 'Reduto'), ('Teresina', 'Piauí', '56789-012', 'urban', 'Rua dos Ipês', 'Jóquei'), ('Fortaleza', 'Ceará', '67890-123', 'urban', 'Av. Dom Luís', 'Aldeota'), ('Natal', 'Rio Grande do Norte', '78901-234', 'urban', 'Rua Mossoró', 'Petrópolis'), ('João Pessoa', 'Paraíba', '89012-345', 'urban', 'Av. Epitácio Pessoa', 'Tambaú'), ('Recife', 'Pernambuco', '90123-456', 'urban', 'Rua do Sol', 'Boa Vista'), ('Maceió', 'Alagoas', '01234-567', 'urban', 'Av. Fernandes Lima', 'Farol') -insert into "equipments" ("type", "model", "serial_number", "manufacturer") values ('ROUTER', 'TP-Link Deco M5', 'SN031', 'TP-Link'), ('MODEM', 'Arris SURFboard SBG6700AC', 'SN032', 'Arris'), ('ROUTER', 'Linksys Velop', 'SN033', 'Linksys'), ('MODEM', 'Netgear Nighthawk AC1900', 'SN034', 'Netgear'), ('ROUTER', 'Asus RT-AC88U', 'SN035', 'Asus'), ('MODEM', 'Motorola MG7700', 'SN036', 'Motorola'), ('ROUTER', 'Google Nest Wifi', 'SN037', 'Google'), ('MODEM', 'Zoom Telephonics AC1900', 'SN038', 'Zoom'), ('ROUTER', 'D-Link DIR-867', 'SN039', 'D-Link'), ('MODEM', 'Actiontec C3000A', 'SN040', 'Actiontec'), ('ROUTER', 'Synology RT2600ac', 'SN041', 'Synology'), ('MODEM', 'Hitron CODA-4582', 'SN042', 'Hitron'), ('ROUTER', 'Tenda AC10U', 'SN043', 'Tenda'), ('MODEM', 'Technicolor TC4400', 'SN044', 'Technicolor'), ('ROUTER', 'Buffalo AirStation', 'SN045', 'Buffalo'), ('MODEM', 'Cisco DPC3941T', 'SN046', 'Cisco'), ('ROUTER', 'TP-Link Archer C7', 'SN047', 'TP-Link'), ('MODEM', 'Zyxel C1100Z', 'SN048', 'Zyxel'), ('ROUTER', 'Apple AirPort Extreme', 'SN049', 'Apple'), ('MODEM', 'Hitron CGNM-2250', 'SN050', 'Hitron'), ('ROUTER', 'Huawei WS5200', 'SN051', 'Huawei'), ('MODEM', 'UBEE DDW36C', 'SN052', 'UBEE'), ('ROUTER', 'MikroTik RB3011UiAS-RM', 'SN053', 'MikroTik'), ('MODEM', 'Zoom 5370', 'SN054', 'Zoom'), ('ROUTER', 'Linksys EA7500', 'SN055', 'Linksys'), ('MODEM', 'Motorola MB7621', 'SN056', 'Motorola'), ('ROUTER', 'Asus RT-AX88U', 'SN057', 'Asus'), ('MODEM', 'Netgear CM500', 'SN058', 'Netgear'), ('ROUTER', 'Google Wifi', 'SN059', 'Google'), ('MODEM', 'Arris SB6190', 'SN060', 'Arris'), ('ROUTER', 'D-Link EXO AC2600', 'SN061', 'D-Link'), ('MODEM', 'TP-Link TC-7610', 'SN062', 'TP-Link'), ('ROUTER', 'Synology MR2200ac', 'SN063', 'Synology'), ('MODEM', 'Actiontec GT784WN', 'SN064', 'Actiontec'), ('ROUTER', 'Netgear Nighthawk X6', 'SN065', 'Netgear'), ('MODEM', 'Technicolor TC8717T', 'SN066', 'Technicolor'), ('ROUTER', 'Buffalo WZR-1750DHP', 'SN067', 'Buffalo'), ('MODEM', 'Cisco DPC3010', 'SN068', 'Cisco') +insert into "addresses" ("city", "state", "zip_code", "address_type", "street", "street_number", "complement", "neighborhood") values ('São Paulo', 'São Paulo', '01000-000', 'urban', 'Avenida Paulista', 1023, 'Próximo ao Parque Trianon', 'Bela Vista'), ('Rio de Janeiro', 'Rio de Janeiro', '20000-000', 'urban', 'Rua Nossa Senhora de Copacabana', 987, 'Perto do Posto 6', 'Copacabana'), ('Belo Horizonte', 'Minas Gerais', '30000-000', 'urban', 'Avenida Afonso Pena', 500, 'Centro', 'Funcionários'), ('Brasília', 'Distrito Federal', '70000-000', 'urban', 'Esplanada dos Ministérios', 1000, 'Asa Norte', 'Plano Piloto'), ('Curitiba', 'Paraná', '80000-000', 'urban', 'Rua XV de Novembro', 789, 'Centro', 'Batel'), ('Porto Alegre', 'Rio Grande do Sul', '90000-000', 'urban', 'Avenida Borges de Medeiros', 1234, 'Centro', 'Moinhos de Vento'), ('Florianópolis', 'Santa Catarina', '88000-000', 'urban', 'Avenida Beira Mar Norte', 567, 'Centro', 'Trindade'), ('Salvador', 'Bahia', '40000-000', 'urban', 'Pelourinho', 321, 'Centro Histórico', 'Barra'), ('Goiânia', 'Goiás', '74000-000', 'urban', 'Avenida Goiás', 789, 'Setor Central', 'Jardim Goiás'), ('Campo Grande', 'Mato Grosso do Sul', '79000-000', 'urban', 'Avenida Afonso Pena', 456, 'Centro', 'Jardim dos Estados'); + +insert into "equipments" ("type", "model", "serial_number", "manufacturer") values ('ROUTER', 'TP-Link Deco M5', 'SN031', 'TP-Link'), ('MODEM', 'Arris SURFboard SBG6700AC', 'SN032', 'Arris'), ('ROUTER', 'Linksys Velop', 'SN033', 'Linksys'), ('MODEM', 'Netgear Nighthawk AC1900', 'SN034', 'Netgear'), ('ROUTER', 'Asus RT-AC88U', 'SN035', 'Asus'), ('MODEM', 'Motorola MG7700', 'SN036', 'Motorola'), ('ROUTER', 'Google Nest Wifi', 'SN037', 'Google'), ('MODEM', 'Zoom Telephonics AC1900', 'SN038', 'Zoom'), ('ROUTER', 'D-Link DIR-867', 'SN039', 'D-Link'), ('MODEM', 'Actiontec C3000A', 'SN040', 'Actiontec'), ('ROUTER', 'Synology RT2600ac', 'SN041', 'Synology'), ('MODEM', 'Hitron CODA-4582', 'SN042', 'Hitron'), ('ROUTER', 'Tenda AC10U', 'SN043', 'Tenda'), ('MODEM', 'Technicolor TC4400', 'SN044', 'Technicolor'), ('ROUTER', 'Buffalo AirStation', 'SN045', 'Buffalo'), ('MODEM', 'Cisco DPC3941T', 'SN046', 'Cisco'), ('ROUTER', 'TP-Link Archer C7', 'SN047', 'TP-Link'), ('MODEM', 'Zyxel C1100Z', 'SN048', 'Zyxel'), ('ROUTER', 'Apple AirPort Extreme', 'SN049', 'Apple'), ('MODEM', 'Hitron CGNM-2250', 'SN050', 'Hitron'), ('ROUTER', 'Huawei WS5200', 'SN051', 'Huawei'), ('MODEM', 'UBEE DDW36C', 'SN052', 'UBEE'), ('ROUTER', 'MikroTik RB3011UiAS-RM', 'SN053', 'MikroTik'), ('MODEM', 'Zoom 5370', 'SN054', 'Zoom'), ('ROUTER', 'Linksys EA7500', 'SN055', 'Linksys'), ('MODEM', 'Motorola MB7621', 'SN056', 'Motorola'), ('ROUTER', 'Asus RT-AX88U', 'SN057', 'Asus'), ('MODEM', 'Netgear CM500', 'SN058', 'Netgear'), ('ROUTER', 'Google Wifi', 'SN059', 'Google'), ('MODEM', 'Arris SB6190', 'SN060', 'Arris'), ('ROUTER', 'D-Link EXO AC2600', 'SN061', 'D-Link'), ('MODEM', 'TP-Link TC-7610', 'SN062', 'TP-Link'), ('ROUTER', 'Synology MR2200ac', 'SN063', 'Synology'), ('MODEM', 'Actiontec GT784WN', 'SN064', 'Actiontec'), ('ROUTER', 'Netgear Nighthawk X6', 'SN065', 'Netgear'), ('MODEM', 'Technicolor TC8717T', 'SN066', 'Technicolor'), ('ROUTER', 'Buffalo WZR-1750DHP', 'SN067', 'Buffalo'), ('MODEM', 'Cisco DPC3010', 'SN068', 'Cisco'); insert into "plans" ("name", "speed", "price") values ('Starter Plan', 100, 99.99), ('Deluxe Plan', 300, 199.99), ('Platinum Plan', 500, 299.99); -insert into "technicians" ("name", "phone", "email") values ('Marcos Oliveira', '21987654321', 'marcos@wnet.com'), ('João Silva', '21987654322', 'joao@wnet.com'), ('Ana Souza', '21987654323', 'ana@wnet.com'), ('Pedro Santos', '21987654324', 'pedro@wnet.com'), \ No newline at end of file +insert into "technicians" ("name", "phone", "email") values ('Marcos Oliveira', '21987654321', 'marcos@wnet.com'), ('João Silva', '21987654322', 'joao@wnet.com'), ('Ana Souza', '21987654323', 'ana@wnet.com'), ('Pedro Santos', '21987654324', 'pedro@wnet.com'); \ No newline at end of file From 3a928bf4e9f7020fd47c6131e474fa8f3cfa1692 Mon Sep 17 00:00:00 2001 From: mairess Date: Thu, 4 Jul 2024 12:47:55 -0300 Subject: [PATCH 3/4] fix: findAddressById method in AddressService it was calling removeAddressById --- .../java/com/maires/wnet/controller/AddressController.java | 2 +- src/main/java/com/maires/wnet/service/AddressService.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/maires/wnet/controller/AddressController.java b/src/main/java/com/maires/wnet/controller/AddressController.java index e4111e4..81d0c98 100644 --- a/src/main/java/com/maires/wnet/controller/AddressController.java +++ b/src/main/java/com/maires/wnet/controller/AddressController.java @@ -65,7 +65,7 @@ public List findAllAddresses() { @GetMapping("/{addressId}") public AddressDto findAddressById(@PathVariable Long addressId) throws AddressNotFoundException { - Address address = addressService.removeAddressById(addressId); + Address address = addressService.findAddressById(addressId); return AddressConverter.returnAddressType(address); } diff --git a/src/main/java/com/maires/wnet/service/AddressService.java b/src/main/java/com/maires/wnet/service/AddressService.java index d279858..241fa69 100644 --- a/src/main/java/com/maires/wnet/service/AddressService.java +++ b/src/main/java/com/maires/wnet/service/AddressService.java @@ -59,8 +59,7 @@ public List
findAllAddresses() { * @throws AddressNotFoundException the address not found exception */ public Address findAddressById(Long addressId) throws AddressNotFoundException { - return addressRepository.findById(addressId) - .orElseThrow(AddressNotFoundException::new); + return addressRepository.findById(addressId).orElseThrow(AddressNotFoundException::new); } From f68dc6d1c9483c24bc2e7be4356a9386b7e36523 Mon Sep 17 00:00:00 2001 From: mairess Date: Thu, 4 Jul 2024 12:49:12 -0300 Subject: [PATCH 4/4] fix(import.sql): change address_type from rural to urban on inset into addresses(rural) --- src/main/resources/import.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/import.sql b/src/main/resources/import.sql index f2d463c..1027171 100644 --- a/src/main/resources/import.sql +++ b/src/main/resources/import.sql @@ -1,6 +1,6 @@ insert into "customers" ("id", "name", "cpf", "phone", "email", "registration_date") values (1, 'João Silva', '12345678900', '21999999999', 'joao.silva@example.com', current_date), (2, 'Maria Oliveira', '23456789001', '21888888888', 'maria.oliveira@example.com', current_date), (3, 'Pedro Souza', '34567890123', '21777777777', 'pedro.souza@example.com', current_date), (4, 'Ana Santos', '45678901224', '21666666666', 'ana.santos@example.com', current_date), (5, 'Carlos Lima', '56789012145', '21555555555', 'carlos.lima@example.com', current_date), (6, 'Mariana Costa', '67890123456', '21444444444', 'mariana.costa@example.com', current_date), (7, 'José Pereira', '78901234567', '21333333333', 'jose.pereira@example.com', current_date), (8, 'Luiza Gomes', '89002345678', '21222222222', 'luiza.gomes@example.com', current_date), (9, 'Fernando Martins', '90123456289', '21111111111', 'fernando.martins@example.com', current_date), (10, 'Aline Mendes', '01214567890', '21999999998', 'aline.mendes@example.com', current_date), (11, 'Rafaela Almeida', '12345678901', '21888888887', 'rafaela.almeida@example.com', current_date), (12, 'Rodrigo Santos', '23456789012', '21777777776', 'rodrigo.santos@example.com', current_date), (13, 'Juliana Lima', '34563790123', '21666666665', 'juliana.lima@example.com', current_date), (14, 'Gustavo Oliveira', '45678901234', '21555555554', 'gustavo.oliveira@example.com', current_date), (15, 'Camila Silva', '56789012345', '21444444443', 'camila.silva@example.com', current_date), (16, 'Marcos Costa', '37890123456', '21333333332', 'marcos.costa@example.com', current_date), (17, 'Carolina Pereira', '70901234567', '21222222221', 'carolina.pereira@example.com', current_date), (18, 'Paulo Gomes', '89012345678', '21111111110', 'paulo.gomes@example.com', current_date), (19, 'Isabela Martins', '90123456789', '21999999997', 'isabela.martins@example.com', current_date), (20, 'Renato Mendes', '01234567890', '21888888886', 'renato.mendes@example.com', current_date); -insert into "addresses" ("city", "state", "zip_code", "address_type", "farm_name", "village") values ('Rio Branco', 'Acre', '12345-678', 'rural', 'Fazenda Sagarana', 'Vale dos Açudes'), ('Porto Velho', 'Rondônia', '78900-000', 'rural', 'Fazenda Esperança', 'Vale Verde'), ('Manaus', 'Amazonas', '23456-789', 'urban', 'Rua das Flores', 'Centro'), ('Belém', 'Pará', '45678-901', 'urban', 'Av. da Independência', 'Reduto'), ('Teresina', 'Piauí', '56789-012', 'urban', 'Rua dos Ipês', 'Jóquei'), ('Fortaleza', 'Ceará', '67890-123', 'urban', 'Av. Dom Luís', 'Aldeota'), ('Natal', 'Rio Grande do Norte', '78901-234', 'urban', 'Rua Mossoró', 'Petrópolis'), ('João Pessoa', 'Paraíba', '89012-345', 'urban', 'Av. Epitácio Pessoa', 'Tambaú'), ('Recife', 'Pernambuco', '90123-456', 'urban', 'Rua do Sol', 'Boa Vista'), ('Maceió', 'Alagoas', '01234-567', 'urban', 'Av. Fernandes Lima', 'Farol') +insert into "addresses" ("city", "state", "zip_code", "address_type", "farm_name", "village") values ('Rio Branco', 'Acre', '12345-678', 'rural', 'Fazenda Sagarana', 'Vale dos Açudes'), ('Porto Velho', 'Rondônia', '78900-000', 'rural', 'Fazenda Esperança', 'Vale Verde'), ('Manaus', 'Amazonas', '23456-789', 'rural', 'Rua das Flores', 'Centro'), ('Belém', 'Pará', '45678-901', 'rural', 'Av. da Independência', 'Reduto'), ('Teresina', 'Piauí', '56789-012', 'rural', 'Rua dos Ipês', 'Jóquei'), ('Fortaleza', 'Ceará', '67890-123', 'rural', 'Av. Dom Luís', 'Aldeota'), ('Natal', 'Rio Grande do Norte', '78901-234', 'rural', 'Rua Mossoró', 'Petrópolis'), ('João Pessoa', 'Paraíba', '89012-345', 'rural', 'Av. Epitácio Pessoa', 'Tambaú'), ('Recife', 'Pernambuco', '90123-456', 'rural', 'Rua do Sol', 'Boa Vista'), ('Maceió', 'Alagoas', '01234-567', 'rural', 'Av. Fernandes Lima', 'Farol') insert into "addresses" ("city", "state", "zip_code", "address_type", "street", "street_number", "complement", "neighborhood") values ('São Paulo', 'São Paulo', '01000-000', 'urban', 'Avenida Paulista', 1023, 'Próximo ao Parque Trianon', 'Bela Vista'), ('Rio de Janeiro', 'Rio de Janeiro', '20000-000', 'urban', 'Rua Nossa Senhora de Copacabana', 987, 'Perto do Posto 6', 'Copacabana'), ('Belo Horizonte', 'Minas Gerais', '30000-000', 'urban', 'Avenida Afonso Pena', 500, 'Centro', 'Funcionários'), ('Brasília', 'Distrito Federal', '70000-000', 'urban', 'Esplanada dos Ministérios', 1000, 'Asa Norte', 'Plano Piloto'), ('Curitiba', 'Paraná', '80000-000', 'urban', 'Rua XV de Novembro', 789, 'Centro', 'Batel'), ('Porto Alegre', 'Rio Grande do Sul', '90000-000', 'urban', 'Avenida Borges de Medeiros', 1234, 'Centro', 'Moinhos de Vento'), ('Florianópolis', 'Santa Catarina', '88000-000', 'urban', 'Avenida Beira Mar Norte', 567, 'Centro', 'Trindade'), ('Salvador', 'Bahia', '40000-000', 'urban', 'Pelourinho', 321, 'Centro Histórico', 'Barra'), ('Goiânia', 'Goiás', '74000-000', 'urban', 'Avenida Goiás', 789, 'Setor Central', 'Jardim Goiás'), ('Campo Grande', 'Mato Grosso do Sul', '79000-000', 'urban', 'Avenida Afonso Pena', 456, 'Centro', 'Jardim dos Estados');