Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
45 kB
2
Indexable
Never
import { isBibApp, isConsumerApp, isProdLike, isProduction } from "./AppMode";

function getServerUri() {
  // TODO CHANGE TO REMOTE CONFIG
  if (isConsumerApp()) {
    if (isProduction()) {
      return "https://iso.astra.co.id/dealer-be";
    }

    // Development
    return "https://dev.accelist.com:5126";
  }

  // Dealer - BIB
  if (isBibApp()) {
    if (isProduction()) {
      return "https://iso.astra.co.id/dealer-be";
    }

    // Development
    return "https://apps-stg.isuzu.astra.co.id:8080";
  }

  // Dealer - SAM
  if (isProduction()) {
    return "https://app-iso.astra.co.id/dealer-be";
  }
    // Dealer - SAM
    if (isProduction()) {
        return 'https://app-udso.astra.co.id/udforce-be';
    }

    // Dealer - SAM
    if (isProdLike()) {
        return 'https://prodlike-udso.astra.co.id/udforce-be';
    }

  // Development
  return "https://dev-udso.astra.co.id/udforce-be";
}
    
    function getDashboardWebviewUri(){
        if(isProduction()){
            return 'https://app-udso.astra.co.id/cms-udforce-fe';
        }
    
        if(isProdLike()){
            return 'https://prodlike-udso.astra.co.id/cms-udforce-fe';
        }
    
        return 'https://dev-udso.astra.co.id/cms-udforce-fe';
    }

    function getCmsBackendUri(){
        if(isProduction()){
            return 'https://app-udso.astra.co.id/cms-udforce-be';
        }
    
        if(isProdLike()){
            return 'https://prodlike-udso.astra.co.id/cms-udforce-be';
        }
    
        return 'https://dev-udso.astra.co.id/cms-udforce-be';
    }

function getGeckoServerUri(){
    if(isProduction()){
        return 'https://meta.astra.co.id';
    }

    return 'https://cloudapidev.astra.co.id';
}

const geckoServerUri = getGeckoServerUri();
export const metaAuth =
  geckoServerUri + "/api/usermanagementservice/oauth/token";
export const metaCheckVersion =
  geckoServerUri + "/api/mamservice/application/checkAppVersion";
export const metaLinking = geckoServerUri + "/main/id=";

function getLoginAuthorizationEndpointUri(){
    if(isProduction()){
        return 'https://devproxy.astra.co.id/prodlike-sap-hana/sap/bc/sec/oauth2/authorize/index.html';
    }

    if(isProdLike()){
        return 'https://devproxy.astra.co.id/prodlike-sap-hana/sap/bc/sec/oauth2/authorize/index.html';
    }

  return "https://devproxy.astra.co.id/sap/bc/sec/oauth2/authorize/index.html";
}

export const serverUri = getServerUri();

export const cmsBackendUri = getCmsBackendUri();

export const loginAuthorizationEndpointUri = getLoginAuthorizationEndpointUri();

export const dashboardWebviewUri = getDashboardWebviewUri();

export const excahangeCodeUri = serverUri + "/jwt/login";

export const refreshTokenCodeUri = serverUri + "/jwt/refresh";

export const opportunityListApiUri = serverUri + "/api/v1/opportunity";

export const opportunityDetailUri = serverUri + "/api/v1/opportunity/";

export const opportunityProspectChecklistStatusUri =
  serverUri + "/api/v1/opportunity/check-p3/";

export const opportunityDropUri = serverUri + '/api/v1/opportunity';

export const opportunityPostUri = serverUri + "/api/v1/opportunity";

export const opportunityEditUri = serverUri + "/api/v1/opportunity";

export const opportunityColorDropdown = serverUri + '/api/v1/dropdown/car-color';

const carVariantDropdownApiUri = serverUri + '/api/v1/dropdown/car-variant/{carModelId}';

const opportunityKaroseriDropdown = serverUri + "/api/v1/dropdown/car-karoseri";

const carModelDropdownApiUri = serverUri + '/api/v1/dropdown/car-model';

const opportunityPowerDropdown =
  serverUri +
  "/api/v1/dropdown/power?carModelId={carModelId}&variantId={carVariantId}&productSegmentId={productSegmentId}";

const opportunityMaterialCodeDropdown =
  serverUri +
  "/api/v1/dropdown/material?carModelId={carModelId}&variantId={carVariantId}&productSegmentId={productSegmentId}&powerId={powerId}";

const opportunityMaterialDescriptionDropdown = serverUri + '/api/v1/dropdown/material-desc?materialId={materialId}';

const productSegmentDropdownApiUri = serverUri + '/api/v1/dropdown/product-segment?carModelId={carModelId}&variantId={carVariantId}';

const opportunityTypeDropdown = serverUri + "/api/v1/dropdown/car-variant";

export const offerListUri = serverUri + "/api/v1/quotation";

export const offerDetailUri = serverUri + "/api/v1/quotation/{quotationNumber}";

export const offerDropUri = serverUri + "/api/v1/quotation/";

export const offerPostUri = serverUri + '/api/v1/quotation';

export const offerEditUri = serverUri + "/api/v1/quotation";

export const offerOpportunityDropdownListUri =
  serverUri + "/api/v1/dropdown/opportunity";

export const setOfferToDetalUri = serverUri + "/api/v1/quotation/set-to-deal/";

export const setOpportunityToP3 = serverUri + "/api/v1/opportunity/set-to-p3";

export const generateOfferToPdf = serverUri + "/api/v1/quotation/pdf/";

export const opportunityDropdownReasonUri =
  serverUri + "/api/v1/dropdown/opportunity-drop-reason";

export const customerProspectDropdown = serverUri + "/api/v1/dropdown/customer";

export const customerProspectDetailData =
  serverUri + "/api/v1/dropdown/contact";

export const blobImageUri = serverUri + "/api/v1/blob/";

export const offerStatusUri = serverUri + "/api/v1/dropdown/quotation-status";

export const highlightApiUri = serverUri + "/api/v1/highlight";

