feat(cart): Cart + Address services (#6055)
Duplicate of #6008, but I messed up my git history big time :'( **What** - CartService and CartRepository + tests - AddressService and AddressRepository + tests - CartModuleService skeleton. Full implementation + tests will be added in a separate PR
This commit is contained in:
1 parent
b6ac768698
commit
ce81cade88
20 files changed
+847
-33
No files matched your search
@@ -465,8 +465,13 @@ export interface FilterableCartProps
|
||||
updated_at?: OperatorMap<string>
|
||||
}
|
||||
|
||||
export interface FilterableAddressProps
|
||||
extends BaseFilterable<FilterableAddressProps> {
|
||||
id?: string | string[]
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Remove this in favor of new__CartDTO, when module is released
|
||||
* TODO: Remove this in favor of CartDTO, when module is released
|
||||
* @deprecated Use CartDTO instead
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FindConfig } from "../common"
|
||||
import { IModuleService } from "../modules-sdk"
|
||||
import { Context } from "../shared-context"
|
||||
import { CartDTO, FilterableCartProps } from "./common"
|
||||
import { AddLineItemsDTO, CreateCartDTO, UpdateCartDTO, UpdateLineItemsDTO } from "./mutations"
|
||||
import { CreateCartDTO, UpdateCartDTO } from "./mutations"
|
||||
|
||||
export interface ICartModuleService extends IModuleService {
|
||||
retrieve(
|
||||
@@ -24,25 +24,28 @@ export interface ICartModuleService extends IModuleService {
|
||||
): Promise<[CartDTO[], number]>
|
||||
|
||||
create(data: CreateCartDTO[], sharedContext?: Context): Promise<CartDTO[]>
|
||||
create(data: CreateCartDTO, sharedContext?: Context): Promise<CartDTO>
|
||||
|
||||
update(data: UpdateCartDTO[], sharedContext?: Context): Promise<CartDTO[]>
|
||||
update(data: UpdateCartDTO, sharedContext?: Context): Promise<CartDTO>
|
||||
|
||||
delete(cartIds: string[], sharedContext?: Context): Promise<void>
|
||||
delete(cartId: string, sharedContext?: Context): Promise<void>
|
||||
|
||||
addLineItems(data: AddLineItemsDTO, sharedContext?: Context): Promise<CartDTO>
|
||||
addLineItems(
|
||||
data: AddLineItemsDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<CartDTO[]>
|
||||
// addLineItems(data: AddLineItemsDTO, sharedContext?: Context): Promise<CartDTO>
|
||||
// addLineItems(
|
||||
// data: AddLineItemsDTO[],
|
||||
// sharedContext?: Context
|
||||
// ): Promise<CartDTO[]>
|
||||
|
||||
updateLineItems(
|
||||
data: UpdateLineItemsDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<CartDTO>
|
||||
updateLineItems(
|
||||
data: UpdateLineItemsDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<CartDTO[]>
|
||||
// updateLineItems(
|
||||
// data: UpdateLineItemsDTO,
|
||||
// sharedContext?: Context
|
||||
// ): Promise<CartDTO>
|
||||
// updateLineItems(
|
||||
// data: UpdateLineItemsDTO[],
|
||||
// sharedContext?: Context
|
||||
// ): Promise<CartDTO[]>
|
||||
|
||||
removeLineItems(lineItemIds: string[], sharedContext?: Context): Promise<void>
|
||||
// removeLineItems(lineItemIds: string[], sharedContext?: Context): Promise<void>
|
||||
}
|
||||
Reference in new issue
Block a user