From 931e3ef920e58c8eb023707ecaff3d572b100d13 Mon Sep 17 00:00:00 2001 From: Wesley Finck Date: Mon, 6 Oct 2025 16:02:31 -0700 Subject: [PATCH] refactor: update InMemoryCardRepository to match new Card repository interface Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) --- .../cards/tests/utils/InMemoryCardRepository.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/cards/tests/utils/InMemoryCardRepository.ts b/src/modules/cards/tests/utils/InMemoryCardRepository.ts index f216d9d7..ccf98180 100644 --- a/src/modules/cards/tests/utils/InMemoryCardRepository.ts +++ b/src/modules/cards/tests/utils/InMemoryCardRepository.ts @@ -2,6 +2,7 @@ import { Result, ok, err } from '../../../../shared/core/Result'; import { ICardRepository } from '../../domain/ICardRepository'; import { Card } from '../../domain/Card'; import { CardId } from '../../domain/value-objects/CardId'; +import { CuratorId } from '../../domain/value-objects/CuratorId'; import { URL } from '../../domain/value-objects/URL'; export class InMemoryCardRepository implements ICardRepository { @@ -13,12 +14,14 @@ export class InMemoryCardRepository implements ICardRepository { // Simple clone - in a real implementation you'd want proper deep cloning const cardResult = Card.create( { + curatorId: card.props.curatorId, type: card.type, content: card.content, parentCardId: card.parentCardId, url: card.url, - originalPublishedRecordId: card.originalPublishedRecordId, + publishedRecordId: card.publishedRecordId, libraryMemberships: card.libraryMemberships, + libraryCount: card.libraryCount, createdAt: card.createdAt, updatedAt: card.updatedAt, }, @@ -44,12 +47,16 @@ export class InMemoryCardRepository implements ICardRepository { } } - async findUrlCardByUrl(url: URL): Promise> { + async findUsersUrlCardByUrl( + url: URL, + curatorId: CuratorId, + ): Promise> { try { const card = Array.from(this.cards.values()).find( (card) => card.content.type === 'URL' && - card.content.urlContent?.url.value === url.value, + card.content.urlContent?.url.value === url.value && + card.props.curatorId.equals(curatorId), ); return ok(card ? this.clone(card) : null); } catch (error) { -- 2.51.2