export const newsApiUri = serverUri + "/api/v1/news?page={page}&newsType=RegularNews";

export const informationUnitApiUri = serverUri + "/api/v1/news";

export const notificationApiUri = serverUri + "/api/v1/notification";

export const contactPersonApiUri = serverUri + "/api/v1/ContactPerson";

export const markNotificationReadApiUri =
  serverUri + "/api/v1/mark-notification-read";

export const newsImageUri = serverUri + "/images/news/";

export const highlightImageUri = serverUri + "/images/highlight/";

export const informationUnitAndSalesImageUri = serverUri + "/images/news/";

export const highlightDetailsApiUri = serverUri + "/api/v1/highlight-details/";

export const newsDetailsApiUri = serverUri + "/api/v1/news-details/";

export const informationUnitAndSalesListApiUri = serverUri + "/api/v1/news?page={page}&newsType=AfterSales";

export const informationUnitAndSalesDetailsApiUri =
  serverUri + "/api/v1/news-details/";

export const searchDealerApiUri = serverUri + "/api/v1/search-dealer";

export const searchBengkelApiUri = serverUri + "/api/v1/search-bengkel";

export const searchIamiOfficeApiUri = serverUri + '/api/v1/search-iami-office';

export const activityDashboardBarChartApiUri = serverUri + '/api/v1/salesman-activity-dashboard/by-status?period={period}&allSalesman={allSalesman}';

export const activityDashboardPieChartApiUri = serverUri + '/api/v1/salesman-activity-dashboard/by-category?period={period}&allSalesman={allSalesman}';

export const activityDashboardTop5ChartApiUri = serverUri + '/api/v1/salesman-activity-dashboard/top?period={period}&allSalesman={allSalesman}';

export const homeActivitySummaryApiUri = serverUri + '/api/v1/salesman-activity-dashboard/total-per-month';

const provinceApiUri = serverUri + "/api/v1/province";

export function searchCarVariant(query: string, carModelId?: string) {
    const uri = new URL(carVariantDropdownApiUri);
    // uri.searchParams.append('search', query);
    const newUri =uri.toString()
    .replace(/\{carModelId\}/, carModelId ?? '')
    .slice(0, -1);
  return newUri;
}

export function searchOpportunityColor(query: string, variantId: string) {
  const uri = new URL(opportunityColorDropdown);
  uri.searchParams.append("search", query);
  uri.searchParams.append("carVarianId", variantId);
  return uri.toString();
}

export function searchOpportunityKaroseri(query: string) {
  const uri = new URL(opportunityKaroseriDropdown);
  uri.searchParams.append("search", query);
  return uri.toString();
}

export function searchOpportunityPower(
  query: string,
  carVariantId: string,
  carModelId: string,
  productSegmentId: string
) {
  const uri = new URL(opportunityPowerDropdown);
  // uri.searchParams.append('search', query);
  const newUri = uri
    .toString()
    .replace(/\{carVariantId\}/, carVariantId)
    .replace(/\{productSegmentId\}/, productSegmentId)
    .replace(/\{carModelId\}/, carModelId)
    .slice(0, -1);
  return newUri;
}

export function searchOpportunityMaterialCode(
  query: string,
  carVariantId: string,
  carModelId: string,
  productSegmentId: string,
  powerId: string
) {
  const uri = new URL(opportunityMaterialCodeDropdown);
  // uri.searchParams.append('search', query);
  const newUri = uri
    .toString()
    .replace(/\{carVariantId\}/, carVariantId)
    .replace(/\{productSegmentId\}/, productSegmentId)
    .replace(/\{carModelId\}/, carModelId)
    .replace(/\{powerId\}/, powerId)
    .slice(0, -1);
  return newUri;
}

export function searchOpportunityMaterialDescription(query: string, materialId: string) {
    const uri = new URL(opportunityMaterialDescriptionDropdown);
    const newUri = uri.toString()
    .replace(/\{materialId\}/, materialId)
    .slice(0, -1);
    return newUri;
}

export function searchCarModel(query: string) {
    const uri = new URL(carModelDropdownApiUri);
    uri.searchParams.append('search', query);
    return uri.toString();
}

export function searchOpportunityType(query: string) {
  const uri = new URL(opportunityTypeDropdown);
  uri.searchParams.append("search", query);
  return uri.toString();
}

export function searchProductSegment(query: string, carVariantId: string, carModelId: string) {
    const uri = new URL(productSegmentDropdownApiUri);
    // uri.searchParams.append('search', query);
    const newUri = uri.toString()
    .replace(/\{carVariantId\}/, carVariantId)
    .replace(/\{carModelId\}/, carModelId)
    .slice(0, -1);
  return newUri;
}

export function searchProvinceApiUri(query: string) {
  const uri = new URL(provinceApiUri);
  uri.searchParams.append("q", query);
  return uri.toString();
}

export function searchCustomerListUri(query: string) {
  const uri = new URL(customerListUri);
  uri.searchParams.append("CustomerName", query);
  return uri.toString();
}

export function searchSourceUri(query: string) {
  const uri = new URL(sourceDropdownUri);
  uri.searchParams.append("search", query);
  return uri.toString();
}

export function searchSalesmanUri(query: string) {
  const uri = new URL(suspectSalesmanApiUri);
  uri.searchParams.append("search", query);
  return uri.toString();
}

const cityApiUri = serverUri + "/api/v1/city";

export function getCityApiUri(provinceId: string, query = "") {
  const uri = new URL(cityApiUri);
  uri.searchParams.append("provinceId", provinceId);
  uri.searchParams.append("q", query);
  return uri.toString();
}

const searchTokoApiUri = serverUri + "/api/v1/search-toko";

export function getSearchTokoApiUri(cityId: string, page: number) {
  const uri = new URL(searchTokoApiUri);
  uri.searchParams.append("city", cityId);
  if (page) {
    uri.searchParams.append("page", page.toString());
  }
  return uri.toString();
}

const carSeriesApiUri = serverUri + "/api/v1/car-series";

