-
-
-
- ui-organizations.integration.edi.accountNumbers
-
-
-
- NoValue
-
-
-
-
{
const accounts = organization.accounts.map(({ accountNo }) => accountNo);
@@ -65,3 +70,67 @@ export const getDefaultEdiNamingConvention = () => (
join('-'),
)(EDI_NAMING_TOKENS)
);
+
+export const getIntegrationTypeOptions = (intl) => {
+ return Object.entries(INTEGRATION_TYPE).map(([key, value]) => ({
+ label: intl.formatMessage({ id: `ui-organizations.integration.info.integrationType.${key}` }),
+ value,
+ }));
+};
+
+export const getTransmissionMethodOptions = (intl) => {
+ return Object.entries(TRANSMISSION_METHOD).map(([key, value]) => ({
+ label: intl.formatMessage({ id: `ui-organizations.integration.info.transmissionMethod.${key}` }),
+ value,
+ }));
+};
+
+export const getFileFormatOptions = () => {
+ return Object.values(FILE_FORMAT).map((value) => ({
+ label: value,
+ value,
+ }));
+};
+
+export const isFileFormat = (config, type) => {
+ const integrationType = config
+ ?.exportTypeSpecificParameters
+ ?.vendorEdiOrdersExportConfig
+ ?.fileFormat;
+
+ return integrationType === type;
+};
+
+export const isFileFormatEDI = (config) => {
+ return isFileFormat(config, FILE_FORMAT.edi);
+};
+
+export const isTransmissionMethod = (config, type) => {
+ const transmissionMethod = config
+ ?.exportTypeSpecificParameters
+ ?.vendorEdiOrdersExportConfig
+ ?.transmissionMethod;
+
+ return transmissionMethod === type;
+};
+
+export const isTransmissionMethodFTP = (config) => {
+ return isTransmissionMethod(config, TRANSMISSION_METHOD.ftp);
+};
+
+export const isIntegrationType = (config, type) => {
+ const integrationType = config
+ ?.exportTypeSpecificParameters
+ ?.vendorEdiOrdersExportConfig
+ ?.integrationType;
+
+ return integrationType === type;
+};
+
+export const isClaimingIntegration = (config) => {
+ return isIntegrationType(config, INTEGRATION_TYPE.claiming);
+};
+
+export const isOrderingIntegration = (config) => {
+ return isIntegrationType(config, INTEGRATION_TYPE.ordering);
+};
diff --git a/translations/ui-organizations/en.json b/translations/ui-organizations/en.json
index 083d0197..4260e74a 100644
--- a/translations/ui-organizations/en.json
+++ b/translations/ui-organizations/en.json
@@ -371,6 +371,13 @@
"integration.info.configName": "Integration name",
"integration.info.configDescription": "Description",
"integration.info.isDefaultConfig": "Default integration",
+ "integration.info.integrationType": "Integration type",
+ "integration.info.integrationType.claiming": "Claiming",
+ "integration.info.integrationType.ordering": "Ordering",
+ "integration.info.transmissionMethod": "Transmission method",
+ "integration.info.transmissionMethod.fileDownLoad": "File download",
+ "integration.info.transmissionMethod.ftp": "FTP",
+ "integration.info.fileFormat": "File format",
"integration.edi": "EDI configuration",
"integration.edi.accountNumbers": "Account numbers",
"integration.edi.defaultAcquisitionMethods": "Automate order export for acquisition methods",