Compare commits

..

11 Commits

Author SHA1 Message Date
cc3dcd3f0a feat(sync): harden the Hiboutik sync, share rate limits across instances, update dependencies (#4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:45:08 +00:00
8c8a2ccf15 feat(security): harden the API, trust Hiboutik for deletions, lock syncs (#3)
- Sync deletions: a 2xx Hiboutik answer is the truth, even an empty list; a failed call (HTTP error or non-list body) deletes nothing (HiboutikClient.getList).
- Validate the environment at startup (HIBOUTIK_BASE_URL must be HTTPS), global ValidationPipe, Helmet, CORS opt-in, HTTP timeouts, rate limiting (60 req/min/IP, 5 on POST /sync), AllExceptionsFilter.
- Postgres advisory lock so only one synchronization runs at a time across instances; syncAll is private, syncs start through startSync.
- Fix the Jest moduleNameMapper; document the validation and security rules in CLAUDE.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 09:36:50 +00:00
8b341c4933 chore: add Claude Code configuration (#2)
## Summary
- Add `CLAUDE.md`: project description (K-pop shop backend, buffer in front of Hiboutik), architecture, domain notes, git workflow.
- Add shared `.claude/settings.json` (allowed dev commands, `.env` read protection).
- Pin the Prisma agent skills in `skills-lock.json` (restore with `npx skills experimental_install`, documented in the README).
- Update `.gitignore` (generated skills, local settings, Postman skills) and add `.gitattributes` (LF line endings).

## Note
This branch is based on `feat/customer-addresses-orders`, so the PR also contains the 3 feature commits (addresses, company details, orders) that `CLAUDE.md` describes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: MastersGame <quentin.duwa1210@gmail.com>
Reviewed-on: #2
2026-11-07 12:14:08 +00:00
9dddf7562a feat(sync): synchronize customer adresses and orders from Hiboutik sales (#1)
Co-authored-by: MastersGame <quentin.duwa1210@gmail.com>
Reviewed-on: #1
2026-11-07 09:56:53 +00:00
MastersGame
c5f65dcb62 feat(sync): synchronize Hiboutik data through POST /sync
POST /sync starts the full synchronization in the background (202, or 409 when one is already running). Entities are synced in dependency order: brands, categories, suppliers, products (with versions and stocks), customers. Each row is synced independently so that a failure is logged without stopping the rest. Replaces the default AppService.
2026-11-05 23:00:49 +01:00
MastersGame
27d0e0149d feat(db): add database repositories
Upserts keyed on hiboutikId and deletion of the rows that no longer exist in Hiboutik.
2026-11-05 23:00:48 +01:00
MastersGame
db699822f9 feat(sync): add converters from Hiboutik DTOs to Prisma inputs
Includes helpers for Hiboutik dates ("0000-00-00" is ignored) and optional prices ("0.00" means no value).
2026-11-05 23:00:48 +01:00
MastersGame
2424a086e0 feat(hiboutik): add Hiboutik API client, repositories and DTOs
HiboutikClient handles Basic auth and walks paginated endpoints. One read-only repository per entity (brands, categories, suppliers, products, stocks, customers).
2026-11-05 23:00:47 +01:00
MastersGame
8f377a1fe9 feat(db): add Prisma schema and global PrismaModule
Models mirror Hiboutik entities (categories tree, brands, suppliers, products and their versions, customers) plus addresses and orders for the upcoming sync. Every synced model is matched with Hiboutik through a unique hiboutikId. The generated client is ignored by git and env files other than .env.example are ignored.
2026-11-05 23:00:46 +01:00
MastersGame
a0ddef240c build: add Prisma 7, PostgreSQL driver and @nestjs/config
Generate the Prisma client on postinstall. Jest now transpiles the ESM-only @nestjs/config and maps the .js imports of the generated Prisma client, in both the unit and e2e configurations.
2026-11-05 23:00:45 +01:00
MastersGame
24b699cfc4 chore: update prettier and eslint configuration
Use a 140 characters print width and let typescript-eslint resolve types through tsconfig.json.
2026-11-05 23:00:44 +01:00

Diff Content Not Available