export function getCarSeriesApiUri(type: string) {
  const uri = new URL(carSeriesApiUri);
  uri.searchParams.append("type", type);
  return uri.toString();
}

const carSeriesImageUri = serverUri + "/images/car-series/";

export function getCarSeriesImageUri(seriesId: string) {
  return carSeriesImageUri + seriesId;
}

const carModelApiUri = serverUri + "/api/v1/dropdown/car-model";

export function getCarModelApiUri(seriesId?: string, query?: string) {
  const uri = new URL(carModelApiUri);
  if (seriesId) {
    uri.searchParams.append("seriesId", seriesId);
  }
  if (query) {
    uri.searchParams.append("query", query);
  }

  return uri.toString();
}

const carComparisonVariantApiUri = serverUri + "/api/v1/dropdown/car-model-material";

export function getCarComparisonVariantApiUri(modelId: string, query?: string) {
  const uri = new URL(carComparisonVariantApiUri);
  uri.searchParams.append("carModelId", modelId);
  if (query) {
    uri.searchParams.append("query", query);
  }
  return uri.toString();
}

const carComparisonImageUri = serverUri + "/images/car-model/";

export function getCarComparisonImageUri(imageBlobId: string) {
  return carComparisonImageUri + imageBlobId;
}

const carModelImageUri = serverUri + "/images/car-model/";

export function getCarModelImageUri(seriesId: string) {
  return carModelImageUri + seriesId;
}

const carModelFeaturesApiUri = serverUri + "/api/v1/car-model-features/";

export function getCarModelFeaturesApiUri(modelId: string) {
  return carModelFeaturesApiUri + modelId;
}

const carVariantApiUri = serverUri + "/api/v1/car-variant";

export function getCarVariantApiUri(modelId: string, query?: string) {
  const uri = new URL(carVariantApiUri);
  uri.searchParams.append("modelId", modelId);
  if (query) {
    uri.searchParams.append("query", query);
  }
  return uri.toString();
}

const carVariantDetailsApiUri = serverUri + "/api/v1/car-variant/";

export function getCarVariantDetailsApiUri(variantId: string) {
  return carVariantDetailsApiUri + variantId;
}

const carModelFeaturesImageUri = serverUri + "/images/car-model-features/";

export function getCarModelFeaturesImageUri(featureId: string) {
  return carModelFeaturesImageUri + featureId;
}

const carVariantImageUri = serverUri + "/images/car-variant/";

export function getCarVariantImageUri(variantId: string) {
  return carVariantImageUri + variantId;
}

const carBrochureUri = serverUri + "/downloads/brochure/";

export function getCarBrochureUri(variantId: string) {
  return carBrochureUri + variantId;
}

const carManualBookUri = serverUri + "/api/v1/manual-book/";

export function getCarManualBookUri(variantId: string) {
  return carManualBookUri + variantId;
}

const carServiceUri = serverUri + "/api/v1/service-book/";

export function getServiceBookUri(variantId: string) {
  return carServiceUri + variantId;
}

const carCompareApiuri = serverUri + "/api/v1/unit-compare";

export function getCarCompareApiuri(
  car1VariantId: string,
  car2VariantId: string
) {
  const uri = new URL(carCompareApiuri);
  uri.searchParams.append("a", car1VariantId);
  uri.searchParams.append("b", car2VariantId);
  return uri.toString();
}

export const requestPresentationCustomerDataApiUri =
  serverUri + "/api/v1/request-presentation-customer-data/";

const customerAddressApiUri = serverUri + "/api/v1/customer-address/";

export function getCustomerAddressApiUri(isCompanyAddress?: boolean) {
  const uri = new URL(customerAddressApiUri);
  if (isCompanyAddress === true || isCompanyAddress === false) {
    uri.searchParams.append("isCompanyAddress", isCompanyAddress.toString());
  }
  return uri.toString();
}

const carSalesTalkApiUri = serverUri + "/api/v1/product-sales-talk/";

export function getCarSalesTalkApiUri(carVariantId: string) {
  return carSalesTalkApiUri + carVariantId;
}

export const getUnitRecommendationIndustryApiUri =
  serverUri + "/api/v1/unit-recommendation-industry/";

export const getUnitRecommendationRoadTypeApiUri =
  serverUri + "/api/v1/unit-recommendation-road-type/";

export const getUnitRecommendationCategoryApiUri =
  serverUri + "/api/v1/unit-recommendation-category/";

export const getUnitRecommendationTiresApiUri =
  serverUri + "/api/v1/unit-recommendation-tires/";

export const getUnitRecommendationApplicationApiUri =
  serverUri + "/api/v1/unit-recommendation-application/";

export const unitRecommendationApiUri = serverUri + "/api/v1/unit-recommendation/";

export function getUnitRecommendationApiUri(
  unitRecommendationApplicationId?: string,
  unitRecommendationCategoryId?: string,
  unitRecommendationIndustryId?: string,
  unitRecommendationRoadTypeId?: string,
  unitRecommendationTiresId?: string
) {
  const uri = new URL(unitRecommendationApiUri);
  if (unitRecommendationIndustryId) {
    uri.searchParams.append("industry", unitRecommendationIndustryId);
  }
  if (unitRecommendationRoadTypeId) {
    uri.searchParams.append("roadType", unitRecommendationRoadTypeId);
  }
  if (unitRecommendationCategoryId) {
    uri.searchParams.append("category", unitRecommendationCategoryId);
  }
  if (unitRecommendationTiresId) {
    uri.searchParams.append("tireType", unitRecommendationTiresId);
  }
  if (unitRecommendationApplicationId) {
    uri.searchParams.append("application", unitRecommendationApplicationId);
  }
  return uri.toString();
}

export const financingLinkWebsiteApiUri =
  serverUri + "/api/v1/financing-link-website/";

export function searchFinancingLinkWebsiteApiUri(query: string) {
  const uri = new URL(financingLinkWebsiteApiUri);
  uri.searchParams.append("q", query);
  return uri.toString();
}

const financingWebsiteImageUri = serverUri + "/images/instalment-partner/";

