2023-01-09 09:55:12 +00:00
|
|
|
export function getTaxConfigurationList() {
|
|
|
|
const query = `query{
|
|
|
|
taxConfigurations(first:100){
|
|
|
|
edges{
|
|
|
|
node{
|
|
|
|
id
|
|
|
|
channel{
|
|
|
|
id
|
|
|
|
slug
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
return cy
|
|
|
|
.sendRequestWithQuery(query)
|
|
|
|
.then(resp => resp.body.data.taxConfigurations.edges);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function updateTaxes({
|
|
|
|
id,
|
|
|
|
chargeTaxes = true,
|
|
|
|
taxCalculationStrategy = "FLAT_RATES",
|
2023-01-25 10:32:28 +00:00
|
|
|
pricesEnteredWithTax = "false",
|
2023-01-09 09:55:12 +00:00
|
|
|
}) {
|
|
|
|
const mutation = `mutation{
|
|
|
|
taxConfigurationUpdate(id:"${id}", input:{
|
|
|
|
chargeTaxes:${chargeTaxes}
|
|
|
|
displayGrossPrices:true
|
2023-01-25 10:32:28 +00:00
|
|
|
pricesEnteredWithTax:${pricesEnteredWithTax}
|
2023-01-09 09:55:12 +00:00
|
|
|
removeCountriesConfiguration: []
|
|
|
|
taxCalculationStrategy:${taxCalculationStrategy}
|
|
|
|
updateCountriesConfiguration: []
|
|
|
|
}){
|
|
|
|
errors{
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
return cy.sendRequestWithQuery(mutation);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getTaxClassList() {
|
|
|
|
const query = `query{
|
|
|
|
taxClasses(first:100){
|
|
|
|
edges{
|
|
|
|
node{
|
|
|
|
id
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
return cy
|
|
|
|
.sendRequestWithQuery(query)
|
|
|
|
.then(resp => resp.body.data.taxClasses.edges);
|
|
|
|
}
|