Skip to content

Commit

Permalink
FCT-575: feat(goodstore-dataset): add channel specific prices and inv…
Browse files Browse the repository at this point in the history
…entory entries (#593)

* feat(goodstore-dataset): add channel specific prices and inventory channel specific inventory entries

* fix(goodstore): add lockfile

* fix(goodstore): update affected product draft tests

* fix(goodstore): lockfile surgery

* fix(goodstore): adjust casing for channel specific prices and inventory entries
  • Loading branch information
tylermorrisford authored May 24, 2024
1 parent 81044fb commit a5c62fb
Show file tree
Hide file tree
Showing 59 changed files with 7,017 additions and 5,316 deletions.
6 changes: 6 additions & 0 deletions .changeset/eighty-ladybugs-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools-test-data/inventory-entry': patch
'@commercetools-test-data/product': patch
---

Adds Channel-specific Prices and Inventory Entries.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ describe('With skuARG56 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "ARG-56",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand All @@ -31,7 +34,10 @@ describe('With skuARG56 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "ARG-56",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ChannelDraft, TChannelDraft } from '@commercetools-test-data/channel';
import { KeyReferenceDraft } from '@commercetools-test-data/commons';
import {
ProductVariantDraft,
type TProductVariantDraft,
Expand All @@ -9,10 +11,17 @@ const ashenRug01Preset = ProductVariantDraft.presets.sampleDataGoodStore
.ashenRug01()
.build<TProductVariantDraft>();

const inventoryChannel = ChannelDraft.presets.sampleDataGoodStore
.inventoryChannel()
.build<TChannelDraft>();

const skuARG56 = (): TInventoryEntryDraftBuilder =>
InventoryEntryDraft.presets
.empty()
.sku(ashenRug01Preset.sku!)
.supplyChannel(
KeyReferenceDraft.presets.channel().key(inventoryChannel.key!)
)
.quantityOnStock(100);

export default skuARG56;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ describe('With skuBLP01 preset', () => {
"quantityOnStock": 80,
"restockableInDays": undefined,
"sku": "BLP-01",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand All @@ -31,7 +34,10 @@ describe('With skuBLP01 preset', () => {
"quantityOnStock": 80,
"restockableInDays": undefined,
"sku": "BLP-01",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ChannelDraft, TChannelDraft } from '@commercetools-test-data/channel';
import { KeyReferenceDraft } from '@commercetools-test-data/commons';
import {
ProductVariantDraft,
type TProductVariantDraft,
Expand All @@ -10,10 +12,17 @@ const purpleLandscapePainting01Preset =
.purpleLandscapePainting01()
.build<TProductVariantDraft>();

const inventoryChannel = ChannelDraft.presets.sampleDataGoodStore
.inventoryChannel()
.build<TChannelDraft>();

const skuBLP01 = (): TInventoryEntryDraftBuilder =>
InventoryEntryDraft.presets
.empty()
.sku(purpleLandscapePainting01Preset.sku!)
.supplyChannel(
KeyReferenceDraft.presets.channel().key(inventoryChannel.key!)
)
.quantityOnStock(80);

export default skuBLP01;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ describe('With skuCCG02 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "CCG-02",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand All @@ -31,7 +34,10 @@ describe('With skuCCG02 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "CCG-02",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ChannelDraft, TChannelDraft } from '@commercetools-test-data/channel';
import { KeyReferenceDraft } from '@commercetools-test-data/commons';
import {
ProductVariantDraft,
type TProductVariantDraft,
Expand All @@ -10,10 +12,17 @@ const clinkChampagneGlass01Preset =
.clinkChampagneGlass01()
.build<TProductVariantDraft>();

const inventoryChannel = ChannelDraft.presets.sampleDataGoodStore
.inventoryChannel()
.build<TChannelDraft>();

const skuCCG02 = (): TInventoryEntryDraftBuilder =>
InventoryEntryDraft.presets
.empty()
.sku(clinkChampagneGlass01Preset.sku!)
.supplyChannel(
KeyReferenceDraft.presets.channel().key(inventoryChannel.key!)
)
.quantityOnStock(100);

export default skuCCG02;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ describe('With skuCR098 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "CR-098",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand All @@ -31,7 +34,10 @@ describe('With skuCR098 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "CR-098",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ChannelDraft, TChannelDraft } from '@commercetools-test-data/channel';
import { KeyReferenceDraft } from '@commercetools-test-data/commons';
import {
ProductVariantDraft,
type TProductVariantDraft,
Expand All @@ -9,10 +11,17 @@ const cobblestoneRug01Preset = ProductVariantDraft.presets.sampleDataGoodStore
.cobblestoneRug01()
.build<TProductVariantDraft>();

const inventoryChannel = ChannelDraft.presets.sampleDataGoodStore
.inventoryChannel()
.build<TChannelDraft>();

const skuCR098 = (): TInventoryEntryDraftBuilder =>
InventoryEntryDraft.presets
.empty()
.sku(cobblestoneRug01Preset.sku!)
.supplyChannel(
KeyReferenceDraft.presets.channel().key(inventoryChannel.key!)
)
.quantityOnStock(100);

export default skuCR098;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ describe('With skuNTSS01 preset', () => {
"quantityOnStock": 97,
"restockableInDays": undefined,
"sku": "NTSS-01",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand All @@ -31,7 +34,10 @@ describe('With skuNTSS01 preset', () => {
"quantityOnStock": 97,
"restockableInDays": undefined,
"sku": "NTSS-01",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ChannelDraft, TChannelDraft } from '@commercetools-test-data/channel';
import { KeyReferenceDraft } from '@commercetools-test-data/commons';
import {
ProductVariantDraft,
type TProductVariantDraft,
Expand All @@ -10,10 +12,17 @@ const nalaTwoSeaterSofa01Preset =
.nalaTwoSeaterSofa01()
.build<TProductVariantDraft>();

const inventoryChannel = ChannelDraft.presets.sampleDataGoodStore
.inventoryChannel()
.build<TChannelDraft>();

const skuNTSS01 = (): TInventoryEntryDraftBuilder =>
InventoryEntryDraft.presets
.empty()
.sku(nalaTwoSeaterSofa01Preset.sku!)
.supplyChannel(
KeyReferenceDraft.presets.channel().key(inventoryChannel.key!)
)
.quantityOnStock(97);

export default skuNTSS01;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ describe('With skuPMAP01 preset', () => {
"quantityOnStock": 91,
"restockableInDays": undefined,
"sku": "PMAP-01",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand All @@ -31,7 +34,10 @@ describe('With skuPMAP01 preset', () => {
"quantityOnStock": 91,
"restockableInDays": undefined,
"sku": "PMAP-01",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ChannelDraft, TChannelDraft } from '@commercetools-test-data/channel';
import { KeyReferenceDraft } from '@commercetools-test-data/commons';
import {
ProductVariantDraft,
type TProductVariantDraft,
Expand All @@ -10,10 +12,17 @@ const purpleMinimalistAbstractPainting01Preset =
.purpleMinimalistAbstractPainting01()
.build<TProductVariantDraft>();

const inventoryChannel = ChannelDraft.presets.sampleDataGoodStore
.inventoryChannel()
.build<TChannelDraft>();

const skuPMAP01 = (): TInventoryEntryDraftBuilder =>
InventoryEntryDraft.presets
.empty()
.sku(purpleMinimalistAbstractPainting01Preset.sku!)
.supplyChannel(
KeyReferenceDraft.presets.channel().key(inventoryChannel.key!)
)
.quantityOnStock(91);

export default skuPMAP01;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ describe('With skuRB01 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "RB-01",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand All @@ -31,7 +34,10 @@ describe('With skuRB01 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "RB-01",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ChannelDraft, TChannelDraft } from '@commercetools-test-data/channel';
import { KeyReferenceDraft } from '@commercetools-test-data/commons';
import {
ProductVariantDraft,
type TProductVariantDraft,
Expand All @@ -9,10 +11,17 @@ const rusticBowl01Preset = ProductVariantDraft.presets.sampleDataGoodStore
.rusticBowl01()
.build<TProductVariantDraft>();

const inventoryChannel = ChannelDraft.presets.sampleDataGoodStore
.inventoryChannel()
.build<TChannelDraft>();

const skuRB01 = (): TInventoryEntryDraftBuilder =>
InventoryEntryDraft.presets
.empty()
.sku(rusticBowl01Preset.sku!)
.supplyChannel(
KeyReferenceDraft.presets.channel().key(inventoryChannel.key!)
)
.quantityOnStock(100);

export default skuRB01;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ describe('With skuSTRA095 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "STRA-095",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand All @@ -31,7 +34,10 @@ describe('With skuSTRA095 preset', () => {
"quantityOnStock": 100,
"restockableInDays": undefined,
"sku": "STRA-095",
"supplyChannel": undefined,
"supplyChannel": {
"key": "inventory-channel",
"typeId": "channel",
},
}
`);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ChannelDraft, TChannelDraft } from '@commercetools-test-data/channel';
import { KeyReferenceDraft } from '@commercetools-test-data/commons';
import {
ProductVariantDraft,
type TProductVariantDraft,
Expand All @@ -9,10 +11,17 @@ const cocktailStrainer01Preset = ProductVariantDraft.presets.sampleDataGoodStore
.cocktailStrainer01()
.build<TProductVariantDraft>();

const inventoryChannel = ChannelDraft.presets.sampleDataGoodStore
.inventoryChannel()
.build<TChannelDraft>();

const skuSTRA095 = (): TInventoryEntryDraftBuilder =>
InventoryEntryDraft.presets
.empty()
.sku(cocktailStrainer01Preset.sku!)
.supplyChannel(
KeyReferenceDraft.presets.channel().key(inventoryChannel.key!)
)
.quantityOnStock(100);

export default skuSTRA095;
Loading

0 comments on commit a5c62fb

Please sign in to comment.