feat(F-058): completed feature

This commit is contained in:
chattie
2026-08-19 15:17:51 +02:00
parent 9c4557a1bf
commit 4cdb5fb487
14 changed files with 233 additions and 21 deletions

View File

@@ -105,6 +105,13 @@ class FakeImageRepository implements ProductImageRepository {
.sort((a, b) => a.position - b.position || a.id.localeCompare(b.id));
}
async listByProductIds(productIds: readonly string[]): Promise<ProductImage[]> {
const set = new Set(productIds);
return this.images
.filter((item) => set.has(item.productId))
.sort((a, b) => a.position - b.position || a.id.localeCompare(b.id));
}
async attach(productId: string, input: NewProductImage): Promise<ProductImage> {
const created = image({
id: `img-${this.images.length + 1}`,