Skip to main content

Overview

The Genero interface represents a book genre or category in the virtual library system. Each book belongs to exactly one genre.

Interface Definition

Properties

number
required
Unique identifier for the genre. Auto-generated by the backend.
string
required
The genre name (e.g., “Ficción”, “No Ficción”, “Ciencia Ficción”, “Romance”, “Misterio”).

Usage Examples

Fetching All Genres

Creating a New Genre

Updating a Genre

Deleting a Genre

Using Genres in Book Management

Filtering Books by Genre

Template Usage

Genre Statistics

  • Libro - Book interface that references Genero

Common Genres

Here are some common genre examples you might use:
  • Ficción
  • No Ficción
  • Ciencia Ficción
  • Fantasía
  • Romance
  • Misterio
  • Thriller
  • Historia
  • Biografía
  • Poesía
  • Drama
  • Terror
  • Aventura
  • Realismo Mágico

Notes

Deleting a genre that is associated with existing books may fail due to foreign key constraints. Ensure no books reference the genre before deletion.
Consider implementing a cascading update strategy so that when a genre is updated, all associated books reflect the change.
Genre names should be unique to avoid confusion. Consider adding validation on the backend to enforce this.