Skip to content

Commit c9d571c

Browse files
authored
Merge pull request #54 from yalla-coop/staging
Production release of producer bugfixes
2 parents bec685e + a3ce029 commit c9d571c

File tree

8 files changed

+300
-193
lines changed

8 files changed

+300
-193
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Create and publish a Docker image
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
jobs:
8+
build-and-push-image:
9+
permissions:
10+
contents: read
11+
packages: write
12+
attestations: write
13+
id-token: write
14+
uses: ./.github/workflows/build-and-deploy-prod.yml
15+
with:
16+
jelastic_env: fdc-producer
17+
secrets: inherit

.github/workflows/deploy-main.yml

-17
This file was deleted.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"generate": "shopify app generate",
1212
"deploy": "shopify app deploy",
1313
"test": "jest --runInBand --detectOpenHandles --forceExit web/${0}",
14+
"acceptance-test": "jest --runInBand --detectOpenHandles --forceExit acceptance-tests/",
1415
"build:db": "node ./web/database/build.js"
1516
},
1617
"dependencies": {

web/api-modules/products/use-cases/get-products.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const toProduct = (product) => ({
1414
async function findProducts(client) {
1515
const response = await client.request(`
1616
{
17-
products(first: 250) {
17+
products(first: 250, sortKey: TITLE) {
1818
edges {
1919
node {
2020
id

web/connector/productUtils.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { throwError } from '../utils/index.js';
22
import loadConnectorWithResources from './index.js';
33
import loadProductTypes from './mappedProductTypes.js';
44
import config from '../config.js';
5+
import currencyMeasureFor from '../utils/currencyMeasureFor.js';
56

67
const createQuantitativeValue = (connector, value, unit) =>
78
connector.createQuantity({
@@ -45,7 +46,6 @@ async function createVariantSuppliedProduct(
4546
try {
4647
const connector = await loadConnectorWithResources();
4748
const kilogram = connector.MEASURES.UNIT.QUANTITYUNIT.KILOGRAM;
48-
const euro = connector.MEASURES.UNIT.CURRENCYUNIT.EURO;
4949

5050
const semanticBase = `${config.PRODUCER_SHOP_URL}api/dfc/Enterprises/${enterpriseName}/SuppliedProducts/${variant.id}`;
5151

@@ -55,7 +55,12 @@ async function createVariantSuppliedProduct(
5555
kilogram
5656
);
5757
const hasVat = variant.taxable ? 1.0 : 0.0; // TODO check how the vat rate can be added
58-
const price = createPrice(connector, variant.price, euro, hasVat);
58+
const price = createPrice(
59+
connector,
60+
variant.price,
61+
currencyMeasureFor(connector, variant.currencyCode),
62+
hasVat
63+
);
5964
const offer = createOffer(connector, semanticBase, price);
6065
const inventoryQuantity =
6166
variant.inventoryPolicy === 'CONTINUE' ? -1 : variant.inventoryQuantity;

0 commit comments

Comments
 (0)