export class Manga {
  constructor({
    id,
    slug,
    title,
    description = null,
    authors = [],
    imageUrl = null,
    thumbnailUrl = null,
    publicationYear = null,
    status = null,
    rating = null,
    genres = [],
    createdAt = new Date().toISOString(),
    monitored = false,
    chaptersTotal = 0,
    chaptersScraped = 0,
  }) {
    this.id = id;
    this.slug = slug;
    this.title = title;
    this.description = description;
    this.authors = authors;
    this.imageUrl = imageUrl;
    this.thumbnailUrl = thumbnailUrl;
    this.publicationYear = publicationYear;
    this.status = status;
    this.rating = rating;
    this.genres = genres;
    this.createdAt = createdAt;
    this.monitored = monitored;
    this.chaptersTotal = chaptersTotal;
    this.chaptersScraped = chaptersScraped;
  }

  static create(data) {
    return new Manga(data);
  }
}

export class MangaCollection {
  constructor(items, total, page, limit, hasNextPage, hasPreviousPage) {
    this.items = items.map(item => Manga.create(item));
    this.total = total;
    this.page = page;
    this.limit = limit;
    this.hasNextPage = hasNextPage;
    this.hasPreviousPage = hasPreviousPage;
  }
} 