export function getFinancingWebsiteImageUri(installmentPartnerId: string) {
  return financingWebsiteImageUri + installmentPartnerId;
}

const financingPackageApiUri = serverUri + "/api/v1/financing-package";

export function downloadFinancingPackageApiUri(
  partnerId: string,
  provinceId: string
) {
  const uri = new URL(financingPackageApiUri);
  uri.searchParams.append("partnerId", partnerId);
  uri.searchParams.append("provinceCode", provinceId);
  return uri.toString();
}

export const customerEulaApiUri = serverUri + "/api/v1/customer-eula/";

export function getCustomerEulaApiUri(eulaType: string) {
  const uri = new URL(customerEulaApiUri);
  uri.searchParams.append("eulaType", eulaType);
  return uri.toString();
}

export const profileApiUri = serverUri + "/api/v1/profile/";

/**
 * Deactivate account / 'Hapus Akun' web API URI.
 */
export const deactivateAccountApiUri = serverUri + "/api/v1/account";

export const profileUnitApiUri = serverUri + "/api/v1/unit-profile/";

export function getCustomerAddressDetailApiUri(addressId: string) {
  return customerAddressApiUri + addressId;
}

export const customerContactListApiUri =
  serverUri + "/api/v1/customer-contact/";

export function getCustomerContactDetailApiUri(contactUserAccountId: string) {
  return serverUri + "/api/v1/customer-contact/" + contactUserAccountId;
}

export const customerHistoryApiUri = serverUri + "/api/v1/history/";
// 'https://ryanelian.github.io/mock-api/api/v1/customer-history/';

export function getCustomerPresentationDetailApiUri(transactionId: string) {
  return serverUri + "/api/v1/request-presentation/" + transactionId;
}

export const customerUserGuideApiUri = serverUri + "/api/v1/user-guidelines/";

export function getDealerRegistrationDetailApiUri(userCode: string) {
  return "https://ryanelian.github.io/mock-api/api/v1/dealer-registration-detail/IZ123/";
  // return '' + userCode
}

export const dealerUserGuideApiUri = serverUri + "/api/v1/user-guide";

export const dealerPresentationRequestApiUri =
  serverUri + "/api/v1/request-presentation";

export function getDealerPresentationRequestDetailApiUri(
  transactionId: string
) {
  return serverUri + "/api/v1/request-presentation/" + transactionId;
}

export const salesPersonApiUri = serverUri + "/api/v1/dealer-sales-member";

export function getSalesPersonPortraitUrlApiUri(salesPersonId: string) {
  return "https://ryanelian.github.io/mock-api/images/account.png";
}

export const dealerMemberListApiUri = serverUri + "/api/v1/dealer-team-members";

export function getDealerMemberListPortraitUrlApiUri(accountId: string) {
  return "https://ryanelian.github.io/mock-api/images/account.png";
}

export const dealerProfileApiUri = serverUri + "/api/v1/dealer-profile";

export function getLoginServerAutoDiscoveryUri() {
  return serverUri;
}

export const customerContactRelationTypeApiUri =
  serverUri + "/api/v1/customer-contact/relation-types";

export const offerPicListApiUri = serverUri + '/api/v1/dropdown/customer-profile-contact/';

export const suspectContactRelationListApiUri = serverUri + '/api/v1/suspect/list-contact-relation/';

export const suspectContactRelationDetailApiUri =
  serverUri + "/api/v1/suspect/suspect-contact-relation/";

export const suspectUpdateContactRelationStatusApiUri =
  serverUri + "/api/v1/suspect/update-cp-status";

export const suspectSearchContactRelationApiUri =
  serverUri + "/api/v1/suspect/search-contact-relation?phoneNo=";

export const suspectDeleteContactRelationApiUri =
  serverUri + "/api/v1/suspect/delete-suspect-contact-relation/";

export const suspectCreateContactRelationApiUri =
  serverUri + "/api/v1/suspect/new-contact-relation";

export const suspectEditContactRelationApiUri =
  serverUri + "/api/v1/suspect/update-contact-relation";

export const customerContactRelationListApiUri =
  serverUri + "/api/v1/account-management/list-contact-relation/";

export const customerContactRelationDetailApiUri =
  serverUri + "/api/v1/account-management/customer-contact-relation/";

export const customerUpdateContactRelationStatusApiUri =
  serverUri + "/api/v1/account-management/update-cp-status";

export const customerDeleteContactRelationApiUri =
  serverUri + "/api/v1/account-management/delete-customer-contact-relation/";

export const customerSearchContactRelationApiUri = serverUri + '/api/v1/account-management/list-contact-relation/{customerId}?page=1&PerPage=100&Search=';

export const contactRelationTitleApiUri = serverUri + "/api/v1/dropdown/title";

export const contactRelationPositionApiUri = serverUri + '/api/v1/dropdown/position?occupationId=';

export const contactRelationContactTypeApiUri =
  serverUri + "/api/v1/dropdown/occupation";

export const customerCreateContactRelationApiUri =
  serverUri + "/api/v1/account-management/new-contact-relation";

export const customerEditContactRelationApiUri =
  serverUri + "/api/v1/account-management/update-contact-relation";

export const checkPhoneNumberApiUri =
  serverUri + "/api/v1/customer-contact/check-phone";

export const addCustomerAddressApiUri = serverUri + "/api/v1/customer-address";

export function userGuideDetailApiUri(categoryId: string) {
  return serverUri + "/api/v1/user-guidelines/" + categoryId;
}

export function editCustomerUserAddressApiUri(addressId: string) {
  return customerAddressApiUri + addressId;
}

export function deleteCustomerUserAddressApiUri(addressId: string) {
  return customerAddressApiUri + addressId;
}

export function setPrimaryCustomerUserAddressApiUri(
  addressId: string,
  isCompanyAddress: boolean
) {
  const uri = new URL(customerAddressApiUri + addressId + "/set-primary");
  uri.searchParams.append("isCompanyAddress", isCompanyAddress.toString());
  return uri.toString();
}

