import { ApiHelper } from '/js/util/api.js';

export const UniversalDataService = {
    GetHoliday: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetHoliday', "GET")).data;
    },
    GetServiceCounty: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetServiceCounty', "GET")).data;
    },
    GetFreightTypes: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetFreightTypes', "GET")).data;
    },
    GetFreightAreas: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetFreightAreas', "GET")).data;
    },
    GetFreightAreaId: async function (zip) {
        return (await ApiHelper.sendRequest(`/api/Universal/GetFreightAreaId?zip=${zip}`, "GET")).data;
    },
    GetOrderMainType: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetOrderMainType', "GET")).data;
    },
    GetRentedFor: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetRentedFor', "GET")).data;
    },
    GetOrderMainPayMethod: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetOrderMainPayMethod', "GET")).data;
    },
    GetShippingMethod: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetShippingMethod', "GET")).data;
    },
    GetOrderMainStatus: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetOrderMainStatus', "GET")).data;
    },
    GetPaymentStatus: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetPaymentStatus', "GET")).data;
    },
    GetOrderSource: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetOrderSource', "GET")).data;
    },
    GetBillType: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetBillType', "GET")).data;
    },
    GetInvoiceType: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetInvoiceType', "GET")).data;
    },
    GetPeriodType: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetPeriodType', "GET")).data;
    }, 
    GetShipPlace: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetShipPlace', "GET")).data;
    },
    UploadImage: async function (formData) {
        return await ApiHelper.sendRequest('/api/Universal/UploadImage', "POST", formData, null, { headers: { 'Content-Type': null } });
    },
    GetContractCustomerLessor: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetContractCustomerLessor', "GET")).data;
    },
    GetContractStoreSupplier: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetContractStoreSupplier', "GET")).data;
    },
    GetPackingTitle: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetPackingTitle', "GET")).data;
    },
    GetRecycleTitle: async function () {
        return (await ApiHelper.sendRequest('/api/Universal/GetRecycleTitle', "GET")).data;
    }
}