Conversation
…e handling in createStatsService
…, and pasta_notebook
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements preRequire filtering logic for scene selection, refactors hooks to remove react-query dependency for scene fetching, and adds three new items to the game. The changes support more flexible scene matching based on requirements like XP, stats, items, and skills.
- Implements
matchesPreRequireutility function with support for OR-styleitemsRequired.anymatching - Refactors
useGetSceneto use newuseFetchhook instead ofreact-query - Adds three new items:
nanotraje,mochila, andpasta_notebook
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/infra/repositories/scenesList.repo.test.ts |
Adds unit tests for matchesPreRequire filtering logic with various preRequire scenarios |
tests/unit/infra/repositories/matchRequired.test.ts |
Adds comprehensive unit tests for individual matchesPreRequire conditions |
src/ui/hooks/useFetch.ts |
Implements new generic useFetch hook for data fetching without react-query |
src/ui/hooks/scene/useGetScene.ts |
Refactors scene fetching to use useFetch instead of useQuery |
src/services/stats/createStats.service.ts |
Refactors resource initialization to use new defaultResourceNormalized helper |
src/services/sheet/createSheet.service.ts |
Simplifies sheet creation by inlining object construction |
src/infra/repositories/scenesList.repo.ts |
Implements matchesPreRequire filtering in getScenesByPreRequire |
src/infra/dexie/seed/stats_base.seed.ts |
Removes obsolete TODO comments |
src/infra/dexie/seed/items.seed.ts |
Adds three new item definitions with descriptions and properties |
src/infra/dexie/migrations/v1-to-v2.migration.ts |
Removes obsolete TODO comment |
src/domain/utils/index.ts |
Exports new matchRequired utilities |
src/domain/utils/game/matchRequired.ts |
Implements core matching logic for preRequire filtering |
src/domain/utils/format/resource.ts |
Adds defaultResourceNormalized helper function |
src/domain/types/queryResult/fetchResult.type.ts |
Defines types for new useFetch hook |
src/domain/types/index.ts |
Exports new fetch result types |
src/domain/queryKeys.ts |
Removes deprecated scene query key |
src/domain/constants/enum/item.enum.ts |
Adds three new item enum entries |
package.json |
Bumps version to 1.0.1 |
docs/kanban.md |
Marks TODO resolution tasks as completed |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Versão (opcional)
Descrição (resumo)
developpara integração: adição de itens (nanotraje,mochila,pasta_notebook), refatoração de hooks (useFetch,useGetScene), implementação de lógica de filtragempreRequiree testes unitários correlatos.Destaques
useFetche refatorauseGetScenepara não usarreact-querymatchesPreRequiree atualizagetScenesByPreRequirepreRequire(xpRequired, statsRequired, itemsRequired.any as OR)Breaking Changes
Checklist
docs/CHANGELOG.mdse aplicável)package.jsonatualizado (se aplicável)Observações para revisão:
matchesPreRequire(especialmenteitemsRequired.anyque agora funciona como OR).npm run test:unitenpm run tsclocalmente antes do merge.