diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..d57c9dbc --- /dev/null +++ b/.babelrc @@ -0,0 +1,12 @@ +{ + "presets": ["@vue/cli-plugin-babel/preset"], + "plugins": [], + "env": { + "development": { + "plugins": ["dynamic-import-node"] + }, + "test": { + "plugins": ["require-context-hook"] + } + } + } \ No newline at end of file diff --git a/.gitignore b/.gitignore index 715e4415..2d7cc10e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ config/local.json config/certs/*.pem .classpath .project + +.talismanrc \ No newline at end of file diff --git a/.jest/register-context.js b/.jest/register-context.js new file mode 100644 index 00000000..950cf6be --- /dev/null +++ b/.jest/register-context.js @@ -0,0 +1,2 @@ +import registerRequireContextHook from 'babel-plugin-require-context-hook/register'; +registerRequireContextHook(); \ No newline at end of file diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index fb82b271..00000000 --- a/babel.config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - presets: [ - // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app - '@vue/cli-plugin-babel/preset' - ], - 'env': { - 'development': { - // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). - // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. - // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html - 'plugins': ['dynamic-import-node'] - } - } -} diff --git a/jest.config.js b/jest.config.js index 143cdc86..1977d3c9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -20,5 +20,8 @@ module.exports = { 'lcov', 'text-summary' ], + "setupFiles": [ + "/.jest/register-context.js" + ], testURL: 'http://localhost/' } diff --git a/package.json b/package.json index 1521d8a0..c9335154 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "scripts": { "start": "vue-cli-service serve", "dev": "vue-cli-service serve", - "lint": "eslint --ext .js,.vue src", + "lint": "eslint --ext .js,.vue src tests", "build:prod": "vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", @@ -32,6 +32,7 @@ "dependencies": { "@toast-ui/vue-editor": "2.5.1", "axios": "0.21.1", + "babel-plugin-require-context-hook": "^1.0.0", "clipboard": "2.0.6", "codemirror": "5.59.2", "core-js": "3.8.3", diff --git a/src/utils/ADempiere/apiConverts/core.js b/src/utils/ADempiere/apiConverts/core.js index 767811ce..04918c10 100644 --- a/src/utils/ADempiere/apiConverts/core.js +++ b/src/utils/ADempiere/apiConverts/core.js @@ -15,134 +15,37 @@ // along with this program. If not, see . import { isEmptyValue } from '../valueUtils' +import { camelizeObjectKeys, renameObjectKey } from '../transformObject' -export function convertContextInfo(contextInfoToConvert) { - if (contextInfoToConvert) { - return { - id: contextInfoToConvert.id, - uuid: contextInfoToConvert.uuid, - name: contextInfoToConvert.name, - description: contextInfoToConvert.description, - sqlStatement: contextInfoToConvert.sql_statement, - isActive: contextInfoToConvert.is_active, - messageText: convertMessageText( - contextInfoToConvert.message_text - ) - } - } - return { - id: undefined, - uuid: undefined, - name: undefined, - description: undefined, - sqlStatement: undefined, - isActive: undefined, - messageText: convertMessageText(undefined) - } -} - -export function convertMessageText(messageTextToConvert) { - if (messageTextToConvert) { - return { - id: messageTextToConvert.id, - // uuid: messageText.uuid, - value: messageTextToConvert.value, - messageType: messageTextToConvert.message_type, - messageText: messageTextToConvert.message_text, - messageTip: messageTextToConvert.message_tip, - isActive: messageTextToConvert.is_active - } - } - return { - id: undefined, - uuid: undefined, - value: undefined, - messageType: undefined, - messageText: undefined, - messageTip: undefined, - isActive: undefined - } -} - -export function convertCriteria(criteriaToConvert) { - return { - tableName: criteriaToConvert.table_name, - query: criteriaToConvert.query, - whereClause: criteriaToConvert.where_clause, - orderByClause: criteriaToConvert.order_by_clause, - referenceUuid: criteriaToConvert.reference_uuid, - // conditionsList: criteriaToConvert.conditions, - valuesList: criteriaToConvert.values, - orderByColumnList: criteriaToConvert.order_by_columns, - limit: criteriaToConvert.limit +export function convertContextInfo(contextInfo) { + if (!contextInfo) { + return { messageText: {}} } + const convertedContextInfo = camelizeObjectKeys(contextInfo) + const messageText = contextInfo.message_text ? camelizeObjectKeys(contextInfo.message_text) : {} + convertedContextInfo.messageText = messageText + return convertedContextInfo } export function convertOrganization(organization) { - const { id, uuid, name, description } = organization - - return { - id, - uuid, - name, - description, - isReadOnly: organization.is_read_only, - duns: organization.duns, - taxId: organization.tax_id, - phone: organization.phone, - phone2: organization.phone2, - fax: organization.fax, - corporateBrandingImage: organization.corporate_branding_image - } + return camelizeObjectKeys(organization) } -export function convertLanguage(languageToConvert) { - return { - language: languageToConvert.language, - languageName: languageToConvert.language_name, - languageISO: languageToConvert.language_iso, - countryCode: languageToConvert.country_code, - isBaseLanguage: languageToConvert.is_base_language, - isSystemLanguage: languageToConvert.is_system_language, - isDecimalPoint: languageToConvert.is_decimal_point, - datePattern: languageToConvert.date_pattern, - timePattern: languageToConvert.time_pattern - } +export function convertLanguage(language) { + const convertedLanguage = camelizeObjectKeys(language) + renameObjectKey(convertedLanguage, 'languageIso', 'languageISO') + return convertedLanguage } -export function convertCountry(countryToConvert) { - const { id, uuid, name, description } = countryToConvert - - return { - id, - uuid, - countryCode: countryToConvert.country_code, - name, - description, - hasRegion: countryToConvert.has_region, - regionName: countryToConvert.region_name, - displaySequence: countryToConvert.display_sequence, - isAddressLinesReverse: countryToConvert.is_address_lines_reverse, - captureSequence: countryToConvert.capture_sequence, - displaySequenceLocal: countryToConvert.display_sequence_local, - isAddressLinesLocalReverse: countryToConvert.is_address_lines_local_reverse, - expressionPostal: countryToConvert.expression_postal, - hasPostalAdd: countryToConvert.has_postal_add, - expressionPhone: countryToConvert.expression_phone, - mediaSize: countryToConvert.media_size, - expressionBankRoutingNo: countryToConvert.expression_bank_routing_no, - expressionBankAccountNo: countryToConvert.expression_bank_account_no, - language: countryToConvert.language, - allowCitiesOutOfList: countryToConvert.allow_cities_out_of_list, - isPostcodeLookup: countryToConvert.is_post_code_lookup, - currency: convertCurrency( - countryToConvert.currency - ) - } +export function convertCountry(country) { + const convertedCountry = camelizeObjectKeys(country) + renameObjectKey(convertedCountry, 'isPostCodeLookup', 'isPostcodeLookup') + convertedCountry.currency = convertCurrency(country.currency) + return convertedCountry } -export function convertCurrency(currencyToConvert) { - if (isEmptyValue(currencyToConvert)) { +function convertCurrency(currency) { + if (isEmptyValue(currency)) { return { id: 0, uuid: '', @@ -153,216 +56,72 @@ export function convertCurrency(currencyToConvert) { costingPrecision: 0 } } - return { - id: currencyToConvert.id, - uuid: currencyToConvert.uuid, - iSOCode: currencyToConvert.iso_code, - curSymbol: currencyToConvert.currency_symbol, - description: currencyToConvert.description, - standardPrecision: currencyToConvert.standard_precision, - costingPrecision: currencyToConvert.costing_precision - } + const convertedCurrency = camelizeObjectKeys(currency) + renameObjectKey(convertedCurrency, 'isoCode', 'iSOCode') + renameObjectKey(convertedCurrency, 'currencySymbol', 'curSymbol') + return convertedCurrency } -export function convertBusinessPartner(businessPartnerToConvert) { - const { id, uuid, name, description } = businessPartnerToConvert - - return { - uuid, - id, - value: businessPartnerToConvert.value, - taxId: businessPartnerToConvert.tax_id, - duns: businessPartnerToConvert.duns, - naics: businessPartnerToConvert.naics, - name, - lastName: businessPartnerToConvert.last_name, - description - } +export function convertBusinessPartner(businessPartner) { + return camelizeObjectKeys(businessPartner) } -export function convertConversionRate(conversionRateToConvert) { - const { id, uuid } = conversionRateToConvert - if (isEmptyValue(conversionRateToConvert.currency_from) && isEmptyValue(conversionRateToConvert.currency_from)) { - return { - uuid, - id, - multiplyRate: conversionRateToConvert.multiply_rate, - divideRate: conversionRateToConvert.divide_rate - } - } - return { - uuid, - id, - conversionTypeUuid: conversionRateToConvert.conversion_type_uuid, - validFrom: conversionRateToConvert.valid_from, - currencyFrom: convertCurrency( - conversionRateToConvert.currency_from - ), - currencyTo: convertCurrency( - conversionRateToConvert.currency_to - ), - multiplyRate: conversionRateToConvert.multiply_rate, - divideRate: conversionRateToConvert.divide_rate +export function convertConversionRate(conversionRate) { + const convertedRate = camelizeObjectKeys(conversionRate) + if (isEmptyValue(conversionRate.currency_from) && isEmptyValue(conversionRate.currency_to)) { + delete convertedRate['validFrom'] + delete convertedRate['conversionTypeUuid'] + return convertedRate } + convertedRate.currencyFrom = convertCurrency(conversionRate.currency_from) + convertedRate.currencyTo = convertCurrency(conversionRate.currency_to) + return convertedRate } -export function convertSalesRepresentative(salesRepresentativeToConvert) { - const { uuid, id, name, description } = salesRepresentativeToConvert - - return { - uuid, - id, - name, - description - } +export function convertSalesRepresentative(salesRepresentative) { + return camelizeObjectKeys(salesRepresentative) } -export function convertBankAccount(bankAccountToConvert) { - if (!bankAccountToConvert) { +export function convertBankAccount(bankAccount) { + if (!bankAccount) { return undefined } - - const { uuid, id, name, description } = bankAccountToConvert - return { - uuid, - id, - name, - accountNo: bankAccountToConvert.account_no, - description, - currency: convertCurrency( - bankAccountToConvert.currency - ), - bban: bankAccountToConvert.bban, - iban: bankAccountToConvert.iban, - creditLimit: bankAccountToConvert.credit_limit, - current_balance: bankAccountToConvert.current_balance, - isDefault: bankAccountToConvert.is_default, - businessPartner: convertBusinessPartner( - bankAccountToConvert.business_partner - ), - bankAccountType: bankAccountToConvert.bank_account_type, - bankAccountTypeName: bankAccountToConvert.bank_account_type_name - } + const convertedBankAccount = camelizeObjectKeys(bankAccount) + convertedBankAccount.currency = convertCurrency(bankAccount.currency) + convertedBankAccount.businessPartner = convertBusinessPartner(bankAccount.business_partner) + return convertedBankAccount } -export function convertDocumentType(documentTypeToConvert) { - if (!documentTypeToConvert) { +export function convertDocumentType(documentType) { + if (!documentType) { return undefined } - const { uuid, id, name, description } = documentTypeToConvert - - return { - uuid, - id, - name, - description, - printName: documentTypeToConvert.print_name - } + return camelizeObjectKeys(documentType) } -export function convertDocumentStatus(documentStatusToConvert) { - const { name, description } = documentStatusToConvert - - return { - name, - description, - value: documentStatusToConvert.value - } +export function convertDocumentStatus(documentStatus) { + return camelizeObjectKeys(documentStatus) } -export function convertPriceList(priceListToConvert) { - const { uuid, id, name, description } = priceListToConvert - - return { - uuid, - id, - name, - description, - currency: convertCurrency( - priceListToConvert.currency - ), - isDefault: priceListToConvert.is_default, - isTaxIncluded: priceListToConvert.is_tax_included, - isEnforcePriceLimit: priceListToConvert.is_enforce_price_limit, - isNetPrice: priceListToConvert.is_net_price, - pricePrecision: priceListToConvert.price_precision - } +export function convertPriceList(priceList) { + const convertedPriceList = camelizeObjectKeys(priceList) + convertedPriceList.currency = convertCurrency(priceList.currency) + return convertedPriceList } -export function convertProductPrice(productPriceToConvert) { - return { - currency: convertCurrency( - productPriceToConvert.currency - ), - taxRate: convertTaxRate( - productPriceToConvert.tax_rate - ), - product: convertProduct( - productPriceToConvert.product - ), - schemaCurrency: convertCurrency( - productPriceToConvert.schema_currency - ), - schemaPriceLimit: productPriceToConvert.schema_price_limit, - schemaPriceList: productPriceToConvert.schema_price_list, - schemaPriceStandard: productPriceToConvert.schema_price_standard, - priceList: productPriceToConvert.price_list, - priceStandard: productPriceToConvert.price_standard, - priceLimit: productPriceToConvert.price_limit, - priceListName: productPriceToConvert.price_list_name, - isTaxIncluded: productPriceToConvert.is_tax_included, - valid_from: productPriceToConvert.validFrom, - pricePrecision: productPriceToConvert.price_precision, - quantityOnHand: productPriceToConvert.quantity_on_hand, - quantityReserved: productPriceToConvert.quantity_reserved, - quantityOrdered: productPriceToConvert.quantity_ordered, - quantityAvailable: productPriceToConvert.quantity_available - } +export function convertProductPrice(productPrice) { + const convertedProductPrice = camelizeObjectKeys(productPrice) + convertedProductPrice.currency = convertCurrency(productPrice.currency) + convertedProductPrice.taxRate = convertTaxRate(productPrice.tax_rate) + convertedProductPrice.product = convertProduct(productPrice.product) + convertedProductPrice.schemaCurrency = convertCurrency(productPrice.schema_currency) + return convertedProductPrice } -export function convertTaxRate(taxRateToConvert) { - return { - name: taxRateToConvert.name, - description: taxRateToConvert.description, - taxIndicator: taxRateToConvert.tax_indicator, - rate: taxRateToConvert.rate - } +export function convertTaxRate(taxRate) { + return camelizeObjectKeys(taxRate) } -export function convertProduct(productToConvert) { - const { uuid, id, name, description, help } = productToConvert - - return { - uuid, - id, - value: productToConvert.value, - name, - help, - documentNote: productToConvert.document_note, - uomName: productToConvert.uom_name, - productType: productToConvert.product_type, - isStocked: productToConvert.is_stocked, - isDropShip: productToConvert.is_drop_ship, - isPurchased: productToConvert.is_purchased, - isSold: productToConvert.is_sold, - imageUrl: productToConvert.image_url, - productCategoryName: productToConvert.product_category_name, - productGroupName: productToConvert.product_group_name, - productClassName: productToConvert.product_class_name, - productClassification_name: productToConvert.product_classification_name, - weight: productToConvert.weight, - volume: productToConvert.volume, - upc: productToConvert.upc, - sku: productToConvert.sku, - shelfWidth: productToConvert.shelf_width, - shelfHeight: productToConvert.shelf_height, - shelfDepth: productToConvert.shelf_depth, - unitsPerPack: productToConvert.units_per_pack, - unitsPerPallet: productToConvert.units_per_pallet, - guaranteeDays: productToConvert.guarantee_days, - descriptionUrl: productToConvert.description_url, - versionNo: productToConvert.version_no, - taxCategory: productToConvert.tax_category, - description - } +export function convertProduct(product) { + return camelizeObjectKeys(product) } diff --git a/src/utils/ADempiere/apiConverts/dashboard.js b/src/utils/ADempiere/apiConverts/dashboard.js index 5dcfddd7..e44d1c9d 100644 --- a/src/utils/ADempiere/apiConverts/dashboard.js +++ b/src/utils/ADempiere/apiConverts/dashboard.js @@ -14,72 +14,27 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -import { convertCriteria } from './core.js' +import { camelizeObjectKeys, renameObjectKey } from '../transformObject.js' -export function convertRecentItemsList(recentItemsListToConvert) { - return { - recordCount: recentItemsListToConvert.record_count, - recentItemsList: recentItemsListToConvert.records.map(recentItem => { - return convertRecentItem(recentItem) - }), - nextPageToken: recentItemsListToConvert.next_page_token - } +export function convertRecentItemsList(recentItemsList) { + const convertedList = camelizeObjectKeys(recentItemsList) + convertedList.recentItemsList = recentItemsList.records.map(item => camelizeObjectKeys(item)) + delete convertedList['records'] + return convertedList } -export function convertRecentItem(recentItemToConvert) { - return { - menuUuid: recentItemToConvert.menu_uuid, - menuName: recentItemToConvert.menu_name, - menuDescription: recentItemToConvert.menu_description, - windowUuid: recentItemToConvert.window_uuid, - tabUuid: recentItemToConvert.tab_uuid, - tableId: recentItemToConvert.table_id, - tableName: recentItemToConvert.table_name, - id: recentItemToConvert.id, - uuid: recentItemToConvert.uuid, - displayName: recentItemToConvert.display_name, - updated: recentItemToConvert.updated, - referenceUuid: recentItemToConvert.reference_uuid, - action: recentItemToConvert.action - } +export function convertFavorite(favorite) { + return camelizeObjectKeys(favorite) } -export function convertFavorite(favoriteToConvert) { - return { - menuUuid: favoriteToConvert.menu_uuid, - menuName: favoriteToConvert.menu_name, - menuDescription: favoriteToConvert.menu_description, - referenceUuid: favoriteToConvert.reference_uuid, - action: favoriteToConvert.action - } +export function convertDashboard(dashboard) { + return camelizeObjectKeys(dashboard) } -export function convertDashboard(dashboardToConvert) { - return { - windowUuid: dashboardToConvert.window_uuid, - browserUuid: dashboardToConvert.browser_uuid, - dashboardName: dashboardToConvert.dashboard_name, - dashboardDescription: dashboardToConvert.dashboard_description, - dashboardHtml: dashboardToConvert.dashboard_html, - columnNo: dashboardToConvert.column_no, - lineNo: dashboardToConvert.line_no, - isCollapsible: dashboardToConvert.is_collapsible, - isOpenByDefault: dashboardToConvert.is_open_by_default, - isEventRequired: dashboardToConvert.is_event_required, - fileName: dashboardToConvert.file_name - } -} - -export function convertPendingDocument(pendingDocumentToConvert) { - return { - windowUuid: pendingDocumentToConvert.window_uuid, - formUuid: pendingDocumentToConvert.form_uuid, - documentName: pendingDocumentToConvert.document_name, - documentDescription: pendingDocumentToConvert.document_description, - sequence: pendingDocumentToConvert.sequence, - recordCount: pendingDocumentToConvert.record_count, - criteria: convertCriteria( - pendingDocumentToConvert.criteria - ) - } +export function convertPendingDocument(pendingDocument) { + const convertedDocument = camelizeObjectKeys(pendingDocument) + convertedDocument.criteria = camelizeObjectKeys(pendingDocument.criteria) + renameObjectKey(convertedDocument.criteria, 'values', 'valuesList') + renameObjectKey(convertedDocument.criteria, 'orderByColumns', 'orderByColumnList') + return convertedDocument } diff --git a/src/utils/ADempiere/apiConverts/dictionary.js b/src/utils/ADempiere/apiConverts/dictionary.js index b1f81ce3..b5a96dd4 100644 --- a/src/utils/ADempiere/apiConverts/dictionary.js +++ b/src/utils/ADempiere/apiConverts/dictionary.js @@ -19,164 +19,49 @@ import { convertFieldGroup } from '@/utils/ADempiere/apiConverts/field.js' import { convertContextInfo } from '@/utils/ADempiere/apiConverts/core.js' +import { camelizeObjectKeys } from '../transformObject' -export function convertProcess(processToConvert) { - return { - accessLevel: processToConvert.access_level, - description: processToConvert.description, - help: processToConvert.help, - id: processToConvert.id, - isActive: processToConvert.is_active, - isDirectPrint: processToConvert.is_direct_print, - isReport: processToConvert.is_report, - name: processToConvert.name, - parameters: processToConvert.parameters.map(parameter => { - return convertField(parameter) - }), - reportExportTypes: processToConvert.report_export_types, // no convert content - showHelp: processToConvert.show_help, - uuid: processToConvert.uuid - } +export function convertProcess(process) { + const convertedProcess = camelizeObjectKeys(process) + convertedProcess.parameters = process.parameters.map(parameter => convertField(parameter)) + return convertedProcess } // Convert report export type export function convertReportExportType(reportExportType) { - return { - name: reportExportType.name, - description: reportExportType.description, - type: reportExportType.type - } + return camelizeObjectKeys(reportExportType) } -export function convertBrowser(browserToConvert) { - // browser definition - return { - // identifier attributes - id: browserToConvert.id, - uuid: browserToConvert.uuid, - viewUuid: browserToConvert.view_uuid, - // - value: browserToConvert.value, - name: browserToConvert.name, - description: browserToConvert.description, - help: browserToConvert.help, - accessLevel: browserToConvert.access_level, - isActive: browserToConvert.is_active, - // - isUpdateable: browserToConvert.is_updateable, - isDeleteable: browserToConvert.is_deleteable, - isSelectedByDefault: browserToConvert.is_selected_by_default, - isCollapsibleByDefault: browserToConvert.is_collapsible_by_default, - isExecutedQueryByDefault: browserToConvert.is_executed_query_by_default, - isShowTotal: browserToConvert.is_show_total, - // search query - query: browserToConvert.query, - whereClause: browserToConvert.where_clause, - orderByClause: browserToConvert.order_by_clause, - // External Reference - window: convertWindow( - browserToConvert.window - ), - process: convertProcess( - browserToConvert.process - ), - // - fields: browserToConvert.fields.map(fieldItem => { - return convertField(fieldItem) - }) - } +export function convertBrowser(browser) { + const convertedBrowser = camelizeObjectKeys(browser) + convertedBrowser.window = convertWindow(browser.window) + convertedBrowser.process = convertProcess(browser.process) + convertedBrowser.fields = browser.fields.map(fieldItem => convertField(fieldItem)) + return convertedBrowser } -export function convertForm(formToConvert) { - return { - id: formToConvert.id, - uuid: formToConvert.uuid, - name: formToConvert.name, - description: formToConvert.description, - help: formToConvert.help, - accessLevel: formToConvert.access_level, - fileName: formToConvert.file_name, - isActive: formToConvert.is_active - } +export function convertForm(form) { + return camelizeObjectKeys(form) } export function convertWindow(windowToConvert) { - return { - id: windowToConvert.id, - uuid: windowToConvert.uuid, - name: windowToConvert.name, - description: windowToConvert.description, - help: windowToConvert.help, - isActive: windowToConvert.is_active, - isSalesTransaction: windowToConvert.is_sales_transaction, - windowType: windowToConvert.window_type, - contextInfo: convertContextInfo( - windowToConvert.context_info - ), - tabs: windowToConvert.tabs.map(tab => { - return convertTab(tab) - }) - } + const convertedWindow = camelizeObjectKeys(windowToConvert) + convertedWindow.contextInfo = convertContextInfo(windowToConvert.context_info) + convertedWindow.tabs = windowToConvert.tabs.map(tab => convertTab(tab)) + return convertedWindow } // convert Tabs -export function convertTab(tabToConvert) { - return { - id: tabToConvert.id, - uuid: tabToConvert.uuid, - name: tabToConvert.name, - description: tabToConvert.description, - help: tabToConvert.help, - tableName: tabToConvert.table_name, - sequence: tabToConvert.sequence, - tabLevel: tabToConvert.tab_level, - isActive: tabToConvert.is_active, - isSingleRow: tabToConvert.is_single_row, - isAdvancedTab: tabToConvert.is_advanced_tab, - isHasTree: tabToConvert.is_has_tree, - isInfoTab: tabToConvert.is_info_tab, - isSortTab: tabToConvert.is_sort_tab, - isTranslationTab: tabToConvert.is_translation_tab, - isReadOnly: tabToConvert.is_read_only, - isInsertRecord: tabToConvert.is_insert_record, - isView: tabToConvert.is_view, - isDeleteable: tabToConvert.is_deleteable, - isDocument: tabToConvert.is_document, - isChangeLog: tabToConvert.is_change_log, - accessLevel: tabToConvert.access_level, - linkColumnName: tabToConvert.link_column_name, - sortOrderColumnName: tabToConvert.sort_order_column_name, - sortYesNoColumnName: tabToConvert.sort_yes_no_column_name, - parentColumnName: tabToConvert.parent_column_name, - displayLogic: tabToConvert.display_logic, - commitWarning: tabToConvert.commit_warning, - query: tabToConvert.query, - whereClause: tabToConvert.where_clause, - orderByClause: tabToConvert.order_by_clause, - parentTabUuid: tabToConvert.parent_tab_uuid, - contextInfo: convertContextInfo( - tabToConvert.context_info - ), - fieldGroup: convertFieldGroup( - tabToConvert.field_group - ), - processes: tabToConvert.processes.map(process => { - return convertProcess(process) - }), - fields: tabToConvert.fields.map(field => { - return convertField(field) - }) - } +export function convertTab(tab) { + const convertedTab = camelizeObjectKeys(tab) + convertedTab.contextInfo = convertContextInfo(tab.context_info) + convertedTab.fieldGroup = convertFieldGroup(tab.field_group) + convertedTab.processes = tab.processes.map(process => convertProcess(process)) + convertedTab.fields = tab.fields.map(field => convertField(field)) + return convertedTab } // Convert Validation Rule -export function convertValidationRule(validationRuleToConvert) { - return { - id: validationRuleToConvert.id, - uuid: validationRuleToConvert.uuid, - name: validationRuleToConvert.name, - description: validationRuleToConvert.description, - validationCode: validationRuleToConvert.validation_code, - type: validationRuleToConvert.type - } +export function convertValidationRule(validationRule) { + return camelizeObjectKeys(validationRule) } diff --git a/src/utils/ADempiere/apiConverts/field.js b/src/utils/ADempiere/apiConverts/field.js index a35c70cc..22526982 100644 --- a/src/utils/ADempiere/apiConverts/field.js +++ b/src/utils/ADempiere/apiConverts/field.js @@ -15,194 +15,64 @@ // along with this program. If not, see . import { convertContextInfo } from '@/utils/ADempiere/apiConverts/core.js' +import { camelizeObjectKeys, renameObjectKey } from '../transformObject' -export function convertField(fieldToConvert) { - return { - // base attributes - id: fieldToConvert.id, - uuid: fieldToConvert.uuid, - name: fieldToConvert.name, - description: fieldToConvert.description, - help: fieldToConvert.help, - columnName: fieldToConvert.column_name, - elementName: fieldToConvert.element_name, - isActive: fieldToConvert.is_active, - // displayed attributes - fieldGroup: convertFieldGroup( - fieldToConvert.Fieldgroup - ), - displayType: fieldToConvert.display_type, - isFieldOnly: fieldToConvert.is_field_only, - isRange: fieldToConvert.is_range, - isSameLine: fieldToConvert.is_same_line, - isEncrypted: fieldToConvert.is_encrypted, // passswords fields - isQuickEntry: fieldToConvert.is_quick_entry, - sequence: fieldToConvert.sequence, - seqNoGrid: fieldToConvert.seq_no_grid, - sortNo: fieldToConvert.sort_no, - identifierSequence: fieldToConvert.identifier_sequence, - // value attributes - formatPattern: fieldToConvert.format_pattern, - vFormat: fieldToConvert.v_format, - defaultValue: fieldToConvert.default_value, - defaultValueTo: fieldToConvert.default_value_to, - fieldLength: fieldToConvert.field_length, - valueMin: fieldToConvert.value_max, - valueMax: fieldToConvert.value_max, - // - isIdentifier: fieldToConvert.is_identifier, - isParent: fieldToConvert.is_parent, - isKey: fieldToConvert.is_key, - isSelectionColumn: fieldToConvert.is_selection_column, - isUpdateable: fieldToConvert.is_updateable, - isAlwaysUpdateable: fieldToConvert.is_always_updateable, - // - isAllowCopy: fieldToConvert.is_allow_copy, - isHeading: fieldToConvert.is_heading, - isAllowLogging: fieldToConvert.is_allow_logging, - isTranslated: fieldToConvert.is_translated, - // - columnSQL: fieldToConvert.column_sql, - // - isDisplayed: fieldToConvert.is_displayed, - isDisplayedGrid: fieldToConvert.is_displayed_grid, - isMandatory: fieldToConvert.is_mandatory, - isReadOnly: fieldToConvert.is_read_only, - // Smart Browser attributes - isQueryCriteria: fieldToConvert.is_query_criteria, - isOrderBy: fieldToConvert.is_order_by, - isinfoOnly: fieldToConvert.is_info_only, - // logics - callout: fieldToConvert.callout, - displayLogic: fieldToConvert.display_logic, - mandatoryLogic: fieldToConvert.mandatory_logic, - readOnlyLogic: fieldToConvert.read_only_logic, - // External info - reference: convertReference( - fieldToConvert.reference - ), - contextInfo: convertContextInfo( - fieldToConvert.context_info - ), - fieldDefinition: convertFieldDefinition( - fieldToConvert.Fielddefinition - ) - } +export function convertField(field) { + const convertedField = camelizeObjectKeys(field) + convertedField.fieldGroup = convertFieldGroup(field.Fieldgroup) + delete convertedField['Fieldgroup'] + convertedField.reference = convertReference(field.reference) + convertedField.contextInfo = convertContextInfo(field.context_info) + convertedField.fieldDefinition = convertFieldDefinition(field.Fielddefinition) + delete convertedField['Fielddefinition'] + convertedField.valueMin = field.value_max + renameObjectKey(convertedField, 'columnSql', 'columnSQL') + return convertedField } -export function convertFieldGroup(fieldGroupToConvert) { - if (fieldGroupToConvert) { - return { - id: fieldGroupToConvert.id, - uuid: fieldGroupToConvert.uuid, - name: fieldGroupToConvert.name, - fieldGroupType: fieldGroupToConvert.field_group_type, - isActive: fieldGroupToConvert.is_active, - // - groupName: fieldGroupToConvert.name, - groupType: fieldGroupToConvert.field_group_type - } - } - return { - id: undefined, - uuid: undefined, - name: undefined, - fieldGroupType: undefined, - isActive: undefined, - // - groupName: undefined, - groupType: undefined +export function convertFieldGroup(fieldGroup) { + if (!fieldGroup) { + return {} } + const convertedFieldGroup = camelizeObjectKeys(fieldGroup) + convertedFieldGroup.groupName = convertedFieldGroup.name + convertedFieldGroup.groupType = convertedFieldGroup.fieldGroupType + return convertedFieldGroup } -export function convertReference(referenceToConvert) { - if (referenceToConvert) { +export function convertReference(reference) { + if (!reference) { return { - tableName: referenceToConvert.table_name, - keyColumnName: referenceToConvert.key_column_name, - displayColumnName: referenceToConvert.display_column_name, - query: referenceToConvert.query, - directQuery: referenceToConvert.direct_query, - validationCode: referenceToConvert.validation_code, - zoomWindows: referenceToConvert.zoom_windows - .map(zoomWindowItem => { - return convertZoomWindow(zoomWindowItem) - }) + zoomWindows: [] } } - return { - tableName: undefined, - keyColumnName: undefined, - displayColumnName: undefined, - query: undefined, - directQuery: undefined, - validationCode: undefined, - zoomWindows: [] - } + const convertedReference = camelizeObjectKeys(reference) + convertedReference.zoomWindows = reference.zoom_windows.map(zoomWindowItem => convertZoomWindow(zoomWindowItem)) + return convertedReference } export function convertZoomWindow(zoomWindowToConvert) { - if (zoomWindowToConvert) { - return { - id: zoomWindowToConvert.id, - uuid: zoomWindowToConvert.uuid, - name: zoomWindowToConvert.name, - description: zoomWindowToConvert.description, - isSalesTransaction: zoomWindowToConvert.is_sales_transaction, - isActive: zoomWindowToConvert.is_active - } - } - return { - id: undefined, - uuid: undefined, - name: undefined, - description: undefined, - isSalesTransaction: undefined, - isActive: undefined + if (!zoomWindowToConvert) { + return {} } + const convertedwindow = camelizeObjectKeys(zoomWindowToConvert) + return convertedwindow } -export function convertFieldDefinition(fieldDefinitionToConvert) { - if (fieldDefinitionToConvert) { - return { - id: fieldDefinitionToConvert.id, - uuid: fieldDefinitionToConvert.uuid, - value: fieldDefinitionToConvert.Value, - name: fieldDefinitionToConvert.name, - isActive: fieldDefinitionToConvert.is_active, - fieldGroupType: fieldDefinitionToConvert.field_group_type, - conditions: fieldDefinitionToConvert.conditions - .map(itemCondition => { - return connvertFieldCondition(itemCondition) - }) - } - } - return { - id: undefined, - uuid: undefined, - value: undefined, - name: undefined, - fieldGroupType: undefined, - isActive: undefined, - conditions: [] +export function convertFieldDefinition(fieldDefinition) { + if (!fieldDefinition) { + return { conditions: [] } } + const convertedDefinition = camelizeObjectKeys(fieldDefinition) + renameObjectKey(convertedDefinition, 'Value', 'value') + convertedDefinition.conditions = fieldDefinition.conditions + .map(itemCondition => connvertFieldCondition(itemCondition)) + return convertedDefinition } -export function connvertFieldCondition(fieldConditionToConvert) { - if (fieldConditionToConvert) { - return { - id: fieldConditionToConvert.id, - uuid: fieldConditionToConvert.uuid, - condition: fieldConditionToConvert.condition, - styleSheet: fieldConditionToConvert.style_sheet, - isActive: fieldConditionToConvert.is_active - } - } - return { - id: undefined, - uuid: undefined, - condition: undefined, - stylesheet: undefined, - isActive: undefined +function connvertFieldCondition(fieldConditionToConvert) { + if (!fieldConditionToConvert) { + return {} } + return camelizeObjectKeys(fieldConditionToConvert) } diff --git a/src/utils/ADempiere/apiConverts/persistence.js b/src/utils/ADempiere/apiConverts/persistence.js index 34c32b20..ee6c6a3a 100644 --- a/src/utils/ADempiere/apiConverts/persistence.js +++ b/src/utils/ADempiere/apiConverts/persistence.js @@ -15,33 +15,24 @@ // along with this program. If not, see . import { convertArrayKeyValueToObject } from '@/utils/ADempiere/valueFormat.js' +import { camelizeObjectKeys } from '../transformObject' -export function convertEntityList(entityListToConvert) { - return { - nextPageToken: entityListToConvert.next_page_token, - recordCount: entityListToConvert.record_count, - recordsList: entityListToConvert.records.map(record => { - return convertEntity(record) - }) - } +export function convertEntityList(entityList) { + const convertedEntityList = camelizeObjectKeys(entityList) + convertedEntityList.recordsList = entityList.records.map(record => convertEntity(record)) + delete convertedEntityList['records'] + return convertedEntityList } -export function convertEntity(entityToConvert) { - return { - id: entityToConvert.id, - uuid: entityToConvert.uuid, - tableName: entityToConvert.table_name, - attributes: convertArrayKeyValueToObject({ - array: entityToConvert.attributes, - keyName: 'key' - }) - } +export function convertEntity(entity) { + const convertedEntity = camelizeObjectKeys(entity) + convertedEntity.attributes = convertArrayKeyValueToObject({ + array: entity.attributes, + keyName: 'key' + }) + return convertedEntity } -export function convertTranslation(translationToConvert) { - return { - language: translationToConvert.language, - uuid: translationToConvert.uuid, - values: translationToConvert.values - } +export function convertTranslation(translation) { + return camelizeObjectKeys(translation) } diff --git a/src/utils/ADempiere/apiConverts/pos.js b/src/utils/ADempiere/apiConverts/pos.js index 44d609ba..1f3afb30 100644 --- a/src/utils/ADempiere/apiConverts/pos.js +++ b/src/utils/ADempiere/apiConverts/pos.js @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +import { camelizeObjectKeys } from '../transformObject.js' import { convertBankAccount, convertBusinessPartner, @@ -25,150 +26,55 @@ import { convertTaxRate } from './core.js' -export function convertPointOfSales(posToConvert) { - const { uuid, id, name, description, help } = posToConvert - - return { - id, - uuid, - name, - description, - help, - isModifyPrice: posToConvert.is_modify_price, - isPosRequiredPin: posToConvert.is_pos_required_pin, - isAisleSeller: posToConvert.is_aisle_seller, - isSharedPos: posToConvert.is_shared_pos, - documentType: convertDocumentType( - posToConvert.document_type - ), - cashBankAccount: convertBankAccount( - posToConvert.cash_bank_account - ), - cashTransferBankAccount: convertBankAccount( - posToConvert.cash_transfer_bank_account - ), - salesRepresentative: posToConvert.sales_representative, - templateBusinessPartner: convertBusinessPartner( - posToConvert.template_business_partner - ), - priceList: convertPriceList( - posToConvert.price_list - ), - conversionTypeUuid: posToConvert.conversion_type_uuid, - keyLayoutUuid: posToConvert.key_layout_uuid - } +export function convertPointOfSales(pos) { + const convertedPos = camelizeObjectKeys(pos) + convertedPos.documentType = convertDocumentType(pos.document_type) + convertedPos.cashBankAccount = convertBankAccount(pos.cash_bank_account) + convertedPos.cashTransferBankAccount = convertBankAccount(pos.cash_transfer_bank_account) + convertedPos.templateBusinessPartner = convertBusinessPartner(pos.template_business_partner) + convertedPos.priceList = convertPriceList(pos.price_list) + return convertedPos } -export function convertOrder(orderToConvert) { - return { - uuid: orderToConvert.uuid, - id: orderToConvert.id, - documentNo: orderToConvert.document_no, - documentType: convertDocumentType( - orderToConvert.document_type - ), - salesRepresentative: convertSalesRepresentative( - orderToConvert.sales_representative - ), - documentStatus: convertDocumentStatus( - orderToConvert.document_status - ), - totalLines: orderToConvert.total_lines, - grandTotal: orderToConvert.grand_total, - dateOrdered: orderToConvert.date_ordered, - businessPartner: convertBusinessPartner( - orderToConvert.business_partner - ) - } +export function convertOrder(order) { + const convertedOrder = camelizeObjectKeys(order) + convertedOrder.documentType = convertDocumentType(order.document_type) + convertedOrder.salesRepresentative = convertSalesRepresentative(order.sales_representative) + convertedOrder.documentStatus = convertDocumentStatus(order.document_status) + convertedOrder.businessPartner = convertBusinessPartner(order.business_partner) + return convertedOrder } -export function convertOrderLine(orderLineToConvert) { - return { - uuid: orderLineToConvert.uuid, - orderUuid: orderLineToConvert.order_uuid, - line: orderLineToConvert.line, - product: convertProduct( - orderLineToConvert.product - ), - charge: orderLineToConvert.charge, - description: orderLineToConvert.description, - lineDescription: orderLineToConvert.line_description, - quantity: orderLineToConvert.quantity, - price: orderLineToConvert.price, - discountRate: orderLineToConvert.discount_rate, - lineNetAmount: orderLineToConvert.line_net_amount, - taxRate: convertTaxRate( - orderLineToConvert.tax_rate - ), - warehouse: orderLineToConvert.warehouse - } +export function convertOrderLine(orderLine) { + const convertedOrderLine = camelizeObjectKeys(orderLine) + convertedOrderLine.product = convertProduct(orderLine.product) + convertedOrderLine.taxRate = convertTaxRate(orderLine.tax_rate) + return convertedOrderLine } -export function convertKeyLayout(keyLayoutToConvert) { - return { - uuid: keyLayoutToConvert.uuid, - id: keyLayoutToConvert.id, - name: keyLayoutToConvert.name, - description: keyLayoutToConvert.description, - help: keyLayoutToConvert.help, - layoutType: keyLayoutToConvert.layout_type, - columns: keyLayoutToConvert.columns, - color: keyLayoutToConvert.color, - keysList: keyLayoutToConvert.keys.map(itemKey => { - return convertKey(itemKey) - }) - } +export function convertKeyLayout(keyLayout) { + const convertedKeyLayout = camelizeObjectKeys(keyLayout) + convertedKeyLayout.keysList = keyLayout.keys.map(key => convertKey(key)) + delete convertedKeyLayout['keys'] + return convertedKeyLayout } -export function convertKey(keyToConvert) { - return { - uuid: keyToConvert.uuid, - id: keyToConvert.id, - name: keyToConvert.name, - description: keyToConvert.description, - subKeyLayoutUuid: keyToConvert.sub_key_layout_uuid, - color: keyToConvert.color, - sequence: keyToConvert.sequence, - spanX: keyToConvert.span_x, - spanY: keyToConvert.span_y, - productValue: keyToConvert.product_value, - quantity: keyToConvert.quantity, - resourceReference: convertResourceReference( - keyToConvert.resource_reference - ) - } +function convertKey(key) { + const convertedKey = camelizeObjectKeys(key) + convertedKey.resourceReference = convertResourceReference(key.resource_reference) + return convertedKey } -export function convertResourceReference(resourceReferenceToConvert) { - if (resourceReferenceToConvert) { - return { - resourceUuid: resourceReferenceToConvert.resource_uuid, - fileName: resourceReferenceToConvert.file_name, - fileSize: resourceReferenceToConvert.file_size, - description: resourceReferenceToConvert.description, - textMsg: resourceReferenceToConvert.text_msg, - contentType: resourceReferenceToConvert.content_type - } +function convertResourceReference(resourceReference) { + if (!resourceReference) { + return undefined } - return undefined + return camelizeObjectKeys(resourceReference) } + export function paymentsMethod(payments) { - if (payments) { - return { - amount: payments.amount, - bankUuid: payments.bank_uuid, - businessPartner: payments.business_partner, - currencyUuid: payments.currency_uuid, - description: payments.description, - documentNo: payments.document_no, - documentStatus: payments.document_status, - id: payments.id, - orderUuid: payments.order_uuid, - paymentDate: payments.payment_date, - referenceNo: payments.reference_no, - tenderTypeCode: payments.tender_type_code, - uuid: payments.uuid - } + if (!payments) { + return undefined } - return undefined + return camelizeObjectKeys(payments) } diff --git a/src/utils/ADempiere/apiConverts/process.js b/src/utils/ADempiere/apiConverts/process.js index 2cf289d7..fca377c6 100644 --- a/src/utils/ADempiere/apiConverts/process.js +++ b/src/utils/ADempiere/apiConverts/process.js @@ -14,22 +14,13 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +import { camelizeObjectKeys } from '../transformObject.js' import { isEmptyValue } from '../valueUtils.js' import { convertReportOutput } from './report.js' -export function convertProcessLog(processLogToConvert) { - return { - uuid: processLogToConvert.uuid, - instanceUuid: processLogToConvert.instance_uuid, - isError: processLogToConvert.is_error, - summary: processLogToConvert.summary, - resultTableName: processLogToConvert.result_table_name, - isProcessing: processLogToConvert.is_processing, - lastRun: processLogToConvert.last_run, - // parametersList: processLogToConvert.parameter.map(parameter => { - // return convertEntity(parameter) - // }), - paramenters: [], - output: isEmptyValue(processLogToConvert.output) ? {} : convertReportOutput(processLogToConvert.output) - } +export function convertProcessLog(processLog) { + const convertedProcessLog = camelizeObjectKeys(processLog) + convertedProcessLog.paramenters = [] + convertedProcessLog.output = isEmptyValue(processLog.output) ? {} : convertReportOutput(processLog.output) + return convertedProcessLog } diff --git a/src/utils/ADempiere/apiConverts/report.js b/src/utils/ADempiere/apiConverts/report.js index 86e8b911..a3bf0b8d 100644 --- a/src/utils/ADempiere/apiConverts/report.js +++ b/src/utils/ADempiere/apiConverts/report.js @@ -14,70 +14,29 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -export function convertListPrintFormats(listPrintFormatsToConvert) { - return { - recordCount: listPrintFormatsToConvert.record_count, - records: listPrintFormatsToConvert.records.map(record => { - return convertPrintFormat(record) - }), - nextPageToken: listPrintFormatsToConvert.next_page_token - } +import { camelizeObjectKeys, renameObjectKey } from '../transformObject' + +export function convertListPrintFormats(printFormats) { + const convertedPrintFormats = camelizeObjectKeys(printFormats) + convertedPrintFormats.records = printFormats.records.map(record => convertPrintFormat(record)) + return convertedPrintFormats } -export function convertPrintFormat(printFormatToConvert) { - const { name, description } = printFormatToConvert - - return { - name, - description, - tableName: printFormatToConvert.table_name, - isDefault: printFormatToConvert.is_default, - reportViewUuid: printFormatToConvert.report_view_uuid, - printFormatUuid: printFormatToConvert.print_format_uuid - } +function convertPrintFormat(printFormat) { + return camelizeObjectKeys(printFormat) } -export function convertReportOutput(reportOutputToConvert) { - const { uuid, name, description } = reportOutputToConvert - - return { - uuid, - name, - description, - fileName: reportOutputToConvert.file_name, - output: reportOutputToConvert.output, - mimeType: reportOutputToConvert.mime_type, - dataCols: reportOutputToConvert.data_cols, - dataRows: reportOutputToConvert.data_rows, - headerName: reportOutputToConvert.header_name, - footerName: reportOutputToConvert.footer_name, - printFormatUuid: reportOutputToConvert.print_format_uuid, - reportViewUuid: reportOutputToConvert.report_view_uuid, - tableName: reportOutputToConvert.table_name, - outputStream: reportOutputToConvert.output_stream, - // outputStreamAsB64 - outputStream_asB64: reportOutputToConvert.output_stream_asB64, - // outputStreamAsU8 - outputStream_asU8: reportOutputToConvert.output_stream_asU8, - reportType: reportOutputToConvert.report_type - } +export function convertReportOutput(reportOutput) { + const convertedReportOutput = camelizeObjectKeys(reportOutput) + renameObjectKey(convertedReportOutput, 'outputStreamAsB64', 'outputStream_asB64') + renameObjectKey(convertedReportOutput, 'outputStreamAsU8', 'outputStream_asU8') + return convertedReportOutput } -export function convertDrillTables(drillTablesToConvert) { - return { - tableName: drillTablesToConvert.table_name, - printName: drillTablesToConvert.print_name - } +export function convertDrillTables(drillTables) { + return camelizeObjectKeys(drillTables) } -export function convertReportView(reportViewToConvert) { - const { uuid, name, description } = reportViewToConvert - - return { - uuid, - name, - description, - tableName: reportViewToConvert.table_name, - reportViewUuid: reportViewToConvert.report_view_uuid - } +export function convertReportView(reportView) { + return camelizeObjectKeys(reportView) } diff --git a/src/utils/ADempiere/apiConverts/user.js b/src/utils/ADempiere/apiConverts/user.js index 3732f458..b51d9499 100644 --- a/src/utils/ADempiere/apiConverts/user.js +++ b/src/utils/ADempiere/apiConverts/user.js @@ -14,59 +14,14 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -export function convertSession(sessionToConvert) { - return { - id: sessionToConvert.id, - uuid: sessionToConvert.uuid, - name: sessionToConvert.name, - userInfo: sessionToConvert.user_info, - role: convertRole( - sessionToConvert.role - ), - processed: sessionToConvert.processed, - defaultContext: sessionToConvert.default_context, - // system info - countryId: sessionToConvert.country_id, - costingPrecision: sessionToConvert.costing_precision, - countryCode: sessionToConvert.country_code, - countryName: sessionToConvert.country_name, - currencyIsoCode: sessionToConvert.currency_iso_code, - currencyName: sessionToConvert.currency_name, - currencySymbol: sessionToConvert.currency_symbol, - displaySequence: sessionToConvert.display_sequence, - language: sessionToConvert.language, - standardPrecision: sessionToConvert.standard_precision - } +import { camelizeObjectKeys } from '../transformObject' + +export function convertSession(session) { + const convertedSession = camelizeObjectKeys(session) + convertedSession.role = convertRole(session.role) + return convertedSession } -export function convertRole(roleToConvert) { - const { id, uuid, name, description } = roleToConvert - - return { - id, - uuid, - name, - description, - clientId: roleToConvert.client_id, - clientName: roleToConvert.client_name, - isAllowHtmlView: roleToConvert.is_allow_html_view, - isAllowInfoAccount: roleToConvert.is_allow_info_account, - isAllowInfoAsset: roleToConvert.is_allow_info_asset, - isAllowInfoBusinessPartner: roleToConvert.is_allow_info_business_partner, - isAllowInfoCashJournal: roleToConvert.is_allow_info_cash_journal, - isAllowInfoCrp: roleToConvert.is_allow_info_crp, - isAllowInfoInOut: roleToConvert.is_allow_info_in_out, - isAllowInfoInvoice: roleToConvert.is_allow_info_invoice, - isAllowInfoMrp: roleToConvert.is_allow_info_mrp, - isAllowInfoOrder: roleToConvert.is_allow_info_order, - isAllowInfoPayment: roleToConvert.is_allow_info_payment, - isAllowInfoProduct: roleToConvert.is_allow_info_product, - isAllowInfoResource: roleToConvert.is_allow_info_resource, - isAllowInfoSchedule: roleToConvert.is_allow_info_schedule, - isAllowXlsView: roleToConvert.is_allow_xls_view, - isCanExport: roleToConvert.is_can_export, - isCanReport: roleToConvert.is_can_report, - isPersonalAccess: roleToConvert.is_personal_access, - isPersonalLock: roleToConvert.is_personal_lock - } +export function convertRole(role) { + return camelizeObjectKeys(role) } diff --git a/src/utils/ADempiere/apiConverts/values.js b/src/utils/ADempiere/apiConverts/values.js index af74d663..670a0369 100644 --- a/src/utils/ADempiere/apiConverts/values.js +++ b/src/utils/ADempiere/apiConverts/values.js @@ -13,26 +13,15 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +import { camelizeObjectKeys } from '../transformObject' -export function convertReferencesList(listReferencesToConvert) { - return { - recordCount: listReferencesToConvert.record_count, - referencesList: listReferencesToConvert.records.map(record => { - return convertReference(record) - }), - nextPageToken: listReferencesToConvert.next_page_token - } +export function convertReferencesList(references) { + const convertedReferences = camelizeObjectKeys(references) + convertedReferences.referencesList = references.records.map(record => convertReference(record)) + delete convertedReferences['records'] + return convertedReferences } -export function convertReference(referenceToConvert) { - const { uuid } = referenceToConvert - - return { - uuid, - tableName: referenceToConvert.table_name, - windowUuid: referenceToConvert.window_uuid, - displayName: referenceToConvert.display_name, - whereClause: referenceToConvert.where_clause, - recordCount: referenceToConvert.record_count - } +export function convertReference(reference) { + return camelizeObjectKeys(reference) } diff --git a/src/utils/ADempiere/apiConverts/window.js b/src/utils/ADempiere/apiConverts/window.js index f1cb06c8..17b116f9 100644 --- a/src/utils/ADempiere/apiConverts/window.js +++ b/src/utils/ADempiere/apiConverts/window.js @@ -14,194 +14,57 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -export function convertEntityLog(entityLogToConvert) { - const { id, uuid } = entityLogToConvert +import { camelizeObjectKeys, renameObjectKey } from '../transformObject' - return { - logId: entityLogToConvert.log_id, - id, - uuid, - tableName: entityLogToConvert.table_name, - sessionUuid: entityLogToConvert.session_uuid, - userUuid: entityLogToConvert.user_uuid, - userName: entityLogToConvert.user_name, - transactionName: entityLogToConvert.transaction_name, - eventType: entityLogToConvert.event_type, - eventTypeName: entityLogToConvert.event_type_name, - logDate: entityLogToConvert.log_date, - changeLogsList: entityLogToConvert.change_logs.map(changeLog => { - return convertChangeLog(changeLog) - }) - } +export function convertEntityLog(entityLog) { + const convertedLog = camelizeObjectKeys(entityLog) + convertedLog.changeLogsList = entityLog.change_logs.map(changeLog => camelizeObjectKeys(changeLog)) + delete convertedLog['changeLogs'] + return convertedLog } -export function convertChangeLog(changeLogToConvert) { - return { - columnName: changeLogToConvert.column_name, - displayColumnName: changeLogToConvert.display_column_name, - oldValue: changeLogToConvert.old_value, - newValue: changeLogToConvert.new_value, - oldDisplayValue: changeLogToConvert.old_display_value, - newDisplayValue: changeLogToConvert.new_display_value, - description: changeLogToConvert.description - } +export function convertEntityChat(entityChat) { + return camelizeObjectKeys(entityChat) } -export function convertEntityChat(entityChatToConvert) { - const { id, uuid, description } = entityChatToConvert - - return { - chatUuid: entityChatToConvert.chat_uuid, - id, - uuid, - tableName: entityChatToConvert.table_name, - chatTypeUuid: entityChatToConvert.chat_type_uuid, - description, - confidentialType: entityChatToConvert.confidential_type, - confidentialTypeName: entityChatToConvert.confidential_type_name, - moderationType: entityChatToConvert.moderation_type, - moderationTypeName: entityChatToConvert.moderation_type_name, - logDate: entityChatToConvert.log_date - } +export function convertChatEntry(chatEntry) { + return camelizeObjectKeys(chatEntry) } -export function convertChatEntry(chatEntryToConvert) { - return { - chatUuid: chatEntryToConvert.chat_uuid, - chatEntryUuid: chatEntryToConvert.chat_entry_uuid, - subject: chatEntryToConvert.subject, - characterData: chatEntryToConvert.character_data, - userUuid: chatEntryToConvert.user_uuid, - userName: chatEntryToConvert.user_name, - chatEntryType: chatEntryToConvert.chat_entry_type, - chatEntryTypeName: chatEntryToConvert.chat_entry_type_name, - confidentialType: chatEntryToConvert.confidential_type, - confidentialTypeName: chatEntryToConvert.confidential_type_name, - moderatorStatus: chatEntryToConvert.moderator_status, - moderatorStatusName: chatEntryToConvert.moderator_status_name, - logDate: chatEntryToConvert.log_date - } +export function convertWorkflowProcess(workflowProcess) { + const convertedProcess = camelizeObjectKeys(workflowProcess) + convertedProcess.workflowEventsList = workflowProcess.workflow_events.map(item => camelizeObjectKeys(item)) + delete convertedProcess['workflowEvents'] + return convertedProcess } -export function convertWorkflowProcess(workflowProcessToConvert) { - return { - processUuid: workflowProcessToConvert.process_uuid, - workflowUuid: workflowProcessToConvert.workflow_uuid, - workflowName: workflowProcessToConvert.workflow_name, - recordId: workflowProcessToConvert.record_id, - tableName: workflowProcessToConvert.table_name, - userUuid: workflowProcessToConvert.user_uuid, - userName: workflowProcessToConvert.user_name, - responsibleUuid: workflowProcessToConvert.responsible_uuid, - responsibleName: workflowProcessToConvert.responsible_name, - textMessage: workflowProcessToConvert.text_message, - processed: workflowProcessToConvert.processed, - workflowStateName: workflowProcessToConvert.workflow_state_name, - workflowState: workflowProcessToConvert.workflow_state, - priority: workflowProcessToConvert.priority, - priorityName: workflowProcessToConvert.priority_name, - workflowEventsList: workflowProcessToConvert.workflow_events.map(itemEvent => { - return convertWorkflowEvent(itemEvent) - }), - logDate: workflowProcessToConvert.log_date - } +export function convertWorkflowDefinition(workflowDefinition) { + const convertedDefinition = camelizeObjectKeys(workflowDefinition) + convertedDefinition.startNode = convertWorkflowNode(workflowDefinition.start_node) + convertedDefinition.workflowNodesList = workflowDefinition.workflow_nodes.map(item => convertWorkflowNode(item)) + delete convertedDefinition['workflowNodes'] + return convertedDefinition } -export function convertWorkflowEvent(workflowEventToConvert) { - return { - nodeUuid: workflowEventToConvert.node_uuid, - nodeName: workflowEventToConvert.node_name, - recordId: workflowEventToConvert.record_id, - tableName: workflowEventToConvert.table_name, - userUuid: workflowEventToConvert.user_uuid, - userName: workflowEventToConvert.user_name, - responsibleUuid: workflowEventToConvert.responsible_uuid, - responsibleName: workflowEventToConvert.responsible_name, - textMessage: workflowEventToConvert.text_message, - timeElapsed: workflowEventToConvert.time_elapsed, - attributeName: workflowEventToConvert.attribute_name, - oldValue: workflowEventToConvert.old_value, - newValue: workflowEventToConvert.new_value, - workflowState: workflowEventToConvert.workflow_state, - workflowStateName: workflowEventToConvert.workflow_state_name, - eventType: workflowEventToConvert.event_type, - eventTypeName: workflowEventToConvert.event_type_name, - logDate: workflowEventToConvert.log_date - } +function convertWorkflowNode(workflowNode) { + const convertedNode = camelizeObjectKeys(workflowNode) + convertedNode.documentAction = { ...workflowNode.document_action } + convertedNode.transitionsList = workflowNode.transitions.map(item => convertWorkflowTransition(item)) + delete convertedNode['transitions'] + return convertedNode } -export function convertWorkflowDefinition(workflowDefinitionToConvert) { - const { uuid, name, description, help } = workflowDefinitionToConvert - - return { - uuid, - value: workflowDefinitionToConvert.value, - name, - description, - help, - tableName: workflowDefinitionToConvert.table_name, - responsibleUuid: workflowDefinitionToConvert.responsible_uuid, - priority: workflowDefinitionToConvert.priority, - validFrom: workflowDefinitionToConvert.valid_from, - isDefault: workflowDefinitionToConvert.is_default, - isValid: workflowDefinitionToConvert.is_valid, - publishStatus: workflowDefinitionToConvert.publish_status, - publishStatusName: workflowDefinitionToConvert.publish_status_name, - durationUnit: workflowDefinitionToConvert.duration_unit, - durationUnitName: workflowDefinitionToConvert.duration_unit_name, - startNode: convertWorkflowNode( - workflowDefinitionToConvert.start_node - ), - workflowNodesList: workflowDefinitionToConvert.workflow_nodes.map(itemWorkflowNode => { - return convertWorkflowNode(itemWorkflowNode) - }) - } +function convertWorkflowTransition(workflowTransition) { + const convertedTransition = camelizeObjectKeys(workflowTransition) + convertedTransition.isStdUserWorkflow = workflowTransition.is_standard_user_workflow + convertedTransition.workflowConditionsList = workflowTransition.workflow_conditions.map(item => convertWorkflowCondition(item)) + delete convertedTransition['workflowConditions'] + return convertedTransition } -export function convertWorkflowNode(workflowNodeToConvert) { - const { uuid, name, description, help } = workflowNodeToConvert - - return { - uuid, - value: workflowNodeToConvert.value, - name, - description, - help, - responsibleUuid: workflowNodeToConvert.responsible_uuid, - documentAction: { - ...workflowNodeToConvert.document_action - // value, name - }, - priority: workflowNodeToConvert.priority, - action: workflowNodeToConvert.action, - actionName: workflowNodeToConvert.action_name, - transitionsList: workflowNodeToConvert.transitions.map(itemTransition => { - return convertWorkflowTransition(itemTransition) - }) - } -} - -export function convertWorkflowTransition(workflowTransitionToConvert) { - return { - nodeNextUuid: workflowTransitionToConvert.node_next_uuid, - description: workflowTransitionToConvert.description, - isStdUserWorkflow: workflowTransitionToConvert.is_standard_user_workflow, - isSandardUserWorkflow: workflowTransitionToConvert.is_standard_user_workflow, - sequence: workflowTransitionToConvert.sequence, - workflowConditionsList: workflowTransitionToConvert.workflow_conditions.map(conditionItem => { - return convertWorkflowCondition(conditionItem) - }) - } -} - -export function convertWorkflowCondition(workflowConditionToConvert) { - return { - sequence: workflowConditionToConvert.sequence, - columnName: workflowConditionToConvert.column_name, - value: workflowConditionToConvert.value, - conditionType: workflowConditionToConvert.confidential_type, - conditionTypeName: workflowConditionToConvert.confidential_type_name, - operation: workflowConditionToConvert.operation, - operationName: workflowConditionToConvert.operation_name - } +function convertWorkflowCondition(workflowCondition) { + const convertedCondition = camelizeObjectKeys(workflowCondition) + renameObjectKey(convertedCondition, 'confidentialType', 'conditionType') + renameObjectKey(convertedCondition, 'confidentialTypeName', 'conditionTypeName') + return convertedCondition } diff --git a/src/utils/ADempiere/transformObject.js b/src/utils/ADempiere/transformObject.js new file mode 100644 index 00000000..d13b46b8 --- /dev/null +++ b/src/utils/ADempiere/transformObject.js @@ -0,0 +1,14 @@ +export function camelizeObjectKeys(obj) { + const camelizedObj = Object.assign({}, obj) + Object.keys(camelizedObj).forEach(k => { + const newK = k.replace(/(\_\w)/g, (m) => m[1].toUpperCase()) + if (newK !== k) { + camelizedObj[newK] = camelizedObj[k] + delete camelizedObj[k] + } + }) + return camelizedObj +} +export function renameObjectKey(obj, oldEntry, newEntry) { + delete Object.assign(obj, { [newEntry]: obj[oldEntry] })[oldEntry] +} diff --git a/tests/unit/components/Hamburger.spec.js b/tests/unit/components/Hamburger.spec.js index e5afcb79..78114c96 100644 --- a/tests/unit/components/Hamburger.spec.js +++ b/tests/unit/components/Hamburger.spec.js @@ -1,18 +1,18 @@ -import { shallowMount } from "@vue/test-utils"; -import Hamburger from "@/components/Hamburger/index.vue"; -describe("Hamburger.vue", () => { - it("toggle click", () => { - const wrapper = shallowMount(Hamburger); - const mockFn = jest.fn(); - wrapper.vm.$on("toggleClick", mockFn); - wrapper.find(".hamburger").trigger("click"); - expect(mockFn).toBeCalled(); - }); - it("prop isActive", () => { +import { shallowMount } from '@vue/test-utils' +import Hamburger from '@/components/Hamburger/index.vue' +describe('Hamburger.vue', () => { + it('toggle click', () => { + const wrapper = shallowMount(Hamburger) + const mockFn = jest.fn() + wrapper.vm.$on('toggleClick', mockFn) + wrapper.find('.hamburger').trigger('click') + expect(mockFn).toBeCalled() + }) + it('prop isActive', () => { // const wrapper = shallowMount(Hamburger) // wrapper.setProps({ isActive: true }) // expect(wrapper.contains('.is-active')).toBe(true) // wrapper.setProps({ isActive: false }) // expect(wrapper.contains('.is-active')).toBe(false) - }); -}); + }) +}) diff --git a/tests/unit/components/SvgIcon.spec.js b/tests/unit/components/SvgIcon.spec.js index e94d6e9c..2745c00d 100644 --- a/tests/unit/components/SvgIcon.spec.js +++ b/tests/unit/components/SvgIcon.spec.js @@ -1,22 +1,22 @@ -import { shallowMount } from "@vue/test-utils"; -import SvgIcon from "@/components/SvgIcon/index.vue"; -describe("SvgIcon.vue", () => { - it("iconClass", () => { +import { shallowMount } from '@vue/test-utils' +import SvgIcon from '@/components/SvgIcon/index.vue' +describe('SvgIcon.vue', () => { + it('iconClass', () => { const wrapper = shallowMount(SvgIcon, { propsData: { - iconClass: "test" + iconClass: 'test' } - }); - expect(wrapper.find("use").attributes().href).toBe("#icon-test"); - }); - it("className", () => { + }) + expect(wrapper.find('use').attributes().href).toBe('#icon-test') + }) + it('className', () => { const wrapper = shallowMount(SvgIcon, { propsData: { - iconClass: "test" + iconClass: 'test' } - }); - expect(wrapper.classes().length).toBe(1); - wrapper.setProps({ className: "test" }); + }) + expect(wrapper.classes().length).toBe(1) + wrapper.setProps({ className: 'test' }) // expect(wrapper.classes().includes('test')).toBe(true) - }); -}); + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/core.spec.js b/tests/unit/utils/ADempiere/apiConverts/core.spec.js new file mode 100644 index 00000000..d46c8d0b --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/core.spec.js @@ -0,0 +1,174 @@ +import { + convertContextInfo, + convertOrganization, + convertLanguage, + convertCountry, + convertBusinessPartner, + convertConversionRate, + convertBankAccount, + convertDocumentType, + convertDocumentStatus, + convertPriceList, + convertTaxRate, + convertProduct, + convertProductPrice +} from '@/utils/ADempiere/apiConverts/core.js' +import contextInfo from './objects/fromApi/contextInfo.json' +import convertedContextInfo from './objects/converted/contextInfo.json' +import contextInfoWithoutMessage from './objects/fromApi/contextInfoWithoutMessage.json' +import convertedContextInfoWithoutMessage from './objects/converted/contextInfoWithoutMessage.json' +import organization from './objects/fromApi/organization.json' +import convertedOrganization from './objects/converted/organization.json' +import language from './objects/fromApi/language.json' +import convertedLanguage from './objects/converted/language.json' +import country from './objects/fromApi/country.json' +import convertedCountry from './objects/converted/country.json' +import countryWithNoCurrency from './objects/fromApi/countryNoCurrency.json' +import convertedCountryWithNoCurrency from './objects/converted/countryNoCurrency.json' +import businessPartner from './objects/fromApi/businessPartner.json' +import convertedBusinessPartner from './objects/converted/businessPartner.json' +import conversionRate from './objects/fromApi/conversionRate.json' +import convertedConversionRate from './objects/converted/conversionRate.json' +import conversionRateNoCurrency from './objects/fromApi/conversionRateNoCurrency.json' +import convertedConversionRateNoCurrency from './objects/converted/conversionRateNoCurrency.json' +import salesRepresentative from './objects/fromApi/salesRepresentative.json' +import convertedSalesRepresentative from './objects/converted/salesRepresentative.json' +import bankAccount from './objects/fromApi/bankAccount.json' +import convertedBankAccount from './objects/converted/bankAccount.json' +import documentType from './objects/fromApi/documentType.json' +import convertedDocumentType from './objects/converted/documentType.json' +import documentStatus from './objects/fromApi/documentStatus.json' +import convertedDocumentStatus from './objects/converted/documentStatus.json' +import priceList from './objects/fromApi/priceList.json' +import convertedPriceList from './objects/converted/priceList.json' +import taxRate from './objects/fromApi/taxRate.json' +import convertedTaxRate from './objects/converted/taxRate.json' +import product from './objects/fromApi/product.json' +import convertedProduct from './objects/converted/product.json' +import productPrice from './objects/fromApi/productPrice.json' +import convertedProductPrice from './objects/converted/productPrice.json' + +describe('context info', () => { + it('should return a converted context info', () => { + const actualContextInfo = convertContextInfo(contextInfo) + expect(actualContextInfo).toEqual(convertedContextInfo) + }) + it('should return empty object for undefined context info', () => { + const actualContextInfo = convertContextInfo(null) + expect(actualContextInfo).toEqual({ messageText: {}}) + }) + it('should return a converted context info with an empty message', () => { + const actualContextInfo = convertContextInfo(contextInfoWithoutMessage) + expect(actualContextInfo).toEqual(convertedContextInfoWithoutMessage) + }) +}) + +describe('organization', () => { + it('should return a converted organization object', () => { + const actualOrganization = convertOrganization(organization) + expect(actualOrganization).toEqual(convertedOrganization) + }) +}) + +describe('language', () => { + it('should return a converted language object', () => { + const actualLanguage = convertLanguage(language) + expect(actualLanguage).toEqual(convertedLanguage) + }) +}) + +describe('country', () => { + it('should return a converted country object with currency', () => { + const actualCountry = convertCountry(country) + expect(actualCountry).toEqual(convertedCountry) + }) + it('should return a converted country object without currency', () => { + const actualCountry = convertCountry(countryWithNoCurrency) + expect(actualCountry).toEqual(convertedCountryWithNoCurrency) + }) +}) + +describe('business partner', () => { + it('should return a converted business partner object', () => { + const actualBusinessPartner = convertBusinessPartner(businessPartner) + expect(actualBusinessPartner).toEqual(convertedBusinessPartner) + }) +}) + +describe('conversion rate', () => { + it('should return a converted conversion rate object with currencies', () => { + const actualConversionRate = convertConversionRate(conversionRate) + expect(actualConversionRate).toEqual(convertedConversionRate) + }) + + it('should return a converted conversion rate object without currencies', () => { + const actualConversionRate = convertConversionRate( + conversionRateNoCurrency + ) + expect(actualConversionRate).toEqual(convertedConversionRateNoCurrency) + }) +}) + +describe('sales representative', () => { + it('should return a converted sales representative object', () => { + const actualSalesRep = convertBusinessPartner(salesRepresentative) + expect(actualSalesRep).toEqual(convertedSalesRepresentative) + }) +}) + +describe('bank account', () => { + it('should return a converted bank account object', () => { + const actualBankAccount = convertBankAccount(bankAccount) + expect(actualBankAccount).toEqual(convertedBankAccount) + }) + it('should return undefined', () => { + const actualBankAccount = convertBankAccount(null) + expect(actualBankAccount).toBeUndefined() + }) +}) + +describe('document type', () => { + it('should return a converted document type object', () => { + const actualDocumentType = convertDocumentType(documentType) + expect(actualDocumentType).toEqual(convertedDocumentType) + }) + it('should return undefined', () => { + const actualDocumentType = convertBankAccount(null) + expect(actualDocumentType).toBeUndefined() + }) +}) + +describe('document status', () => { + it('should return a converted document status object', () => { + const actualDocumentStatus = convertDocumentStatus(documentStatus) + expect(actualDocumentStatus).toEqual(convertedDocumentStatus) + }) +}) + +describe('price list', () => { + it('should return a converted price list object', () => { + const actualPriceList = convertPriceList(priceList) + expect(actualPriceList).toEqual(convertedPriceList) + }) +}) + +describe('tax rate', () => { + it('should return a converted tax rate object', () => { + const actualTaxRate = convertTaxRate(taxRate) + expect(actualTaxRate).toEqual(convertedTaxRate) + }) +}) + +describe('product', () => { + it('should return a converted product object', () => { + const actualProduct = convertProduct(product) + expect(actualProduct).toEqual(convertedProduct) + }) +}) + +describe('product price', () => { + it('should return a converted product price object', () => { + const actualProductPrice = convertProductPrice(productPrice) + expect(actualProductPrice).toEqual(convertedProductPrice) + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/dashboard.spec.js b/tests/unit/utils/ADempiere/apiConverts/dashboard.spec.js new file mode 100644 index 00000000..82529390 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/dashboard.spec.js @@ -0,0 +1,29 @@ +import { convertRecentItemsList, convertFavorite, convertDashboard, convertPendingDocument } from '../../../../../src/utils/ADempiere/apiConverts/dashboard' +import recentListItems from './objects/fromApi/recentListItems.json' +import convertedRecentListItems from './objects/converted/recentListItems.json' +import favorite from './objects/fromApi/favorite.json' +import convertedFavorite from './objects/converted/favorite.json' +import dashboard from './objects/fromApi/dashboard.json' +import convertedDashboard from './objects/converted/dashboard.json' +import pendingDocument from './objects/fromApi/pendingDocument.json' +import convertedPendingDocument from './objects/converted/pendingDocument.json' + +it('should convert the recent item list', () => { + const actualConvertedList = convertRecentItemsList(recentListItems) + expect(actualConvertedList).toEqual(convertedRecentListItems) +}) + +it('should convert the favorite', () => { + const actualFavorite = convertFavorite(favorite) + expect(actualFavorite).toEqual(convertedFavorite) +}) + +it('should convert dashboard', () => { + const actualDashbaord = convertDashboard(dashboard) + expect(actualDashbaord).toEqual(convertedDashboard) +}) + +it('should convert a pending document', () => { + const actualPendingDocument = convertPendingDocument(pendingDocument) + expect(actualPendingDocument).toEqual(convertedPendingDocument) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/dictionary.spec.js b/tests/unit/utils/ADempiere/apiConverts/dictionary.spec.js new file mode 100644 index 00000000..abb52c4a --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/dictionary.spec.js @@ -0,0 +1,79 @@ +import { + convertBrowser, + convertForm, + convertProcess, + convertReportExportType, + convertTab, + convertValidationRule, + convertWindow +} from '../../../../../src/utils/ADempiere/apiConverts/dictionary' +import process from './objects/fromApi/process.json' +import convertedProcess from './objects/converted/process.json' +import processWithUndefined from './objects/fromApi/processWithUndefined.json' +import convertedProcessWithUndefined from './objects/converted/processWithUndefined.json' +import reportExportType from './objects/fromApi/reportExportType.json' +import convertedReportExportType from './objects/converted/reportExportType.json' +import tab from './objects/fromApi/tab.json' +import convertedTab from './objects/converted/tab.json' +import windowObj from './objects/fromApi/window.json' +import convertedWindow from './objects/converted/window.json' +import browser from './objects/fromApi/browser.json' +import convertedBrowser from './objects/converted/browser.json' +import form from './objects/fromApi/form.json' +import convertedForm from './objects/converted/form.json' +import validationRule from './objects/fromApi/validationRule.json' +import convertedValidationRule from './objects/converted/validationRule.json' + +describe('process', () => { + it('should convert a process with all fields defined', () => { + const actualConvertedProcess = convertProcess(process) + expect(actualConvertedProcess).toEqual(convertedProcess) + }) + + it('should convert a process with some fields undefined', () => { + const actualConvertedProcess = convertProcess(processWithUndefined) + expect(actualConvertedProcess).toEqual(convertedProcessWithUndefined) + }) +}) + +describe('report export type', () => { + it('should return a converted report export type object', () => { + const actualExportType = convertReportExportType(reportExportType) + expect(actualExportType).toEqual(convertedReportExportType) + }) +}) + +describe('tab', () => { + it('should return a converted tab object', () => { + const actualTab = convertTab(tab) + expect(actualTab).toEqual(convertedTab) + }) +}) + +describe('window', () => { + it('should return a converted window object', () => { + const actualWindow = convertWindow(windowObj) + expect(actualWindow).toEqual(convertedWindow) + }) +}) + +describe('browser', () => { + it('should return a converted browser object', () => { + const actualBrowser = convertBrowser(browser) + expect(actualBrowser).toEqual(convertedBrowser) + }) +}) + +describe('form', () => { + it('should return a converted form object', () => { + const actualForm = convertForm(form) + expect(actualForm).toEqual(convertedForm) + }) +}) + +describe('validation rule', () => { + it('should return a converted validation rule object', () => { + const actualValidationRule = convertValidationRule(validationRule) + expect(actualValidationRule).toEqual(convertedValidationRule) + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/field.spec.js b/tests/unit/utils/ADempiere/apiConverts/field.spec.js new file mode 100644 index 00000000..fe717213 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/field.spec.js @@ -0,0 +1,19 @@ +const { convertFieldGroup, convertField } = require('@/utils/ADempiere/apiConverts/field') +import fieldGroup from './objects/fromApi/fieldGroup.json' +import convertedFieldGroup from './objects/converted/fieldGroup.json' +import field from './objects/fromApi/field.json' +import convertedField from './objects/converted/field.json' + +describe('field group', () => { + it('should return a converted field group object', () => { + const actualFieldGroup = convertFieldGroup(fieldGroup) + expect(actualFieldGroup).toEqual(convertedFieldGroup) + }) +}) + +describe('field', () => { + it('should return a converted field object', () => { + const actualField = convertField(field) + expect(actualField).toEqual(convertedField) + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/bankAccount.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/bankAccount.json new file mode 100644 index 00000000..55a1d6ff --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/bankAccount.json @@ -0,0 +1,34 @@ +{ + "uuid": "bank account uuid", + "id": "bank account id", + "name": "bank account name", + "description": "bank account description", + "accountNo": "bank account account_no", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + }, + "bban": "bank account bban", + "iban": "bank account iban", + "creditLimit": "bank account credit_limit", + "currentBalance": "bank account current_balance", + "isDefault": "bank account is_default", + "businessPartner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "taxId": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "lastName": "last_name", + "description": "description" + }, + "bankAccountType": "bank account bank_account_type", + "bankAccountTypeName": "bank account bank_account_type_name" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/browser.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/browser.json new file mode 100644 index 00000000..356d5c73 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/browser.json @@ -0,0 +1,579 @@ +{ + "id": "id", + "uuid": "uuid", + "viewUuid": "viewUuid", + "value": "value", + "name": "name", + "description": "description", + "help": "help", + "accessLevel": "access_level", + "isActive": false, + "isUpdateable": true, + "isDeleteable": false, + "isSelectedByDefault": true, + "isCollapsibleByDefault": true, + "isExecutedQueryByDefault": false, + "isShowTotal": true, + "query": "query", + "whereClause": "where_clause", + "orderByClause": "order_by_clause", + "window": { + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "isActive": true, + "isSalesTransaction": false, + "windowType": "windowType", + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "tabs": [ + { + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "tableName": "table_name", + "sequence": "sequence", + "tabLevel": "tab_level", + "isActive": false, + "isSingleRow": true, + "isAdvancedTab": true, + "isHasTree": true, + "isInfoTab": false, + "isSortTab": true, + "isTranslationTab": true, + "isReadOnly": true, + "isInsertRecord": false, + "isView": true, + "isDeleteable": true, + "isDocument": false, + "isChangeLog": false, + "accessLevel": "access_level", + "linkColumnName": "link_column_name", + "sortOrderColumnName": "sort_order_column_name", + "sortYesNoColumnName": "sort_yes_no_column_name", + "parentColumnName": "parent_column_name", + "displayLogic": "display_logic", + "commitWarning": "commit_warning", + "query": "query", + "whereClause": "where_clause", + "orderByClause": "order_by_clause", + "parentTabUuid": "parent_tab_uuid", + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "processes": [ + { + "accessLevel": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "isActive": false, + "isDirectPrint": true, + "isReport": false, + "name": "Process Name", + "reportExportTypes": ["Export Type 1", "Export Type 2"], + "showHelp": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + } + ] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + } + ] + } + } + ] + } + ], + "fields": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + } + ] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + } + ] + } + } + ] + } + ] + }, + "process": { + "accessLevel": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "isActive": false, + "isDirectPrint": true, + "isReport": false, + "name": "Process Name", + "reportExportTypes": ["Export Type 1", "Export Type 2"], + "showHelp": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + } + ] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + } + ] + } + } + ] + }, + "fields": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + } + ] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + } + ] + } + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/businessPartner.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/businessPartner.json new file mode 100644 index 00000000..5f5946ae --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/businessPartner.json @@ -0,0 +1,11 @@ +{ + "uuid": "uuid", + "id": "id", + "value": "value", + "taxId": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "lastName": "last_name", + "description": "description" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/chatEntry.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/chatEntry.json new file mode 100644 index 00000000..dd28059a --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/chatEntry.json @@ -0,0 +1,15 @@ +{ + "chatUuid": "chat_uuid", + "chatEntryUuid": "chat_entry_uuid", + "subject": "subject", + "characterData": "character_data", + "userUuid": "user_uuid", + "userName": "user_name", + "chatEntryType": "chat_entry_type", + "chatEntryTypeName": "chat_entry_type_name", + "confidentialType": "confidential_type", + "confidentialTypeName": "confidential_type_name", + "moderatorStatus": "moderator_status", + "moderatorStatusName": "moderator_status_name", + "logDate": "log_date" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/contextInfo.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/contextInfo.json new file mode 100644 index 00000000..ff70da5a --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/contextInfo.json @@ -0,0 +1,16 @@ +{ + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/contextInfoWithoutMessage.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/contextInfoWithoutMessage.json new file mode 100644 index 00000000..b7552234 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/contextInfoWithoutMessage.json @@ -0,0 +1,9 @@ +{ + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": {} +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/conversionRate.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/conversionRate.json new file mode 100644 index 00000000..2fb670f7 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/conversionRate.json @@ -0,0 +1,26 @@ +{ + "uuid": "converstion rateuuid", + "id": "converstion rateid", + "conversionTypeUuid": "converstion rateconversion_type_uuid", + "validFrom": "converstion rate valid_from", + "currencyFrom": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + }, + "currencyTo": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + }, + "multiplyRate": "converstion rate multiply_rate", + "divideRate": "converstion rate converstion ratedivide_rate" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/conversionRateNoCurrency.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/conversionRateNoCurrency.json new file mode 100644 index 00000000..1dd56b52 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/conversionRateNoCurrency.json @@ -0,0 +1,6 @@ +{ + "uuid": "converstion rateuuid", + "id": "converstion rateid", + "multiplyRate": "converstion rate multiply_rate", + "divideRate": "converstion rate converstion ratedivide_rate" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/country.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/country.json new file mode 100644 index 00000000..82e2056b --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/country.json @@ -0,0 +1,32 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "countryCode": "AUS", + "name": "Australia", + "description": "country description", + "hasRegion": true, + "regionName": "NSW", + "displaySequence": "country display sequence", + "isAddressLinesReverse": false, + "captureSequence": "country capture sequence", + "displaySequenceLocal": "country display seq local", + "isAddressLinesLocalReverse": false, + "expressionPostal": "country expression postal", + "hasPostalAdd": "country has postal add", + "expressionPhone": "country expression phone", + "mediaSize": "country media size", + "expressionBankRoutingNo": "country expression baking routing no", + "expressionBankAccountNo": "country expression banking account no", + "language": "EN", + "allowCitiesOutOfList": true, + "isPostcodeLookup": false, + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + } +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/countryNoCurrency.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/countryNoCurrency.json new file mode 100644 index 00000000..51b1e96d --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/countryNoCurrency.json @@ -0,0 +1,32 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "countryCode": "AUS", + "name": "Australia", + "description": "country description", + "hasRegion": true, + "regionName": "NSW", + "displaySequence": "country display sequence", + "isAddressLinesReverse": false, + "captureSequence": "country capture sequence", + "displaySequenceLocal": "country display seq local", + "isAddressLinesLocalReverse": false, + "expressionPostal": "country expression postal", + "hasPostalAdd": "country has postal add", + "expressionPhone": "country expression phone", + "mediaSize": "country media size", + "expressionBankRoutingNo": "country expression baking routing no", + "expressionBankAccountNo": "country expression banking account no", + "language": "EN", + "allowCitiesOutOfList": true, + "isPostcodeLookup": false, + "currency": { + "id": 0, + "uuid": "", + "iSOCode": "", + "curSymbol": "", + "description": "", + "standardPrecision": 0, + "costingPrecision": 0 + } +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/dashboard.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/dashboard.json new file mode 100644 index 00000000..ecc43460 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/dashboard.json @@ -0,0 +1,13 @@ +{ + "windowUuid": "953269ba-a67b-11eb-bcbc-0242ac130002", + "browserUuid": "95326a6e-a67b-11eb-bcbc-0242ac130002", + "dashboardName": "dashboard name", + "dashboardDescription": "dashboard description", + "dashboardHtml": "dashboard html", + "columnNo": 0, + "lineNo": 1, + "isCollapsible": true, + "isOpenByDefault": true, + "isEventRequired": false, + "fileName": "dashboard file name" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/documentStatus.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/documentStatus.json new file mode 100644 index 00000000..cca45403 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/documentStatus.json @@ -0,0 +1,5 @@ +{ + "name": "document status name", + "description": "document status description", + "value": "document status value" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/documentType.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/documentType.json new file mode 100644 index 00000000..bef79067 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/documentType.json @@ -0,0 +1,7 @@ +{ + "uuid": "document type uuid", + "id": "document type id", + "name": "document type name", + "description": "document type description", + "printName": "doc type print_name" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/drillTables.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/drillTables.json new file mode 100644 index 00000000..30ce63b8 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/drillTables.json @@ -0,0 +1,4 @@ +{ + "tableName": "table_name", + "printName": "print_name" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/entity.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/entity.json new file mode 100644 index 00000000..63e71509 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/entity.json @@ -0,0 +1,9 @@ +{ + "id": "entity id", + "uuid": "entity uuid", + "tableName": "entity table_name", + "attributes": { + "key1": "value1", + "key2": "value2" + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/entityChat.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/entityChat.json new file mode 100644 index 00000000..bfffb170 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/entityChat.json @@ -0,0 +1,13 @@ +{ + "chatUuid": "chat_uuid", + "id": "id", + "uuid": "123234", + "tableName": "table_name", + "chatTypeUuid": "chat_type_uuid", + "description": "description", + "confidentialType": "confidential_type", + "confidentialTypeName": "confidential_type_name", + "moderationType": "moderation_type", + "moderationTypeName": "moderation_type_name", + "logDate": "log_date" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/entityList.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/entityList.json new file mode 100644 index 00000000..c13993cb --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/entityList.json @@ -0,0 +1,15 @@ +{ + "nextPageToken": "entity list next_page_token", + "recordCount": "entity list record_count", + "recordsList": [ + { + "id": "entity list id", + "uuid": "entity list uuid", + "tableName": "entity list table_name", + "attributes": { + "key1": "value1", + "key2": "value2" + } + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/entityLog.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/entityLog.json new file mode 100644 index 00000000..878dc2ef --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/entityLog.json @@ -0,0 +1,24 @@ +{ + "logId": "log_id", + "id": "id", + "uuid": "uuid", + "tableName": "table_name", + "sessionUuid": "session_uuid", + "userUuid": "user_uuid", + "userName": "user_name", + "transactionName": "transaction_name", + "eventType": "event_type", + "eventTypeName": "event_type_name", + "logDate": "log_date", + "changeLogsList": [ + { + "columnName": "column_name", + "displayColumnName": "display_column_name", + "oldValue": "old_value", + "newValue": "new_value", + "oldDisplayValue": "old_display_value", + "newDisplayValue": "new_display_value", + "description": "description" + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/favorite.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/favorite.json new file mode 100644 index 00000000..48ebfb08 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/favorite.json @@ -0,0 +1,7 @@ +{ + "menuUuid": "953266fe-a67b-11eb-bcbc-0242ac130002", + "menuName": "favorite menu name", + "menuDescription": "favorite menu description", + "referenceUuid": "953268fc-a67b-11eb-bcbc-0242ac130002", + "action": "favorite action" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/field.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/field.json new file mode 100644 index 00000000..0eca005d --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/field.json @@ -0,0 +1,109 @@ +{ + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + } + ] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + } + ] + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/fieldGroup.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/fieldGroup.json new file mode 100644 index 00000000..4d8855fc --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/fieldGroup.json @@ -0,0 +1,9 @@ +{ + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/form.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/form.json new file mode 100644 index 00000000..bd84bea3 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/form.json @@ -0,0 +1,10 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "name": "form name", + "description": "form description", + "help": "form help", + "accessLevel": "form accessLevel", + "fileName": "form file_name", + "isActive": true +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/keyLayout.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/keyLayout.json new file mode 100644 index 00000000..3514c166 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/keyLayout.json @@ -0,0 +1,33 @@ +{ + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "id": "34534534", + "name": "name", + "description": "description", + "help": "help", + "layoutType": "layout_type", + "columns": "columns", + "color": "color", + "keysList": [ + { + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "id": "34534534", + "name": "name", + "description": "description", + "subKeyLayoutUuid": "sub_key_layout_uuid", + "color": "color", + "sequence": "sequence", + "spanX": "span_x", + "spanY": "span_y", + "productValue": "product_value", + "quantity": "quantity", + "resourceReference": { + "resourceUuid": "resource_uuid", + "fileName": "file_name", + "fileSize": "file_size", + "description": "description", + "textMsg": "text_msg", + "contentType": "content_type∏" + } + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/language.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/language.json new file mode 100644 index 00000000..1981b534 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/language.json @@ -0,0 +1,11 @@ +{ + "language": "language", + "languageName": "language name", + "languageISO": "language iso", + "countryCode": "language country code", + "isBaseLanguage": true, + "isSystemLanguage": false, + "isDecimalPoint": true, + "datePattern": "language date pattern", + "timePattern": "language time pattern" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/order.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/order.json new file mode 100644 index 00000000..f5556810 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/order.json @@ -0,0 +1,37 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "documentNo": "document_no", + "documentType": { + "uuid": "document type uuid", + "id": "document type id", + "name": "document type name", + "description": "document type description", + "printName": "doc type print_name" + }, + "salesRepresentative": { + "uuid": "sales rep uuid", + "id": "sales rep id", + "name": "sales rep name", + "description": "sales rep description" + }, + "documentStatus": { + "name": "document status name", + "description": "document status description", + "value": "document status value" + }, + "totalLines": "total_lines", + "grandTotal": "grand_total", + "dateOrdered": "date_ordered", + "businessPartner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "taxId": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "lastName": "last_name", + "description": "description" + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/orderLine.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/orderLine.json new file mode 100644 index 00000000..e06df3c8 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/orderLine.json @@ -0,0 +1,52 @@ +{ + "uuid": "orderLine uuid", + "orderUuid": "orderLine order_uuid", + "line": "orderLine line", + "product": { + "uuid": "product uuid", + "id": "product id", + "value": "product value", + "name": "product name", + "help": "product help", + "documentNote": "product document_note", + "uomName": "product uom_name", + "productType": "product product_type", + "isStocked": true, + "isDropShip": false, + "isPurchased": false, + "isSold": true, + "imageUrl": "product image_url", + "productCategoryName": "product product_category_name", + "productGroupName": "product product_group_name", + "productClassName": "product product_class_name", + "productClassificationName": "product product_classification_name", + "weight": "product weight", + "volume": "product volume", + "upc": "product upc", + "sku": "product sku", + "shelfWidth": "product shelf_width", + "shelfHeight": "product shelf_height", + "shelfDepth": "product shelf_depth", + "unitsPerPack": "product units_per_pack", + "unitsPerPallet": "product units_per_pallet", + "guaranteeDays": "product guarantee_days", + "descriptionUrl": "product description_url", + "versionNo": "product version_no", + "taxCategory": "product tax_category", + "description": "product description" + }, + "charge": "orderLine charge", + "description": "orderLine description", + "lineDescription": "orderLine line_description", + "quantity": "orderLine quantity", + "price": "orderLine price", + "discountRate": "orderLine discount_rate", + "lineNetAmount": "orderLine line_net_amount", + "taxRate": { + "name": "tax rate name", + "description": "tax rate description", + "taxIndicator": "tax rate tax_indicator", + "rate": "tax rate rate" + }, + "warehouse": "orderLine warehouse" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/organization.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/organization.json new file mode 100644 index 00000000..d8f10552 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/organization.json @@ -0,0 +1,13 @@ +{ + "id": "12345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "name": "organization name", + "description": "organization description", + "isReadOnly": "organization is read only", + "duns": "organization duns", + "taxId": "organization tax id", + "phone": "organization phone", + "phone2": "organization phone2", + "fax": "organization fax", + "corporateBrandingImage": "organization corporate branding image" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/paymentMethod.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/paymentMethod.json new file mode 100644 index 00000000..c18a61b6 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/paymentMethod.json @@ -0,0 +1,15 @@ +{ + "amount": "payment method amount", + "bankUuid": "payment method bank_uuid", + "businessPartner": "payment method business_partner", + "currencyUuid": "payment method currency_uuid", + "description": "payment method description", + "documentNo": "payment method document_no", + "documentStatus": "payment method document_status", + "id": "payment method id", + "orderUuid": "payment method order_uuid", + "paymentDate": "payment method payment_date", + "referenceNo": "payment method reference_no", + "tenderTypeCode": "payment method tender_type_code", + "uuid": "payment method uuid" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/pendingDocument.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/pendingDocument.json new file mode 100644 index 00000000..3c0772b5 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/pendingDocument.json @@ -0,0 +1,19 @@ +{ + "windowUuid": "95326b18-a67b-11eb-bcbc-0242ac130002", + "formUuid": "95326bcc-a67b-11eb-bcbc-0242ac130002", + "documentName": "pending document name", + "documentDescription": "pending document description", + "sequence": 2, + "recordCount": 0, + "criteria": { + "tableName": "pending document criteria table name", + "query": "pending document criteria query", + "whereClause": "pending document criteria where clause", + "orderByClause": "pending document criteria order by clause", + "referenceUuid": "95326c76-a67b-11eb-bcbc-0242ac130002", + "filters": [], + "valuesList": ["value1", "value2"], + "orderByColumnList": ["column1", "column2"], + "limit": 5 + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/pointOfSales.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/pointOfSales.json new file mode 100644 index 00000000..36a0c968 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/pointOfSales.json @@ -0,0 +1,119 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "name": "name", + "description": "description", + "help": "help", + "isModifyPrice": true, + "isPosRequiredPin": false, + "isAisleSeller": false, + "isSharedPos": true, + "documentType": { + "uuid": "document type uuid", + "id": "document type id", + "name": "document type name", + "description": "document type description", + "printName": "doc type print_name" + }, + "cashBankAccount": { + "uuid": "cashbank account uuid", + "id": "cashbank account id", + "name": "cash bank account name", + "description": "cash bank account description", + "accountNo": "cash bank account account_no", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + }, + "bban": "cash bank account bban", + "iban": "cash bank account iban", + "creditLimit": "cash bank account credit_limit", + "currentBalance": "cash bank account current_balance", + "isDefault": "cash bank account is_default", + "businessPartner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "taxId": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "lastName": "last_name", + "description": "description" + }, + "bankAccountType": "bank account bank_account_type", + "bankAccountTypeName": "bank account bank_account_type_name" + }, + "cashTransferBankAccount": { + "uuid": "bank account uuid", + "id": "bank account id", + "name": "bank account name", + "description": "bank account description", + "accountNo": "bank account account_no", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + }, + "bban": "bank account bban", + "iban": "bank account iban", + "creditLimit": "bank account credit_limit", + "currentBalance": "bank account current_balance", + "isDefault": "bank account is_default", + "businessPartner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "taxId": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "lastName": "last_name", + "description": "description" + }, + "bankAccountType": "bank account bank_account_type", + "bankAccountTypeName": "bank account bank_account_type_name" + }, + "salesRepresentative": "sales_representative", + "templateBusinessPartner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "taxId": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "lastName": "last_name", + "description": "description" + }, + "priceList": { + "uuid": "price list uuid", + "id": "price list id", + "name": "price list name", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + }, + "isDefault": "is_default", + "isTaxIncluded": "is_tax_included", + "isEnforcePriceLimit": "is_enforce_price_limit", + "isNetPrice": "is_net_price", + "pricePrecision": "price_precision" + }, + "conversionTypeUuid": "conversion_type_uuid", + "keyLayoutUuid": "key_layout_uuid" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/priceList.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/priceList.json new file mode 100644 index 00000000..19fd4608 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/priceList.json @@ -0,0 +1,19 @@ +{ + "uuid": "price list uuid", + "id": "price list id", + "name": "price list name", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + }, + "isDefault": "is_default", + "isTaxIncluded": "is_tax_included", + "isEnforcePriceLimit": "is_enforce_price_limit", + "isNetPrice": "is_net_price", + "pricePrecision": "price_precision" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/printFormats.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/printFormats.json new file mode 100644 index 00000000..efab337c --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/printFormats.json @@ -0,0 +1,14 @@ +{ + "recordCount": "record_count", + "records": [ + { + "name": "name", + "description": "description", + "tableName": "table_name", + "isDefault": true, + "reportViewUuid": "report_view_uuid", + "printFormatUuid": "print_format_uuid" + } + ], + "nextPageToken": "next_page_token" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/process.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/process.json new file mode 100644 index 00000000..ad61d85b --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/process.json @@ -0,0 +1,118 @@ +{ + "accessLevel": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "isActive": false, + "isDirectPrint": true, + "isReport": false, + "name": "Process Name", + "reportExportTypes": ["Export Type 1", "Export Type 2"], + "showHelp": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [{ + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [{ + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + }] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [{ + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + }] + } + }] +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/processLog.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/processLog.json new file mode 100644 index 00000000..db5d89df --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/processLog.json @@ -0,0 +1,11 @@ +{ + "uuid": "uuid", + "instanceUuid": "instance_uuid", + "isError": true, + "summary": "summary", + "resultTableName": "result_table_name", + "isProcessing": false, + "lastRun": "last_run", + "paramenters": [], + "output": {} +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/processLogWithReport.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/processLogWithReport.json new file mode 100644 index 00000000..db64865b --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/processLogWithReport.json @@ -0,0 +1,29 @@ +{ + "uuid": "uuid", + "instanceUuid": "instance_uuid", + "isError": true, + "summary": "summary", + "resultTableName": "result_table_name", + "isProcessing": false, + "lastRun": "last_run", + "paramenters": [], + "output": { + "uuid": "uuid", + "name": "name", + "description": "description", + "fileName": "file_name", + "output": "output", + "mimeType": "mime_type", + "dataCols": "data_cols", + "dataRows": "data_rows", + "headerName": "header_name", + "footerName": "footer_name", + "printFormatUuid": "print_format_uuid", + "reportViewUuid": "report_view_uuid", + "tableName": "table_name", + "outputStream": "output_stream", + "outputStream_asB64": "output_stream_asB64", + "outputStream_asU8": "output_stream_asU8", + "reportType": "report_type" + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/processWithUndefined.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/processWithUndefined.json new file mode 100644 index 00000000..e74d96d9 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/processWithUndefined.json @@ -0,0 +1,72 @@ +{ + "accessLevel": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "isActive": false, + "isDirectPrint": true, + "isReport": false, + "name": "Process Name", + "reportExportTypes": ["Export Type 1", "Export Type 2"], + "showHelp": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [{ + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": {}, + "reference": { + "zoomWindows": [] + }, + "contextInfo": { + "messageText": {} + }, + "fieldDefinition": { + "conditions": [] + } + }] +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/product.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/product.json new file mode 100644 index 00000000..3e8c6d6c --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/product.json @@ -0,0 +1,33 @@ +{ + "uuid": "product uuid", + "id": "product id", + "value": "product value", + "name": "product name", + "help": "product help", + "documentNote": "product document_note", + "uomName": "product uom_name", + "productType": "product product_type", + "isStocked": true, + "isDropShip": false, + "isPurchased": false, + "isSold": true, + "imageUrl": "product image_url", + "productCategoryName": "product product_category_name", + "productGroupName": "product product_group_name", + "productClassName": "product product_class_name", + "productClassificationName": "product product_classification_name", + "weight": "product weight", + "volume": "product volume", + "upc": "product upc", + "sku": "product sku", + "shelfWidth": "product shelf_width", + "shelfHeight": "product shelf_height", + "shelfDepth": "product shelf_depth", + "unitsPerPack": "product units_per_pack", + "unitsPerPallet": "product units_per_pallet", + "guaranteeDays": "product guarantee_days", + "descriptionUrl": "product description_url", + "versionNo": "product version_no", + "taxCategory": "product tax_category", + "description": "product description" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/productPrice.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/productPrice.json new file mode 100644 index 00000000..f1eb8560 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/productPrice.json @@ -0,0 +1,75 @@ +{ + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + }, + "taxRate": { + "name": "tax rate name", + "description": "tax rate description", + "taxIndicator": "tax rate tax_indicator", + "rate": "tax rate rate" + } + , + "product": { + "uuid": "product uuid", + "id": "product id", + "value": "product value", + "name": "product name", + "help": "product help", + "documentNote": "product document_note", + "uomName": "product uom_name", + "productType": "product product_type", + "isStocked": true, + "isDropShip": false, + "isPurchased": false, + "isSold": true, + "imageUrl": "product image_url", + "productCategoryName": "product product_category_name", + "productGroupName": "product product_group_name", + "productClassName": "product product_class_name", + "productClassificationName": "product product_classification_name", + "weight": "product weight", + "volume": "product volume", + "upc": "product upc", + "sku": "product sku", + "shelfWidth": "product shelf_width", + "shelfHeight": "product shelf_height", + "shelfDepth": "product shelf_depth", + "unitsPerPack": "product units_per_pack", + "unitsPerPallet": "product units_per_pallet", + "guaranteeDays": "product guarantee_days", + "descriptionUrl": "product description_url", + "versionNo": "product version_no", + "taxCategory": "product tax_category", + "description": "product description" + } + , + "schemaCurrency": { + "id": "345345345123", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iSOCode": "34534123", + "curSymbol": "$", + "description": "currency description", + "standardPrecision": "currency standard precision", + "costingPrecision": "currency coasting precision" + }, + "schemaPriceLimit": "product price schema_price_limit", + "schemaPriceList": "product price schema_price_list", + "schemaPriceStandard": "product price schema_price_standard", + "priceList": "product price price_list", + "priceStandard": "product price price_standard", + "priceLimit": "product price price_limit", + "priceListName": "product price price_list_name", + "isTaxIncluded": false, + "validFrom": "product price validFrom", + "pricePrecision": "product price price_precision", + "quantityOnHand": "product price quantity_on_hand", + "quantityReserved": "product price quantity_reserved", + "quantityOrdered": "product price quantity_ordered", + "quantityAvailable": "product price quantity_available" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/recentListItems.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/recentListItems.json new file mode 100644 index 00000000..65f78c54 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/recentListItems.json @@ -0,0 +1,21 @@ +{ + "recordCount": 0, + "nextPageToken": "12345", + "recentItemsList": [ + { + "menuUuid": "9532638e-a67b-11eb-bcbc-0242ac130002", + "menuName": "Menu Name", + "menuDescription": "Menu Description", + "windowUuid": "95326442-a67b-11eb-bcbc-0242ac130002", + "tabUuid": "953264ec-a67b-11eb-bcbc-0242ac130002", + "tableId": 3, + "tableName": "table name", + "id": 23, + "uuid": "953265a0-a67b-11eb-bcbc-0242ac130002", + "displayName": "display name", + "updated": "2021-04-27", + "referenceUuid": "95326654-a67b-11eb-bcbc-0242ac130002", + "action": "item list action" + } + ] +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/reference.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/reference.json new file mode 100644 index 00000000..6cad7c97 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/reference.json @@ -0,0 +1,8 @@ +{ + "uuid": "uuid", + "tableName": "table_name", + "windowUuid": "window_uuid", + "displayName": "display_name", + "whereClause": "where_clause", + "recordCount": "record_count" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/referenceList.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/referenceList.json new file mode 100644 index 00000000..28ad845d --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/referenceList.json @@ -0,0 +1,14 @@ +{ + "recordCount": "record_count", + "referencesList": [ + { + "uuid": "uuid", + "tableName": "table_name", + "windowUuid": "window_uuid", + "displayName": "display_name", + "whereClause": "where_clause", + "recordCount": "record_count" + } + ], + "nextPageToken": "next_page_token" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/reportExportType.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/reportExportType.json new file mode 100644 index 00000000..b78c8558 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/reportExportType.json @@ -0,0 +1,5 @@ +{ + "name": "reportExportType name", + "description": "reportExportType description", + "type": "reportExportType type" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/reportOutput.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/reportOutput.json new file mode 100644 index 00000000..f7ad6e40 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/reportOutput.json @@ -0,0 +1,19 @@ +{ + "uuid": "uuid", + "name": "name", + "description": "description", + "fileName": "file_name", + "output": "output", + "mimeType": "mime_type", + "dataCols": "data_cols", + "dataRows": "data_rows", + "headerName": "header_name", + "footerName": "footer_name", + "printFormatUuid": "print_format_uuid", + "reportViewUuid": "report_view_uuid", + "tableName": "table_name", + "outputStream": "output_stream", + "outputStream_asB64": "output_stream_asB64", + "outputStream_asU8": "output_stream_asU8", + "reportType": "report_type" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/reportView.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/reportView.json new file mode 100644 index 00000000..28ffa75d --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/reportView.json @@ -0,0 +1,7 @@ +{ + "uuid": "uuid", + "name": "name", + "description": "description", + "tableName": "table_name", + "reportViewUuid": "report_view_uuid" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/role.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/role.json new file mode 100644 index 00000000..47537b76 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/role.json @@ -0,0 +1,27 @@ +{ + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "clientId": "client_id", + "clientName": "client_name", + "isAllowHtmlView": true, + "isAllowInfoAccount": false, + "isAllowInfoAsset": true, + "isAllowInfoBusinessPartner": true, + "isAllowInfoCashJournal": false, + "isAllowInfoCrp": false, + "isAllowInfoInOut": false, + "isAllowInfoInvoice": true, + "isAllowInfoMrp": true, + "isAllowInfoOrder": true, + "isAllowInfoPayment": true, + "isAllowInfoProduct": true, + "isAllowInfoResource": true, + "isAllowInfoSchedule": true, + "isAllowXlsView": true, + "isCanExport": true, + "isCanReport": true, + "isPersonalAccess": true, + "isPersonalLock": false +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/salesRepresentative.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/salesRepresentative.json new file mode 100644 index 00000000..78cdea3d --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/salesRepresentative.json @@ -0,0 +1,6 @@ +{ + "uuid": "sales rep uuid", + "id": "sales rep id", + "name": "sales rep name", + "description": "sales rep description" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/tab.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/tab.json new file mode 100644 index 00000000..1cc75b73 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/tab.json @@ -0,0 +1,296 @@ +{ + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "tableName": "table_name", + "sequence": "sequence", + "tabLevel": "tab_level", + "isActive": false, + "isSingleRow": true, + "isAdvancedTab": true, + "isHasTree": true, + "isInfoTab": false, + "isSortTab": true, + "isTranslationTab": true, + "isReadOnly": true, + "isInsertRecord": false, + "isView": true, + "isDeleteable": true, + "isDocument": false, + "isChangeLog": false, + "accessLevel": "access_level", + "linkColumnName": "link_column_name", + "sortOrderColumnName": "sort_order_column_name", + "sortYesNoColumnName": "sort_yes_no_column_name", + "parentColumnName": "parent_column_name", + "displayLogic": "display_logic", + "commitWarning": "commit_warning", + "query": "query", + "whereClause": "where_clause", + "orderByClause": "order_by_clause", + "parentTabUuid": "parent_tab_uuid", + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "processes": [ + { + "accessLevel": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "isActive": false, + "isDirectPrint": true, + "isReport": false, + "name": "Process Name", + "reportExportTypes": ["Export Type 1", "Export Type 2"], + "showHelp": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + } + ] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + } + ] + } + } + ] + } + ], + "fields": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + } + ] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + } + ] + } + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/taxRate.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/taxRate.json new file mode 100644 index 00000000..fa092090 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/taxRate.json @@ -0,0 +1,6 @@ +{ + "name": "tax rate name", + "description": "tax rate description", + "taxIndicator": "tax rate tax_indicator", + "rate": "tax rate rate" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/translation.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/translation.json new file mode 100644 index 00000000..d2437c0e --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/translation.json @@ -0,0 +1,5 @@ +{ + "language": "translation: language", + "uuid": "translation: uuid", + "values": "translation: values" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/user.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/user.json new file mode 100644 index 00000000..448b28a0 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/user.json @@ -0,0 +1,45 @@ +{ + "id": "id", + "uuid": "uuid", + "name": "name", + "userInfo": "user_info", + "role": { + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "clientId": "client_id", + "clientName": "client_name", + "isAllowHtmlView": true, + "isAllowInfoAccount": false, + "isAllowInfoAsset": true, + "isAllowInfoBusinessPartner": true, + "isAllowInfoCashJournal": false, + "isAllowInfoCrp": false, + "isAllowInfoInOut": false, + "isAllowInfoInvoice": true, + "isAllowInfoMrp": true, + "isAllowInfoOrder": true, + "isAllowInfoPayment": true, + "isAllowInfoProduct": true, + "isAllowInfoResource": true, + "isAllowInfoSchedule": true, + "isAllowXlsView": true, + "isCanExport": true, + "isCanReport": true, + "isPersonalAccess": true, + "isPersonalLock": false + }, + "processed": "processed", + "defaultContext": "default_context", + "countryId": "country_id", + "costingPrecision": "costing_precision", + "countryCode": "country_code", + "countryName": "country_name", + "currencyIsoCode": "currency_iso_code", + "currencyName": "currency_name", + "currencySymbol": "currency_symbol", + "displaySequence": "display_sequence", + "language": "language", + "standardPrecision": "standard_precision" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/validationRule.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/validationRule.json new file mode 100644 index 00000000..cea3828e --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/validationRule.json @@ -0,0 +1,8 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "name": "validation rule name", + "description": "validation rule description", + "validationCode": "validation rule validation_code", + "type": "validation rule type" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/window.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/window.json new file mode 100644 index 00000000..ffffb884 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/window.json @@ -0,0 +1,324 @@ +{ + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "isActive": true, + "isSalesTransaction": false, + "windowType": "windowType", + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "tabs": [ + { + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "tableName": "table_name", + "sequence": "sequence", + "tabLevel": "tab_level", + "isActive": false, + "isSingleRow": true, + "isAdvancedTab": true, + "isHasTree": true, + "isInfoTab": false, + "isSortTab": true, + "isTranslationTab": true, + "isReadOnly": true, + "isInsertRecord": false, + "isView": true, + "isDeleteable": true, + "isDocument": false, + "isChangeLog": false, + "accessLevel": "access_level", + "linkColumnName": "link_column_name", + "sortOrderColumnName": "sort_order_column_name", + "sortYesNoColumnName": "sort_yes_no_column_name", + "parentColumnName": "parent_column_name", + "displayLogic": "display_logic", + "commitWarning": "commit_warning", + "query": "query", + "whereClause": "where_clause", + "orderByClause": "order_by_clause", + "parentTabUuid": "parent_tab_uuid", + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "processes": [ + { + "accessLevel": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "isActive": false, + "isDirectPrint": true, + "isReport": false, + "name": "Process Name", + "reportExportTypes": ["Export Type 1", "Export Type 2"], + "showHelp": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + } + ] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + } + ] + } + } + ] + } + ], + "fields": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "columnName": "Process Parameter Column Name", + "elementName": "Process Parameter Element Name", + "isActive": true, + "displayType": "Process Parameter Display Type", + "isFieldOnly": false, + "isRange": true, + "isSameLine": false, + "isEncrypted": true, + "isQuickEntry": false, + "sequence": "Process Parameter Sequence", + "seqNoGrid": 6, + "sortNo": 1, + "identifierSequence": "Process Parameter Identifier Sequence", + "formatPattern": "Process Parameter Format Pattern", + "vFormat": "Process Parameter V Format", + "defaultValue": "Process Parameter Default Value", + "defaultValueTo": "Process Parameter Default Value To", + "fieldLength": 2, + "valueMin": 3, + "valueMax": 3, + "isIdentifier": true, + "isParent": false, + "isKey": true, + "isSelectionColumn": false, + "isUpdateable": true, + "isAlwaysUpdateable": false, + "isAllowCopy": true, + "isHeading": false, + "isAllowLogging": true, + "isTranslated": false, + "columnSQL": "Process Parameter Column SQL", + "isDisplayed": true, + "isDisplayedGrid": false, + "isMandatory": true, + "isReadOnly": false, + "isQueryCriteria": true, + "isOrderBy": false, + "isInfoOnly": true, + "callout": "Process Parameter Callout", + "displayLogic": "Process Parameter Display Logic", + "mandatoryLogic": "Process Parameter Mandatory Logic", + "readOnlyLogic": "Process Parameter Read Only Logic", + "fieldGroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "fieldGroupType": "Process Parameter Fieldgroup Type", + "isActive": true, + "groupName": "Process Parameter Fieldgroup Name", + "groupType": "Process Parameter Fieldgroup Type" + }, + "reference": { + "tableName": "Process Parameter Reference Table Name", + "keyColumnName": "Process Parameter Reference Key Column Name", + "displayColumnName": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "directQuery": "Process Parameter Reference Direcy Query", + "validationCode": "Process Parameter Reference Validation Code", + "zoomWindows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "isSalesTransaction": false, + "isActive": true + } + ] + }, + "contextInfo": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sqlStatement": "Process Parameter Context Info SQL Statement", + "isActive": false, + "messageText": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "messageType": "Process Parameter Context Info Message Text Type", + "messageText": "Process Parameter Context Info Message Text Text", + "messageTip": "Process Parameter Context Info Message Text Tip", + "isActive": false + } + }, + "fieldDefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "isActive": false, + "fieldGroupType": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "styleSheet": "Process Parameter Field Definition Condition Style Sheet", + "isActive": false + } + ] + } + } + ] + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/workflowDefinition.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/workflowDefinition.json new file mode 100644 index 00000000..3ca3454d --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/workflowDefinition.json @@ -0,0 +1,83 @@ +{ + "uuid": "uuid", + "value": "value", + "name": "name", + "description": "description", + "help": "help", + "tableName": "table_name", + "responsibleUuid": "responsible_uuid", + "priority": "priority", + "validFrom": "valid_from", + "isDefault": true, + "isValid": false, + "publishStatus": "publish_status", + "publishStatusName": "publish_status_name", + "durationUnit": "duration_unit", + "durationUnitName": "duration_unit_name", + "startNode": { + "uuid": "start node uuid", + "value": "start node value", + "name": "start node name", + "description": "start node description", + "help": "start node help", + "responsibleUuid": "start node responsible_uuid", + "documentAction": { "action": "value1" }, + "priority": "start node priority", + "action": "start node action", + "actionName": "start node action_name", + "transitionsList": [ + { + "nodeNextUuid": "start node node_next_uuid", + "description": "start node description", + "isStdUserWorkflow": true, + "isStandardUserWorkflow": true, + "sequence": "start node sequence", + "workflowConditionsList": [ + { + "sequence": "start node sequence", + "columnName": "start node column_name", + "value": "start node value", + "conditionType": "start node confidential_type", + "conditionTypeName": "start node confidential_type_name", + "operation": "start node operation", + "operationName": "start node operation_name" + } + ] + } + ] + }, + "workflowNodesList": [ + { + "uuid": "node 1 uuid", + "value": "node 1 value", + "name": "node 1 name", + "description": "node 1 description", + "help": "node 1 help", + "responsibleUuid": "node 1 responsible_uuid", + "documentAction": { "action": "value2" }, + "priority": "node 1 priority", + "action": "node 1 action", + "actionName": "node 1 action_name", + "transitionsList": [ + { + "nodeNextUuid": "node 1 node_next_uuid", + "description": "node 1 description", + "isStdUserWorkflow": true, + "isStandardUserWorkflow": true, + "sequence": "node 1 sequence", + "workflowConditionsList": [ + { + "sequence": "node 1 sequence", + "columnName": "node 1 column_name", + "value": "node 1 value", + "conditionType": "node 1 confidential_type", + "conditionTypeName": "node 1 confidential_type_name", + "operation": "node 1 operation", + "operationName": "node 1 operation_name" + } + ] + } + ] + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/converted/workflowProcess.json b/tests/unit/utils/ADempiere/apiConverts/objects/converted/workflowProcess.json new file mode 100644 index 00000000..66bf6498 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/converted/workflowProcess.json @@ -0,0 +1,40 @@ +{ + "processUuid": "process_uuid", + "workflowUuid": "workflow_uuid", + "workflowName": "workflow_name", + "recordId": "record_id", + "tableName": "table_name", + "userUuid": "user_uuid", + "userName": "user_name", + "responsibleUuid": "responsible_uuid", + "responsibleName": "responsible_name", + "textMessage": "text_message", + "processed": "processed", + "workflowStateName": "workflow_state_name", + "workflowState": "workflow_state", + "priority": "priority", + "priorityName": "priority_name", + "workflowEventsList": [ + { + "nodeUuid": "node_uuid", + "nodeName": "node_name", + "recordId": "record_id", + "tableName": "table_name", + "userUuid": "user_uuid", + "userName": "user_name", + "responsibleUuid": "responsible_uuid", + "responsibleName": "responsible_name", + "textMessage": "text_message", + "timeElapsed": "time_elapsed", + "attributeName": "attribute_name", + "oldValue": "old_value", + "newValue": "new_value", + "workflowState": "workflow_state", + "workflowStateName": "workflow_state_name", + "eventType": "event_type", + "eventTypeName": "event_type_name", + "logDate": "log_date" + } + ], + "logDate": "log_date" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/bankAccount.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/bankAccount.json new file mode 100644 index 00000000..3c34189a --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/bankAccount.json @@ -0,0 +1,34 @@ +{ + "uuid": "bank account uuid", + "id": "bank account id", + "name": "bank account name", + "description": "bank account description", + "account_no": "bank account account_no", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + }, + "bban": "bank account bban", + "iban": "bank account iban", + "credit_limit": "bank account credit_limit", + "current_balance": "bank account current_balance", + "is_default": "bank account is_default", + "business_partner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "tax_id": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "last_name": "last_name", + "description": "description" + }, + "bank_account_type": "bank account bank_account_type", + "bank_account_type_name": "bank account bank_account_type_name" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/browser.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/browser.json new file mode 100644 index 00000000..41ed2f6f --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/browser.json @@ -0,0 +1,565 @@ +{ + "id": "id", + "uuid": "uuid", + "view_uuid": "viewUuid", + "value": "value", + "name": "name", + "description": "description", + "help": "help", + "access_level": "access_level", + "is_active": false, + "is_updateable": true, + "is_deleteable": false, + "is_selected_by_default": true, + "is_collapsible_by_default": true, + "is_executed_query_by_default": false, + "is_show_total": true, + "query": "query", + "where_clause": "where_clause", + "order_by_clause": "order_by_clause", + "window": { + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "is_active": true, + "is_sales_transaction": false, + "window_type": "windowType", + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "tabs": [ + { + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "table_name": "table_name", + "sequence": "sequence", + "tab_level": "tab_level", + "is_active": false, + "is_single_row": true, + "is_advanced_tab": true, + "is_has_tree": true, + "is_info_tab": false, + "is_sort_tab": true, + "is_translation_tab": true, + "is_read_only": true, + "is_insert_record": false, + "is_view": true, + "is_deleteable": true, + "is_document": false, + "is_change_log": false, + "access_level": "access_level", + "link_column_name": "link_column_name", + "sort_order_column_name": "sort_order_column_name", + "sort_yes_no_column_name": "sort_yes_no_column_name", + "parent_column_name": "parent_column_name", + "display_logic": "display_logic", + "commit_warning": "commit_warning", + "query": "query", + "where_clause": "where_clause", + "order_by_clause": "order_by_clause", + "parent_tab_uuid": "parent_tab_uuid", + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "field_group": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "processes": [ + { + "access_level": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "is_active": false, + "is_direct_print": true, + "is_report": false, + "name": "Process Name", + "report_export_types": ["Export Type 1", "Export Type 2"], + "show_help": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } + } + ] + } + ], + "fields": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } + } + ] + } + ] + }, + "process": { + "access_level": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "is_active": false, + "is_direct_print": true, + "is_report": false, + "name": "Process Name", + "report_export_types": ["Export Type 1", "Export Type 2"], + "show_help": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } + } + ] + }, + "fields": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/businessPartner.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/businessPartner.json new file mode 100644 index 00000000..9946aa14 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/businessPartner.json @@ -0,0 +1,11 @@ +{ + "uuid": "uuid", + "id": "id", + "value": "value", + "tax_id": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "last_name": "last_name", + "description": "description" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/chatEntry.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/chatEntry.json new file mode 100644 index 00000000..f889c8d9 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/chatEntry.json @@ -0,0 +1,15 @@ +{ + "chat_uuid": "chat_uuid", + "chat_entry_uuid": "chat_entry_uuid", + "subject": "subject", + "character_data": "character_data", + "user_uuid": "user_uuid", + "user_name": "user_name", + "chat_entry_type": "chat_entry_type", + "chat_entry_type_name": "chat_entry_type_name", + "confidential_type": "confidential_type", + "confidential_type_name": "confidential_type_name", + "moderator_status": "moderator_status", + "moderator_status_name": "moderator_status_name", + "log_date": "log_date" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/contextInfo.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/contextInfo.json new file mode 100644 index 00000000..63ce1031 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/contextInfo.json @@ -0,0 +1,16 @@ +{ + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/contextInfoWithoutMessage.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/contextInfoWithoutMessage.json new file mode 100644 index 00000000..fe291dd0 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/contextInfoWithoutMessage.json @@ -0,0 +1,8 @@ +{ + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/conversionRate.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/conversionRate.json new file mode 100644 index 00000000..29693e81 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/conversionRate.json @@ -0,0 +1,26 @@ +{ + "uuid": "converstion rateuuid", + "id": "converstion rateid", + "conversion_type_uuid": "converstion rateconversion_type_uuid", + "valid_from": "converstion rate valid_from", + "currency_from": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + }, + "currency_to": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + }, + "multiply_rate": "converstion rate multiply_rate", + "divide_rate": "converstion rate converstion ratedivide_rate" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/conversionRateNoCurrency.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/conversionRateNoCurrency.json new file mode 100644 index 00000000..accd34f5 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/conversionRateNoCurrency.json @@ -0,0 +1,8 @@ +{ + "uuid": "converstion rateuuid", + "id": "converstion rateid", + "conversion_type_uuid": "converstion rateconversion_type_uuid", + "valid_from": "converstion rate valid_from", + "multiply_rate": "converstion rate multiply_rate", + "divide_rate": "converstion rate converstion ratedivide_rate" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/country.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/country.json new file mode 100644 index 00000000..6d0272f5 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/country.json @@ -0,0 +1,32 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "country_code": "AUS", + "name": "Australia", + "description": "country description", + "has_region": true, + "region_name": "NSW", + "display_sequence": "country display sequence", + "is_address_lines_reverse": false, + "capture_sequence": "country capture sequence", + "display_sequence_local": "country display seq local", + "is_address_lines_local_reverse": false, + "expression_postal": "country expression postal", + "has_postal_add": "country has postal add", + "expression_phone": "country expression phone", + "media_size": "country media size", + "expression_bank_routing_no": "country expression baking routing no", + "expression_bank_account_no": "country expression banking account no", + "language": "EN", + "allow_cities_out_of_list": true, + "is_post_code_lookup": false, + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + } +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/countryNoCurrency.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/countryNoCurrency.json new file mode 100644 index 00000000..a1d8a0ef --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/countryNoCurrency.json @@ -0,0 +1,23 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "country_code": "AUS", + "name": "Australia", + "description": "country description", + "has_region": true, + "region_name": "NSW", + "display_sequence": "country display sequence", + "is_address_lines_reverse": false, + "capture_sequence": "country capture sequence", + "display_sequence_local": "country display seq local", + "is_address_lines_local_reverse": false, + "expression_postal": "country expression postal", + "has_postal_add": "country has postal add", + "expression_phone": "country expression phone", + "media_size": "country media size", + "expression_bank_routing_no": "country expression baking routing no", + "expression_bank_account_no": "country expression banking account no", + "language": "EN", + "allow_cities_out_of_list": true, + "is_post_code_lookup": false +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/dashboard.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/dashboard.json new file mode 100644 index 00000000..ce83fef2 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/dashboard.json @@ -0,0 +1,13 @@ +{ + "window_uuid": "953269ba-a67b-11eb-bcbc-0242ac130002", + "browser_uuid": "95326a6e-a67b-11eb-bcbc-0242ac130002", + "dashboard_name": "dashboard name", + "dashboard_description": "dashboard description", + "dashboard_html": "dashboard html", + "column_no": 0, + "line_no": 1, + "is_collapsible": true, + "is_open_by_default": true, + "is_event_required": false, + "file_name": "dashboard file name" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/documentStatus.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/documentStatus.json new file mode 100644 index 00000000..cca45403 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/documentStatus.json @@ -0,0 +1,5 @@ +{ + "name": "document status name", + "description": "document status description", + "value": "document status value" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/documentType.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/documentType.json new file mode 100644 index 00000000..2771fe00 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/documentType.json @@ -0,0 +1,7 @@ +{ + "uuid": "document type uuid", + "id": "document type id", + "name": "document type name", + "description": "document type description", + "print_name": "doc type print_name" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/drillTables.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/drillTables.json new file mode 100644 index 00000000..5f6f7b14 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/drillTables.json @@ -0,0 +1,4 @@ +{ + "table_name": "table_name", + "print_name": "print_name" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entity.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entity.json new file mode 100644 index 00000000..f873585f --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entity.json @@ -0,0 +1,9 @@ +{ + "id": "entity id", + "uuid": "entity uuid", + "table_name": "entity table_name", + "attributes": [ + { "key": "key1", "value": "value1" }, + { "key": "key2", "value": "value2" } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entityChat.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entityChat.json new file mode 100644 index 00000000..7f31495b --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entityChat.json @@ -0,0 +1,13 @@ +{ + "chat_uuid": "chat_uuid", + "id": "id", + "uuid": "123234", + "table_name": "table_name", + "chat_type_uuid": "chat_type_uuid", + "description": "description", + "confidential_type": "confidential_type", + "confidential_type_name": "confidential_type_name", + "moderation_type": "moderation_type", + "moderation_type_name": "moderation_type_name", + "log_date": "log_date" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entityList.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entityList.json new file mode 100644 index 00000000..641724be --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entityList.json @@ -0,0 +1,15 @@ +{ + "next_page_token": "entity list next_page_token", + "record_count": "entity list record_count", + "records": [ + { + "id": "entity list id", + "uuid": "entity list uuid", + "table_name": "entity list table_name", + "attributes": [ + { "key": "key1", "value": "value1" }, + { "key": "key2", "value": "value2" } + ] + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entityLog.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entityLog.json new file mode 100644 index 00000000..a57e4f69 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/entityLog.json @@ -0,0 +1,24 @@ +{ + "log_id": "log_id", + "id": "id", + "uuid": "uuid", + "table_name": "table_name", + "session_uuid": "session_uuid", + "user_uuid": "user_uuid", + "user_name": "user_name", + "transaction_name": "transaction_name", + "event_type": "event_type", + "event_type_name": "event_type_name", + "log_date": "log_date", + "change_logs": [ + { + "column_name": "column_name", + "display_column_name": "display_column_name", + "old_value": "old_value", + "new_value": "new_value", + "old_display_value": "old_display_value", + "new_display_value": "new_display_value", + "description": "description" + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/favorite.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/favorite.json new file mode 100644 index 00000000..a4e3bfc7 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/favorite.json @@ -0,0 +1,7 @@ +{ + "menu_uuid": "953266fe-a67b-11eb-bcbc-0242ac130002", + "menu_name": "favorite menu name", + "menu_description": "favorite menu description", + "reference_uuid": "953268fc-a67b-11eb-bcbc-0242ac130002", + "action": "favorite action" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/field.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/field.json new file mode 100644 index 00000000..4e64624d --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/field.json @@ -0,0 +1,106 @@ +{ + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/fieldGroup.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/fieldGroup.json new file mode 100644 index 00000000..517d6b80 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/fieldGroup.json @@ -0,0 +1,7 @@ +{ + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/form.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/form.json new file mode 100644 index 00000000..b8e5c084 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/form.json @@ -0,0 +1,10 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "name": "form name", + "description": "form description", + "help": "form help", + "access_level": "form accessLevel", + "file_name": "form file_name", + "is_active": true +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/keyLayout.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/keyLayout.json new file mode 100644 index 00000000..23dd7d20 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/keyLayout.json @@ -0,0 +1,33 @@ +{ + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "id": "34534534", + "name": "name", + "description": "description", + "help": "help", + "layout_type": "layout_type", + "columns": "columns", + "color": "color", + "keys": [ + { + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "id": "34534534", + "name": "name", + "description": "description", + "sub_key_layout_uuid": "sub_key_layout_uuid", + "color": "color", + "sequence": "sequence", + "span_x": "span_x", + "span_y": "span_y", + "product_value": "product_value", + "quantity": "quantity", + "resource_reference": { + "resource_uuid": "resource_uuid", + "file_name": "file_name", + "file_size": "file_size", + "description": "description", + "text_msg": "text_msg", + "content_type": "content_type∏" + } + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/language.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/language.json new file mode 100644 index 00000000..060ca3da --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/language.json @@ -0,0 +1,11 @@ +{ + "language": "language", + "language_name": "language name", + "language_iso": "language iso", + "country_code": "language country code", + "is_base_language": true, + "is_system_language": false, + "is_decimal_point": true, + "date_pattern": "language date pattern", + "time_pattern": "language time pattern" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/order.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/order.json new file mode 100644 index 00000000..c8fdb686 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/order.json @@ -0,0 +1,37 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "document_no": "document_no", + "document_type": { + "uuid": "document type uuid", + "id": "document type id", + "name": "document type name", + "description": "document type description", + "print_name": "doc type print_name" + }, + "sales_representative": { + "uuid": "sales rep uuid", + "id": "sales rep id", + "name": "sales rep name", + "description": "sales rep description" + }, + "document_status": { + "name": "document status name", + "description": "document status description", + "value": "document status value" + }, + "total_lines": "total_lines", + "grand_total": "grand_total", + "date_ordered": "date_ordered", + "business_partner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "tax_id": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "last_name": "last_name", + "description": "description" + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/orderLine.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/orderLine.json new file mode 100644 index 00000000..91746b95 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/orderLine.json @@ -0,0 +1,52 @@ +{ + "uuid": "orderLine uuid", + "order_uuid": "orderLine order_uuid", + "line": "orderLine line", + "product": { + "uuid": "product uuid", + "id": "product id", + "value": "product value", + "name": "product name", + "help": "product help", + "document_note": "product document_note", + "uom_name": "product uom_name", + "product_type": "product product_type", + "is_stocked": true, + "is_drop_ship": false, + "is_purchased": false, + "is_sold": true, + "image_url": "product image_url", + "product_category_name": "product product_category_name", + "product_group_name": "product product_group_name", + "product_class_name": "product product_class_name", + "product_classification_name": "product product_classification_name", + "weight": "product weight", + "volume": "product volume", + "upc": "product upc", + "sku": "product sku", + "shelf_width": "product shelf_width", + "shelf_height": "product shelf_height", + "shelf_depth": "product shelf_depth", + "units_per_pack": "product units_per_pack", + "units_per_pallet": "product units_per_pallet", + "guarantee_days": "product guarantee_days", + "description_url": "product description_url", + "version_no": "product version_no", + "tax_category": "product tax_category", + "description": "product description" + }, + "charge": "orderLine charge", + "description": "orderLine description", + "line_description": "orderLine line_description", + "quantity": "orderLine quantity", + "price": "orderLine price", + "discount_rate": "orderLine discount_rate", + "line_net_amount": "orderLine line_net_amount", + "tax_rate": { + "name": "tax rate name", + "description": "tax rate description", + "tax_indicator": "tax rate tax_indicator", + "rate": "tax rate rate" + }, + "warehouse": "orderLine warehouse" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/organization.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/organization.json new file mode 100644 index 00000000..757ef085 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/organization.json @@ -0,0 +1,13 @@ +{ + "id": "12345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "name": "organization name", + "description": "organization description", + "is_read_only": "organization is read only", + "duns": "organization duns", + "tax_id": "organization tax id", + "phone": "organization phone", + "phone2": "organization phone2", + "fax": "organization fax", + "corporate_branding_image": "organization corporate branding image" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/paymentMethod.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/paymentMethod.json new file mode 100644 index 00000000..660c42b0 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/paymentMethod.json @@ -0,0 +1,15 @@ +{ + "amount": "payment method amount", + "bank_uuid": "payment method bank_uuid", + "business_partner": "payment method business_partner", + "currency_uuid": "payment method currency_uuid", + "description": "payment method description", + "document_no": "payment method document_no", + "document_status": "payment method document_status", + "id": "payment method id", + "order_uuid": "payment method order_uuid", + "payment_date": "payment method payment_date", + "reference_no": "payment method reference_no", + "tender_type_code": "payment method tender_type_code", + "uuid": "payment method uuid" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/pendingDocument.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/pendingDocument.json new file mode 100644 index 00000000..2211db6e --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/pendingDocument.json @@ -0,0 +1,19 @@ +{ + "window_uuid": "95326b18-a67b-11eb-bcbc-0242ac130002", + "form_uuid": "95326bcc-a67b-11eb-bcbc-0242ac130002", + "document_name": "pending document name", + "document_description": "pending document description", + "sequence": 2, + "record_count": 0, + "criteria": { + "table_name": "pending document criteria table name", + "query": "pending document criteria query", + "where_clause": "pending document criteria where clause", + "order_by_clause": "pending document criteria order by clause", + "reference_uuid": "95326c76-a67b-11eb-bcbc-0242ac130002", + "filters": [], + "values": ["value1", "value2"], + "order_by_columns": ["column1", "column2"], + "limit": 5 + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/pointOfSales.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/pointOfSales.json new file mode 100644 index 00000000..a469ed7f --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/pointOfSales.json @@ -0,0 +1,119 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "name": "name", + "description": "description", + "help": "help", + "is_modify_price": true, + "is_pos_required_pin": false, + "is_aisle_seller": false, + "is_shared_pos": true, + "document_type": { + "uuid": "document type uuid", + "id": "document type id", + "name": "document type name", + "description": "document type description", + "print_name": "doc type print_name" + }, + "cash_bank_account": { + "uuid": "cashbank account uuid", + "id": "cashbank account id", + "name": "cash bank account name", + "description": "cash bank account description", + "account_no": "cash bank account account_no", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + }, + "bban": "cash bank account bban", + "iban": "cash bank account iban", + "credit_limit": "cash bank account credit_limit", + "current_balance": "cash bank account current_balance", + "is_default": "cash bank account is_default", + "business_partner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "tax_id": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "last_name": "last_name", + "description": "description" + }, + "bank_account_type": "bank account bank_account_type", + "bank_account_type_name": "bank account bank_account_type_name" + }, + "cash_transfer_bank_account": { + "uuid": "bank account uuid", + "id": "bank account id", + "name": "bank account name", + "description": "bank account description", + "account_no": "bank account account_no", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + }, + "bban": "bank account bban", + "iban": "bank account iban", + "credit_limit": "bank account credit_limit", + "current_balance": "bank account current_balance", + "is_default": "bank account is_default", + "business_partner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "tax_id": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "last_name": "last_name", + "description": "description" + }, + "bank_account_type": "bank account bank_account_type", + "bank_account_type_name": "bank account bank_account_type_name" + }, + "sales_representative": "sales_representative", + "template_business_partner": { + "uuid": "uuid", + "id": "id", + "value": "value", + "tax_id": "tax_id", + "duns": "duns", + "naics": "naics", + "name": "name", + "last_name": "last_name", + "description": "description" + }, + "price_list": { + "uuid": "price list uuid", + "id": "price list id", + "name": "price list name", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + }, + "is_default": "is_default", + "is_tax_included": "is_tax_included", + "is_enforce_price_limit": "is_enforce_price_limit", + "is_net_price": "is_net_price", + "price_precision": "price_precision" + }, + "conversion_type_uuid": "conversion_type_uuid", + "key_layout_uuid": "key_layout_uuid" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/priceList.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/priceList.json new file mode 100644 index 00000000..eb9194c9 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/priceList.json @@ -0,0 +1,19 @@ +{ + "uuid": "price list uuid", + "id": "price list id", + "name": "price list name", + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + }, + "is_default": "is_default", + "is_tax_included": "is_tax_included", + "is_enforce_price_limit": "is_enforce_price_limit", + "is_net_price": "is_net_price", + "price_precision": "price_precision" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/printFormats.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/printFormats.json new file mode 100644 index 00000000..b6374356 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/printFormats.json @@ -0,0 +1,14 @@ +{ + "record_count": "record_count", + "records": [ + { + "name": "name", + "description": "description", + "table_name": "table_name", + "is_default": true, + "report_view_uuid": "report_view_uuid", + "print_format_uuid": "print_format_uuid" + } + ], + "next_page_token": "next_page_token" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/process.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/process.json new file mode 100644 index 00000000..5e99304e --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/process.json @@ -0,0 +1,121 @@ +{ + "access_level": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "is_active": false, + "is_direct_print": true, + "is_report": false, + "name": "Process Name", + "report_export_types": ["Export Type 1", "Export Type 2"], + "show_help": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/processLog.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/processLog.json new file mode 100644 index 00000000..9317d8d9 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/processLog.json @@ -0,0 +1,11 @@ +{ + "uuid": "uuid", + "instance_uuid": "instance_uuid", + "is_error": true, + "summary": "summary", + "result_table_name": "result_table_name", + "is_processing": false, + "last_run": "last_run", + "paramenters": ["paramenter1", "paramenter2"], + "output": "" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/processLogWithReport.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/processLogWithReport.json new file mode 100644 index 00000000..098a9736 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/processLogWithReport.json @@ -0,0 +1,29 @@ +{ + "uuid": "uuid", + "instance_uuid": "instance_uuid", + "is_error": true, + "summary": "summary", + "result_table_name": "result_table_name", + "is_processing": false, + "last_run": "last_run", + "paramenters": ["paramenter1", "paramenter2"], + "output": { + "uuid": "uuid", + "name": "name", + "description": "description", + "file_name": "file_name", + "output": "output", + "mime_type": "mime_type", + "data_cols": "data_cols", + "data_rows": "data_rows", + "header_name": "header_name", + "footer_name": "footer_name", + "print_format_uuid": "print_format_uuid", + "report_view_uuid": "report_view_uuid", + "table_name": "table_name", + "output_stream": "output_stream", + "output_stream_asB64": "output_stream_asB64", + "output_stream_asU8": "output_stream_asU8", + "report_type": "report_type" + } +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/processWithUndefined.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/processWithUndefined.json new file mode 100644 index 00000000..bfb4416b --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/processWithUndefined.json @@ -0,0 +1,61 @@ +{ + "access_level": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "is_active": false, + "is_direct_print": true, + "is_report": false, + "name": "Process Name", + "report_export_types": ["Export Type 1", "Export Type 2"], + "show_help": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [{ + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic" + }] +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/product.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/product.json new file mode 100644 index 00000000..fe06fca4 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/product.json @@ -0,0 +1,33 @@ +{ + "uuid": "product uuid", + "id": "product id", + "value": "product value", + "name": "product name", + "help": "product help", + "document_note": "product document_note", + "uom_name": "product uom_name", + "product_type": "product product_type", + "is_stocked": true, + "is_drop_ship": false, + "is_purchased": false, + "is_sold": true, + "image_url": "product image_url", + "product_category_name": "product product_category_name", + "product_group_name": "product product_group_name", + "product_class_name": "product product_class_name", + "product_classification_name": "product product_classification_name", + "weight": "product weight", + "volume": "product volume", + "upc": "product upc", + "sku": "product sku", + "shelf_width": "product shelf_width", + "shelf_height": "product shelf_height", + "shelf_depth": "product shelf_depth", + "units_per_pack": "product units_per_pack", + "units_per_pallet": "product units_per_pallet", + "guarantee_days": "product guarantee_days", + "description_url": "product description_url", + "version_no": "product version_no", + "tax_category": "product tax_category", + "description": "product description" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/productPrice.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/productPrice.json new file mode 100644 index 00000000..0906d51a --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/productPrice.json @@ -0,0 +1,73 @@ +{ + "currency": { + "id": "345345345", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + }, + "tax_rate": { + "name": "tax rate name", + "description": "tax rate description", + "tax_indicator": "tax rate tax_indicator", + "rate": "tax rate rate" + }, + "product": { + "uuid": "product uuid", + "id": "product id", + "value": "product value", + "name": "product name", + "help": "product help", + "document_note": "product document_note", + "uom_name": "product uom_name", + "product_type": "product product_type", + "is_stocked": true, + "is_drop_ship": false, + "is_purchased": false, + "is_sold": true, + "image_url": "product image_url", + "product_category_name": "product product_category_name", + "product_group_name": "product product_group_name", + "product_class_name": "product product_class_name", + "product_classification_name": "product product_classification_name", + "weight": "product weight", + "volume": "product volume", + "upc": "product upc", + "sku": "product sku", + "shelf_width": "product shelf_width", + "shelf_height": "product shelf_height", + "shelf_depth": "product shelf_depth", + "units_per_pack": "product units_per_pack", + "units_per_pallet": "product units_per_pallet", + "guarantee_days": "product guarantee_days", + "description_url": "product description_url", + "version_no": "product version_no", + "tax_category": "product tax_category", + "description": "product description" + }, + "schema_currency": { + "id": "345345345123", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "iso_code": "34534123", + "currency_symbol": "$", + "description": "currency description", + "standard_precision": "currency standard precision", + "costing_precision": "currency coasting precision" + }, + "schema_price_limit": "product price schema_price_limit", + "schema_price_list": "product price schema_price_list", + "schema_price_standard": "product price schema_price_standard", + "price_list": "product price price_list", + "price_standard": "product price price_standard", + "price_limit": "product price price_limit", + "price_list_name": "product price price_list_name", + "is_tax_included": false, + "validFrom": "product price validFrom", + "price_precision": "product price price_precision", + "quantity_on_hand": "product price quantity_on_hand", + "quantity_reserved": "product price quantity_reserved", + "quantity_ordered": "product price quantity_ordered", + "quantity_available": "product price quantity_available" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/recentListItems.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/recentListItems.json new file mode 100644 index 00000000..57db9313 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/recentListItems.json @@ -0,0 +1,21 @@ +{ + "record_count": 0, + "next_page_token": "12345", + "records": [ + { + "menu_uuid": "9532638e-a67b-11eb-bcbc-0242ac130002", + "menu_name": "Menu Name", + "menu_description": "Menu Description", + "window_uuid": "95326442-a67b-11eb-bcbc-0242ac130002", + "tab_uuid": "953264ec-a67b-11eb-bcbc-0242ac130002", + "table_id": 3, + "table_name": "table name", + "id": 23, + "uuid": "953265a0-a67b-11eb-bcbc-0242ac130002", + "display_name": "display name", + "updated": "2021-04-27", + "reference_uuid": "95326654-a67b-11eb-bcbc-0242ac130002", + "action": "item list action" + } + ] +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reference.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reference.json new file mode 100644 index 00000000..545c1b35 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reference.json @@ -0,0 +1,8 @@ +{ + "uuid": "uuid", + "table_name": "table_name", + "window_uuid": "window_uuid", + "display_name": "display_name", + "where_clause": "where_clause", + "record_count": "record_count" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/referenceList.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/referenceList.json new file mode 100644 index 00000000..b33708db --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/referenceList.json @@ -0,0 +1,14 @@ +{ + "record_count": "record_count", + "records": [ + { + "uuid": "uuid", + "table_name": "table_name", + "window_uuid": "window_uuid", + "display_name": "display_name", + "where_clause": "where_clause", + "record_count": "record_count" + } + ], + "next_page_token": "next_page_token" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reportExportType.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reportExportType.json new file mode 100644 index 00000000..b78c8558 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reportExportType.json @@ -0,0 +1,5 @@ +{ + "name": "reportExportType name", + "description": "reportExportType description", + "type": "reportExportType type" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reportOutput.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reportOutput.json new file mode 100644 index 00000000..dc904648 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reportOutput.json @@ -0,0 +1,19 @@ +{ + "uuid": "uuid", + "name": "name", + "description": "description", + "file_name": "file_name", + "output": "output", + "mime_type": "mime_type", + "data_cols": "data_cols", + "data_rows": "data_rows", + "header_name": "header_name", + "footer_name": "footer_name", + "print_format_uuid": "print_format_uuid", + "report_view_uuid": "report_view_uuid", + "table_name": "table_name", + "output_stream": "output_stream", + "output_stream_asB64": "output_stream_asB64", + "output_stream_asU8": "output_stream_asU8", + "report_type": "report_type" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reportView.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reportView.json new file mode 100644 index 00000000..ceae9a50 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/reportView.json @@ -0,0 +1,7 @@ +{ + "uuid": "uuid", + "name": "name", + "description": "description", + "table_name": "table_name", + "report_view_uuid": "report_view_uuid" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/role.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/role.json new file mode 100644 index 00000000..2a6781dc --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/role.json @@ -0,0 +1,27 @@ +{ + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "client_id": "client_id", + "client_name": "client_name", + "is_allow_html_view": true, + "is_allow_info_account": false, + "is_allow_info_asset": true, + "is_allow_info_business_partner": true, + "is_allow_info_cash_journal": false, + "is_allow_info_crp": false, + "is_allow_info_in_out": false, + "is_allow_info_invoice": true, + "is_allow_info_mrp": true, + "is_allow_info_order": true, + "is_allow_info_payment": true, + "is_allow_info_product": true, + "is_allow_info_resource": true, + "is_allow_info_schedule": true, + "is_allow_xls_view": true, + "is_can_export": true, + "is_can_report": true, + "is_personal_access": true, + "is_personal_lock": false +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/salesRepresentative.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/salesRepresentative.json new file mode 100644 index 00000000..78cdea3d --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/salesRepresentative.json @@ -0,0 +1,6 @@ +{ + "uuid": "sales rep uuid", + "id": "sales rep id", + "name": "sales rep name", + "description": "sales rep description" +} \ No newline at end of file diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/tab.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/tab.json new file mode 100644 index 00000000..d93222d4 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/tab.json @@ -0,0 +1,288 @@ +{ + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "table_name": "table_name", + "sequence": "sequence", + "tab_level": "tab_level", + "is_active": false, + "is_single_row": true, + "is_advanced_tab": true, + "is_has_tree": true, + "is_info_tab": false, + "is_sort_tab": true, + "is_translation_tab": true, + "is_read_only": true, + "is_insert_record": false, + "is_view": true, + "is_deleteable": true, + "is_document": false, + "is_change_log": false, + "access_level": "access_level", + "link_column_name": "link_column_name", + "sort_order_column_name": "sort_order_column_name", + "sort_yes_no_column_name": "sort_yes_no_column_name", + "parent_column_name": "parent_column_name", + "display_logic": "display_logic", + "commit_warning": "commit_warning", + "query": "query", + "where_clause": "where_clause", + "order_by_clause": "order_by_clause", + "parent_tab_uuid": "parent_tab_uuid", + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "field_group": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "processes": [ + { + "access_level": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "is_active": false, + "is_direct_print": true, + "is_report": false, + "name": "Process Name", + "report_export_types": ["Export Type 1", "Export Type 2"], + "show_help": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } + } + ] + } + ], + "fields": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/taxRate.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/taxRate.json new file mode 100644 index 00000000..3eee2391 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/taxRate.json @@ -0,0 +1,6 @@ +{ + "name": "tax rate name", + "description": "tax rate description", + "tax_indicator": "tax rate tax_indicator", + "rate": "tax rate rate" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/translation.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/translation.json new file mode 100644 index 00000000..d2437c0e --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/translation.json @@ -0,0 +1,5 @@ +{ + "language": "translation: language", + "uuid": "translation: uuid", + "values": "translation: values" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/user.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/user.json new file mode 100644 index 00000000..570aa556 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/user.json @@ -0,0 +1,45 @@ +{ + "id": "id", + "uuid": "uuid", + "name": "name", + "user_info": "user_info", + "role": { + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "client_id": "client_id", + "client_name": "client_name", + "is_allow_html_view": true, + "is_allow_info_account": false, + "is_allow_info_asset": true, + "is_allow_info_business_partner": true, + "is_allow_info_cash_journal": false, + "is_allow_info_crp": false, + "is_allow_info_in_out": false, + "is_allow_info_invoice": true, + "is_allow_info_mrp": true, + "is_allow_info_order": true, + "is_allow_info_payment": true, + "is_allow_info_product": true, + "is_allow_info_resource": true, + "is_allow_info_schedule": true, + "is_allow_xls_view": true, + "is_can_export": true, + "is_can_report": true, + "is_personal_access": true, + "is_personal_lock": false + }, + "processed": "processed", + "default_context": "default_context", + "country_id": "country_id", + "costing_precision": "costing_precision", + "country_code": "country_code", + "country_name": "country_name", + "currency_iso_code": "currency_iso_code", + "currency_name": "currency_name", + "currency_symbol": "currency_symbol", + "display_sequence": "display_sequence", + "language": "language", + "standard_precision": "standard_precision" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/validationRule.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/validationRule.json new file mode 100644 index 00000000..3933f0b5 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/validationRule.json @@ -0,0 +1,8 @@ +{ + "id": "34534534", + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "name": "validation rule name", + "description": "validation rule description", + "validation_code": "validation rule validation_code", + "type": "validation rule type" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/window.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/window.json new file mode 100644 index 00000000..95c6e71f --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/window.json @@ -0,0 +1,316 @@ +{ + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "is_active": true, + "is_sales_transaction": false, + "window_type": "windowType", + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "tabs": [ + { + "id": "id", + "uuid": "uuid", + "name": "name", + "description": "description", + "help": "help", + "table_name": "table_name", + "sequence": "sequence", + "tab_level": "tab_level", + "is_active": false, + "is_single_row": true, + "is_advanced_tab": true, + "is_has_tree": true, + "is_info_tab": false, + "is_sort_tab": true, + "is_translation_tab": true, + "is_read_only": true, + "is_insert_record": false, + "is_view": true, + "is_deleteable": true, + "is_document": false, + "is_change_log": false, + "access_level": "access_level", + "link_column_name": "link_column_name", + "sort_order_column_name": "sort_order_column_name", + "sort_yes_no_column_name": "sort_yes_no_column_name", + "parent_column_name": "parent_column_name", + "display_logic": "display_logic", + "commit_warning": "commit_warning", + "query": "query", + "where_clause": "where_clause", + "order_by_clause": "order_by_clause", + "parent_tab_uuid": "parent_tab_uuid", + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "field_group": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "processes": [ + { + "access_level": "Access Level", + "description": "Process Description", + "help": "Process Help", + "id": "12345", + "is_active": false, + "is_direct_print": true, + "is_report": false, + "name": "Process Name", + "report_export_types": ["Export Type 1", "Export Type 2"], + "show_help": true, + "uuid": "95325b0a-a67b-11eb-bcbc-0242ac130002", + "parameters": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } + } + ] + } + ], + "fields": [ + { + "id": "5678", + "uuid": "95325d26-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Name", + "description": "Process Parameter Description", + "help": "Process Parameter Help", + "column_name": "Process Parameter Column Name", + "element_name": "Process Parameter Element Name", + "is_active": true, + "display_type": "Process Parameter Display Type", + "is_field_only": false, + "is_range": true, + "is_same_line": false, + "is_encrypted": true, + "is_quick_entry": false, + "sequence": "Process Parameter Sequence", + "seq_no_grid": 6, + "sort_no": 1, + "identifier_sequence": "Process Parameter Identifier Sequence", + "format_pattern": "Process Parameter Format Pattern", + "v_format": "Process Parameter V Format", + "default_value": "Process Parameter Default Value", + "default_value_to": "Process Parameter Default Value To", + "field_length": 2, + "value_max": 3, + "is_identifier": true, + "is_parent": false, + "is_key": true, + "is_selection_column": false, + "is_updateable": true, + "is_always_updateable": false, + "is_allow_copy": true, + "is_heading": false, + "is_allow_logging": true, + "is_translated": false, + "column_sql": "Process Parameter Column SQL", + "is_displayed": true, + "is_displayed_grid": false, + "is_mandatory": true, + "is_read_only": false, + "is_query_criteria": true, + "is_order_by": false, + "is_info_only": true, + "callout": "Process Parameter Callout", + "display_logic": "Process Parameter Display Logic", + "mandatory_logic": "Process Parameter Mandatory Logic", + "read_only_logic": "Process Parameter Read Only Logic", + "Fieldgroup": { + "id": "3455", + "uuid": "95325e16-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Fieldgroup Name", + "field_group_type": "Process Parameter Fieldgroup Type", + "is_active": true + }, + "reference": { + "table_name": "Process Parameter Reference Table Name", + "key_column_name": "Process Parameter Reference Key Column Name", + "display_column_name": "Process Parameter Reference Display Column Name", + "query": "Process Parameter Reference Query", + "direct_query": "Process Parameter Reference Direcy Query", + "validation_code": "Process Parameter Reference Validation Code", + "zoom_windows": [ + { + "id": "974634", + "uuid": "95325ede-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Reference Zoom Windows Name", + "description": "Process Parameter Reference Zoom Windows Description", + "is_sales_transaction": false, + "is_active": true + } + ] + }, + "context_info": { + "id": "8546456", + "uuid": "95325f9c-a67b-11eb-bcbc-0242ac130002", + "name": "Process Parameter Context Info Name", + "description": "Process Parameter Context Info Description", + "sql_statement": "Process Parameter Context Info SQL Statement", + "is_active": false, + "message_text": { + "id": "4383456", + "value": "Process Parameter Context Info Message Text Value", + "message_type": "Process Parameter Context Info Message Text Type", + "message_text": "Process Parameter Context Info Message Text Text", + "message_tip": "Process Parameter Context Info Message Text Tip", + "is_active": false + } + }, + "Fielddefinition": { + "id": "4364567", + "uuid": "95326050-a67b-11eb-bcbc-0242ac130002", + "Value": "Process Parameter Field Definition Value", + "name": "Process Parameter Field Definition Name", + "is_active": false, + "field_group_type": "Process Parameter Field Definition Type", + "conditions": [ + { + "id": "4567568", + "uuid": "953262d0-a67b-11eb-bcbc-0242ac130002", + "condition": "Process Parameter Field Definition Condition", + "style_sheet": "Process Parameter Field Definition Condition Style Sheet", + "is_active": false + } + ] + } + } + ] + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/workflowDefinition.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/workflowDefinition.json new file mode 100644 index 00000000..0ed52cc3 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/workflowDefinition.json @@ -0,0 +1,81 @@ +{ + "uuid": "uuid", + "value": "value", + "name": "name", + "description": "description", + "help": "help", + "table_name": "table_name", + "responsible_uuid": "responsible_uuid", + "priority": "priority", + "valid_from": "valid_from", + "is_default": true, + "is_valid": false, + "publish_status": "publish_status", + "publish_status_name": "publish_status_name", + "duration_unit": "duration_unit", + "duration_unit_name": "duration_unit_name", + "start_node": { + "uuid": "start node uuid", + "value": "start node value", + "name": "start node name", + "description": "start node description", + "help": "start node help", + "responsible_uuid": "start node responsible_uuid", + "document_action": { "action": "value1" }, + "priority": "start node priority", + "action": "start node action", + "action_name": "start node action_name", + "transitions": [ + { + "node_next_uuid": "start node node_next_uuid", + "description": "start node description", + "is_standard_user_workflow": true, + "sequence": "start node sequence", + "workflow_conditions": [ + { + "sequence": "start node sequence", + "column_name": "start node column_name", + "value": "start node value", + "confidential_type": "start node confidential_type", + "confidential_type_name": "start node confidential_type_name", + "operation": "start node operation", + "operation_name": "start node operation_name" + } + ] + } + ] + }, + "workflow_nodes": [ + { + "uuid": "node 1 uuid", + "value": "node 1 value", + "name": "node 1 name", + "description": "node 1 description", + "help": "node 1 help", + "responsible_uuid": "node 1 responsible_uuid", + "document_action": { "action": "value2" }, + "priority": "node 1 priority", + "action": "node 1 action", + "action_name": "node 1 action_name", + "transitions": [ + { + "node_next_uuid": "node 1 node_next_uuid", + "description": "node 1 description", + "is_standard_user_workflow": true, + "sequence": "node 1 sequence", + "workflow_conditions": [ + { + "sequence": "node 1 sequence", + "column_name": "node 1 column_name", + "value": "node 1 value", + "confidential_type": "node 1 confidential_type", + "confidential_type_name": "node 1 confidential_type_name", + "operation": "node 1 operation", + "operation_name": "node 1 operation_name" + } + ] + } + ] + } + ] +} diff --git a/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/workflowProcess.json b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/workflowProcess.json new file mode 100644 index 00000000..940652b9 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/objects/fromApi/workflowProcess.json @@ -0,0 +1,40 @@ +{ + "process_uuid": "process_uuid", + "workflow_uuid": "workflow_uuid", + "workflow_name": "workflow_name", + "record_id": "record_id", + "table_name": "table_name", + "user_uuid": "user_uuid", + "user_name": "user_name", + "responsible_uuid": "responsible_uuid", + "responsible_name": "responsible_name", + "text_message": "text_message", + "processed": "processed", + "workflow_state_name": "workflow_state_name", + "workflow_state": "workflow_state", + "priority": "priority", + "priority_name": "priority_name", + "workflow_events": [ + { + "node_uuid": "node_uuid", + "node_name": "node_name", + "record_id": "record_id", + "table_name": "table_name", + "user_uuid": "user_uuid", + "user_name": "user_name", + "responsible_uuid": "responsible_uuid", + "responsible_name": "responsible_name", + "text_message": "text_message", + "time_elapsed": "time_elapsed", + "attribute_name": "attribute_name", + "old_value": "old_value", + "new_value": "new_value", + "workflow_state": "workflow_state", + "workflow_state_name": "workflow_state_name", + "event_type": "event_type", + "event_type_name": "event_type_name", + "log_date": "log_date" + } + ], + "log_date": "log_date" +} diff --git a/tests/unit/utils/ADempiere/apiConverts/persistence.spec.js b/tests/unit/utils/ADempiere/apiConverts/persistence.spec.js new file mode 100644 index 00000000..c9822486 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/persistence.spec.js @@ -0,0 +1,28 @@ +import { convertEntity, convertEntityList, convertTranslation } from '@/utils/ADempiere/apiConverts/persistence' +import entityList from './objects/fromApi/entityList.json' +import convertedEntityList from './objects/converted/entityList.json' +import entity from './objects/fromApi/entity.json' +import convertedEntity from './objects/converted/entity.json' +import translation from './objects/fromApi/translation.json' +import convertedTranslation from './objects/converted/translation.json' + +describe('entity list', () => { + it('should return a converted entity list object', () => { + const actualEntityList = convertEntityList(entityList) + expect(actualEntityList).toEqual(convertedEntityList) + }) +}) + +describe('entity', () => { + it('should return a converted entity object', () => { + const actualEntity = convertEntity(entity) + expect(actualEntity).toEqual(convertedEntity) + }) +}) + +describe('translation', () => { + it('should return a converted translation object', () => { + const actualTranslation = convertTranslation(translation) + expect(actualTranslation).toEqual(convertedTranslation) + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/pos.spec.js b/tests/unit/utils/ADempiere/apiConverts/pos.spec.js new file mode 100644 index 00000000..03fc9deb --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/pos.spec.js @@ -0,0 +1,57 @@ +import { + convertOrder, + convertPointOfSales, + convertOrderLine, + convertKeyLayout, + paymentsMethod +} from '@/utils/ADempiere/apiConverts/pos' +import pointOfSales from './objects/fromApi/pointOfSales.json' +import convertedPointOfSales from './objects/converted/pointOfSales.json' +import order from './objects/fromApi/order.json' +import convertedOrder from './objects/converted/order.json' +import orderLine from './objects/fromApi/orderLine.json' +import convertedOrderLine from './objects/converted/orderLine.json' +import keyLayout from './objects/fromApi/keyLayout.json' +import convertedKeyLayout from './objects/converted/keyLayout.json' +import paymentMethod from './objects/fromApi/paymentMethod.json' +import convertedPaymentMethod from './objects/converted/paymentMethod.json' + +describe('point of sales', () => { + it('should return a converted point of sales object', () => { + const actualPointOfSales = convertPointOfSales(pointOfSales) + expect(actualPointOfSales).toEqual(convertedPointOfSales) + }) +}) + +describe('order', () => { + it('should return a converted order object', () => { + const actualOrder = convertOrder(order) + expect(actualOrder).toEqual(convertedOrder) + }) +}) + +describe('orderLine', () => { + it('should return a converted orderLine object', () => { + const actualOrderLine = convertOrderLine(orderLine) + expect(actualOrderLine).toEqual(convertedOrderLine) + }) +}) + +describe('keyLayout', () => { + it('should return a converted keyLayout object', () => { + const actualKeyLayout = convertKeyLayout(keyLayout) + expect(actualKeyLayout).toEqual(convertedKeyLayout) + }) +}) + +describe('paymentMethod', () => { + it('should return a converted paymentMethod object', () => { + const actualPaymentMethod = paymentsMethod(paymentMethod) + expect(actualPaymentMethod).toEqual(convertedPaymentMethod) + }) + + it('should return an undefined object', () => { + const actualPaymentMethod = paymentsMethod(undefined) + expect(actualPaymentMethod).toBeUndefined() + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/process.spec.js b/tests/unit/utils/ADempiere/apiConverts/process.spec.js new file mode 100644 index 00000000..c4adbdf4 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/process.spec.js @@ -0,0 +1,17 @@ +import { convertProcessLog } from '@/utils/ADempiere/apiConverts/process' +import processLog from './objects/fromApi/processLog.json' +import convertedProcessLog from './objects/converted/processLog.json' +import processLogWithReport from './objects/fromApi/processLogWithReport.json' +import convertedProcessLogWithReport from './objects/converted/processLogWithReport.json' + +describe('processLog', () => { + it('should return a converted processLog object', () => { + const actualProcessLog = convertProcessLog(processLog) + expect(actualProcessLog).toEqual(convertedProcessLog) + }) + + it('should return a converted processLog with output object', () => { + const actualProcessLog = convertProcessLog(processLogWithReport) + expect(actualProcessLog).toEqual(convertedProcessLogWithReport) + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/report.spec.js b/tests/unit/utils/ADempiere/apiConverts/report.spec.js new file mode 100644 index 00000000..ceb76868 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/report.spec.js @@ -0,0 +1,42 @@ +import { + convertListPrintFormats, + convertReportOutput, + convertDrillTables, + convertReportView +} from '@/utils/ADempiere/apiConverts/report' +import reportOutput from './objects/fromApi/reportOutput.json' +import convertedReportOutput from './objects/converted/reportOutput.json' +import printFormats from './objects/fromApi/printFormats.json' +import convertedPrintFormats from './objects/converted/printFormats.json' +import drillTables from './objects/fromApi/drillTables.json' +import convertedDrillTables from './objects/converted/drillTables.json' +import reportView from './objects/fromApi/reportView.json' +import convertedReportView from './objects/converted/reportView.json' + +describe('reportOutput', () => { + it('should return a converted reportOutput object', () => { + const actualReportOutput = convertReportOutput(reportOutput) + expect(actualReportOutput).toEqual(convertedReportOutput) + }) +}) + +describe('printFormats', () => { + it('should return a converted printFormats object', () => { + const actualPrintFormats = convertListPrintFormats(printFormats) + expect(actualPrintFormats).toEqual(convertedPrintFormats) + }) +}) + +describe('drillTables', () => { + it('should return a converted drillTables object', () => { + const actualDrillTables = convertDrillTables(drillTables) + expect(actualDrillTables).toEqual(convertedDrillTables) + }) +}) + +describe('reportView', () => { + it('should return a converted reportView object', () => { + const actualReportView = convertReportView(reportView) + expect(actualReportView).toEqual(convertedReportView) + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/user.spec.js b/tests/unit/utils/ADempiere/apiConverts/user.spec.js new file mode 100644 index 00000000..ab147938 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/user.spec.js @@ -0,0 +1,19 @@ +import { convertRole, convertSession } from '@/utils/ADempiere/apiConverts/user' +import role from './objects/fromApi/role.json' +import convertedRole from './objects/converted/role.json' +import user from './objects/fromApi/user.json' +import convertedUser from './objects/converted/user.json' + +describe('role', () => { + it('should return a converted role object', () => { + const actualRole = convertRole(role) + expect(actualRole).toEqual(convertedRole) + }) +}) + +describe('user', () => { + it('should return a converted user object', () => { + const actualUser = convertSession(user) + expect(actualUser).toEqual(convertedUser) + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/values.spec.js b/tests/unit/utils/ADempiere/apiConverts/values.spec.js new file mode 100644 index 00000000..f0823d7d --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/values.spec.js @@ -0,0 +1,22 @@ +import { + convertReference, + convertReferencesList +} from '@/utils/ADempiere/apiConverts/values' +import reference from './objects/fromApi/reference.json' +import convertedReference from './objects/converted/reference.json' +import referenceList from './objects/fromApi/referenceList.json' +import convertedReferenceList from './objects/converted/referenceList.json' + +describe('reference', () => { + it('should return a converted reference object', () => { + const actualReference = convertReference(reference) + expect(actualReference).toEqual(convertedReference) + }) +}) + +describe('referenceList', () => { + it('should return a converted referenceList object', () => { + const actualReferenceList = convertReferencesList(referenceList) + expect(actualReferenceList).toEqual(convertedReferenceList) + }) +}) diff --git a/tests/unit/utils/ADempiere/apiConverts/window.spec.js b/tests/unit/utils/ADempiere/apiConverts/window.spec.js new file mode 100644 index 00000000..128c3aa2 --- /dev/null +++ b/tests/unit/utils/ADempiere/apiConverts/window.spec.js @@ -0,0 +1,52 @@ +import { + convertEntityLog, + convertEntityChat, + convertChatEntry, + convertWorkflowProcess, + convertWorkflowDefinition +} from '@/utils/ADempiere/apiConverts/window' +import entityLog from './objects/fromApi/entityLog.json' +import convertedEntityLog from './objects/converted/entityLog.json' +import entityChat from './objects/fromApi/entityChat.json' +import convertedEntityChat from './objects/converted/entityChat.json' +import chatEntry from './objects/fromApi/chatEntry.json' +import convertedChatEntry from './objects/converted/chatEntry.json' +import workflowProcess from './objects/fromApi/workflowProcess.json' +import convertedWorkflowProcess from './objects/converted/workflowProcess.json' +import workflowDefinition from './objects/fromApi/workflowDefinition.json' +import convertedWorkflowDefinition from './objects/converted/workflowDefinition.json' + +describe('entityLog', () => { + it('should return a converted entityLog object', () => { + const actualEntityLog = convertEntityLog(entityLog) + expect(actualEntityLog).toEqual(convertedEntityLog) + }) +}) + +describe('entityChat', () => { + it('should return a converted entityChat object', () => { + const actualEntityChat = convertEntityChat(entityChat) + expect(actualEntityChat).toEqual(convertedEntityChat) + }) +}) + +describe('chatEntry', () => { + it('should return a converted chatEntry object', () => { + const actualChatEntry = convertChatEntry(chatEntry) + expect(actualChatEntry).toEqual(convertedChatEntry) + }) +}) + +describe('workflowProcess', () => { + it('should return a converted workflowProcess object', () => { + const actualWorkflowProcess = convertWorkflowProcess(workflowProcess) + expect(actualWorkflowProcess).toEqual(convertedWorkflowProcess) + }) +}) + +describe('workflowDefinition', () => { + it('should return a converted workflowDefinition object', () => { + const actualWorkflowDefinition = convertWorkflowDefinition(workflowDefinition) + expect(actualWorkflowDefinition).toEqual(convertedWorkflowDefinition) + }) +}) diff --git a/tests/unit/utils/ADempiere/transformObject.spec.js b/tests/unit/utils/ADempiere/transformObject.spec.js new file mode 100644 index 00000000..0a20c63f --- /dev/null +++ b/tests/unit/utils/ADempiere/transformObject.spec.js @@ -0,0 +1,73 @@ +const { camelizeObjectKeys, renameObjectKey } = require('@/utils/ADempiere/transformObject') + +describe('given an object is camelized', () => { + it('should camelize all snake case object entries', () => { + const obj = { + 'menu_uuid': '95326d2a-a67b-11eb-bcbc-0242ac130002', + 'menu_name': 'Menu Name' + } + const convertedObj = camelizeObjectKeys(obj) + + expect(convertedObj.menuUuid).toBe('95326d2a-a67b-11eb-bcbc-0242ac130002') + expect(convertedObj.menuName).toBe('Menu Name') + expect(convertedObj.menu_uuid).toBeUndefined() + expect(convertedObj.menu_name).toBeUndefined() + }) + + it('should ignore all entires that are not snake case', () => { + const obj = { + 'menu_name': 'Menu Name', + 'menuItem': 'Menu Item', + 'something': 'else' + } + const convertedObj = camelizeObjectKeys(obj) + + expect(convertedObj.menuName).toBe('Menu Name') + expect(convertedObj.menuItem).toBe('Menu Item') + expect(convertedObj.something).toBe('else') + }) + + it('should return empty object if object is empty', () => { + const obj = {} + const convertedObj = camelizeObjectKeys(obj) + + expect(convertedObj).toBeDefined() + }) +}) + +describe('given an object key is renamed', () => { + it('should only rename the passed key', () => { + const obj = { + 'key1': 'value for key', + 'permanentKey': 'permanent value' + } + renameObjectKey(obj, 'key1', 'key2') + + expect(obj.key2).toBe('value for key') + expect(obj.permanentKey).toBe('permanent value') + expect(obj.key1).toBeUndefined() + }) + + it('should not change anything if old key does not exist', () => { + const obj = { + 'key1': 'key1 value', + 'key2': 'key2 value' + } + renameObjectKey(obj, 'key3', 'key4') + + expect(obj.key1).toBe('key1 value') + expect(obj.key2).toBe('key2 value') + expect(obj.key4).toBeUndefined() + }) + + it('should rename if new key already exists in object', () => { + const obj = { + 'key1': 'key1 value', + 'key2': 'key2 value' + } + renameObjectKey(obj, 'key1', 'key2') + + expect(obj.key1).toBeUndefined() + expect(obj.key2).toBe('key1 value') + }) +})