const reverseGeoNameApiUri = serverUri + "/api/v1/maps/reverse-geo/";

export function getReverseGeoNameApiUri(latitude: number, longitude: number) {
  const uri = new URL(reverseGeoNameApiUri);
  uri.searchParams.append("latitude", latitude.toString());
  uri.searchParams.append("longitude", longitude.toString());

  return uri.toString();
}

export const registerCustomerContactApiUri =
  serverUri + "/api/v1/customer-contact/create/new";

export const addExistingCustomerContactApiUri =
  serverUri + "/api/v1/customer-contact/create/existing";

export function deleteCustomerUserContactApiUri(customerContactId: string) {
  return serverUri + "/api/v1/customer-contact/" + customerContactId;
}

export function editCustomerUserContactApiUri(customerContactId: string) {
  return serverUri + "/api/v1/customer-contact/" + customerContactId;
}

export const registerUserCustomerApiUri = serverUri + "/api/v1/register";

export const isLoginUserVerifiedApiUri = serverUri + "/api/v1/is-verified";

export const submitRequestPresentationApiUri =
  serverUri + "/api/v1/request-presentation";

export const editCustomerUserProfileApiUri = serverUri + "/api/v1/profile";

export const verifyOtpApiUri = serverUri + "/api/v1/verify-otp";

export const generatePhoneNumberOtpApiUri =
  serverUri + "/api/v1/generate-phone-number-otp";

export const checkDealerDataFromDOS = serverUri + "/api/v1/get-dealer-data";

export const registerDealerData = serverUri + "/api/v1/register-dealer";

export function checkBookAvailability(variantId: string) {
  return serverUri + "/api/v1/car-variant/" + variantId + "/book-availability";
}

export const generateRegistrationOtpApiUri =
  serverUri + "/api/v1/generate-registration-otp";

export const syncCustomerUserProfileApiUri = serverUri + "/api/v1/sync-profile";

export const expoPushMapTokenApiUri = serverUri + "/api/v1/expo-push/map-token";

export const uploadProfilePictureApiUri =
  serverUri + "/api/v1/blob/profile-picture";

export const assignSalesApiUri = serverUri + "/api/v1/assign-sales";

export const mobileMenuAccessApiUri = serverUri + "/api/v1/mobile-menu-Access";

export const suspectSegmentationApiUri =
  serverUri + "/api/v1/dropdown/segmentation";

export const suspectSourceApiUri = serverUri + "/api/v1/dropdown/source";

export const suspectPositionApiUri = serverUri + "/api/v1/dropdown/position";

export const suspectSalesmanApiUri = serverUri + "/api/v1/dropdown/salesman";

export const suspectTitleApiUri = serverUri + "/api/v1/dropdown/title";

export const suspectDropReasonApiUri =
  serverUri + "/api/v1/dropdown/drop-suspect-reason";

export const suspectCreateApiUri = serverUri + "/api/v1/suspect/create";

export const leadApiUri = serverUri + "/api/v1/lead-management";

export const leadClaimOrAllocated =
  serverUri + "/api/v1/lead-management/allocated-claim";

export const leadDrop = serverUri + "/api/v1/lead-management/drop";

export const leadAvailableSegmentationApiUri =
  serverUri + "/api/v1/dropdown/segmentation";

export const leadAvailableSourceApiUri = serverUri + "/api/v1/dropdown/source";

export const leadAvailableDropReason =
  serverUri + "/api/v1/dropdown/drop-suspect-reason";

export const leadAvailableSalesmanDropdown =
  serverUri + "/api/v1/dropdown/salesman";

export const suspectApiUri = serverUri + '/api/v1/suspect';

export const suspectDetailApiUri = serverUri + '/api/v1/suspect/suspect-data/';

export const prospectListApiUri = serverUri + '/api/v1/prospect/data';

export const updateProspectDataApiUri =
  serverUri + "/api/v1/prospect/get-data-form";

export const activityListApiUri =
  serverUri + "/api/v1/activity-management/activity-list";

export const activityAllListApiUri =
  serverUri + "/api/v1/activity-management/activity-list-all";

export const delegasiActivityListApiUri =
  serverUri + "/api/v1/activity-management/delegated-activity-list";

export const activityListCalendarApiUri =
  serverUri + "/api/v1/activity-management/calendar-activity-list";

export const activityFilterSalesmanUri =
  serverUri + "/api/v1/dealer-team-members";

export const salesmanUnderSpvApiUri =
  serverUri + "/api/v1/dropdown/salesman-under-spv/";

export const salesmanSpvPostUri = serverUri + "/api/v1/dropdown/salesman";

export const detailProspectP3P4P5ApiUri =
  serverUri + "/api/v1/prospect/p3-p4-p5";

export const detailProspectP1ApiUri = serverUri + "/api/v1/prospect/p1";

export const detailProspectP2ApiUri = serverUri + "/api/v1/prospect/p2";

export const detailProspectP3ApiUri = serverUri + "/api/v1/prospect/p3";

export const activityDetailApiUri =
  serverUri + "/api/v1/activity-management/activity-detail/";

export const activityDetailCustomerNameApiUri =
  serverUri + "/api/v1/dropdown/employees";

export const deleteActivityApiUri =
  serverUri + "/api/v1/activity-management/activity-drop";

export const categoryTypeGroupListDropdownUri =
  serverUri + "/api/v1/dropdown/activity-category-type-group";

export const categoryTypeListDropdownUri =
  serverUri + "/api/v1/dropdown/activity-category-type/";

export const sourceDropdownUri = serverUri + "/api/v1/dropdown/source";

export const salesFunnelDropdownUri =
  serverUri + "/api/v1/dropdown/activity-sales-funnel";

export const customerListUri =
  serverUri + "/api/v1/activity-management/customer-list";

export const opportunityDropdownUri =
  serverUri + "/api/v1/dropdown/opportunity";

export const quotationDropdownUri = serverUri + "/api/v1/dropdown/quotation";

export const activityResultDropdownUri =
  serverUri + "/api/v1/dropdown/activity-result/";

