some progress

This commit is contained in:
2025-09-20 16:47:41 +03:00
parent e650f3c1b2
commit 2228469bcb
65 changed files with 3382 additions and 311 deletions
+9 -2
View File
@@ -9,6 +9,11 @@
## Open Text Summaries API
### Sitemap
- Endpoint: GET /sitemap.xml
- Description: Returns an XML sitemap including homepage, static pages (/about, /privacy, /terms, /contact), index pages (/books, /categories), and all book detail pages.
- How to submit to Google: In Google Search Console, add your property (domain) and submit the sitemap URL, e.g., https://your-domain.com/sitemap.xml
This API lets you ingest Books (with optional Category and Summary) in a create-or-update (upsert) fashion. It is designed so your client can safely resend the same data without creating duplicates.
- Method and route: POST /api/ingest/books
@@ -61,7 +66,8 @@ Accepted request shapes
Field reference
- Book
- title (string, required)
- author (string, required)
- author (string, required if `authors` not provided)
- authors (array<string>, optional; preferred. If provided, `author` may be omitted. The first name is also stored in the legacy `author` field for backward compatibility.)
- slug (string, optional; defaults to slugified title)
- description (string, optional)
- publication_date (YYYY-MM-DD string, optional)
@@ -148,7 +154,8 @@ Status: 422
}
Notes
- This endpoint performs minimal validation: each item must have title and author. Other fields are optional.
- Authors are normalized to a separate `authors` table and linked via a pivot. You may send `author` (string) or `authors` (array). If `authors` is provided, the first name is also saved to the legacy `author` column on books for compatibility.
- This endpoint performs minimal validation: each item must have title and author/authors. Other fields are optional.
- Slugs are derived from names/titles if not provided, using Laravel's Str::slug.
- There is no pagination or retrieval endpoint here; this endpoint is for ingestion only.
- No authentication/rate limiting is configured by default; add it before exposing this API to untrusted clients.