* chore: create tests * chore: models * fix: passing initial tests * test: adds integration test * test: clean up integration implementation * fix: claims * fix: brightpearl + webshipper * tests: passing * fix: update claim items * fix: adds gitignore * fix: pr comments * fix: single migration * fix(medusa-plugin-segment): adds item claimed event to segment
50 lines
814 B
JavaScript
50 lines
814 B
JavaScript
import { FulfillmentService } from "medusa-interfaces";
|
|
|
|
class TestFulService extends FulfillmentService {
|
|
static identifier = "test-ful";
|
|
|
|
constructor() {
|
|
super();
|
|
}
|
|
|
|
getFulfillmentOptions() {
|
|
return [
|
|
{
|
|
id: "manual-fulfillment",
|
|
},
|
|
];
|
|
}
|
|
|
|
validateFulfillmentData(data, cart) {
|
|
return data;
|
|
}
|
|
|
|
validateOption(data) {
|
|
return true;
|
|
}
|
|
|
|
canCalculate() {
|
|
return false;
|
|
}
|
|
|
|
calculatePrice() {
|
|
throw Error("Manual Fulfillment service cannot calculatePrice");
|
|
}
|
|
|
|
createOrder() {
|
|
// No data is being sent anywhere
|
|
return Promise.resolve({});
|
|
}
|
|
|
|
createFulfillment() {
|
|
// No data is being sent anywhere
|
|
return Promise.resolve({});
|
|
}
|
|
|
|
cancelFulfillment() {
|
|
return Promise.resolve({});
|
|
}
|
|
}
|
|
|
|
export default TestFulService;
|