Skip to content

Commit

Permalink
Merge pull request #54 from yalla-coop/staging
Browse files Browse the repository at this point in the history
Production release of producer bugfixes
  • Loading branch information
ajluker authored Oct 14, 2024
2 parents bec685e + a3ce029 commit c9d571c
Show file tree
Hide file tree
Showing 8 changed files with 300 additions and 193 deletions.
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

0 comments on commit c9d571c

Please sign in to comment.