Skip to content

[Fase 2] Repository CRUD per Notes #11

Description

@elecicalla

Context

Le note CRM sono collegate a contatti, aziende e deals. L'interfaccia Notes include anche campi come isFavorite (usato inline nei componenti).

Objective

Creare src/db/repositories/note-repository.ts con:

  • getAllNotes(): Notes[]
  • getNoteById(id: string): Notes | null
  • createNote(data): Notes
  • updateNote(id, data): Notes | null
  • removeNote(id): boolean
  • getNotesByContact(contactId): Notes[]
  • Gestione join tables: note_contacts, note_companies, note_deals

Acceptance Criteria

  • 5 funzioni CRUD base + getNotesByContact
  • createNote gestisce assignedContactIds[], companyIds[], dealIds[] nelle join tables
  • getNoteById ricostruisce l'oggetto Notes completo
  • removeNote pulisce note_contacts, note_companies, note_deals
  • status NOT NULL con valori: pending, in_progress, completed

Dependencies

Depends on: #6

Notes

Phase: Fase 2
Ref: FR-004

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions