chore(): Modules providers reorganization (#7234)
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
This commit is contained in:
co-authored by
Riqwan Thamir
parent
2f7b53488d
commit
93f6e60c17
@@ -0,0 +1,44 @@
|
||||
import { AbstractFulfillmentProviderService } from "@medusajs/utils"
|
||||
|
||||
// TODO rework type and DTO's
|
||||
|
||||
export class ManualFulfillmentService extends AbstractFulfillmentProviderService {
|
||||
static identifier = "manual"
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
}
|
||||
|
||||
async getFulfillmentOptions(): Promise<Record<string, unknown>[]> {
|
||||
return [
|
||||
{
|
||||
id: "manual-fulfillment",
|
||||
},
|
||||
{
|
||||
id: "manual-fulfillment-return",
|
||||
is_return: true,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
async validateFulfillmentData(
|
||||
optionData: Record<string, unknown>,
|
||||
data: Record<string, unknown>,
|
||||
context: Record<string, unknown>
|
||||
): Promise<any> {
|
||||
return data
|
||||
}
|
||||
|
||||
async validateOption(data: Record<string, unknown>): Promise<boolean> {
|
||||
return true
|
||||
}
|
||||
|
||||
async createFulfillment(): Promise<Record<string, unknown>> {
|
||||
// No data is being sent anywhere
|
||||
return {}
|
||||
}
|
||||
|
||||
async cancelFulfillment(fulfillment: Record<string, unknown>): Promise<any> {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user