Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production release of producer bugfixes #54

Merged
merged 5 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/deploy-main-hodmedod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Create and publish a Docker image

on:
push:
branches: ["main"]

jobs:
build-and-push-image:
permissions:
contents: read
packages: write
attestations: write
id-token: write
uses: ./.github/workflows/build-and-deploy-prod.yml
with:
jelastic_env: fdc-producer
secrets: inherit
17 changes: 0 additions & 17 deletions .github/workflows/deploy-main.yml

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"generate": "shopify app generate",
"deploy": "shopify app deploy",
"test": "jest --runInBand --detectOpenHandles --forceExit web/${0}",
"acceptance-test": "jest --runInBand --detectOpenHandles --forceExit acceptance-tests/",
"build:db": "node ./web/database/build.js"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion web/api-modules/products/use-cases/get-products.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const toProduct = (product) => ({
async function findProducts(client) {
const response = await client.request(`
{
products(first: 250) {
products(first: 250, sortKey: TITLE) {
edges {
node {
id
Expand Down
9 changes: 7 additions & 2 deletions web/connector/productUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { throwError } from '../utils/index.js';
import loadConnectorWithResources from './index.js';
import loadProductTypes from './mappedProductTypes.js';
import config from '../config.js';
import currencyMeasureFor from '../utils/currencyMeasureFor.js';

const createQuantitativeValue = (connector, value, unit) =>
connector.createQuantity({
Expand Down Expand Up @@ -45,7 +46,6 @@ async function createVariantSuppliedProduct(
try {
const connector = await loadConnectorWithResources();
const kilogram = connector.MEASURES.UNIT.QUANTITYUNIT.KILOGRAM;
const euro = connector.MEASURES.UNIT.CURRENCYUNIT.EURO;

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

Expand All @@ -55,7 +55,12 @@ async function createVariantSuppliedProduct(
kilogram
);
const hasVat = variant.taxable ? 1.0 : 0.0; // TODO check how the vat rate can be added
const price = createPrice(connector, variant.price, euro, hasVat);
const price = createPrice(
connector,
variant.price,
currencyMeasureFor(connector, variant.currencyCode),
hasVat
);
const offer = createOffer(connector, semanticBase, price);
const inventoryQuantity =
variant.inventoryPolicy === 'CONTINUE' ? -1 : variant.inventoryQuantity;
Expand Down
Loading
Loading