rename project from SimpleshopTheme to Berrypod
All modules, configs, paths, and references updated. 836 tests pass, zero warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@ This simplification means `provider_data` stores different fields and shipping r
|
||||
|
||||
### 1.1 HTTP client
|
||||
|
||||
**New file:** `lib/simpleshop_theme/clients/printful.ex`
|
||||
**New file:** `lib/berrypod/clients/printful.ex`
|
||||
|
||||
Same pattern as `clients/printify.ex`. Uses `Req` with Bearer token auth.
|
||||
|
||||
@@ -70,7 +70,7 @@ API key stored in process dictionary (`Process.put(:printful_api_key, key)`) sam
|
||||
|
||||
### 1.2 Provider implementation
|
||||
|
||||
**New file:** `lib/simpleshop_theme/providers/printful.ex`
|
||||
**New file:** `lib/berrypod/providers/printful.ex`
|
||||
|
||||
Implements the `Provider` behaviour. The big difference from Printify is that Printful products don't need a "shop" — they come from the global catalogue. But orders require a store_id.
|
||||
|
||||
@@ -173,16 +173,16 @@ Alternatively, query rates for all countries in `Shipping.@country_names` to pop
|
||||
|
||||
### 1.3 Wire into Provider dispatch
|
||||
|
||||
**File:** `lib/simpleshop_theme/providers/provider.ex`
|
||||
**File:** `lib/berrypod/providers/provider.ex`
|
||||
|
||||
Change line 97:
|
||||
```elixir
|
||||
defp default_for_type("printful"), do: {:ok, SimpleshopTheme.Providers.Printful}
|
||||
defp default_for_type("printful"), do: {:ok, Berrypod.Providers.Printful}
|
||||
```
|
||||
|
||||
### 1.4 Order submission: multi-provider routing
|
||||
|
||||
**File:** `lib/simpleshop_theme/orders.ex`
|
||||
**File:** `lib/berrypod/orders.ex`
|
||||
|
||||
Currently `get_provider_connection/0` is hardcoded to `"printify"`. For multi-provider support, orders need to route to the correct provider based on which connection owns the product.
|
||||
|
||||
@@ -223,7 +223,7 @@ Already covered in the client (1.1). The flow:
|
||||
|
||||
### 2.2 Mockup worker
|
||||
|
||||
**New file:** `lib/simpleshop_theme/sync/mockup_generation_worker.ex`
|
||||
**New file:** `lib/berrypod/sync/mockup_generation_worker.ex`
|
||||
|
||||
Oban worker that generates mockups for a product after sync:
|
||||
|
||||
@@ -294,7 +294,7 @@ This works correctly with the existing calculation logic — no changes needed t
|
||||
|
||||
### 4.1 Webhook handler
|
||||
|
||||
**New file:** `lib/simpleshop_theme_web/controllers/printful_webhook_controller.ex`
|
||||
**New file:** `lib/berrypod_web/controllers/printful_webhook_controller.ex`
|
||||
|
||||
Printful webhooks POST JSON to a configured URL. Events we care about:
|
||||
|
||||
@@ -353,22 +353,22 @@ Identical to Printify — the admin clicks "Sync" and the ProductSyncWorker runs
|
||||
### New files (6)
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `lib/simpleshop_theme/clients/printful.ex` | HTTP client |
|
||||
| `lib/simpleshop_theme/providers/printful.ex` | Provider behaviour implementation |
|
||||
| `lib/simpleshop_theme/sync/mockup_generation_worker.ex` | Async mockup generation |
|
||||
| `lib/simpleshop_theme_web/controllers/printful_webhook_controller.ex` | Webhook handler |
|
||||
| `test/simpleshop_theme/providers/printful_test.exs` | Provider tests |
|
||||
| `test/simpleshop_theme/clients/printful_test.exs` | Client tests (with Req mocking) |
|
||||
| `lib/berrypod/clients/printful.ex` | HTTP client |
|
||||
| `lib/berrypod/providers/printful.ex` | Provider behaviour implementation |
|
||||
| `lib/berrypod/sync/mockup_generation_worker.ex` | Async mockup generation |
|
||||
| `lib/berrypod_web/controllers/printful_webhook_controller.ex` | Webhook handler |
|
||||
| `test/berrypod/providers/printful_test.exs` | Provider tests |
|
||||
| `test/berrypod/clients/printful_test.exs` | Client tests (with Req mocking) |
|
||||
|
||||
### Modified files (6)
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `lib/simpleshop_theme/providers/provider.ex` | Wire `"printful"` to Printful module |
|
||||
| `lib/simpleshop_theme/orders.ex` | Route to correct provider per order (not hardcoded "printify") |
|
||||
| `lib/simpleshop_theme_web/router.ex` | Add Printful webhook route |
|
||||
| `lib/berrypod/providers/provider.ex` | Wire `"printful"` to Printful module |
|
||||
| `lib/berrypod/orders.ex` | Route to correct provider per order (not hardcoded "printify") |
|
||||
| `lib/berrypod_web/router.ex` | Add Printful webhook route |
|
||||
| `config/config.exs` | (optional) Printful-specific config |
|
||||
| `lib/simpleshop_theme/sync/product_sync_worker.ex` | Enqueue mockup generation for Printful products |
|
||||
| `lib/simpleshop_theme_web/live/admin/settings.ex` | Provider form tweaks for Printful |
|
||||
| `lib/berrypod/sync/product_sync_worker.ex` | Enqueue mockup generation for Printful products |
|
||||
| `lib/berrypod_web/live/admin/settings.ex` | Provider form tweaks for Printful |
|
||||
|
||||
---
|
||||
|
||||
@@ -399,7 +399,7 @@ Identical to Printify — the admin clicks "Sync" and the ProductSyncWorker runs
|
||||
|
||||
## Decisions and trade-offs
|
||||
|
||||
**Using sync products (not catalogue browsing):** Printful's model expects sellers to set up products in Printful's dashboard first (apply designs, choose products, set pricing). SimpleShop syncs those configured products. This matches the Printify workflow where products exist in the provider's system first. Full catalogue browsing + product creation via API is possible but significantly more complex (need artwork upload, placement positioning, pricing config) — better suited for a v2.
|
||||
**Using sync products (not catalogue browsing):** Printful's model expects sellers to set up products in Printful's dashboard first (apply designs, choose products, set pricing). Berrypod syncs those configured products. This matches the Printify workflow where products exist in the provider's system first. Full catalogue browsing + product creation via API is possible but significantly more complex (need artwork upload, placement positioning, pricing config) — better suited for a v2.
|
||||
|
||||
**Reusing ShippingRate schema fields:** `blueprint_id` and `print_provider_id` are Printify-specific names, but they serve as generic "product type ID" and "provider ID" slots. Renaming them would be a migration + touch every query. Not worth it until a third provider makes the naming confusing.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user