Conversation
…o records - StatementRequest: converted from class to record with Jakarta validations - StatementResponse: converted to record with nested response objects - Follows SchoolYear DTO pattern
…esponses - Update accessor methods from getters to record accessors - Add toResponse with nested SchoolYear, Term, Subject, Class, Course, Account objects - Fix Mono.zip() compatibility with switchIfEmpty for non-null values - Add repository dependencies for related entities
- Fix path from /statements to /api/statements - Add .collectList() for Flux to List conversion
- Add FK constraints for school_year, term, subject, class, course, created_by
- Simulation model with R2DBC annotations - SimulationStatus enum: IN_PROGRESS, FINISHED, CANCELLED - Soft delete support with markAsDelete() and restore()
- SimulationRequest: record with accountId, statementId, schoolYearId, status - SimulationResponse: record with nested Account, Statement, SchoolYear objects - StatementBasicResponse: simplified statement info for nested use
- findByDeletedAtIsNull for active records - findByDeletedAtIsNotNull for trashed records - findByIdAndDeletedAtIsNull/IsNotNull for single record queries
- Create simulation with account and school year validation - Update with status transitions (IN_PROGRESS -> FINISHED/CANCELLED) - Soft delete, restore, and hard delete support - Nested response mapping with Account, Statement, SchoolYear
Endpoints:
- GET /api/simulations - List all active
- GET /api/simulations/trash - List trashed
- GET /api/simulations/{id} - Get by ID
- POST /api/simulations - Create
- PUT /api/simulations/{id} - Update
- DELETE /api/simulations/{id} - Soft delete
- PUT /api/simulations/{id}/restore - Restore
- DELETE /api/simulations/{id}/permanent - Hard delete
- Add jakarta.validation.Valid import - Add @Valid to create and update endpoints - Follows CRUD pattern for validation
- Replace RuntimeException with ApiException in hardDelete - Set startedAt to current time if not provided in create
- Create simulation table with all columns from ERM - Add foreign keys to accounts, statement, school_years - Add CHECK constraint for status values - Add indexes for active records and common queries
- Rename table from 'simulation_answer' to 'simulation_answers' (plural) - Add missing 'answerText' field to model, request and response - Change 'float' to 'Float' for scoreObtained to allow null values - Rename 'textAnswer' to 'answerText' in request to match ERM - Add @NotNull validations for simulationId and questionId - Remove unused SchoolYear import from repository - Add migration V9 to rename table and indexes in database
…ear pattern - Rename findAllTrashed() to findAllDeleted() for consistency - Change return type from Mono<List<>> to Flux<> in service - Fix error messages from 'School year' to 'Simulation answer' - Map answerText field in create and update methods - Add onErrorMap for conflict handling in update method - Remove unused imports (SchoolYearRequest, SchoolYearResponse, Flux) - Add JavaDoc documentation to all controller methods
- Use ApiException.getStatus() instead of hardcoded 500 - Return proper status codes: 404 for notFound, 400 for badRequest, 409 for conflict - Use status reason phrase as title instead of generic 'API Error' - This fix affects all controllers using ApiException globally
- ClassRequest: alterado grade de String para Integer - ClassResponse: alterado grade de String para Integer - OcrController.ClassInfo: alterado grade de String para Integer - Removida anotação @notblank (específica para String) do grade
…anas Melhorias na extração de cotação: - Suporte a formatos: '1-a) 3 valores', '(3V)', 'COTACAO:1) a - 4 V' - Extração de cotação inline no texto das questões - Soma automática de cotação de subitems Melhorias na extração de metadados: - Padrões mais robustos para ano letivo (Ano Lectivo/Letivo) - Melhor detecção de classe/grade com fallbacks - Limpeza de campos nulos para evitar persistir dados vazios - Filtro de lixo do rodapé (COORDENAÇÃO, minttics.gov.ao, etc.) Novo campo subitemsContent: - Armazena conteúdo completo de cada alínea (a, b, c) - Inclui texto e cotação individual por subitem Correções: - Evita confundir '12ª Classe' com número de questão - Padrão de curso mais restritivo (requer 'CURSO:') - Normalização de nomes de disciplinas
- Novo record SubitemContent com label, text e cotacao - Campo subitemsContent no ExtractedQuestion para mapear alíneas - Permite persistir conteúdo individual de cada alínea (a, b, c)
ExamExtractionResponse: - DTO estruturado para extração de exames angolanos - Conversão de OcrResponse para formato de persistência - QuestionData, OptionData, ImageToUploadData, WarningData OcrPersistenceService: - Serviço para processar OCR e persistir no banco - Criação automática de SchoolYear, Course, Subject, Class - Mapeamento de questões e opções - Suporte a lookup ou criação de entidades relacionadas
- OCR_MAPPING.md com guia completo de mapeamento - Estrutura de campos OCR → Entidades do banco - Exemplos de extração de cotação angolana - Endpoints de teste e exemplos de uso - Troubleshooting e limites do sistema
- Script interativo para testar endpoints OCR - Suporte a Python OCR Service e Spring Backend - Modos: health check, python, spring, exam, all - Formatação colorida e resumo de resultados
- SchoolYearRepository: findByStartYearAndEndYear - CourseRepository: findByNameIgnoreCase - SubjectRepository: findByNameIgnoreCase - ClassRepository: findByGradeAndCourseIdAndSchoolYearId - QuestionRepository: métodos para busca por statement
- Class: ajustes para suporte a OCR - Course: campos adicionais para persistência
- StatementService: melhorias na busca e criação - SubjectService: ajustes para integração com OCR - StatementController: endpoints atualizados - StatementBasicResponse: campos adicionais
- docker-compose.yml: configurações de serviços - pom.xml: dependências atualizadas - crud-flux.md: guia de implementação
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.