Skip to content

Commit

Permalink
feat: adding upc identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikZed committed Nov 8, 2023
1 parent ba5275b commit b7cbb08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/integration-kencove-api/src/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,7 @@ export class KencoveApiAppProductSyncService {
},
create: {
id: id.id("variant"),
ean: variant.upc,
sku,
weight: variant.weight,
variantName,
Expand Down Expand Up @@ -1455,6 +1456,7 @@ export class KencoveApiAppProductSyncService {
update: {
weight: variant.weight,
variantName,
ean: variant.upc,
product: {
connect: {
id: existingProduct.id,
Expand All @@ -1468,7 +1470,8 @@ export class KencoveApiAppProductSyncService {
*/
existingVariant.weight !== variant.weight ||
existingVariant.variantName !== variantName ||
existingVariant.productId !== existingProduct.id
existingVariant.productId !== existingProduct.id ||
existingVariant.ean !== variant.upc
) {
this.logger.info(
`Updating variant ${variant.id} of product ${product.productName}`,
Expand All @@ -1480,6 +1483,7 @@ export class KencoveApiAppProductSyncService {
data: {
weight: variant.weight,
variantName,
ean: variant.upc,
product: {
connect: {
id: existingProduct.id,
Expand Down
4 changes: 4 additions & 0 deletions pkg/integration-kencove-api/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ export type KencoveApiProductVariant = {
*/
selectorValues: KencoveApiAttributeInProduct[];
attributeValues: KencoveApiAttributeInProduct[] | null;
/**
* UPC is unique identifier EAN / GTIN
*/
upc: string | null;
name: string;
createdAt: string;
updatedAt: string;
Expand Down

1 comment on commit b7cbb08

@vercel
Copy link

@vercel vercel bot commented on b7cbb08 Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.