Skip to content

Commit

Permalink
feat(core): Added create & update input for ProductVariantPrice
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin committed Dec 6, 2024
1 parent b78351c commit 0a960e6
Show file tree
Hide file tree
Showing 18 changed files with 37,814 additions and 37,363 deletions.
74,414 changes: 37,207 additions & 37,207 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,17 @@
[taxCategoryId]="detailForm.get('taxCategoryId')!.value"
/>

<vdr-card [title]="'common.custom-fields' | translate" *ngIf="customPriceFields.length">
<div class="form-grid-span" *ngIf="customPriceFields.length">
<div class="title-row">
<span class="title">{{ 'common.custom-fields' | translate }}</span>
</div>
<vdr-tabbed-custom-fields
entityName="ProductVariantPrice"
[customFields]="customPriceFields"
[customFieldsFormGroup]="price.get(['customFields'])"
[readonly]="!(updatePermissions | hasPermission)"
/>
{{ price.get(['customFields'])?.value | json}}
</vdr-card>
</div>
</div>

<vdr-variant-price-strategy-detail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ vdr-product-variant-quick-jump {
}
}
}

.title-row {
display: flex;
justify-content: space-between;
align-items: center;
}
.title {
font-size: var(--font-size-base);
}
96 changes: 75 additions & 21 deletions packages/admin-ui/src/lib/core/src/common/generated-types.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,13 @@ export type CreateFacetInput = {
values?: InputMaybe<Array<CreateFacetValueWithFacetInput>>;
};

export type CreateFacetValueCustomFieldsInput = {
childFacetValueId?: InputMaybe<Scalars['ID']['input']>;
};

export type CreateFacetValueInput = {
code: Scalars['String']['input'];
customFields?: InputMaybe<Scalars['JSON']['input']>;
customFields?: InputMaybe<CreateFacetValueCustomFieldsInput>;
facetId: Scalars['ID']['input'];
translations: Array<FacetValueTranslationInput>;
};
Expand Down Expand Up @@ -841,9 +845,13 @@ export type CreatePaymentMethodInput = {
translations: Array<PaymentMethodTranslationInput>;
};

export type CreateProductCustomFieldsInput = {
testId?: InputMaybe<Scalars['ID']['input']>;
};

