Skip to content

fix(api): add seed npcs.json to unblock main CI and market tests (#83) - #122

Open
Rodrigoue9 wants to merge 6 commits into
Bitcoindefi:mainfrom
Rodrigoue9:fix/seed-npcs-json-unblock-ci
Open

fix(api): add seed npcs.json to unblock main CI and market tests (#83)#122
Rodrigoue9 wants to merge 6 commits into
Bitcoindefi:mainfrom
Rodrigoue9:fix/seed-npcs-json-unblock-ci

Conversation

@Rodrigoue9

@Rodrigoue9 Rodrigoue9 commented Aug 24, 2026

Copy link
Copy Markdown

Resumen de la Solución

  • Agrega api/src/jsons/npcs.json con la estructura normalizada de NPCs (GameNpcRecordData) incluyendo comerciantes, sacerdotes, banqueros y guardias.
  • Desbloquea la suite de tests de integración (market.integration.test.ts) y el CI de main.

Closes #83
Resolves #83

Listo para revisión! 🚀


Summary by Gitar

  • Database schema updates:
    • Defined clan_members and related tables before applying data migrations in api/schema.sql

This will update automatically on new commits.

Comment thread api/src/jsons/npcs.json Outdated
Comment thread PR_DESCRIPTION_DRAFT.md Outdated
@Rodrigoue9

Copy link
Copy Markdown
Author

Resolved both review items in commit 39a2a55:

  1. Updated api/src/jsons/npcs.json setting npcType: 10 and objs array for the merchant to satisfy listNpcSoldItemIds() market integration tests.
  2. Removed the unrelated PR_DESCRIPTION_DRAFT.md file from the branch.

Ready for review and merge! 🚀

@gitar-bot

gitar-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Adds seed npcs.json file to unblock CI and market integration tests, with NPC data now properly structured using correct npcType values and objs array format. Resolved issues with seed data compatibility and removed unrelated draft file.

✅ 2 resolved
Bug: Seed NPC data won't satisfy market test (wrong npcType/field)

📄 api/src/jsons/npcs.json:2-16
The PR aims to unblock market.integration.test.ts, but that test calls getNpcSoldItemId()listNpcSoldItemIds(), which queries WHERE npc_type = 10 and reads data.objs (gameNpcs.ts:50-70). In npcs.json the only merchant (id 1) uses npcType: 1 and a trade array instead of npcType: 10 and objs. normalizeNpcData sets objs: [] when absent, so the query returns no rows, listNpcSoldItemIds() returns [], and the test's assert.ok(itemId, ...) fails — leaving CI still red. Fix: set the merchant's npcType to 10 and rename its trade array to objs.

Quality: Unrelated draft file PR_DESCRIPTION_DRAFT.md committed

📄 PR_DESCRIPTION_DRAFT.md:1-10
PR_DESCRIPTION_DRAFT.md describes an unrelated world-builder feature (#6, palette schemas) and appears to be an accidentally committed scratch/draft file that has nothing to do with seeding npcs.json or unblocking CI. Remove it from the PR to avoid polluting the repo root.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Falta api/src/jsons/npcs.json en el repositorio y el test de market no puede correr

1 participant