2.7 KiB
2.7 KiB
Implementer — F-009 Brands module
done -> work/artifacts/F-009/implementer.md
Summary
Implemented brands as an independent backend module with slug URLs and SEO metadata, added product-brand assignment to catalog, and extended public product search with a brand filter.
Changed files
project/src/modules/brands/domain/brand.tsproject/src/modules/brands/domain/errors.tsproject/src/modules/brands/domain/ports.tsproject/src/modules/brands/application/brand-use-cases.tsproject/src/modules/brands/infrastructure/pg-brand-repository.tsproject/src/modules/brands/api/brands.routes.tsproject/src/modules/brands/index.tsproject/migrations/007_brands.jsproject/src/modules/catalog/domain/product.tsproject/src/modules/catalog/domain/errors.tsproject/src/modules/catalog/domain/ports.tsproject/src/modules/catalog/application/product-use-cases.tsproject/src/modules/catalog/infrastructure/pg-product-repository.tsproject/src/modules/catalog/api/catalog.routes.tsproject/src/app/build-app.tsproject/src/app/tests/brands.itest.tsproject/src/app/tests/catalog.itest.tswork/artifacts/F-009/architect.mdbacklog/features.jsonwork/current.md
Acceptance traceability
- Duplicate brand slug returns HTTP 409
- Implemented through
brands_brands.slug UNIQUEandBRAND_SLUG_EXISTSmapping. - Covered by
project/src/app/tests/brands.itest.ts.
- Implemented through
- Products list filterable by brand
GET /products/search?brandSlug=<slug>filters active products by storedcatalog_products.brand_idjoined tobrands_brands.slug.- Covered by
project/src/app/tests/catalog.itest.ts.
- Public URL is
/marca/<slug>- Implemented
GET /marca/:slugand serializedurl: /marca/<slug>. - Covered by
project/src/app/tests/brands.itest.ts.
- Implemented
verify.shgreen- Verified after implementation.
Commands run
cd project && npm run typecheck— PASScd project && npm test— PASS: 59 passed, 31 skipped (DB integration skipped withoutTEST_DATABASE_URL)cd project && npm run lint— PASS after Prettier normalizationcd project && npm run build— PASScd project && npm run lint:boundaries— PASS: 79 files checked./scripts/verify.sh— PASS
Notes
- No new npm dependencies.
- Brand mutation routes are admin-only via shared auth injected from the composition root.
- Public brand reads are unauthenticated.
- Catalog references
brands_brandsonly at repository/SQL boundary; it does not import brands module internals. - Documentation stage should update README/API notes because new user-facing brand endpoints, product brand assignment, and product error code were added.