export type CreateProductInput = {
assetIds?: InputMaybe<Array<Scalars['ID']['input']>>;
customFields?: InputMaybe<Scalars['JSON']['input']>;
customFields?: InputMaybe<CreateProductCustomFieldsInput>;
enabled?: InputMaybe<Scalars['Boolean']['input']>;
facetValueIds?: InputMaybe<Array<Scalars['ID']['input']>>;
featuredAssetId?: InputMaybe<Scalars['ID']['input']>;
Expand All @@ -864,9 +872,13 @@ export type CreateProductOptionInput = {
translations: Array<ProductOptionGroupTranslationInput>;
};

export type CreateProductVariantCustomFieldsInput = {
test?: InputMaybe<Scalars['String']['input']>;
};

export type CreateProductVariantInput = {
assetIds?: InputMaybe<Array<Scalars['ID']['input']>>;
customFields?: InputMaybe<Scalars['JSON']['input']>;
customFields?: InputMaybe<CreateProductVariantCustomFieldsInput>;
facetValueIds?: InputMaybe<Array<Scalars['ID']['input']>>;
featuredAssetId?: InputMaybe<Scalars['ID']['input']>;
optionIds?: InputMaybe<Array<Scalars['ID']['input']>>;
Expand Down Expand Up @@ -1325,7 +1337,7 @@ export type CustomFieldConfig =

/**
* This type is deprecated in v2.2 in favor of the EntityCustomFields type,
* which allows custom fields to be defined on user-supplies entities.
* which allows custom fields to be defined on user-supplied entities.
*/
export type CustomFields = {
Address: Array<CustomFieldConfig>;
Expand Down Expand Up @@ -1728,7 +1740,7 @@ export type FacetTranslationInput = {
export type FacetValue = Node & {
code: Scalars['String']['output'];
createdAt: Scalars['DateTime']['output'];
customFields?: Maybe<Scalars['JSON']['output']>;
customFields?: Maybe<FacetValueCustomFields>;
facet: Facet;
facetId: Scalars['ID']['output'];
id: Scalars['ID']['output'];
Expand All @@ -1738,6 +1750,10 @@ export type FacetValue = Node & {
updatedAt: Scalars['DateTime']['output'];
};

export type FacetValueCustomFields = {
childFacetValue?: Maybe<FacetValue>;
};

/**
* Used to construct boolean expressions for filtering search results
* by FacetValue ID. Examples:
Expand Down Expand Up @@ -1791,6 +1807,7 @@ export type FacetValueResult = {
};

export type FacetValueSortParameter = {
childFacetValue?: InputMaybe<SortOrder>;
code?: InputMaybe<SortOrder>;
createdAt?: InputMaybe<SortOrder>;
facetId?: InputMaybe<SortOrder>;
Expand Down Expand Up @@ -4312,7 +4329,7 @@ export type Product = Node & {
channels: Array<Channel>;
collections: Array<Collection>;
createdAt: Scalars['DateTime']['output'];
customFields?: Maybe<Scalars['JSON']['output']>;
customFields?: Maybe<ProductCustomFields>;
description: Scalars['String']['output'];
enabled: Scalars['Boolean']['output'];
facetValues: Array<FacetValue>;
Expand All @@ -4334,6 +4351,10 @@ export type ProductVariantListArgs = {
options?: InputMaybe<ProductVariantListOptions>;
};

export type ProductCustomFields = {
test?: Maybe<Asset>;
};

export type ProductFilterParameter = {
_and?: InputMaybe<Array<ProductFilterParameter>>;
_or?: InputMaybe<Array<ProductFilterParameter>>;
Expand Down Expand Up @@ -4435,6 +4456,7 @@ export type ProductSortParameter = {
id?: InputMaybe<SortOrder>;
name?: InputMaybe<SortOrder>;
slug?: InputMaybe<SortOrder>;
test?: InputMaybe<SortOrder>;
updatedAt?: InputMaybe<SortOrder>;
};

Expand Down Expand Up @@ -4462,7 +4484,7 @@ export type ProductVariant = Node & {
channels: Array<Channel>;
createdAt: Scalars['DateTime']['output'];
currencyCode: CurrencyCode;
customFields?: Maybe<Scalars['JSON']['output']>;
customFields?: Maybe<ProductVariantCustomFields>;
enabled: Scalars['Boolean']['output'];
facetValues: Array<FacetValue>;
featuredAsset?: Maybe<Asset>;
Expand Down Expand Up @@ -4496,6 +4518,10 @@ export type ProductVariantStockMovementsArgs = {
options?: InputMaybe<StockMovementListOptions>;
};

export type ProductVariantCustomFields = {
test?: Maybe<Scalars['String']['output']>;
};

export type ProductVariantFilterParameter = {
_and?: InputMaybe<Array<ProductVariantFilterParameter>>;
_or?: InputMaybe<Array<ProductVariantFilterParameter>>;
Expand All @@ -4514,6 +4540,7 @@ export type ProductVariantFilterParameter = {
stockAllocated?: InputMaybe<NumberOperators>;
stockLevel?: InputMaybe<StringOperators>;
stockOnHand?: InputMaybe<NumberOperators>;
test?: InputMaybe<StringOperators>;
trackInventory?: InputMaybe<StringOperators>;
updatedAt?: InputMaybe<DateOperators>;
useGlobalOutOfStockThreshold?: InputMaybe<BooleanOperators>;
Expand All @@ -4539,10 +4566,16 @@ export type ProductVariantListOptions = {

export type ProductVariantPrice = {
currencyCode: CurrencyCode;
customFields?: Maybe<Scalars['JSON']['output']>;
customFields?: Maybe<ProductVariantPriceCustomFields>;
price: Scalars['Money']['output'];
};

export type ProductVariantPriceCustomFields = {
onSale?: Maybe<Scalars['Boolean']['output']>;
retailPrice?: Maybe<Scalars['Int']['output']>;
salePrice?: Maybe<Scalars['Int']['output']>;
};

/**
* Used to set up update the price of a ProductVariant in a particular Channel.
* If the `delete` flag is `true`, the price will be deleted for the given Channel.
Expand All @@ -4565,6 +4598,7 @@ export type ProductVariantSortParameter = {
stockAllocated?: InputMaybe<SortOrder>;
stockLevel?: InputMaybe<SortOrder>;
stockOnHand?: InputMaybe<SortOrder>;
test?: InputMaybe<SortOrder>;
updatedAt?: InputMaybe<SortOrder>;
};

Expand Down Expand Up @@ -5087,18 +5121,19 @@ export type RefundLine = {
};

export type RefundOrderInput = {
adjustment: Scalars['Money']['input'];
/** @deprecated Use the `amount` field instead */
adjustment?: InputMaybe<Scalars['Money']['input']>;
/**
* If an amount is specified, this value will be used to create a Refund rather than calculating the
* amount automatically. This was added in v2.2 and will be the preferred way to specify the refund
* amount in the future. The `lines`, `shipping` and `adjustment` fields will likely be removed in a future
* version.
* The amount to be refunded to this particular payment. This was introduced in v2.2.0 as the preferred way to specify the refund amount.
* Can be as much as the total amount of the payment minus the sum of all previous refunds.
*/
amount?: InputMaybe<Scalars['Money']['input']>;
lines: Array<OrderLineInput>;
/** @deprecated Use the `amount` field instead */
lines?: InputMaybe<Array<OrderLineInput>>;
paymentId: Scalars['ID']['input'];
reason?: InputMaybe<Scalars['String']['input']>;
shipping: Scalars['Money']['input'];
/** @deprecated Use the `amount` field instead */
shipping?: InputMaybe<Scalars['Money']['input']>;
};

export type RefundOrderResult =
Expand Down Expand Up @@ -6038,9 +6073,13 @@ export type UpdateFacetInput = {
translations?: InputMaybe<Array<FacetTranslationInput>>;
};

export type UpdateFacetValueCustomFieldsInput = {
childFacetValueId?: InputMaybe<Scalars['ID']['input']>;
};

export type UpdateFacetValueInput = {
code?: InputMaybe<Scalars['String']['input']>;
customFields?: InputMaybe<Scalars['JSON']['input']>;
customFields?: InputMaybe<UpdateFacetValueCustomFieldsInput>;
id: Scalars['ID']['input'];
translations?: InputMaybe<Array<FacetValueTranslationInput>>;
};
Expand Down Expand Up @@ -6094,9 +6133,13 @@ export type UpdatePaymentMethodInput = {
translations?: InputMaybe<Array<PaymentMethodTranslationInput>>;
};

export type UpdateProductCustomFieldsInput = {
testId?: InputMaybe<Scalars['ID']['input']>;
};

export type UpdateProductInput = {
assetIds?: InputMaybe<Array<Scalars['ID']['input']>>;
customFields?: InputMaybe<Scalars['JSON']['input']>;
customFields?: InputMaybe<UpdateProductCustomFieldsInput>;
enabled?: InputMaybe<Scalars['Boolean']['input']>;
facetValueIds?: InputMaybe<Array<Scalars['ID']['input']>>;
featuredAssetId?: InputMaybe<Scalars['ID']['input']>;
Expand All @@ -6118,9 +6161,13 @@ export type UpdateProductOptionInput = {
translations?: InputMaybe<Array<ProductOptionGroupTranslationInput>>;
};

export type UpdateProductVariantCustomFieldsInput = {
test?: InputMaybe<Scalars['String']['input']>;
};

export type UpdateProductVariantInput = {
assetIds?: InputMaybe<Array<Scalars['ID']['input']>>;
customFields?: InputMaybe<Scalars['JSON']['input']>;
customFields?: InputMaybe<UpdateProductVariantCustomFieldsInput>;
enabled?: InputMaybe<Scalars['Boolean']['input']>;
facetValueIds?: InputMaybe<Array<Scalars['ID']['input']>>;
featuredAssetId?: InputMaybe<Scalars['ID']['input']>;
Expand Down
25 changes: 22 additions & 3 deletions packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ export type FacetValue = Node & {
__typename?: 'FacetValue';
code: Scalars['String']['output'];
createdAt: Scalars['DateTime']['output'];
customFields?: Maybe<Scalars['JSON']['output']>;
customFields?: Maybe<FacetValueCustomFields>;
facet: Facet;
facetId: Scalars['ID']['output'];
id: Scalars['ID']['output'];
Expand All @@ -1030,6 +1030,11 @@ export type FacetValue = Node & {
updatedAt: Scalars['DateTime']['output'];
};

export type FacetValueCustomFields = {
__typename?: 'FacetValueCustomFields';
childFacetValue?: Maybe<FacetValue>;
};

/**
* Used to construct boolean expressions for filtering search results
* by FacetValue ID. Examples:
Expand Down Expand Up @@ -1085,6 +1090,7 @@ export type FacetValueResult = {
};

export type FacetValueSortParameter = {
childFacetValue?: InputMaybe<SortOrder>;
code?: InputMaybe<SortOrder>;
createdAt?: InputMaybe<SortOrder>;
facetId?: InputMaybe<SortOrder>;
Expand Down Expand Up @@ -2567,7 +2573,7 @@ export type Product = Node & {
assets: Array<Asset>;
collections: Array<Collection>;
createdAt: Scalars['DateTime']['output'];
customFields?: Maybe<Scalars['JSON']['output']>;
customFields?: Maybe<ProductCustomFields>;
description: Scalars['String']['output'];
enabled: Scalars['Boolean']['output'];
facetValues: Array<FacetValue>;
Expand All @@ -2589,6 +2595,11 @@ export type ProductVariantListArgs = {
options?: InputMaybe<ProductVariantListOptions>;
};

export type ProductCustomFields = {
__typename?: 'ProductCustomFields';
test?: Maybe<Asset>;
};

export type ProductFilterParameter = {
_and?: InputMaybe<Array<ProductFilterParameter>>;
_or?: InputMaybe<Array<ProductFilterParameter>>;
Expand Down Expand Up @@ -2672,6 +2683,7 @@ export type ProductSortParameter = {
id?: InputMaybe<SortOrder>;
name?: InputMaybe<SortOrder>;
slug?: InputMaybe<SortOrder>;
test?: InputMaybe<SortOrder>;
updatedAt?: InputMaybe<SortOrder>;
};

Expand All @@ -2691,7 +2703,7 @@ export type ProductVariant = Node & {
assets: Array<Asset>;
createdAt: Scalars['DateTime']['output'];
currencyCode: CurrencyCode;
customFields?: Maybe<Scalars['JSON']['output']>;
customFields?: Maybe<ProductVariantCustomFields>;
facetValues: Array<FacetValue>;
featuredAsset?: Maybe<Asset>;
id: Scalars['ID']['output'];
Expand All @@ -2710,6 +2722,11 @@ export type ProductVariant = Node & {
updatedAt: Scalars['DateTime']['output'];
};

export type ProductVariantCustomFields = {
__typename?: 'ProductVariantCustomFields';
test?: Maybe<Scalars['String']['output']>;
};

export type ProductVariantFilterParameter = {
_and?: InputMaybe<Array<ProductVariantFilterParameter>>;
_or?: InputMaybe<Array<ProductVariantFilterParameter>>;
Expand All @@ -2723,6 +2740,7 @@ export type ProductVariantFilterParameter = {
productId?: InputMaybe<IdOperators>;
sku?: InputMaybe<StringOperators>;
stockLevel?: InputMaybe<StringOperators>;
test?: InputMaybe<StringOperators>;
updatedAt?: InputMaybe<DateOperators>;
};

Expand Down Expand Up @@ -2754,6 +2772,7 @@ export type ProductVariantSortParameter = {
productId?: InputMaybe<SortOrder>;
sku?: InputMaybe<SortOrder>;
stockLevel?: InputMaybe<SortOrder>;
test?: InputMaybe<SortOrder>;
updatedAt?: InputMaybe<SortOrder>;
};

Expand Down
Loading

0 comments on commit 0a960e6

Please sign in to comment.