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

export const PackingDataService = {
    GetShipList: async function (queryData) {
        return (await ApiHelper.sendRequest('/api/Packing/GetShipList', "POST", queryData));
    },
    ExportList: async function (exportData) {
        return (await ApiHelper.sendRequest('/api/Packing/ExportList', "POST", exportData));
    },
    Get: async function (id) {
        return await ApiHelper.sendRequest(`/api/Packing/Get?id=${id}`, "GET");
    },
    ConfirmQC: async function (queryData) {
        return (await ApiHelper.sendRequest('/api/Packing/ConfirmQC', "POST", queryData));
    },
    TransToOrder: async function (id) {
        return await ApiHelper.sendRequest(`/api/Packing/TransToOrder?id=${id}`, 'GET');
    },
    TransToShip: async function (id) {
        return await ApiHelper.sendRequest(`/api/Packing/TransToShip?id=${id}`, "GET");
    },
    TransToPreparing: async function (id) {
        return await ApiHelper.sendRequest(`/api/Packing/TransToPreparing?id=${id}`, "GET");
    },
    TransToDelivered: async function (id) {
        return await ApiHelper.sendRequest(`/api/Packing/TransToDelivered?id=${id}`, "GET");
    },
    TransToCancelApply: async function (id) {
        return await ApiHelper.sendRequest(`/api/Packing/TransToCancelApply?id=${id}`, "GET");
    },
    TransToCancelConfirm: async function (id) {
        return await ApiHelper.sendRequest(`/api/Packing/TransToCancelConfirm?id=${id}`, "GET");
    },
    GetOne: async function (id) {
        return await ApiHelper.sendRequest(`/api/Packing/GetOne?id=${id}`, "GET");
    },
    UploadImage: async function (formData) {
        return await ApiHelper.sendRequest('/api/Packing/UploadImage', "POST", formData, null, { headers: { 'Content-Type': null } });
    }
}