diff --git a/.github/workflows/actionsflow.yml b/.github/workflows/actionsflow.yml
new file mode 100644
index 00000000..f3e71791
--- /dev/null
+++ b/.github/workflows/actionsflow.yml
@@ -0,0 +1,28 @@
+name: Deploy MkDocs to GitHub Pages
+
+on:
+ push:
+ branches:
+ - pages
+
+permissions:
+ contents: write
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ with:
+ python-version: 3.x
+ - uses: actions/cache@v3 # Atualizado para v3
+ with:
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+ path: .aux
+
+ - run: pip install mkdocs-bootswatch
+ - run: pip install mkdocs-material mkdocs-with-pdf
+ - run: mkdocs build
+ - run: mkdocs gh-deploy --force
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 26d33521..00000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/.idea/T2G3-Sistema-Instalacao-Eletrica.iml b/.idea/T2G3-Sistema-Instalacao-Eletrica.iml
deleted file mode 100644
index 90496925..00000000
--- a/.idea/T2G3-Sistema-Instalacao-Eletrica.iml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 6e866721..00000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 5a84757f..00000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1ddf..00000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index 4b8a2e9f..00000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "cmake.sourceDirectory": "/home/danilo/Desktop/T2G3-Sistema-Instalacao-Eletrica/frontend/sige_ie/linux"
-}
diff --git a/README.md b/README.md
deleted file mode 100644
index ebdcb4be..00000000
--- a/README.md
+++ /dev/null
@@ -1,284 +0,0 @@
-
-
-![Versões do Django](./doc/img/sige_ie_logo.jpeg)
-
-SIGE IE
-
-
-## Fase
-Release 1 ✔️ Ir para milestone da release 1
-
-Release 2 ✔️ Ir para milestone da release 2
-
-Release 3 (atual) Ir para milestone da release 3
-## Visão geral do produto
-
-### Sobre
-Aplicativo web mobile desenvolvido para a Universidade de Brasília com objetivo de gerenciar as instalações elétricas e dar suporte ao retrofitting das instalações.
-
-### Posição
-O SIGE IE é um sistema da Universidade de Brasília para o gerenciamento de instalações elétricas com o objetivo de facilitar o cadastro das informações de instalação elétrica para ajudar na reforma da parte elétrica dos prédios e salas. Ele permite a automatização da geração de relatórios das instalações elétricas de cada lugar e a centralização dessas informações para uso dos responsáveis pelas instalações. As pessoas devem usar o SIGE IE porque ele simplifica e agiliza o processo de gerenciamento, principalmente do retrofitting de instalações elétricas, garantindo maior eficiência e segurança.
-
-### Objetivos
-Simplificar o cadastro e gerenciamento de informações de instalações elétricas e automatizar a geração de relatórios.
-### Tecnologias
-#### Back-end
-
-
-
-| Nome | Versão | Uso | Configuração |
-|---|---|---|---|
-| Python | 3.11.8| Linguagem | [Site oficial do Python](https://www.python.org/downloads/) Ou veja na seção "Como subir o back-end" |
-| Django | 4.2 (LTS) | Framework web | Automática |
-| Django REST framework | 3.14 | API REST | Automática |
-| Docker | 25.0.4 | Conteiner e imagem | [Site oficial do Docker](https://docs.docker.com/desktop/install/ubuntu/) |
-| Redis | 7.2 | Banco de dados cache para sessão | Automática via Docker |
-| MySQL | 8.1 | Banco de dados | Automática via Docker |
-| Cabeçalhos do Python3 e do MySQL | - | Cabeçalhos de desenvolvimento e bibliotecas | [Site do Pypi com as configurações](https://pypi.org/project/mysqlclient/) Ou veja na seção "Como subir o back-end"
-
-
-
-##### Observação
-Atualmente o Django REST Framework suporta as seguintes versões do Python e do Django:
-
-
-
-| Python | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 |
-|--------|-----|-----|-----|-----|------|------|
-| Django | 3.0 | 3.1 | 3.2 | 4.0 | 4.1 | 4.2 (LTS) |
-
-
-
-Como a versão LTS mais recente do Django (2024) é a 4.2, escolhemos configurar o projeto usando Python 3.11.
-
-#### Front-end mobile
-
-
-
-| Nome | Versão | Uso | Configuração |
-|---|---|---|---|
-| Flutter | 3.19.3 | Framework frontend | [Site oficial do Flutter](https://docs.flutter.dev/get-started/install/linux) |
-| Android Studio | Iguana | IDE para desenvolvimento Android com Android SDK | [Site oficial do Android Studio](https://developer.android.com/studio/index.html) |
-
-
-
-### Contribuidores
-
-
-## Visão geral do projeto
-
-### Organização
-
-
-| Papel | Atribuições | Responsável | Participantes |
-| --- | --- | --- | --- |
-| Cliente | Validar as entregas | Loana | Loana, Alex |
-| Desenvolvedor back-end | Codificar o backend, configurar a infraestrutura | Pedro | Pedro, Kauan, Oscar |
-| Desenvolvedor frontend | Codificar o frontend, realizar integração com backend | Danilo | Danilo, Ramires, Pedro |
-| UX design | Projetar a interface do usuário, criar protótipos e realizar entrevistas com os clientes | Danilo | Danilo |
-| Analista de requisitos | Levantar requisitos, gerenciar a documentação, validar com cliente | Oscar | Oscar, Ramires, Pedro |
-
-
-
-## Configuração do ambiente
-### Como subir o projeto
-Estas etapas são válidas para Linux OS e WSL.
-#### Como subir o back-end:
-
-##### Pela primeira vez
-
-Primeiramente, interrompa qualquer processo que use o porto 8080, 3306 e 6379. Então atualize o seu sistema:
- ```
- sudo apt-get update
- ```
-
- ```
- sudo apt-get upgrade
- ```
-
-Em seguida, caso já não tenha instalado:
-
-- Instale o Python, Pip e os cabeçalhos do Python e MySQL:
-
- Python:
- ```
- sudo apt-get install python3.11
- ```
-
- Pip:
- ```
- sudo apt-get install python3-pip
- ```
-
- Cabeçalhos:
- ```
- sudo apt-get install python3.11-dev default-libmysqlclient-dev build-essential pkg-config
- ```
-
-- Instale o virtualenv para criar um ambiente virtual do projeto:
-
- Virtualenv:
- ```
- sudo pip3 install virtualenv
- ```
-
-Vá para dentro da pasta raiz `api`:
-
-1. Cria o ambiente virtual e ative-o:
-
- Criar ambiente virtual:
- ```
- virtualenv -p python3.11 venv
- ```
-
- Ativar ambiente:
- ```
- source venv/bin/activate
- ```
-
-2. Com o ambiente virtual ativado, instale as dependências:
-
- ```
- pip install -r requirements.txt
- ```
-
-3. Inicie o Docker, depois vá para o diretório `api` e crie a imagem do banco de dados e da api pela primeira vez:
-
- ```
- docker-compose up --build
- ```
-
-4. Em outro terminal, retorne para o diretório raiz `api` e aplique as migrações:
-
- ```
- python manage.py makemigrations
- ```
-
- ```
- python manage.py migrate
- ```
-
-Pronto, o servidor já está rodando com o banco de dados configurado.
-
-##### Pela segunda vez
-
-Garanta que não haja nenhum processo que use o porto 8080, 3306 e 6379. Por fim, com todas as dependências configuradas, basta:
-
-- Inicar o Docker e o container `sigeie`;
-- Baixar as atualizações (caso haja):
-
- ```
- git pull
- ```
-
-- Atualizar as dependências, fazer as migrações e iniciar o servidor:
-
-```
- source venv/bin/activate && python manage.py makemigrations && python manage.py migrate
-```
-
-Isso é tudo, pessoal.
-
-#### Como subir o front-end:
-
-Antes de começar, verifique se o Flutter SDK está atualizado e compatível com o projeto. Siga as instruções específicas para sua plataforma (Windows, macOS, Linux) disponíveis na [documentação oficial do Flutter](https://flutter.dev/docs/get-started/install).
-
-Caso ainda não tenha feito, instale os seguintes requisitos em sua máquina:
-
-- **Flutter SDK**:
- Siga as instruções de instalação para a sua plataforma.
-
-- **Android Studio ou Visual Studio Code**:
-
- - Android Studio:
- ```
- sudo snap install android-studio --classic
- ```
-
- - Visual Studio Code:
- ```
- sudo snap install code --classic
- ```
- Para o VS Code, instale as extensões do Flutter e Dart disponíveis na aba de extensões do editor.
-
-- **Emulador Android ou um dispositivo físico**:
- Configure um emulador usando o AVD Manager do Android Studio ou [configure seu dispositivo Android para depuração USB](https://developer.android.com/studio/debug/dev-options).
-
-Com o ambiente preparado, siga os passos abaixo:
-
-1. **Clone o Repositório do Front-end**:
- ```
- git clone https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica.git
- ```
-
-2. **Abra o Projeto no Editor**:
- Abra a pasta clonada no Android Studio ou no Visual Studio Code.
-
-3. **Baixe as Dependências**:
- Abra um terminal na pasta frontend/sige_ie e execute o comando:
- ```
- flutter pub get
- ```
-
-4. **Execute o Projeto**:
- - **No Android Studio:** Escolha um dispositivo ou emulador na barra de ferramentas e clique em 'Run'.
- - **No Visual Studio Code:** Selecione um dispositivo ou emulador na barra de status e pressione `F5` ou utilize o comando `flutter run` na paleta de comandos.
-
-Pronto, o Front end já está rodando e você pode utilizá-lo.
-
-## Contribuição
-### Como contribuir
-1. Faça um fork do repositório do projeto.
-2. Clone o fork na sua máquina:
-
- ```
- git clone https://github.com/{seu-usuario}/T2G3-Sistema-Instalacao-Eletrica.git
- ```
-
-4. Comente na issue que deseja contribuir ou crie uma issue nova.
-5. Entre no repositório clonado na sua máquina:
-
- ```
- cd T2G3-Sistema-Instalacao-Eletrica
- ```
-
-7. Após enviar suas contribuições para o fork do seu repositório, faça um pull request.
-8. Aguarde a revisão.
-
-## Documentação
-- [Requisitos de software](https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/issues/1)
-- [Cronograma](https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/issues/3)
-- [Backlog do produto](https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/issues/9)
-- [Releases](https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/milestones)
-- [Arquitetura](https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/issues/2)
-- [Atas de reunião](https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/issues/4)
diff --git a/api/.dockerignore b/api/.dockerignore
deleted file mode 100644
index 354168f2..00000000
--- a/api/.dockerignore
+++ /dev/null
@@ -1 +0,0 @@
-data/mysql/db
diff --git a/api/.gitignore b/api/.gitignore
deleted file mode 100644
index a2b4fdf4..00000000
--- a/api/.gitignore
+++ /dev/null
@@ -1,144 +0,0 @@
-# Django #
-*.log
-*.pot
-*.pyc
-*/__pycache__/
-db.sqlite3
-media/
-*/data/
-
-# Photos #
-equipment_photos/
-
-# Backup files #
-*.bak
-
-# If you are using PyCharm #
-# User-specific stuff
-.idea/**/workspace.xml
-.idea/**/tasks.xml
-.idea/**/usage.statistics.xml
-.idea/**/dictionaries
-.idea/**/shelf
-
-# AWS User-specific
-.idea/**/aws.xml
-
-# Generated files
-.idea/**/contentModel.xml
-
-# Sensitive or high-churn files
-.idea/**/dataSources/
-.idea/**/dataSources.ids
-.idea/**/dataSources.local.xml
-.idea/**/sqlDataSources.xml
-.idea/**/dynamic.xml
-.idea/**/uiDesigner.xml
-.idea/**/dbnavigator.xml
-
-# Gradle
-.idea/**/gradle.xml
-.idea/**/libraries
-
-# File-based project format
-*.iws
-
-# IntelliJ
-out/
-
-# JIRA plugin
-atlassian-ide-plugin.xml
-
-# Python #
-*.py[cod]
-*$py.class
-
-# Distribution / packaging
-.Python build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-.eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-wheels/
-*.whl
-*.egg-info/
-.installed.cfg
-*.egg
-*.manifest
-*.spec
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.coverage
-.coverage.*
-.cache
-.pytest_cache/
-nosetests.xml
-coverage.xml
-*.cover
-.hypothesis/
-
-# Jupyter Notebook
-.ipynb_checkpoints
-
-# pyenv
-.python-version
-
-# celery
-celerybeat-schedule.*
-
-# SageMath parsed files
-*.sage.py
-
-# Environments
-.env
-.venv
-env/
-venv/
-ENV/
-env.bak/
-venv.bak/
-
-# mkdocs documentation
-/site
-
-# mypy
-.mypy_cache/
-
-# Sublime Text #
-*.tmlanguage.cache
-*.tmPreferences.cache
-*.stTheme.cache
-*.sublime-workspace
-*.sublime-project
-
-# sftp configuration file
-sftp-config.json
-
-# Package control specific files Package
-Control.last-run
-Control.ca-list
-Control.ca-bundle
-Control.system-ca-bundle
-GitHub.sublime-settings
-
-# Visual Studio Code #
-.vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
-.history
-data/
-
diff --git a/api/.idea/.gitignore b/api/.idea/.gitignore
deleted file mode 100644
index 13566b81..00000000
--- a/api/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Editor-based HTTP Client requests
-/httpRequests/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
diff --git a/api/.idea/api.iml b/api/.idea/api.iml
deleted file mode 100644
index b00c88e2..00000000
--- a/api/.idea/api.iml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/api/.idea/dataSources.xml b/api/.idea/dataSources.xml
deleted file mode 100644
index bb66d67c..00000000
--- a/api/.idea/dataSources.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
- mysql.8
- true
- com.mysql.cj.jdbc.Driver
- jdbc:mysql://localhost:3306/sigeie_db
- $ProjectFileDir$
-
-
-
\ No newline at end of file
diff --git a/api/.idea/inspectionProfiles/profiles_settings.xml b/api/.idea/inspectionProfiles/profiles_settings.xml
deleted file mode 100644
index 105ce2da..00000000
--- a/api/.idea/inspectionProfiles/profiles_settings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/api/.idea/misc.xml b/api/.idea/misc.xml
deleted file mode 100644
index 6ae386b6..00000000
--- a/api/.idea/misc.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/api/.idea/modules.xml b/api/.idea/modules.xml
deleted file mode 100644
index d50cf45f..00000000
--- a/api/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/api/.idea/vcs.xml b/api/.idea/vcs.xml
deleted file mode 100644
index 6c0b8635..00000000
--- a/api/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/api/.vscode/settings.json b/api/.vscode/settings.json
deleted file mode 100644
index b92839d5..00000000
--- a/api/.vscode/settings.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "workbench.colorCustomizations": {
- "activityBar.activeBackground": "#65c89b",
- "activityBar.background": "#65c89b",
- "activityBar.foreground": "#15202b",
- "activityBar.inactiveForeground": "#15202b99",
- "activityBarBadge.background": "#945bc4",
- "activityBarBadge.foreground": "#e7e7e7",
- "commandCenter.border": "#15202b99",
- "sash.hoverBorder": "#65c89b",
- "statusBar.background": "#42b883",
- "statusBar.foreground": "#15202b",
- "statusBarItem.hoverBackground": "#359268",
- "statusBarItem.remoteBackground": "#42b883",
- "statusBarItem.remoteForeground": "#15202b",
- "titleBar.activeBackground": "#42b883",
- "titleBar.activeForeground": "#15202b",
- "titleBar.inactiveBackground": "#42b88399",
- "titleBar.inactiveForeground": "#15202b99"
- },
- "peacock.color": "#42b883"
-}
\ No newline at end of file
diff --git a/api/Dockerfile b/api/Dockerfile
deleted file mode 100644
index 3d6b28de..00000000
--- a/api/Dockerfile
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM python:3.11
-
-WORKDIR /app
-
-COPY requirements.txt /app/
-
-RUN pip install --no-cache-dir -r requirements.txt
-
-COPY . /app/
-
-EXPOSE 8000
diff --git a/api/docker-compose.yml b/api/docker-compose.yml
deleted file mode 100644
index e38f4b8a..00000000
--- a/api/docker-compose.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-version: "3.9"
-services:
- db:
- image: mysql:8.1.0
- restart: always
- environment:
- MYSQL_DATABASE: 'sigeie_db'
- MYSQL_ROOT_PASSWORD: 'root'
- container_name: sigeie_mysql_db
- ports:
- - "3306:3306"
- volumes:
- - ./data/mysql/db:/var/lib/mysql
- redis:
- image: redis:7.2
- restart: always
- container_name: sigeie_redis_db
- ports:
- - "6379:6379"
- web:
- build: .
- restart: always
- container_name: sigeie_web
- command: ["python", "manage.py", "runserver", "0.0.0.0:8000"]
- volumes:
- - .:/app
- ports:
- - "8000:8000"
- depends_on:
- - db
- - redis
\ No newline at end of file
diff --git a/api/equipments/__init__.py b/api/equipments/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/api/equipments/admin.py b/api/equipments/admin.py
deleted file mode 100644
index 8c38f3f3..00000000
--- a/api/equipments/admin.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.contrib import admin
-
-# Register your models here.
diff --git a/api/equipments/apps.py b/api/equipments/apps.py
deleted file mode 100644
index 0b795db5..00000000
--- a/api/equipments/apps.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from django.apps import AppConfig
-
-
-class EquipmentsConfig(AppConfig):
- default_auto_field = 'django.db.models.BigAutoField'
- name = 'equipments'
diff --git a/api/equipments/migrations/0001_initial.py b/api/equipments/migrations/0001_initial.py
deleted file mode 100644
index 70dd3fa6..00000000
--- a/api/equipments/migrations/0001_initial.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Generated by Django 4.2 on 2024-04-18 17:23
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- initial = True
-
- dependencies = [
- ('places', '0019_delete_atmosfericdischargesystem'),
- ('systems', '0006_remove_equipment_equipmentphoto_and_more'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='EquipmentType',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('type', models.CharField(max_length=50)),
- ('system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='systems.system')),
- ],
- ),
- migrations.CreateModel(
- name='Equipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('photo', models.ImageField(null=True, upload_to='equipment_photos/')),
- ('description', models.CharField(max_length=50)),
- ('equipmentType', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmenttype')),
- ],
- ),
- migrations.CreateModel(
- name='AtmosphericDischargeSystem',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_systems', to='places.place')),
- ('room', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_systems', to='places.room')),
- ('system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_systems', to='systems.system')),
- ],
- options={
- 'db_table': 'atmospheric_discharge_systems',
- },
- ),
- ]
diff --git a/api/equipments/migrations/0002_equipment_placeowner_and_more.py b/api/equipments/migrations/0002_equipment_placeowner_and_more.py
deleted file mode 100644
index 34ec64e4..00000000
--- a/api/equipments/migrations/0002_equipment_placeowner_and_more.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Generated by Django 4.2 on 2024-04-18 18:24
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0004_alter_placeowner_user'),
- ('equipments', '0001_initial'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='equipment',
- name='placeOwner',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='users.placeowner'),
- ),
- migrations.DeleteModel(
- name='AtmosphericDischargeSystem',
- ),
- ]
diff --git a/api/equipments/migrations/0003_atmosphericdischargeequipment.py b/api/equipments/migrations/0003_atmosphericdischargeequipment.py
deleted file mode 100644
index 434456c4..00000000
--- a/api/equipments/migrations/0003_atmosphericdischargeequipment.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Generated by Django 4.2 on 2024-04-24 18:15
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0021_room_place_room_systems'),
- ('equipments', '0002_equipment_placeowner_and_more'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='AtmosphericDischargeEquipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('equipment', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipment')),
- ('room', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.room')),
- ],
- ),
- ]
diff --git a/api/equipments/migrations/0004_rename_equipment_equipmentdetail.py b/api/equipments/migrations/0004_rename_equipment_equipmentdetail.py
deleted file mode 100644
index b7cb03fe..00000000
--- a/api/equipments/migrations/0004_rename_equipment_equipmentdetail.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Generated by Django 4.2 on 2024-04-24 18:54
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0004_alter_placeowner_user'),
- ('equipments', '0003_atmosphericdischargeequipment'),
- ]
-
- operations = [
- migrations.RenameModel(
- old_name='Equipment',
- new_name='EquipmentDetail',
- ),
- ]
diff --git a/api/equipments/migrations/0005_remove_atmosphericdischargeequipment_room.py b/api/equipments/migrations/0005_remove_atmosphericdischargeequipment_room.py
deleted file mode 100644
index f1047511..00000000
--- a/api/equipments/migrations/0005_remove_atmosphericdischargeequipment_room.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Generated by Django 4.2 on 2024-04-24 19:22
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0004_rename_equipment_equipmentdetail'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='atmosphericdischargeequipment',
- name='room',
- ),
- ]
diff --git a/api/equipments/migrations/0006_atmosphericdischargeequipment_area.py b/api/equipments/migrations/0006_atmosphericdischargeequipment_area.py
deleted file mode 100644
index bf889635..00000000
--- a/api/equipments/migrations/0006_atmosphericdischargeequipment_area.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Generated by Django 4.2 on 2024-04-24 19:22
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0022_area_delete_room'),
- ('equipments', '0005_remove_atmosphericdischargeequipment_room'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='atmosphericdischargeequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- ]
diff --git a/api/equipments/migrations/0007_alter_atmosphericdischargeequipment_table_and_more.py b/api/equipments/migrations/0007_alter_atmosphericdischargeequipment_table_and_more.py
deleted file mode 100644
index 8ab0948b..00000000
--- a/api/equipments/migrations/0007_alter_atmosphericdischargeequipment_table_and_more.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Generated by Django 4.2 on 2024-04-24 19:24
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0006_atmosphericdischargeequipment_area'),
- ]
-
- operations = [
- migrations.AlterModelTable(
- name='atmosphericdischargeequipment',
- table='atmospheric_discharge_equipments',
- ),
- migrations.AlterModelTable(
- name='equipmentdetail',
- table='equipment_details',
- ),
- migrations.AlterModelTable(
- name='equipmenttype',
- table='equipment_types',
- ),
- ]
diff --git a/api/equipments/migrations/0008_alter_atmosphericdischargeequipment_table_and_more.py b/api/equipments/migrations/0008_alter_atmosphericdischargeequipment_table_and_more.py
deleted file mode 100644
index d45e74ad..00000000
--- a/api/equipments/migrations/0008_alter_atmosphericdischargeequipment_table_and_more.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Generated by Django 4.2 on 2024-04-24 19:25
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0007_alter_atmosphericdischargeequipment_table_and_more'),
- ]
-
- operations = [
- migrations.AlterModelTable(
- name='atmosphericdischargeequipment',
- table='equipments_atmospheric_discharge_equipments',
- ),
- migrations.AlterModelTable(
- name='equipmentdetail',
- table='equipments_equipment_details',
- ),
- migrations.AlterModelTable(
- name='equipmenttype',
- table='equipments_equipment_types',
- ),
- ]
diff --git a/api/equipments/migrations/0009_rename_equipment_atmosphericdischargeequipment_equipment_detail.py b/api/equipments/migrations/0009_rename_equipment_atmosphericdischargeequipment_equipment_detail.py
deleted file mode 100644
index e522ad03..00000000
--- a/api/equipments/migrations/0009_rename_equipment_atmosphericdischargeequipment_equipment_detail.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Generated by Django 4.2 on 2024-04-24 20:23
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0008_alter_atmosphericdischargeequipment_table_and_more'),
- ]
-
- operations = [
- migrations.RenameField(
- model_name='atmosphericdischargeequipment',
- old_name='equipment',
- new_name='equipment_detail',
- ),
- ]
diff --git a/api/equipments/migrations/0010_rename_type_equipmenttype_name.py b/api/equipments/migrations/0010_rename_type_equipmenttype_name.py
deleted file mode 100644
index 7d8e4a0f..00000000
--- a/api/equipments/migrations/0010_rename_type_equipmenttype_name.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Generated by Django 4.2 on 2024-04-25 12:50
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0009_rename_equipment_atmosphericdischargeequipment_equipment_detail'),
- ]
-
- operations = [
- migrations.RenameField(
- model_name='equipmenttype',
- old_name='type',
- new_name='name',
- ),
- ]
diff --git a/api/equipments/migrations/0011_rename_placeowner_equipmentdetail_place_owner.py b/api/equipments/migrations/0011_rename_placeowner_equipmentdetail_place_owner.py
deleted file mode 100644
index 9ac02fb3..00000000
--- a/api/equipments/migrations/0011_rename_placeowner_equipmentdetail_place_owner.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Generated by Django 4.2 on 2024-04-25 13:29
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0010_rename_type_equipmenttype_name'),
- ]
-
- operations = [
- migrations.RenameField(
- model_name='equipmentdetail',
- old_name='placeOwner',
- new_name='place_owner',
- ),
- ]
diff --git a/api/equipments/migrations/0012_sructeredcablingequipment_iluminationequipment_and_more.py b/api/equipments/migrations/0012_sructeredcablingequipment_iluminationequipment_and_more.py
deleted file mode 100644
index 807a3d82..00000000
--- a/api/equipments/migrations/0012_sructeredcablingequipment_iluminationequipment_and_more.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# Generated by Django 4.2 on 2024-04-25 13:51
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0023_alter_area_place'),
- ('equipments', '0011_rename_placeowner_equipmentdetail_place_owner'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='SructeredCablingEquipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area')),
- ('equipment_detail', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail')),
- ],
- ),
- migrations.CreateModel(
- name='IluminationEquipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area')),
- ('equipment_detail', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail')),
- ],
- ),
- migrations.CreateModel(
- name='FireAlarmEquipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area')),
- ('equipment_detail', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail')),
- ],
- ),
- migrations.CreateModel(
- name='ElectricalLoadEquipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area')),
- ('equipment_detail', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail')),
- ],
- ),
- migrations.CreateModel(
- name='ElectricalLineEquipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area')),
- ('equipment_detail', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail')),
- ],
- ),
- migrations.CreateModel(
- name='ElectricalCircuitEquipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area')),
- ('equipment_detail', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail')),
- ],
- ),
- migrations.CreateModel(
- name='DistributionBoardEquipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area')),
- ('equipment_detail', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail')),
- ],
- ),
- ]
diff --git a/api/equipments/migrations/0013_atmosphericdischargeequipment_system_and_more.py b/api/equipments/migrations/0013_atmosphericdischargeequipment_system_and_more.py
deleted file mode 100644
index d5222883..00000000
--- a/api/equipments/migrations/0013_atmosphericdischargeequipment_system_and_more.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by Django 4.2 on 2024-05-03 13:25
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('equipments', '0012_sructeredcablingequipment_iluminationequipment_and_more'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='atmosphericdischargeequipment',
- name='system',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AddField(
- model_name='distributionboardequipment',
- name='system',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AddField(
- model_name='electricalcircuitequipment',
- name='system',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AddField(
- model_name='electricallineequipment',
- name='system',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AddField(
- model_name='electricalloadequipment',
- name='system',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AddField(
- model_name='firealarmequipment',
- name='system',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AddField(
- model_name='iluminationequipment',
- name='system',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AddField(
- model_name='sructeredcablingequipment',
- name='system',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- ]
diff --git a/api/equipments/migrations/0014_alter_atmosphericdischargeequipment_system_and_more.py b/api/equipments/migrations/0014_alter_atmosphericdischargeequipment_system_and_more.py
deleted file mode 100644
index 88952f33..00000000
--- a/api/equipments/migrations/0014_alter_atmosphericdischargeequipment_system_and_more.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated by Django 4.2 on 2024-05-03 13:28
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('equipments', '0013_atmosphericdischargeequipment_system_and_more'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='atmosphericdischargeequipment',
- name='system',
- field=models.OneToOneField(default=7, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='distributionboardequipment',
- name='system',
- field=models.OneToOneField(default=5, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='electricalcircuitequipment',
- name='system',
- field=models.OneToOneField(default=4, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='electricallineequipment',
- name='system',
- field=models.OneToOneField(default=3, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='electricalloadequipment',
- name='system',
- field=models.OneToOneField(default=2, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='firealarmequipment',
- name='system',
- field=models.OneToOneField(default=8, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='iluminationequipment',
- name='system',
- field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='sructeredcablingequipment',
- name='system',
- field=models.OneToOneField(default=6, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- ]
diff --git a/api/equipments/migrations/0015_rename_sructeredcablingequipment_structuredcablingequipment_and_more.py b/api/equipments/migrations/0015_rename_sructeredcablingequipment_structuredcablingequipment_and_more.py
deleted file mode 100644
index 01b2e558..00000000
--- a/api/equipments/migrations/0015_rename_sructeredcablingequipment_structuredcablingequipment_and_more.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# Generated by Django 4.2 on 2024-05-03 15:38
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('places', '0026_alter_area_place'),
- ('equipments', '0014_alter_atmosphericdischargeequipment_system_and_more'),
- ]
-
- operations = [
- migrations.RenameModel(
- old_name='SructeredCablingEquipment',
- new_name='StructuredCablingEquipment',
- ),
- migrations.AlterModelTable(
- name='distributionboardequipment',
- table='equipments_distribution_board_equipments',
- ),
- migrations.AlterModelTable(
- name='electricalcircuitequipment',
- table='equipments_electrical_circuit_equipments',
- ),
- migrations.AlterModelTable(
- name='electricallineequipment',
- table='equipments_electrical_line_equipments',
- ),
- migrations.AlterModelTable(
- name='electricalloadequipment',
- table='equipments_electrical_load_equipments',
- ),
- migrations.AlterModelTable(
- name='firealarmequipment',
- table='equipments_fire_alarm_equipments',
- ),
- migrations.AlterModelTable(
- name='iluminationequipment',
- table='equipments_ilumination_equipments',
- ),
- migrations.AlterModelTable(
- name='structuredcablingequipment',
- table='equipments_structured_cabling_equipments',
- ),
- ]
diff --git a/api/equipments/migrations/0016_alter_atmosphericdischargeequipment_system.py b/api/equipments/migrations/0016_alter_atmosphericdischargeequipment_system.py
deleted file mode 100644
index e8356204..00000000
--- a/api/equipments/migrations/0016_alter_atmosphericdischargeequipment_system.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Generated by Django 4.2 on 2024-05-03 16:34
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('equipments', '0015_rename_sructeredcablingequipment_structuredcablingequipment_and_more'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='atmosphericdischargeequipment',
- name='system',
- field=models.ForeignKey(default=7, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- ]
diff --git a/api/equipments/migrations/0017_alter_distributionboardequipment_system_and_more.py b/api/equipments/migrations/0017_alter_distributionboardequipment_system_and_more.py
deleted file mode 100644
index 4684b905..00000000
--- a/api/equipments/migrations/0017_alter_distributionboardequipment_system_and_more.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Generated by Django 4.2 on 2024-05-03 16:53
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('equipments', '0016_alter_atmosphericdischargeequipment_system'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='distributionboardequipment',
- name='system',
- field=models.ForeignKey(default=5, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='electricalcircuitequipment',
- name='system',
- field=models.ForeignKey(default=4, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='electricallineequipment',
- name='system',
- field=models.ForeignKey(default=3, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='electricalloadequipment',
- name='system',
- field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='firealarmequipment',
- name='system',
- field=models.ForeignKey(default=8, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='iluminationequipment',
- name='system',
- field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterField(
- model_name='structuredcablingequipment',
- name='system',
- field=models.ForeignKey(default=6, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- ]
diff --git a/api/equipments/migrations/0018_personalequipmenttype.py b/api/equipments/migrations/0018_personalequipmenttype.py
deleted file mode 100644
index 28eece20..00000000
--- a/api/equipments/migrations/0018_personalequipmenttype.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Generated by Django 4.2 on 2024-05-13 16:21
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0004_alter_placeowner_user'),
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('equipments', '0017_alter_distributionboardequipment_system_and_more'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='PersonalEquipmentType',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=50)),
- ('place_owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='users.placeowner')),
- ('system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='systems.system')),
- ],
- options={
- 'db_table': 'equipments_personal_equipment_types',
- },
- ),
- ]
diff --git a/api/equipments/migrations/0019_remove_equipmentdetail_description_and_more.py b/api/equipments/migrations/0019_remove_equipmentdetail_description_and_more.py
deleted file mode 100644
index 29fded19..00000000
--- a/api/equipments/migrations/0019_remove_equipmentdetail_description_and_more.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Generated by Django 4.2 on 2024-05-23 14:16
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('places', '0028_place_photo'),
- ('equipments', '0018_personalequipmenttype'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='equipmentdetail',
- name='description',
- ),
- migrations.RemoveField(
- model_name='equipmentdetail',
- name='photo',
- ),
- migrations.CreateModel(
- name='RefrigerationEquipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area')),
- ('equipment_detail', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail')),
- ('system', models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='systems.system')),
- ],
- options={
- 'db_table': 'refrigeration_equipments',
- },
- ),
- migrations.CreateModel(
- name='EquipmentPhoto',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('photo', models.ImageField(null=True, upload_to='equipment_photos/')),
- ('description', models.CharField(max_length=50)),
- ('equipment_detail', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail')),
- ],
- ),
- ]
diff --git a/api/equipments/migrations/0020_remove_equipmentphoto_equipment_detail_and_more.py b/api/equipments/migrations/0020_remove_equipmentphoto_equipment_detail_and_more.py
deleted file mode 100644
index 22ee62c0..00000000
--- a/api/equipments/migrations/0020_remove_equipmentphoto_equipment_detail_and_more.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Generated by Django 4.2 on 2024-06-05 17:36
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0019_remove_equipmentdetail_description_and_more'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='equipmentphoto',
- name='equipment_detail',
- ),
- migrations.AddField(
- model_name='equipmentphoto',
- name='equipmentType',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmenttype'),
- ),
- migrations.AddField(
- model_name='equipmentphoto',
- name='personalEquipmentType',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.personalequipmenttype'),
- ),
- migrations.AlterField(
- model_name='equipmentphoto',
- name='description',
- field=models.CharField(max_length=50, null=True),
- ),
- ]
diff --git a/api/equipments/migrations/0021_remove_equipmentphoto_equipmenttype_and_more.py b/api/equipments/migrations/0021_remove_equipmentphoto_equipmenttype_and_more.py
deleted file mode 100644
index 673f7782..00000000
--- a/api/equipments/migrations/0021_remove_equipmentphoto_equipmenttype_and_more.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Generated by Django 4.2 on 2024-06-05 18:28
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0020_remove_equipmentphoto_equipment_detail_and_more'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='equipmentphoto',
- name='equipmentType',
- ),
- migrations.RemoveField(
- model_name='equipmentphoto',
- name='personalEquipmentType',
- ),
- migrations.AddField(
- model_name='equipmentdetail',
- name='personalEquipmentType',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.personalequipmenttype'),
- ),
- migrations.AlterField(
- model_name='equipmentdetail',
- name='equipmentType',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmenttype'),
- ),
- ]
diff --git a/api/equipments/migrations/0022_equipmentphoto_equipment_detail.py b/api/equipments/migrations/0022_equipmentphoto_equipment_detail.py
deleted file mode 100644
index 34d12076..00000000
--- a/api/equipments/migrations/0022_equipmentphoto_equipment_detail.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by Django 4.2 on 2024-06-12 20:29
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0021_remove_equipmentphoto_equipmenttype_and_more'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='equipmentphoto',
- name='equipment_detail',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='equipments.equipmentdetail'),
- ),
- ]
diff --git a/api/equipments/migrations/0023_rename_equipmentdetail_equipment_and_more.py b/api/equipments/migrations/0023_rename_equipmentdetail_equipment_and_more.py
deleted file mode 100644
index 1bca0743..00000000
--- a/api/equipments/migrations/0023_rename_equipmentdetail_equipment_and_more.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# Generated by Django 4.2 on 2024-06-14 13:54
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0006_alter_placeowner_user'),
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('equipments', '0022_equipmentphoto_equipment_detail'),
- ]
-
- operations = [
- migrations.RenameModel(
- old_name='EquipmentDetail',
- new_name='Equipment',
- ),
- migrations.RenameModel(
- old_name='EquipmentType',
- new_name='GenericEquipmentCategory',
- ),
- migrations.RenameModel(
- old_name='PersonalEquipmentType',
- new_name='PersonalEquipmentCategory',
- ),
- migrations.RenameField(
- model_name='atmosphericdischargeequipment',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.RenameField(
- model_name='distributionboardequipment',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.RenameField(
- model_name='electricalcircuitequipment',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.RenameField(
- model_name='electricallineequipment',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.RenameField(
- model_name='electricalloadequipment',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.RenameField(
- model_name='equipment',
- old_name='equipmentType',
- new_name='genericEquipmentCategory',
- ),
- migrations.RenameField(
- model_name='equipment',
- old_name='personalEquipmentType',
- new_name='personalEquipmentCategory',
- ),
- migrations.RenameField(
- model_name='equipmentphoto',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.RenameField(
- model_name='firealarmequipment',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.RenameField(
- model_name='iluminationequipment',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.RenameField(
- model_name='refrigerationequipment',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.RenameField(
- model_name='structuredcablingequipment',
- old_name='equipment_detail',
- new_name='equipment',
- ),
- migrations.AlterModelTable(
- name='genericequipmentcategory',
- table='equipments_generic_equipment_categories',
- ),
- migrations.AlterModelTable(
- name='personalequipmentcategory',
- table='equipments_personal_equipment_categories',
- ),
- ]
diff --git a/api/equipments/migrations/0024_rename_genericequipmentcategory_equipment_generic_equipment_category_and_more.py b/api/equipments/migrations/0024_rename_genericequipmentcategory_equipment_generic_equipment_category_and_more.py
deleted file mode 100644
index 1c60d476..00000000
--- a/api/equipments/migrations/0024_rename_genericequipmentcategory_equipment_generic_equipment_category_and_more.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Generated by Django 4.2 on 2024-06-14 15:38
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0023_rename_equipmentdetail_equipment_and_more'),
- ]
-
- operations = [
- migrations.RenameField(
- model_name='equipment',
- old_name='genericEquipmentCategory',
- new_name='generic_equipment_category',
- ),
- migrations.RenameField(
- model_name='equipment',
- old_name='personalEquipmentCategory',
- new_name='personal_equipment_category',
- ),
- ]
diff --git a/api/equipments/migrations/0025_alter_atmosphericdischargeequipment_area_and_more.py b/api/equipments/migrations/0025_alter_atmosphericdischargeequipment_area_and_more.py
deleted file mode 100644
index 8b111a11..00000000
--- a/api/equipments/migrations/0025_alter_atmosphericdischargeequipment_area_and_more.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Generated by Django 4.2 on 2024-06-17 14:34
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0031_remove_place_access_code'),
- ('equipments', '0024_rename_genericequipmentcategory_equipment_generic_equipment_category_and_more'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='atmosphericdischargeequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='AtmosphericDischargeEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='distributionboardequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='DistributionBoardEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricalcircuitequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ElectricalCircuitEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricallineequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ElectricalLineEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricalloadequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ElectricalLoadEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='firealarmequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='firealarmequipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='iluminationequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='IluminationEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='refrigerationequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='RefrigerationEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='structuredcablingequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='StructuredCablingEquipment', to='places.area'),
- ),
- ]
diff --git a/api/equipments/migrations/0026_alter_atmosphericdischargeequipment_area_and_more.py b/api/equipments/migrations/0026_alter_atmosphericdischargeequipment_area_and_more.py
deleted file mode 100644
index 5d6bcc24..00000000
--- a/api/equipments/migrations/0026_alter_atmosphericdischargeequipment_area_and_more.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Generated by Django 4.2 on 2024-06-17 16:34
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0031_remove_place_access_code'),
- ('equipments', '0025_alter_atmosphericdischargeequipment_area_and_more'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='atmosphericdischargeequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- migrations.AlterField(
- model_name='distributionboardequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricalcircuitequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricallineequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricalloadequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- migrations.AlterField(
- model_name='firealarmequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- migrations.AlterField(
- model_name='iluminationequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- migrations.AlterField(
- model_name='refrigerationequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- migrations.AlterField(
- model_name='structuredcablingequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.area'),
- ),
- ]
diff --git a/api/equipments/migrations/0027_alter_atmosphericdischargeequipment_area_and_more.py b/api/equipments/migrations/0027_alter_atmosphericdischargeequipment_area_and_more.py
deleted file mode 100644
index ebbb285b..00000000
--- a/api/equipments/migrations/0027_alter_atmosphericdischargeequipment_area_and_more.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Generated by Django 4.2 on 2024-06-17 16:59
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0031_remove_place_access_code'),
- ('equipments', '0026_alter_atmosphericdischargeequipment_area_and_more'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='atmosphericdischargeequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='AtmosphericDischargeEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='distributionboardequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='DistributionBoardEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricalcircuitequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ElectricalCircuitEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricallineequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ElectricalLineEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricalloadequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ElectricalLoadEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='firealarmequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='firealarmequipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='iluminationequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='IluminationEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='refrigerationequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='RefrigerationEquipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='structuredcablingequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='StructuredCablingEquipment', to='places.area'),
- ),
- ]
diff --git a/api/equipments/migrations/0028_alter_atmosphericdischargeequipment_area_and_more.py b/api/equipments/migrations/0028_alter_atmosphericdischargeequipment_area_and_more.py
deleted file mode 100644
index 324c01eb..00000000
--- a/api/equipments/migrations/0028_alter_atmosphericdischargeequipment_area_and_more.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Generated by Django 4.2 on 2024-06-18 20:55
-# Generated by Django 4.2 on 2024-06-19 17:19
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0031_remove_place_access_code'),
- ('equipments', '0027_alter_atmosphericdischargeequipment_area_and_more'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='atmosphericdischargeequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_equipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='distributionboardequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='distribution_board_equipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricalcircuitequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='electrical_circuit_equipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricallineequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='electrical_line_equipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='electricalloadequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='electrical_load_equipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='firealarmequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='fire_alarm_equipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='iluminationequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ilumination_equipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='refrigerationequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='refrigeration_equipment', to='places.area'),
- ),
- migrations.AlterField(
- model_name='structuredcablingequipment',
- name='area',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='structured_cabling_equipment', to='places.area'),
- ),
- ]
diff --git a/api/equipments/migrations/0029_alter_equipment_place_owner_and_more.py b/api/equipments/migrations/0029_alter_equipment_place_owner_and_more.py
deleted file mode 100644
index 2c28d3f2..00000000
--- a/api/equipments/migrations/0029_alter_equipment_place_owner_and_more.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# Generated by Django 4.2 on 2024-06-21 12:47
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0006_alter_placeowner_user'),
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('equipments', '0028_alter_atmosphericdischargeequipment_area_and_more'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='equipment',
- name='place_owner',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='equipment', to='users.placeowner'),
- ),
- migrations.AlterField(
- model_name='firealarmequipment',
- name='equipment',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='fire_alarm', to='equipments.equipment'),
- ),
- migrations.AlterField(
- model_name='refrigerationequipment',
- name='system',
- field=models.ForeignKey(default=9, on_delete=django.db.models.deletion.CASCADE, to='systems.system'),
- ),
- migrations.AlterModelTable(
- name='refrigerationequipment',
- table='equipments_refrigeration_equipments',
- ),
- ]
diff --git a/api/equipments/migrations/0030_alter_equipment_place_owner.py b/api/equipments/migrations/0030_alter_equipment_place_owner.py
deleted file mode 100644
index 6eedb78d..00000000
--- a/api/equipments/migrations/0030_alter_equipment_place_owner.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Generated by Django 4.2 on 2024-06-21 18:13
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0006_alter_placeowner_user'),
- ('equipments', '0029_alter_equipment_place_owner_and_more'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='equipment',
- name='place_owner',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='users.placeowner'),
- ),
- ]
diff --git a/api/equipments/migrations/0031_alter_atmosphericdischargeequipment_table_and_more.py b/api/equipments/migrations/0031_alter_atmosphericdischargeequipment_table_and_more.py
deleted file mode 100644
index 7448428c..00000000
--- a/api/equipments/migrations/0031_alter_atmosphericdischargeequipment_table_and_more.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# Generated by Django 4.2 on 2024-06-30 14:55
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0030_alter_equipment_place_owner'),
- ]
-
- operations = [
- migrations.AlterModelTable(
- name='atmosphericdischargeequipment',
- table='atmospheric_discharges',
- ),
- migrations.AlterModelTable(
- name='distributionboardequipment',
- table='distribution_boards',
- ),
- migrations.AlterModelTable(
- name='electricalcircuitequipment',
- table='electrical_circuits',
- ),
- migrations.AlterModelTable(
- name='electricallineequipment',
- table='electrical_lines',
- ),
- migrations.AlterModelTable(
- name='electricalloadequipment',
- table='electrical_loads',
- ),
- migrations.AlterModelTable(
- name='equipment',
- table='equipments',
- ),
- migrations.AlterModelTable(
- name='equipmentphoto',
- table='equipment_photos',
- ),
- migrations.AlterModelTable(
- name='firealarmequipment',
- table='fire_alarms',
- ),
- migrations.AlterModelTable(
- name='genericequipmentcategory',
- table='generic_equipment_categories',
- ),
- migrations.AlterModelTable(
- name='iluminationequipment',
- table='illuminations',
- ),
- migrations.AlterModelTable(
- name='personalequipmentcategory',
- table='personal_equipment_categories',
- ),
- migrations.AlterModelTable(
- name='refrigerationequipment',
- table='refrigeration_equipments',
- ),
- migrations.AlterModelTable(
- name='structuredcablingequipment',
- table='structured_cabling',
- ),
- ]
diff --git a/api/equipments/migrations/0032_alter_atmosphericdischargeequipment_table_and_more.py b/api/equipments/migrations/0032_alter_atmosphericdischargeequipment_table_and_more.py
deleted file mode 100644
index 05913c04..00000000
--- a/api/equipments/migrations/0032_alter_atmosphericdischargeequipment_table_and_more.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# Generated by Django 4.2 on 2024-06-30 14:58
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0031_alter_atmosphericdischargeequipment_table_and_more'),
- ]
-
- operations = [
- migrations.AlterModelTable(
- name='atmosphericdischargeequipment',
- table='equipments_atmospheric_discharges',
- ),
- migrations.AlterModelTable(
- name='distributionboardequipment',
- table='equipments_distribution_boards',
- ),
- migrations.AlterModelTable(
- name='electricalcircuitequipment',
- table='equipments_electrical_circuits',
- ),
- migrations.AlterModelTable(
- name='electricallineequipment',
- table='equipments_electrical_lines',
- ),
- migrations.AlterModelTable(
- name='electricalloadequipment',
- table='equipments_electrical_loads',
- ),
- migrations.AlterModelTable(
- name='equipmentphoto',
- table='equipments_photos',
- ),
- migrations.AlterModelTable(
- name='firealarmequipment',
- table='equipments_fire_alarms',
- ),
- migrations.AlterModelTable(
- name='iluminationequipment',
- table='equipments_illuminations',
- ),
- migrations.AlterModelTable(
- name='refrigerationequipment',
- table='equipments_refrigeration',
- ),
- migrations.AlterModelTable(
- name='structuredcablingequipment',
- table='equipments_structured_cabling',
- ),
- ]
diff --git a/api/equipments/migrations/0033_distributionboardequipment_dps_and_more.py b/api/equipments/migrations/0033_distributionboardequipment_dps_and_more.py
deleted file mode 100644
index cdd2e893..00000000
--- a/api/equipments/migrations/0033_distributionboardequipment_dps_and_more.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# Generated by Django 4.2 on 2024-07-09 18:42
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0032_alter_atmosphericdischargeequipment_table_and_more'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='distributionboardequipment',
- name='dps',
- field=models.BooleanField(default=False),
- ),
- migrations.AddField(
- model_name='distributionboardequipment',
- name='dr',
- field=models.BooleanField(default=False),
- ),
- migrations.AddField(
- model_name='distributionboardequipment',
- name='grounding',
- field=models.BooleanField(default=False),
- ),
- migrations.AddField(
- model_name='distributionboardequipment',
- name='method_installation',
- field=models.CharField(max_length=50, null=True),
- ),
- migrations.AddField(
- model_name='distributionboardequipment',
- name='power',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='distributionboardequipment',
- name='type_material',
- field=models.CharField(max_length=30, null=True),
- ),
- migrations.AddField(
- model_name='electricalcircuitequipment',
- name='isolament',
- field=models.CharField(default=None, max_length=30),
- ),
- migrations.AddField(
- model_name='electricalcircuitequipment',
- name='size',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='electricalloadequipment',
- name='brand',
- field=models.CharField(default=None, max_length=30),
- ),
- migrations.AddField(
- model_name='electricalloadequipment',
- name='model',
- field=models.CharField(default=None, max_length=50),
- ),
- migrations.AddField(
- model_name='electricalloadequipment',
- name='power',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='electricalloadequipment',
- name='quantity',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='iluminationequipment',
- name='format',
- field=models.CharField(default=None, max_length=30),
- ),
- migrations.AddField(
- model_name='iluminationequipment',
- name='power',
- field=models.IntegerField(default=1),
- ),
- migrations.AddField(
- model_name='iluminationequipment',
- name='quantity',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='iluminationequipment',
- name='tecnology',
- field=models.CharField(default=None, max_length=30),
- ),
- migrations.AddField(
- model_name='refrigerationequipment',
- name='power',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='refrigerationequipment',
- name='quantity',
- field=models.IntegerField(default=0),
- ),
- ]
diff --git a/api/equipments/migrations/0034_atmosphericdischargeequipment_quantity_and_more.py b/api/equipments/migrations/0034_atmosphericdischargeequipment_quantity_and_more.py
deleted file mode 100644
index 6affde09..00000000
--- a/api/equipments/migrations/0034_atmosphericdischargeequipment_quantity_and_more.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# Generated by Django 4.2 on 2024-07-17 17:25
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('equipments', '0033_distributionboardequipment_dps_and_more'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='atmosphericdischargeequipment',
- name='quantity',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='distributionboardequipment',
- name='quantity',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='electricalcircuitequipment',
- name='quantity',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='electricallineequipment',
- name='quantity',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='firealarmequipment',
- name='quantity',
- field=models.IntegerField(default=0),
- ),
- migrations.AddField(
- model_name='structuredcablingequipment',
- name='quantity',
- field=models.IntegerField(default=0),
- ),
- ]
diff --git a/api/equipments/migrations/__init__.py b/api/equipments/migrations/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/api/equipments/mixins.py b/api/equipments/mixins.py
deleted file mode 100644
index 51d406a4..00000000
--- a/api/equipments/mixins.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from rest_framework import serializers
-
-
-class ValidateAreaMixin:
-
- def validate_area(self, value):
- """
- Garante que a area pertence ao place owner ou ao editor.
- """
- user = self.context['request'].user
- if value.place.place_owner != user.place_owner and not value.place.editors.filter(user=user).exists():
- raise serializers.ValidationError("You are not the owner or editor of this place")
- return value
-
-
-class EquipmentCategoryMixin:
-
- def get_equipment_category(self, obj):
- equipment = obj.equipment
- if equipment.generic_equipment_category is not None:
- return equipment.generic_equipment_category.name
- elif equipment.personal_equipment_category is not None:
- return equipment.personal_equipment_category.name
- return None
diff --git a/api/equipments/models.py b/api/equipments/models.py
deleted file mode 100644
index b74bdcf0..00000000
--- a/api/equipments/models.py
+++ /dev/null
@@ -1,163 +0,0 @@
-from django.db import models
-from places.models import Place, Area
-from systems.models import System
-from users.models import PlaceOwner
-
-
-class PersonalEquipmentCategory(models.Model):
- name = models.CharField(max_length=50)
- system = models.ForeignKey(System, on_delete=models.CASCADE)
- place_owner = models.ForeignKey(PlaceOwner, on_delete=models.CASCADE, null=True)
-
- def __str__(self):
- return self.name
-
- class Meta:
- db_table = 'personal_equipment_categories'
-
-
-class GenericEquipmentCategory(models.Model):
- name = models.CharField(max_length=50)
- system = models.ForeignKey(System, on_delete=models.CASCADE)
-
- def __str__(self):
- return self.name
-
- class Meta:
- db_table = 'generic_equipment_categories'
-
-
-class Equipment(models.Model):
- generic_equipment_category = models.ForeignKey(GenericEquipmentCategory, on_delete=models.CASCADE, null=True)
- personal_equipment_category = models.ForeignKey(PersonalEquipmentCategory, on_delete=models.CASCADE, null=True)
- place_owner = models.ForeignKey(PlaceOwner, on_delete=models.CASCADE, null=True)
-
- def __str__(self):
- if self.generic_equipment_category is not None:
- return str(self.generic_equipment_category.name)
- elif self.personal_equipment_category is not None:
- return str(self.personal_equipment_category.name)
- return 'No category'
-
- class Meta:
- db_table = 'equipments'
-
-
-class EquipmentPhoto(models.Model):
- photo = models.ImageField(null=True, upload_to='equipment_photos/')
- description = models.CharField(max_length=50, null=True)
- equipment = models.ForeignKey(Equipment, on_delete=models.CASCADE, null=True)
-
- def __str__(self):
- return self.description
-
- class Meta:
- db_table = 'equipments_photos'
-
-
-class IluminationEquipment(models.Model):
- area = models.ForeignKey(Area, on_delete=models.CASCADE, null=True, related_name="ilumination_equipment")
- equipment = models.OneToOneField(Equipment, on_delete=models.CASCADE, null=True)
- system = models.ForeignKey(System, on_delete=models.CASCADE, default=1)
- power = models.IntegerField(default=1)
- tecnology = models.CharField(max_length=30, default=None)
- format = models.CharField(max_length=30, default=None)
- quantity = models.IntegerField(default=0)
-
-
- class Meta:
- db_table = 'equipments_illuminations'
-
-
-class ElectricalLoadEquipment(models.Model):
- area = models.ForeignKey(Area, on_delete=models.CASCADE, null=True, related_name="electrical_load_equipment")
- equipment = models.OneToOneField(Equipment, on_delete=models.CASCADE, null=True)
- system = models.ForeignKey(System, on_delete=models.CASCADE, default=2)
- brand = models.CharField(max_length=30, default=None)
- model = models.CharField(max_length=50, default=None)
- power = models.IntegerField(default=0)
- quantity = models.IntegerField(default=0)
-
-
- class Meta:
- db_table = 'equipments_electrical_loads'
-
-
-class ElectricalLineEquipment(models.Model):
- area = models.ForeignKey(Area, on_delete=models.CASCADE, null=True, related_name="electrical_line_equipment")
- equipment = models.OneToOneField(Equipment, on_delete=models.CASCADE, null=True)
- system = models.ForeignKey(System, on_delete=models.CASCADE, default=3)
- quantity = models.IntegerField(default=0)
-
- class Meta:
- db_table = 'equipments_electrical_lines'
-
-
-class ElectricalCircuitEquipment(models.Model):
- area = models.ForeignKey(Area, on_delete=models.CASCADE, null=True, related_name='electrical_circuit_equipment')
- equipment = models.OneToOneField(Equipment, on_delete=models.CASCADE, null=True)
- system = models.ForeignKey(System, on_delete=models.CASCADE, default=4)
- size = models.IntegerField(default=0)
- isolament = models.CharField(max_length=30, default=None)
- quantity = models.IntegerField(default=0)
-
- class Meta:
- db_table = 'equipments_electrical_circuits'
-
-
-class DistributionBoardEquipment(models.Model):
- area = models.ForeignKey(Area, on_delete=models.CASCADE, null=True, related_name="distribution_board_equipment")
- equipment = models.OneToOneField(Equipment, on_delete=models.CASCADE, null=True)
- system = models.ForeignKey(System, on_delete=models.CASCADE, default=5)
- power = models.IntegerField(default=0)
- dr = models.BooleanField(default=False)
- dps = models.BooleanField(default=False)
- grounding = models.BooleanField(default=False)
- type_material = models.CharField(max_length=30, null=True)
- method_installation = models.CharField(max_length=50, null=True)
- quantity = models.IntegerField(default=0)
-
-
- class Meta:
- db_table = 'equipments_distribution_boards'
-
-
-class StructuredCablingEquipment(models.Model):
- area = models.ForeignKey(Area, on_delete=models.CASCADE, null=True, related_name="structured_cabling_equipment")
- equipment = models.OneToOneField(Equipment, on_delete=models.CASCADE, null=True)
- system = models.ForeignKey(System, on_delete=models.CASCADE, default=6)
- quantity = models.IntegerField(default=0)
-
- class Meta:
- db_table = 'equipments_structured_cabling'
-
-
-class AtmosphericDischargeEquipment(models.Model):
- area = models.ForeignKey(Area, on_delete=models.CASCADE, null=True, related_name="atmospheric_discharge_equipment")
- equipment = models.OneToOneField(Equipment, on_delete=models.CASCADE, null=True)
- system = models.ForeignKey(System, on_delete=models.CASCADE, default=7)
- quantity = models.IntegerField(default=0)
-
- class Meta:
- db_table = 'equipments_atmospheric_discharges'
-
-
-class FireAlarmEquipment(models.Model):
- area = models.ForeignKey(Area, on_delete=models.CASCADE, null=True, related_name="fire_alarm_equipment")
- equipment = models.OneToOneField(Equipment, on_delete=models.CASCADE, null=True, related_name="fire_alarm")
- system = models.ForeignKey(System, on_delete=models.CASCADE, default=8)
- quantity = models.IntegerField(default=0)
-
- class Meta:
- db_table = 'equipments_fire_alarms'
-
-
-class RefrigerationEquipment(models.Model):
- area = models.ForeignKey(Area, on_delete=models.CASCADE, null=True, related_name="refrigeration_equipment")
- equipment = models.OneToOneField(Equipment, on_delete=models.CASCADE, null=True)
- system = models.ForeignKey(System, on_delete=models.CASCADE, default=9)
- power = models.IntegerField(default=0)
- quantity = models.IntegerField(default=0)
-
- class Meta:
- db_table = 'equipments_refrigeration'
diff --git a/api/equipments/permissions.py b/api/equipments/permissions.py
deleted file mode 100644
index 21377d5a..00000000
--- a/api/equipments/permissions.py
+++ /dev/null
@@ -1,47 +0,0 @@
-from rest_framework.permissions import BasePermission
-
-from users.models import PlaceOwner
-
-
-def get_place_owner_or_create(user):
- try:
- return user.place_owner
- except PlaceOwner.DoesNotExist:
- return PlaceOwner.objects.create(user=user)
-
-
-class IsOwner(BasePermission):
- def has_object_permission(self, request, view, obj):
- get_place_owner_or_create(request.user)
- return obj.place_owner == request.user.place_owner
-
-
-class IsPlaceOwner(BasePermission):
- def has_object_permission(self, request, view, obj):
- if obj.place_owner == request.user.place_owner:
- return True
- return False
-
-
-class IsEquipmentOwner(BasePermission):
- def has_object_permission(self, request, view, obj):
- if obj.equipment and obj.equipment.place_owner:
- return obj.equipment.place_owner == request.user.place_owner
- return False
-
-
-class IsEquipmentEditor(BasePermission):
- def has_object_permission(self, request, view, obj):
- return obj.place_owner.places.editors.filter(user=request.user).exists()
-
-
-class IsEquipmentEditorPhoto(BasePermission):
- def has_object_permission(self, request, view, obj):
- return obj.equipment.place_owner.places.editors.filter(user=request.user).exists()
-
-
-class IsSpecificEquipmentEditor(BasePermission):
- def has_object_permission(self, request, view, obj):
- if obj.area and obj.area.place:
- return obj.area.place.editors.filter(user=request.user).exists()
- return False
diff --git a/api/equipments/serializers.py b/api/equipments/serializers.py
deleted file mode 100644
index 0ded426a..00000000
--- a/api/equipments/serializers.py
+++ /dev/null
@@ -1,259 +0,0 @@
-import base64
-from django.core.files.base import ContentFile
-from rest_framework import serializers
-from .models import *
-
-from .mixins import ValidateAreaMixin, EquipmentCategoryMixin
-
-
-class PersonalEquipmentCategorySerializer(serializers.ModelSerializer):
- class Meta:
- model = PersonalEquipmentCategory
- fields = '__all__'
-
-
-class GenericEquipmentCategorySerializer(serializers.ModelSerializer):
- class Meta:
- model = GenericEquipmentCategory
- fields = '__all__'
-
-
-class EquipmentPhotoSerializer(serializers.ModelSerializer):
- photo = serializers.CharField(write_only=True)
- photo_base64 = serializers.SerializerMethodField()
-
- class Meta:
- model = EquipmentPhoto
- fields = ['id', 'photo', 'photo_base64', 'description', 'equipment']
-
- def create(self, validated_data):
- photo_data = validated_data.pop('photo')
- try:
- format, imgstr = photo_data.split(';base64,')
- ext = format.split('/')[-1]
- photo = ContentFile(base64.b64decode(imgstr), name='temp.' + ext)
- except ValueError:
- raise serializers.ValidationError("Invalid image data")
-
- equipment_photo = EquipmentPhoto.objects.create(photo=photo, **validated_data)
- return equipment_photo
-
- def update(self, instance, validated_data):
- photo_data = validated_data.pop('photo', None)
- if photo_data:
- try:
- format, imgstr = photo_data.split(';base64,')
- ext = format.split('/')[-1]
- photo = ContentFile(base64.b64decode(imgstr), name='temp.' + ext)
- instance.photo = photo
- except ValueError:
- raise serializers.ValidationError("Invalid image data")
-
- instance.description = validated_data.get('description', instance.description)
- instance.equipment = validated_data.get('equipment', instance.equipment)
- instance.save()
- return instance
-
- def get_photo_base64(self, obj):
- if obj.photo:
- with obj.photo.open('rb') as image_file:
- return 'data:image/jpeg;base64,' + base64.b64encode(image_file.read()).decode('utf-8')
- return None
-
-
-class FireAlarmEquipmentSerializer(ValidateAreaMixin, serializers.ModelSerializer):
- class Meta:
- model = FireAlarmEquipment
- fields = '__all__'
-
-
-class AtmosphericDischargeEquipmentSerializer(ValidateAreaMixin, serializers.ModelSerializer):
- class Meta:
- model = AtmosphericDischargeEquipment
- fields = '__all__'
-
-
-class StructuredCablingEquipmentSerializer(ValidateAreaMixin, serializers.ModelSerializer):
- class Meta:
- model = StructuredCablingEquipment
- fields = '__all__'
-
-
-class DistributionBoardEquipmentSerializer(ValidateAreaMixin, serializers.ModelSerializer):
- class Meta:
- model = DistributionBoardEquipment
- fields = '__all__'
-
-
-class ElectricalCircuitEquipmentSerializer(ValidateAreaMixin, serializers.ModelSerializer):
- class Meta:
- model = ElectricalCircuitEquipment
- fields = '__all__'
-
-
-class ElectricalLineEquipmentSerializer(ValidateAreaMixin, serializers.ModelSerializer):
- class Meta:
- model = ElectricalLineEquipment
- fields = '__all__'
-
-
-class ElectricalLoadEquipmentSerializer(ValidateAreaMixin, serializers.ModelSerializer):
- class Meta:
- model = ElectricalLoadEquipment
- fields = '__all__'
-
-
-class IluminationEquipmentSerializer(ValidateAreaMixin, serializers.ModelSerializer):
- class Meta:
- model = IluminationEquipment
- fields = '__all__'
-
-
-class RefrigerationEquipmentSerializer(ValidateAreaMixin, serializers.ModelSerializer):
- class Meta:
- model = RefrigerationEquipment
- fields = '__all__'
-
-
-class FireAlarmEquipmentResponseSerializer(ValidateAreaMixin, EquipmentCategoryMixin, serializers.ModelSerializer):
- equipment_category = serializers.SerializerMethodField()
-
- class Meta:
- model = FireAlarmEquipment
- fields = ['id', 'area', 'equipment_category', 'system', 'quantity']
-
-
-class AtmosphericDischargeEquipmentResponseSerializer(EquipmentCategoryMixin, serializers.ModelSerializer):
- equipment_category = serializers.SerializerMethodField()
-
- class Meta:
- model = AtmosphericDischargeEquipment
- fields = ['id', 'area', 'equipment_category', 'system', 'quantity']
-
-
-class StructuredCablingEquipmentResponseSerializer(EquipmentCategoryMixin, serializers.ModelSerializer):
- equipment_category = serializers.SerializerMethodField()
-
- class Meta:
- model = StructuredCablingEquipment
- fields = ['id', 'area', 'equipment_category', 'system', 'quantity']
-
-
-class DistributionBoardEquipmentResponseSerializer(EquipmentCategoryMixin, serializers.ModelSerializer):
- equipment_category = serializers.SerializerMethodField()
-
- class Meta:
- model = DistributionBoardEquipment
- fields = ['id', 'area', 'equipment_category', 'system', 'power', 'dr', 'dps', 'grounding', 'type_material', 'method_installation', 'quantity']
-
-
-class ElectricalCircuitEquipmentResponseSerializer(EquipmentCategoryMixin, serializers.ModelSerializer):
- equipment_category = serializers.SerializerMethodField()
-
- class Meta:
- model = ElectricalCircuitEquipment
- fields = ['id', 'area', 'equipment_category', 'system', 'size', 'isolament', 'quantity']
-
-
-class ElectricalLineEquipmentResponseSerializer(EquipmentCategoryMixin, serializers.ModelSerializer):
- equipment_category = serializers.SerializerMethodField()
-
- class Meta:
- model = ElectricalLineEquipment
- fields = ['id', 'area', 'equipment_category', 'system', 'quantity']
-
-
-class ElectricalLoadEquipmentResponseSerializer(EquipmentCategoryMixin, serializers.ModelSerializer):
- equipment_category = serializers.SerializerMethodField()
-
- class Meta:
- model = ElectricalLoadEquipment
- fields = ['id', 'area', 'equipment_category', 'system', 'quantity']
-
-
-class IluminationEquipmentResponseSerializer(EquipmentCategoryMixin, serializers.ModelSerializer):
- equipment_category = serializers.SerializerMethodField()
-
- class Meta:
- model = IluminationEquipment
- fields = ['id', 'area', 'equipment_category', 'system', 'quantity']
-
-
-class RefrigerationEquipmentResponseSerializer(EquipmentCategoryMixin, serializers.ModelSerializer):
- equipment_category = serializers.SerializerMethodField()
-
- class Meta:
- model = RefrigerationEquipment
- fields = ['id', 'area', 'equipment_category', 'system', 'power', 'quantity']
-
-
-class EquipmentSerializer(serializers.ModelSerializer):
- fire_alarm_equipment = FireAlarmEquipmentSerializer(required=False)
- atmospheric_discharge_equipment = AtmosphericDischargeEquipmentSerializer(required=False)
- structured_cabling_equipment = StructuredCablingEquipmentSerializer(required=False)
- distribution_board_equipment = DistributionBoardEquipmentSerializer(required=False)
- electrical_circuit_equipment = ElectricalCircuitEquipmentSerializer(required=False)
- electrical_line_equipment = ElectricalLineEquipmentSerializer(required=False)
- electrical_load_equipment = ElectricalLoadEquipmentSerializer(required=False)
- ilumination_equipment = IluminationEquipmentSerializer(required=False)
- refrigeration_equipment = RefrigerationEquipmentSerializer(required=False)
-
- class Meta:
- model = Equipment
- fields = '__all__'
- extra_kwargs = {'place_owner': {'read_only': True}}
-
- def create(self, validated_data):
- request = self.context.get('request')
- validated_data['place_owner'] = request.user.place_owner
-
- fire_alarm_data = validated_data.pop('fire_alarm_equipment', None)
- atmospheric_discharge_data = validated_data.pop('atmospheric_discharge_equipment', None)
- structured_cabling_data = validated_data.pop('structured_cabling_equipment', None)
- distribution_board_data = validated_data.pop('distribution_board_equipment', None)
- electrical_circuit_data = validated_data.pop('electrical_circuit_equipment', None)
- electrical_line_data = validated_data.pop('electrical_line_equipment', None)
- electrical_load_data = validated_data.pop('electrical_load_equipment', None)
- ilumination_equipment_data = validated_data.pop('ilumination_equipment', None)
- refrigeration_equipment_data = validated_data.pop('refrigeration_equipment', None)
-
- equipment = Equipment.objects.create(**validated_data)
-
- if fire_alarm_data:
- if 'equipment' in fire_alarm_data:
- fire_alarm_data.pop('equipment')
- FireAlarmEquipment.objects.create(equipment=equipment, **fire_alarm_data)
- elif atmospheric_discharge_data:
- if 'equipment' in atmospheric_discharge_data:
- atmospheric_discharge_data.pop('equipment')
- AtmosphericDischargeEquipment.objects.create(equipment=equipment, **atmospheric_discharge_data)
- elif structured_cabling_data:
- if 'equipment' in structured_cabling_data:
- structured_cabling_data.pop('equipment')
- StructuredCablingEquipment.objects.create(equipment=equipment, **structured_cabling_data)
- elif distribution_board_data:
- if 'equipment' in distribution_board_data:
- distribution_board_data.pop('equipment')
- DistributionBoardEquipment.objects.create(equipment=equipment, **distribution_board_data)
- elif electrical_circuit_data:
- if 'equipment' in electrical_circuit_data:
- electrical_circuit_data.pop('equipment')
- ElectricalCircuitEquipment.objects.create(equipment=equipment, **electrical_circuit_data)
- elif electrical_line_data:
- if 'equipment' in electrical_line_data:
- electrical_line_data.pop('equipment')
- ElectricalLineEquipment.objects.create(equipment=equipment, **electrical_line_data)
- elif electrical_load_data:
- if 'equipment' in electrical_load_data:
- electrical_load_data.pop('equipment')
- ElectricalLoadEquipment.objects.create(equipment=equipment, **electrical_load_data)
- elif ilumination_equipment_data:
- if 'equipment' in ilumination_equipment_data:
- ilumination_equipment_data.pop('equipment')
- IluminationEquipment.objects.create(equipment=equipment, **ilumination_equipment_data)
- elif refrigeration_equipment_data:
- if 'equipment' in refrigeration_equipment_data:
- refrigeration_equipment_data.pop('equipment')
- RefrigerationEquipment.objects.create(equipment=equipment, **refrigeration_equipment_data)
-
- return equipment
diff --git a/api/equipments/tests.py b/api/equipments/tests.py
deleted file mode 100644
index 7ce503c2..00000000
--- a/api/equipments/tests.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/api/equipments/urls.py b/api/equipments/urls.py
deleted file mode 100644
index 16510fc1..00000000
--- a/api/equipments/urls.py
+++ /dev/null
@@ -1,42 +0,0 @@
-from .views import *
-from django.urls import path
-
-urlpatterns = [
- path('personal-equipment-types/', PersonalEquipmentCategoryCreate.as_view(), name='personal_equipment_category_create'),
- path('personal-equipment-types/by-system//', PersonalEquipmentCategoryList.as_view(), name='personal_equipment_category_by_system'),
- path('personal-equipment-types//', PersonalEquipmentCategoryDetail.as_view()),
- path('equipment-types/by-system//', GenericEquipmentCategoryList.as_view(), name='personal_equipment_types_by_system'),
- path('equipment-types//', GenericEquipmentCategoryDetail.as_view()),
- path('equipments/', EquipmentListCreateView.as_view(), name='equipments'),
- path('equipments//', EquipmentDetail.as_view()),
- path('equipment-photos/', EquipmentPhotoList.as_view()),
- path('equipment-photos/by-equipment//', EquipmentPhotoByEquipmentList.as_view(), name='equipment-photo-list'),
- path('equipment-photos//', EquipmentPhotoDetail.as_view()),
- path('refrigerations/', RefrigerationEquipmentList.as_view()),
- path('refrigeration/by-area//', RefrigerationEquipmentByAreaList.as_view()),
- path('refrigerations//', RefrigerationEquipmentDetail.as_view()),
- path('fire-alarms/', FireAlarmEquipmentList.as_view()),
- path('fire-alarms/by-area//', FireAlarmEquipmentByAreaList.as_view()),
- path('fire-alarms//', FireAlarmEquipmentDetail.as_view()),
- path('atmospheric-discharges/', AtmosphericDischargeEquipmentList.as_view()),
- path('atmospheric-discharges/by-area//', AtmosphericDischargeEquipmentByAreaList.as_view()),
- path('atmospheric-discharges//', AtmosphericDischargeEquipmentDetail.as_view()),
- path('structured-cabling/', StructuredCablingEquipmentList.as_view()),
- path('structured-cabling/by-area//', StructuredCablingEquipmentByAreaList.as_view()),
- path('structured-cabling//', StructuredCablingEquipmentDetail.as_view()),
- path('distribution-boards/', DistributionBoardEquipmentList.as_view()),
- path('distribution-boards/by-area//', DistributionBoardEquipmentByAreaList.as_view()),
- path('distribution-boards//', DistributionBoardEquipmentDetail.as_view()),
- path('electrical-circuits/', ElectricalCircuitEquipmentList.as_view()),
- path('electrical-circuits/by-area//', ElectricalCircuitEquipmentByAreaList.as_view()),
- path('electrical-circuits//', ElectricalCircuitEquipmentDetail.as_view()),
- path('electrical-lines/', ElectricalLineEquipmentList.as_view()),
- path('electrical-lines/by-area//', ElectricalLineEquipmentByAreaList.as_view()),
- path('electrical-lines//', ElectricalLineEquipmentDetail.as_view()),
- path('electrical-loads/', ElectricalLoadEquipmentList.as_view()),
- path('electrical-loads/by-area//', ElectricalLoadEquipmentByAreaList.as_view()),
- path('electrical-loads//', ElectricalLoadEquipmentDetail.as_view()),
- path('iluminations/', IluminationEquipmentList.as_view()),
- path('iluminations/by-area//', IluminationEquipmentByAreaList.as_view()),
- path('iluminations//', IluminationEquipmentDetail.as_view())
-]
diff --git a/api/equipments/views.py b/api/equipments/views.py
deleted file mode 100644
index 57858caf..00000000
--- a/api/equipments/views.py
+++ /dev/null
@@ -1,541 +0,0 @@
-from rest_framework import generics
-from rest_framework import status
-from rest_framework.permissions import IsAuthenticated
-from rest_framework.response import Response
-
-from .permissions import *
-from .serializers import *
-
-
-def get_place_owner_or_create(user):
- try:
- return user.place_owner
- except PlaceOwner.DoesNotExist:
- return PlaceOwner.objects.create(user=user)
-
-
-class PersonalEquipmentCategoryCreate(generics.CreateAPIView):
- queryset = PersonalEquipmentCategory.objects.all()
- serializer_class = PersonalEquipmentCategorySerializer
- permission_classes = [IsAuthenticated, IsOwner]
-
- def create(self, request, *args, **kwargs):
- user = request.user
- place_owner = get_place_owner_or_create(user)
- serializer = self.get_serializer(data=request.data)
- serializer.is_valid(raise_exception=True)
- serializer.save(place_owner=place_owner)
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)
-
-
-class PersonalEquipmentCategoryList(generics.ListAPIView):
- queryset = PersonalEquipmentCategory.objects.all()
- serializer_class = PersonalEquipmentCategorySerializer
- permission_classes = [IsAuthenticated, IsOwner]
-
- def get_queryset(self):
- system_id = self.kwargs['system_id']
- return PersonalEquipmentCategory.objects.filter(system_id=system_id)
-
-
-class PersonalEquipmentCategoryDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = PersonalEquipmentCategory.objects.all()
- serializer_class = PersonalEquipmentCategorySerializer
- permission_classes = [IsAuthenticated]
-
-
-class GenericEquipmentCategoryList(generics.ListAPIView):
- queryset = GenericEquipmentCategory.objects.all()
- serializer_class = GenericEquipmentCategorySerializer
- permission_classes = [IsAuthenticated]
-
- def get_queryset(self):
- system_id = self.kwargs['system_id']
- return GenericEquipmentCategory.objects.filter(system_id=system_id)
-
-
-class GenericEquipmentCategoryDetail(generics.RetrieveAPIView):
- queryset = GenericEquipmentCategory.objects.all()
- serializer_class = GenericEquipmentCategorySerializer
- permission_classes = [IsAuthenticated]
-
-
-class EquipmentListCreateView(generics.ListCreateAPIView):
- queryset = Equipment.objects.all()
- serializer_class = EquipmentSerializer
- permission_classes = [IsAuthenticated, IsOwner or IsEquipmentEditor]
-
-
-class EquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = Equipment.objects.all()
- serializer_class = EquipmentSerializer
- permission_classes = [IsAuthenticated, IsOwner or IsEquipmentEditor]
-
-
-class EquipmentPhotoList(generics.ListCreateAPIView):
- queryset = EquipmentPhoto.objects.all()
- serializer_class = EquipmentPhotoSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner or IsEquipmentEditorPhoto]
-
- def get_queryset(self):
- user = self.request.user
- queryset = super().get_queryset()
- return queryset.filter(equipment__place_owner__user=user)
-
-
-class EquipmentPhotoDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = EquipmentPhoto.objects.all()
- serializer_class = EquipmentPhotoSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner or IsEquipmentEditorPhoto]
-
-
-class EquipmentPhotoByEquipmentList(generics.ListAPIView):
- serializer_class = EquipmentPhotoSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner]
-
- def get_queryset(self):
- equipment_id = self.kwargs['equipment_id']
- user = self.request.user
- return EquipmentPhoto.objects.filter(equipment_id=equipment_id, equipment__place_owner__user=user)
-
-
-class RefrigerationEquipmentList(generics.ListCreateAPIView):
- queryset = RefrigerationEquipment.objects.all()
- serializer_class = RefrigerationEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner, IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- user = self.request.user
- place_owner = get_place_owner_or_create(user)
- return RefrigerationEquipment.objects.filter(area__place__place_owner=place_owner)
-
- def create(self, request, *args, **kwargs):
- data = request.data.copy()
- data["system"] = 9
- serializer = self.get_serializer(data=data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_200_OK, headers=headers)
-
-
-class RefrigerationEquipmentByAreaList(generics.ListAPIView):
- serializer_class = RefrigerationEquipmentResponseSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- area_id = self.kwargs['area_id']
- queryset = RefrigerationEquipment.objects.filter(area_id=area_id)
-
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
-
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
-
-
-class RefrigerationEquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = RefrigerationEquipment.objects.all()
- serializer_class = RefrigerationEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
-
-class FireAlarmEquipmentList(generics.ListCreateAPIView):
- queryset = FireAlarmEquipment.objects.all()
- serializer_class = FireAlarmEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- user = self.request.user
- place_owner = get_place_owner_or_create(user)
- return FireAlarmEquipment.objects.filter(area__place__place_owner=place_owner)
-
- def create(self, request, *args, **kwargs):
- data = request.data.copy()
- data["system"] = 8
- serializer = self.get_serializer(data=data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_200_OK, headers=headers)
-
-
-class FireAlarmEquipmentByAreaList(generics.ListAPIView):
- serializer_class = FireAlarmEquipmentResponseSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- area_id = self.kwargs['area_id']
- queryset = FireAlarmEquipment.objects.filter(area_id=area_id)
-
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
-
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
-
-
-class FireAlarmEquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = FireAlarmEquipment.objects.all()
- serializer_class = FireAlarmEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
-
-class AtmosphericDischargeEquipmentList(generics.ListCreateAPIView):
- queryset = AtmosphericDischargeEquipment.objects.all()
- serializer_class = AtmosphericDischargeEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- user = self.request.user
- place_owner = get_place_owner_or_create(user)
- return AtmosphericDischargeEquipment.objects.filter(area__place__place_owner=place_owner)
-
- def create(self, request, *args, **kwargs):
- data = request.data.copy()
- data["system"] = 7
- serializer = self.get_serializer(data=data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_200_OK, headers=headers)
-
-
-class AtmosphericDischargeEquipmentByAreaList(generics.ListAPIView):
- serializer_class = AtmosphericDischargeEquipmentResponseSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner, IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- area_id = self.kwargs['area_id']
- queryset = AtmosphericDischargeEquipment.objects.filter(area_id=area_id)
-
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
-
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
-
-
-class AtmosphericDischargeEquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = AtmosphericDischargeEquipment.objects.all()
- serializer_class = AtmosphericDischargeEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
-
-class StructuredCablingEquipmentList(generics.ListCreateAPIView):
- queryset = StructuredCablingEquipment.objects.all()
- serializer_class = StructuredCablingEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- user = self.request.user
- place_owner = get_place_owner_or_create(user)
- return StructuredCablingEquipment.objects.filter(area__place__place_owner=place_owner)
-
- def create(self, request, *args, **kwargs):
- data = request.data.copy()
- data["system"] = 6
- serializer = self.get_serializer(data=data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_200_OK, headers=headers)
-
-
-class StructuredCablingEquipmentByAreaList(generics.ListAPIView):
- serializer_class = StructuredCablingEquipmentResponseSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- area_id = self.kwargs['area_id']
- queryset = StructuredCablingEquipment.objects.filter(area_id=area_id)
-
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
-
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
-
-
-class StructuredCablingEquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = StructuredCablingEquipment.objects.all()
- serializer_class = StructuredCablingEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
-
-class DistributionBoardEquipmentList(generics.ListCreateAPIView):
- queryset = DistributionBoardEquipment.objects.all()
- serializer_class = DistributionBoardEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- user = self.request.user
- place_owner = get_place_owner_or_create(user)
- return DistributionBoardEquipment.objects.filter(area__place__place_owner=place_owner)
-
- def create(self, request, *args, **kwargs):
- data = request.data.copy()
- data["system"] = 5
- serializer = self.get_serializer(data=data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_200_OK, headers=headers)
-
-
-class DistributionBoardEquipmentByAreaList(generics.ListAPIView):
- serializer_class = DistributionBoardEquipmentResponseSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- area_id = self.kwargs['area_id']
- queryset = DistributionBoardEquipment.objects.filter(area_id=area_id)
-
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
-
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
-
-
-class DistributionBoardEquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = DistributionBoardEquipment.objects.all()
- serializer_class = DistributionBoardEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
-
-class ElectricalCircuitEquipmentList(generics.ListCreateAPIView):
- queryset = ElectricalCircuitEquipment.objects.all()
- serializer_class = ElectricalCircuitEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- user = self.request.user
- place_owner = get_place_owner_or_create(user)
- return ElectricalCircuitEquipment.objects.filter(area__place__place_owner=place_owner)
-
- def create(self, request, *args, **kwargs):
- data = request.data.copy()
- data["system"] = 4
- serializer = self.get_serializer(data=data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_200_OK, headers=headers)
-
-
-class ElectricalCircuitEquipmentByAreaList(generics.ListAPIView):
- serializer_class = ElectricalCircuitEquipmentResponseSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- area_id = self.kwargs['area_id']
- queryset = ElectricalCircuitEquipment.objects.filter(area_id=area_id)
-
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
-
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
-
-
-class ElectricalCircuitEquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = ElectricalCircuitEquipment.objects.all()
- serializer_class = ElectricalCircuitEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
-
-class ElectricalLineEquipmentList(generics.ListCreateAPIView):
- queryset = ElectricalLineEquipment.objects.all()
- serializer_class = ElectricalLineEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- user = self.request.user
- place_owner = get_place_owner_or_create(user)
- return ElectricalLineEquipment.objects.filter(area__place__place_owner=place_owner)
-
- def create(self, request, *args, **kwargs):
- data = request.data.copy()
- data["system"] = 3
- serializer = self.get_serializer(data=data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_200_OK, headers=headers)
-
-
-class ElectricalLineEquipmentByAreaList(generics.ListAPIView):
- serializer_class = ElectricalLineEquipmentResponseSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- area_id = self.kwargs['area_id']
- queryset = ElectricalLineEquipment.objects.filter(area_id=area_id)
-
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
-
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
-
-
-class ElectricalLineEquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = ElectricalLineEquipment.objects.all()
- serializer_class = ElectricalLineEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
-
-class ElectricalLoadEquipmentList(generics.ListCreateAPIView):
- queryset = ElectricalLoadEquipment.objects.all()
- serializer_class = ElectricalLoadEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- user = self.request.user
- place_owner = get_place_owner_or_create(user)
- return ElectricalLoadEquipment.objects.filter(area__place__place_owner=place_owner)
-
- def create(self, request, *args, **kwargs):
- data = request.data.copy()
- data["system"] = 2
- serializer = self.get_serializer(data=data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_200_OK, headers=headers)
-
-
-class ElectricalLoadEquipmentByAreaList(generics.ListAPIView):
- serializer_class = ElectricalLoadEquipmentResponseSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- area_id = self.kwargs['area_id']
- queryset = ElectricalLoadEquipment.objects.filter(area_id=area_id)
-
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
-
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
-
-
-class ElectricalLoadEquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = ElectricalLoadEquipment.objects.all()
- serializer_class = ElectricalLoadEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
-
-class IluminationEquipmentList(generics.ListCreateAPIView):
- queryset = IluminationEquipment.objects.all()
- serializer_class = IluminationEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- user = self.request.user
- place_owner = get_place_owner_or_create(user)
- return IluminationEquipment.objects.filter(area__place__place_owner=place_owner)
-
- def create(self, request, *args, **kwargs):
- data = request.data.copy()
- data["system"] = 1
- serializer = self.get_serializer(data=data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- headers = self.get_success_headers(serializer.data)
- return Response(serializer.data, status=status.HTTP_200_OK, headers=headers)
-
-
-class IluminationEquipmentByAreaList(generics.ListAPIView):
- serializer_class = IluminationEquipmentResponseSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
-
- def get_queryset(self):
- area_id = self.kwargs['area_id']
- queryset = IluminationEquipment.objects.filter(area_id=area_id)
-
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
-
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
-
-
-class IluminationEquipmentDetail(generics.RetrieveUpdateDestroyAPIView):
- queryset = IluminationEquipment.objects.all()
- serializer_class = IluminationEquipmentSerializer
- permission_classes = [IsAuthenticated, IsEquipmentOwner | IsSpecificEquipmentEditor]
diff --git a/api/manage.py b/api/manage.py
deleted file mode 100755
index 7398656e..00000000
--- a/api/manage.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env python
-"""Django's command-line utility for administrative tasks."""
-import os
-import sys
-
-
-def main():
- """Run administrative tasks."""
- os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sigeie.settings')
- try:
- from django.core.management import execute_from_command_line
- except ImportError as exc:
- raise ImportError(
- "Couldn't import Django. Are you sure it's installed and "
- "available on your PYTHONPATH environment variable? Did you "
- "forget to activate a virtual environment?"
- ) from exc
- execute_from_command_line(sys.argv)
-
-
-if __name__ == '__main__':
- main()
diff --git a/api/places/__init__.py b/api/places/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/api/places/admin.py b/api/places/admin.py
deleted file mode 100644
index 8c38f3f3..00000000
--- a/api/places/admin.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.contrib import admin
-
-# Register your models here.
diff --git a/api/places/apps.py b/api/places/apps.py
deleted file mode 100644
index b3d0c3d3..00000000
--- a/api/places/apps.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from django.apps import AppConfig
-
-
-class PlacesConfig(AppConfig):
- default_auto_field = 'django.db.models.BigAutoField'
- name = 'places'
diff --git a/api/places/migrations/0001_initial.py b/api/places/migrations/0001_initial.py
deleted file mode 100644
index cf2a9fd5..00000000
--- a/api/places/migrations/0001_initial.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Generated by Django 4.2 on 2024-03-27 13:42
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- initial = True
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ]
-
- operations = [
- migrations.CreateModel(
- name='PlacesModel',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=50)),
- ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='places')),
- ],
- ),
- ]
diff --git a/api/places/migrations/0002_places_delete_placesmodel.py b/api/places/migrations/0002_places_delete_placesmodel.py
deleted file mode 100644
index b4c72ac7..00000000
--- a/api/places/migrations/0002_places_delete_placesmodel.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Generated by Django 4.2 on 2024-03-27 14:20
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('places', '0001_initial'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='Places',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=50)),
- ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='donos')),
- ],
- ),
- migrations.DeleteModel(
- name='PlacesModel',
- ),
- ]
diff --git a/api/places/migrations/0003_place_delete_places.py b/api/places/migrations/0003_place_delete_places.py
deleted file mode 100644
index 431a699d..00000000
--- a/api/places/migrations/0003_place_delete_places.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Generated by Django 4.2 on 2024-03-27 14:37
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('places', '0002_places_delete_placesmodel'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='Place',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=50)),
- ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='creator')),
- ],
- ),
- migrations.DeleteModel(
- name='Places',
- ),
- ]
diff --git a/api/places/migrations/0004_room.py b/api/places/migrations/0004_room.py
deleted file mode 100644
index 82acbc56..00000000
--- a/api/places/migrations/0004_room.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Generated by Django 4.2 on 2024-03-27 18:38
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0003_place_delete_places'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='Room',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=50)),
- ('floor', models.IntegerField(default=0)),
- ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='places.place')),
- ],
- ),
- ]
diff --git a/api/places/migrations/0005_alter_room_floor_alter_room_place.py b/api/places/migrations/0005_alter_room_floor_alter_room_place.py
deleted file mode 100644
index 8d060b6a..00000000
--- a/api/places/migrations/0005_alter_room_floor_alter_room_place.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Generated by Django 4.2 on 2024-03-27 22:26
-
-import django.core.validators
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0004_room'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='room',
- name='floor',
- field=models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)]),
- ),
- migrations.AlterField(
- model_name='room',
- name='place',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rooms', to='places.place'),
- ),
- ]
diff --git a/api/places/migrations/0006_room_systems.py b/api/places/migrations/0006_room_systems.py
deleted file mode 100644
index d915eccc..00000000
--- a/api/places/migrations/0006_room_systems.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by Django 4.2 on 2024-04-01 14:49
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0001_initial'),
- ('places', '0005_alter_room_floor_alter_room_place'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='room',
- name='systems',
- field=models.ManyToManyField(to='systems.system'),
- ),
- ]
diff --git a/api/places/migrations/0007_remove_place_user_place_place_owner.py b/api/places/migrations/0007_remove_place_user_place_place_owner.py
deleted file mode 100644
index a87f5d96..00000000
--- a/api/places/migrations/0007_remove_place_user_place_place_owner.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Generated by Django 4.2 on 2024-04-10 18:53
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0001_initial'),
- ('places', '0006_room_systems'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='place',
- name='user',
- ),
- migrations.AddField(
- model_name='place',
- name='place_owner',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='users.placeowner'),
- ),
- ]
diff --git a/api/places/migrations/0008_alter_place_place_owner.py b/api/places/migrations/0008_alter_place_place_owner.py
deleted file mode 100644
index de40950f..00000000
--- a/api/places/migrations/0008_alter_place_place_owner.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Generated by Django 4.2 on 2024-04-10 18:57
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0001_initial'),
- ('places', '0007_remove_place_user_place_place_owner'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='place',
- name='place_owner',
- field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='users.placeowner'),
- ),
- ]
diff --git a/api/places/migrations/0009_alter_room_place.py b/api/places/migrations/0009_alter_room_place.py
deleted file mode 100644
index 6558ffb1..00000000
--- a/api/places/migrations/0009_alter_room_place.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by Django 4.2 on 2024-04-10 18:59
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0008_alter_place_place_owner'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='room',
- name='place',
- field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='rooms', to='places.place'),
- ),
- ]
diff --git a/api/places/migrations/0010_alter_place_place_owner_alter_room_place.py b/api/places/migrations/0010_alter_place_place_owner_alter_room_place.py
deleted file mode 100644
index 761e92be..00000000
--- a/api/places/migrations/0010_alter_place_place_owner_alter_room_place.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Generated by Django 4.2 on 2024-04-10 19:19
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0001_initial'),
- ('places', '0009_alter_room_place'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='place',
- name='place_owner',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='users.placeowner'),
- ),
- migrations.AlterField(
- model_name='room',
- name='place',
- field=models.OneToOneField(on_delete=django.db.models.deletion.DO_NOTHING, related_name='rooms', to='places.place'),
- ),
- ]
diff --git a/api/places/migrations/0011_alter_place_place_owner.py b/api/places/migrations/0011_alter_place_place_owner.py
deleted file mode 100644
index 13bfae87..00000000
--- a/api/places/migrations/0011_alter_place_place_owner.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Generated by Django 4.2 on 2024-04-11 19:38
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0002_alter_placeowner_user'),
- ('places', '0010_alter_place_place_owner_alter_room_place'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='place',
- name='place_owner',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.placeowner'),
- ),
- ]
diff --git a/api/places/migrations/0012_alter_place_place_owner.py b/api/places/migrations/0012_alter_place_place_owner.py
deleted file mode 100644
index ad6d9136..00000000
--- a/api/places/migrations/0012_alter_place_place_owner.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Generated by Django 4.2 on 2024-04-11 19:43
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0002_alter_placeowner_user'),
- ('places', '0011_alter_place_place_owner'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='place',
- name='place_owner',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.placeowner', unique=True),
- ),
- ]
diff --git a/api/places/migrations/0013_alter_place_place_owner.py b/api/places/migrations/0013_alter_place_place_owner.py
deleted file mode 100644
index 357ff692..00000000
--- a/api/places/migrations/0013_alter_place_place_owner.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Generated by Django 4.2 on 2024-04-11 19:46
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0002_alter_placeowner_user'),
- ('places', '0012_alter_place_place_owner'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='place',
- name='place_owner',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.placeowner'),
- ),
- ]
diff --git a/api/places/migrations/0014_alter_room_place.py b/api/places/migrations/0014_alter_room_place.py
deleted file mode 100644
index 3a37a425..00000000
--- a/api/places/migrations/0014_alter_room_place.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by Django 4.2 on 2024-04-12 14:13
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0013_alter_place_place_owner'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='room',
- name='place',
- field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='rooms', to='places.place'),
- ),
- ]
diff --git a/api/places/migrations/0015_alter_room_place.py b/api/places/migrations/0015_alter_room_place.py
deleted file mode 100644
index 91bbb25c..00000000
--- a/api/places/migrations/0015_alter_room_place.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by Django 4.2 on 2024-04-12 15:40
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0014_alter_room_place'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='room',
- name='place',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rooms', to='places.place'),
- ),
- ]
diff --git a/api/places/migrations/0016_alter_place_place_owner.py b/api/places/migrations/0016_alter_place_place_owner.py
deleted file mode 100644
index 69d70a4a..00000000
--- a/api/places/migrations/0016_alter_place_place_owner.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Generated by Django 4.2 on 2024-04-12 17:20
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0002_alter_placeowner_user'),
- ('places', '0015_alter_room_place'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='place',
- name='place_owner',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='users.placeowner'),
- ),
- ]
diff --git a/api/places/migrations/0017_atmosfericdischargesystem.py b/api/places/migrations/0017_atmosfericdischargesystem.py
deleted file mode 100644
index ec3b46c8..00000000
--- a/api/places/migrations/0017_atmosfericdischargesystem.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Generated by Django 4.2 on 2024-04-17 17:48
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0001_initial'),
- ('places', '0016_alter_place_place_owner'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='AtmosfericDischargeSystem',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmosferic_discharg_systems', to='places.place')),
- ('room', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmosferic_discharg_systems', to='places.room')),
- ('system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmosferic_discharg_systems', to='systems.system')),
- ],
- ),
- ]
diff --git a/api/places/migrations/0018_alter_atmosfericdischargesystem_place_and_more.py b/api/places/migrations/0018_alter_atmosfericdischargesystem_place_and_more.py
deleted file mode 100644
index f1ed9298..00000000
--- a/api/places/migrations/0018_alter_atmosfericdischargesystem_place_and_more.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Generated by Django 4.2 on 2024-04-17 17:51
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0001_initial'),
- ('places', '0017_atmosfericdischargesystem'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='atmosfericdischargesystem',
- name='place',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmosferic_discharge_systems', to='places.place'),
- ),
- migrations.AlterField(
- model_name='atmosfericdischargesystem',
- name='room',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmosferic_discharge_systems', to='places.room'),
- ),
- migrations.AlterField(
- model_name='atmosfericdischargesystem',
- name='system',
- field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmosferic_discharge_systems', to='systems.system'),
- ),
- migrations.AlterModelTable(
- name='atmosfericdischargesystem',
- table='atmosferic_discharge_system',
- ),
- ]
diff --git a/api/places/migrations/0019_delete_atmosfericdischargesystem.py b/api/places/migrations/0019_delete_atmosfericdischargesystem.py
deleted file mode 100644
index 9b467921..00000000
--- a/api/places/migrations/0019_delete_atmosfericdischargesystem.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Generated by Django 4.2 on 2024-04-17 17:56
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0018_alter_atmosfericdischargesystem_place_and_more'),
- ]
-
- operations = [
- migrations.DeleteModel(
- name='AtmosfericDischargeSystem',
- ),
- ]
diff --git a/api/places/migrations/0020_remove_room_place_remove_room_systems.py b/api/places/migrations/0020_remove_room_place_remove_room_systems.py
deleted file mode 100644
index 7a2532fc..00000000
--- a/api/places/migrations/0020_remove_room_place_remove_room_systems.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Generated by Django 4.2 on 2024-04-18 19:54
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0019_delete_atmosfericdischargesystem'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='room',
- name='place',
- ),
- migrations.RemoveField(
- model_name='room',
- name='systems',
- ),
- ]
diff --git a/api/places/migrations/0021_room_place_room_systems.py b/api/places/migrations/0021_room_place_room_systems.py
deleted file mode 100644
index 4659a37a..00000000
--- a/api/places/migrations/0021_room_place_room_systems.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Generated by Django 4.2 on 2024-04-19 16:08
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('places', '0020_remove_room_place_remove_room_systems'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='room',
- name='place',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='rooms', to='places.place'),
- ),
- migrations.AddField(
- model_name='room',
- name='systems',
- field=models.ManyToManyField(to='systems.system'),
- ),
- ]
diff --git a/api/places/migrations/0022_area_delete_room.py b/api/places/migrations/0022_area_delete_room.py
deleted file mode 100644
index f55fe63a..00000000
--- a/api/places/migrations/0022_area_delete_room.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Generated by Django 4.2 on 2024-04-24 19:22
-
-import django.core.validators
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0008_delete_atmosphericdischargesystem'),
- ('equipments', '0005_remove_atmosphericdischargeequipment_room'),
- ('places', '0021_room_place_room_systems'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='Area',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=50)),
- ('floor', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)])),
- ('place', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='areas', to='places.place')),
- ('systems', models.ManyToManyField(to='systems.system')),
- ],
- ),
- migrations.DeleteModel(
- name='Room',
- ),
- ]
diff --git a/api/places/migrations/0023_alter_area_place.py b/api/places/migrations/0023_alter_area_place.py
deleted file mode 100644
index 3f3e1056..00000000
--- a/api/places/migrations/0023_alter_area_place.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by Django 4.2 on 2024-04-24 20:50
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0022_area_delete_room'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='area',
- name='place',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='places.place'),
- ),
- ]
diff --git a/api/places/migrations/0024_place_lat_place_lon.py b/api/places/migrations/0024_place_lat_place_lon.py
deleted file mode 100644
index 409a2182..00000000
--- a/api/places/migrations/0024_place_lat_place_lon.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Generated by Django 4.2 on 2024-04-25 15:13
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0023_alter_area_place'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='place',
- name='lat',
- field=models.FloatField(null=True),
- ),
- migrations.AddField(
- model_name='place',
- name='lon',
- field=models.FloatField(null=True),
- ),
- ]
diff --git a/api/places/migrations/0025_remove_area_systems.py b/api/places/migrations/0025_remove_area_systems.py
deleted file mode 100644
index 574f6279..00000000
--- a/api/places/migrations/0025_remove_area_systems.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Generated by Django 4.2 on 2024-05-03 13:17
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0024_place_lat_place_lon'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='area',
- name='systems',
- ),
- ]
diff --git a/api/places/migrations/0026_alter_area_place.py b/api/places/migrations/0026_alter_area_place.py
deleted file mode 100644
index 4b7a7943..00000000
--- a/api/places/migrations/0026_alter_area_place.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by Django 4.2 on 2024-05-03 13:55
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0025_remove_area_systems'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='area',
- name='place',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='areas', to='places.place'),
- ),
- ]
diff --git a/api/places/migrations/0027_alter_area_floor.py b/api/places/migrations/0027_alter_area_floor.py
deleted file mode 100644
index 678177b2..00000000
--- a/api/places/migrations/0027_alter_area_floor.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Generated by Django 4.2 on 2024-05-07 13:01
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0026_alter_area_place'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='area',
- name='floor',
- field=models.IntegerField(default=0),
- ),
- ]
diff --git a/api/places/migrations/0028_place_photo.py b/api/places/migrations/0028_place_photo.py
deleted file mode 100644
index 52a0e5ac..00000000
--- a/api/places/migrations/0028_place_photo.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Generated by Django 4.2 on 2024-05-23 14:16
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0027_alter_area_floor'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='place',
- name='photo',
- field=models.ImageField(null=True, upload_to='place_photos/'),
- ),
- ]
diff --git a/api/places/migrations/0029_place_editors.py b/api/places/migrations/0029_place_editors.py
deleted file mode 100644
index 803f27ee..00000000
--- a/api/places/migrations/0029_place_editors.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by Django 4.2 on 2024-06-12 13:26
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0005_placeeditor'),
- ('places', '0028_place_photo'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='place',
- name='editors',
- field=models.ManyToManyField(related_name='places', to='users.placeeditor'),
- ),
- ]
diff --git a/api/places/migrations/0030_place_access_code.py b/api/places/migrations/0030_place_access_code.py
deleted file mode 100644
index ed49739a..00000000
--- a/api/places/migrations/0030_place_access_code.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Generated by Django 4.2 on 2024-06-12 14:15
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0029_place_editors'),
- ]
-
- operations = [
- migrations.AddField(
- model_name='place',
- name='access_code',
- field=models.CharField(blank=True, max_length=36, null=True, unique=True),
- ),
- ]
diff --git a/api/places/migrations/0031_remove_place_access_code.py b/api/places/migrations/0031_remove_place_access_code.py
deleted file mode 100644
index 0325efb7..00000000
--- a/api/places/migrations/0031_remove_place_access_code.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Generated by Django 4.2 on 2024-06-12 14:32
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0030_place_access_code'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='place',
- name='access_code',
- ),
- ]
diff --git a/api/places/migrations/0032_alter_place_place_owner.py b/api/places/migrations/0032_alter_place_place_owner.py
deleted file mode 100644
index a2109717..00000000
--- a/api/places/migrations/0032_alter_place_place_owner.py
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# Generated by Django 4.2 on 2024-07-09 18:42
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('users', '0006_alter_placeowner_user'),
- ('places', '0031_remove_place_access_code'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='place',
- name='place_owner',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='places', to='users.placeowner'),
- ),
- ]
diff --git a/api/places/migrations/__init__.py b/api/places/migrations/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/api/places/models.py b/api/places/models.py
deleted file mode 100644
index 57b3d024..00000000
--- a/api/places/models.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from django.db import models
-
-from users.models import PlaceOwner, PlaceEditor
-
-
-class Place(models.Model):
- name = models.CharField(max_length=50)
- place_owner = models.ForeignKey(PlaceOwner, on_delete=models.CASCADE, null=True, related_name="places")
- lon = models.FloatField(null=True)
- lat = models.FloatField(null=True)
- photo = models.ImageField(null=True, upload_to='place_photos/')
- editors = models.ManyToManyField(PlaceEditor, related_name='places')
-
- def __str__(self):
- return self.name
-
-
-class Area(models.Model):
- name = models.CharField(max_length=50)
- floor = models.IntegerField(default=0)
- place = models.ForeignKey(Place, on_delete=models.CASCADE, null=True, related_name='areas')
-
- def __str__(self):
- return self.name
diff --git a/api/places/permissions.py b/api/places/permissions.py
deleted file mode 100644
index 13818834..00000000
--- a/api/places/permissions.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from rest_framework import permissions
-from .models import Area
-
-
-class IsPlaceOwner(permissions.BasePermission):
- def has_object_permission(self, request, view, obj):
- return obj.place_owner.user == request.user
-
-
-class IsPlaceEditor(permissions.BasePermission):
- def has_object_permission(self, request, view, obj):
- return obj.editors.filter(user=request.user).exists()
diff --git a/api/places/serializers.py b/api/places/serializers.py
deleted file mode 100644
index 07b7fc18..00000000
--- a/api/places/serializers.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from rest_framework import serializers
-
-from .models import Place, Area
-
-
-class PlaceSerializer(serializers.ModelSerializer):
- class Meta:
- model = Place
- fields = ['id', 'name', 'place_owner', 'lon', 'lat']
- extra_kwargs = {
- 'name': {'required': True}
- }
-
-
-class AreaSerializer(serializers.ModelSerializer):
- class Meta:
- model = Area
- fields = ['id', 'name', 'floor', 'place']
- extra_kwargs = {
- 'name': {'required': True},
- 'floor': {'required': True},
- 'place': {'required': True}
- }
diff --git a/api/places/tests.py b/api/places/tests.py
deleted file mode 100644
index 7ce503c2..00000000
--- a/api/places/tests.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/api/places/urls.py b/api/places/urls.py
deleted file mode 100644
index fd79ac9a..00000000
--- a/api/places/urls.py
+++ /dev/null
@@ -1,14 +0,0 @@
-from django.urls import path, include
-from .views import *
-from rest_framework.routers import SimpleRouter
-from .views import GeneratePDFView
-
-router = SimpleRouter()
-router.register(r'places',PlaceViewSet)
-router.register(r'areas', AreaViewSet)
-router.register(r'grant_access', GrantAccessViewSet, basename='grant_access')
-router.register(r'refuse_access', RefuseAccessViewSet, basename = 'refuse_access')
-
-urlpatterns = [
- path('places//report/', GeneratePDFView.as_view(), name='place-report'),
-]
\ No newline at end of file
diff --git a/api/places/views.py b/api/places/views.py
deleted file mode 100644
index 621e87d4..00000000
--- a/api/places/views.py
+++ /dev/null
@@ -1,324 +0,0 @@
-from rest_framework.views import APIView
-from django.db.models import Q
-from django.contrib.auth.models import User
-from users.models import PlaceOwner, PlaceEditor
-from rest_framework.generics import get_object_or_404
-from rest_framework.permissions import IsAuthenticated
-from places.permissions import *
-from rest_framework import viewsets, status
-from rest_framework.decorators import action
-from rest_framework.response import Response
-from rest_framework.exceptions import NotFound
-from django.http import HttpResponse
-from reportlab.lib.pagesizes import A4
-from reportlab.pdfgen import canvas
-from .models import Place, Area
-from .serializers import PlaceSerializer, AreaSerializer
-
-
-def get_place_owner_or_create(user):
- try:
- return user.place_owner
- except PlaceOwner.DoesNotExist:
- return PlaceOwner.objects.create(user=user)
-
-
-class PlaceViewSet(viewsets.ModelViewSet):
- queryset = Place.objects.all()
- serializer_class = PlaceSerializer
- permission_classes = [IsAuthenticated, IsPlaceOwner | IsPlaceEditor]
-
- def create(self, request, *args, **kwargs):
- user = request.user
- place_owner = get_place_owner_or_create(user)
-
- place_data = request.data.copy()
- place_data['place_owner'] = place_owner.id
- place_serializer = self.get_serializer(data=place_data)
- place_serializer.is_valid(raise_exception=True)
- self.perform_create(place_serializer)
-
- headers = self.get_success_headers(place_serializer.data)
- return Response(place_serializer.data, status=status.HTTP_201_CREATED, headers=headers)
-
- def list(self, request, *args, **kwargs):
- user = request.user
- place_owner = get_place_owner_or_create(user)
-
- places = Place.objects.filter(
- Q(place_owner=place_owner) |
- Q(editors__user=user)
- ).distinct()
-
- place_serializer = PlaceSerializer(places, many=True)
- return Response(place_serializer.data)
-
- def retrieve(self, request, pk=None):
- place = get_object_or_404(Place, pk=pk)
- user = request.user
- place_owner = get_place_owner_or_create(user)
- if place.place_owner.id == place_owner.id or place.editors.filter(user=user).exists():
- serializer = PlaceSerializer(place)
- return Response(serializer.data)
- else:
- return Response({"message": "You are not the owner or an editor of this place"},
- status=status.HTTP_403_FORBIDDEN)
-
- def update(self, request, pk=None):
- place = get_object_or_404(Place, pk=pk)
- user = request.user
- place_owner = get_place_owner_or_create(user)
- if place.place_owner.id == place_owner.id or place.editors.filter(user=user).exists():
- serializer = PlaceSerializer(place, data=request.data)
- serializer.is_valid(raise_exception=True)
- serializer.save()
- return Response(serializer.data)
- else:
- return Response({"message": "You are not the owner or an editor of this place"},
- status=status.HTTP_403_FORBIDDEN)
-
- def destroy(self, request, pk=None):
- user = request.user
- place_owner = get_place_owner_or_create(user)
-
- place = get_object_or_404(Place, pk=pk)
- if place.place_owner.id == place_owner.id:
- place.delete()
- return Response({"message": "Place deleted successfully"}, status=status.HTTP_204_NO_CONTENT)
- else:
- return Response({"message": "You are not the owner of this place"}, status=status.HTTP_403_FORBIDDEN)
-
- @action(detail=True, methods=['get'], permission_classes=[IsAuthenticated, IsPlaceOwner | IsPlaceEditor])
- def areas(self, request, pk=None):
- place = self.get_object()
- serializer = AreaSerializer(place.areas.all(), many=True)
- return Response(serializer.data)
-
- @action(detail=True, methods=['get'], url_path='areas/(?P\d+)',
- permission_classes=[IsAuthenticated])
- def area(self, request, pk=None, area_pk=None):
- place = self.get_object()
- area = get_object_or_404(place.areas.all(), pk=area_pk)
- if(request.user.place_owner == area.place.place_owner or area.place.editors.filter(user=request.user).exists()):
- serializer = AreaSerializer(area)
- return Response(serializer.data)
- return Response({"Error" : "You're not the owner or editor of this Area"})
-
-
-class AreaViewSet(viewsets.ModelViewSet):
- queryset = Area.objects.all()
- serializer_class = AreaSerializer
- permission_classes = [IsAuthenticated]
-
- def create(self, request, *args, **kwargs):
- user = request.user
- place_owner = get_place_owner_or_create(user)
- place_id = request.data.get('place')
- place = get_object_or_404(Place, id=place_id)
-
- if place.place_owner.id == place_owner.id or place.editors.filter(user=user).exists():
- area_serializer = AreaSerializer(data=request.data)
- area_serializer.is_valid(raise_exception=True)
- area_serializer.save()
- return Response(area_serializer.data, status=status.HTTP_201_CREATED)
- else:
- return Response({"message": "You are not the owner or an editor of this place"},
- status=status.HTTP_403_FORBIDDEN)
-
- def list(self, request, *args, **kwargs):
- user = request.user
- place_owner = get_place_owner_or_create(user)
- place_id = request.query_params.get('place')
-
- if not place_id:
- raise NotFound("Place ID must be provided.")
-
- place = get_object_or_404(Place, id=place_id)
-
- if place.place_owner.id == place_owner.id or place.editors.filter(user=user).exists():
- areas = Area.objects.filter(place=place)
- area_serializer = AreaSerializer(areas, many=True)
- return Response(area_serializer.data)
- else:
- return Response({"message": "You are not the owner or an editor of this place"},
- status=status.HTTP_403_FORBIDDEN)
-
- def retrieve(self, request, pk=None):
- user = request.user
- place_owner = get_place_owner_or_create(user)
-
- area = get_object_or_404(Area, pk=pk)
-
- if area.place.place_owner.id == place_owner.id or area.place.editors.filter(user=user).exists():
- serializer = AreaSerializer(area)
- return Response(serializer.data)
- else:
- return Response({"message": "You are not the owner or an editor of this area"},
- status=status.HTTP_403_FORBIDDEN)
-
- def destroy(self, request, pk=None):
- user = request.user
- place_owner = get_place_owner_or_create(user)
- area = get_object_or_404(Area, pk=pk)
-
- if area.place.place_owner.id == place_owner.id:
- area.delete()
- return Response({"message": "Area deleted successfully"}, status=status.HTTP_204_NO_CONTENT)
- else:
- return Response({"message": "You are not the owner of this area"}, status=status.HTTP_403_FORBIDDEN)
-
-
-class RefuseAccessViewSet(viewsets.ViewSet):
- permission_classes = [IsAuthenticated, IsPlaceOwner]
-
- @action(detail=True, methods=['post'])
- def refuse_access(self, request, pk=None):
- place = get_object_or_404(Place, pk=pk)
- place_owner = place.place_owner
-
- if request.user != place_owner.user:
- return Response({"message": "You are not the owner of this place"}, status=status.HTTP_403_FORBIDDEN)
-
- username = request.data.get('username')
-
- if not username:
- return Response({'error': 'Username is required'}, status=status.HTTP_400_BAD_REQUEST)
-
- user = get_object_or_404(User, username=username)
-
- place_editor = PlaceEditor.objects.filter(user=user).first()
-
- if not place_editor:
- return Response({'error': 'This user is not an editor of the place'}, status=status.HTTP_400_BAD_REQUEST)
-
- place.editors.remove(place_editor)
-
- return Response({'message': 'Access revoked successfully'}, status=status.HTTP_200_OK)
-
-class GrantAccessViewSet(viewsets.ViewSet):
- permission_classes = [IsAuthenticated, IsPlaceOwner]
-
- @action(detail=True, methods=['post'])
- def grant_access(self, request, pk=None):
- place = get_object_or_404(Place, pk=pk)
- place_owner = place.place_owner
-
- if request.user != place_owner.user:
- return Response({"message": "You are not the owner of this place"}, status=status.HTTP_403_FORBIDDEN)
-
- username = request.data.get('username')
-
- if not username:
- return Response({'error': 'Username is required'}, status=status.HTTP_400_BAD_REQUEST)
-
- user = get_object_or_404(User, username=username)
-
- place_editor, created = PlaceEditor.objects.get_or_create(user=user)
-
- place.editors.add(place_editor)
-
- return Response({'message': 'Access granted successfully'}, status=status.HTTP_200_OK)
-
-
-class Altura:
- def __init__(self):
- self.alt = 840
-
- def get_alt(self, p, margin=30):
- self.alt -= 40
- if self.alt < margin:
- p.showPage()
- self.alt = 800
- return self.alt
- return self.alt
-
-
-def genericOrPersonal(system):
- if system.equipment.generic_equipment_category is not None:
- return system.equipment.generic_equipment_category
- else:
- return system.equipment.personal_equipment_category
-
-
-class GeneratePDFView(APIView):
- permission_classes = [IsAuthenticated, IsPlaceOwner | IsPlaceEditor]
-
- def get(self, request, pk=None):
- place = get_object_or_404(Place, pk=pk)
-
- self.check_object_permissions(request, place)
-
- response = HttpResponse(content_type='application/pdf')
- response['Content-Disposition'] = f'attachment; filename="place_{place.id}_report.pdf"'
-
- p = canvas.Canvas(response, pagesize=A4)
- alt = Altura()
-
- p.setFont('Helvetica-Bold', 16)
-
- p.drawString(205, alt.get_alt(p), f"Relatório do Local: {place.name}")
-
- p.setFont('Helvetica-Bold', 14)
- p.drawString(100, alt.get_alt(p), "Áreas:")
-
- for area in place.areas.all():
- p.setFont('Helvetica-Bold', 14)
- p.drawString(120, alt.get_alt(p), f"Relatório da Área: {area.name}")
-
- for system in area.fire_alarm_equipment.all():
- if (system == None):
- break
- p.setFont('Helvetica', 12)
- p.drawString(140, alt.get_alt(p), f"Sistema: {system.system} - Tipo: {genericOrPersonal(system)}")
-
- for system in area.atmospheric_discharge_equipment.all():
- if (system == None):
- break
- p.setFont('Helvetica', 12)
- p.drawString(140, alt.get_alt(p), f"Sistema: {system.system} - Tipo: {genericOrPersonal(system)}")
-
- for system in area.structured_cabling_equipment.all():
- if (system == None):
- break
- p.setFont('Helvetica', 12)
- p.drawString(140, alt.get_alt(p), f"Sistema: {system.system} - Tipo: {genericOrPersonal(system)}")
-
- for system in area.distribution_board_equipment.all():
- if (system == None):
- break
- p.setFont('Helvetica', 12)
- p.drawString(140, alt.get_alt(p), f"Sistema: {system.system} - Tipo: {genericOrPersonal(system)}")
-
- for system in area.electrical_circuit_equipment.all():
- if (system == None):
- break
- p.setFont('Helvetica', 12)
- p.drawString(140, alt.get_alt(p), f"Sistema: {system.system} - Tipo: {genericOrPersonal(system)}")
-
- for system in area.electrical_line_equipment.all():
- if (system == None):
- break
- p.setFont('Helvetica', 12)
- p.drawString(140, alt.get_alt(p), f"Sistema: {system.system} - Tipo: {genericOrPersonal(system)}")
-
- for system in area.electrical_load_equipment.all():
- if (system == None):
- break
- p.setFont('Helvetica', 12)
- p.drawString(140, alt.get_alt(p), f"Sistema: {system.system} - Tipo: {genericOrPersonal(system)}")
-
- for system in area.ilumination_equipment.all():
- if (system == None):
- break
- p.setFont('Helvetica', 12)
- p.drawString(140, alt.get_alt(p), f"Sistema: {system.system} - Tipo: {genericOrPersonal(system)}")
-
- for system in area.refrigeration_equipment.all():
- if (system == None):
- break
- p.setFont('Helvetica', 12)
- p.drawString(140, alt.get_alt(p), f"Sistema: {system.system} - Tipo: {genericOrPersonal(system)}")
-
- p.showPage()
- p.save()
- return response
diff --git a/api/requirements.txt b/api/requirements.txt
deleted file mode 100644
index 44f1d13f..00000000
--- a/api/requirements.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-asgiref==3.7.2
-async-timeout==4.0.3
-chardet==5.2.0
-Django==4.2
-django-cors-headers==4.3.1
-django-redis==5.4.0
-django-redis-session-store==0.1.1
-django-redis-sessions==0.6.2
-djangorestframework==3.14.0
-mysqlclient==2.2.4
-pillow==10.3.0
-pytz==2024.1
-redis==5.0.3
-reportlab==4.2.0
-sqlparse==0.4.4
diff --git a/api/sigeie/__init__.py b/api/sigeie/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/api/sigeie/asgi.py b/api/sigeie/asgi.py
deleted file mode 100644
index d0b8cb22..00000000
--- a/api/sigeie/asgi.py
+++ /dev/null
@@ -1,16 +0,0 @@
-"""
-ASGI config for sigeie project.
-
-It exposes the ASGI callable as a module-level variable named ``application``.
-
-For more information on this file, see
-https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
-"""
-
-import os
-
-from django.core.asgi import get_asgi_application
-
-os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sigeie.settings')
-
-application = get_asgi_application()
diff --git a/api/sigeie/base_views.py b/api/sigeie/base_views.py
deleted file mode 100644
index f3981182..00000000
--- a/api/sigeie/base_views.py
+++ /dev/null
@@ -1,27 +0,0 @@
-from rest_framework import generics
-
-
-class PermissionFilteredListView(generics.ListAPIView):
- """
- Classe base para ListAPIView que filtra o queryset baseado nas permissões do usuário.
- """
-
- def get_queryset(self):
- queryset = super().get_queryset()
-
- user = self.request.user
- permitted_objects = []
- for obj in queryset:
- if self.check_object_permissions(self.request, obj):
- permitted_objects.append(obj.id)
-
- return queryset.filter(id__in=permitted_objects)
-
- def check_object_permissions(self, request, obj):
- """
- Verifica as permissões de objeto para cada item no queryset.
- """
- for permission in self.get_permissions():
- if not permission.has_object_permission(request, self, obj):
- return False
- return True
diff --git a/api/sigeie/middleware.py b/api/sigeie/middleware.py
deleted file mode 100644
index 51f9ccec..00000000
--- a/api/sigeie/middleware.py
+++ /dev/null
@@ -1,8 +0,0 @@
-
-class DisableCSRFMiddleware(object):
- def __init__(self, get_response):
- self.get_response = get_response
- def __call__(self, request):
- setattr(request, '_dont_enforce_csrf_checks', True)
- response = self.get_response(request)
- return response
\ No newline at end of file
diff --git a/api/sigeie/settings.py b/api/sigeie/settings.py
deleted file mode 100644
index fa63a638..00000000
--- a/api/sigeie/settings.py
+++ /dev/null
@@ -1,139 +0,0 @@
-from pathlib import Path
-
-BASE_DIR = Path(__file__).resolve().parent.parent
-
-SECRET_KEY = 'django-insecure-vy00e(4im2%orzf_b+dv6k$6)%c$8zfjgb6vb^hd^ugxfqpk1)'
-
-DEBUG = True
-
-ALLOWED_HOSTS = ['127.0.0.1', '10.0.2.2']
-
-INSTALLED_APPS = [
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'rest_framework',
- 'corsheaders',
- 'users',
- 'places',
- 'systems',
- 'equipments'
-]
-
-MIDDLEWARE = [
- 'django.middleware.security.SecurityMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- "corsheaders.middleware.CorsMiddleware",
- 'django.middleware.common.CommonMiddleware',
- 'sigeie.middleware.DisableCSRFMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
-]
-
-ROOT_URLCONF = 'sigeie.urls'
-
-TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [BASE_DIR / 'users.templates'],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- ],
- },
- },
-]
-
-WSGI_APPLICATION = 'sigeie.wsgi.application'
-
-
-# Database
-# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
-
-DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.mysql',
- 'HOST': 'db',
- 'PORT': '3306',
- 'USER': 'root',
- 'PASSWORD': 'root',
- 'NAME': 'sigeie_db',
- 'OPTIONS': {
- 'init_command': "SET sql_mode ='STRICT_TRANS_TABLES'"
- }
- }
-}
-
-CACHES = {
- 'default': {
- 'BACKEND': 'django_redis.cache.RedisCache',
- 'LOCATION': 'redis://localhost:6379',
- 'OPTIONS': {
- 'CLIENT_CLASS': 'django_redis.client.DefaultClient',
- }
- }
-}
-
-SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
-
-SESSION_CACHE_ALIAS = 'default'
-
-AUTH_PASSWORD_VALIDATORS = [
- {
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
- },
-]
-
-LANGUAGE_CODE = 'en-us'
-
-TIME_ZONE = 'UTC'
-
-USE_I18N = True
-
-USE_TZ = True
-
-STATIC_URL = 'static/'
-DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
-
-REST_FRAMEWORK = {
- 'DEFAULT_AUTHENTICATION_CLASSES': [
- 'rest_framework.authentication.SessionAuthentication',
- ],
- 'DEFAULT_PERMISSION_CLASSES': {
- 'rest_framework.permissions.IsAuthenticated',
- }
-}
-
-CORS_ALLOW_CREDENTIALS = True
-CORS_ALLOW_ALL_ORIGINS = True
-CORS_ALLOW_HEADERS = (
- "accept",
- "authorization",
- "content-type",
- "user-agent",
- "x-csrftoken",
- "x-requested-with",
-)
-
-EMAIL_HOST = 'sandbox.smtp.mailtrap.io'
-EMAIL_HOST_USER = '1ae45caf98a722'
-EMAIL_HOST_PASSWORD = 'c6aa9de24a4720'
-EMAIL_PORT = '465'
-
diff --git a/api/sigeie/urls.py b/api/sigeie/urls.py
deleted file mode 100644
index 877cd7b7..00000000
--- a/api/sigeie/urls.py
+++ /dev/null
@@ -1,29 +0,0 @@
-"""
-URL configuration for sigeie project.
-
-The `urlpatterns` list routes URLs to views. For more information please see:
- https://docs.djangoproject.com/en/4.2/topics/http/urls/
-Examples:
-Function views
- 1. Add an import: from my_app import views
- 2. Add a URL to urlpatterns: path('', views.home, name='home')
-Class-based views
- 1. Add an import: from other_app.views import Home
- 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
-Including another URLconf
- 1. Import the include() function: from django.urls import include, path
- 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
-"""
-from django.contrib import admin
-from django.urls import path, include
-from places.urls import router
-
-urlpatterns = [
- path('admin/', admin.site.urls),
- path('api/', include('users.urls')),
- path('api/', include(router.urls)),
- path('api/', include('systems.urls')),
- path('auth/', include('rest_framework.urls')),
- path('api/', include('equipments.urls')),
- path('api/', include('places.urls'))
-]
diff --git a/api/sigeie/wsgi.py b/api/sigeie/wsgi.py
deleted file mode 100644
index c5d484d4..00000000
--- a/api/sigeie/wsgi.py
+++ /dev/null
@@ -1,16 +0,0 @@
-"""
-WSGI config for sigeie project.
-
-It exposes the WSGI callable as a module-level variable named ``application``.
-
-For more information on this file, see
-https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
-"""
-
-import os
-
-from django.core.wsgi import get_wsgi_application
-
-os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sigeie.settings')
-
-application = get_wsgi_application()
diff --git a/api/systems/__init__.py b/api/systems/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/api/systems/admin.py b/api/systems/admin.py
deleted file mode 100644
index 8c38f3f3..00000000
--- a/api/systems/admin.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.contrib import admin
-
-# Register your models here.
diff --git a/api/systems/apps.py b/api/systems/apps.py
deleted file mode 100644
index 22403977..00000000
--- a/api/systems/apps.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from django.apps import AppConfig
-
-
-class SystemsConfig(AppConfig):
- default_auto_field = 'django.db.models.BigAutoField'
- name = 'systems'
diff --git a/api/systems/migrations/0001_initial.py b/api/systems/migrations/0001_initial.py
deleted file mode 100644
index 9f4befc5..00000000
--- a/api/systems/migrations/0001_initial.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Generated by Django 4.2 on 2024-04-01 14:49
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- initial = True
-
- dependencies = [
- ]
-
- operations = [
- migrations.CreateModel(
- name='System',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('name', models.CharField(max_length=50)),
- ],
- ),
- ]
diff --git a/api/systems/migrations/0002_atmosfericdischargesystem.py b/api/systems/migrations/0002_atmosfericdischargesystem.py
deleted file mode 100644
index 4f81e285..00000000
--- a/api/systems/migrations/0002_atmosfericdischargesystem.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Generated by Django 4.2 on 2024-04-17 17:56
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0019_delete_atmosfericdischargesystem'),
- ('systems', '0001_initial'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='AtmosfericDischargeSystem',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmosferic_discharge_systems', to='places.place')),
- ('room', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmosferic_discharge_systems', to='places.room')),
- ('system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmosferic_discharge_systems', to='systems.system')),
- ],
- options={
- 'db_table': 'atmosferic_discharge_system',
- },
- ),
- ]
diff --git a/api/systems/migrations/0003_atmosphericdischargesystem_and_more.py b/api/systems/migrations/0003_atmosphericdischargesystem_and_more.py
deleted file mode 100644
index b7cad046..00000000
--- a/api/systems/migrations/0003_atmosphericdischargesystem_and_more.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Generated by Django 4.2 on 2024-04-17 18:00
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0019_delete_atmosfericdischargesystem'),
- ('systems', '0002_atmosfericdischargesystem'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='AtmosphericDischargeSystem',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_systems', to='places.place')),
- ('room', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_systems', to='places.room')),
- ('system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_systems', to='systems.system')),
- ],
- options={
- 'db_table': 'atmospheric_discharge_systems',
- },
- ),
- migrations.DeleteModel(
- name='AtmosfericDischargeSystem',
- ),
- ]
diff --git a/api/systems/migrations/0004_equipmentphoto_equipmenttype_equipment.py b/api/systems/migrations/0004_equipmentphoto_equipmenttype_equipment.py
deleted file mode 100644
index 6e60b0fa..00000000
--- a/api/systems/migrations/0004_equipmentphoto_equipmenttype_equipment.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Generated by Django 4.2 on 2024-04-17 18:28
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0003_atmosphericdischargesystem_and_more'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='EquipmentPhoto',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('photo', models.ImageField(null=True, upload_to='equipment_photos/')),
- ('description', models.CharField(max_length=50)),
- ],
- ),
- migrations.CreateModel(
- name='EquipmentType',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('type', models.CharField(max_length=50)),
- ('system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='systems.system')),
- ],
- ),
- migrations.CreateModel(
- name='Equipment',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('equipmentPhoto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='systems.equipmentphoto')),
- ('equipmentType', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='systems.equipmenttype')),
- ],
- ),
- ]
diff --git a/api/systems/migrations/0005_alter_equipment_equipmentphoto.py b/api/systems/migrations/0005_alter_equipment_equipmentphoto.py
deleted file mode 100644
index b0d4bac5..00000000
--- a/api/systems/migrations/0005_alter_equipment_equipmentphoto.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Generated by Django 4.2 on 2024-04-18 12:50
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0004_equipmentphoto_equipmenttype_equipment'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='equipment',
- name='equipmentPhoto',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='systems.equipmentphoto'),
- ),
- ]
diff --git a/api/systems/migrations/0006_remove_equipment_equipmentphoto_and_more.py b/api/systems/migrations/0006_remove_equipment_equipmentphoto_and_more.py
deleted file mode 100644
index 7ab2c6fb..00000000
--- a/api/systems/migrations/0006_remove_equipment_equipmentphoto_and_more.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# Generated by Django 4.2 on 2024-04-18 17:23
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0005_alter_equipment_equipmentphoto'),
- ]
-
- operations = [
- migrations.RemoveField(
- model_name='equipment',
- name='equipmentPhoto',
- ),
- migrations.RemoveField(
- model_name='equipment',
- name='equipmentType',
- ),
- migrations.RemoveField(
- model_name='equipmenttype',
- name='system',
- ),
- migrations.DeleteModel(
- name='AtmosphericDischargeSystem',
- ),
- migrations.DeleteModel(
- name='Equipment',
- ),
- migrations.DeleteModel(
- name='EquipmentPhoto',
- ),
- migrations.DeleteModel(
- name='EquipmentType',
- ),
- ]
diff --git a/api/systems/migrations/0007_atmosphericdischargesystem.py b/api/systems/migrations/0007_atmosphericdischargesystem.py
deleted file mode 100644
index fa37505a..00000000
--- a/api/systems/migrations/0007_atmosphericdischargesystem.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# Generated by Django 4.2 on 2024-04-18 18:24
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('places', '0019_delete_atmosfericdischargesystem'),
- ('systems', '0006_remove_equipment_equipmentphoto_and_more'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='AtmosphericDischargeSystem',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('place', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_systems', to='places.place')),
- ('room', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_systems', to='places.room')),
- ('system', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='atmospheric_discharge_systems', to='systems.system')),
- ],
- options={
- 'db_table': 'atmospheric_discharge_systems',
- },
- ),
- ]
diff --git a/api/systems/migrations/0008_delete_atmosphericdischargesystem.py b/api/systems/migrations/0008_delete_atmosphericdischargesystem.py
deleted file mode 100644
index d3aed114..00000000
--- a/api/systems/migrations/0008_delete_atmosphericdischargesystem.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Generated by Django 4.2 on 2024-04-19 16:08
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('systems', '0007_atmosphericdischargesystem'),
- ]
-
- operations = [
- migrations.DeleteModel(
- name='AtmosphericDischargeSystem',
- ),
- ]
diff --git a/api/systems/migrations/__init__.py b/api/systems/migrations/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/api/systems/models.py b/api/systems/models.py
deleted file mode 100644
index d35f60da..00000000
--- a/api/systems/models.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from places.models import models
-
-
-class System(models.Model):
- name = models.CharField(max_length=50)
-
- def __str__(self):
- return self.name
diff --git a/api/systems/serializers.py b/api/systems/serializers.py
deleted file mode 100644
index f99c5b40..00000000
--- a/api/systems/serializers.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from rest_framework import serializers
-from .models import System
-
-
-class SystemSerializer(serializers.ModelSerializer):
- class Meta:
- model = System
- fields = ['id', 'name']
diff --git a/api/systems/tests.py b/api/systems/tests.py
deleted file mode 100644
index 7ce503c2..00000000
--- a/api/systems/tests.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/api/systems/urls.py b/api/systems/urls.py
deleted file mode 100644
index d186b7e5..00000000
--- a/api/systems/urls.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from django.urls import path, include
-from .views import SystemViewDetail, SystemViewList
-
-urlpatterns = [
- path('systems/', SystemViewList.as_view()),
- path('systems//', SystemViewDetail.as_view())
-
-]
-
diff --git a/api/systems/views.py b/api/systems/views.py
deleted file mode 100644
index b676c274..00000000
--- a/api/systems/views.py
+++ /dev/null
@@ -1,15 +0,0 @@
-from rest_framework import generics
-from .models import System
-from .serializers import SystemSerializer
-
-
-class SystemViewList(generics.ListAPIView):
- queryset = System.objects.all()
- serializer_class = SystemSerializer
- permission_classes = []
-
-
-class SystemViewDetail(generics.RetrieveAPIView):
- queryset = System.objects.all()
- serializer_class = SystemSerializer
- permission_classes = []
diff --git a/api/users/__init__.py b/api/users/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/api/users/admin.py b/api/users/admin.py
deleted file mode 100644
index 8c38f3f3..00000000
--- a/api/users/admin.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.contrib import admin
-
-# Register your models here.
diff --git a/api/users/apps.py b/api/users/apps.py
deleted file mode 100644
index 72b14010..00000000
--- a/api/users/apps.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from django.apps import AppConfig
-
-
-class UsersConfig(AppConfig):
- default_auto_field = 'django.db.models.BigAutoField'
- name = 'users'
diff --git a/api/users/migrations/0001_initial.py b/api/users/migrations/0001_initial.py
deleted file mode 100644
index 650ab025..00000000
--- a/api/users/migrations/0001_initial.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Generated by Django 4.2 on 2024-04-10 18:53
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- initial = True
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ]
-
- operations = [
- migrations.CreateModel(
- name='PlaceOwner',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('user', models.OneToOneField(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='user')),
- ],
- ),
- ]
diff --git a/api/users/migrations/0002_alter_placeowner_user.py b/api/users/migrations/0002_alter_placeowner_user.py
deleted file mode 100644
index 0131ed9d..00000000
--- a/api/users/migrations/0002_alter_placeowner_user.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Generated by Django 4.2 on 2024-04-11 19:34
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('users', '0001_initial'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='placeowner',
- name='user',
- field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='user'),
- ),
- ]
diff --git a/api/users/migrations/0003_alter_placeowner_user.py b/api/users/migrations/0003_alter_placeowner_user.py
deleted file mode 100644
index 6a60a746..00000000
--- a/api/users/migrations/0003_alter_placeowner_user.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Generated by Django 4.2 on 2024-04-12 17:23
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('users', '0002_alter_placeowner_user'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='placeowner',
- name='user',
- field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='placeowner', to=settings.AUTH_USER_MODEL),
- ),
- ]
diff --git a/api/users/migrations/0004_alter_placeowner_user.py b/api/users/migrations/0004_alter_placeowner_user.py
deleted file mode 100644
index 4c48c10c..00000000
--- a/api/users/migrations/0004_alter_placeowner_user.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Generated by Django 4.2 on 2024-04-16 18:14
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('users', '0003_alter_placeowner_user'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='placeowner',
- name='user',
- field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='placeowner', to=settings.AUTH_USER_MODEL, verbose_name='user'),
- ),
- ]
diff --git a/api/users/migrations/0005_placeeditor.py b/api/users/migrations/0005_placeeditor.py
deleted file mode 100644
index 5adb732c..00000000
--- a/api/users/migrations/0005_placeeditor.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Generated by Django 4.2 on 2024-06-12 13:26
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('users', '0004_alter_placeowner_user'),
- ]
-
- operations = [
- migrations.CreateModel(
- name='PlaceEditor',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='place_editor', to=settings.AUTH_USER_MODEL, verbose_name='user')),
- ],
- ),
- ]
diff --git a/api/users/migrations/0006_alter_placeowner_user.py b/api/users/migrations/0006_alter_placeowner_user.py
deleted file mode 100644
index 437f24cc..00000000
--- a/api/users/migrations/0006_alter_placeowner_user.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# Generated by Django 4.2 on 2024-06-14 13:54
-
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('users', '0005_placeeditor'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='placeowner',
- name='user',
- field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='place_owner', to=settings.AUTH_USER_MODEL, verbose_name='user'),
- ),
- ]
diff --git a/api/users/migrations/__init__.py b/api/users/migrations/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/api/users/models.py b/api/users/models.py
deleted file mode 100644
index 0c582299..00000000
--- a/api/users/models.py
+++ /dev/null
@@ -1,16 +0,0 @@
-from django.db import models
-from django.contrib.auth.models import User
-
-
-class PlaceOwner(models.Model):
- user = models.OneToOneField(User, verbose_name="user", on_delete=models.CASCADE, related_name='place_owner')
-
- def __str__(self):
- return self.user.first_name
-
-
-class PlaceEditor(models.Model):
- user = models.OneToOneField(User, verbose_name="user", on_delete=models.CASCADE, related_name='place_editor')
-
- def __str__(self):
- return self.user.first_name
diff --git a/api/users/permissions.py b/api/users/permissions.py
deleted file mode 100644
index 9335de03..00000000
--- a/api/users/permissions.py
+++ /dev/null
@@ -1,13 +0,0 @@
-from rest_framework import permissions
-
-
-class IsOwner(permissions.BasePermission):
- def has_object_permission(self, request, view, obj):
- return request.user == obj
-
-
-class IsOwnerOrReadOnly(permissions.BasePermission):
- def has_object_permission(self, request, view, obj):
- if request.method in permissions.SAFE_METHODS:
- return True
- return obj.owner == request.user
diff --git a/api/users/serializers.py b/api/users/serializers.py
deleted file mode 100644
index c2875908..00000000
--- a/api/users/serializers.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# serializers.py
-from rest_framework import serializers, response
-from django.contrib.auth.models import User
-from .models import PlaceOwner, PlaceEditor
-import re
-
-
-def validate_username(value):
- if not re.match("^[a-zA-Z0-9]+$", value):
- raise serializers.ValidationError("The username must contain only letters and numbers.")
- return value
-
-
-class UserSerializer(serializers.ModelSerializer):
- username = serializers.CharField(min_length=6, max_length=23, required=True)
- password = serializers.CharField(min_length=6, max_length=200, write_only=True)
- first_name = serializers.CharField(required=True)
- email = serializers.EmailField(required=True)
-
- class Meta:
- model = User
- fields = ['id', 'password', 'username', 'first_name', 'email', 'is_active', 'date_joined', 'groups']
- extra_kwargs = {
- 'password': {'write_only': True},
- 'first_name': {'required': True},
- 'email': {'required': True},
- 'is_active': {'read_only': True},
- 'date_joined': {'read_only': True},
- 'groups': {'read_only': True}
- }
-
- def create(self, validated_data):
- user = User.objects.create_user(
- username=validated_data['username'],
- password=validated_data['password'],
- first_name=validated_data['first_name'],
- email=validated_data.get('email')
- )
- return user
-
-
-class UserLoginSerializer(serializers.Serializer):
- username = serializers.CharField(min_length=6, max_length=23, required=True)
- password = serializers.CharField(min_length=6, max_length=200, required=True)
-
-
-class UsernameSerializer(serializers.Serializer):
- username = serializers.CharField(min_length=6, max_length=23, required=True)
-
-
-class UserUpdateSerializer(serializers.Serializer):
- first_name = serializers.CharField(required=True)
- email = serializers.EmailField(required=True)
-
- def update(self, instance, validated_data):
- instance.first_name = validated_data.get('first_name', instance.first_name)
- instance.email = validated_data.get('email', instance.email)
- instance.save()
- return instance
-
-
-class PlaceOwnerSerializer(serializers.ModelSerializer):
- class Meta:
- model = PlaceOwner
- fields = ['id']
-
-
-class PlaceEditorSerializer(serializers.ModelSerializer):
- class Meta:
- model = PlaceEditor
- fields = ['id']
diff --git a/api/users/templates/password_reset_email.html b/api/users/templates/password_reset_email.html
deleted file mode 100644
index ed81c32a..00000000
--- a/api/users/templates/password_reset_email.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{% autoescape off %}
-Olá {{ user.username }},
-
-Você solicitou a redefinição de senha para sua conta. Insira o código abaixo para redefinir sua senha:
-
-{{ token }}
-
-Se você não solicitou a redefinição de senha, ignore este e-mail.
-
-Atenciosamente,
-Equipe do seu site
-{% endautoescape %}
diff --git a/api/users/tests.py b/api/users/tests.py
deleted file mode 100644
index 7ce503c2..00000000
--- a/api/users/tests.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/api/users/urls.py b/api/users/urls.py
deleted file mode 100644
index d636ccc2..00000000
--- a/api/users/urls.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# urls.py
-from django.urls import path
-from .views import GetCSRFToken, GetSessionCookie, CheckAuthenticatedView, UserCreateView, AuthenticatedUserView, UserDetailView, LoginView, LogoutView, Email, PasswordResetConfirmView
-from django.urls import include
-
-urlpatterns = [
- path('csrfcookie/', GetCSRFToken.as_view(), name='csrf-cookie'),
- path('sessioncookie/', GetSessionCookie.as_view(), name='session-cookie'),
- path('checkauth/', CheckAuthenticatedView.as_view(), name='check-auth'),
- path('users/', UserCreateView.as_view(), name='create-user'),
- path('userauth/', AuthenticatedUserView.as_view(), name='authenticated-user'),
- path('users//', UserDetailView.as_view(), name='user_detail'),
- path('login/', LoginView.as_view(), name='login'),
- path('logout/', LogoutView.as_view(), name='logout'),
- path('recover/', Email.as_view()),
- path('reset/', PasswordResetConfirmView.as_view())
-]
diff --git a/api/users/views.py b/api/users/views.py
deleted file mode 100644
index 456115c8..00000000
--- a/api/users/views.py
+++ /dev/null
@@ -1,138 +0,0 @@
-# views.py
-from django.contrib.auth import authenticate, login, logout
-from django.contrib.auth import get_user_model
-from django.contrib.auth.models import User
-from django.contrib.auth.tokens import default_token_generator
-from django.core.mail import EmailMessage
-from django.http import HttpResponse, JsonResponse
-from django.template.loader import render_to_string
-from django.utils.decorators import method_decorator
-from django.views.decorators.csrf import ensure_csrf_cookie
-from rest_framework import generics
-from rest_framework import status
-from rest_framework.permissions import AllowAny, IsAuthenticated
-from rest_framework.response import Response
-from rest_framework.views import APIView
-
-from .permissions import IsOwner
-from .serializers import UserSerializer, UserLoginSerializer, UserUpdateSerializer
-
-
-@method_decorator(ensure_csrf_cookie, name='dispatch')
-class GetCSRFToken(APIView):
- permission_classes = [AllowAny]
-
- def get(self, request):
- return Response({'success': 'CSRF Cookie Set'})
-
-
-class GetSessionCookie(APIView):
- permission_classes = [IsAuthenticated]
-
- def get(self, request):
- sessionid = request.COOKIES.get('sessionid')
- response = HttpResponse()
- response.set_cookie('sessionid', sessionid)
- return response
-
-
-class CheckAuthenticatedView(APIView):
- permission_classes = [AllowAny]
-
- def get(self, request):
- if request.user.is_authenticated:
- return Response({'isAuthenticated': True})
- else:
- return Response({'isAuthenticated': False})
-
-
-class UserCreateView(generics.CreateAPIView):
- queryset = User.objects.all()
- serializer_class = UserSerializer
- permission_classes = [AllowAny]
-
-
-class UserDetailView(generics.RetrieveUpdateDestroyAPIView):
- queryset = User.objects.all()
- serializer_class = UserUpdateSerializer
- permission_classes = [IsOwner, IsAuthenticated]
-
-
-class AuthenticatedUserView(generics.RetrieveAPIView):
- queryset = User.objects.all()
- serializer_class = UserSerializer
- permission_classes = [IsAuthenticated]
-
- def get_object(self):
- return self.request.user
-
-
-class LoginView(APIView):
- permission_classes = [AllowAny]
-
- def post(self, request, format=None):
- serializer = UserLoginSerializer(data=request.data)
- if serializer.is_valid():
- username = serializer.validated_data["username"]
- password = serializer.validated_data["password"]
- user = authenticate(username=username, password=password)
- if user is not None:
- login(request, user)
- return Response({'message': 'Login successful'}, status=status.HTTP_200_OK)
- else:
- return Response({'message': 'Invalid credentials'}, status=status.HTTP_401_UNAUTHORIZED)
- return JsonResponse(serializer.errors)
-
-
-class LogoutView(APIView):
- permission_classes = [IsAuthenticated]
-
- def post(self, request, format=None):
- logout(request)
- return Response({'message': 'Logout successful'}, status=status.HTTP_200_OK)
-
-
-class Email(APIView):
- permission_classes = []
-
- def post(self, request, *args, **kwargs):
- email = request.data.get('email')
- user = User.objects.filter(email=email).first()
- if user is not None:
- token = default_token_generator.make_token(user)
- mail_subject = 'Redefinição de senha'
- message = render_to_string('password_reset_email.html', {
- 'user': user,
- 'token': token,
- })
- email = EmailMessage(mail_subject, message, to=[email])
- email.send()
- return Response({'message': 'Email de redefinição de senha enviado'}, status=status.HTTP_200_OK)
- else:
- return Response({'message': 'Usuário não encontrado'}, status=status.HTTP_404_NOT_FOUND)
-
-
-class PasswordResetConfirmView(APIView):
- permission_classes = []
-
- def post(self, request):
- try:
- email = request.data.get("email")
- token = request.data.get("token")
-
- user = get_user_model().objects.get(email=email)
- except (TypeError, ValueError, OverflowError, get_user_model().DoesNotExist):
- user = None
-
- if user is not None and default_token_generator.check_token(user, token):
- new_password = request.data.get('new_password')
- confirm_password = request.data.get('confirm_password')
- if new_password == confirm_password:
- user.set_password(new_password)
- user.save()
- return Response({'message': 'Senha redefinida com sucesso'}, status=status.HTTP_200_OK)
- else:
- return Response({'message': 'As senhas não correspondem'}, status=status.HTTP_400_BAD_REQUEST)
- else:
- return Response({'message': 'O link de redefinição de senha é inválido'},
- status=status.HTTP_400_BAD_REQUEST)
diff --git a/doc/img/release-roadmap.4cf783b31fbe.png b/doc/img/release-roadmap.4cf783b31fbe.png
deleted file mode 100644
index d18faa44..00000000
Binary files a/doc/img/release-roadmap.4cf783b31fbe.png and /dev/null differ
diff --git a/doc/img/sige-ie-img.png b/doc/img/sige-ie-img.png
deleted file mode 100644
index e16bb804..00000000
Binary files a/doc/img/sige-ie-img.png and /dev/null differ
diff --git a/doc/img/sige_ie_logo.jpeg b/doc/img/sige_ie_logo.jpeg
deleted file mode 100644
index b5c183d6..00000000
Binary files a/doc/img/sige_ie_logo.jpeg and /dev/null differ
diff --git a/docs/assets/1.png b/docs/assets/1.png
new file mode 100644
index 00000000..d6d1d464
Binary files /dev/null and b/docs/assets/1.png differ
diff --git a/frontend/sige_ie/assets/1000x1000Horizontal.png b/docs/assets/1000x1000Horizontal.png
similarity index 100%
rename from frontend/sige_ie/assets/1000x1000Horizontal.png
rename to docs/assets/1000x1000Horizontal.png
diff --git a/docs/assets/Electrician-black.gif b/docs/assets/Electrician-black.gif
new file mode 100644
index 00000000..194fdc9b
Binary files /dev/null and b/docs/assets/Electrician-black.gif differ
diff --git a/docs/assets/Electrician.gif b/docs/assets/Electrician.gif
new file mode 100644
index 00000000..8bc513c4
Binary files /dev/null and b/docs/assets/Electrician.gif differ
diff --git a/docs/assets/Electrician2-black.gif b/docs/assets/Electrician2-black.gif
new file mode 100644
index 00000000..a6ef8fce
Binary files /dev/null and b/docs/assets/Electrician2-black.gif differ
diff --git a/docs/assets/Electrician2.gif b/docs/assets/Electrician2.gif
new file mode 100644
index 00000000..9c510c12
Binary files /dev/null and b/docs/assets/Electrician2.gif differ
diff --git a/docs/assets/Login Page Wireframe Mobile UI Prototype-2_page-0019.jpg b/docs/assets/Login Page Wireframe Mobile UI Prototype-2_page-0019.jpg
new file mode 100644
index 00000000..5b806049
Binary files /dev/null and b/docs/assets/Login Page Wireframe Mobile UI Prototype-2_page-0019.jpg differ
diff --git a/docs/assets/R1.png b/docs/assets/R1.png
new file mode 100644
index 00000000..05513eb9
Binary files /dev/null and b/docs/assets/R1.png differ
diff --git a/docs/assets/R2.png b/docs/assets/R2.png
new file mode 100644
index 00000000..6ba88dc3
Binary files /dev/null and b/docs/assets/R2.png differ
diff --git a/docs/assets/R3.png b/docs/assets/R3.png
new file mode 100644
index 00000000..b33c593d
Binary files /dev/null and b/docs/assets/R3.png differ
diff --git a/docs/assets/R4.png b/docs/assets/R4.png
new file mode 100644
index 00000000..ceee2344
Binary files /dev/null and b/docs/assets/R4.png differ
diff --git a/frontend/sige_ie/assets/UNB.png b/docs/assets/UNB.png
similarity index 100%
rename from frontend/sige_ie/assets/UNB.png
rename to docs/assets/UNB.png
diff --git a/docs/assets/adicionar.equipamentos.jpg b/docs/assets/adicionar.equipamentos.jpg
new file mode 100644
index 00000000..198ef2a8
Binary files /dev/null and b/docs/assets/adicionar.equipamentos.jpg differ
diff --git a/doc/img/arquitetura-api-rest-sigeie.png b/docs/assets/arquitetura.png
similarity index 100%
rename from doc/img/arquitetura-api-rest-sigeie.png
rename to docs/assets/arquitetura.png
diff --git a/docs/assets/day-and-night.png b/docs/assets/day-and-night.png
new file mode 100644
index 00000000..0edb5d13
Binary files /dev/null and b/docs/assets/day-and-night.png differ
diff --git a/docs/assets/default_765x625.png b/docs/assets/default_765x625.png
new file mode 100644
index 00000000..424e36dd
Binary files /dev/null and b/docs/assets/default_765x625.png differ
diff --git a/frontend/sige_ie/assets/1000x1000.png b/docs/assets/default_transparent_1000x1000.png
similarity index 100%
rename from frontend/sige_ie/assets/1000x1000.png
rename to docs/assets/default_transparent_1000x1000.png
diff --git a/docs/assets/default_transparent_765x625.png b/docs/assets/default_transparent_765x625.png
new file mode 100644
index 00000000..4c8229f6
Binary files /dev/null and b/docs/assets/default_transparent_765x625.png differ
diff --git a/docs/assets/favicon.ico b/docs/assets/favicon.ico
new file mode 100644
index 00000000..cf72f904
Binary files /dev/null and b/docs/assets/favicon.ico differ
diff --git a/docs/assets/favicon_transparent_32x32.png b/docs/assets/favicon_transparent_32x32.png
new file mode 100644
index 00000000..5c441352
Binary files /dev/null and b/docs/assets/favicon_transparent_32x32.png differ
diff --git a/docs/assets/github-sign.png b/docs/assets/github-sign.png
new file mode 100644
index 00000000..7b222645
Binary files /dev/null and b/docs/assets/github-sign.png differ
diff --git a/docs/assets/google-play.png b/docs/assets/google-play.png
new file mode 100644
index 00000000..3487f7f8
Binary files /dev/null and b/docs/assets/google-play.png differ
diff --git a/docs/assets/imagem.mapa.jpg b/docs/assets/imagem.mapa.jpg
new file mode 100644
index 00000000..4e89060a
Binary files /dev/null and b/docs/assets/imagem.mapa.jpg differ
diff --git a/frontend/sige_ie/assets/lighting.png b/docs/assets/lighting.png
similarity index 100%
rename from frontend/sige_ie/assets/lighting.png
rename to docs/assets/lighting.png
diff --git a/docs/assets/linkedin.png b/docs/assets/linkedin.png
new file mode 100644
index 00000000..b6231a35
Binary files /dev/null and b/docs/assets/linkedin.png differ
diff --git a/docs/assets/locais.jpg b/docs/assets/locais.jpg
new file mode 100644
index 00000000..4d2e088d
Binary files /dev/null and b/docs/assets/locais.jpg differ
diff --git a/docs/assets/logo.png b/docs/assets/logo.png
new file mode 100644
index 00000000..300aee64
Binary files /dev/null and b/docs/assets/logo.png differ
diff --git "a/docs/assets/menu.instala\303\247oes.jpg" "b/docs/assets/menu.instala\303\247oes.jpg"
new file mode 100644
index 00000000..f8e223b9
Binary files /dev/null and "b/docs/assets/menu.instala\303\247oes.jpg" differ
diff --git a/docs/assets/moon.png b/docs/assets/moon.png
new file mode 100644
index 00000000..39405601
Binary files /dev/null and b/docs/assets/moon.png differ
diff --git a/docs/assets/pp.pdf b/docs/assets/pp.pdf
new file mode 100644
index 00000000..8e84a862
Binary files /dev/null and b/docs/assets/pp.pdf differ
diff --git a/docs/assets/release2.1.png b/docs/assets/release2.1.png
new file mode 100644
index 00000000..ca9e15c0
Binary files /dev/null and b/docs/assets/release2.1.png differ
diff --git a/docs/assets/release2.png b/docs/assets/release2.png
new file mode 100644
index 00000000..4c987d0d
Binary files /dev/null and b/docs/assets/release2.png differ
diff --git a/docs/assets/sun.png b/docs/assets/sun.png
new file mode 100644
index 00000000..187b7db6
Binary files /dev/null and b/docs/assets/sun.png differ
diff --git a/docs/atas/ata1.md b/docs/atas/ata1.md
new file mode 100644
index 00000000..7ffdb6b6
--- /dev/null
+++ b/docs/atas/ata1.md
@@ -0,0 +1,69 @@
+### Ata de Reunião - Criação de Aplicativo Mobile para Retrofitting de Instalações Elétricas em Edificações
+
+--
+### Detalhes da Reunião
+
+ Data:27 de Fevereiro de 2024
+ Horário:14 horas
+ Local: LDTEA 206
+
+---
+
+### Participantes
+
+- **Oscar de Brito**
+- **Danilo Melo**
+- **Kauan José**
+- **Pedro Lucas**
+- **Ramires Rocha**
+
+---
+
+### Pauta
+
+1. Discussão sobre a criação de um aplicativo mobile baseado no TCC de Estudo de Metodologia de Levantamento de Dados para Retrofitting de Instalações Elétricas em Edificações.
+2. Definição dos objetivos e funcionalidades do aplicativo.
+3. Distribuição de tarefas entre os membros da equipe.
+
+---
+
+### Decisões e Discussões
+
+#### 1. Objetivos e Funcionalidades do Aplicativo
+
+- **Objetivo Principal:** Facilitar o levantamento de dados para o retrofit de instalações elétricas em edificações.
+- **Funcionalidades Básicas:**
+ - Cadastro de edificações
+ - Registro de características elétricas atuais
+ - Geração de relatórios
+ - Interface intuitiva e fácil de usar
+
+#### 2. Distribuição de Tarefas
+
+- **Design da Interface do Usuário:**
+ - **Danilo Melo**
+ - **Ramires Rocha**
+- **Desenvolvimento do Banco de Dados:**
+ - **Kauan José**
+ - **Pedro Lucas**
+- **Desenvolvimento do Backend e História do Usuário:**
+ - **Oscar de Brito**
+
+#### 3. Definição de Objetivos
+
+- **Ferramentas de Desenvolvimento:** Estabelecimento das ferramentas necessárias.
+- **Prazos:** Conclusão do projeto dentro do prazo estabelecido.
+
+---
+
+### Próxima Reunião
+
+**Data:** 20 de Março de 2024
+**Horário:** 15:00
+**Local:** LTDEA 206
+
+---
+
+### Observações
+
+Na presente reunião, foram elucidados todos os requisitos funcionais e não funcionais do projeto, bem como todas as demandas necessárias para a criação do projeto. A divisão da equipe e o levantamento dos requisitos necessários foram estabelecidos para que cada um elabore sua parte do projeto.
diff --git a/docs/atas/ata2.md b/docs/atas/ata2.md
new file mode 100644
index 00000000..2748f8c5
--- /dev/null
+++ b/docs/atas/ata2.md
@@ -0,0 +1,77 @@
+### Ata de Reunião - Apresentação do Protótipo com Tela de Login, Registro e Layout da Página do Aplicativo Mobile, Apresentação do Nome, Sistema e Subsistemas
+
+---
+
+### Detalhes da Reunião
+
+ Data:20 de Março de 2024
+ Horário:14 horas
+ Local:LDTEA Sala 206
+
+---
+
+### Participantes
+
+- **Danilo de Melo**
+- **Kauan Jóse**
+- **Oscar de Brito**
+- **Ramires Rocha**
+- **Pedro Lucas**
+
+---
+
+### Pauta
+
+- Apresentação do protótipo inicial do aplicativo, incluindo:
+ - Tela de login
+ - Registro
+ - Layout da página principal
+- Discussão sobre a usabilidade e design do protótipo
+- Feedback dos membros da equipe
+- Definição de próximos passos e ajustes necessários
+
+---
+
+### Descrição
+
+### 1. Apresentação do Protótipo
+
+- O protótipo inicial do aplicativo foi apresentado aos membros da equipe.
+- Foram demonstradas as telas de login e registro, bem como o layout preliminar da página principal.
+- Apresentação do nome do aplicativo definido como **Sigeie**.
+- Foram apresentados todos os sistemas e subsistemas definidos a partir do material de apoio disponibilizado para a geração do aplicativo, incluindo:
+ - Instalações de Baixa Tensão
+ - Cabeamento Estruturado
+ - Sistema de Proteção contra Descargas Elétricas
+ - Sistema de Detecção de Alarme de Incêndio
+
+### 2. Discussão sobre Usabilidade e Design
+
+- Os membros da equipe discutiram a usabilidade e o design do protótipo.
+- Foram levantados pontos positivos e áreas que necessitam de melhoria em termos de interface e experiência do usuário.
+- Discussão sobre a usabilidade de todos os sistemas e subsistemas apresentados.
+
+### 3. Feedback do Cliente
+
+- O cliente apresentou seu feedback da apresentação com pontos positivos e negativos e pontos de melhoria.
+- O cliente concordou com o layout, design e interface.
+- O cliente solicitou melhorias nos sistemas e subsistemas, recomendando acréscimos e retiradas de objetos nos sistemas e subsistemas.
+
+### 4. Definição de Próximos Passos
+
+- Foi acordado que serão feitos ajustes com base no feedback recebido.
+- Cada membro da equipe foi designado para realizar as alterações específicas em suas respectivas áreas de responsabilidade.
+
+---
+
+### Próxima Reunião
+
+ Data:20 de Junho de 2024
+ Horário: 15 horas
+ Local: LDTEA Sala 206
+
+---
+
+### Observações
+
+- Na presente reunião, houve a aprovação por parte do cliente da logo criada, assim como de toda a interface e aprovação da divisão dos sistemas e subsistemas do protótipo apresentado.
diff --git a/docs/atas/ata3.md b/docs/atas/ata3.md
new file mode 100644
index 00000000..05b7cda0
--- /dev/null
+++ b/docs/atas/ata3.md
@@ -0,0 +1,87 @@
+# Ata de Reunião - Apresentação do Protótipo com Sistema e Subsistemas
+
+---
+
+### Detalhes da Reunião
+
+ Data: 20 de Junho de 2024
+ Horário: 15 horas
+ Local: LDTEA Sala 206
+
+---
+
+### Participantes
+
+- **Danilo de Melo**
+- **Kauan Jóse**
+- **Oscar de Brito**
+- **Ramires Rocha**
+- **Pedro Lucas**
+
+---
+
+### Pauta
+
+- Apresentação do protótipo inicial do aplicativo, incluindo os sistemas de:
+ - **Iluminação**
+ - **Refrigeração**
+ - **Cargas Elétricas**
+ - **Linhas Elétricas**
+ - **Quadro de Distribuição**
+ - **Cabeamento Estruturado**
+ - **Circuitos Elétricos**
+ - **Sistema de Proteção contra Descargas Atmosféricas**
+ - **Sistema de Detecção de Alarme de Incêndio**
+- Discussão sobre a usabilidade e design do protótipo.
+- Feedback dos membros da equipe.
+- Definição de próximos passos e ajustes necessários.
+
+---
+
+### Descrição
+
+### 1. Apresentação do Protótipo
+
+- O protótipo inicial do aplicativo foi apresentado aos membros da equipe.
+- Foram demonstrados os sistemas criados, incluindo:
+ - **Sistema de Iluminação**
+ - **Sistema de Refrigeração**
+ - **Cargas Elétricas**
+ - **Linhas Elétricas**
+ - **Quadro de Distribuição**
+ - **Cabeamento Estruturado**
+ - **Circuitos Elétricos**
+ - **Sistema de Proteção contra Descargas Atmosféricas**
+ - **Sistema de Detecção de Alarme de Incêndio**
+- Apresentação do nome do aplicativo definido como **Sigeie**.
+- Apresentação dos sistemas e subsistemas definidos a partir do material de apoio disponibilizado para a geração do aplicativo.
+
+### 2. Discussão sobre Usabilidade e Design
+
+- Os membros da equipe discutiram a usabilidade e o design do protótipo.
+- Foram levantados pontos positivos e áreas que necessitam de melhoria em termos de interface e experiência do usuário.
+- Discussão detalhada sobre a usabilidade de todos os sistemas e subsistemas apresentados.
+
+### 3. Feedback do Cliente
+
+- O cliente apresentou seu feedback da apresentação com pontos positivos e negativos, e sugestões de melhoria.
+- O cliente solicitou melhorias nos sistemas e subsistemas, recomendando acréscimos e retiradas de objetos nos sistemas e subsistemas.
+
+### 4. Definição de Próximos Passos
+
+- Foi acordado que serão feitos ajustes com base no feedback recebido.
+- Cada membro da equipe foi designado para realizar as alterações específicas em suas respectivas áreas de responsabilidade.
+
+---
+
+## Próxima Reunião
+
+ Data: 05 de Agosto de 2024
+ Horário: 10 horas
+ Local: LDTEA Sala 313
+
+---
+
+### Observações
+
+- Na presente reunião, houve a aprovação por parte do cliente das informações contidas em cada campo de cada sistema e subsistema. Ficou acordado também que possíveis alterações serão relatadas para mudanças futuras.
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 00000000..2070e36e
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,630 @@
+
+
+
+
+
+
+ SIGE IE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sistema de Auxilio para Operação e Manutenção de Instalação
+ Elétrica.
+
+
+
+ Uma ferramenta inovadora, projetada para otimizar a
+ coleta de dados e o suporte em operações e manutenções
+ de sistemas elétricos. Este aplicativo móvel foi
+ desenvolvido para acelerar a obtenção de informações
+ essenciais, aumentando a eficiência das operações e
+ garantindo uma gestão mais eficaz das instalações
+ elétricas.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Descrição do Produto
+
+
+
+
+ Gerenciamento de Instalações
+
+
+ Melhore a eficiência e a gestão das instalações
+ elétricas com uma interface intuitiva que facilita a
+ coleta de dados e o suporte às operações e
+ manutenções. Supervise e acompanhe manutenções
+ preventivas e corretivas, garantindo que todas as
+ atividades sejam realizadas no tempo certo e da
+ melhor forma.
+
+
+
+
+
+
+
+
+
+
+
+
+ Funcionalidades Diversas
+
+
+ Aproveite uma ampla gama de funcionalidades que
+ garantem uma gestão eficiente e segura das
+ instalações elétricas. Cadastre, edite e exclua
+ locais e equipamentos, monitore em tempo real, gere
+ relatórios, integre com mapas e desfrute de uma
+ interface intuitiva.
+
+
+
+
+
+
+
+
+
+ Funcionalidades
+
+
+
+
+
+ Cadastro de Equipamento
+
+
+
+ Cadastre os equipamentos presentes em cada
+ local, organizando e estruturando as
+ instalações. Edite e exclua equipamentos
+ conforme necessário para manter as informações
+ sempre atualizadas.
+
+
+
+
+
+
+
+
+ Cadastro de Locais
+
+
+
+ Mantenha um registro detalhado de todos os
+ locais e salas dentro da instalação, facilitando
+ a gestão e manutenção. Edite e exclua locais
+ conforme necessário. Gere relatórios completos
+ de cada local de forma instantânea.
+
+
+
+
+
+
+
+
+
+
+ Menu de Instalações
+
+
+
+ Acesse rapidamente todos os sistemas presentes
+ em um local e adicione novos de forma prática e
+ simples.
+
+
+
+
+
+
+
+
+ Integração com Mapas
+
+
+
+ Acompanhe localizações e salas registradas em
+ tempo real. Crie e atualize locais
+ instantaneamente, garantindo que todas as
+ mudanças sejam refletidas no sistema sem
+ atrasos.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Equipe de Desenvolvimento
+
+
+
+
+
+ Danilo Melo
+
+
+
+
+ • Desenvolvedor Mobile
+ • Desenvolvedor Web
+ • UX e UI designer
+ • Analista de requisitos
+ • Integração frontend/backend
+
+
+
+
+ Kauan José
+
+
+
+
+ • Desenvolvedor backend
+ • Desenvolvedor Infraestrutura
+
+
+
+
+ Oscar de Brito
+
+
+
+
+ • Analista de requisitos
+ • Desenvolvedor backend
+ • Desenvolvedor frontend
+ • Integração backend/frontend
+
+
+
+
+ Pedro Lucas
+
+
+
+
+ • Desenvolvedor backend
+ • Desenvolvedor infraestrutura
+ • Participação na codificação do frontend
+ • Integração backend/frontend
+
+
+
+
+ Ramires Rocha
+
+
+
+
+ • Desenvolvedor frontend
+ • Levantamento de requisitos
+ • Gerenciamento da documentação
+ • Validação com a cliente
+
+
+
+
+
+
+
+
+
+
Baixe o nosso aplicativo:
+
+
+
+
+
+ © 2024 SIGE IE. Todos os direitos reservados.
+
+
+
+
+
+
+
+
+
diff --git a/docs/info/Roadmap.md b/docs/info/Roadmap.md
new file mode 100644
index 00000000..68445de3
--- /dev/null
+++ b/docs/info/Roadmap.md
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/info/arquitetura.md b/docs/info/arquitetura.md
new file mode 100644
index 00000000..0954eee6
--- /dev/null
+++ b/docs/info/arquitetura.md
@@ -0,0 +1,35 @@
+Arquitetura de uma aplicação com uma API REST, onde os clientes interagem com servidores que, por sua vez, interagem com um banco de dados MySQL e um armazenamento de sessão no Redis.
+
+### Clientes
+- **Função:** São os usuários finais ou sistemas que fazem requisições para a API.
+- **Interação:** Fazem requisições HTTP para os servidores e recebem respostas em formato JSON.
+
+### Servidores
+- **Função:** Provedores da API REST que processam as requisições dos clientes.
+- **Interação com Banco de Dados:** Realizam operações CRUD (Criar, Ler, Atualizar, Deletar) no banco de dados MySQL.
+- **Interação com Redis:** Utilizam o Redis para gerenciamento de sessão dos usuários.
+
+### Banco de Dados MySQL
+- **Função:** Armazenamento persistente dos dados da aplicação.
+- **Operações CRUD:** Recebe comandos dos servidores para realizar operações CRUD.
+
+### Sessão no Redis
+- **Função:** Armazenamento de dados de sessão para usuários autenticados.
+- **Interação:** Os servidores lêem e escrevem dados de sessão para gerenciar o estado da sessão dos clientes.
+
+### Fluxo Geral
+1. O cliente faz uma requisição HTTP para o servidor.
+2. O servidor processa a requisição, que pode envolver:
+ - A leitura ou escrita de informações no banco de dados MySQL.
+ - A verificação ou atualização de dados de sessão no Redis.
+3. Após processar a requisição, o servidor envia uma resposta em formato JSON de volta ao cliente.
+
+### Observações
+- **Escalabilidade:** A presença de múltiplos servidores sugere que a arquitetura foi projetada para escalar horizontalmente.
+- **Performance:** O uso do Redis para sessões indica uma preocupação com a velocidade de acesso aos dados de sessão, que são geralmente mais voláteis e acessados com frequência.
+- **Segurança:** A gestão de sessões no Redis sugere que o sistema implementa mecanismos de autenticação e possivelmente de autorização.
+- **Disponibilidade:** A arquitetura sugere que há redundância nos servidores para garantir a disponibilidade do serviço.
+
+A arquitetura é representativa de muitas aplicações web modernas que buscam desempenho, escalabilidade e confiabilidade.
+
\ No newline at end of file
diff --git a/docs/info/backend.md b/docs/info/backend.md
new file mode 100644
index 00000000..1978a24d
--- /dev/null
+++ b/docs/info/backend.md
@@ -0,0 +1,114 @@
+### Como subir o projeto
+Estas etapas são válidas para Linux OS e WSL.
+#### Como subir o back-end:
+
+Primeiramente, interrompa qualquer processo que use o porto 8080, 3306 e 6379. Então atualize o seu sistema:
+ ```
+ sudo apt-get update
+ ```
+
+ ```
+ sudo apt-get upgrade
+ ```
+
+2. **Instalação de Dependências:**
+
+- Instale o Python, Pip e os cabeçalhos do Python e MySQL:
+
+ Python:
+ ```
+ sudo apt-get install python3.11
+ ```
+
+ Pip:
+ ```
+ sudo apt-get install python3-pip
+ ```
+
+ Cabeçalhos:
+ ```
+ sudo apt-get install python3.11-dev default-libmysqlclient-dev build-essential pkg-config
+ ```
+
+ mysqlclient:
+
+ ```
+ pip install mysqlclient
+ ```
+
+- Instale o virtualenv para criar um ambiente virtual do projeto:
+
+ Virtualenv:
+ ```
+ sudo pip3 install virtualenv
+ ```
+
+Vá para dentro da pasta raiz `api`:
+
+1. Cria o ambiente virtual e ative-o:
+
+ Criar ambiente virtual:
+ ```
+ virtualenv -p python3.11 venv
+ ```
+
+ Ativar ambiente:
+ ```
+ source venv/bin/activate
+ ```
+
+3. Com o ambiente virtual ativado, instale as dependências:
+
+ ```
+ pip install -r requirements.txt
+ ```
+
+4. Com o docker iniciado, crie a imagem do banco de dados pela primeira vez:
+
+ ```
+ docker-compose build
+ ```
+
+6. Suba a imagem:
+
+ ```
+ docker-compose up
+ ```
+
+8. Ainda no diretório raiz `api`, aplique as migrações:
+
+ ```
+ python manage.py makemigrations
+ ```
+
+ ```
+ python3 manage.py migrate
+ ```
+
+10. Inicie o servidor:
+
+ ```
+ python3 manage.py runserver
+ ```
+
+Pronto! O servidor está configurado e em execução com o banco de dados configurado.
+
+#### Pela segunda vez
+
+Garanta que não haja nenhum processo que use o porto `8080`, `3306` e `6379`. Por fim, com todas as dependências configuradas, basta:
+
+- Iniciar o Docker e o container `sigeie`;
+- Baixar as atualizações (caso haja):
+
+```sh
+git pull
+```
+
+- Atualizar as dependências, fazer as migrações e iniciar o servidor:
+
+```sh
+source venv/bin/activate && pip install -r requirements.txt && python manage.py makemigrations && python manage.py migrate && python manage.py runserver
+```
+
+Isso é tudo, pessoal.
+```
\ No newline at end of file
diff --git a/docs/info/contribuir.md b/docs/info/contribuir.md
new file mode 100644
index 00000000..a3c649c0
--- /dev/null
+++ b/docs/info/contribuir.md
@@ -0,0 +1,18 @@
+### Como contribuir
+1. Faça um fork do repositório do projeto.
+2. Clone o fork na sua máquina:
+
+ ```
+ git clone https://github.com/{seu-usuario}/T2G3-Sistema-Instalacao-Eletrica.git
+ ```
+
+4. Comente na issue que deseja contribuir ou crie uma issue nova.
+5. Entre no repositório clonado na sua máquina:
+
+ ```
+ cd T2G3-Sistema-Instalacao-Eletrica
+ ```
+
+7. Após enviar suas contribuições para o fork do seu repositório, faça um pull request.
+8. Aguarde a revisão.
+
diff --git a/docs/info/cronograma.md b/docs/info/cronograma.md
new file mode 100644
index 00000000..e5181a66
--- /dev/null
+++ b/docs/info/cronograma.md
@@ -0,0 +1,14 @@
+Cronograma do projeto:
+
+| Semana | Status | Entrega | Início | Fim |
+| --- | --- | --- | --- | --- |
+1 | Feito | Separação da equipe e estudo do projeto | 19/02/24 | 26/02/24
+2 | Feito | Reunião com o cliente, levantamento de requisitos, criação do repositório no GitHub e documentação | 26/02/24 | 04/03/24
+3 | Feito | Preparação do ambiente de desenvolvimento do backend e frontend, levantamento de requisitos e escrita de histórias de usuário da release 1, prototipação em baixa fidelidade | 04/03/24 | 11/03/24
+4 | Feito | Prototipação em baixa fidelidade, levantamento de requisitos e escrita das histórias de usuário, agendamento com o cliente para apresentar os resultados | 11/03/24 | 18/03/24
+5 | Feito | Reunião com o cliente para apresentar os resultados e validar, modelagem do diagrama entidade-relacionamento e codificação da release 1 | 18/03/24 | 25/03/24
+6 | Feito | Codificação da release 1 e atualização do diagrama entidade-relacionamento | 25/03/24 | 01/04/24
+7 | Feito | Codificação da release 1 e entrega da release 1 e entrega da tela de login e tela de cadastro | 01/04/24 | 08/04/24
+8 | Feito | Codificação da release 2 e atualização do diagrama entidade-relacionamento e produção das telas de gerenciar local,gerenciar SPDA e gerenciar salas| 08/04/24| 08/05/24
+9 | Feito | Entrega da realese 2 e atualização do diagrama entidade-relacionamento e planejamento para entrega das próximas releases| 08/05/24 | 01/07/24
+10| Feito | Codificação da realese 3, reunião com cliente com a apresentação do desenvolvimento do prototipo e aprovação jun to ao cliente| 01/07/2024 | 05/07/2024
\ No newline at end of file
diff --git a/docs/info/frontend.md b/docs/info/frontend.md
new file mode 100644
index 00000000..10346abb
--- /dev/null
+++ b/docs/info/frontend.md
@@ -0,0 +1,52 @@
+### Guia de Configuração do Front-end
+
+### Como subir o front-end:
+
+Antes de começar, verifique se o Flutter SDK está atualizado e compatível com o projeto. Siga as instruções específicas para sua plataforma (Windows, macOS, Linux) disponíveis na documentação oficial do Flutter.
+
+Caso ainda não tenha feito, instale os seguintes requisitos em sua máquina:
+
+#### Flutter SDK:
+Siga as instruções de instalação para a sua plataforma.
+
+#### Android Studio ou Visual Studio Code:
+
+##### Android Studio:
+
+```sh
+sudo snap install android-studio --classic
+```
+
+##### Visual Studio Code:
+
+```sh
+sudo snap install code --classic
+```
+
+Para o VS Code, instale as extensões do Flutter e Dart disponíveis na aba de extensões do editor.
+
+#### Emulador Android ou um dispositivo físico:
+Configure um emulador usando o AVD Manager do Android Studio ou configure seu dispositivo Android para depuração USB.
+
+Com o ambiente preparado, siga os passos abaixo:
+
+#### Clone o Repositório do Front-end:
+
+```sh
+git clone https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica.git
+```
+
+#### Abra o Projeto no Editor:
+Abra a pasta clonada no Android Studio ou no Visual Studio Code.
+
+#### Baixe as Dependências:
+Abra um terminal na pasta `frontend/sige_ie` e execute o comando:
+
+```sh
+flutter pub get
+```
+
+#### Execute o Projeto:
+
+- No Android Studio: Escolha um dispositivo ou emulador na barra de ferramentas e clique em 'Run'.
+- No Visual Studio Code: Selecione um dispositivo ou emulador na barra de status e pressione `F5` ou utilize o comando `flutter run` na paleta de comandos.
diff --git a/docs/info/home.md b/docs/info/home.md
new file mode 100644
index 00000000..a81c3947
--- /dev/null
+++ b/docs/info/home.md
@@ -0,0 +1,69 @@
+SIGE IE
+
+
+
+
+Sobre este projeto
+
+Aplicativo web mobile desenvolvido para a Universidade de Brasília com objetivo de gerenciar as instalações elétricas e dar suporte ao retrofitting das instalações.
+
+Posição
+O SIGE IE é um sistema da Universidade de Brasília para o gerenciamento de instalações elétricas com o objetivo de facilitar o cadastro das informações de instalação elétrica para ajudar na reforma da parte elétrica dos prédios e salas. Ele permite a automatização da geração de relatórios das instalações elétricas de cada lugar e a centralização dessas informações para uso dos responsáveis pelas instalações. As pessoas devem usar o SIGE IE porque ele simplifica e agiliza o processo de gerenciamento, principalmente do retrofitting de instalações elétricas, garantindo maior eficiência e segurança.
+
+
+Objetivo
+Simplificar o cadastro e gerenciamento de informações de instalações elétricas e automatizar a geração de relatórios.
+
+
+Tecnologias
+
+##### Back-end
+
+| Nome | Versão | Uso | Configuração |
+|-------------------|--------|-------------------|-------------------------------------------------------------------------|
+| Python | 3.11.8 | Linguagem | [Site oficial do Python](https://www.python.org/downloads/) |
+| Django | 4.2 (LTS) | Framework web | Automática |
+| Django REST framework | 3.14 | API REST | Automática |
+| Docker | 25.0.4 | Conteiner e imagem | [Site oficial do Docker](https://docs.docker.com/desktop/install/ubuntu/) |
+| Redis | 7.2 | Banco de dados cache para sessão | Automática via Docker |
+| MySQL | 8.1 | Banco de dados | Automática via Docker |
+| mysqlclient | 2.2.4 | Cliente para se conectar com MySQL | [Site do Pypi com as configurações](https://pypi.org/project/mysqlclient/) |
+
+###### Observação
+
+Atualmente o Django REST Framework suporta as seguintes versões do Python e do Django:
+
+| Python | 3.6 | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 |
+|--------|-----|-----|-----|-----|------|------|
+| Django | 3.0 | 3.1 | 3.2 | 4.0 | 4.1 | 4.2 (LTS) |
+
+Como a versão LTS mais recente do Django (2024) é a 4.2, escolhemos configurar o projeto usando Python 3.11.
+
+##### Front-end mobile
+
+| Nome | Versão | Uso | Configuração |
+|---------------|--------|--------------------|--------------------------------------------------------------|
+| Flutter | 3.19.3 | Framework frontend | [Site oficial do Flutter](https://docs.flutter.dev/get-started/install/linux) |
+| Android Studio| Iguana | IDE para desenvolvimento Android com Android SDK | [Site oficial do Android Studio](https://developer.android.com/studio/index.html) |
+
+## Equipe
+
+
+
+
+### Organização
+
+| Papel | Atribuições | Responsável | Participantes |
+| --- | --- | --- | --- |
+| Cliente | Validar as entregas | Loana | Loana e Alex |
+| Desenvolvedor back-end | Codificar o backend, configurar a infraestrutura | Pedro | Pedro, Kauan e Oscar |
+| Desenvolvedor frontend | Codificar o frontend, realizar integração com backend | Danilo | Danilo, Ramires, Pedro e Oscar |
+| UX design | Projetar a interface do usuário, criar protótipos e realizar entrevistas com os clientes | Danilo | Danilo |
+| Analista de requisitos | Levantar requisitos, gerenciar a documentação, validar com cliente | Oscar | Oscar, Ramires e Pedro |
\ No newline at end of file
diff --git a/docs/info/modelagemBD.md b/docs/info/modelagemBD.md
new file mode 100644
index 00000000..ae518362
--- /dev/null
+++ b/docs/info/modelagemBD.md
@@ -0,0 +1,8 @@
+### Banco de dados
+
+A estrutura do banco de dados é projetada para uma aplicação de gerenciamento de instalações, onde os usuários podem manter registros de locais, salas, sistemas e equipamentos. O esquema reflete uma hierarquia de dados bem definida e normalizada, facilitando a manutenção, a consulta e a expansão do banco de dados.
+
+A complexidade dos relacionamentos indica uma solução robusta capaz de lidar com uma grande variedade de informações operacionais, mantendo a integridade e a eficiência dos dados. Cada entidade é projetada para armazenar informações específicas, permitindo consultas detalhadas e relatórios sobre o estado e uso dos equipamentos e sistemas.
+
+
+
diff --git a/docs/info/prototipo.md b/docs/info/prototipo.md
new file mode 100644
index 00000000..45d382ed
--- /dev/null
+++ b/docs/info/prototipo.md
@@ -0,0 +1,27 @@
+# Protótipo de Aplicativo Móvel: Gerenciamento de Instalações
+
+Este documento apresenta um protótipo detalhado de um aplicativo móvel projetado para o gerenciamento e configuração de instalações. Com um foco específico no controle de espaços físicos e infraestrutura, o aplicativo oferece uma gama abrangente de funcionalidades que visam simplificar e efetivar a administração de locais.
+
+## Funcionalidades Principais
+
+- **Autenticação de Usuário:** Interface de login segura para acessar funcionalidades personalizadas.
+- **Registro e Gerenciamento de Locais:** Capacidade de adicionar, editar e gerenciar detalhes de locais, como salas, incluindo atributos específicos como andar e nome.
+- **Configuração de Sistemas:** Opções para ajustar sistemas dentro de um local, abrangendo desde baixa tensão até alarmes de incêndio, indicando uma abordagem minuciosa ao gerenciamento de infraestrutura.
+- **Inventário de Equipamentos:** Funcionalidades para incluir e administrar equipamentos por categoria, quantidade e localização, refletindo um componente de inventário essencial.
+- **Relatórios e Análises:** Ferramentas para a geração de relatórios, proporcionando insights e revisões das configurações e instalações.
+
+## Design e Usabilidade
+
+O aplicativo exibe um design minimalista, priorizando a clareza e a facilidade de navegação. Utiliza uma paleta de cores sóbrias e uma barra de navegação inferior constante para promover uma experiência de usuário intuitiva e eficiente.
+
+## Visualização do Protótipo
+
+Para uma visão detalhada do protótipo e suas funcionalidades, veja o documento incorporado abaixo:
+
+
+Se seu navegador não suporta iframes. Você pode acessar o PDF diretamente aqui .
+
+Este protótipo evidencia uma solução abrangente para o gerenciamento de instalações, destacando-se por sua interface limpa, navegação intuitiva, e um conjunto robusto de funcionalidades práticas. Ideal para profissionais e organizações que buscam otimizar o controle e administração de espaços físicos e infraestrutura.
+
+
diff --git a/docs/info/requisitosEpicos.md b/docs/info/requisitosEpicos.md
new file mode 100644
index 00000000..79dacdcd
--- /dev/null
+++ b/docs/info/requisitosEpicos.md
@@ -0,0 +1,12 @@
+# Épicos
+| N. | Eṕicos |
+| --- | --- |
+| 1 | Prover contas |
+| 2 | Prover locais |
+| 3 | Prover retrofitting de instalações de baixa tensão |
+| 4 | Prover retrofitting de cabeamento estruturado |
+| 5 | Prover retrofitting de sistema de proteção conta descargas atmosféricas (SPDA) |
+| 6 | Prover retrofitting de sistema de detecção de alarme de incêndio |
+| 7 | Prover retrofiting de sistema de refrigeração |
+| 8 | Gerar relatorio |
+
diff --git a/docs/info/requisitosFeatures.md b/docs/info/requisitosFeatures.md
new file mode 100644
index 00000000..a6093ff0
--- /dev/null
+++ b/docs/info/requisitosFeatures.md
@@ -0,0 +1,16 @@
+# Features
+| N. | Épico | Features |
+| --- | --- | --- |
+| 1 | 1 | Gerenciar conta de usuário |
+| 2 | 2 | Gerenciar locais |
+| 3 | 2 | Gerenciar salas |
+| 4 | 3 | Gerenciar sistema de iluminação |
+| 5 | 3 | Gerenciar cargas elétricas |
+| 6 | 3 | Gerenciar linhas elétricas |
+| 7 | 3| Gerenciar circuitos elétricos |
+| 8 | 3 | Gerenciar quadros de distribuição |
+| 9 | 4 | Gerenciar cabeamento estruturado |
+| 10 | 5 | Gerenciar sistema de proteção conta descargas atmosféricas (SPDA) |
+| 11 | 6 | Gerenciar sistema de detecção de alarme de incêndio (SDAI) |
+| 12 | 7 | Gerenciar sistema de Refrigeração|
+| 13 | 8 | Gerar relatório |
\ No newline at end of file
diff --git a/docs/releases/Release1.md b/docs/releases/Release1.md
new file mode 100644
index 00000000..a126d36b
--- /dev/null
+++ b/docs/releases/Release1.md
@@ -0,0 +1,15 @@
+Data de Inicio: 19 de fevereiro de 2024;
+Data de Termino: 08 de Abril de 2024;
+
+
+O release, que ocorreu de 19 de fevereiro a 08 de abril de 2024, foi marcado pela conclusão bem-sucedida das User Stories planejadas, conforme mostrado na imagem fornecida. A equipe demonstrou compromisso com a excelência e a qualidade, mantendo uma comunicação eficaz e adaptando-se às mudanças.
+
+
+
+
+Entregas:Na imagem a seguir são mostradas as US entregues;
+
+
+
+
\ No newline at end of file
diff --git a/docs/releases/release2.md b/docs/releases/release2.md
new file mode 100644
index 00000000..0eb84aae
--- /dev/null
+++ b/docs/releases/release2.md
@@ -0,0 +1,19 @@
+Data de Inicio: 09 de Abril de 2024;
+Data de Termino: 08 de Maio de 2024;
+
+
+Entregas: Na imagem a seguir são mostradas as US que serão entregues;
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/releases/release3.md b/docs/releases/release3.md
new file mode 100644
index 00000000..4c0d68da
--- /dev/null
+++ b/docs/releases/release3.md
@@ -0,0 +1,17 @@
+Data de Inicio : 21 de Maio de 2024;
+Data de Entrega: 05 de Julho de 2024;
+
+
+Entregas: Nas imagem a seguir são mostradas as US que serão entregues;
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/releases/release4.md b/docs/releases/release4.md
new file mode 100644
index 00000000..6e430a43
--- /dev/null
+++ b/docs/releases/release4.md
@@ -0,0 +1,19 @@
+Data de Inicio : 02 de Julho de 2024;
+Data de Termino: 05 de Agosto de 2024;
+
+
+
+Entregas:Na imagem a seguir são mostradas as US que serão entregues;
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/script.js b/docs/script.js
new file mode 100644
index 00000000..290945b8
--- /dev/null
+++ b/docs/script.js
@@ -0,0 +1,60 @@
+function toggleMenu() {
+ const navToggle = document.getElementById("nav-toggle");
+ const navContent = document.getElementById("nav-content");
+ navToggle.classList.toggle("open");
+ navContent.classList.toggle("open");
+}
+
+document.getElementById("modeToggle").addEventListener("click", function () {
+ document.body.classList.toggle("dark-mode");
+
+ if (document.body.classList.contains("dark-mode")) {
+ document.getElementById("image1").src = "assets/Electrician-black.gif";
+ document.getElementById("image2").src = "assets/Electrician2-black.gif";
+ document.getElementById("img-sun-moon").src = "assets/moon.png";
+ document.querySelector(".gradient-bg").classList.add("dark-mode");
+ } else {
+ document.getElementById("image1").src = "assets/Electrician.gif";
+ document.getElementById("image2").src = "assets/Electrician2.gif";
+ document.getElementById("img-sun-moon").src = "assets/sun.png";
+ document.querySelector(".gradient-bg").classList.remove("dark-mode");
+ }
+});
+
+$(document).ready(function () {
+ $(".team-carousel").slick({
+ infinite: true,
+ slidesToShow: 3,
+ slidesToScroll: 1,
+ arrows: true,
+ autoplay: true,
+ autoplaySpeed: 2000,
+ responsive: [
+ {
+ breakpoint: 1024,
+ settings: {
+ slidesToShow: 2,
+ slidesToScroll: 1,
+ infinite: true,
+ dots: true,
+ },
+ },
+ {
+ breakpoint: 600,
+ settings: {
+ slidesToShow: 1,
+ slidesToScroll: 1,
+ },
+ },
+ ],
+ });
+});
+
+document.querySelectorAll('a[href^="#"]').forEach((anchor) => {
+ anchor.addEventListener("click", function (e) {
+ e.preventDefault();
+ document.querySelector(this.getAttribute("href")).scrollIntoView({
+ behavior: "smooth",
+ });
+ });
+});
diff --git a/docs/style.css b/docs/style.css
new file mode 100644
index 00000000..3bfc65ce
--- /dev/null
+++ b/docs/style.css
@@ -0,0 +1,351 @@
+#nav-toggle {
+ display: none;
+}
+
+@media (max-width: 1280px) {
+ #nav-content {
+ display: none;
+ }
+ #nav-content .sun-moon {
+ width: 60px;
+ height: auto;
+ display: block;
+ margin: auto;
+ transform: translateX(-8px);
+ }
+ #nav-toggle {
+ display: block;
+ }
+
+ #nav-toggle.open + #nav-content {
+ display: flex;
+ flex-direction: column;
+ margin: auto;
+ width: 100%;
+ background-color: #003366fb;
+ position: absolute;
+ top: 60px;
+ left: 0;
+ padding: 1em 0;
+ }
+ .dark-mode #nav-toggle.open + #nav-content {
+ background-color: #1f1f1ffb;
+ }
+
+ #nav-content a {
+ padding: 1em;
+ text-align: center;
+ width: 100%;
+ }
+
+ #nav-content a:hover {
+ transform: scale(1.1);
+ }
+}
+
+#nav-toggle.open .bar1 {
+ transform: rotate(-45deg) translate(-4px, 6px);
+}
+
+#nav-toggle.open .bar2 {
+ opacity: 0;
+}
+
+#nav-toggle.open .bar3 {
+ transform: rotate(45deg) translate(-4px, -6px);
+}
+
+.bar1,
+.bar2,
+.bar3 {
+ width: 25px;
+ height: 3px;
+ background-color: white;
+ margin: 4px 30px;
+ transition: 0.4s;
+}
+
+.gradient-bg {
+ background: linear-gradient(to bottom, #003366, #ffcc00);
+}
+
+.dark-mode .gradient-bg {
+ background: linear-gradient(to bottom, #333333, #777777);
+}
+
+.image-container {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.image-container img {
+ width: 100%;
+ height: auto;
+ max-width: 300px;
+ border-radius: 8px;
+ margin: 0 auto;
+}
+
+.slick-slide {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+#navAction {
+ padding: 10px;
+ border-radius: 10px;
+ text-decoration: none;
+}
+
+#modeToggle img {
+ width: 35%;
+ height: 35%;
+}
+
+#modeToggle img:hover {
+ transform: scale(1.2);
+}
+
+.slick-prev,
+.slick-next {
+ color: #333;
+ font-size: 24px;
+ line-height: 1;
+ opacity: 0.75;
+ transition: opacity 0.3s ease;
+}
+
+.slick-prev:hover,
+.slick-next:hover {
+ opacity: 1;
+}
+
+.slick-prev:before,
+.slick-next:before {
+ font-family: "slick";
+ font-size: 24px;
+}
+
+.slick-prev:before {
+ content: "←";
+}
+
+.slick-next:before {
+ content: "→";
+}
+
+#logo {
+ display: flex;
+ align-items: center;
+ height: 100%;
+ padding-right: 20px;
+}
+
+#logo img {
+ width: 160px;
+ height: auto;
+ margin-left: 10px;
+}
+
+.navbar-item {
+ display: flex;
+ align-items: center;
+ height: 100%;
+ padding: 0 15px 0 15px;
+}
+
+#navAction {
+ padding: 10px;
+ border-radius: 10px;
+ text-decoration: none;
+}
+.navbar-item a {
+ padding: 0 15px;
+ color: white;
+ text-decoration: none;
+ font-weight: bold;
+}
+
+.dark-mode nav {
+ background-color: #1f1f1f;
+}
+
+#header {
+ background-color: #003366;
+}
+
+.dark-mode #header {
+ background-color: #1f1f1f;
+}
+
+.dark-mode .bg-white {
+ background-color: #1f1f1f;
+ color: #ffffff;
+}
+
+#nav-content {
+ background-color: transparent;
+}
+
+.dark-mode #navAction {
+ background-color: #ffcc00;
+ color: #1f1f1f;
+}
+
+nav a {
+ color: #ffffff;
+ transition: 0.3s;
+}
+
+nav a:hover {
+ color: #ffcc00;
+}
+
+.dark-mode nav a {
+ color: #ffffff;
+}
+
+.dark-mode nav a:hover {
+ color: #ffcc00;
+}
+
+#navAction {
+ background-color: #ffcc00;
+ color: #003366;
+}
+
+#navAction:hover {
+ background-color: #ffa500;
+}
+
+.dark-mode #navAction {
+ color: #1f1f1f;
+}
+
+.dark-mode #navAction:hover {
+ background-color: #ffa500;
+}
+
+body.dark-mode {
+ background-color: #121212;
+ color: #ffffff;
+}
+
+body.dark-mode .bg-white {
+ background-color: #333333;
+ color: #ffffff;
+}
+
+body.dark-mode .text-gray-800 {
+ color: #ffffff;
+}
+
+body.dark-mode .text-gray-600 {
+ color: #bbbbbb;
+}
+
+body.dark-mode .team-carousel .text-gray-800 {
+ color: #ffffff;
+}
+
+body.dark-mode .team-carousel .text-gray-600 {
+ color: #bbbbbb;
+}
+
+.waves {
+ position: relative;
+ width: 100%;
+ height: 15vh;
+ margin-bottom: -7px;
+ min-height: 100px;
+ max-height: 150px;
+}
+
+.parallax > use {
+ animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
+}
+
+.parallax > use:nth-child(1) {
+ animation-delay: -2s;
+ animation-duration: 7s;
+}
+
+.parallax > use:nth-child(2) {
+ animation-delay: -3s;
+ animation-duration: 10s;
+}
+
+.parallax > use:nth-child(3) {
+ animation-delay: -4s;
+ animation-duration: 13s;
+}
+
+.parallax > use:nth-child(4) {
+ animation-delay: -5s;
+ animation-duration: 20s;
+}
+
+@keyframes move-forever {
+ 0% {
+ transform: translate3d(-90px, 0, 0);
+ }
+ 100% {
+ transform: translate3d(85px, 0, 0);
+ }
+}
+
+.dark-mode .waves path {
+ fill: #333333;
+}
+
+footer {
+ background-color: #003366;
+ color: #ffffff;
+ padding: 20px 0;
+ text-align: center;
+}
+
+.dark-mode footer {
+ background-color: #1f1f1f;
+}
+
+footer a {
+ color: #ffcc00;
+ text-decoration: none;
+}
+
+footer a:hover {
+ text-decoration: underline;
+}
+
+footer p {
+ margin: 0;
+ font-size: 14px;
+}
+
+.download-app {
+ text-align: center;
+ margin-top: 10px;
+ margin-bottom: 15px;
+}
+
+.download-app img {
+ width: 60px;
+ height: auto;
+ margin: auto;
+ transition: transform 0.3s;
+}
+
+.download-app img:hover {
+ transform: scale(1.1);
+}
+
+.download-app p {
+ margin: 0;
+}
+.download-app h2 {
+ font-size: 25px;
+ font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
+}
diff --git a/frontend/.idea/.gitignore b/frontend/.idea/.gitignore
deleted file mode 100644
index 26d33521..00000000
--- a/frontend/.idea/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
diff --git a/frontend/.idea/frontend.iml b/frontend/.idea/frontend.iml
deleted file mode 100644
index 92e2a39e..00000000
--- a/frontend/.idea/frontend.iml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/.idea/misc.xml b/frontend/.idea/misc.xml
deleted file mode 100644
index 639900d1..00000000
--- a/frontend/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/.idea/modules.xml b/frontend/.idea/modules.xml
deleted file mode 100644
index f3d93d75..00000000
--- a/frontend/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/.idea/vcs.xml b/frontend/.idea/vcs.xml
deleted file mode 100644
index 6c0b8635..00000000
--- a/frontend/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/frontend/sige_ie/.gitignore b/frontend/sige_ie/.gitignore
deleted file mode 100644
index 29a3a501..00000000
--- a/frontend/sige_ie/.gitignore
+++ /dev/null
@@ -1,43 +0,0 @@
-# Miscellaneous
-*.class
-*.log
-*.pyc
-*.swp
-.DS_Store
-.atom/
-.buildlog/
-.history
-.svn/
-migrate_working_dir/
-
-# IntelliJ related
-*.iml
-*.ipr
-*.iws
-.idea/
-
-# The .vscode folder contains launch configuration and tasks you configure in
-# VS Code which you may wish to be included in version control, so this line
-# is commented out by default.
-#.vscode/
-
-# Flutter/Dart/Pub related
-**/doc/api/
-**/ios/Flutter/.last_build_id
-.dart_tool/
-.flutter-plugins
-.flutter-plugins-dependencies
-.pub-cache/
-.pub/
-/build/
-
-# Symbolication related
-app.*.symbols
-
-# Obfuscation related
-app.*.map.json
-
-# Android Studio will place build artifacts here
-/android/app/debug
-/android/app/profile
-/android/app/release
diff --git a/frontend/sige_ie/.metadata b/frontend/sige_ie/.metadata
deleted file mode 100644
index aa90aa80..00000000
--- a/frontend/sige_ie/.metadata
+++ /dev/null
@@ -1,45 +0,0 @@
-# This file tracks properties of this Flutter project.
-# Used by Flutter tool to assess capabilities and perform upgrades etc.
-#
-# This file should be version controlled and should not be manually edited.
-
-version:
- revision: "ba393198430278b6595976de84fe170f553cc728"
- channel: "stable"
-
-project_type: app
-
-# Tracks metadata for the flutter migrate command
-migration:
- platforms:
- - platform: root
- create_revision: ba393198430278b6595976de84fe170f553cc728
- base_revision: ba393198430278b6595976de84fe170f553cc728
- - platform: android
- create_revision: ba393198430278b6595976de84fe170f553cc728
- base_revision: ba393198430278b6595976de84fe170f553cc728
- - platform: ios
- create_revision: ba393198430278b6595976de84fe170f553cc728
- base_revision: ba393198430278b6595976de84fe170f553cc728
- - platform: linux
- create_revision: ba393198430278b6595976de84fe170f553cc728
- base_revision: ba393198430278b6595976de84fe170f553cc728
- - platform: macos
- create_revision: ba393198430278b6595976de84fe170f553cc728
- base_revision: ba393198430278b6595976de84fe170f553cc728
- - platform: web
- create_revision: ba393198430278b6595976de84fe170f553cc728
- base_revision: ba393198430278b6595976de84fe170f553cc728
- - platform: windows
- create_revision: ba393198430278b6595976de84fe170f553cc728
- base_revision: ba393198430278b6595976de84fe170f553cc728
-
- # User provided section
-
- # List of Local paths (relative to this file) that should be
- # ignored by the migrate tool.
- #
- # Files that are not part of the templates will be ignored by default.
- unmanaged_files:
- - 'lib/main.dart'
- - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/frontend/sige_ie/.vscode/settings.json b/frontend/sige_ie/.vscode/settings.json
deleted file mode 100644
index 79eab2c1..00000000
--- a/frontend/sige_ie/.vscode/settings.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "workbench.colorCustomizations": {
- "activityBar.activeBackground": "#3399ff",
- "activityBar.background": "#3399ff",
- "activityBar.foreground": "#15202b",
- "activityBar.inactiveForeground": "#15202b99",
- "activityBarBadge.background": "#bf0060",
- "activityBarBadge.foreground": "#e7e7e7",
- "commandCenter.border": "#e7e7e799",
- "sash.hoverBorder": "#3399ff",
- "statusBar.background": "#007fff",
- "statusBar.foreground": "#e7e7e7",
- "statusBarItem.hoverBackground": "#3399ff",
- "statusBarItem.remoteBackground": "#007fff",
- "statusBarItem.remoteForeground": "#e7e7e7",
- "titleBar.activeBackground": "#007fff",
- "titleBar.activeForeground": "#e7e7e7",
- "titleBar.inactiveBackground": "#007fff99",
- "titleBar.inactiveForeground": "#e7e7e799"
- },
- "peacock.color": "#007fff"
-}
\ No newline at end of file
diff --git a/frontend/sige_ie/README.md b/frontend/sige_ie/README.md
deleted file mode 100644
index 1e0bc35c..00000000
--- a/frontend/sige_ie/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# sige_ie
-
-A new Flutter project.
-
-## Getting Started
-
-This project is a starting point for a Flutter application.
-
-A few resources to get you started if this is your first Flutter project:
-
-- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
-- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
-
-For help getting started with Flutter development, view the
-[online documentation](https://docs.flutter.dev/), which offers tutorials,
-samples, guidance on mobile development, and a full API reference.
diff --git a/frontend/sige_ie/analysis_options.yaml b/frontend/sige_ie/analysis_options.yaml
deleted file mode 100644
index 0d290213..00000000
--- a/frontend/sige_ie/analysis_options.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-# This file configures the analyzer, which statically analyzes Dart code to
-# check for errors, warnings, and lints.
-#
-# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
-# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
-# invoked from the command line by running `flutter analyze`.
-
-# The following line activates a set of recommended lints for Flutter apps,
-# packages, and plugins designed to encourage good coding practices.
-include: package:flutter_lints/flutter.yaml
-
-linter:
- # The lint rules applied to this project can be customized in the
- # section below to disable rules from the `package:flutter_lints/flutter.yaml`
- # included above or to enable additional rules. A list of all available lints
- # and their documentation is published at https://dart.dev/lints.
- #
- # Instead of disabling a lint rule for the entire project in the
- # section below, it can also be suppressed for a single line of code
- # or a specific dart file by using the `// ignore: name_of_lint` and
- # `// ignore_for_file: name_of_lint` syntax on the line or in the file
- # producing the lint.
- rules:
- # avoid_print: false # Uncomment to disable the `avoid_print` rule
- # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
-
-# Additional information about this file can be found at
-# https://dart.dev/guides/language/analysis-options
diff --git a/frontend/sige_ie/android/.gitignore b/frontend/sige_ie/android/.gitignore
deleted file mode 100644
index 6f568019..00000000
--- a/frontend/sige_ie/android/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-gradle-wrapper.jar
-/.gradle
-/captures/
-/gradlew
-/gradlew.bat
-/local.properties
-GeneratedPluginRegistrant.java
-
-# Remember to never publicly share your keystore.
-# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
-key.properties
-**/*.keystore
-**/*.jks
diff --git a/frontend/sige_ie/android/app/build.gradle b/frontend/sige_ie/android/app/build.gradle
deleted file mode 100644
index 8233a549..00000000
--- a/frontend/sige_ie/android/app/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-plugins {
- id "com.android.application"
- id "kotlin-android"
- id "dev.flutter.flutter-gradle-plugin"
-}
-
-def localProperties = new Properties()
-def localPropertiesFile = rootProject.file('local.properties')
-if (localPropertiesFile.exists()) {
- localPropertiesFile.withReader('UTF-8') { reader ->
- localProperties.load(reader)
- }
-}
-
-def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
-if (flutterVersionCode == null) {
- flutterVersionCode = '1'
-}
-
-def flutterVersionName = localProperties.getProperty('flutter.versionName')
-if (flutterVersionName == null) {
- flutterVersionName = '1.0'
-}
-
-android {
- namespace "com.example.sige_ie"
- compileSdk flutter.compileSdkVersion
- ndkVersion flutter.ndkVersion
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-
- kotlinOptions {
- jvmTarget = '1.8'
- }
-
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
-
- defaultConfig {
- applicationId "com.example.sige_ie"
- // Defina os valores a seguir de acordo com as necessidades do seu aplicativo.
- minSdkVersion 21 // Definido como 21 conforme sua especificação
- targetSdkVersion 31 // Atualizado para apontar para a versão 31, que é a mais recente no momento
- versionCode flutterVersionCode.toInteger()
- versionName flutterVersionName
- multiDexEnabled true // Ativado para suportar múltiplos DEX
-}
-
-
- buildTypes {
- release {
- // TODO: Add your own signing config for the release build.
- // Signing with the debug keys for now, so `flutter run --release` works.
- signingConfig signingConfigs.debug
- }
- }
-}
-
-flutter {
- source '../..'
-}
-
-dependencies {
- implementation 'androidx.multidex:multidex:2.0.1'
- implementation 'com.google.android.gms:play-services-maps:18.0.2'
- implementation 'com.google.android.gms:play-services-location:21.0.1'
- implementation 'com.google.maps.android:android-maps-utils:2.3.0'
-}
diff --git a/frontend/sige_ie/android/app/src/debug/AndroidManifest.xml b/frontend/sige_ie/android/app/src/debug/AndroidManifest.xml
deleted file mode 100644
index 399f6981..00000000
--- a/frontend/sige_ie/android/app/src/debug/AndroidManifest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
diff --git a/frontend/sige_ie/android/app/src/main/AndroidManifest.xml b/frontend/sige_ie/android/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 24e1cadb..00000000
--- a/frontend/sige_ie/android/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/sige_ie/android/app/src/main/kotlin/com/example/sige_ie/MainActivity.kt b/frontend/sige_ie/android/app/src/main/kotlin/com/example/sige_ie/MainActivity.kt
deleted file mode 100644
index 9076008d..00000000
--- a/frontend/sige_ie/android/app/src/main/kotlin/com/example/sige_ie/MainActivity.kt
+++ /dev/null
@@ -1,5 +0,0 @@
-package com.example.sige_ie
-
-import io.flutter.embedding.android.FlutterActivity
-
-class MainActivity: FlutterActivity()
diff --git a/frontend/sige_ie/android/app/src/main/res/drawable-v21/launch_background.xml b/frontend/sige_ie/android/app/src/main/res/drawable-v21/launch_background.xml
deleted file mode 100644
index f74085f3..00000000
--- a/frontend/sige_ie/android/app/src/main/res/drawable-v21/launch_background.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/frontend/sige_ie/android/app/src/main/res/drawable/launch_background.xml b/frontend/sige_ie/android/app/src/main/res/drawable/launch_background.xml
deleted file mode 100644
index 304732f8..00000000
--- a/frontend/sige_ie/android/app/src/main/res/drawable/launch_background.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/frontend/sige_ie/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/frontend/sige_ie/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index db77bb4b..00000000
Binary files a/frontend/sige_ie/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/frontend/sige_ie/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/frontend/sige_ie/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 17987b79..00000000
Binary files a/frontend/sige_ie/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/frontend/sige_ie/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/frontend/sige_ie/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 09d43914..00000000
Binary files a/frontend/sige_ie/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/frontend/sige_ie/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/frontend/sige_ie/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index d5f1c8d3..00000000
Binary files a/frontend/sige_ie/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/frontend/sige_ie/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/frontend/sige_ie/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index 4d6372ee..00000000
Binary files a/frontend/sige_ie/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/frontend/sige_ie/android/app/src/main/res/values-night/styles.xml b/frontend/sige_ie/android/app/src/main/res/values-night/styles.xml
deleted file mode 100644
index 06952be7..00000000
--- a/frontend/sige_ie/android/app/src/main/res/values-night/styles.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
diff --git a/frontend/sige_ie/android/app/src/main/res/values/styles.xml b/frontend/sige_ie/android/app/src/main/res/values/styles.xml
deleted file mode 100644
index cb1ef880..00000000
--- a/frontend/sige_ie/android/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
diff --git a/frontend/sige_ie/android/app/src/profile/AndroidManifest.xml b/frontend/sige_ie/android/app/src/profile/AndroidManifest.xml
deleted file mode 100644
index 399f6981..00000000
--- a/frontend/sige_ie/android/app/src/profile/AndroidManifest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
diff --git a/frontend/sige_ie/android/build.gradle b/frontend/sige_ie/android/build.gradle
deleted file mode 100644
index bc157bd1..00000000
--- a/frontend/sige_ie/android/build.gradle
+++ /dev/null
@@ -1,18 +0,0 @@
-allprojects {
- repositories {
- google()
- mavenCentral()
- }
-}
-
-rootProject.buildDir = '../build'
-subprojects {
- project.buildDir = "${rootProject.buildDir}/${project.name}"
-}
-subprojects {
- project.evaluationDependsOn(':app')
-}
-
-tasks.register("clean", Delete) {
- delete rootProject.buildDir
-}
diff --git a/frontend/sige_ie/android/gradle.properties b/frontend/sige_ie/android/gradle.properties
deleted file mode 100644
index 598d13fe..00000000
--- a/frontend/sige_ie/android/gradle.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-org.gradle.jvmargs=-Xmx4G
-android.useAndroidX=true
-android.enableJetifier=true
diff --git a/frontend/sige_ie/android/gradle/wrapper/gradle-wrapper.properties b/frontend/sige_ie/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index e1ca574e..00000000
--- a/frontend/sige_ie/android/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
diff --git a/frontend/sige_ie/android/settings.gradle b/frontend/sige_ie/android/settings.gradle
deleted file mode 100644
index 985a6e2e..00000000
--- a/frontend/sige_ie/android/settings.gradle
+++ /dev/null
@@ -1,26 +0,0 @@
-pluginManagement {
- def flutterSdkPath = {
- def properties = new Properties()
- file("local.properties").withInputStream { properties.load(it) }
- def flutterSdkPath = properties.getProperty("flutter.sdk")
- assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
- return flutterSdkPath
- }
- settings.ext.flutterSdkPath = flutterSdkPath()
-
- includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
-
- repositories {
- google()
- mavenCentral()
- gradlePluginPortal()
- }
-}
-
-plugins {
- id "dev.flutter.flutter-plugin-loader" version "1.0.0"
- id "com.android.application" version "7.3.0" apply false
- id "org.jetbrains.kotlin.android" version "1.9.22" apply false
-}
-
-include ":app"
diff --git a/frontend/sige_ie/assets/Loading.mp4 b/frontend/sige_ie/assets/Loading.mp4
deleted file mode 100644
index e7cd9901..00000000
Binary files a/frontend/sige_ie/assets/Loading.mp4 and /dev/null differ
diff --git a/frontend/sige_ie/ios/.gitignore b/frontend/sige_ie/ios/.gitignore
deleted file mode 100644
index 7a7f9873..00000000
--- a/frontend/sige_ie/ios/.gitignore
+++ /dev/null
@@ -1,34 +0,0 @@
-**/dgph
-*.mode1v3
-*.mode2v3
-*.moved-aside
-*.pbxuser
-*.perspectivev3
-**/*sync/
-.sconsign.dblite
-.tags*
-**/.vagrant/
-**/DerivedData/
-Icon?
-**/Pods/
-**/.symlinks/
-profile
-xcuserdata
-**/.generated/
-Flutter/App.framework
-Flutter/Flutter.framework
-Flutter/Flutter.podspec
-Flutter/Generated.xcconfig
-Flutter/ephemeral/
-Flutter/app.flx
-Flutter/app.zip
-Flutter/flutter_assets/
-Flutter/flutter_export_environment.sh
-ServiceDefinitions.json
-Runner/GeneratedPluginRegistrant.*
-
-# Exceptions to above rules.
-!default.mode1v3
-!default.mode2v3
-!default.pbxuser
-!default.perspectivev3
diff --git a/frontend/sige_ie/ios/Flutter/AppFrameworkInfo.plist b/frontend/sige_ie/ios/Flutter/AppFrameworkInfo.plist
deleted file mode 100644
index 7c569640..00000000
--- a/frontend/sige_ie/ios/Flutter/AppFrameworkInfo.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- en
- CFBundleExecutable
- App
- CFBundleIdentifier
- io.flutter.flutter.app
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- App
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 1.0
- MinimumOSVersion
- 12.0
-
-
diff --git a/frontend/sige_ie/ios/Flutter/Debug.xcconfig b/frontend/sige_ie/ios/Flutter/Debug.xcconfig
deleted file mode 100644
index 592ceee8..00000000
--- a/frontend/sige_ie/ios/Flutter/Debug.xcconfig
+++ /dev/null
@@ -1 +0,0 @@
-#include "Generated.xcconfig"
diff --git a/frontend/sige_ie/ios/Flutter/Release.xcconfig b/frontend/sige_ie/ios/Flutter/Release.xcconfig
deleted file mode 100644
index 592ceee8..00000000
--- a/frontend/sige_ie/ios/Flutter/Release.xcconfig
+++ /dev/null
@@ -1 +0,0 @@
-#include "Generated.xcconfig"
diff --git a/frontend/sige_ie/ios/Runner.xcodeproj/project.pbxproj b/frontend/sige_ie/ios/Runner.xcodeproj/project.pbxproj
deleted file mode 100644
index c6591a32..00000000
--- a/frontend/sige_ie/ios/Runner.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,616 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 54;
- objects = {
-
-/* Begin PBXBuildFile section */
- 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
- 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
- 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
- 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
- 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
- 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
- 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 97C146E61CF9000F007C117D /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 97C146ED1CF9000F007C117D;
- remoteInfo = Runner;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "";
- dstSubfolderSpec = 10;
- files = (
- );
- name = "Embed Frameworks";
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
- 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
- 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; };
- 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
- 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
- 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
- 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
- 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
- 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
- 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
- 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
- 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
- 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
- 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 97C146EB1CF9000F007C117D /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 331C8082294A63A400263BE5 /* RunnerTests */ = {
- isa = PBXGroup;
- children = (
- 331C807B294A618700263BE5 /* RunnerTests.swift */,
- );
- path = RunnerTests;
- sourceTree = "";
- };
- 9740EEB11CF90186004384FC /* Flutter */ = {
- isa = PBXGroup;
- children = (
- 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
- 9740EEB21CF90195004384FC /* Debug.xcconfig */,
- 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
- 9740EEB31CF90195004384FC /* Generated.xcconfig */,
- );
- name = Flutter;
- sourceTree = "";
- };
- 97C146E51CF9000F007C117D = {
- isa = PBXGroup;
- children = (
- 9740EEB11CF90186004384FC /* Flutter */,
- 97C146F01CF9000F007C117D /* Runner */,
- 97C146EF1CF9000F007C117D /* Products */,
- 331C8082294A63A400263BE5 /* RunnerTests */,
- );
- sourceTree = "";
- };
- 97C146EF1CF9000F007C117D /* Products */ = {
- isa = PBXGroup;
- children = (
- 97C146EE1CF9000F007C117D /* Runner.app */,
- 331C8081294A63A400263BE5 /* RunnerTests.xctest */,
- );
- name = Products;
- sourceTree = "";
- };
- 97C146F01CF9000F007C117D /* Runner */ = {
- isa = PBXGroup;
- children = (
- 97C146FA1CF9000F007C117D /* Main.storyboard */,
- 97C146FD1CF9000F007C117D /* Assets.xcassets */,
- 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
- 97C147021CF9000F007C117D /* Info.plist */,
- 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
- 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
- 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
- 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
- );
- path = Runner;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 331C8080294A63A400263BE5 /* RunnerTests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
- buildPhases = (
- 331C807D294A63A400263BE5 /* Sources */,
- 331C807F294A63A400263BE5 /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- 331C8086294A63A400263BE5 /* PBXTargetDependency */,
- );
- name = RunnerTests;
- productName = RunnerTests;
- productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
- productType = "com.apple.product-type.bundle.unit-test";
- };
- 97C146ED1CF9000F007C117D /* Runner */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
- buildPhases = (
- 9740EEB61CF901F6004384FC /* Run Script */,
- 97C146EA1CF9000F007C117D /* Sources */,
- 97C146EB1CF9000F007C117D /* Frameworks */,
- 97C146EC1CF9000F007C117D /* Resources */,
- 9705A1C41CF9048500538489 /* Embed Frameworks */,
- 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = Runner;
- productName = Runner;
- productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 97C146E61CF9000F007C117D /* Project object */ = {
- isa = PBXProject;
- attributes = {
- BuildIndependentTargetsInParallel = YES;
- LastUpgradeCheck = 1510;
- ORGANIZATIONNAME = "";
- TargetAttributes = {
- 331C8080294A63A400263BE5 = {
- CreatedOnToolsVersion = 14.0;
- TestTargetID = 97C146ED1CF9000F007C117D;
- };
- 97C146ED1CF9000F007C117D = {
- CreatedOnToolsVersion = 7.3.1;
- LastSwiftMigration = 1100;
- };
- };
- };
- buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
- compatibilityVersion = "Xcode 9.3";
- developmentRegion = en;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 97C146E51CF9000F007C117D;
- productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 97C146ED1CF9000F007C117D /* Runner */,
- 331C8080294A63A400263BE5 /* RunnerTests */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 331C807F294A63A400263BE5 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 97C146EC1CF9000F007C117D /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
- 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
- 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
- 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
- isa = PBXShellScriptBuildPhase;
- alwaysOutOfDate = 1;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
- );
- name = "Thin Binary";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
- };
- 9740EEB61CF901F6004384FC /* Run Script */ = {
- isa = PBXShellScriptBuildPhase;
- alwaysOutOfDate = 1;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Run Script";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 331C807D294A63A400263BE5 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 97C146EA1CF9000F007C117D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
- 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 97C146ED1CF9000F007C117D /* Runner */;
- targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin PBXVariantGroup section */
- 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
- isa = PBXVariantGroup;
- children = (
- 97C146FB1CF9000F007C117D /* Base */,
- );
- name = Main.storyboard;
- sourceTree = "";
- };
- 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
- isa = PBXVariantGroup;
- children = (
- 97C147001CF9000F007C117D /* Base */,
- );
- name = LaunchScreen.storyboard;
- sourceTree = "";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- 249021D3217E4FDB00AE95B9 /* Profile */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
- MTL_ENABLE_DEBUG_INFO = NO;
- SDKROOT = iphoneos;
- SUPPORTED_PLATFORMS = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_PRODUCT = YES;
- };
- name = Profile;
- };
- 249021D4217E4FDB00AE95B9 /* Profile */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
- ENABLE_BITCODE = NO;
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- PRODUCT_BUNDLE_IDENTIFIER = com.example.sigeIe;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_VERSION = 5.0;
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Profile;
- };
- 331C8088294A63A400263BE5 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 1.0;
- PRODUCT_BUNDLE_IDENTIFIER = com.example.sigeIe.RunnerTests;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 5.0;
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
- };
- name = Debug;
- };
- 331C8089294A63A400263BE5 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 1.0;
- PRODUCT_BUNDLE_IDENTIFIER = com.example.sigeIe.RunnerTests;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_VERSION = 5.0;
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
- };
- name = Release;
- };
- 331C808A294A63A400263BE5 /* Profile */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 1.0;
- PRODUCT_BUNDLE_IDENTIFIER = com.example.sigeIe.RunnerTests;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_VERSION = 5.0;
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
- };
- name = Profile;
- };
- 97C147031CF9000F007C117D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = dwarf;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
- MTL_ENABLE_DEBUG_INFO = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- TARGETED_DEVICE_FAMILY = "1,2";
- };
- name = Debug;
- };
- 97C147041CF9000F007C117D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 12.0;
- MTL_ENABLE_DEBUG_INFO = NO;
- SDKROOT = iphoneos;
- SUPPORTED_PLATFORMS = iphoneos;
- SWIFT_COMPILATION_MODE = wholemodule;
- SWIFT_OPTIMIZATION_LEVEL = "-O";
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- 97C147061CF9000F007C117D /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
- ENABLE_BITCODE = NO;
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- PRODUCT_BUNDLE_IDENTIFIER = com.example.sigeIe;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 5.0;
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Debug;
- };
- 97C147071CF9000F007C117D /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
- ENABLE_BITCODE = NO;
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/Frameworks",
- );
- PRODUCT_BUNDLE_IDENTIFIER = com.example.sigeIe;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_VERSION = 5.0;
- VERSIONING_SYSTEM = "apple-generic";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 331C8088294A63A400263BE5 /* Debug */,
- 331C8089294A63A400263BE5 /* Release */,
- 331C808A294A63A400263BE5 /* Profile */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 97C147031CF9000F007C117D /* Debug */,
- 97C147041CF9000F007C117D /* Release */,
- 249021D3217E4FDB00AE95B9 /* Profile */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 97C147061CF9000F007C117D /* Debug */,
- 97C147071CF9000F007C117D /* Release */,
- 249021D4217E4FDB00AE95B9 /* Profile */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 97C146E61CF9000F007C117D /* Project object */;
-}
diff --git a/frontend/sige_ie/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/frontend/sige_ie/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 919434a6..00000000
--- a/frontend/sige_ie/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/frontend/sige_ie/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/frontend/sige_ie/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d98100..00000000
--- a/frontend/sige_ie/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/frontend/sige_ie/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/frontend/sige_ie/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
deleted file mode 100644
index f9b0d7c5..00000000
--- a/frontend/sige_ie/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- PreviewsEnabled
-
-
-
diff --git a/frontend/sige_ie/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/frontend/sige_ie/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
deleted file mode 100644
index 8e3ca5df..00000000
--- a/frontend/sige_ie/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/sige_ie/ios/Runner.xcworkspace/contents.xcworkspacedata b/frontend/sige_ie/ios/Runner.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 1d526a16..00000000
--- a/frontend/sige_ie/ios/Runner.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
diff --git a/frontend/sige_ie/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/frontend/sige_ie/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d98100..00000000
--- a/frontend/sige_ie/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/frontend/sige_ie/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/frontend/sige_ie/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
deleted file mode 100644
index f9b0d7c5..00000000
--- a/frontend/sige_ie/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- PreviewsEnabled
-
-
-
diff --git a/frontend/sige_ie/ios/Runner/AppDelegate.swift b/frontend/sige_ie/ios/Runner/AppDelegate.swift
deleted file mode 100644
index 70693e4a..00000000
--- a/frontend/sige_ie/ios/Runner/AppDelegate.swift
+++ /dev/null
@@ -1,13 +0,0 @@
-import UIKit
-import Flutter
-
-@UIApplicationMain
-@objc class AppDelegate: FlutterAppDelegate {
- override func application(
- _ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
- ) -> Bool {
- GeneratedPluginRegistrant.register(with: self)
- return super.application(application, didFinishLaunchingWithOptions: launchOptions)
- }
-}
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index d36b1fab..00000000
--- a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,122 +0,0 @@
-{
- "images" : [
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "Icon-App-20x20@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "Icon-App-20x20@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-App-29x29@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-App-29x29@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-App-29x29@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "Icon-App-40x40@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "Icon-App-40x40@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "Icon-App-60x60@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "Icon-App-60x60@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "Icon-App-20x20@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "Icon-App-20x20@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "Icon-App-29x29@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "Icon-App-29x29@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "Icon-App-40x40@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "Icon-App-40x40@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "Icon-App-76x76@1x.png",
- "scale" : "1x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "Icon-App-76x76@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "83.5x83.5",
- "idiom" : "ipad",
- "filename" : "Icon-App-83.5x83.5@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "1024x1024",
- "idiom" : "ios-marketing",
- "filename" : "Icon-App-1024x1024@1x.png",
- "scale" : "1x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
deleted file mode 100644
index dc9ada47..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
deleted file mode 100644
index 7353c41e..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
deleted file mode 100644
index 797d452e..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
deleted file mode 100644
index 6ed2d933..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
deleted file mode 100644
index 4cd7b009..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
deleted file mode 100644
index fe730945..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
deleted file mode 100644
index 321773cd..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
deleted file mode 100644
index 797d452e..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
deleted file mode 100644
index 502f463a..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
deleted file mode 100644
index 0ec30343..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
deleted file mode 100644
index 0ec30343..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
deleted file mode 100644
index e9f5fea2..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
deleted file mode 100644
index 84ac32ae..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
deleted file mode 100644
index 8953cba0..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
deleted file mode 100644
index 0467bf12..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
deleted file mode 100644
index 0bedcf2f..00000000
--- a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "images" : [
- {
- "idiom" : "universal",
- "filename" : "LaunchImage.png",
- "scale" : "1x"
- },
- {
- "idiom" : "universal",
- "filename" : "LaunchImage@2x.png",
- "scale" : "2x"
- },
- {
- "idiom" : "universal",
- "filename" : "LaunchImage@3x.png",
- "scale" : "3x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
deleted file mode 100644
index 9da19eac..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
deleted file mode 100644
index 9da19eac..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
deleted file mode 100644
index 9da19eac..00000000
Binary files a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ
diff --git a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
deleted file mode 100644
index 89c2725b..00000000
--- a/frontend/sige_ie/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Launch Screen Assets
-
-You can customize the launch screen with your own desired assets by replacing the image files in this directory.
-
-You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
diff --git a/frontend/sige_ie/ios/Runner/Base.lproj/LaunchScreen.storyboard b/frontend/sige_ie/ios/Runner/Base.lproj/LaunchScreen.storyboard
deleted file mode 100644
index f2e259c7..00000000
--- a/frontend/sige_ie/ios/Runner/Base.lproj/LaunchScreen.storyboard
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/sige_ie/ios/Runner/Base.lproj/Main.storyboard b/frontend/sige_ie/ios/Runner/Base.lproj/Main.storyboard
deleted file mode 100644
index f3c28516..00000000
--- a/frontend/sige_ie/ios/Runner/Base.lproj/Main.storyboard
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/sige_ie/ios/Runner/Info.plist b/frontend/sige_ie/ios/Runner/Info.plist
deleted file mode 100644
index 829c7ead..00000000
--- a/frontend/sige_ie/ios/Runner/Info.plist
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- $(DEVELOPMENT_LANGUAGE)
- CFBundleDisplayName
- Sige Ie
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- sige_ie
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- $(FLUTTER_BUILD_NAME)
- CFBundleSignature
- ????
- CFBundleVersion
- $(FLUTTER_BUILD_NUMBER)
- LSRequiresIPhoneOS
-
- UILaunchStoryboardName
- LaunchScreen
- UIMainStoryboardFile
- Main
- UISupportedInterfaceOrientations
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- UISupportedInterfaceOrientations~ipad
-
- UIInterfaceOrientationPortrait
- UIInterfaceOrientationPortraitUpsideDown
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
-
- CADisableMinimumFrameDurationOnPhone
-
- UIApplicationSupportsIndirectInputEvents
-
- NSLocationWhenInUseUsageDescription
- Este aplicativo precisa de acesso à sua localização para funcionar corretamente.
- NSLocationAlwaysUsageDescription
- Este aplicativo precisa de acesso constante à sua localização para oferecer os melhores serviços.
-
-
diff --git a/frontend/sige_ie/ios/Runner/Runner-Bridging-Header.h b/frontend/sige_ie/ios/Runner/Runner-Bridging-Header.h
deleted file mode 100644
index 308a2a56..00000000
--- a/frontend/sige_ie/ios/Runner/Runner-Bridging-Header.h
+++ /dev/null
@@ -1 +0,0 @@
-#import "GeneratedPluginRegistrant.h"
diff --git a/frontend/sige_ie/ios/RunnerTests/RunnerTests.swift b/frontend/sige_ie/ios/RunnerTests/RunnerTests.swift
deleted file mode 100644
index 86a7c3b1..00000000
--- a/frontend/sige_ie/ios/RunnerTests/RunnerTests.swift
+++ /dev/null
@@ -1,12 +0,0 @@
-import Flutter
-import UIKit
-import XCTest
-
-class RunnerTests: XCTestCase {
-
- func testExample() {
- // If you add code to the Runner application, consider adding tests here.
- // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
- }
-
-}
diff --git a/frontend/sige_ie/lib/Teams/teams.dart b/frontend/sige_ie/lib/Teams/teams.dart
deleted file mode 100644
index 8ccf8cdd..00000000
--- a/frontend/sige_ie/lib/Teams/teams.dart
+++ /dev/null
@@ -1,225 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:sige_ie/config/app_styles.dart';
-
-class TeamsPage extends StatefulWidget {
- const TeamsPage({super.key});
-
- @override
- _TeamsPageState createState() => _TeamsPageState();
-}
-
-class _TeamsPageState extends State {
- final List teams = [
- Team('Equipe 1', ['Membro 1', 'Membro 2', 'Membro 3']),
- Team('Equipe 2', ['Membro 4', 'Membro 5']),
- Team('Equipe 3', ['Membro 6', 'Membro 7', 'Membro 8']),
- ];
-
- void _addTeam(String teamName) {
- setState(() {
- teams.add(Team(teamName, []));
- });
- }
-
- void _removeTeam(int index) {
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Confirmar Exclusão'),
- content: const Text('Você realmente deseja excluir esta equipe?'),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Excluir'),
- onPressed: () {
- setState(() {
- teams.removeAt(index);
- });
- Navigator.of(context).pop();
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Equipe excluída com sucesso!'),
- backgroundColor: Colors.green,
- ),
- );
- },
- ),
- ],
- );
- },
- );
- }
-
- void _switchTeam(String teamName) {
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Confirmar Troca de Equipe'),
- content:
- Text('Você realmente deseja trocar para a equipe "$teamName"?'),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Trocar'),
- onPressed: () {
- Navigator.of(context).pop();
- ScaffoldMessenger.of(context).showSnackBar(
- SnackBar(
- content: Text(
- 'Troca concluída. Você agora está na equipe "$teamName".'),
- backgroundColor: Colors.green,
- ),
- );
- },
- ),
- ],
- );
- },
- );
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: AppColors.sigeIeBlue,
- foregroundColor: Colors.white,
- automaticallyImplyLeading: false,
- ),
- body: SingleChildScrollView(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- padding: const EdgeInsets.fromLTRB(10, 10, 10, 20),
- decoration: const BoxDecoration(
- color: AppColors.sigeIeBlue,
- borderRadius:
- BorderRadius.vertical(bottom: Radius.circular(20)),
- ),
- child: const Center(
- child: Column(
- children: [
- Text(
- 'Equipes',
- style: TextStyle(
- fontSize: 26,
- fontWeight: FontWeight.bold,
- color: Colors.white,
- ),
- ),
- ],
- ),
- ),
- ),
- const SizedBox(height: 20),
- Padding(
- padding: const EdgeInsets.all(16.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- ListView.builder(
- shrinkWrap: true,
- physics: const NeverScrollableScrollPhysics(),
- itemCount: teams.length,
- itemBuilder: (context, index) {
- final team = teams[index];
- return Card(
- child: ListTile(
- leading: const Icon(Icons.group,
- color: AppColors.sigeIeBlue),
- title: Text(team.name),
- subtitle: Text('Membros: ${team.members.length}'),
- trailing: IconButton(
- icon:
- const Icon(Icons.delete, color: AppColors.warn),
- onPressed: () {
- _removeTeam(index);
- },
- ),
- onTap: () {
- _switchTeam(team.name);
- },
- ),
- );
- },
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- floatingActionButton: FloatingActionButton(
- onPressed: () {
- showDialog(
- context: context,
- builder: (context) {
- final TextEditingController _controller = TextEditingController();
- return AlertDialog(
- title: const Text('Adicionar nova equipe'),
- content: TextField(
- controller: _controller,
- decoration: const InputDecoration(
- hintText: 'Digite o código da equipe',
- ),
- ),
- actions: [
- TextButton(
- onPressed: () {
- Navigator.of(context).pop();
- },
- child: const Text('Cancelar'),
- ),
- TextButton(
- onPressed: () {
- if (_controller.text.isNotEmpty) {
- _addTeam(_controller.text);
- Navigator.of(context).pop();
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Equipe adicionada com sucesso!'),
- backgroundColor: Colors.green,
- ),
- );
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Nome da equipe não pode ser vazio!'),
- backgroundColor: Colors.red,
- ),
- );
- }
- },
- child: const Text('Adicionar'),
- ),
- ],
- );
- },
- );
- },
- backgroundColor: AppColors.sigeIeYellow,
- child: const Icon(Icons.add, color: AppColors.sigeIeBlue),
- ),
- );
- }
-}
-
-class Team {
- final String name;
- final List members;
-
- Team(this.name, this.members);
-}
diff --git a/frontend/sige_ie/lib/areas/data/area_request_model.dart b/frontend/sige_ie/lib/areas/data/area_request_model.dart
deleted file mode 100644
index 2cd56094..00000000
--- a/frontend/sige_ie/lib/areas/data/area_request_model.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class AreaRequestModel {
- String name;
- int? floor;
- int? place;
-
- AreaRequestModel({required this.name, this.floor, this.place});
-
- Map toJson() {
- return {
- 'name': name,
- 'floor': floor,
- 'place': place,
- };
- }
-
- factory AreaRequestModel.fromJson(Map json) {
- return AreaRequestModel(
- name: json['name'],
- floor: json['floor'],
- place: json['place'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/areas/data/area_response_model.dart b/frontend/sige_ie/lib/areas/data/area_response_model.dart
deleted file mode 100644
index 28adcb04..00000000
--- a/frontend/sige_ie/lib/areas/data/area_response_model.dart
+++ /dev/null
@@ -1,31 +0,0 @@
-class AreaResponseModel {
- int id;
- String name;
- int? floor;
- int place;
-
- AreaResponseModel({
- required this.id,
- required this.name,
- this.floor,
- required this.place,
- });
-
- factory AreaResponseModel.fromJson(Map json) {
- return AreaResponseModel(
- id: json['id'],
- name: json['name'],
- floor: json['floor'],
- place: json['place'],
- );
- }
-
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- 'floor': floor,
- 'place': place,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/areas/data/area_service.dart b/frontend/sige_ie/lib/areas/data/area_service.dart
deleted file mode 100644
index 157117dc..00000000
--- a/frontend/sige_ie/lib/areas/data/area_service.dart
+++ /dev/null
@@ -1,101 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart';
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/areas/data/area_response_model.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-import 'package:sige_ie/areas/data/area_request_model.dart';
-
-class AreaService {
- final Logger _logger = Logger('AreaService');
- Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- final String baseUrl = 'http://10.0.2.2:8000/api/areas/';
-
- // POST
-// POST
- Future createArea(
- AreaRequestModel areaRequestModel) async {
- var url = Uri.parse(baseUrl);
- print('URL: $url'); // Log da URL
- print(
- 'Request Body: ${jsonEncode(areaRequestModel.toJson())}'); // Log do corpo da requisição
-
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(areaRequestModel.toJson()),
- );
-
- print(
- 'Response Status Code: ${response.statusCode}'); // Log do status da resposta
- print('Response Body: ${response.body}'); // Log do corpo da resposta
-
- if (response.statusCode == 201) {
- var data = jsonDecode(response.body);
- print('Response Data: $data'); // Log dos dados da resposta
- return AreaResponseModel.fromJson(data);
- } else {
- print(
- 'Failed to create area. Status Code: ${response.statusCode}'); // Log do erro com status code
- throw Exception('Failed to create area');
- }
- }
-
- // Fetch all areas for a specific place
- Future> fetchAreasByPlaceId(int placeId) async {
- var url = Uri.parse('http://10.0.2.2:8000/api/places/$placeId/areas/');
- var response = await client.get(url);
-
- if (response.statusCode == 200) {
- List dataList = jsonDecode(response.body);
- return dataList.map((data) => AreaResponseModel.fromJson(data)).toList();
- } else {
- throw Exception('Failed to load areas for place $placeId');
- }
- }
-
- // GET
- Future fetchArea(int areaId) async {
- var url = Uri.parse('$baseUrl$areaId/');
- var response = await client.get(url);
-
- if (response.statusCode == 200) {
- var data = jsonDecode(response.body);
- return AreaResponseModel.fromJson(data);
- } else {
- throw Exception('Failed to load area with ID $areaId');
- }
- }
-
- // PUT
- Future updateArea(int areaId, AreaRequestModel areaRequestModel) async {
- var url = Uri.parse('$baseUrl$areaId/');
-
- _logger.info('Sending PUT request to $url');
- _logger.info('Request body: ${jsonEncode(areaRequestModel.toJson())}');
-
- var response = await client.put(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(areaRequestModel.toJson()),
- );
-
- _logger.info('Response status: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- return response.statusCode == 200;
- }
-
- // DELETE
- Future deleteArea(int areaId) async {
- var url = Uri.parse('$baseUrl$areaId/');
-
- var response = await client.delete(url);
-
- return response.statusCode == 204;
- }
-}
diff --git a/frontend/sige_ie/lib/areas/feature/register/new_area.dart b/frontend/sige_ie/lib/areas/feature/register/new_area.dart
deleted file mode 100644
index 9a2d4eee..00000000
--- a/frontend/sige_ie/lib/areas/feature/register/new_area.dart
+++ /dev/null
@@ -1,304 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:sige_ie/areas/data/area_response_model.dart';
-import 'package:sige_ie/config/app_styles.dart';
-import 'package:sige_ie/areas/data/area_request_model.dart';
-import 'package:sige_ie/areas/data/area_service.dart';
-
-class AreaLocation extends StatefulWidget {
- final String localName;
- final int localId;
-
- const AreaLocation(
- {super.key, required this.localName, required this.localId});
- @override
- _AreaLocationState createState() => _AreaLocationState();
-}
-
-class _AreaLocationState extends State {
- int? selectedFloor;
- final TextEditingController areaController = TextEditingController();
- final TextEditingController floorController = TextEditingController();
-
- @override
- void initState() {
- super.initState();
- floorController.text = selectedFloor?.toString() ?? '';
- }
-
- @override
- void dispose() {
- areaController.dispose();
- floorController.dispose();
- super.dispose();
- }
-
- void logState() {
- print('selectedFloor: $selectedFloor');
- print('areaController.text: ${areaController.text}');
- print('floorController.text: ${floorController.text}');
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: AppColors.sigeIeBlue,
- automaticallyImplyLeading: false,
- ),
- body: SingleChildScrollView(
- child: Column(
- children: [
- Container(
- width: double.infinity,
- padding: const EdgeInsets.fromLTRB(10, 10, 10, 35),
- decoration: const BoxDecoration(
- color: AppColors.sigeIeBlue,
- borderRadius:
- BorderRadius.vertical(bottom: Radius.circular(20)),
- ),
- child: Center(
- child: Text('${widget.localName} - Área',
- style: const TextStyle(
- fontSize: 26,
- fontWeight: FontWeight.bold,
- color: Colors.white)),
- ),
- ),
- const SizedBox(height: 60),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- children: [
- const Text('Andar',
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.bold,
- color: Colors.black)),
- IconButton(
- icon: const Icon(Icons.info_outline),
- onPressed: () {
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title:
- const Text('Informação sobre os Andares'),
- content: const Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('0 = Térreo',
- style: TextStyle(fontSize: 16)),
- Text('1 = 1° Andar',
- style: TextStyle(fontSize: 16)),
- Text('2 = 2° Andar',
- style: TextStyle(fontSize: 16)),
- ],
- ),
- actions: [
- TextButton(
- child: const Text('OK'),
- onPressed: () =>
- Navigator.of(context).pop(),
- ),
- ],
- );
- },
- );
- },
- ),
- ],
- ),
- const SizedBox(height: 10),
- Container(
- padding: const EdgeInsets.symmetric(horizontal: 10),
- decoration: BoxDecoration(
- color: Colors.grey[300],
- borderRadius: BorderRadius.circular(10),
- ),
- child: TextFormField(
- controller: floorController,
- keyboardType: TextInputType.number,
- decoration: const InputDecoration(
- border: InputBorder.none,
- ),
- onChanged: (value) {
- setState(() {
- selectedFloor = int.tryParse(value);
- });
- logState(); // Log the state after changing the value
- },
- ),
- ),
- const SizedBox(height: 40),
- const Text('Área',
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.bold,
- color: Colors.black)),
- const SizedBox(height: 10),
- Container(
- decoration: BoxDecoration(
- color: Colors.grey[300],
- borderRadius: BorderRadius.circular(10)),
- child: TextField(
- controller: areaController,
- decoration: const InputDecoration(
- hintText: 'Digite o nome da Sala',
- border: InputBorder.none,
- contentPadding: EdgeInsets.symmetric(horizontal: 10),
- ),
- onChanged: (value) {
- logState(); // Log the state after changing the value
- },
- ),
- ),
- const SizedBox(height: 60),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: [
- ElevatedButton(
- style: ElevatedButton.styleFrom(
- foregroundColor: AppColors.lightText,
- backgroundColor: AppColors.warn,
- minimumSize: const Size(150, 50),
- textStyle: const TextStyle(
- fontWeight: FontWeight.bold,
- ),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(8),
- ),
- ),
- onPressed: () {
- Navigator.of(context)
- .popUntil((route) => route.isFirst);
- Navigator.pushReplacementNamed(
- context,
- '/homeScreen',
- arguments: {'initialPage': 1},
- );
- },
- child: const Text('ENCERRAR'),
- ),
- ElevatedButton(
- style: ElevatedButton.styleFrom(
- foregroundColor: AppColors.lightText,
- backgroundColor: AppColors.sigeIeBlue,
- minimumSize: const Size(150, 50),
- textStyle: const TextStyle(
- fontWeight: FontWeight.bold,
- ),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(8),
- ),
- ),
- onPressed: () async {
- logState(); // Log the state before making the API call
- if (selectedFloor != null &&
- areaController.text.isNotEmpty) {
- AreaService areaService = AreaService();
- try {
- AreaResponseModel newArea =
- await areaService.createArea(AreaRequestModel(
- name: areaController.text,
- floor: selectedFloor,
- place: widget.localId,
- ));
- print(
- 'Sala Registrada: ${newArea.name} no ${newArea.floor}° andar');
- Navigator.pushNamed(context, '/systemLocation',
- arguments: {
- 'areaName': newArea.name,
- 'localName': widget.localName,
- 'localId': widget.localId,
- 'areaId': newArea.id,
- });
- } catch (e) {
- print('Erro ao criar sala: $e'); // Log the error
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Erro'),
- content: Text("Falha ao criar sala: $e"),
- actions: [
- TextButton(
- child: const Text("OK"),
- onPressed: () =>
- Navigator.of(context).pop(),
- ),
- ],
- );
- },
- );
- }
- } else {
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Erro'),
- content: const Text(
- "Por favor, selecione um andar e digite o nome da sala"),
- actions: [
- TextButton(
- child: const Text("OK"),
- onPressed: () =>
- Navigator.of(context).pop(),
- ),
- ],
- );
- },
- );
- }
- },
- child: const Text('CONTINUAR'),
- ),
- ],
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- );
- }
-}
-
-Widget _buildDropdown({
- required List items,
- required String? value,
- required void Function(String?) onChanged,
-}) {
- return Container(
- padding: const EdgeInsets.symmetric(horizontal: 10),
- decoration: BoxDecoration(
- color: Colors.grey[300],
- borderRadius: BorderRadius.circular(10),
- ),
- child: DropdownButtonHideUnderline(
- child: DropdownButtonFormField(
- decoration: const InputDecoration(
- border: InputBorder.none,
- contentPadding: EdgeInsets.symmetric(vertical: 4),
- ),
- value: value,
- isExpanded: true,
- items: items.map((String item) {
- return DropdownMenuItem(
- value: item,
- child: Text(item),
- );
- }).toList(),
- onChanged: onChanged,
- style: const TextStyle(color: Colors.black),
- dropdownColor: Colors.grey[200],
- ),
- ),
- );
-}
-
diff --git a/frontend/sige_ie/lib/config/app_styles.dart b/frontend/sige_ie/lib/config/app_styles.dart
deleted file mode 100644
index beda3627..00000000
--- a/frontend/sige_ie/lib/config/app_styles.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-import 'package:flutter/material.dart';
-
-class AppColors {
- static const Color sigeIeYellow = Color(0xFFF1F60E);
- static const Color sigeIeBlue = Color(0xff123c75);
- static const Color dartText = Color.fromRGBO(22, 22, 22, 1);
- static const Color lightText = Color.fromARGB(255, 238, 233, 233);
- static const Color warn = Color.fromARGB(255, 231, 27, 27);
- static const Color accent = Color.fromARGB(255, 231, 85, 27);
-}
-
-class AppButtonStyles {
- static ButtonStyle warnButton = ElevatedButton.styleFrom(
- backgroundColor: const Color.fromARGB(255, 231, 27, 27),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(8),
- ),
- );
- static ButtonStyle accentButton = ElevatedButton.styleFrom(
- backgroundColor: const Color.fromARGB(255, 231, 160, 27),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(8),
- ),
- );
- static ButtonStyle standardButton = ElevatedButton.styleFrom(
- backgroundColor: AppColors.sigeIeYellow,
- foregroundColor: AppColors.sigeIeBlue,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(8),
- ),
- );
-}
diff --git a/frontend/sige_ie/lib/core/data/auth_interceptor.dart b/frontend/sige_ie/lib/core/data/auth_interceptor.dart
deleted file mode 100644
index 2a752367..00000000
--- a/frontend/sige_ie/lib/core/data/auth_interceptor.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-import 'package:cookie_jar/cookie_jar.dart';
-import 'package:http_interceptor/http_interceptor.dart';
-
-class AuthInterceptor implements InterceptorContract {
- CookieJar cookieJar;
-
- AuthInterceptor(this.cookieJar);
-
- @override
- Future interceptRequest({required RequestData data}) async {
- var cookies = await cookieJar
- .loadForRequest(Uri.parse('http://10.0.2.2:8000/api/login/'));
- Cookie? sessionCookie;
- for (var cookie in cookies) {
- if (cookie.name == 'sessionid') {
- sessionCookie = cookie;
- break;
- }
- }
- data.headers
- .addAll({'Cookie': '${sessionCookie!.name}=${sessionCookie.value}'});
- return data;
- }
-
- @override
- Future interceptResponse({required ResponseData data}) async {
- return data;
- }
-}
diff --git a/frontend/sige_ie/lib/core/data/auth_service.dart b/frontend/sige_ie/lib/core/data/auth_service.dart
deleted file mode 100644
index b645f393..00000000
--- a/frontend/sige_ie/lib/core/data/auth_service.dart
+++ /dev/null
@@ -1,129 +0,0 @@
-import 'dart:convert';
-import 'package:cookie_jar/cookie_jar.dart';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-
-class AuthService {
- static Future fetchCsrfToken() async {
- const String url = 'http://10.0.2.2:8000/api/csrfcookie/';
- final response = await http.get(Uri.parse(url));
-
- if (response.statusCode == 200) {
- String cookie = response.headers['set-cookie']!;
- String csrfToken = cookie.split(';')[0].substring('csrftoken='.length);
-
- final csrfCookie = Cookie('csrftoken', csrfToken);
- cookieJar.saveFromResponse(
- Uri.parse('http://10.0.2.2:8000/api/csrftoken/'), [csrfCookie]);
-
- return csrfToken;
- } else {
- throw Exception('Falha ao obter o token CSRF: ${response.statusCode}');
- }
- }
-
- static Future fetchSessionCookie() async {
- const url = 'http://10.0.2.2:8000/api/sessioncookie/';
- final response = await http.get(Uri.parse(url));
-
- if (response.statusCode == 200) {
- final cookies = response.headers['set-cookie']?.split(',');
-
- String? sessionid;
- if (cookies != null) {
- for (var cookie in cookies) {
- if (cookie.contains('sessionid')) {
- sessionid = cookie.split(';')[0].split('=')[1];
- break;
- }
- }
- }
- return sessionid!;
- } else {
- throw Exception('Failed to fetch session cookie: ${response.statusCode}');
- }
- }
-
- Future checkAuthenticated() async {
- var client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- final response =
- await client.get(Uri.parse('http://10.0.2.2:8000/api/checkauth/'));
-
- if (response.statusCode == 200) {
- var data = jsonDecode(response.body);
- return data['isAuthenticated'];
- } else {
- throw Exception('Failed to check authentication');
- }
- }
-
- Future login(String username, String password) async {
- //var csrfToken = await fetchCsrfToken();
- //print(csrfToken);
-
- var url = Uri.parse('http://10.0.2.2:8000/api/login/');
-
- try {
- var response = await http.post(url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode({
- 'username': username,
- 'password': password,
- }));
- final cookies = response.headers['set-cookie']?.split(',');
-
- String? sessionid;
- if (cookies != null) {
- for (var cookie in cookies) {
- if (cookie.contains('sessionid')) {
- sessionid = cookie.split(';')[0].split('=')[1];
- break;
- }
- }
- }
-
- final cookie = Cookie('sessionid', sessionid!);
- cookieJar.saveFromResponse(
- Uri.parse('http://10.0.2.2:8000/api/login/'), [cookie]);
-
- if (response.statusCode == 200) {
- //print("Login bem-sucedido: $data");
- return true;
- } else {
- //print("Falha no login: ${response.body}");
- return false;
- }
- } catch (e) {
- //print("Erro ao tentar fazer login: $e");
- return false;
- }
- }
-
- Future logout() async {
- //final cookies = await cookieJar.loadForRequest(Uri.parse('http://10.0.2.2:8000/api/csrftoken/'));
-
- var url = Uri.parse('http://10.0.2.2:8000/api/logout/');
-
- try {
- var client =
- InterceptedClient.build(interceptors: [AuthInterceptor(cookieJar)]);
- var response =
- await client.post(url, headers: {'Content-Type': 'application/json'});
- cookieJar.deleteAll();
- if (response.statusCode == 200) {
- //print("Logout bem-sucedido");
- } else {
- //print("Falha no logout: ${response.body}");
- //bool isAuth = await checkAuthenticated();
- //print(isAuth);
- }
- } catch (e) {
- //print("Erro ao tentar fazer logout: $e");
- }
- }
-}
diff --git a/frontend/sige_ie/lib/core/feature/login/login.dart b/frontend/sige_ie/lib/core/feature/login/login.dart
deleted file mode 100644
index eb260119..00000000
--- a/frontend/sige_ie/lib/core/feature/login/login.dart
+++ /dev/null
@@ -1,268 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:sige_ie/core/data/auth_service.dart';
-
-class LoginScreen extends StatefulWidget {
- const LoginScreen({super.key});
- @override
- State createState() => _LoginScreenState();
-}
-
-class _LoginScreenState extends State {
- AuthService authService = AuthService();
- bool rememberMe = false;
- final _loginScreen = GlobalKey();
- final TextEditingController usernameController = TextEditingController();
- final TextEditingController passwordController = TextEditingController();
- bool isLoading = false;
-
- @override
- void dispose() {
- usernameController.dispose();
- passwordController.dispose();
- super.dispose();
- }
-
- Future _login() async {
- if (!_loginScreen.currentState!.validate()) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(content: Text('Por favor, preencha todos os campos')),
- );
- return;
- }
-
- setState(() {
- isLoading = true;
- });
-
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(content: Text('Processando dados')),
- );
-
- bool success = await authService.login(
- usernameController.text,
- passwordController.text,
- );
-
- ScaffoldMessenger.of(context).hideCurrentSnackBar();
-
- setState(() {
- isLoading = false;
- });
-
- if (success) {
- if (!mounted) return;
- Navigator.of(context).pushReplacementNamed('/homeScreen');
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Login falhou, verifique suas credenciais')),
- );
- }
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: const Color(0xff123c75),
- appBar: AppBar(
- automaticallyImplyLeading: false,
- iconTheme: const IconThemeData(color: Colors.white),
- backgroundColor: const Color(0xff123c75),
- ),
- body: Center(
- child: Column(
- children: [
- Expanded(
- flex: 2,
- child: Container(
- decoration: const BoxDecoration(
- image: DecorationImage(
- image: AssetImage('assets/1000x1000.png'),
- fit: BoxFit.cover,
- ),
- ),
- ),
- ),
- Expanded(
- flex: 6,
- child: Container(
- padding: const EdgeInsets.fromLTRB(25.0, 50.0, 25.0, 20.0),
- decoration: const BoxDecoration(
- color: Colors.white,
- borderRadius:
- BorderRadius.only(topLeft: Radius.circular(50.0)),
- ),
- child: SingleChildScrollView(
- child: Form(
- key: _loginScreen,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- const Text(
- 'Login',
- style: TextStyle(
- fontSize: 30.0,
- fontWeight: FontWeight.w900,
- color: Colors.black,
- ),
- ),
- const SizedBox(height: 35),
- TextFormField(
- controller: usernameController,
- validator: (value) {
- if (value == null || value.isEmpty) {
- return 'Por favor, insira um username válido';
- }
- return null;
- },
- decoration: InputDecoration(
- label: const Text('Username'),
- labelStyle: const TextStyle(color: Colors.black),
- hintText: 'Insira o seu username',
- hintStyle: const TextStyle(
- color: Colors.black,
- ),
- border: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 39, 38, 38),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- enabledBorder: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- ),
- ),
- const SizedBox(height: 20),
- TextFormField(
- controller: passwordController,
- obscureText: true,
- obscuringCharacter: '*',
- validator: (value) {
- if (value == null || value.isEmpty) {
- return 'Por favor, insira uma senha válida';
- }
- return null;
- },
- decoration: InputDecoration(
- label: const Text('Senha'),
- labelStyle: const TextStyle(color: Colors.black),
- hintText: 'Insira a senha',
- hintStyle: const TextStyle(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- border: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(31, 255, 3, 3),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- enabledBorder: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- ),
- ),
- const SizedBox(height: 20),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Row(
- children: [
- Checkbox(
- value: rememberMe,
- onChanged: (bool? value) {
- setState(() {
- rememberMe = value!;
- });
- },
- activeColor:
- const Color.fromARGB(255, 12, 78, 170),
- ),
- const Text(
- 'Manter conectado',
- style: TextStyle(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- ),
- ],
- ),
- GestureDetector(
- child: const Text(
- 'Esqueceu a senha?',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- color: Color(0xff123c75),
- ),
- ),
- ),
- ],
- ),
- const SizedBox(height: 20),
- SizedBox(
- width: 200,
- height: 50,
- child: ElevatedButton(
- onPressed: isLoading ? null : _login,
- style: ElevatedButton.styleFrom(
- elevation: 6,
- backgroundColor:
- const Color.fromARGB(255, 244, 248, 0),
- foregroundColor: const Color(0xff123c75),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12),
- ),
- ),
- child: isLoading
- ? const CircularProgressIndicator(
- valueColor: AlwaysStoppedAnimation(
- Color(0xff123c75)),
- )
- : const Text(
- 'Login',
- style: TextStyle(
- fontSize: 20,
- fontWeight: FontWeight.bold),
- ),
- ),
- ),
- const SizedBox(height: 30),
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- const Text(
- 'Não tem uma conta? ',
- style: TextStyle(
- color: Color.fromARGB(255, 0, 0, 0)),
- ),
- GestureDetector(
- onTap: () {
- Navigator.pushNamed(context, '/registerScreen');
- },
- child: const Text(
- 'Registre-se',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- color: Color(0xff123c75),
- ),
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/frontend/sige_ie/lib/core/feature/register/register.dart b/frontend/sige_ie/lib/core/feature/register/register.dart
deleted file mode 100644
index 34da9010..00000000
--- a/frontend/sige_ie/lib/core/feature/register/register.dart
+++ /dev/null
@@ -1,355 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:sige_ie/users/data/user_request_model.dart';
-import 'package:sige_ie/users/data/user_service.dart';
-
-class RegisterScreen extends StatefulWidget {
- const RegisterScreen({super.key});
- @override
- State createState() => _RegisterScreenState();
-}
-
-class _RegisterScreenState extends State {
- UserService userService = UserService();
- bool terms = true;
- bool isLoading = false;
- final _registerScreen = GlobalKey();
- final usernameController = TextEditingController();
- final nameController = TextEditingController();
- final passwordController = TextEditingController();
- final emailController = TextEditingController();
-
- Future _register() async {
- if (!_registerScreen.currentState!.validate()) {
- return;
- }
-
- if (!terms) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content:
- Text('Por Favor, concorde com o processamento de dados pessoais'),
- ),
- );
- return;
- }
-
- setState(() {
- isLoading = true;
- });
-
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(content: Text('Processando Dados')),
- );
-
- final user = UserRequestModel(
- username: usernameController.text,
- firstname: nameController.text,
- password: passwordController.text,
- email: emailController.text,
- );
-
- bool success = await userService.register(user);
- ScaffoldMessenger.of(context).hideCurrentSnackBar();
-
- setState(() {
- isLoading = false;
- });
-
- if (success) {
- FocusScope.of(context).unfocus();
- Navigator.of(context).pushReplacementNamed('/loginScreen');
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Registro falhou, por favor tente novamente.'),
- ),
- );
- }
- }
-
- @override
- void dispose() {
- usernameController.dispose();
- nameController.dispose();
- passwordController.dispose();
- emailController.dispose();
- super.dispose();
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: const Color(0xff123c75),
- appBar: AppBar(
- iconTheme: const IconThemeData(color: Colors.white),
- backgroundColor: const Color(0xff123c75),
- ),
- body: Center(
- child: Column(
- children: [
- Expanded(
- flex: 2,
- child: Container(
- decoration: const BoxDecoration(
- image: DecorationImage(
- image: AssetImage('assets/1000x1000.png'),
- fit: BoxFit.cover,
- ),
- ),
- ),
- ),
- Expanded(
- flex: 6,
- child: Container(
- padding: const EdgeInsets.fromLTRB(25.0, 50.0, 25.0, 20.0),
- decoration: const BoxDecoration(
- color: Colors.white,
- borderRadius:
- BorderRadius.only(topLeft: Radius.circular(50.0))),
- child: SingleChildScrollView(
- child: Form(
- key: _registerScreen,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- const Text('Registro',
- style: TextStyle(
- fontSize: 30.0,
- fontWeight: FontWeight.w900,
- color: Colors.black)),
- const SizedBox(height: 35),
- TextFormField(
- controller: usernameController,
- decoration: InputDecoration(
- label: const Text('Username'),
- labelStyle: const TextStyle(color: Colors.black),
- hintText: 'Insira o seu username',
- hintStyle: const TextStyle(
- color: Colors.black,
- ),
- border: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 39, 38, 38),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- enabledBorder: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- ),
- validator: (value) {
- if (value == null || value.isEmpty) {
- return 'Por favor, insira um username válido';
- }
- return null;
- },
- ),
- const SizedBox(height: 20),
- TextFormField(
- controller: nameController,
- decoration: InputDecoration(
- label: const Text('Nome'),
- labelStyle: const TextStyle(color: Colors.black),
- hintText: 'Insira seu Nome',
- hintStyle: const TextStyle(
- color: Colors.black,
- ),
- border: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 39, 38, 38),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- enabledBorder: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- ),
- validator: (value) {
- if (value == null || value.isEmpty) {
- return 'Por Favor Insira seu Nome';
- }
- return null;
- },
- ),
- const SizedBox(height: 20),
- TextFormField(
- controller: emailController,
- validator: (value) {
- if (value == null || value.isEmpty) {
- return 'Insira um email valido';
- }
- return null;
- },
- decoration: InputDecoration(
- label: const Text('Email'),
- labelStyle: const TextStyle(color: Colors.black),
- hintText: 'Insira o Email',
- hintStyle: const TextStyle(
- color: Colors.black,
- ),
- border: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 39, 38, 38),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- enabledBorder: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- ),
- ),
- const SizedBox(height: 20),
- TextFormField(
- controller: passwordController,
- obscureText: true,
- obscuringCharacter: '*',
- validator: (value) {
- if (value == null || value.isEmpty) {
- return 'Por Favor, insira uma senha valida';
- }
- return null;
- },
- decoration: InputDecoration(
- label: const Text('Senha'),
- labelStyle: const TextStyle(color: Colors.black),
- hintText: 'Insira a senha',
- hintStyle: const TextStyle(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- border: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(31, 255, 3, 3),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- enabledBorder: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- ),
- ),
- const SizedBox(height: 20),
- TextFormField(
- obscureText: true,
- obscuringCharacter: '*',
- validator: (value) {
- if (value == null ||
- value.isEmpty ||
- value != passwordController.text) {
- return 'As senhas não coincidem';
- }
- return null;
- },
- decoration: InputDecoration(
- label: const Text('Confirmar Senha'),
- labelStyle: const TextStyle(color: Colors.black),
- hintText: 'Confirme sua senha',
- hintStyle: const TextStyle(
- color: Color.fromARGB(255, 0, 0, 0),
- ),
- border: OutlineInputBorder(
- borderSide: const BorderSide(
- color: Color.fromARGB(31, 255, 3, 3),
- ),
- borderRadius: BorderRadius.circular(10),
- ),
- ),
- ),
- const SizedBox(height: 20),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Row(
- children: [
- Checkbox(
- value: terms,
- onChanged: (bool? value) {
- setState(() {
- terms = value!;
- });
- },
- activeColor:
- const Color.fromARGB(255, 12, 78, 170),
- ),
- const Text(
- 'Aceite os Termos',
- style: TextStyle(
- color: Color(0xff123c75),
- ),
- ),
- ],
- ),
- ],
- ),
- const SizedBox(height: 20),
- SizedBox(
- width: 200,
- height: 50,
- child: ElevatedButton(
- onPressed: isLoading ? null : _register,
- style: ElevatedButton.styleFrom(
- elevation: 6,
- backgroundColor:
- const Color.fromARGB(255, 244, 248, 0),
- foregroundColor: const Color(0xff123c75),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12),
- ),
- ),
- child: isLoading
- ? const CircularProgressIndicator(
- valueColor: AlwaysStoppedAnimation(
- Color(0xff123c75)),
- )
- : const Text(
- 'Registro',
- style: TextStyle(
- fontSize: 20,
- fontWeight: FontWeight.bold),
- ),
- ),
- ),
- const SizedBox(height: 30),
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- const Text(
- 'Já tem uma conta? ',
- style: TextStyle(
- color: Color.fromARGB(255, 0, 0, 0)),
- ),
- GestureDetector(
- onTap: () {
- Navigator.pushNamed(context, '/loginScreen');
- },
- child: const Text(
- 'Fazer login',
- style: TextStyle(
- fontWeight: FontWeight.bold,
- color: Color(0xff123c75),
- ),
- ),
- ),
- ],
- ),
- const SizedBox(height: 10),
- ],
- ),
- )),
- ))
- ],
- ),
- ));
- }
-}
diff --git a/frontend/sige_ie/lib/core/ui/first_scren.dart b/frontend/sige_ie/lib/core/ui/first_scren.dart
deleted file mode 100644
index cc91a5e5..00000000
--- a/frontend/sige_ie/lib/core/ui/first_scren.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-import 'package:flutter/material.dart';
-
-class FirstScreen extends StatelessWidget {
- const FirstScreen({super.key});
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Color(0xFF6399BE),
- body: Center(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Image.asset('assets/UNB.png'),
- Image.asset('assets/1000x1000Horizontal.png'),
- const SizedBox(
- height: 140,
- ),
- ElevatedButton(
- onPressed: () {
- Navigator.pushNamed(context, '/loginScreen');
- },
- style: ElevatedButton.styleFrom(
- elevation: 6,
- minimumSize: const Size(200, 50),
- backgroundColor: const Color(0xfff1f60e),
- foregroundColor: const Color(0xff123c75),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12),
- ),
- ),
- child: const Text(
- "Login",
- style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
- ),
- ),
- const SizedBox(
- height: 15,
- ),
- ElevatedButton(
- onPressed: () {
- Navigator.pushNamed(context, '/registerScreen');
- },
- style: ElevatedButton.styleFrom(
- elevation: 6,
- minimumSize: const Size(200, 50),
- backgroundColor: const Color(0xfff1f60e),
- foregroundColor: const Color(0xff123c75),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12),
- ),
- ),
- child: const Text(
- "Registro",
- style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
- ),
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/frontend/sige_ie/lib/core/ui/splash_screen.dart b/frontend/sige_ie/lib/core/ui/splash_screen.dart
deleted file mode 100644
index 519d9d9f..00000000
--- a/frontend/sige_ie/lib/core/ui/splash_screen.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:video_player/video_player.dart';
-
-class SplashScreen extends StatefulWidget {
- const SplashScreen({super.key});
-
- @override
- _SplashScreenState createState() => _SplashScreenState();
-}
-
-class _SplashScreenState extends State {
- VideoPlayerController? _controller;
-
- @override
- void initState() {
- super.initState();
- _controller = VideoPlayerController.asset('assets/Loading.mp4')
- ..initialize().then((_) {
- setState(() {});
- _controller!.play();
- _controller!.setLooping(false);
- _controller!.addListener(checkVideo);
- });
- }
-
- void checkVideo() {
- if (_controller!.value.position == _controller!.value.duration) {
- Navigator.pushReplacementNamed(context, '/first');
- }
- }
-
- @override
- void dispose() {
- _controller!.dispose();
- super.dispose();
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Colors.black,
- body: Center(
- child: _controller != null && _controller!.value.isInitialized
- ? SizedBox.expand(
- child: FittedBox(
- fit: BoxFit.cover,
- child: SizedBox(
- width: _controller!.value.size.width,
- height: _controller!.value.size.height,
- child: VideoPlayer(_controller!),
- ),
- ),
- )
- : const CircularProgressIndicator(), // Mostra o indicador de carregamento enquanto o vídeo está carregando
- ),
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_equipment_request_model.dart b/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_equipment_request_model.dart
deleted file mode 100644
index 12b9ed71..00000000
--- a/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_equipment_request_model.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:sige_ie/equipments/data/atmospheric/atmospheric_request_model.dart';
-
-class AtmosphericEquipmentRequestModel {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
- AtmosphericRequestModel? atmosphericRequestModel;
-
- AtmosphericEquipmentRequestModel({
- required this.genericEquipmentCategory,
- required this.personalEquipmentCategory,
- required this.atmosphericRequestModel,
- });
-
- Map toJson() {
- return {
- 'generic_equipment_category': genericEquipmentCategory,
- 'personal_equipment_category': personalEquipmentCategory,
- 'atmospheric_discharge_equipment': atmosphericRequestModel?.toJson(),
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_request_model.dart b/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_request_model.dart
deleted file mode 100644
index b5be154e..00000000
--- a/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_request_model.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-class AtmosphericRequestModel {
- int? area;
- int? system;
-
- AtmosphericRequestModel({
- required this.area,
- required this.system,
- });
-
- Map toJson() {
- return {
- 'area': area,
- 'system': system,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_response_model.dart b/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_response_model.dart
deleted file mode 100644
index dab15cc6..00000000
--- a/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_response_model.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class AtmosphericEquipmentResponseModel {
- int id;
- int area;
- String equipmentCategory;
- int system;
-
- AtmosphericEquipmentResponseModel({
- required this.id,
- required this.area,
- required this.equipmentCategory,
- required this.system,
- });
-
- factory AtmosphericEquipmentResponseModel.fromJson(
- Map json) {
- return AtmosphericEquipmentResponseModel(
- id: json['id'],
- area: json['area'],
- equipmentCategory: json['equipment_category'],
- system: json['system'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_service.dart b/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_service.dart
deleted file mode 100644
index b58013e8..00000000
--- a/frontend/sige_ie/lib/equipments/data/atmospheric/atmospheric_service.dart
+++ /dev/null
@@ -1,41 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-
-class AtmosphericEquipmentService {
- final Logger _logger = Logger('AtmosphericEquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future> getAtmosphericListByArea(int areaId) async {
- final url = '${baseUrl}atmospheric-discharges/by-area/$areaId';
- try {
- final response = await client.get(Uri.parse(url));
- if (response.statusCode == 200) {
- final List data = json.decode(response.body);
- _logger.info('API response data: $data');
- return data.map((item) {
- if (item['equipment'].containsKey('generic_equipment_category')) {
- return item['equipment']['generic_equipment_category'] as String;
- } else if (item['equipment']
- .containsKey('personal_equipment_category')) {
- return item['equipment']['personal_equipment_category'] as String;
- } else {
- return 'Unknown Equipment';
- }
- }).toList();
- } else {
- throw Exception('Failed to load atmospheric-discharges equipment');
- }
- } catch (e) {
- _logger
- .info('Error during get atmospheric-discharges equipment list: $e');
- return [];
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/distribution/distribution_equipment_request_model.dart b/frontend/sige_ie/lib/equipments/data/distribution/distribution_equipment_request_model.dart
deleted file mode 100644
index eda6a289..00000000
--- a/frontend/sige_ie/lib/equipments/data/distribution/distribution_equipment_request_model.dart
+++ /dev/null
@@ -1,39 +0,0 @@
-import 'package:sige_ie/equipments/data/distribution/distribution_request_model.dart';
-
-class DistributionEquipmentRequestModel {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
- DistributionRequestModel? distributionRequestModel;
- String? power;
- bool dr;
- bool dps;
- bool grounding;
- String? typeMaterial;
- String? methodInstallation;
-
- DistributionEquipmentRequestModel({
- required this.genericEquipmentCategory,
- required this.personalEquipmentCategory,
- required this.distributionRequestModel,
- this.power,
- this.dr = false,
- this.dps = false,
- this.grounding = false,
- this.typeMaterial,
- this.methodInstallation,
- });
-
- Map toJson() {
- return {
- 'generic_equipment_category': genericEquipmentCategory,
- 'personal_equipment_category': personalEquipmentCategory,
- 'distribution_board_equipment': distributionRequestModel?.toJson(),
- 'power': power,
- 'dr': dr,
- 'dps': dps,
- 'grounding': grounding,
- 'type_material': typeMaterial,
- 'method_installation': methodInstallation,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/distribution/distribution_request_model.dart b/frontend/sige_ie/lib/equipments/data/distribution/distribution_request_model.dart
deleted file mode 100644
index 031a4684..00000000
--- a/frontend/sige_ie/lib/equipments/data/distribution/distribution_request_model.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-class DistributionRequestModel {
- int? area;
- int? system;
-
- DistributionRequestModel({
- required this.area,
- required this.system,
- });
-
- Map toJson() {
- return {
- 'area': area,
- 'system': system,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/distribution/distribution_response_model.dart b/frontend/sige_ie/lib/equipments/data/distribution/distribution_response_model.dart
deleted file mode 100644
index c0c300a0..00000000
--- a/frontend/sige_ie/lib/equipments/data/distribution/distribution_response_model.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class DistributionEquipmentResponseModel {
- int id;
- int area;
- String equipmentCategory;
- int system;
-
- DistributionEquipmentResponseModel({
- required this.id,
- required this.area,
- required this.equipmentCategory,
- required this.system,
- });
-
- factory DistributionEquipmentResponseModel.fromJson(
- Map json) {
- return DistributionEquipmentResponseModel(
- id: json['id'],
- area: json['area'],
- equipmentCategory: json['equipment_category'],
- system: json['system'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/distribution/distribution_service.dart b/frontend/sige_ie/lib/equipments/data/distribution/distribution_service.dart
deleted file mode 100644
index baefcef3..00000000
--- a/frontend/sige_ie/lib/equipments/data/distribution/distribution_service.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-
-class DistributionEquipmentService {
- final Logger _logger = Logger('DistributionEquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future> getDistributionListByArea(int areaId) async {
- final url = '${baseUrl}distribution-boards/by-area/$areaId';
- try {
- final response = await client.get(Uri.parse(url));
- if (response.statusCode == 200) {
- final List data = json.decode(response.body);
- _logger.info('API response data: $data');
- return data.map((item) {
- if (item['equipment'].containsKey('generic_equipment_category')) {
- return item['equipment']['generic_equipment_category'] as String;
- } else if (item['equipment']
- .containsKey('personal_equipment_category')) {
- return item['equipment']['personal_equipment_category'] as String;
- } else {
- return 'Unknown Equipment';
- }
- }).toList();
- } else {
- throw Exception('Failed to load distribution-boards equipment');
- }
- } catch (e) {
- _logger.info('Error during get distribution-boards equipment list: $e');
- return [];
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_equipment_request_model.dart b/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_equipment_request_model.dart
deleted file mode 100644
index f894742e..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_equipment_request_model.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:sige_ie/equipments/data/eletrical-load/eletrical_load_request_model.dart.dart';
-
-class EletricalLoadEquipmentRequestModel {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
- EletricalLoadRequestModel? eletricalLoadRequestModel;
-
- EletricalLoadEquipmentRequestModel({
- required this.genericEquipmentCategory,
- required this.personalEquipmentCategory,
- required this.eletricalLoadRequestModel,
- });
-
- Map toJson() {
- return {
- 'generic_equipment_category': genericEquipmentCategory,
- 'personal_equipment_category': personalEquipmentCategory,
- 'electrical_load_equipment': eletricalLoadRequestModel?.toJson(),
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_request_model.dart.dart b/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_request_model.dart.dart
deleted file mode 100644
index 50d38722..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_request_model.dart.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-class EletricalLoadRequestModel {
- int? area;
- int? system;
-
- EletricalLoadRequestModel({
- required this.area,
- required this.system,
- });
-
- Map toJson() {
- return {
- 'area': area,
- 'system': system,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_response_model.dart b/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_response_model.dart
deleted file mode 100644
index 9a950c3a..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_response_model.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class EletricalLoadEquipmentResponseModel {
- int id;
- int area;
- String equipmentCategory;
- int system;
-
- EletricalLoadEquipmentResponseModel({
- required this.id,
- required this.area,
- required this.equipmentCategory,
- required this.system,
- });
-
- factory EletricalLoadEquipmentResponseModel.fromJson(
- Map json) {
- return EletricalLoadEquipmentResponseModel(
- id: json['id'],
- area: json['area'],
- equipmentCategory: json['equipment_category'],
- system: json['system'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_service.dart b/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_service.dart
deleted file mode 100644
index 189b2b54..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical-load/eletrical_load_service.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-
-class EletricalLoadEquipmentService {
- final Logger _logger = Logger('EletricalLoadEquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future> getEletricalLoadListByArea(int areaId) async {
- final url = '${baseUrl}electrical-loads/by-area/$areaId';
- try {
- final response = await client.get(Uri.parse(url));
- if (response.statusCode == 200) {
- final List data = json.decode(response.body);
- _logger.info('API response data: $data');
- return data.map((item) {
- if (item['equipment'].containsKey('generic_equipment_category')) {
- return item['equipment']['generic_equipment_category'] as String;
- } else if (item['equipment']
- .containsKey('personal_equipment_category')) {
- return item['equipment']['personal_equipment_category'] as String;
- } else {
- return 'Unknown Equipment';
- }
- }).toList();
- } else {
- throw Exception('Failed to load electrical-loads equipment');
- }
- } catch (e) {
- _logger.info('Error during get electrical-loads equipment list: $e');
- return [];
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_equipment_request_model.dart b/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_equipment_request_model.dart
deleted file mode 100644
index 7ecf5095..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_equipment_request_model.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:sige_ie/equipments/data/eletrical_circuit/eletrical_circuit_request_model.dart';
-
-class EletricalCircuitEquipmentRequestModel {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
- EletricalCircuitRequestModel? eletricalCircuitRequestModel;
-
- EletricalCircuitEquipmentRequestModel({
- required this.genericEquipmentCategory,
- required this.personalEquipmentCategory,
- required this.eletricalCircuitRequestModel,
- });
-
- Map toJson() {
- return {
- 'generic_equipment_category': genericEquipmentCategory,
- 'personal_equipment_category': personalEquipmentCategory,
- 'electrical_circuit_equipment': eletricalCircuitRequestModel?.toJson(),
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_request_model.dart b/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_request_model.dart
deleted file mode 100644
index 8068d3c5..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_request_model.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-class EletricalCircuitRequestModel {
- int? area;
- int? system;
-
- EletricalCircuitRequestModel({
- required this.area,
- required this.system,
- });
-
- Map toJson() {
- return {
- 'area': area,
- 'system': system,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_response_model.dart b/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_response_model.dart
deleted file mode 100644
index 926c7a8f..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_response_model.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class EletricalCircuitEquipmentResponseModel {
- int id;
- int area;
- String equipmentCategory;
- int system;
-
- EletricalCircuitEquipmentResponseModel({
- required this.id,
- required this.area,
- required this.equipmentCategory,
- required this.system,
- });
-
- factory EletricalCircuitEquipmentResponseModel.fromJson(
- Map json) {
- return EletricalCircuitEquipmentResponseModel(
- id: json['id'],
- area: json['area'],
- equipmentCategory: json['equipment_category'],
- system: json['system'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_service.dart b/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_service.dart
deleted file mode 100644
index 48c34588..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical_circuit/eletrical_circuit_service.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-
-class EletricalCircuitEquipmentService {
- final Logger _logger = Logger('EletricalCircuitEquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future> getEletricalCircuitListByArea(int areaId) async {
- final url = '${baseUrl}electrical-circuits/by-area/$areaId';
- try {
- final response = await client.get(Uri.parse(url));
- if (response.statusCode == 200) {
- final List data = json.decode(response.body);
- _logger.info('API response data: $data');
- return data.map((item) {
- if (item['equipment'].containsKey('generic_equipment_category')) {
- return item['equipment']['generic_equipment_category'] as String;
- } else if (item['equipment']
- .containsKey('personal_equipment_category')) {
- return item['equipment']['personal_equipment_category'] as String;
- } else {
- return 'Unknown Equipment';
- }
- }).toList();
- } else {
- throw Exception('Failed to load electrical-circuits equipment');
- }
- } catch (e) {
- _logger.info('Error during get electrical-circuits equipment list: $e');
- return [];
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_equipment_request_model.dart b/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_equipment_request_model.dart
deleted file mode 100644
index 9377f5f6..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_equipment_request_model.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:sige_ie/equipments/data/eletrical_line/eletrical_line_request_model.dart';
-
-class EletricalLineEquipmentRequestModel {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
- EletricalLineRequestModel? eletricalLineRequestModel;
-
- EletricalLineEquipmentRequestModel({
- required this.genericEquipmentCategory,
- required this.personalEquipmentCategory,
- required this.eletricalLineRequestModel,
- });
-
- Map toJson() {
- return {
- 'generic_equipment_category': genericEquipmentCategory,
- 'personal_equipment_category': personalEquipmentCategory,
- 'electrical_line_equipment': eletricalLineRequestModel?.toJson(),
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_request_model.dart b/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_request_model.dart
deleted file mode 100644
index 9bb93058..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_request_model.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-class EletricalLineRequestModel {
- int? area;
- int? system;
-
- EletricalLineRequestModel({
- required this.area,
- required this.system,
- });
-
- Map toJson() {
- return {
- 'area': area,
- 'system': system,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_response_model.dart b/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_response_model.dart
deleted file mode 100644
index c1653dbf..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_response_model.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class EletricalLineEquipmentResponseModel {
- int id;
- int area;
- String equipmentCategory;
- int system;
-
- EletricalLineEquipmentResponseModel({
- required this.id,
- required this.area,
- required this.equipmentCategory,
- required this.system,
- });
-
- factory EletricalLineEquipmentResponseModel.fromJson(
- Map json) {
- return EletricalLineEquipmentResponseModel(
- id: json['id'],
- area: json['area'],
- equipmentCategory: json['equipment_category'],
- system: json['system'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_service.dart b/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_service.dart
deleted file mode 100644
index 53db71ea..00000000
--- a/frontend/sige_ie/lib/equipments/data/eletrical_line/eletrical_line_service.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-
-class EletricalLineEquipmentService {
- final Logger _logger = Logger('EletricalLineEquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future> getElectricalLineListByArea(int areaId) async {
- final url = '${baseUrl}electrical-lines/by-area/$areaId';
- try {
- final response = await client.get(Uri.parse(url));
- if (response.statusCode == 200) {
- final List data = json.decode(response.body);
- _logger.info('API response data: $data');
- return data.map((item) {
- if (item['equipment'].containsKey('generic_equipment_category')) {
- return item['equipment']['generic_equipment_category'] as String;
- } else if (item['equipment']
- .containsKey('personal_equipment_category')) {
- return item['equipment']['personal_equipment_category'] as String;
- } else {
- return 'Unknown Equipment';
- }
- }).toList();
- } else {
- throw Exception('Failed to load electrical-lines equipment');
- }
- } catch (e) {
- _logger.info('Error during get electrical-lines equipment list: $e');
- return [];
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/equipment_service.dart b/frontend/sige_ie/lib/equipments/data/equipment_service.dart
deleted file mode 100644
index be56b2f0..00000000
--- a/frontend/sige_ie/lib/equipments/data/equipment_service.dart
+++ /dev/null
@@ -1,332 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/equipments/data/atmospheric/atmospheric_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/distribution/distribution_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/eletrical-load/eletrical_load_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/eletrical_circuit/eletrical_circuit_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/eletrical_line/eletrical_line_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/refrigerations/refrigerations_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/fire_alarm/fire_alarm_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/iluminations/ilumination__equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/structured_cabling/structured_cabling_equipment_request_model.dart';
-import 'package:sige_ie/main.dart';
-
-class EquipmentService {
- final Logger _logger = Logger('EquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/equipments/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future> getEquipmentById(int equipmentId) async {
- var url = Uri.parse('http://10.0.2.2:8000/api/equipments/$equipmentId/');
- try {
- var response = await client.get(url);
- if (response.statusCode == 200) {
- return jsonDecode(response.body);
- } else {
- _logger.info(
- 'Failed to load equipment with status code: ${response.statusCode}');
- throw Exception('Failed to load equipment');
- }
- } catch (e) {
- _logger.info('Error during get equipment: $e');
- throw Exception('Failed to load equipment');
- }
- }
-
- Future updateEquipment(int id, Map data) async {
- var url = Uri.parse('http://10.0.2.2:8000/api/equipments/$id/');
-
- try {
- var response = await client.put(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(data),
- );
-
- if (response.statusCode == 200) {
- _logger.info('Successfully updated equipment type with ID: $id');
- return true;
- } else {
- _logger.info(
- 'Failed to update equipment type with status code: ${response.statusCode}');
- return false;
- }
- } catch (e) {
- _logger.info('Error during update equipment type: $e');
- return false;
- }
- }
-
- Future createFireAlarm(
- FireAlarmEquipmentRequestModel fireAlarmEquipmentRequestModel) async {
- var url = Uri.parse(baseUrl);
-
- try {
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(fireAlarmEquipmentRequestModel.toJson()),
- );
-
- _logger.info('Response status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- if (response.statusCode == 201 || response.statusCode == 200) {
- Map responseData = jsonDecode(response.body);
- _logger.info('Request successful, received ID: ${responseData['id']}');
- return responseData['id'];
- } else {
- _logger.info(
- 'Failed to register fire alarm equipment: ${response.statusCode}');
- return null;
- }
- } catch (e) {
- _logger.info('Error during register: $e');
- return null;
- }
- }
-
- Future createStructuredCabling(
- StructuredCablingEquipmentRequestModel
- structuredCablingEquipmentRequestModel) async {
- var url = Uri.parse(baseUrl);
-
- try {
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(structuredCablingEquipmentRequestModel.toJson()),
- );
-
- _logger.info('Response status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- if (response.statusCode == 201 || response.statusCode == 200) {
- Map responseData = jsonDecode(response.body);
- _logger.info('Request successful, received ID: ${responseData['id']}');
- return responseData['id'];
- } else {
- _logger.info(
- 'Failed to register structured cabling equipment: ${response.statusCode}');
- return null;
- }
- } catch (e) {
- _logger.info('Error during register: $e');
- return null;
- }
- }
-
- Future createIlumination(
- IluminationEquipmentRequestModel
- illuminationEquipmentRequestModel) async {
- var url = Uri.parse(baseUrl);
-
- try {
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(illuminationEquipmentRequestModel.toJson()),
- );
-
- _logger.info('Response status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- if (response.statusCode == 201 || response.statusCode == 200) {
- Map responseData = jsonDecode(response.body);
- _logger.info('Request successful, received ID: ${responseData['id']}');
- return responseData['id'];
- } else {
- _logger.info(
- 'Failed to register illumination equipment: ${response.statusCode}');
- return null;
- }
- } catch (e) {
- _logger.info('Error during register: $e');
- return null;
- }
- }
-
- Future createElectricalLoad(
- EletricalLoadEquipmentRequestModel
- electricalLoadEquipmentRequestModel) async {
- var url = Uri.parse(baseUrl);
-
- try {
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(electricalLoadEquipmentRequestModel.toJson()),
- );
-
- _logger.info('Response status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- if (response.statusCode == 201 || response.statusCode == 200) {
- Map responseData = jsonDecode(response.body);
- _logger.info('Request successful, received ID: ${responseData['id']}');
- return responseData['id'];
- } else {
- _logger.info(
- 'Failed to register electrical load equipment: ${response.statusCode}');
- return null;
- }
- } catch (e) {
- _logger.info('Error during register: $e');
- return null;
- }
- }
-
- Future createElectricalLine(
- EletricalLineEquipmentRequestModel
- electricalLineEquipmentRequestModel) async {
- var url = Uri.parse(baseUrl);
-
- try {
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(electricalLineEquipmentRequestModel.toJson()),
- );
-
- _logger.info('Response status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- if (response.statusCode == 201 || response.statusCode == 200) {
- Map responseData = jsonDecode(response.body);
- _logger.info('Request successful, received ID: ${responseData['id']}');
- return responseData['id'];
- } else {
- _logger.info(
- 'Failed to register electrical line equipment: ${response.statusCode}');
- return null;
- }
- } catch (e) {
- _logger.info('Error during register: $e');
- return null;
- }
- }
-
- Future createElectricalCircuit(
- EletricalCircuitEquipmentRequestModel
- electricalCircuitEquipmentRequestModel) async {
- var url = Uri.parse(baseUrl);
-
- try {
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(electricalCircuitEquipmentRequestModel.toJson()),
- );
-
- _logger.info('Response status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- if (response.statusCode == 201 || response.statusCode == 200) {
- Map responseData = jsonDecode(response.body);
- _logger.info('Request successful, received ID: ${responseData['id']}');
- return responseData['id'];
- } else {
- _logger.info(
- 'Failed to register electrical circuit equipment: ${response.statusCode}');
- return null;
- }
- } catch (e) {
- _logger.info('Error during register: $e');
- return null;
- }
- }
-
- Future createDistribution(
- DistributionEquipmentRequestModel
- distributionEquipmentRequestModel) async {
- var url = Uri.parse(baseUrl);
-
- try {
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(distributionEquipmentRequestModel.toJson()),
- );
-
- _logger.info('Response status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- if (response.statusCode == 201 || response.statusCode == 200) {
- Map responseData = jsonDecode(response.body);
- _logger.info('Request successful, received ID: ${responseData['id']}');
- return responseData['id'];
- } else {
- _logger.info(
- 'Failed to register distribution equipment: ${response.statusCode}');
- return null;
- }
- } catch (e) {
- _logger.info('Error during register: $e');
- return null;
- }
- }
-
- Future createRefrigerations(
- RefrigerationsEquipmentRequestModel
- refrigerationsEquipmentRequestModel) async {
- var url = Uri.parse(baseUrl);
-
- try {
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(refrigerationsEquipmentRequestModel.toJson()),
- );
-
- _logger.info('Response status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- if (response.statusCode == 201 || response.statusCode == 200) {
- Map responseData = jsonDecode(response.body);
- _logger.info('Request successful, received ID: ${responseData['id']}');
- return responseData['id'];
- } else {
- _logger.info(
- 'Failed to register refrigeration equipment: ${response.statusCode}');
- return null;
- }
- } catch (e) {
- _logger.info('Error during register: $e');
- return null;
- }
- }
-
- Future createAtmospheric(
- AtmosphericEquipmentRequestModel atmosphericEquipmentRequestModel) async {
- var url = Uri.parse(baseUrl);
-
- try {
- var response = await client.post(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(atmosphericEquipmentRequestModel.toJson()),
- );
-
- _logger.info('Response status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
-
- if (response.statusCode == 201 || response.statusCode == 200) {
- Map responseData = jsonDecode(response.body);
- _logger.info('Request successful, received ID: ${responseData['id']}');
- return responseData['id'];
- } else {
- _logger.info(
- 'Failed to register atmospheric equipment: ${response.statusCode}');
- return null;
- }
- } catch (e) {
- _logger.info('Error during register: $e');
- return null;
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_equipment_request_model.dart b/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_equipment_request_model.dart
deleted file mode 100644
index 175b868d..00000000
--- a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_equipment_request_model.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:sige_ie/equipments/data/fire_alarm/fire_alarm_request_model.dart';
-
-class FireAlarmEquipmentRequestModel {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
- FireAlarmRequestModel? fireAlarmRequestModel;
-
- FireAlarmEquipmentRequestModel({
- required this.genericEquipmentCategory,
- required this.personalEquipmentCategory,
- required this.fireAlarmRequestModel,
- });
-
- Map toJson() {
- return {
- 'generic_equipment_category': genericEquipmentCategory,
- 'personal_equipment_category': personalEquipmentCategory,
- 'fire_alarm_equipment': fireAlarmRequestModel?.toJson(),
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_request_model.dart b/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_request_model.dart
deleted file mode 100644
index b84ecd16..00000000
--- a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_request_model.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-class FireAlarmRequestModel {
- int? area;
- int? system;
- int? quantity;
-
- FireAlarmRequestModel({
- required this.area,
- required this.system,
- this.quantity,
- });
-
- Map toJson() {
- return {
- 'area': area,
- 'system': system,
- 'quantity': quantity,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_response_by_area_model.dart b/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_response_by_area_model.dart
deleted file mode 100644
index ef320836..00000000
--- a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_response_by_area_model.dart
+++ /dev/null
@@ -1,26 +0,0 @@
-class FireAlarmEquipmentResponseByAreaModel {
- int id;
- int area;
- String equipmentCategory;
- int system;
- int quantity;
-
- FireAlarmEquipmentResponseByAreaModel({
- required this.id,
- required this.area,
- required this.equipmentCategory,
- required this.system,
- required this.quantity,
- });
-
- factory FireAlarmEquipmentResponseByAreaModel.fromJson(
- Map json) {
- return FireAlarmEquipmentResponseByAreaModel(
- id: json['id'],
- area: json['area'],
- equipmentCategory: json['equipment_category'],
- system: json['system'],
- quantity: json['quantity'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_response_model.dart b/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_response_model.dart
deleted file mode 100644
index c6430edf..00000000
--- a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_response_model.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-class FireAlarmResponseModel {
- int id;
- int area;
- int equipment;
- int system;
- int quantity;
-
- FireAlarmResponseModel({
- required this.id,
- required this.area,
- required this.equipment,
- required this.system,
- required this.quantity,
- });
-
- factory FireAlarmResponseModel.fromJson(Map json) {
- return FireAlarmResponseModel(
- id: json['id'],
- area: json['area'],
- equipment: json['equipment'],
- system: json['system'],
- quantity: json['quantity'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_service.dart b/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_service.dart
deleted file mode 100644
index 579ca036..00000000
--- a/frontend/sige_ie/lib/equipments/data/fire_alarm/fire_alarm_service.dart
+++ /dev/null
@@ -1,103 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/equipments/data/fire_alarm/fire_alarm_request_model.dart';
-import 'package:sige_ie/equipments/data/fire_alarm/fire_alarm_response_by_area_model.dart';
-import 'package:sige_ie/equipments/data/fire_alarm/fire_alarm_response_model.dart';
-import 'package:sige_ie/main.dart';
-
-class FireAlarmEquipmentService {
- final Logger _logger = Logger('FireAlarmEquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future> getFireAlarmListByArea(
- int areaId) async {
- var url = Uri.parse('${baseUrl}fire-alarms/by-area/$areaId/');
- try {
- var response = await client.get(url);
-
- if (response.statusCode == 200) {
- List dataList = jsonDecode(response.body);
- return dataList
- .map((data) => FireAlarmEquipmentResponseByAreaModel.fromJson(data))
- .toList();
- } else {
- _logger.info(
- 'Failed to load fire alarm equipment with status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
- throw Exception('Failed to load fire alarm equipment');
- }
- } catch (e) {
- _logger.info('Error during get fire alarm equipment list: $e');
- throw Exception('Failed to load fire alarm equipment');
- }
- }
-
- Future deleteFireAlarm(int fireAlarmId) async {
- var url = Uri.parse('${baseUrl}fire-alarms/$fireAlarmId/');
- try {
- var response = await client.delete(url);
- if (response.statusCode == 204) {
- _logger.info(
- 'Successfully deleted fire alarm equipment with ID: $fireAlarmId');
- } else {
- _logger.info(
- 'Failed to delete fire alarm equipment with status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
- throw Exception('Failed to delete fire alarm equipment');
- }
- } catch (e) {
- _logger.info('Error during delete fire alarm equipment: $e');
- throw Exception('Failed to delete fire alarm equipment');
- }
- }
-
- Future getFireAlarmById(int fireAlarmId) async {
- var url = Uri.parse('${baseUrl}fire-alarms/$fireAlarmId/');
- try {
- var response = await client.get(url);
- if (response.statusCode == 200) {
- var jsonResponse = jsonDecode(response.body);
- return FireAlarmResponseModel.fromJson(jsonResponse);
- } else {
- _logger.info(
- 'Failed to load fire alarm with status code: ${response.statusCode}');
- throw Exception('Failed to load fire alarm');
- }
- } catch (e) {
- _logger.info('Error during get fire alarm: $e');
- throw Exception('Failed to load fire alarm');
- }
- }
-
- Future updateFireAlarm(
- int fireAlarmId, FireAlarmRequestModel fireAlarmRequestModel) async {
- var url = Uri.parse('${baseUrl}fire-alarms/$fireAlarmId/');
-
- try {
- var response = await client.put(
- url,
- headers: {'Content-Type': 'application/json'},
- body: jsonEncode(fireAlarmRequestModel.toJson()),
- );
-
- if (response.statusCode == 200) {
- _logger.info(
- 'Successfully updated fire alarm equipment with ID: $fireAlarmId');
- return true;
- } else {
- _logger.info(
- 'Failed to update fire alarm equipment with status code: ${response.statusCode}');
- return false;
- }
- } catch (e) {
- _logger.info('Error during update fire alarm equipment: $e');
- return false;
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/iluminations/ilumination__equipment_request_model.dart b/frontend/sige_ie/lib/equipments/data/iluminations/ilumination__equipment_request_model.dart
deleted file mode 100644
index efd20485..00000000
--- a/frontend/sige_ie/lib/equipments/data/iluminations/ilumination__equipment_request_model.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:sige_ie/equipments/data/iluminations/ilumination_request_model.dart';
-
-class IluminationEquipmentRequestModel {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
- IluminationRequestModel? iluminationRequestModel;
-
- IluminationEquipmentRequestModel({
- required this.genericEquipmentCategory,
- required this.personalEquipmentCategory,
- required this.iluminationRequestModel,
- });
-
- Map toJson() {
- return {
- 'generic_equipment_category': genericEquipmentCategory,
- 'personal_equipment_category': personalEquipmentCategory,
- 'ilumination_equipment': iluminationRequestModel?.toJson(),
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/iluminations/ilumination_request_model.dart b/frontend/sige_ie/lib/equipments/data/iluminations/ilumination_request_model.dart
deleted file mode 100644
index c3b44740..00000000
--- a/frontend/sige_ie/lib/equipments/data/iluminations/ilumination_request_model.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-class IluminationRequestModel {
- int? area;
- int? system;
-
- IluminationRequestModel({
- required this.area,
- required this.system,
- });
-
- Map toJson() {
- return {
- 'area': area,
- 'system': system,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/iluminations/ilumination_request_response.dart b/frontend/sige_ie/lib/equipments/data/iluminations/ilumination_request_response.dart
deleted file mode 100644
index 66238ad1..00000000
--- a/frontend/sige_ie/lib/equipments/data/iluminations/ilumination_request_response.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class IluminationEquipmentResponseModel {
- int id;
- int area;
- String equipmentCategory;
- int system;
-
- IluminationEquipmentResponseModel({
- required this.id,
- required this.area,
- required this.equipmentCategory,
- required this.system,
- });
-
- factory IluminationEquipmentResponseModel.fromJson(
- Map json) {
- return IluminationEquipmentResponseModel(
- id: json['id'],
- area: json['area'],
- equipmentCategory: json['equipment_category'],
- system: json['system'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/iluminations/ilumination_service.dart b/frontend/sige_ie/lib/equipments/data/iluminations/ilumination_service.dart
deleted file mode 100644
index 28f20cdd..00000000
--- a/frontend/sige_ie/lib/equipments/data/iluminations/ilumination_service.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-
-class IluminationEquipmentService {
- final Logger _logger = Logger('IluminationEquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future> getIluminationListByArea(int areaId) async {
- final url = '${baseUrl}iluminations/by-area/$areaId';
- try {
- final response = await client.get(Uri.parse(url));
- if (response.statusCode == 200) {
- final List data = json.decode(response.body);
- _logger.info('API response data: $data');
- return data.map((item) {
- if (item['equipment'].containsKey('generic_equipment_category')) {
- return item['equipment']['generic_equipment_category'] as String;
- } else if (item['equipment']
- .containsKey('personal_equipment_category')) {
- return item['equipment']['personal_equipment_category'] as String;
- } else {
- return 'Unknown Equipment';
- }
- }).toList();
- } else {
- throw Exception('Failed to load ilumination equipment');
- }
- } catch (e) {
- _logger.info('Error during get ilumination equipment list: $e');
- return [];
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_equipment_request_model.dart b/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_equipment_request_model.dart
deleted file mode 100644
index ad35b02b..00000000
--- a/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_equipment_request_model.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:sige_ie/equipments/data/refrigerations/refrigerations_request_model.dart';
-
-class RefrigerationsEquipmentRequestModel {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
- RefrigerationsRequestModel? refrigerationsRequestModel;
-
- RefrigerationsEquipmentRequestModel({
- required this.genericEquipmentCategory,
- required this.personalEquipmentCategory,
- required this.refrigerationsRequestModel,
- });
-
- Map toJson() {
- return {
- 'generic_equipment_category': genericEquipmentCategory,
- 'personal_equipment_category': personalEquipmentCategory,
- 'refrigeration_equipment': refrigerationsRequestModel?.toJson(),
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_request_model.dart b/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_request_model.dart
deleted file mode 100644
index 231942f8..00000000
--- a/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_request_model.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-class RefrigerationsRequestModel {
- int? area;
- int? system;
-
- RefrigerationsRequestModel({
- required this.area,
- required this.system,
- });
-
- Map toJson() {
- return {
- 'area': area,
- 'system': system,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_response_model.dart b/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_response_model.dart
deleted file mode 100644
index 9e03c896..00000000
--- a/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_response_model.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class RefrigerationsEquipmentResponseModel {
- int id;
- int area;
- String equipmentCategory;
- int system;
-
- RefrigerationsEquipmentResponseModel({
- required this.id,
- required this.area,
- required this.equipmentCategory,
- required this.system,
- });
-
- factory RefrigerationsEquipmentResponseModel.fromJson(
- Map json) {
- return RefrigerationsEquipmentResponseModel(
- id: json['id'],
- area: json['area'],
- equipmentCategory: json['equipment_category'],
- system: json['system'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_service.dart b/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_service.dart
deleted file mode 100644
index 32eabb58..00000000
--- a/frontend/sige_ie/lib/equipments/data/refrigerations/refrigerations_service.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-
-class RefrigerationsEquipmentService {
- final Logger _logger = Logger('RefrigerationsEquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future> getRefrigerationsListByArea(int areaId) async {
- final url = '${baseUrl}refrigeration/by-area/$areaId';
- try {
- final response = await client.get(Uri.parse(url));
- if (response.statusCode == 200) {
- final List data = json.decode(response.body);
- _logger.info('API response data: $data');
- return data.map((item) {
- if (item['equipment'].containsKey('generic_equipment_category')) {
- return item['equipment']['generic_equipment_category'] as String;
- } else if (item['equipment']
- .containsKey('personal_equipment_category')) {
- return item['equipment']['personal_equipment_category'] as String;
- } else {
- return 'Unknown Equipment';
- }
- }).toList();
- } else {
- throw Exception('Failed to load ilumination equipment');
- }
- } catch (e) {
- _logger.info('Error during get ilumination equipment list: $e');
- return [];
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_equipment_request_model.dart b/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_equipment_request_model.dart
deleted file mode 100644
index 64cad126..00000000
--- a/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_equipment_request_model.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-import 'package:sige_ie/equipments/data/structured_cabling/structured_cabling_request_model.dart';
-
-class StructuredCablingEquipmentRequestModel {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
- StructuredCablingRequestModel? structuredCablingRequestModel;
-
- StructuredCablingEquipmentRequestModel({
- required this.genericEquipmentCategory,
- required this.personalEquipmentCategory,
- required this.structuredCablingRequestModel,
- });
-
- Map toJson() {
- return {
- 'generic_equipment_category': genericEquipmentCategory,
- 'personal_equipment_category': personalEquipmentCategory,
- 'structured_cabling_equipment': structuredCablingRequestModel?.toJson(),
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_request_model.dart b/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_request_model.dart
deleted file mode 100644
index df7c53b9..00000000
--- a/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_request_model.dart
+++ /dev/null
@@ -1,16 +0,0 @@
-class StructuredCablingRequestModel {
- int? area;
- int? system;
-
- StructuredCablingRequestModel({
- required this.area,
- required this.system,
- });
-
- Map toJson() {
- return {
- 'area': area,
- 'system': system,
- };
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_response_model.dart b/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_response_model.dart
deleted file mode 100644
index 7d3c05e8..00000000
--- a/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_response_model.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-class StructuredCablingEquipmentResponseModel {
- int id;
- int area;
- String equipmentCategory;
- int system;
-
- StructuredCablingEquipmentResponseModel({
- required this.id,
- required this.area,
- required this.equipmentCategory,
- required this.system,
- });
-
- factory StructuredCablingEquipmentResponseModel.fromJson(
- Map json) {
- return StructuredCablingEquipmentResponseModel(
- id: json['id'],
- area: json['area'],
- equipmentCategory: json['equipment_category'],
- system: json['system'],
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_service.dart b/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_service.dart
deleted file mode 100644
index 59d278a1..00000000
--- a/frontend/sige_ie/lib/equipments/data/structured_cabling/structured_cabling_service.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-import 'dart:convert';
-import 'package:http/http.dart' as http;
-import 'package:http_interceptor/http_interceptor.dart';
-import 'package:logging/logging.dart';
-import 'package:sige_ie/core/data/auth_interceptor.dart';
-import 'package:sige_ie/main.dart';
-import 'package:sige_ie/equipments/data/structured_cabling/structured_cabling_response_model.dart';
-
-class StructuredCablingEquipmentService {
- final Logger _logger = Logger('StructuredCablingEquipmentService');
- final String baseUrl = 'http://10.0.2.2:8000/api/';
- http.Client client = InterceptedClient.build(
- interceptors: [AuthInterceptor(cookieJar)],
- );
-
- Future>
- getStructuredCablingListByArea(int areaId) async {
- final url = '${baseUrl}structured-cabling/by-area/$areaId';
- try {
- final response = await client.get(Uri.parse(url));
- if (response.statusCode == 200) {
- final List data = json.decode(response.body);
- _logger.info('API response data: $data');
- return data
- .map((item) =>
- StructuredCablingEquipmentResponseModel.fromJson(item))
- .toList();
- } else {
- _logger.severe(
- 'Failed to load structured-cabling equipment with status code: ${response.statusCode}, response body: ${response.body}');
- throw Exception(
- 'Failed to load structured-cabling equipment with status code: ${response.statusCode}');
- }
- } catch (e) {
- _logger.severe('Error during get structured-cabling equipment list: $e');
- throw Exception('Failed to load structured-cabling equipment. Error: $e');
- }
- }
-
- Future deleteStructuredCabling(int structuredCablingId) async {
- var url = Uri.parse('${baseUrl}structured-cabling/$structuredCablingId/');
- try {
- var response = await client.delete(url);
- if (response.statusCode == 204) {
- _logger.info(
- 'Successfully deleted structured cabling equipment with ID: $structuredCablingId');
- } else {
- _logger.info(
- 'Failed to delete structured cabling equipment with status code: ${response.statusCode}');
- _logger.info('Response body: ${response.body}');
- throw Exception('Failed to delete structured cabling equipment');
- }
- } catch (e) {
- _logger.info('Error during delete structured cabling equipment: $e');
- throw Exception('Failed to delete structured cabling equipment');
- }
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/feature/atmospheric-discharges/add_atmospheric_discharges_equipment.dart b/frontend/sige_ie/lib/equipments/feature/atmospheric-discharges/add_atmospheric_discharges_equipment.dart
deleted file mode 100644
index 9d27d064..00000000
--- a/frontend/sige_ie/lib/equipments/feature/atmospheric-discharges/add_atmospheric_discharges_equipment.dart
+++ /dev/null
@@ -1,800 +0,0 @@
-import 'dart:io';
-import 'dart:math';
-import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
-import 'package:image_picker/image_picker.dart';
-import 'package:sige_ie/config/app_styles.dart';
-import 'package:sige_ie/equipments/data/atmospheric/atmospheric_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/atmospheric/atmospheric_request_model.dart';
-import 'package:sige_ie/equipments/data/equipment_service.dart';
-import 'package:sige_ie/shared/data/equipment-photo/equipment_photo_request_model.dart';
-import 'package:sige_ie/shared/data/equipment-photo/equipment_photo_service.dart';
-import 'package:sige_ie/shared/data/generic-equipment-category/generic_equipment_category_response_model.dart';
-import 'package:sige_ie/shared/data/generic-equipment-category/generic_equipment_category_service.dart';
-import 'package:sige_ie/shared/data/personal-equipment-category/personal_equipment_category_request_model.dart';
-import 'package:sige_ie/shared/data/personal-equipment-category/personal_equipment_category_service.dart';
-
-class ImageData {
- int id;
- File imageFile;
- String description;
-
- ImageData(this.imageFile, this.description) : id = Random().nextInt(1000000);
-}
-
-List _images = [];
-Map> categoryImagesMap = {};
-
-class AddAtmosphericEquipmentScreen extends StatefulWidget {
- final String areaName;
- final String localName;
- final int localId;
- final int systemId;
- final int areaId;
-
- const AddAtmosphericEquipmentScreen({
- super.key,
- required this.areaName,
- required this.systemId,
- required this.localName,
- required this.localId,
- required this.areaId,
- });
-
- @override
- _AddEquipmentScreenState createState() => _AddEquipmentScreenState();
-}
-
-class _AddEquipmentScreenState extends State {
- EquipmentService equipmentService = EquipmentService();
- EquipmentPhotoService equipmentPhotoService = EquipmentPhotoService();
- PersonalEquipmentCategoryService personalEquipmentCategoryService =
- PersonalEquipmentCategoryService();
- GenericEquipmentCategoryService genericEquipmentCategoryService =
- GenericEquipmentCategoryService();
-
- final _equipmentQuantityController = TextEditingController();
- String? _selectedType;
- String? _selectedTypeToDelete;
- String? _newEquipmentTypeName;
- int? _selectedGenericEquipmentCategoryId;
- int? _selectedPersonalEquipmentCategoryId;
- bool _isPersonalEquipmentCategorySelected = false;
-
- List> genericEquipmentTypes = [];
- List> personalEquipmentTypes = [];
- Map personalEquipmentMap = {};
-
- @override
- void initState() {
- super.initState();
- _fetchEquipmentCategory();
- }
-
- @override
- void didChangeDependencies() {
- super.didChangeDependencies();
- _fetchEquipmentCategory();
- }
-
- Future _fetchEquipmentCategory() async {
- List genericEquipmentCategoryList =
- await genericEquipmentCategoryService
- .getAllGenericEquipmentCategoryBySystem(widget.systemId);
-
- List personalEquipmentCategoryList =
- await personalEquipmentCategoryService
- .getAllPersonalEquipmentCategoryBySystem(widget.systemId);
-
- if (mounted) {
- setState(() {
- genericEquipmentTypes = genericEquipmentCategoryList
- .map((e) => {'id': e.id, 'name': e.name, 'type': 'generico'})
- .toList();
- personalEquipmentTypes = personalEquipmentCategoryList
- .map((e) => {'id': e.id, 'name': e.name, 'type': 'pessoal'})
- .toList();
- personalEquipmentMap = {
- for (var equipment in personalEquipmentCategoryList)
- equipment.name: equipment.id
- };
- });
- }
- }
-
- @override
- void dispose() {
- _equipmentQuantityController.dispose();
- categoryImagesMap[widget.systemId]?.clear();
- super.dispose();
- }
-
- Future _pickImage() async {
- final picker = ImagePicker();
- try {
- final pickedFile = await picker.pickImage(source: ImageSource.camera);
- if (pickedFile != null) {
- _showImageDialog(File(pickedFile.path));
- }
- } catch (e) {
- print('Erro ao capturar a imagem: $e');
- }
- }
-
- void _showImageDialog(File imageFile, {ImageData? existingImage}) {
- TextEditingController descriptionController =
- TextEditingController(text: existingImage?.description ?? '');
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Adicionar descrição da imagem'),
- content: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Image.file(imageFile, width: 100, height: 100, fit: BoxFit.cover),
- TextField(
- controller: descriptionController,
- decoration: const InputDecoration(
- hintText: 'Digite a descrição da imagem (opcional)'),
- ),
- ],
- ),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Salvar'),
- onPressed: () {
- setState(() {
- if (existingImage != null) {
- existingImage.description = descriptionController.text;
- } else {
- final imageData =
- ImageData(imageFile, descriptionController.text);
- final systemId = widget.systemId;
- if (!categoryImagesMap.containsKey(systemId)) {
- categoryImagesMap[systemId] = [];
- }
- categoryImagesMap[systemId]!.add(imageData);
- _images = categoryImagesMap[systemId]!;
- }
- });
- Navigator.of(context).pop();
- },
- ),
- ],
- );
- },
- );
- }
-
- void _addNewEquipmentType() {
- TextEditingController typeController = TextEditingController();
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Adicionar novo tipo de equipamento'),
- content: TextField(
- controller: typeController,
- decoration: const InputDecoration(
- hintText: 'Digite o novo tipo de equipamento'),
- ),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Adicionar'),
- onPressed: () {
- if (typeController.text.isNotEmpty) {
- setState(() {
- _newEquipmentTypeName = typeController.text;
- });
- _registerPersonalEquipmentType().then((_) {
- setState(() {
- _selectedType = null;
- _selectedGenericEquipmentCategoryId = null;
- _fetchEquipmentCategory();
- });
- });
- Navigator.of(context).pop();
- }
- },
- ),
- ],
- );
- },
- );
- }
-
- Future _registerPersonalEquipmentType() async {
- int systemId = widget.systemId;
- PersonalEquipmentCategoryRequestModel personalEquipmentTypeRequestModel =
- PersonalEquipmentCategoryRequestModel(
- name: _newEquipmentTypeName ?? '', system: systemId);
-
- int id = await personalEquipmentCategoryService
- .createPersonalEquipmentCategory(personalEquipmentTypeRequestModel);
-
- if (id != -1) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Equipamento registrado com sucesso.'),
- backgroundColor: Colors.green,
- ),
- );
-
- setState(() {
- personalEquipmentTypes
- .add({'name': _newEquipmentTypeName!, 'id': id, 'type': 'pessoal'});
- personalEquipmentMap[_newEquipmentTypeName!] = id;
- _newEquipmentTypeName = null;
- _fetchEquipmentCategory();
- });
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Falha ao registrar o equipamento.'),
- backgroundColor: Colors.red,
- ),
- );
- }
- }
-
- void _deleteEquipmentType() async {
- if (personalEquipmentTypes.isEmpty) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content:
- Text('Não existem categorias de equipamentos a serem excluídas.'),
- ),
- );
- return;
- }
-
- if (_selectedTypeToDelete == null) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text(
- 'Selecione uma categoria de equipamento válida para excluir.'),
- ),
- );
- return;
- }
-
- int personalCategoryId = personalEquipmentMap[_selectedTypeToDelete]!;
-
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Confirmar Exclusão'),
- content:
- const Text('Tem certeza de que deseja excluir este equipamento?'),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Excluir'),
- onPressed: () async {
- Navigator.of(context).pop();
- bool success = await personalEquipmentCategoryService
- .deletePersonalEquipmentCategory(personalCategoryId);
-
- if (success) {
- setState(() {
- personalEquipmentTypes.removeWhere(
- (element) => element['name'] == _selectedTypeToDelete);
- _selectedTypeToDelete = null;
- _fetchEquipmentCategory();
- });
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Equipamento excluído com sucesso.'),
- backgroundColor: Colors.green,
- ),
- );
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Falha ao excluir o equipamento.'),
- backgroundColor: Colors.red,
- ),
- );
- }
- },
- ),
- ],
- );
- },
- );
- }
-
- void _showConfirmationDialog() {
- if (_equipmentQuantityController.text.isEmpty ||
- (_selectedType == null && _newEquipmentTypeName == null)) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Por favor, preencha todos os campos.'),
- ),
- );
- return;
- }
-
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Confirmar Dados do Equipamento'),
- content: SingleChildScrollView(
- child: ListBody(
- children: [
- const Text('Tipo:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_selectedType ?? _newEquipmentTypeName ?? ''),
- const SizedBox(height: 10),
- const Text('Quantidade:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_equipmentQuantityController.text),
- const SizedBox(height: 10),
- const Text('Imagens:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Wrap(
- children: _images.map((imageData) {
- return Padding(
- padding: const EdgeInsets.all(4.0),
- child: GestureDetector(
- onTap: () => _showImageDialog(imageData.imageFile,
- existingImage: imageData),
- child: Column(
- children: [
- Image.file(
- imageData.imageFile,
- width: 100,
- height: 100,
- fit: BoxFit.cover,
- ),
- Text(imageData.description),
- ],
- ),
- ),
- );
- }).toList(),
- ),
- ],
- ),
- ),
- actions: [
- TextButton(
- child: const Text('Editar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Adicionar'),
- onPressed: () {
- _registerEquipment();
- },
- ),
- ],
- );
- },
- );
- }
-
- void _registerEquipment() async {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
-
- if (_isPersonalEquipmentCategorySelected) {
- genericEquipmentCategory = null;
- personalEquipmentCategory = _selectedPersonalEquipmentCategoryId;
- } else {
- genericEquipmentCategory = _selectedGenericEquipmentCategoryId;
- personalEquipmentCategory = null;
- }
-
- final AtmosphericRequestModel atmosphericModel = AtmosphericRequestModel(
- area: widget.areaId,
- system: widget.systemId,
- );
-
- final AtmosphericEquipmentRequestModel atmosphericEquipmentDetail =
- AtmosphericEquipmentRequestModel(
- genericEquipmentCategory: genericEquipmentCategory,
- personalEquipmentCategory: personalEquipmentCategory,
- atmosphericRequestModel: atmosphericModel,
- );
-
- int? equipmentId =
- await equipmentService.createAtmospheric(atmosphericEquipmentDetail);
-
- if (equipmentId != null) {
- await Future.wait(_images.map((imageData) async {
- await equipmentPhotoService.createPhoto(
- EquipmentPhotoRequestModel(
- photo: imageData.imageFile,
- description: imageData.description,
- equipment: equipmentId,
- ),
- );
- }));
-
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Detalhes do equipamento registrados com sucesso.'),
- backgroundColor: Colors.green,
- ),
- );
- Navigator.pushReplacementNamed(
- context,
- '/listatmosphericEquipment',
- arguments: {
- 'areaName': widget.areaName,
- 'systemId': widget.systemId,
- 'localName': widget.localName,
- 'localId': widget.localId,
- 'areaId': widget.areaId,
- },
- );
- setState(() {
- _equipmentQuantityController.clear();
- _selectedType = null;
- _selectedPersonalEquipmentCategoryId = null;
- _selectedGenericEquipmentCategoryId = null;
- _images.clear();
- });
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Falha ao registrar os detalhes do equipamento.'),
- backgroundColor: Colors.red,
- ),
- );
- }
- }
-
- @override
- Widget build(BuildContext context) {
- List> combinedTypes = [
- ...genericEquipmentTypes,
- ...personalEquipmentTypes
- ];
-
- return Scaffold(
- appBar: AppBar(
- backgroundColor: AppColors.sigeIeBlue,
- foregroundColor: Colors.white,
- leading: IconButton(
- icon: const Icon(Icons.arrow_back, color: Colors.white),
- onPressed: () {
- setState(() {
- _equipmentQuantityController.clear();
- _selectedType = null;
- _selectedPersonalEquipmentCategoryId = null;
- _selectedGenericEquipmentCategoryId = null;
- _images.clear();
- });
- Navigator.pushReplacementNamed(
- context,
- '/listatmosphericEquipment',
- arguments: {
- 'areaName': widget.areaName,
- 'systemId': widget.systemId,
- 'localName': widget.localName,
- 'localId': widget.localId,
- 'areaId': widget.areaId,
- },
- );
- },
- ),
- ),
- body: SingleChildScrollView(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: double.infinity,
- padding: const EdgeInsets.fromLTRB(10, 10, 10, 35),
- decoration: const BoxDecoration(
- color: AppColors.sigeIeBlue,
- borderRadius:
- BorderRadius.vertical(bottom: Radius.circular(20)),
- ),
- child: const Center(
- child: Text('Adicionar equipamento',
- style: TextStyle(
- fontSize: 26,
- fontWeight: FontWeight.bold,
- color: Colors.white)),
- ),
- ),
- Padding(
- padding: const EdgeInsets.all(20.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text('Tipos de equipamento',
- style:
- TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
- const SizedBox(height: 8),
- Row(
- children: [
- Expanded(
- flex: 4,
- child: _buildStyledDropdown(
- items: [
- {
- 'name': 'Selecione o tipo de equipamento',
- 'id': -1,
- 'type': -1
- }
- ] +
- combinedTypes,
- value: _selectedType,
- onChanged: (newValue) {
- if (newValue != 'Selecione o tipo de equipamento') {
- setState(() {
- _selectedType = newValue;
- Map selected =
- combinedTypes.firstWhere((element) =>
- element['name'] == newValue);
- _isPersonalEquipmentCategorySelected =
- selected['type'] == 'pessoal';
- if (_isPersonalEquipmentCategorySelected) {
- _selectedPersonalEquipmentCategoryId =
- selected['id'] as int;
- _selectedGenericEquipmentCategoryId = null;
- } else {
- _selectedGenericEquipmentCategoryId =
- selected['id'] as int;
- _selectedPersonalEquipmentCategoryId = null;
- }
- });
- }
- },
- enabled: true,
- ),
- ),
- Expanded(
- flex: 0,
- child: Row(
- children: [
- IconButton(
- icon: const Icon(Icons.add),
- onPressed: _addNewEquipmentType,
- ),
- IconButton(
- icon: const Icon(Icons.delete),
- onPressed: () {
- if (personalEquipmentTypes.isEmpty) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text(
- 'Não existem equipamentos pessoais a serem excluídos.'),
- ),
- );
- } else {
- setState(() {
- _selectedTypeToDelete = null;
- });
- _showDeleteDialog();
- }
- },
- ),
- ],
- ),
- ),
- ],
- ),
- const SizedBox(height: 8),
- TextButton(
- onPressed: () {
- setState(() {
- _selectedType = null;
- });
- },
- child: const Text('Limpar seleção'),
- ),
- const SizedBox(height: 30),
- const Text('Quantidade',
- style:
- TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
- const SizedBox(height: 8),
- Container(
- decoration: BoxDecoration(
- color: Colors.grey[300],
- borderRadius: BorderRadius.circular(10),
- ),
- child: TextField(
- controller: _equipmentQuantityController,
- keyboardType: TextInputType.number,
- inputFormatters: [
- FilteringTextInputFormatter.digitsOnly
- ],
- decoration: const InputDecoration(
- border: InputBorder.none,
- contentPadding:
- EdgeInsets.symmetric(horizontal: 10, vertical: 15),
- ),
- ),
- ),
- const SizedBox(height: 15),
- IconButton(
- icon: const Icon(Icons.camera_alt),
- onPressed: _pickImage,
- ),
- Wrap(
- children: _images.map((imageData) {
- return Stack(
- alignment: Alignment.topRight,
- children: [
- GestureDetector(
- onTap: () => _showImageDialog(imageData.imageFile,
- existingImage: imageData),
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: Image.file(
- imageData.imageFile,
- width: 100,
- height: 100,
- fit: BoxFit.cover,
- ),
- ),
- ),
- IconButton(
- icon: const Icon(Icons.remove_circle,
- color: AppColors.warn),
- onPressed: () {
- setState(() {
- _images.removeWhere(
- (element) => element.id == imageData.id);
- });
- },
- ),
- ],
- );
- }).toList(),
- ),
- const SizedBox(height: 15),
- Center(
- child: ElevatedButton(
- style: ButtonStyle(
- backgroundColor:
- MaterialStateProperty.all(AppColors.sigeIeYellow),
- foregroundColor:
- MaterialStateProperty.all(AppColors.sigeIeBlue),
- minimumSize:
- MaterialStateProperty.all(const Size(185, 55)),
- shape:
- MaterialStateProperty.all(RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10),
- ))),
- onPressed: _showConfirmationDialog,
- child: const Text(
- 'ADICIONAR EQUIPAMENTO',
- style: TextStyle(
- fontSize: 17, fontWeight: FontWeight.bold),
- ),
- ),
- )
- ],
- ),
- ),
- ],
- ),
- ),
- );
- }
-
- void _showDeleteDialog() {
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Excluir tipo de equipamento'),
- content: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- const Text(
- 'Selecione um equipamento para excluir:',
- textAlign: TextAlign.center,
- ),
- StatefulBuilder(
- builder: (BuildContext context, StateSetter setState) {
- return DropdownButton(
- isExpanded: true,
- value: _selectedTypeToDelete,
- onChanged: (String? newValue) {
- setState(() {
- _selectedTypeToDelete = newValue;
- });
- },
- items: personalEquipmentTypes.map>(
- (Map value) {
- return DropdownMenuItem(
- value: value['name'] as String,
- child: Text(
- value['name'] as String,
- style: const TextStyle(color: Colors.black),
- ),
- );
- }).toList(),
- );
- },
- ),
- ],
- ),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Excluir'),
- onPressed: () {
- if (_selectedTypeToDelete != null) {
- Navigator.of(context).pop();
- _deleteEquipmentType();
- }
- },
- ),
- ],
- );
- },
- );
- }
-
- Widget _buildStyledDropdown({
- required List> items,
- String? value,
- required Function(String?) onChanged,
- bool enabled = true,
- }) {
- return Container(
- decoration: BoxDecoration(
- color: enabled ? Colors.grey[300] : Colors.grey[200],
- borderRadius: BorderRadius.circular(10),
- ),
- padding: const EdgeInsets.symmetric(horizontal: 10),
- child: DropdownButton(
- hint: Text(items.first['name'] as String,
- style: const TextStyle(color: Colors.grey)),
- value: value,
- isExpanded: true,
- underline: Container(),
- onChanged: enabled ? onChanged : null,
- items: items.map>((Map value) {
- return DropdownMenuItem(
- value: value['name'] as String,
- enabled: value['name'] != 'Selecione o tipo de equipamento',
- child: Text(
- value['name'] as String,
- style: TextStyle(
- color: value['name'] == 'Selecione o tipo de equipamento'
- ? Colors.grey
- : Colors.black,
- ),
- ),
- );
- }).toList(),
- ),
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/feature/atmospheric-discharges/atmospheric_discharges_list.dart b/frontend/sige_ie/lib/equipments/feature/atmospheric-discharges/atmospheric_discharges_list.dart
deleted file mode 100644
index 67a461b8..00000000
--- a/frontend/sige_ie/lib/equipments/feature/atmospheric-discharges/atmospheric_discharges_list.dart
+++ /dev/null
@@ -1,206 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:sige_ie/config/app_styles.dart';
-import 'package:sige_ie/equipments/data/atmospheric/atmospheric_service.dart';
-import 'package:sige_ie/equipments/feature/atmospheric-discharges/add_atmospheric_discharges_equipment.dart';
-
-class ListAtmosphericEquipment extends StatefulWidget {
- final String areaName;
- final String localName;
- final int systemId;
- final int localId;
- final int areaId;
-
- const ListAtmosphericEquipment({
- Key? key,
- required this.areaName,
- required this.systemId,
- required this.localName,
- required this.localId,
- required this.areaId,
- }) : super(key: key);
-
- @override
- _ListAtmosphericEquipmentState createState() =>
- _ListAtmosphericEquipmentState();
-}
-
-class _ListAtmosphericEquipmentState extends State {
- List equipmentList = [];
- bool isLoading = true;
- final AtmosphericEquipmentService _service = AtmosphericEquipmentService();
-
- @override
- void initState() {
- super.initState();
- fetchEquipmentList();
- }
-
- Future fetchEquipmentList() async {
- try {
- final List equipmentList =
- await _service.getAtmosphericListByArea(widget.areaId);
- if (mounted) {
- setState(() {
- this.equipmentList = equipmentList;
- isLoading = false;
- });
- }
- } catch (e) {
- print('Error fetching equipment list: $e');
- if (mounted) {
- setState(() {
- isLoading = false;
- });
- }
- }
- }
-
- void navigateToAddEquipment(BuildContext context) {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => AddAtmosphericEquipmentScreen(
- areaName: widget.areaName,
- systemId: widget.systemId,
- localName: widget.localName,
- localId: widget.localId,
- areaId: widget.areaId,
- ),
- ),
- );
- }
-
- void _editEquipment(BuildContext context, String equipment) {
- // Implement the logic to edit the equipment
- }
-
- void _deleteEquipment(BuildContext context, String equipment) {
- // Implement the logic to delete the equipment
- }
-
- @override
- Widget build(BuildContext context) {
- String systemTitle = 'Descargas Atmosféricas';
-
- return Scaffold(
- appBar: AppBar(
- backgroundColor: AppColors.sigeIeBlue,
- leading: IconButton(
- icon: const Icon(Icons.arrow_back, color: Colors.white),
- onPressed: () {
- Navigator.pushReplacementNamed(
- context,
- '/systemLocation',
- arguments: {
- 'areaName': widget.areaName,
- 'localName': widget.localName,
- 'localId': widget.localId,
- 'areaId': widget.areaId,
- },
- );
- },
- ),
- ),
- body: SingleChildScrollView(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- Container(
- padding: const EdgeInsets.fromLTRB(10, 10, 10, 35),
- decoration: const BoxDecoration(
- color: AppColors.sigeIeBlue,
- borderRadius:
- BorderRadius.vertical(bottom: Radius.circular(20)),
- ),
- child: Center(
- child: Text(
- '${widget.areaName} - $systemTitle',
- textAlign: TextAlign.center,
- style: const TextStyle(
- fontSize: 26,
- fontWeight: FontWeight.bold,
- color: AppColors.lightText,
- ),
- ),
- ),
- ),
- const SizedBox(height: 20),
- Padding(
- padding: const EdgeInsets.all(20),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- isLoading
- ? const Center(
- child: CircularProgressIndicator(),
- )
- : equipmentList.isNotEmpty
- ? Column(
- children: equipmentList.map((equipment) {
- return Container(
- margin:
- const EdgeInsets.symmetric(vertical: 5),
- child: Container(
- padding: const EdgeInsets.all(10),
- decoration: BoxDecoration(
- color: AppColors.sigeIeBlue,
- borderRadius: BorderRadius.circular(10),
- ),
- child: Row(
- children: [
- Expanded(
- child: Padding(
- padding:
- const EdgeInsets.only(left: 10),
- child: Text(
- equipment,
- style: const TextStyle(
- color: Colors.white,
- fontSize: 18,
- ),
- ),
- ),
- ),
- IconButton(
- icon: const Icon(Icons.edit,
- color: Colors.blue),
- onPressed: () => _editEquipment(
- context, equipment),
- ),
- IconButton(
- icon: const Icon(Icons.delete,
- color: Colors.red),
- onPressed: () => _deleteEquipment(
- context, equipment),
- ),
- ],
- ),
- ),
- );
- }).toList(),
- )
- : const Center(
- child: Text(
- 'Você ainda não tem equipamentos',
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.bold,
- color: Colors.black54,
- ),
- ),
- ),
- const SizedBox(height: 40),
- ],
- ),
- ),
- ],
- ),
- ),
- floatingActionButton: FloatingActionButton(
- onPressed: () => navigateToAddEquipment(context),
- backgroundColor: AppColors.sigeIeYellow,
- child: const Icon(Icons.add, color: AppColors.sigeIeBlue),
- ),
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/feature/distribuition_board/add_distribuition_board.dart b/frontend/sige_ie/lib/equipments/feature/distribuition_board/add_distribuition_board.dart
deleted file mode 100644
index 9af8f245..00000000
--- a/frontend/sige_ie/lib/equipments/feature/distribuition_board/add_distribuition_board.dart
+++ /dev/null
@@ -1,940 +0,0 @@
-import 'dart:io';
-import 'dart:math';
-import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
-import 'package:image_picker/image_picker.dart';
-import 'package:sige_ie/config/app_styles.dart';
-import 'package:sige_ie/equipments/data/distribution/distribution_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/distribution/distribution_request_model.dart';
-import 'package:sige_ie/equipments/data/equipment_service.dart';
-import 'package:sige_ie/shared/data/equipment-photo/equipment_photo_request_model.dart';
-import 'package:sige_ie/shared/data/equipment-photo/equipment_photo_service.dart';
-import 'package:sige_ie/shared/data/generic-equipment-category/generic_equipment_category_response_model.dart';
-import 'package:sige_ie/shared/data/generic-equipment-category/generic_equipment_category_service.dart';
-import 'package:sige_ie/shared/data/personal-equipment-category/personal_equipment_category_request_model.dart';
-import 'package:sige_ie/shared/data/personal-equipment-category/personal_equipment_category_service.dart';
-
-class ImageData {
- int id;
- File imageFile;
- String description;
-
- ImageData(this.imageFile, this.description) : id = Random().nextInt(1000000);
-}
-
-List _images = [];
-Map> categoryImagesMap = {};
-
-class AddDistribuitionBoard extends StatefulWidget {
- final String areaName;
- final String localName;
- final int localId;
- final int systemId;
- final int areaId;
-
- const AddDistribuitionBoard({
- super.key,
- required this.areaName,
- required this.systemId,
- required this.localName,
- required this.localId,
- required this.areaId,
- });
-
- @override
- _AddDistribuitionBoardState createState() => _AddDistribuitionBoardState();
-}
-
-class _AddDistribuitionBoardState extends State {
- EquipmentService equipmentService = EquipmentService();
- EquipmentPhotoService equipmentPhotoService = EquipmentPhotoService();
- PersonalEquipmentCategoryService personalEquipmentCategoryService =
- PersonalEquipmentCategoryService();
- GenericEquipmentCategoryService genericEquipmentCategoryService =
- GenericEquipmentCategoryService();
-
- final _equipmentChargeController = TextEditingController();
- final _equipmentQuantityController = TextEditingController();
- final _powerController = TextEditingController();
- final _typeMaterialController = TextEditingController();
- final _methodInstallationController = TextEditingController();
- bool _dr = false;
- bool _dps = false;
- bool _grounding = false;
- String? _selectedType;
- String? _selectedTypeToDelete;
- String? _newEquipmentTypeName;
- int? _selectedGenericEquipmentCategoryId;
- int? _selectedPersonalEquipmentCategoryId;
- bool _isPersonalEquipmentCategorySelected = false;
-
- List> genericEquipmentTypes = [];
- List> personalEquipmentTypes = [];
- Map personalEquipmentMap = {};
-
- @override
- void initState() {
- super.initState();
- _fetchEquipmentCategory();
- }
-
- @override
- void didChangeDependencies() {
- super.didChangeDependencies();
- _fetchEquipmentCategory();
- }
-
- Future _fetchEquipmentCategory() async {
- List genericEquipmentCategoryList =
- await genericEquipmentCategoryService
- .getAllGenericEquipmentCategoryBySystem(widget.systemId);
-
- List personalEquipmentCategoryList =
- await personalEquipmentCategoryService
- .getAllPersonalEquipmentCategoryBySystem(widget.systemId);
-
- if (mounted) {
- setState(() {
- genericEquipmentTypes = genericEquipmentCategoryList
- .map((e) => {'id': e.id, 'name': e.name, 'type': 'generico'})
- .toList();
- personalEquipmentTypes = personalEquipmentCategoryList
- .map((e) => {'id': e.id, 'name': e.name, 'type': 'pessoal'})
- .toList();
- personalEquipmentMap = {
- for (var equipment in personalEquipmentCategoryList)
- equipment.name: equipment.id
- };
- });
- }
- }
-
- @override
- void dispose() {
- _equipmentChargeController.dispose();
- _equipmentQuantityController.dispose();
- _powerController.dispose();
- _typeMaterialController.dispose();
- _methodInstallationController.dispose();
- categoryImagesMap[widget.systemId]?.clear();
- super.dispose();
- }
-
- Future _pickImage() async {
- final picker = ImagePicker();
- try {
- final pickedFile = await picker.pickImage(source: ImageSource.camera);
- if (pickedFile != null) {
- _showImageDialog(File(pickedFile.path));
- }
- } catch (e) {
- print('Erro ao capturar a imagem: $e');
- }
- }
-
- void _showImageDialog(File imageFile, {ImageData? existingImage}) {
- TextEditingController descriptionController =
- TextEditingController(text: existingImage?.description ?? '');
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Adicionar descrição da imagem'),
- content: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Image.file(imageFile, width: 100, height: 100, fit: BoxFit.cover),
- TextField(
- controller: descriptionController,
- decoration: const InputDecoration(
- hintText: 'Digite a descrição da imagem (opcional)'),
- ),
- ],
- ),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Salvar'),
- onPressed: () {
- setState(() {
- if (existingImage != null) {
- existingImage.description = descriptionController.text;
- } else {
- final imageData =
- ImageData(imageFile, descriptionController.text);
- final systemId = widget.systemId;
- if (!categoryImagesMap.containsKey(systemId)) {
- categoryImagesMap[systemId] = [];
- }
- categoryImagesMap[systemId]!.add(imageData);
- _images = categoryImagesMap[systemId]!;
- }
- });
- Navigator.of(context).pop();
- },
- ),
- ],
- );
- },
- );
- }
-
- void _addNewEquipmentType() {
- TextEditingController typeController = TextEditingController();
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Adicionar novo tipo de equipamento'),
- content: TextField(
- controller: typeController,
- decoration: const InputDecoration(
- hintText: 'Digite o novo tipo de equipamento'),
- ),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Adicionar'),
- onPressed: () {
- if (typeController.text.isNotEmpty) {
- setState(() {
- _newEquipmentTypeName = typeController.text;
- });
- _registerPersonalEquipmentType().then((_) {
- setState(() {
- _selectedType = null;
- _selectedGenericEquipmentCategoryId = null;
- _fetchEquipmentCategory();
- });
- });
- Navigator.of(context).pop();
- }
- },
- ),
- ],
- );
- },
- );
- }
-
- Future _registerPersonalEquipmentType() async {
- int systemId = widget.systemId;
- PersonalEquipmentCategoryRequestModel personalEquipmentTypeRequestModel =
- PersonalEquipmentCategoryRequestModel(
- name: _newEquipmentTypeName ?? '', system: systemId);
-
- int id = await personalEquipmentCategoryService
- .createPersonalEquipmentCategory(personalEquipmentTypeRequestModel);
-
- if (id != -1) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Equipamento registrado com sucesso.'),
- backgroundColor: Colors.green,
- ),
- );
-
- setState(() {
- personalEquipmentTypes
- .add({'name': _newEquipmentTypeName!, 'id': id, 'type': 'pessoal'});
- personalEquipmentMap[_newEquipmentTypeName!] = id;
- _newEquipmentTypeName = null;
- _fetchEquipmentCategory();
- });
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Falha ao registrar o equipamento.'),
- backgroundColor: Colors.red,
- ),
- );
- }
- }
-
- void _deleteEquipmentType() async {
- if (personalEquipmentTypes.isEmpty) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content:
- Text('Não existem categorias de equipamentos a serem excluídas.'),
- ),
- );
- return;
- }
-
- if (_selectedTypeToDelete == null) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text(
- 'Selecione uma categoria de equipamento válida para excluir.'),
- ),
- );
- return;
- }
-
- int equipmentId = personalEquipmentMap[_selectedTypeToDelete]!;
-
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Confirmar Exclusão'),
- content:
- const Text('Tem certeza de que deseja excluir este equipamento?'),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Excluir'),
- onPressed: () async {
- Navigator.of(context).pop();
- bool success = await personalEquipmentCategoryService
- .deletePersonalEquipmentCategory(equipmentId);
-
- if (success) {
- setState(() {
- personalEquipmentTypes.removeWhere(
- (element) => element['name'] == _selectedTypeToDelete);
- _selectedTypeToDelete = null;
- _fetchEquipmentCategory();
- });
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Equipamento excluído com sucesso.'),
- backgroundColor: Colors.green,
- ),
- );
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Falha ao excluir o equipamento.'),
- backgroundColor: Colors.red,
- ),
- );
- }
- },
- ),
- ],
- );
- },
- );
- }
-
- void _showConfirmationDialog() {
- if (_equipmentChargeController.text.isEmpty ||
- _equipmentQuantityController.text.isEmpty ||
- (_selectedType == null && _newEquipmentTypeName == null)) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Por favor, preencha todos os campos.'),
- ),
- );
- return;
- }
-
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Confirmar Dados do Equipamento'),
- content: SingleChildScrollView(
- child: ListBody(
- children: [
- const Text('Tipo:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_selectedType ?? _newEquipmentTypeName ?? ''),
- const SizedBox(height: 10),
- const Text('Especificação:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_equipmentChargeController.text),
- const SizedBox(height: 10),
- const Text('Quantidade:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_equipmentQuantityController.text),
- const SizedBox(height: 10),
- const Text('Imagens:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Wrap(
- children: _images.map((imageData) {
- return Padding(
- padding: const EdgeInsets.all(4.0),
- child: GestureDetector(
- onTap: () => _showImageDialog(imageData.imageFile,
- existingImage: imageData),
- child: Column(
- children: [
- Image.file(
- imageData.imageFile,
- width: 100,
- height: 100,
- fit: BoxFit.cover,
- ),
- Text(imageData.description),
- ],
- ),
- ),
- );
- }).toList(),
- ),
- ],
- ),
- ),
- actions: [
- TextButton(
- child: const Text('Editar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Adicionar'),
- onPressed: () {
- _registerEquipment();
- },
- ),
- ],
- );
- },
- );
- }
-
- void _registerEquipment() async {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
-
- if (_isPersonalEquipmentCategorySelected) {
- genericEquipmentCategory = null;
- personalEquipmentCategory = _selectedPersonalEquipmentCategoryId;
- } else {
- genericEquipmentCategory = _selectedGenericEquipmentCategoryId;
- personalEquipmentCategory = null;
- }
-
- final DistributionRequestModel distributionModel = DistributionRequestModel(
- area: widget.areaId,
- system: widget.systemId,
- );
-
- final DistributionEquipmentRequestModel distributionEquipmentDetail =
- DistributionEquipmentRequestModel(
- genericEquipmentCategory: genericEquipmentCategory,
- personalEquipmentCategory: personalEquipmentCategory,
- distributionRequestModel: distributionModel,
- power: _powerController.text,
- dr: _dr,
- dps: _dps,
- grounding: _grounding,
- typeMaterial: _typeMaterialController.text,
- methodInstallation: _methodInstallationController.text,
- );
-
- int? equipmentId =
- await equipmentService.createDistribution(distributionEquipmentDetail);
-
- if (equipmentId != null) {
- await Future.wait(_images.map((imageData) async {
- await equipmentPhotoService.createPhoto(
- EquipmentPhotoRequestModel(
- photo: imageData.imageFile,
- description: imageData.description,
- equipment: equipmentId,
- ),
- );
- }));
-
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Detalhes do equipamento registrados com sucesso.'),
- backgroundColor: Colors.green,
- ),
- );
- Navigator.pushReplacementNamed(
- context,
- '/listDistribuitionBoard',
- arguments: {
- 'areaName': widget.areaName,
- 'systemId': widget.systemId,
- 'localName': widget.localName,
- 'localId': widget.localId,
- 'areaId': widget.areaId,
- },
- );
- setState(() {
- _equipmentChargeController.clear();
- _equipmentQuantityController.clear();
- _powerController.clear();
- _typeMaterialController.clear();
- _methodInstallationController.clear();
- _dr = false;
- _dps = false;
- _grounding = false;
- _selectedType = null;
- _selectedPersonalEquipmentCategoryId = null;
- _selectedGenericEquipmentCategoryId = null;
- _images.clear();
- });
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Falha ao registrar os detalhes do equipamento.'),
- backgroundColor: Colors.red,
- ),
- );
- }
- }
-
- @override
- Widget build(BuildContext context) {
- List> combinedTypes = [
- ...genericEquipmentTypes,
- ...personalEquipmentTypes
- ];
-
- return Scaffold(
- appBar: AppBar(
- backgroundColor: AppColors.sigeIeBlue,
- foregroundColor: Colors.white,
- leading: IconButton(
- icon: const Icon(Icons.arrow_back, color: Colors.white),
- onPressed: () {
- setState(() {
- _equipmentChargeController.clear();
- _equipmentQuantityController.clear();
- _powerController.clear();
- _typeMaterialController.clear();
- _methodInstallationController.clear();
- _dr = false;
- _dps = false;
- _grounding = false;
- _selectedType = null;
- _selectedPersonalEquipmentCategoryId = null;
- _selectedGenericEquipmentCategoryId = null;
- _images.clear();
- });
- Navigator.pushReplacementNamed(
- context,
- '/listDistribuitionBoard',
- arguments: {
- 'areaName': widget.areaName,
- 'systemId': widget.systemId,
- 'localName': widget.localName,
- 'localId': widget.localId,
- 'areaId': widget.areaId,
- },
- );
- },
- ),
- ),
- body: SingleChildScrollView(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: double.infinity,
- padding: const EdgeInsets.fromLTRB(10, 10, 10, 35),
- decoration: const BoxDecoration(
- color: AppColors.sigeIeBlue,
- borderRadius:
- BorderRadius.vertical(bottom: Radius.circular(20)),
- ),
- child: const Center(
- child: Text('Adicionar equipamento',
- style: TextStyle(
- fontSize: 26,
- fontWeight: FontWeight.bold,
- color: Colors.white)),
- ),
- ),
- Padding(
- padding: const EdgeInsets.all(20.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text('Tipos de equipamento',
- style:
- TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
- const SizedBox(height: 8),
- Row(
- children: [
- Expanded(
- flex: 4,
- child: _buildStyledDropdown(
- items: [
- {
- 'name': 'Selecione o tipo de equipamento',
- 'id': -1,
- 'type': -1
- }
- ] +
- combinedTypes,
- value: _selectedType,
- onChanged: (newValue) {
- if (newValue != 'Selecione o tipo de equipamento') {
- setState(() {
- _selectedType = newValue;
- Map selected =
- combinedTypes.firstWhere((element) =>
- element['name'] == newValue);
- _isPersonalEquipmentCategorySelected =
- selected['type'] == 'pessoal';
- if (_isPersonalEquipmentCategorySelected) {
- _selectedPersonalEquipmentCategoryId =
- selected['id'] as int;
- _selectedGenericEquipmentCategoryId = null;
- } else {
- _selectedGenericEquipmentCategoryId =
- selected['id'] as int;
- _selectedPersonalEquipmentCategoryId = null;
- }
- });
- }
- },
- enabled: true,
- ),
- ),
- Expanded(
- flex: 0,
- child: Row(
- children: [
- IconButton(
- icon: const Icon(Icons.add),
- onPressed: _addNewEquipmentType,
- ),
- IconButton(
- icon: const Icon(Icons.delete),
- onPressed: () {
- if (personalEquipmentTypes.isEmpty) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text(
- 'Não existem equipamentos pessoais a serem excluídos.'),
- ),
- );
- } else {
- setState(() {
- _selectedTypeToDelete = null;
- });
- _showDeleteDialog();
- }
- },
- ),
- ],
- ),
- ),
- ],
- ),
- TextButton(
- onPressed: () {
- setState(() {
- _selectedType = null;
- });
- },
- child: const Text('Limpar seleção'),
- ),
- const SizedBox(height: 8),
- const Text('Quantidade',
- style:
- TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
- const SizedBox(height: 8),
- Container(
- decoration: BoxDecoration(
- color: Colors.grey[300],
- borderRadius: BorderRadius.circular(10),
- ),
- child: TextField(
- controller: _equipmentQuantityController,
- keyboardType: TextInputType.number,
- inputFormatters: [
- FilteringTextInputFormatter.digitsOnly
- ],
- decoration: const InputDecoration(
- border: InputBorder.none,
- contentPadding:
- EdgeInsets.symmetric(horizontal: 10, vertical: 15),
- ),
- ),
- ),
- const SizedBox(height: 15),
- const Text('Potência',
- style:
- TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
- const SizedBox(height: 8),
- Container(
- decoration: BoxDecoration(
- color: Colors.grey[300],
- borderRadius: BorderRadius.circular(10),
- ),
- child: TextField(
- controller: _powerController,
- decoration: const InputDecoration(
- border: InputBorder.none,
- contentPadding:
- EdgeInsets.symmetric(horizontal: 10, vertical: 15),
- ),
- ),
- ),
- const SizedBox(height: 15),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- const Text('DR', style: TextStyle(fontSize: 16)),
- Checkbox(
- value: _dr,
- onChanged: (bool? newValue) {
- setState(() {
- _dr = newValue ?? false;
- });
- },
- ),
- ],
- ),
- Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- const Text('DPS', style: TextStyle(fontSize: 16)),
- Checkbox(
- value: _dps,
- onChanged: (bool? newValue) {
- setState(() {
- _dps = newValue ?? false;
- });
- },
- ),
- ],
- ),
- Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- const Text('Aterramento',
- style: TextStyle(fontSize: 16)),
- Checkbox(
- value: _grounding,
- onChanged: (bool? newValue) {
- setState(() {
- _grounding = newValue ?? false;
- });
- },
- ),
- ],
- ),
- ],
- ),
- const Text('Tipo de Material',
- style:
- TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
- const SizedBox(height: 8),
- Container(
- decoration: BoxDecoration(
- color: Colors.grey[300],
- borderRadius: BorderRadius.circular(10),
- ),
- child: TextField(
- controller: _typeMaterialController,
- decoration: const InputDecoration(
- border: InputBorder.none,
- contentPadding:
- EdgeInsets.symmetric(horizontal: 10, vertical: 15),
- ),
- ),
- ),
- const SizedBox(height: 15),
- const Text('Método de Instalação',
- style:
- TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
- const SizedBox(height: 8),
- Container(
- decoration: BoxDecoration(
- color: Colors.grey[300],
- borderRadius: BorderRadius.circular(10),
- ),
- child: TextField(
- controller: _methodInstallationController,
- decoration: const InputDecoration(
- border: InputBorder.none,
- contentPadding:
- EdgeInsets.symmetric(horizontal: 10, vertical: 15),
- ),
- ),
- ),
- const SizedBox(height: 15),
- IconButton(
- icon: const Icon(Icons.camera_alt),
- onPressed: _pickImage,
- ),
- Wrap(
- children: _images.map((imageData) {
- return Stack(
- alignment: Alignment.topRight,
- children: [
- GestureDetector(
- onTap: () => _showImageDialog(imageData.imageFile,
- existingImage: imageData),
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: Image.file(
- imageData.imageFile,
- width: 100,
- height: 100,
- fit: BoxFit.cover,
- ),
- ),
- ),
- IconButton(
- icon: const Icon(Icons.remove_circle,
- color: AppColors.warn),
- onPressed: () {
- setState(() {
- _images.removeWhere(
- (element) => element.id == imageData.id);
- });
- },
- ),
- ],
- );
- }).toList(),
- ),
- const SizedBox(height: 15),
- Center(
- child: ElevatedButton(
- style: ButtonStyle(
- backgroundColor:
- MaterialStateProperty.all(AppColors.sigeIeYellow),
- foregroundColor:
- MaterialStateProperty.all(AppColors.sigeIeBlue),
- minimumSize:
- MaterialStateProperty.all(const Size(185, 55)),
- shape:
- MaterialStateProperty.all(RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10),
- ))),
- onPressed: _showConfirmationDialog,
- child: const Text(
- 'ADICIONAR EQUIPAMENTO',
- style: TextStyle(
- fontSize: 17, fontWeight: FontWeight.bold),
- ),
- ),
- )
- ],
- ),
- ),
- ],
- ),
- ),
- );
- }
-
- void _showDeleteDialog() {
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Excluir tipo de equipamento'),
- content: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- const Text(
- 'Selecione um equipamento para excluir:',
- textAlign: TextAlign.center,
- ),
- StatefulBuilder(
- builder: (BuildContext context, StateSetter setState) {
- return DropdownButton(
- isExpanded: true,
- value: _selectedTypeToDelete,
- onChanged: (String? newValue) {
- setState(() {
- _selectedTypeToDelete = newValue;
- });
- },
- items: personalEquipmentTypes.map>(
- (Map value) {
- return DropdownMenuItem(
- value: value['name'] as String,
- child: Text(
- value['name'] as String,
- style: const TextStyle(color: Colors.black),
- ),
- );
- }).toList(),
- );
- },
- ),
- ],
- ),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Excluir'),
- onPressed: () {
- if (_selectedTypeToDelete != null) {
- Navigator.of(context).pop();
- _deleteEquipmentType();
- }
- },
- ),
- ],
- );
- },
- );
- }
-
- Widget _buildStyledDropdown({
- required List> items,
- String? value,
- required Function(String?) onChanged,
- bool enabled = true,
- }) {
- return Container(
- decoration: BoxDecoration(
- color: enabled ? Colors.grey[300] : Colors.grey[200],
- borderRadius: BorderRadius.circular(10),
- ),
- padding: const EdgeInsets.symmetric(horizontal: 10),
- child: DropdownButton(
- hint: Text(items.first['name'] as String,
- style: const TextStyle(color: Colors.grey)),
- value: value,
- isExpanded: true,
- underline: Container(),
- onChanged: enabled ? onChanged : null,
- items: items.map>((Map value) {
- return DropdownMenuItem(
- value: value['name'] as String,
- enabled: value['name'] != 'Selecione o tipo de equipamento',
- child: Text(
- value['name'] as String,
- style: TextStyle(
- color: value['name'] == 'Selecione o tipo de equipamento'
- ? Colors.grey
- : Colors.black,
- ),
- ),
- );
- }).toList(),
- ),
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/feature/distribuition_board/distribuition_board_equipment_list.dart b/frontend/sige_ie/lib/equipments/feature/distribuition_board/distribuition_board_equipment_list.dart
deleted file mode 100644
index 07cf41c2..00000000
--- a/frontend/sige_ie/lib/equipments/feature/distribuition_board/distribuition_board_equipment_list.dart
+++ /dev/null
@@ -1,205 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:sige_ie/config/app_styles.dart';
-import 'package:sige_ie/equipments/data/distribution/distribution_service.dart';
-import 'package:sige_ie/equipments/feature/distribuition_board/add_distribuition_board.dart';
-
-class ListDistributionBoard extends StatefulWidget {
- final String areaName;
- final String localName;
- final int systemId;
- final int localId;
- final int areaId;
-
- const ListDistributionBoard({
- Key? key,
- required this.areaName,
- required this.systemId,
- required this.localName,
- required this.localId,
- required this.areaId,
- }) : super(key: key);
-
- @override
- _ListDistributionBoardState createState() => _ListDistributionBoardState();
-}
-
-class _ListDistributionBoardState extends State {
- List equipmentList = [];
- bool isLoading = true;
- final DistributionEquipmentService _service = DistributionEquipmentService();
-
- @override
- void initState() {
- super.initState();
- fetchEquipmentList();
- }
-
- Future fetchEquipmentList() async {
- try {
- final List equipmentList =
- await _service.getDistributionListByArea(widget.areaId);
- if (mounted) {
- setState(() {
- this.equipmentList = equipmentList;
- isLoading = false;
- });
- }
- } catch (e) {
- print('Error fetching equipment list: $e');
- if (mounted) {
- setState(() {
- isLoading = false;
- });
- }
- }
- }
-
- void navigateToAddEquipment(BuildContext context) {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => AddDistribuitionBoard(
- areaName: widget.areaName,
- systemId: widget.systemId,
- localName: widget.localName,
- localId: widget.localId,
- areaId: widget.areaId,
- ),
- ),
- );
- }
-
- void _editEquipment(BuildContext context, String equipment) {
- // Implement the logic to edit the equipment
- }
-
- void _deleteEquipment(BuildContext context, String equipment) {
- // Implement the logic to delete the equipment
- }
-
- @override
- Widget build(BuildContext context) {
- String systemTitle = 'Quadro de Distribuição';
-
- return Scaffold(
- appBar: AppBar(
- backgroundColor: AppColors.sigeIeBlue,
- leading: IconButton(
- icon: const Icon(Icons.arrow_back, color: Colors.white),
- onPressed: () {
- Navigator.pushReplacementNamed(
- context,
- '/systemLocation',
- arguments: {
- 'areaName': widget.areaName,
- 'localName': widget.localName,
- 'localId': widget.localId,
- 'areaId': widget.areaId,
- },
- );
- },
- ),
- ),
- body: SingleChildScrollView(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- Container(
- padding: const EdgeInsets.fromLTRB(10, 10, 10, 35),
- decoration: const BoxDecoration(
- color: AppColors.sigeIeBlue,
- borderRadius:
- BorderRadius.vertical(bottom: Radius.circular(20)),
- ),
- child: Center(
- child: Text(
- '${widget.areaName} - $systemTitle',
- textAlign: TextAlign.center,
- style: const TextStyle(
- fontSize: 26,
- fontWeight: FontWeight.bold,
- color: AppColors.lightText,
- ),
- ),
- ),
- ),
- const SizedBox(height: 20),
- Padding(
- padding: const EdgeInsets.all(20),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- isLoading
- ? const Center(
- child: CircularProgressIndicator(),
- )
- : equipmentList.isNotEmpty
- ? Column(
- children: equipmentList.map((equipment) {
- return Container(
- margin:
- const EdgeInsets.symmetric(vertical: 5),
- child: Container(
- padding: const EdgeInsets.all(10),
- decoration: BoxDecoration(
- color: AppColors.sigeIeBlue,
- borderRadius: BorderRadius.circular(10),
- ),
- child: Row(
- children: [
- Expanded(
- child: Padding(
- padding:
- const EdgeInsets.only(left: 10),
- child: Text(
- equipment,
- style: const TextStyle(
- color: Colors.white,
- fontSize: 18,
- ),
- ),
- ),
- ),
- IconButton(
- icon: const Icon(Icons.edit,
- color: Colors.blue),
- onPressed: () => _editEquipment(
- context, equipment),
- ),
- IconButton(
- icon: const Icon(Icons.delete,
- color: Colors.red),
- onPressed: () => _deleteEquipment(
- context, equipment),
- ),
- ],
- ),
- ),
- );
- }).toList(),
- )
- : const Center(
- child: Text(
- 'Você ainda não tem equipamentos',
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.bold,
- color: Colors.black54,
- ),
- ),
- ),
- const SizedBox(height: 40),
- ],
- ),
- ),
- ],
- ),
- ),
- floatingActionButton: FloatingActionButton(
- onPressed: () => navigateToAddEquipment(context),
- backgroundColor: AppColors.sigeIeYellow,
- child: const Icon(Icons.add, color: AppColors.sigeIeBlue),
- ),
- );
- }
-}
diff --git a/frontend/sige_ie/lib/equipments/feature/electrical_circuit/add_electrical_circuit.dart b/frontend/sige_ie/lib/equipments/feature/electrical_circuit/add_electrical_circuit.dart
deleted file mode 100644
index 3dfe3dd3..00000000
--- a/frontend/sige_ie/lib/equipments/feature/electrical_circuit/add_electrical_circuit.dart
+++ /dev/null
@@ -1,907 +0,0 @@
-import 'dart:math';
-import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
-import 'dart:io';
-import 'package:image_picker/image_picker.dart';
-import 'package:sige_ie/config/app_styles.dart';
-import 'package:sige_ie/equipments/data/eletrical_circuit/eletrical_circuit_equipment_request_model.dart';
-import 'package:sige_ie/equipments/data/eletrical_circuit/eletrical_circuit_request_model.dart';
-import 'package:sige_ie/equipments/data/equipment_service.dart';
-import 'package:sige_ie/shared/data/equipment-photo/equipment_photo_request_model.dart';
-import 'package:sige_ie/shared/data/equipment-photo/equipment_photo_service.dart';
-import 'package:sige_ie/shared/data/generic-equipment-category/generic_equipment_category_response_model.dart';
-import 'package:sige_ie/shared/data/generic-equipment-category/generic_equipment_category_service.dart';
-import 'package:sige_ie/shared/data/personal-equipment-category/personal_equipment_category_request_model.dart';
-import 'package:sige_ie/shared/data/personal-equipment-category/personal_equipment_category_service.dart';
-
-class ImageData {
- File imageFile;
- int id;
- String description;
-
- ImageData(this.imageFile, this.description) : id = Random().nextInt(1000000);
-}
-
-List _images = [];
-Map> categoryImagesMap = {};
-
-class AddElectricalCircuitEquipmentScreen extends StatefulWidget {
- final String areaName;
- final String localName;
- final int localId;
- final int systemId;
- final int areaId;
-
- const AddElectricalCircuitEquipmentScreen({
- super.key,
- required this.areaName,
- required this.systemId,
- required this.localName,
- required this.localId,
- required this.areaId,
- });
-
- @override
- _AddElectricalCircuitEquipmentScreenState createState() =>
- _AddElectricalCircuitEquipmentScreenState();
-}
-
-class _AddElectricalCircuitEquipmentScreenState
- extends State {
- EquipmentService equipmentService = EquipmentService();
- EquipmentPhotoService equipmentPhotoService = EquipmentPhotoService();
- PersonalEquipmentCategoryService personalEquipmentCategoryService =
- PersonalEquipmentCategoryService();
- GenericEquipmentCategoryService genericEquipmentCategoryService =
- GenericEquipmentCategoryService();
-
- final _equipmentQuantityController = TextEditingController();
- final _breakerLocationController = TextEditingController();
- final _breakerStateController = TextEditingController();
- final _wireTypeController = TextEditingController();
- final _dimensionController = TextEditingController();
- String? _selectedTypeToDelete;
- String? _selectCircuitType;
- String? _newEquipmentTypeName;
- int? _selectedGenericEquipmentCategoryId;
- int? _selectedPersonalEquipmentCategoryId;
- bool _isPersonalEquipmentCategorySelected = false;
-
- List> genericEquipmentTypes = [];
- List> personalEquipmentTypes = [];
- Map personalEquipmentMap = {};
-
- @override
- void initState() {
- super.initState();
- _fetchEquipmentCategory();
- }
-
- @override
- void didChangeDependencies() {
- super.didChangeDependencies();
- _fetchEquipmentCategory();
- }
-
- Future _fetchEquipmentCategory() async {
- List genericEquipmentCategoryList =
- await genericEquipmentCategoryService
- .getAllGenericEquipmentCategoryBySystem(widget.systemId);
-
- List personalEquipmentCategoryList =
- await personalEquipmentCategoryService
- .getAllPersonalEquipmentCategoryBySystem(widget.systemId);
-
- if (mounted) {
- setState(() {
- genericEquipmentTypes = genericEquipmentCategoryList
- .map((e) => {'id': e.id, 'name': e.name, 'type': 'generico'})
- .toList();
- personalEquipmentTypes = personalEquipmentCategoryList
- .map((e) => {'id': e.id, 'name': e.name, 'type': 'pessoal'})
- .toList();
- personalEquipmentMap = {
- for (var equipment in personalEquipmentCategoryList)
- equipment.name: equipment.id
- };
- });
- }
- }
-
- @override
- void dispose() {
- _equipmentQuantityController.dispose();
- _breakerLocationController.dispose();
- _breakerStateController.dispose();
- _wireTypeController.dispose();
- _dimensionController.dispose();
- categoryImagesMap[widget.systemId]?.clear();
- super.dispose();
- }
-
- Future _pickImage() async {
- final picker = ImagePicker();
- try {
- final pickedFile = await picker.pickImage(source: ImageSource.camera);
- if (pickedFile != null) {
- _showImageDialog(File(pickedFile.path));
- }
- } catch (e) {
- print('Erro ao capturar a imagem: $e');
- }
- }
-
- void _showImageDialog(File imageFile, {ImageData? existingImage}) {
- TextEditingController descriptionController =
- TextEditingController(text: existingImage?.description ?? '');
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Adicionar descrição da imagem'),
- content: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Image.file(imageFile, width: 100, height: 100, fit: BoxFit.cover),
- TextField(
- controller: descriptionController,
- decoration: const InputDecoration(
- hintText: 'Digite a descrição da imagem (opcional)'),
- ),
- ],
- ),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Salvar'),
- onPressed: () {
- setState(() {
- if (existingImage != null) {
- existingImage.description = descriptionController.text;
- } else {
- final imageData =
- ImageData(imageFile, descriptionController.text);
- final systemId = widget.systemId;
- if (!categoryImagesMap.containsKey(systemId)) {
- categoryImagesMap[systemId] = [];
- }
- categoryImagesMap[systemId]!.add(imageData);
- _images = categoryImagesMap[systemId]!;
- }
- });
- Navigator.of(context).pop();
- },
- ),
- ],
- );
- },
- );
- }
-
- void _addNewEquipmentType() {
- TextEditingController typeController = TextEditingController();
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Adicionar novo tipo de Circuito Elétrico'),
- content: TextField(
- controller: typeController,
- decoration: const InputDecoration(
- hintText: 'Digite o novo tipo de Circuito Elétrico'),
- ),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Adicionar'),
- onPressed: () {
- if (typeController.text.isNotEmpty) {
- setState(() {
- _newEquipmentTypeName = typeController.text;
- });
- _registerPersonalEquipmentType().then((_) {
- setState(() {
- _selectCircuitType = null;
- _selectedGenericEquipmentCategoryId = null;
- _fetchEquipmentCategory();
- });
- });
- Navigator.of(context).pop();
- }
- },
- ),
- ],
- );
- },
- );
- }
-
- Future _registerPersonalEquipmentType() async {
- int systemId = widget.systemId;
- PersonalEquipmentCategoryRequestModel personalEquipmentTypeRequestModel =
- PersonalEquipmentCategoryRequestModel(
- name: _newEquipmentTypeName ?? '', system: systemId);
-
- int id = await personalEquipmentCategoryService
- .createPersonalEquipmentCategory(personalEquipmentTypeRequestModel);
-
- if (id != -1) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Equipamento registrado com sucesso.'),
- backgroundColor: Colors.green,
- ),
- );
-
- setState(() {
- personalEquipmentTypes
- .add({'name': _newEquipmentTypeName!, 'id': id, 'type': 'pessoal'});
- personalEquipmentMap[_newEquipmentTypeName!] = id;
- _newEquipmentTypeName = null;
- _fetchEquipmentCategory();
- });
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Falha ao registrar o equipamento.'),
- backgroundColor: Colors.red,
- ),
- );
- }
- }
-
- void _deleteEquipmentType() async {
- if (personalEquipmentTypes.isEmpty) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content:
- Text('Não existem categorias de equipamentos a serem excluídas.'),
- ),
- );
- return;
- }
-
- if (_selectedTypeToDelete == null) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text(
- 'Selecione uma categoria de equipamento válida para excluir.'),
- ),
- );
- return;
- }
-
- int equipmentId = personalEquipmentMap[_selectedTypeToDelete]!;
-
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Confirmar Exclusão'),
- content:
- const Text('Tem certeza de que deseja excluir este equipamento?'),
- actions: [
- TextButton(
- child: const Text('Cancelar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Excluir'),
- onPressed: () async {
- Navigator.of(context).pop();
- bool success = await personalEquipmentCategoryService
- .deletePersonalEquipmentCategory(equipmentId);
-
- if (success) {
- setState(() {
- personalEquipmentTypes.removeWhere(
- (element) => element['name'] == _selectedTypeToDelete);
- _selectedTypeToDelete = null;
- _fetchEquipmentCategory();
- });
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Equipamento excluído com sucesso.'),
- backgroundColor: Colors.green,
- ),
- );
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Falha ao excluir o equipamento.'),
- backgroundColor: Colors.red,
- ),
- );
- }
- },
- ),
- ],
- );
- },
- );
- }
-
- void _showConfirmationDialog() {
- if (_equipmentQuantityController.text.isEmpty ||
- _breakerLocationController.text.isEmpty ||
- _breakerStateController.text.isEmpty ||
- _wireTypeController.text.isEmpty ||
- _dimensionController.text.isEmpty ||
- (_selectCircuitType == null && _newEquipmentTypeName == null)) {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Por favor, preencha todos os campos.'),
- ),
- );
- return;
- }
-
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: const Text('Confirmar Dados do Equipamento'),
- content: SingleChildScrollView(
- child: ListBody(
- children: [
- const Text('Tipo:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_selectCircuitType ?? _newEquipmentTypeName ?? ''),
- const SizedBox(height: 10),
- const Text('Quantidade:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_equipmentQuantityController.text),
- const SizedBox(height: 10),
- const Text('Disjuntor(Local):',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_breakerLocationController.text),
- const SizedBox(height: 10),
- const Text('Disjuntor(Estado):',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_breakerStateController.text),
- const SizedBox(height: 10),
- const Text('Tipo de Fio:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_wireTypeController.text),
- const SizedBox(height: 10),
- const Text('Dimensão:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Text(_dimensionController.text),
- const SizedBox(height: 10),
- const Text('Imagens:',
- style: TextStyle(fontWeight: FontWeight.bold)),
- Wrap(
- children: _images.map((imageData) {
- return Padding(
- padding: const EdgeInsets.all(4.0),
- child: GestureDetector(
- onTap: () => _showImageDialog(imageData.imageFile,
- existingImage: imageData),
- child: Column(
- children: [
- Image.file(imageData.imageFile,
- width: 100, height: 100, fit: BoxFit.cover),
- Text(imageData.description),
- ],
- ),
- ),
- );
- }).toList(),
- ),
- ],
- ),
- ),
- actions: [
- TextButton(
- child: const Text('Editar'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: const Text('Adicionar'),
- onPressed: () {
- _registerEquipment();
- },
- ),
- ],
- );
- },
- );
- }
-
- void _registerEquipment() async {
- int? genericEquipmentCategory;
- int? personalEquipmentCategory;
-
- if (_isPersonalEquipmentCategorySelected) {
- genericEquipmentCategory = null;
- personalEquipmentCategory = _selectedPersonalEquipmentCategoryId;
- } else {
- genericEquipmentCategory = _selectedGenericEquipmentCategoryId;
- personalEquipmentCategory = null;
- }
-
- final EletricalCircuitRequestModel electricalCircuitModel =
- EletricalCircuitRequestModel(
- area: widget.areaId,
- system: widget.systemId,
- );
-
- final EletricalCircuitEquipmentRequestModel
- electricalCircuitEquipmentDetail =
- EletricalCircuitEquipmentRequestModel(
- genericEquipmentCategory: genericEquipmentCategory,
- personalEquipmentCategory: personalEquipmentCategory,
- eletricalCircuitRequestModel: electricalCircuitModel,
- );
-
- int? equipmentId = await equipmentService
- .createElectricalCircuit(electricalCircuitEquipmentDetail);
-
- if (equipmentId != null) {
- await Future.wait(_images.map((imageData) async {
- await equipmentPhotoService.createPhoto(
- EquipmentPhotoRequestModel(
- photo: imageData.imageFile,
- description: imageData.description,
- equipment: equipmentId,
- ),
- );
- }));
-
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Detalhes do equipamento registrados com sucesso.'),
- backgroundColor: Colors.green,
- ),
- );
- Navigator.pushReplacementNamed(
- context,
- '/electricalCircuitList',
- arguments: {
- 'areaName': widget.areaName,
- 'systemId': widget.systemId,
- 'localName': widget.localName,
- 'localId': widget.localId,
- 'areaId': widget.areaId,
- },
- );
- setState(() {
- _equipmentQuantityController.clear();
- _breakerLocationController.clear();
- _breakerStateController.clear();
- _wireTypeController.clear();
- _dimensionController.clear();
- _selectCircuitType = null;
- _selectedPersonalEquipmentCategoryId = null;
- _selectedGenericEquipmentCategoryId = null;
- _images.clear();
- });
- } else {
- ScaffoldMessenger.of(context).showSnackBar(
- const SnackBar(
- content: Text('Falha ao registrar os detalhes do equipamento.'),
- backgroundColor: Colors.red,
- ),
- );
- }
- }
-
- @override
- Widget build(BuildContext context) {
- List> combinedTypes = [
- ...genericEquipmentTypes,
- ...personalEquipmentTypes
- ];
-
- return Scaffold(
- appBar: AppBar(
- backgroundColor: AppColors.sigeIeBlue,
- foregroundColor: Colors.white,
- leading: IconButton(
- icon: const Icon(Icons.arrow_back, color: Colors.white),
- onPressed: () {
- Navigator.pushReplacementNamed(
- context,
- '/electricalCircuitList',
- arguments: {
- 'areaName': widget.areaName,
- 'systemId': widget.systemId,
- 'localName': widget.localName,
- 'localId': widget.localId,
- 'areaId': widget.areaId,
- },
- );
- },
- ),
- ),
- body: SingleChildScrollView(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: