Updates to clean up the lookups for time zones, countries, and subdivisions.

This commit is contained in:
Scott Idem
2025-01-13 15:28:24 -05:00
parent 8d4c770f19
commit 321c48513f
7 changed files with 64 additions and 46 deletions

View File

@@ -11,37 +11,42 @@ export async function load_ae_obj_li__country(
{
api_cfg,
// account_id,
enabled = 'enabled',
hidden = 'not_hidden',
limit = 299,
offset = 0,
order_by_li = {'sort': 'DESC', 'english_short_name': 'ASC', 'alpha_2_code': 'ASC'},
params = {},
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
// account_id: string,
enabled?: string,
hidden?: string,
limit?: number,
offset?: number,
order_by_li?: key_val
params?: key_val,
try_cache?: boolean,
log_lvl?: number
}
) {
console.log(`*** load_ae_obj_li__country() ***`);
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
let limit: number = (params.qry__limit ?? 300); // Actual is 249 in 2024
let offset: number = (params.qry__offset ?? 0); // 0
let order_by_li = {'sort': 'DESC', 'english_short_name': 'ASC', 'alpha_2_code': 'ASC'};
if (log_lvl) {
console.log(`*** load_ae_obj_li__country() ***`);
}
let params_json: key_val = {};
// console.log('params_json:', params_json);
ae_promises.load__country_li = await api.get_ae_obj_li_for_obj_id_crud({
ae_promises.load__country_li = await api.get_ae_obj_li_for_obj_id_crud_v2({
api_cfg: api_cfg,
obj_type: 'lu',
for_obj_type: 'country',
// for_obj_id: account_id,
use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
use_alt_tbl: false,
use_alt_mdl: false,
enabled: enabled,
hidden: hidden,
order_by_li: order_by_li,

View File

@@ -11,12 +11,22 @@ export async function load_ae_obj_li__country_subdivision(
{
api_cfg,
// account_id,
enabled = 'enabled',
hidden = 'not_hidden',
limit = 399,
offset = 0,
order_by_li = {'sort': 'DESC', 'name': 'ASC', 'code': 'ASC'},
params = {},
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
// account_id: string,
enabled?: string,
hidden?: string,
limit?: number,
offset?: number,
order_by_li?: key_val
params?: key_val,
try_cache?: boolean,
log_lvl?: number
@@ -26,24 +36,17 @@ export async function load_ae_obj_li__country_subdivision(
console.log(`*** load_ae_obj_li__country_subdivision() ***`);
}
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
let limit: number = (params.qry__limit ?? 300); // Actual is 249 in 2024
let offset: number = (params.qry__offset ?? 0); // 0
let order_by_li = {'sort': 'DESC', 'name': 'ASC', 'code': 'ASC'};
let params_json: key_val = {};
// console.log('params_json:', params_json);
ae_promises.load__country_subdivision_li = await api.get_ae_obj_li_for_obj_id_crud({
ae_promises.load__country_subdivision_li = await api.get_ae_obj_li_for_obj_id_crud_v2({
api_cfg: api_cfg,
obj_type: 'lu',
for_obj_type: 'country_subdivision',
// for_obj_id: account_id,
use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
use_alt_tbl: false,
use_alt_mdl: false,
enabled: enabled,
hidden: hidden,
order_by_li: order_by_li,

View File

@@ -11,39 +11,46 @@ export async function load_ae_obj_li__time_zone(
{
api_cfg,
// account_id,
enabled = 'enabled',
hidden = 'not_hidden',
limit = 99,
offset = 0,
// order_by_li = {'priority': 'DESC', 'group': 'ASC', 'sort': 'DESC', 'name': 'ASC'},
order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC'},
params = {},
try_cache = true,
log_lvl = 0
}: {
api_cfg: any,
// account_id: string,
enabled?: string,
hidden?: string,
limit?: number,
offset?: number,
order_by_li?: key_val,
params?: key_val,
try_cache?: boolean,
log_lvl?: number
}
) {
console.log(`*** load_ae_obj_li__time_zone() ***`);
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
let limit: number = (params.qry__limit ?? 625); // Actual is 594 in 2024
let offset: number = (params.qry__offset ?? 0); // 0
if (log_lvl) {
console.log(`*** load_ae_obj_li__time_zone() ***`);
}
let params_json: key_val = {};
// console.log('params_json:', params_json);
ae_promises.load__time_zone_li = await api.get_ae_obj_li_for_obj_id_crud({
ae_promises.load__time_zone_li = await api.get_ae_obj_li_for_obj_id_crud_v2({
api_cfg: api_cfg,
obj_type: 'lu',
for_obj_type: 'time_zone',
// for_obj_id: account_id,
use_alt_table: false, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config.
use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value
use_alt_tbl: true, // NOTE: Using this with the time zones to use the view named "v_lu_time_zone_cust"
use_alt_mdl: false,
enabled: enabled,
hidden: hidden,
order_by_li: {'name': 'ASC'},
order_by_li: order_by_li,
limit: limit,
offset: offset,
params_json: params_json,