export const activityPostUri =
  serverUri + "/api/v1/activity-management/activity";

export const notificationHistoryApiUri =
  serverUri + "/api/v1/activity-management/notification-history";

export const notificationReminderUpdateApiUri =
  serverUri + "/api/v1/activity-management/update-reminder";

export const reminderDetailActivityApiUri =
  serverUri + "/api/v1/activity-management/activity-reminder-detail/";

export const unitTypeApiUri = serverUri + "/api/v1/dropdown/customer-unit-type";

export const unitBrandApiUri =
  serverUri + "/api/v1/dropdown/customer-unit-brand";

export const salesTypeApiUri = serverUri + "/api/v1/dropdown/sales-type";

export const leasingCompanyApiUri =
  serverUri + "/api/v1/dropdown/leasing-provider";

export const regionsApiUri = serverUri + "/api/v1/dropdown/region";

export const citiesApiUri = serverUri + "/api/v1/dropdown/city";

export const unitCountApiUri =
  serverUri + "/api/v1/dropdown/customer-unit-count";

export const noSpkApiUri = serverUri + "/api/v1/dropdown/spk-number";

export const createP2toP3UploadJKPP =
  serverUri + "/api/v1/opportunity/upload-jkpp";

export const createP1toP2Checklist =
  serverUri + "/api/v1/prospect/checklist-p1-to-p2";

export const createP2toP3Checklist = serverUri + '/api/v1/prospect/spk/create';

export const getSPKDetailDataApiUri = serverUri + '/api/v1/prospect/spk-detail/{spkNumber}';

export const blobApiUri = serverUri + "/api/v1/blob";

export const dropProspectReasonApiUri =
  serverUri + "/api/v1/dropdown/prospect-drop-reason";

export const dropProspectUri = serverUri + "/api/v1/prospect";

export const accessableToCreateSpk =
  serverUri + "/api/v1/prospect/spk/check-create-spk";

export const updateDetailApiUri =
  serverUri + "/api/v1/activity-management/activity-update-form/";

export const cancelDelegasiApiUri =
  serverUri + "/api/v1/activity-delegation/cancel-delegation/";

export const createDelegasiApiUri =
  serverUri + "/api/v1/activity-delegation/create-delegation";

export const listDelegasiApiUri =
  serverUri + "/api/v1/activity-delegation/delegation-list";

export const detailDelegasiApiUri =
  serverUri + "/api/v1/activity-delegation/delegation-detail/";

export const updateDelegasiApiUri =
  serverUri + "/api/v1/activity-delegation/update-delegation/";

export const approvalDelegasiApiUri =
  serverUri + "/api/v1/activity-delegation/approval";

export const DelegasiSalesmanSvpApiUri =
  serverUri + "/api/v1/activity-delegation/spv-dropdown-list";

export const commentActivityApiUri =
  serverUri + "/api/v1/activity-management/create-comment/";

export const deleteCommentActivityApiUri =
  serverUri + "/api/v1/activity-management/delete-comment";

export const viewcommentActivityApiUri =
  serverUri + "/api/v1/activity-management/comment/";

export const activityResultDropDownApiUri =
  serverUri + "/api/v1/dropdown/activity-result/";

export const finishActivityApiUri =
  serverUri + "/api/v1/activity-management/finish-activity";

export const updateStatusActivityApiUri =
  serverUri + "/api/v1/activity-management/activity-status";

export const uploadFileApiUri = serverUri + "/api/v1/blob/put";

export const activityAttachmentApiUri = serverUri + '/api/v1/activity-management/activity-attachment/';

export const suspectGuidelineApiUri = serverUri + '/api/v1/suspect/guidelines';

export const suspectGuidelineUpdateApiUri = serverUri + '/api/v1/suspect/guideline-update';

export const suspectConvertToProspectApiUri = serverUri + '/api/v1/suspect/convert';

export const suspectAvailableSegmentationApiUri = serverUri + '/api/v1/dropdown/available-segmentation';

export const suspectAvailableSourceApiUri = serverUri + '/api/v1/dropdown/available-source';

export const suspectCustomerApiUri = serverUri + '/api/v1/dropdown/customer';

export const prospectDropdownSalesmanApiUri = serverUri + '/api/v1/dropdown/salesman';

export const prospectDropdownSegmentationApiUri = serverUri + '/api/v1/dropdown/segmentation-ref';

export const prospectDropdownSocialMediaApiUri = serverUri + '/api/v1/dropdown/social-media';

export const prospectDropdownTitleApiUri = serverUri + '/api/v1/dropdown/title';

export const prospectDropdownSourceApiUri = serverUri + '/api/v1/dropdown/source';

export const prospectDropdownCityApiUri = serverUri + '/api/v1/dropdown/city';

export const prospectDropdownRegionApiUri = serverUri + '/api/v1/dropdown/region';

export const prospectDropdownReligionApiUri = serverUri + '/api/v1/dropdown/religion';

export const prospectDropdownCustomerGroupApiUri = serverUri + '/api/v1/dropdown/customer-group';

export const prospectDropdownSocialMediaTypeApiUri = serverUri + '/api/v1/dropdown/social-media';

export const prospectDropdownMainContactJobApiUri = serverUri + '/api/v1/dropdown/occupation';

export const prospectDropdownMainContactPositionApiUri = serverUri + '/api/v1/dropdown/position?occupationId=';

export const prospectDropdownFileCategoryApiUri =
  serverUri + "/api/v1/dropdown/file-category";

export const uploadProspectDocumentApiUri = serverUri + "/api/v1/blob/put";

export const prospectDropdownSPKNumberApiUri =
  serverUri + "/api/v1/dropdown/spk-number";

export const prospectProfileInfoApiUri = serverUri + '/api/v1/account-management/customers/info/';

export const prospectDropdownOfferedUnitTypeApiUri =
  serverUri + "/api/v1/dropdown/offered-unit-type";

export const prospectDropdownRoadCharacteristicApiUri =
  serverUri + "/api/v1/dropdown/landscape";

