@develemit/commerce-server 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/admin.md CHANGED
@@ -18,16 +18,17 @@ management under `/admin`. Without it, no admin routes exist (404).
18
18
  files with `openStoredFile(dir, key)`, which returns `{ stream, contentType,
19
19
  size }` or `null` (answer 404).
20
20
 
21
- | Route | Purpose |
22
- | ---------------------------------------- | -------------------------------------------------------- |
23
- | `GET/POST /admin/products` | List all statuses / create (`adminProductInputSchema`) |
24
- | `GET /admin/products/counts` | `{ all, live, draft, sold, archived, incompleteDrafts }` |
25
- | `GET/PATCH /admin/products/:id` | Read / edit; `{ sold: true }` sets quantity to 0 |
26
- | `POST /admin/products/:id/images` | Multipart `file` (+ optional `alt`), 8MB max |
27
- | `PATCH /admin/products/:id/images/order` | `{ imageIds }`, every image exactly once |
28
- | `PATCH /admin/products/:id/images/:id` | `{ alt }` (trimmed, max 500); 404 for unknown image |
29
- | `DELETE /admin/products/:id/images/:id` | Removes the row and the stored file |
30
- | `GET/PUT /admin/shipping-rates` | `PUT` replaces the full set of rates |
21
+ | Route | Purpose |
22
+ | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
23
+ | `GET/POST /admin/products` | List all statuses / create (`adminProductInputSchema`) |
24
+ | `GET /admin/products/counts` | `{ all, live, draft, sold, archived, incompleteDrafts }` |
25
+ | `GET/PATCH /admin/products/:id` | Read / edit; `{ sold: true }` sets quantity to 0 |
26
+ | `DELETE /admin/products/:id` | Deletes a never-live draft with no order lines (204), its files and holds; else 409 `PRODUCT_NOT_DELETABLE` (`reason`) |
27
+ | `POST /admin/products/:id/images` | Multipart `file` (+ optional `alt`), 8MB max |
28
+ | `PATCH /admin/products/:id/images/order` | `{ imageIds }`, every image exactly once |
29
+ | `PATCH /admin/products/:id/images/:id` | `{ alt }` (trimmed, max 500); 404 for unknown image |
30
+ | `DELETE /admin/products/:id/images/:id` | Removes the row and the stored file |
31
+ | `GET/PUT /admin/shipping-rates` | `PUT` replaces the full set of rates |
31
32
 
32
33
  Stored image keys are `products/<productId>/<uuid>.<ext>` and are never
33
34
  overwritten, so their URLs are safe to cache forever. Serve `FileStorage` URLs
@@ -0,0 +1,2 @@
1
+ ALTER TABLE "commerce_products" ADD COLUMN "published_at" timestamp with time zone;--> statement-breakpoint
2
+ UPDATE "commerce_products" SET "published_at" = "updated_at" WHERE "status" <> 'draft';