import type { JsonObject } from '@x12i/api-simulator'; /** * Seed catalog for the library demo. * * This array becomes the `data.books` object handed to every endpoint in the * `library-api`. `relative` endpoints can template straight off it (see * `list-books` in ../api.ts); `simulation` endpoints load it into the * in-memory ledger in ../state/checkout-ledger.ts so it can change as books * are checked out and returned. */ export interface Book extends JsonObject { id: string; isbn: string; title: string; author: string; copiesTotal: number; copiesAvailable: number; } export const books: Book[] = [ { id: 'book-atomic-habits', isbn: '9780735211292', title: 'Atomic Habits', author: 'James Clear', copiesTotal: 3, copiesAvailable: 3 }, { id: 'book-clean-code', isbn: '9780132350884', title: 'Clean Code', author: 'Robert C. Martin', copiesTotal: 2, copiesAvailable: 1 }, { id: 'book-dune', isbn: '9780441172719', title: 'Dune', author: 'Frank Herbert', copiesTotal: 4, copiesAvailable: 0 } ];