export const prospectDropdownVehicleApplicationApiUri =
  serverUri + "/api/v1/dropdown/unit-application";

export const prospectSpkListApiUri = serverUri + "/api/v1/prospect/spk";

export const prospectDetailSPKApiUri =
  serverUri + "/api/v1/prospect/spk-detail";

export const updateProspectApiUri = serverUri + "/api/v1/prospect/update";

export const prospectInstructionApiUri =
  serverUri + "/api/v1/prospect/guideline";

export const createProspectApiUri = serverUri + "/api/v1/prospect/create";

export const prospectDropdownCustomerApiUri =
  serverUri + "/api/v1/dropdown/customer";

export const prospectDropdownContactApiUri =
  serverUri + "/api/v1/dropdown/contact";

export const prospectDropdownLeasingProviderApiUri =
  serverUri + "/api/v1/dropdown/leasing-provider";

export const prospectDropdownSalesTypeApiUri =
  serverUri + "/api/v1/dropdown/sales-type";

export const prospectGetCreateSPKFormApiUri =
  serverUri + "/api/v1/prospect/spk/form-create";

export const prospectCreateSPKApiUri =
  serverUri + "/api/v1/prospect/spk/create";

export const prospectUploadFileApiUri =
  serverUri + "/api/v1/prospect/prospect-file";

export const prospectDocumentApiUri = serverUri + "/api/v1/prospect/attachment";

export const getUserInfo = serverUri + "/jwt/userinfo";

export const auditLocationLog = serverUri + "/api/v1/audit-location-log";

export const customerSalesmanApiUri = serverUri + "/api/v1/dropdown/salesman";

export const customerAvailableSegmentationApiUri =
  serverUri + "/api/v1/dropdown/available-segmentation";

export const documentApiUri = serverUri + "/api/v1/account-management/document";

export const uploadDocumentApiUri =
  serverUri + "/api/v1/account-management/document/upload";

export const updateDocumentFormApiUri =
  serverUri + "/api/v1/account-management/document/update-form";

export const downloadDocumentApiUri =
  serverUri + "/api/v1/account-management/document/download";

export const customerApiUri =
  serverUri + "/api/v1/account-management/customers";

export const infoCustomerApiUri =
  serverUri + "/api/v1/account-management/customers/info/";

export const customerNotesListApiUri =
  serverUri + "/api/v1/account-management/note/";

export const customerTransactionApiUri =
  serverUri + "/api/v1/account-management/transaction";

export const accountDelegationListApiUri =
  serverUri + "/api/v1/account-management/customer-account-delegation-list";

export const accountDelegationAvailableSalesmanDropdownApiUri =
  serverUri + "/api/v1/dropdown/spv-salesman";

export const accountDelegationCustomerDropdownApiUri =
  serverUri + "/api/v1/account-management/customers-profile";

export const submitAccountDelegationApiUri = serverUri + '/api/v1/account-management/customer-account-delegation';

export const tonnaseDropdownApiUri = serverUri + "/api/v1/dropdown/tonnase";

export const getUserDashboard = serverUri + '/api/v1/dashboard-access';

export const suspectSqlReviewApiUri = serverUri + "/api/v1/suspect/sql-review";

export const salesTargetApiUri = serverUri + "/api/v1/sales-target";

export const salesTargetListSalesman =
  serverUri + "/api/v1/dropdown/spv-salesman";

export const unitTypeDropdownApiUri = serverUri + '/api/v1/dropdown/unit-type';

export const opportunityDetailApiUri = serverUri + "/api/v1/opportunity/{id}";

export const spvSalesmanAreaDropdownApiUri = serverUri + "/api/v1/dropdown/spv-salesman-area";

export const spvSalesmanMemberDropdownApiUri = serverUri + "/api/v1/dropdown/spv-salesman-member";

export const salesmanAreaDropdownForBmApiUri = serverUri + "/api/v1/dropdown/salesman-area";

export const salesmanAreaDropdownApiUri = serverUri + "/api/v1/dealer-team-members";

export const unitCatalogModelApiUri = serverUri + '/api/v1/car-model';

export const unitCatalogVariantApiUri = serverUri + '/api/v1/car-model/catalog/{modelId}';

export const carModelImageApiUri = serverUri + '/images/car-model/';

export function createSuspectSqlReviewApiUri(suspectId: string) {
  return `${suspectSqlReviewApiUri}/` + suspectId;
}

export const customerAssetListApiUri =
  serverUri + "/api/v1/account-management/customer-asset";

export function customerAssetDetailApiUri(
    customerId: string,
    customerProfileId: string,
    prospectId: string
) {
    const uri = new URL(customerAssetListApiUri + '/detail');
    uri.searchParams.append('customerId', customerId);
    uri.searchParams.append('CustomerProfileId', customerProfileId);
    uri.searchParams.append('prospectId', prospectId);
    return uri.toString();
}

export function updateCustomerAssetApiUri(
    customerAssetId: string, customerProfileId: string
) {
    return customerAssetListApiUri + '/' + customerAssetId + '/' + customerProfileId;
}

export function createCustomerAssetApiUri(
    customerProfileId: string
) {
    return customerAssetListApiUri + '/' + customerProfileId;
}

export function deleteCustomerAssetApiUri(customerAssetId: string) {
  return customerAssetListApiUri + "/" + customerAssetId;
}

export const brandDropdownApiUri = serverUri + "/api/v1/dropdown/vehicle-brand";

export const customerReligionDropdown = serverUri + "/api/v1/dropdown/religion";

export const customerGroupCustomerDropdown =
  serverUri + "/api/v1/dropdown/customer-group";

export const customerJobDropdown = serverUri + "/api/v1/dropdown/occupation";

export const customerSocialMediaDropDown =
  serverUri + "/api/v1/dropdown/social-media";

export const customerTitleDropDown = serverUri + "/api/v1/dropdown/title";

export const customerAddressContactSocialMediaApiUri =
  serverUri +
  "/api/v1/account-management/customers/address-contact-socialmedia/";

