-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(business-unit): fixed issues with new sdk
- Loading branch information
1 parent
97cce0e
commit e50af4f
Showing
12 changed files
with
72 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { | ||
ProductTailoring, | ||
ProductTailoringUpdateAction, | ||
} from "@commercetools/platform-sdk"; | ||
import { AbstractStorage } from "~src/storage"; | ||
import { | ||
AbstractResourceRepository, | ||
AbstractUpdateHandler, | ||
RepositoryContext, | ||
UpdateHandlerInterface, | ||
} from "./abstract"; | ||
|
||
export class ProductTailoringRepository extends AbstractResourceRepository<"product-tailoring"> { | ||
constructor(storage: AbstractStorage) { | ||
super("product-tailoring", storage); | ||
this.actions = new ProductTailoringUpdateHandler(this._storage); | ||
} | ||
|
||
create(context: RepositoryContext, draft: any): ProductTailoring { | ||
throw new Error("Create method for product-tailoring not implemented."); | ||
} | ||
} | ||
|
||
class ProductTailoringUpdateHandler | ||
extends AbstractUpdateHandler | ||
implements | ||
Partial< | ||
UpdateHandlerInterface<ProductTailoring, ProductTailoringUpdateAction> | ||
> | ||
{ | ||
setSlug() { | ||
throw new Error("SetSlug method for product-tailoring not implemented."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import type { | ||
Customer, | ||
CustomerChangePassword, | ||
CustomerToken, | ||
MyCustomerDraft, | ||
|
@@ -73,6 +74,7 @@ describe("/me", () => { | |
isEmailVerified: true, | ||
authenticationMode: "password", | ||
custom: { type: { typeId: "type", id: "" }, fields: {} }, | ||
stores: [], | ||
}); | ||
}); | ||
|
||
|
@@ -126,7 +128,7 @@ describe("/me", () => { | |
}); | ||
|
||
test("Change my password", async () => { | ||
const customer = { | ||
const customer: Customer = { | ||
...getBaseResourceProperties(), | ||
id: "customer-uuid", | ||
email: "[email protected]", | ||
|
@@ -135,6 +137,7 @@ describe("/me", () => { | |
isEmailVerified: true, | ||
authenticationMode: "Password", //default in Commercetools | ||
version: 1, | ||
stores: [], | ||
}; | ||
ctMock.project("dummy").add("customer", customer); | ||
|
||
|
@@ -176,7 +179,7 @@ describe("/me", () => { | |
}); | ||
|
||
test("reset password flow", async () => { | ||
const customer = { | ||
const customer: Customer = { | ||
...getBaseResourceProperties(), | ||
id: "customer-uuid", | ||
email: "[email protected]", | ||
|
@@ -185,6 +188,7 @@ describe("/me", () => { | |
isEmailVerified: true, | ||
authenticationMode: "Password", //default in Commercetools | ||
version: 1, | ||
stores: [], | ||
}; | ||
ctMock.project("dummy").add("customer", customer); | ||
|
||
|
@@ -225,7 +229,7 @@ describe("/me", () => { | |
}); | ||
|
||
test("verify email flow", async () => { | ||
const customer = { | ||
const customer: Customer = { | ||
...getBaseResourceProperties(), | ||
id: "customer-uuid", | ||
email: "[email protected]", | ||
|
@@ -234,6 +238,7 @@ describe("/me", () => { | |
isEmailVerified: false, | ||
authenticationMode: "Password", //default in Commercetools | ||
version: 1, | ||
stores: [], | ||
}; | ||
ctMock.project("dummy").add("customer", customer); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters