Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Update master-variant terminology in dashboard + admin-sdk comments

Łukasz Adamczyk43399c98867c
diff --git a/packages/admin-sdk/src/params.ts b/packages/admin-sdk/src/params.ts
index 95754538b3..e308877f73 100644
--- a/packages/admin-sdk/src/params.ts
+++ b/packages/admin-sdk/src/params.ts
@@ -375,11 +375,9 @@ export interface ProductUpdateParams {
/**
* A variant entry nested inside a product create/update payload.
*
- * Unlike the standalone `POST /products/:id/variants` endpoint (see
- * `VariantCreateParams`, where `options` is required because the variant is
- * always non-master), a nested entry may omit `options`: an options-less
- * entry upserts onto the product's default (master) variant — the simple,
- * no-options product case. Pass `id` to update an existing variant.
+ * A nested entry may omit `options`: an options-less entry upserts onto the
+ * product's default variant — the simple, no-options product case. Pass `id`
+ * to update an existing variant.
*/
export interface ProductVariantInput {
id?: string
@@ -501,11 +499,9 @@ export interface VariantCreateParams {
position?: number
barcode?: string
/**
- * Required on create — a variant created via this endpoint is always
- * non-master, so it must declare at least one option pair (e.g. size +
- * color) or creation fails with 422. The non-empty tuple type enforces
- * this at compile time. Option types and values are auto-created if
- * missing.
+ * The variant's option pairs (e.g. size + color). The non-empty tuple type
+ * requires at least one at compile time. Option types and values are
+ * auto-created if missing.
*/
options: [VariantOptionPair, ...VariantOptionPair[]]
/** Per-currency prices. Upserted by currency. */
diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/new.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/new.tsx
index c85095bca0..20fd244207 100644
--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/new.tsx
+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/new.tsx
@@ -78,26 +78,26 @@ function NewProductPage() {
}
// For simple products (single variant with no options) the merchant
- // doesn't realise the master variant exists. Two routes:
+ // doesn't realise a default variant is auto-created server-side. Two routes:
//
// - Prices only (no SKU/weight/dimensions/stock/track_inventory edits):
// lift to the product-level `prices` key. `Spree::Product#prices=`
- // forwards to the master. Shipping a no-options variant inline
- // alongside the auto-created master would create a duplicate
- // non-master variant (apply_variants always builds a fresh variant
+ // forwards to the default variant. Shipping a no-options variant inline
+ // alongside the auto-created default variant would create a duplicate
+ // variant (apply_variants always builds a fresh variant
// for entries without an id).
//
// - Any variant-only data: ship the variant inline. The backend's
- // `Product#variants=` builds a non-master variant carrying every
+ // `Product#variants=` builds the variant carrying every
// field — including prices — so we MUST NOT also ship top-level
- // `prices` (would double-record the price on both master and the
- // inline variant).
+ // `prices` (would double-record the price on both the default variant
+ // and the inline variant).
const isSingleOptionlessVariant = meaningful.length === 1 && meaningful[0].options.length === 0
if (isSingleOptionlessVariant) {
const v = meaningful[0]
// Mirrors isPlaceholderDefaultVariant — any variant-only field the
// merchant edited should ride inline so the backend's apply_variants
- // upserts onto the master rather than leaving the field at its
+ // upserts onto the default variant rather than leaving the field at its
// default.
const hasVariantOnlyData =
v.sku != null ||