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

UIORGS-442 Change export type on integration type change #668

Merged
merged 1 commit into from
Dec 20, 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { useHistory, useLocation } from 'react-router-dom';
import {
useHistory,
useLocation,
} from 'react-router-dom';

import {
LoadingPane,
Expand All @@ -14,30 +16,30 @@ import {
useAcqMethods,
useIntegrationConfigMutation,
} from '../../common/hooks';

import {
CONNECTION_MODES,
EDI_CODE_TYPES,
EXPORT_TYPES,
FILE_FORMAT,
FTP_TYPES,
INTEGRATION_TYPE,
TRANSMISSION_METHOD,
TRANSMISSION_MODES,
CONNECTION_MODES,
INTEGRATION_TYPE,
} from '../constants';
import { OrganizationIntegrationForm } from '../OrganizationIntegrationForm';
import {
buildAvailableAccounts,
findDefaultIntegration,
getDefaultEdiNamingConvention,
} from '../utils';
import { OrganizationIntegrationForm } from '../OrganizationIntegrationForm';

// should be removed after lotus release
const buildInitialValues = (organization, withMigration) => {
const edi = withMigration ? organization.edi || {} : {};

return {
schedulePeriod: 'NONE',
type: 'EDIFACT_ORDERS_EXPORT',
type: EXPORT_TYPES.claims,
exportTypeSpecificParameters: {
vendorEdiOrdersExportConfig: {
vendorId: organization.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import { validateRequired } from '@folio/stripes-acq-components';

import {
EXPORT_TYPES,
FILE_FORMAT,
INTEGRATION_TYPE,
TRANSMISSION_METHOD,
Expand Down Expand Up @@ -67,11 +68,13 @@ export const IntegrationInfoForm = ({

switch (value) {
case INTEGRATION_TYPE.ordering: {
change('type', EXPORT_TYPES.edifactOrders);
change('exportTypeSpecificParameters.vendorEdiOrdersExportConfig.transmissionMethod', TRANSMISSION_METHOD.ftp);
change('exportTypeSpecificParameters.vendorEdiOrdersExportConfig.fileFormat', FILE_FORMAT.edi);
break;
}
case INTEGRATION_TYPE.claiming: {
change('type', EXPORT_TYPES.claims);
change('exportTypeSpecificParameters.vendorEdiOrdersExportConfig.ediSchedule', null);
break;
}
Expand Down
5 changes: 5 additions & 0 deletions src/OrganizationIntegration/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export const EDI_NAMING_TOKENS = {
numberSequence: 'numberSequence',
};

export const EXPORT_TYPES = {
edifactOrders: 'EDIFACT_ORDERS_EXPORT',
claims: 'CLAIMS',
};

export const INTEGRATION_TYPE = {
claiming: 'Claiming',
ordering: 'Ordering',
Expand Down
Loading