feat(types, medusa, core-flows): add delete-stock-location endpoint to api-v2 (#6801)
* initial create * add changeset * redo changes for stock locatino module' * initial delete stock location * add changeset * pr prep * propagate deletion with common step * move integration tests --------- Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
This commit is contained in:
1 parent
71efa15088
commit
deab12e27e
8 files changed
+163
-1
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
UpdateStockLocationInput,
|
||||
UpdateStockLocationNextInput,
|
||||
} from "./common"
|
||||
import { RestoreReturn, SoftDeleteReturn } from "../dal"
|
||||
|
||||
import { Context } from "../shared-context"
|
||||
import { FindConfig } from "../common/common"
|
||||
@@ -301,4 +302,30 @@ export interface IStockLocationServiceNext extends IModuleService {
|
||||
* }
|
||||
*/
|
||||
delete(id: string, context?: Context): Promise<void>
|
||||
|
||||
/**
|
||||
* Soft delete stock locations
|
||||
* @param stockLocationIds
|
||||
* @param config
|
||||
* @param sharedContext
|
||||
*/
|
||||
softDelete<TReturnableLinkableKeys extends string = string>(
|
||||
stockLocationIds: string[],
|
||||
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
|
||||
sharedContext?: Context
|
||||
): Promise<Record<string, string[]> | void>
|
||||
|
||||
/**
|
||||
* This method is used to restore a stock location or multiple stock locations that were previously deleted using the {@link softDelete} method.
|
||||
*
|
||||
* @param {string[]} stockLocationIds - The ID(s) of the stock location(s) to restore.
|
||||
* @param {RestoreReturn<TReturnableLinkableKeys>} config - Restore config
|
||||
* @param {Context} context - A context used to share resources, such as transaction manager, between the application and the module.
|
||||
* @returns {Promise<void>} Resolves when the stock location(s) are successfully restored.
|
||||
*/
|
||||
restore<TReturnableLinkableKeys extends string = string>(
|
||||
stockLocationIds: string[],
|
||||
config?: RestoreReturn<TReturnableLinkableKeys>,
|
||||
sharedContext?: Context
|
||||
): Promise<Record<string, string[]> | void>
|
||||
}
|
||||
Reference in new issue
Block a user