Skip to content

Commit

Permalink
perf: Remove unused and dupicated definitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Jul 21, 2024
1 parent 3b85dc1 commit 048d117
Show file tree
Hide file tree
Showing 22 changed files with 179 additions and 1,088 deletions.
31 changes: 1 addition & 30 deletions src/api/ADempiere/business-data/entities.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
* Copyright (C) 201-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Contributor(s): Edwin Betancourt [email protected] https://github.com/EdwinBetanc0urt
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -139,32 +139,3 @@ export function requestDeleteEntities({
return response
})
}

// /**
// * Rollback entity (Create, Update, Delete)
// * @param {string} tableName
// * @param {number} recordId
// * @param {string} eventType
// */
// export function rollbackEntity({
// tableName,
// recordId,
// recordUuid,
// eventType
// }) {
// return request({
// url: '/common/api/rollback-entity',
// method: 'post',
// data: {
// table_name: tableName,
// id: recordId,
// uuid: recordUuid,
// event_type: eventType
// }
// })
// .then(entityResponse => {
// const { convertEntity } = require('@/utils/ADempiere/apiConverts/persistence.js')

// return convertEntity(entityResponse)
// })
// }
173 changes: 0 additions & 173 deletions src/api/ADempiere/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,10 @@ import { request } from '@/utils/ADempiere/request'

// Constants
import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils'
import { RECORD_ROWS_BY_LIST } from '@/utils/ADempiere/dictionary/field/lookups'

// Utils and Helper Methods
import { camelizeObjectKeys } from '@/utils/ADempiere/transformObject.js'

/**
* Conversion Rate
*/
export function requestGetConversionRate() {
return request({
url: '/common/conversion-rates',
method: 'get'
})
.then(response => {
return camelizeObjectKeys(response)
})
}

/**
* Get System Info
*/
Expand Down Expand Up @@ -82,58 +68,6 @@ export function requestGetCountryDefinition({
})
}

/**
* Get Organization list from role
* @param param0
* @returns
*/
export function requestOrganizationsList({
roleId,
pageToken,
pageSize = RECORD_ROWS_BY_LIST
}) {
return request({
url: '/security/organizations',
method: 'get',
params: {
role_id: roleId,
page_token: pageToken,
page_size: pageSize
}
})
.then(organizationsListResponse => {
return {
nextPageToken: organizationsListResponse.next_page_token,
recordCount: organizationsListResponse.record_count,
organizationsList: organizationsListResponse.organizations.map(organization => {
return camelizeObjectKeys(organization)
})
}
})
}

/**
* Get Warehouses of Organization
* @param organizationId
* @returns
*/
export function requestWarehousesList({
organizationId,
pageToken,
pageSize = RECORD_ROWS_BY_LIST
}) {
return request({
url: '/security/warehouses',
method: 'get',
params: {
organization_id: organizationId,
// Page Data
page_token: pageToken,
page_size: pageSize
}
})
}

/**
* GET Business Partners
*/
Expand Down Expand Up @@ -169,110 +103,3 @@ export function requestListBusinessPartner({
}
})
}

/**
* GET Product Conversions
*/
export function productConversions({
id
}) {
return request({
url: `/common/product-conversions/${id}`,
method: 'get'
})
.then(responseProductConversions => {
return {
nextPageToken: responseProductConversions.next_page_token,
recordCount: responseProductConversions.record_count,
businessPartnersList: responseProductConversions.product_conversion.map(list => {
return camelizeObjectKeys(list)
})
}
})
}

/**
* GET Business Partne
*/
export function businessPartner({
searchValue
}) {
return request({
url: `/core-functionality/business-partners`,
method: 'get',
params: {
search_value: searchValue
}
})
.then(businessPartnerResponse => {
return {
nextPageToken: businessPartnerResponse.next_page_token,
recordCount: businessPartnerResponse.record_count,
businessPartnersList: businessPartnerResponse.business_partners.map(list => {
return camelizeObjectKeys(list)
})
}
})
}

/**
* POST Business Partner
*/
export function requestCreateBusinessPartner({
value,
taxId,
duns,
naics,
name,
name2,
description,
contactName,
eMail,
phone,
businessPartnerGroupUuid,
// Location
address1,
address2,
address3,
address4,
cityUuid,
cityName,
postalCode,
regionUuid,
regionName,
countryUuid,
posUuid
}) {
return request({
url: '/core-functionality/create-business-partner',
method: 'post',
data: {
value,
tax_id: taxId,
duns,
naics,
name,
last_name: name2,
description,
contact_name: contactName,
e_mail: eMail,
phone,
business_partner_group_uid: businessPartnerGroupUuid,
// Location
address1,
address2,
address3,
address4,
city_uuid: cityUuid,
city_name: cityName,
postal_code: postalCode,
region_uuid: regionUuid,
region_name: regionName,
country_uuid: countryUuid,
pos_uuid: posUuid
}
})
.then(businessPartnerResponse => {
return camelizeObjectKeys(businessPartnerResponse)
})
}
43 changes: 2 additions & 41 deletions src/api/ADempiere/form/VPOS/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
* Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Contributor(s): Elsio Sanchez [email protected] https://github.com/elsiosanchez
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -9,7 +9,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
Expand Down Expand Up @@ -864,19 +864,6 @@ export function processOrder({
* |______________________________________|
*/

/**
* List Product Conversion UOM
*/

export function listProductConversion({
id
}) {
return request({
url: `common/product-conversions/${id}`,
method: 'get'
})
}

/**
* List Stock: GET /api/stocks
* @param {int32} posId
Expand All @@ -898,32 +885,6 @@ export function listStocks({
})
}

/**
* Get Currency Rate
* @param {int32} conversion_type_id
* @param {int32} currency_from_id
* @param {int32} currency_to_id
* @param {google.protobuf.Timestamp} conversion_date
*/

export function getConversionRate({
conversionTypeId,
currencyFromId,
currencyToId,
conversionDate
}) {
return request({
url: 'common/conversion-rates',
method: 'get',
params: {
conversion_type_id: conversionTypeId,
currency_from_id: currencyFromId,
currency_to_id: currencyToId,
conversion_date: conversionDate
}
})
}

/**
* List Banks
*/
Expand Down
24 changes: 4 additions & 20 deletions src/api/ADempiere/form/point-of-sales.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
Expand All @@ -19,7 +19,9 @@
// Get Instance for connection
import { request } from '@/utils/ADempiere/request'
import { config } from '@/utils/ADempiere/config'
import { isEmptyValue } from '@/utils/ADempiere'

// Utils and Helper Methods
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
import { camelizeObjectKeys } from '@/utils/ADempiere/transformObject.js'

// Constants
Expand All @@ -31,7 +33,6 @@ import { RECORD_ROWS_BY_LIST } from '@/utils/ADempiere/dictionary/field/lookups'
* @author elsiosanchez <[email protected]>
*/
export { getProductPrice as findProduct } from '@/api/ADempiere/form/price-checking.js'
export { requestGetConversionRate } from '@/api/ADempiere/common/index.ts'

// List Point of sales
export function getPointOfSales({
Expand Down Expand Up @@ -1609,23 +1610,6 @@ export function listStocks({
})
}

export function listUom({
posUuid,
productId
}) {
return request({
url: 'common/list-product-conversion',
method: 'get',
params: {
pos_uuid: posUuid,
product_id: productId
}
})
.then(response => {
return camelizeObjectKeys(response)
})
}

/**
* GET List Banks
* req.query.token - user token
Expand Down
Loading

0 comments on commit 048d117

Please sign in to comment.