export const customerSocialMediaApiUri =
  serverUri + "/api/v1/account-management/customers/social-media/";

export const customerAccountAddressApiUri =
  serverUri + "/api/v1/account-management/customers/address/";

export const customerAccountContactApiUri =
  serverUri + "/api/v1/account-management/customers/contact/";

export const afterSalesProductApiUri =
  serverUri + "/api/v1/after-sales-product";

export const recommendationFirstQuestionApiUri =
  serverUri + "/api/v1/after-sales-product/question-first";

export function recommendationNextQuestionApiUri(answers: string) {
  const uri = new URL(afterSalesProductApiUri + "/question-next");
  uri.searchParams.append("jawaban", answers);
  return uri.toString();
}

export function recommendationListApiUri(answers: string) {
  const uri = new URL(afterSalesProductApiUri + "/recommendation-list");
  uri.searchParams.append("jawaban", answers);
  return uri.toString();
}

export const recommendationQuestionApiUri =
  serverUri + "/api/v1/recommendation-question";

export const recommendationProductApiUri =
  afterSalesProductApiUri + "/get-by-answer";

export function afterSalesProductDetailApiUri(productId: string) {
  return afterSalesProductApiUri + "/get-detail-desc/" + productId;
}

export function afterSalesProductPriceApiUri(
  carVariantId?: string[],
  maintenanceId?: string,
  conditionId?: string
) {
  const uri = new URL(afterSalesProductApiUri + "/price");
  if (carVariantId && carVariantId?.length > 0) {
    carVariantId.map((variant) => {
      uri.searchParams.append("carvariantID", variant);
    });
  }
  if (maintenanceId) {
    uri.searchParams.append("mainteneanceID", maintenanceId);
  }
  if (conditionId) {
    uri.searchParams.append("conditionID", conditionId.toString());
  }
  return uri.toString();
}

export const afterSalesProductProspectApiUri =
  afterSalesProductApiUri + "/get-prospect-p1-p2";

export const afterSalesProductQuotationApiUri =
  afterSalesProductApiUri + "/get-quotation";

export const afterSalesProductSaveOrderApiUri =
  afterSalesProductApiUri + "/save-order";

export function afterSalesProductContactTeamApiUri(orderId: string) {
  return afterSalesProductApiUri + "/hubungkan-ke-tim/" + orderId;
}

export const afterSalesLeadListApiUri = afterSalesProductApiUri + "/get-lead";

export const afterSalesLeadFilterSalesmanApiUri =
  afterSalesProductApiUri + "/get-salesman";

export function afterSalesLeadDetailApiUri(orderId: string) {
  const uri = new URL(afterSalesProductApiUri + "/get-lead-detail");
  uri.searchParams.append("orderId", orderId);
  return uri.toString();
}

export function afterSalesLeadQuotationApiUri(orderId: string) {
  return afterSalesProductApiUri + "/pdf/" + orderId;
}

export function afterSalesLeadDropReasonApiUri(search: string) {
  const uri = new URL(afterSalesProductApiUri + "/get-lead-batal");
  uri.searchParams.append("search", search);
  return uri.toString();
}

export function afterSalesLeadBertransaksiApiUri(orderId: string) {
  return afterSalesProductApiUri + "/lead-bertransaksi/" + orderId;
}

export const afterSalesLeadBatalApiUri =
  afterSalesProductApiUri + "/lead-batal";

export const orderTrackingListApiUri = serverUri + "/api/v1/order-tracking";

export function orderTrackingDetailApiUri(
  opportunityNo: string,
  spkNumber: string,
  customerNumber: string
) {
  const uri = new URL(orderTrackingListApiUri + "/detail");
  uri.searchParams.append("opportunityNo", opportunityNo);
  uri.searchParams.append("spkNumber", spkNumber);
  uri.searchParams.append("customerNumber", customerNumber);
  return uri.toString();
}

export function activityCustomerProfileContactApiUri(prospectId: string) {
  return (
    serverUri +
    "/api/v1/activity-management/customer-profile-contact/" +
    prospectId
  );
}

export const suspectContactTypeApiUri = serverUri + '/api/v1/dropdown/occupation';
export const suspectPersonalPositionApiUri = serverUri + '/api/v1/dropdown/position?occupationId=';
export const suspectCustomerClassificationApiUri = serverUri + '/api/v1/dropdown/customer-clasification';
export const suspectCompanyTitleApiUri = serverUri + '/api/v1/dropdown/company-title';

export const suspectSearchCustomerApiUri =
  serverUri + "/api/v1/suspect/search-by-name-phone";

export const switchRoleApiUri = serverUri + "/api/v1/dealer-switch-role";

export const createActivityMadeForCustomersApiUri =
  serverUri + "/api/v1/activity-management/activity-made-for";

export const editProspectApiUri = serverUri + '/api/v1/account-management/customers/';

export const targetSalesPeriodeApiUri = cmsBackendUri + '/api/v1/target-sales-dashboard/get-year-funnel';

export const conversionRateCategoryApiUri = serverUri + "";

export const conversionRatePeriodeApiUri = cmsBackendUri + '/api/v1/conversion-rate-dashboard/get-year';

export const truckClassDropdownApiUri = serverUri + '/api/v1/dropdown/truck-class';

export const lossDealProspectPeriodeApiUri = cmsBackendUri + '/api/v1/performance-dashboard/get-year-drop-reason?accessId';

export const productModelVariantApiUri = serverUri + "/api/v1/car-variant/brochure/";

export const outletLocationApiUri = serverUri + "/api/v1/dropdown/outlet";

export const lossDealDashboardApiUri = serverUri + '/api/v1/loss-deal-prospect-dashboard/by-reason?period={period}&allSalesman={allSalesman}';

export const lossDealTop5DashboardApiUri = serverUri + '/api/v1/loss-deal-prospect-dashboard/top?period={period}&allSalesman={allSalesman}';

export const segmentationDropdownApiUri = serverUri + '/api/v1/dropdown/segmentation';
Leave a Comment