updates tests
This commit is contained in:
1 parent
36c12fa66d
commit
96377df101
42 files changed
+243
-200
No files matched your search
@@ -1,15 +1,21 @@
|
|||||||
import mongoose from "mongoose"
|
import mongoose from "mongoose"
|
||||||
|
|
||||||
|
String.prototype.equals = function(that) {
|
||||||
|
return this === that
|
||||||
|
}
|
||||||
|
|
||||||
class IdMap {
|
class IdMap {
|
||||||
ids = {}
|
ids = {}
|
||||||
|
|
||||||
getId(key) {
|
getId(key, backend=false) {
|
||||||
if (this.ids[key]) {
|
if (this.ids[key]) {
|
||||||
return this.ids[key]
|
return this.ids[key]
|
||||||
}
|
}
|
||||||
const id = `${mongoose.Types.ObjectId()}`
|
|
||||||
this.ids[key] = id
|
const mongooseId = `${mongoose.Types.ObjectId()}`
|
||||||
return id
|
this.ids[key] = mongooseId
|
||||||
|
|
||||||
|
return mongooseId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ describe("POST /admin/product-variants/:id/options", () => {
|
|||||||
`/admin/product-variants/${IdMap.getId("testVariant")}/options`,
|
`/admin/product-variants/${IdMap.getId("testVariant")}/options`,
|
||||||
{
|
{
|
||||||
payload: {
|
payload: {
|
||||||
optionId: IdMap.getId("testOption"),
|
option_id: IdMap.getId("testOption"),
|
||||||
optionValue: "test",
|
value: "test",
|
||||||
},
|
},
|
||||||
adminSession: {
|
adminSession: {
|
||||||
jwt: {
|
jwt: {
|
||||||
|
|||||||
+12
-2
@@ -10,7 +10,12 @@ describe("POST /admin/product-variants", () => {
|
|||||||
subject = await request("POST", "/admin/product-variants", {
|
subject = await request("POST", "/admin/product-variants", {
|
||||||
payload: {
|
payload: {
|
||||||
title: "Test Product Variant",
|
title: "Test Product Variant",
|
||||||
prices: [{}],
|
prices: [
|
||||||
|
{
|
||||||
|
currency_code: "DKK",
|
||||||
|
amount: 1234,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
adminSession: {
|
adminSession: {
|
||||||
jwt: {
|
jwt: {
|
||||||
@@ -32,7 +37,12 @@ describe("POST /admin/product-variants", () => {
|
|||||||
expect(ProductVariantServiceMock.createDraft).toHaveBeenCalledTimes(1)
|
expect(ProductVariantServiceMock.createDraft).toHaveBeenCalledTimes(1)
|
||||||
expect(ProductVariantServiceMock.createDraft).toHaveBeenCalledWith({
|
expect(ProductVariantServiceMock.createDraft).toHaveBeenCalledWith({
|
||||||
title: "Test Product Variant",
|
title: "Test Product Variant",
|
||||||
prices: [{}],
|
prices: [
|
||||||
|
{
|
||||||
|
currency_code: "DKK",
|
||||||
|
amount: 1234,
|
||||||
|
},
|
||||||
|
],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ describe("DELETE /admin/product-variants/:id/options", () => {
|
|||||||
`/admin/product-variants/${IdMap.getId("testVariant")}/options`,
|
`/admin/product-variants/${IdMap.getId("testVariant")}/options`,
|
||||||
{
|
{
|
||||||
payload: {
|
payload: {
|
||||||
optionId: IdMap.getId("testOption"),
|
option_id: IdMap.getId("testOption"),
|
||||||
},
|
},
|
||||||
adminSession: {
|
adminSession: {
|
||||||
jwt: {
|
jwt: {
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
import { IdMap } from "medusa-test-utils"
|
|
||||||
import { request } from "../../../../../helpers/test-request"
|
|
||||||
import { ProductVariantServiceMock } from "../../../../../services/__mocks__/product-variant"
|
|
||||||
|
|
||||||
describe("POST /admin/product-variants/:id/currency-price", () => {
|
|
||||||
describe("successful sets currency price", () => {
|
|
||||||
let subject
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
|
||||||
subject = await request(
|
|
||||||
"POST",
|
|
||||||
`/admin/product-variants/${IdMap.getId("testVariant")}/currency-price`,
|
|
||||||
{
|
|
||||||
payload: {
|
|
||||||
currencyCode: "DKK",
|
|
||||||
amount: 100,
|
|
||||||
},
|
|
||||||
adminSession: {
|
|
||||||
jwt: {
|
|
||||||
userId: IdMap.getId("admin_user"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it("returns 200", () => {
|
|
||||||
expect(subject.status).toEqual(200)
|
|
||||||
})
|
|
||||||
|
|
||||||
it("calls service setCurrencyPrice", () => {
|
|
||||||
expect(ProductVariantServiceMock.setCurrencyPrice).toHaveBeenCalledTimes(
|
|
||||||
1
|
|
||||||
)
|
|
||||||
expect(ProductVariantServiceMock.setCurrencyPrice).toHaveBeenCalledWith(
|
|
||||||
IdMap.getId("testVariant"),
|
|
||||||
"DKK",
|
|
||||||
100
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import { IdMap } from "medusa-test-utils"
|
|
||||||
import { request } from "../../../../../helpers/test-request"
|
|
||||||
import { ProductVariantServiceMock } from "../../../../../services/__mocks__/product-variant"
|
|
||||||
|
|
||||||
describe("POST /admin/product-variants/:id/region-price", () => {
|
|
||||||
describe("successfully sets region price", () => {
|
|
||||||
let subject
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
|
||||||
subject = await request(
|
|
||||||
"POST",
|
|
||||||
`/admin/product-variants/${IdMap.getId("testVariant")}/region-price`,
|
|
||||||
{
|
|
||||||
payload: {
|
|
||||||
regionId: IdMap.getId("region-fr"),
|
|
||||||
amount: 100,
|
|
||||||
},
|
|
||||||
adminSession: {
|
|
||||||
jwt: {
|
|
||||||
userId: IdMap.getId("admin_user"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it("returns 200", () => {
|
|
||||||
expect(subject.status).toEqual(200)
|
|
||||||
})
|
|
||||||
|
|
||||||
it("calls service setCurrencyPrice", () => {
|
|
||||||
expect(ProductVariantServiceMock.setRegionPrice).toHaveBeenCalledTimes(1)
|
|
||||||
expect(ProductVariantServiceMock.setRegionPrice).toHaveBeenCalledWith(
|
|
||||||
IdMap.getId("testVariant"),
|
|
||||||
IdMap.getId("region-fr"),
|
|
||||||
100
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
import { IdMap } from "medusa-test-utils"
|
||||||
|
import { request } from "../../../../../helpers/test-request"
|
||||||
|
import { ProductVariantServiceMock } from "../../../../../services/__mocks__/product-variant"
|
||||||
|
|
||||||
|
describe("POST /admin/product-variants/:id/prices", () => {
|
||||||
|
describe("successfully sets region price", () => {
|
||||||
|
let subject
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
subject = await request(
|
||||||
|
"POST",
|
||||||
|
`/admin/product-variants/${IdMap.getId("testVariant")}/prices`,
|
||||||
|
{
|
||||||
|
payload: {
|
||||||
|
region_id: IdMap.getId("region-fr"),
|
||||||
|
amount: 100,
|
||||||
|
},
|
||||||
|
adminSession: {
|
||||||
|
jwt: {
|
||||||
|
userId: IdMap.getId("admin_user"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("returns 200", () => {
|
||||||
|
expect(subject.status).toEqual(200)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("calls service setCurrencyPrice", () => {
|
||||||
|
expect(ProductVariantServiceMock.setRegionPrice).toHaveBeenCalledTimes(1)
|
||||||
|
expect(ProductVariantServiceMock.setRegionPrice).toHaveBeenCalledWith(
|
||||||
|
IdMap.getId("testVariant"),
|
||||||
|
IdMap.getId("region-fr"),
|
||||||
|
100
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe("successfully sets currency price", () => {
|
||||||
|
let subject
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
subject = await request(
|
||||||
|
"POST",
|
||||||
|
`/admin/product-variants/${IdMap.getId("testVariant")}/prices`,
|
||||||
|
{
|
||||||
|
payload: {
|
||||||
|
currency_code: "EUR",
|
||||||
|
amount: 100,
|
||||||
|
},
|
||||||
|
adminSession: {
|
||||||
|
jwt: {
|
||||||
|
userId: IdMap.getId("admin_user"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("returns 200", () => {
|
||||||
|
expect(subject.status).toEqual(200)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("calls service setCurrencyPrice", () => {
|
||||||
|
expect(ProductVariantServiceMock.setCurrencyPrice).toHaveBeenCalledTimes(
|
||||||
|
1
|
||||||
|
)
|
||||||
|
expect(ProductVariantServiceMock.setCurrencyPrice).toHaveBeenCalledWith(
|
||||||
|
IdMap.getId("testVariant"),
|
||||||
|
"EUR",
|
||||||
|
100
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
+12
-2
@@ -13,7 +13,12 @@ describe("POST /admin/product-variants/:id", () => {
|
|||||||
{
|
{
|
||||||
payload: {
|
payload: {
|
||||||
title: "Test Product Variant Updated",
|
title: "Test Product Variant Updated",
|
||||||
prices: [{}],
|
prices: [
|
||||||
|
{
|
||||||
|
currency_code: "DKK",
|
||||||
|
amount: 1234,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
adminSession: {
|
adminSession: {
|
||||||
jwt: {
|
jwt: {
|
||||||
@@ -34,7 +39,12 @@ describe("POST /admin/product-variants/:id", () => {
|
|||||||
IdMap.getId("testVariant"),
|
IdMap.getId("testVariant"),
|
||||||
{
|
{
|
||||||
title: "Test Product Variant Updated",
|
title: "Test Product Variant Updated",
|
||||||
prices: [{}],
|
prices: [
|
||||||
|
{
|
||||||
|
currency_code: "DKK",
|
||||||
|
amount: 1234,
|
||||||
|
},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import { MedusaError, Validator } from "medusa-core-utils"
|
||||||
|
|
||||||
|
export default async (req, res) => {
|
||||||
|
const { id } = req.params
|
||||||
|
|
||||||
|
const schema = Validator.object()
|
||||||
|
.keys({
|
||||||
|
region_id: Validator.string(),
|
||||||
|
currency_code: Validator.string(),
|
||||||
|
amount: Validator.number().required(),
|
||||||
|
})
|
||||||
|
.xor("region_id", "currency_code")
|
||||||
|
|
||||||
|
const { value, error } = schema.validate(req.body)
|
||||||
|
if (error) {
|
||||||
|
throw new MedusaError(MedusaError.Types.INVALID_DATA, error.details)
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const productVariantService = req.scope.resolve("productVariantService")
|
||||||
|
|
||||||
|
if (value.region_id) {
|
||||||
|
const productVariant = await productVariantService.setRegionPrice(
|
||||||
|
id,
|
||||||
|
value.region_id,
|
||||||
|
value.amount
|
||||||
|
)
|
||||||
|
|
||||||
|
res.status(200).json(productVariant)
|
||||||
|
} else {
|
||||||
|
const productVariant = await productVariantService.setCurrencyPrice(
|
||||||
|
id,
|
||||||
|
value.currency_code,
|
||||||
|
value.amount
|
||||||
|
)
|
||||||
|
|
||||||
|
res.status(200).json(productVariant)
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ export default async (req, res) => {
|
|||||||
const { id } = req.params
|
const { id } = req.params
|
||||||
|
|
||||||
const schema = Validator.object().keys({
|
const schema = Validator.object().keys({
|
||||||
optionId: Validator.objectId().required(),
|
option_id: Validator.objectId().required(),
|
||||||
})
|
})
|
||||||
|
|
||||||
const { value, error } = schema.validate(req.body)
|
const { value, error } = schema.validate(req.body)
|
||||||
@@ -16,7 +16,7 @@ export default async (req, res) => {
|
|||||||
const productVariantService = req.scope.resolve("productVariantService")
|
const productVariantService = req.scope.resolve("productVariantService")
|
||||||
const productVariant = await productVariantService.deleteOptionValue(
|
const productVariant = await productVariantService.deleteOptionValue(
|
||||||
id,
|
id,
|
||||||
value.optionId
|
value.option_id
|
||||||
)
|
)
|
||||||
|
|
||||||
res.status(200).json(productVariant)
|
res.status(200).json(productVariant)
|
||||||
|
|||||||
@@ -17,15 +17,7 @@ export default app => {
|
|||||||
middlewares.wrap(require("./publish-product-variant").default)
|
middlewares.wrap(require("./publish-product-variant").default)
|
||||||
)
|
)
|
||||||
|
|
||||||
route.post(
|
route.post("/:id/prices", middlewares.wrap(require("./add-price").default))
|
||||||
"/:id/currency-price",
|
|
||||||
middlewares.wrap(require("./set-currency-price").default)
|
|
||||||
)
|
|
||||||
|
|
||||||
route.post(
|
|
||||||
"/:id/region-price",
|
|
||||||
middlewares.wrap(require("./set-region-price").default)
|
|
||||||
)
|
|
||||||
|
|
||||||
route.post(
|
route.post(
|
||||||
"/:id/options",
|
"/:id/options",
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
import { MedusaError, Validator } from "medusa-core-utils"
|
|
||||||
|
|
||||||
export default async (req, res) => {
|
|
||||||
const { id } = req.params
|
|
||||||
|
|
||||||
const schema = Validator.object().keys({
|
|
||||||
currencyCode: Validator.string().required(),
|
|
||||||
amount: Validator.number().required(),
|
|
||||||
})
|
|
||||||
|
|
||||||
const { value, error } = schema.validate(req.body)
|
|
||||||
if (error) {
|
|
||||||
throw new MedusaError(MedusaError.Types.INVALID_DATA, error.details)
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const productVariantService = req.scope.resolve("productVariantService")
|
|
||||||
const productVariant = await productVariantService.setCurrencyPrice(
|
|
||||||
id,
|
|
||||||
value.currencyCode,
|
|
||||||
value.amount
|
|
||||||
)
|
|
||||||
|
|
||||||
res.status(200).json(productVariant)
|
|
||||||
} catch (err) {
|
|
||||||
throw err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@ export default async (req, res) => {
|
|||||||
const { id } = req.params
|
const { id } = req.params
|
||||||
|
|
||||||
const schema = Validator.object().keys({
|
const schema = Validator.object().keys({
|
||||||
regionId: Validator.objectId().required(),
|
region_id: Validator.objectId().required(),
|
||||||
amount: Validator.number().required(),
|
amount: Validator.number().required(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ describe("POST /admin/products/:id/options", () => {
|
|||||||
`/admin/products/${IdMap.getId("productWithOptions")}/options`,
|
`/admin/products/${IdMap.getId("productWithOptions")}/options`,
|
||||||
{
|
{
|
||||||
payload: {
|
payload: {
|
||||||
optionTitle: "Test option",
|
option_title: "Test option",
|
||||||
},
|
},
|
||||||
adminSession: {
|
adminSession: {
|
||||||
jwt: {
|
jwt: {
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ export default async (req, res) => {
|
|||||||
])
|
])
|
||||||
res.json(data)
|
res.json(data)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
|
||||||
throw err
|
throw err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ describe("POST /admin/regions/:region_id/countries", () => {
|
|||||||
let subject
|
let subject
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
const id = IdMap.getId("region")
|
const id = IdMap.getId("testRegion")
|
||||||
subject = await request("POST", `/admin/regions/${id}/countries`, {
|
subject = await request("POST", `/admin/regions/${id}/countries`, {
|
||||||
payload: {
|
payload: {
|
||||||
country_code: "se",
|
country_code: "se",
|
||||||
@@ -27,7 +27,7 @@ describe("POST /admin/regions/:region_id/countries", () => {
|
|||||||
it("calls service addCountry", () => {
|
it("calls service addCountry", () => {
|
||||||
expect(RegionServiceMock.addCountry).toHaveBeenCalledTimes(1)
|
expect(RegionServiceMock.addCountry).toHaveBeenCalledTimes(1)
|
||||||
expect(RegionServiceMock.addCountry).toHaveBeenCalledWith(
|
expect(RegionServiceMock.addCountry).toHaveBeenCalledWith(
|
||||||
IdMap.getId("region"),
|
IdMap.getId("testRegion"),
|
||||||
"se"
|
"se"
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ describe("POST /admin/regions/:region_id/fulfillment-providers", () => {
|
|||||||
let subject
|
let subject
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
const id = IdMap.getId("region")
|
const id = IdMap.getId("testRegion")
|
||||||
subject = await request(
|
subject = await request(
|
||||||
"POST",
|
"POST",
|
||||||
`/admin/regions/${id}/fulfillment-providers`,
|
`/admin/regions/${id}/fulfillment-providers`,
|
||||||
@@ -31,7 +31,7 @@ describe("POST /admin/regions/:region_id/fulfillment-providers", () => {
|
|||||||
it("calls service addCountry", () => {
|
it("calls service addCountry", () => {
|
||||||
expect(RegionServiceMock.addFulfillmentProvider).toHaveBeenCalledTimes(1)
|
expect(RegionServiceMock.addFulfillmentProvider).toHaveBeenCalledTimes(1)
|
||||||
expect(RegionServiceMock.addFulfillmentProvider).toHaveBeenCalledWith(
|
expect(RegionServiceMock.addFulfillmentProvider).toHaveBeenCalledWith(
|
||||||
IdMap.getId("region"),
|
IdMap.getId("testRegion"),
|
||||||
"default_provider"
|
"default_provider"
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ describe("POST /admin/regions/:region_id/payment-providers", () => {
|
|||||||
let subject
|
let subject
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
const id = IdMap.getId("region")
|
const id = IdMap.getId("testRegion")
|
||||||
subject = await request(
|
subject = await request(
|
||||||
"POST",
|
"POST",
|
||||||
`/admin/regions/${id}/payment-providers`,
|
`/admin/regions/${id}/payment-providers`,
|
||||||
@@ -31,7 +31,7 @@ describe("POST /admin/regions/:region_id/payment-providers", () => {
|
|||||||
it("calls service addCountry", () => {
|
it("calls service addCountry", () => {
|
||||||
expect(RegionServiceMock.addPaymentProvider).toHaveBeenCalledTimes(1)
|
expect(RegionServiceMock.addPaymentProvider).toHaveBeenCalledTimes(1)
|
||||||
expect(RegionServiceMock.addPaymentProvider).toHaveBeenCalledWith(
|
expect(RegionServiceMock.addPaymentProvider).toHaveBeenCalledWith(
|
||||||
IdMap.getId("region"),
|
IdMap.getId("testRegion"),
|
||||||
"default_provider"
|
"default_provider"
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ describe("GET /admin/regions/:region_id", () => {
|
|||||||
let subject
|
let subject
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
const id = IdMap.getId("region")
|
const id = IdMap.getId("testRegion")
|
||||||
subject = await request("GET", `/admin/regions/${id}`, {
|
subject = await request("GET", `/admin/regions/${id}`, {
|
||||||
adminSession: {
|
adminSession: {
|
||||||
jwt: {
|
jwt: {
|
||||||
@@ -24,7 +24,7 @@ describe("GET /admin/regions/:region_id", () => {
|
|||||||
it("calls service addCountry", () => {
|
it("calls service addCountry", () => {
|
||||||
expect(RegionServiceMock.retrieve).toHaveBeenCalledTimes(1)
|
expect(RegionServiceMock.retrieve).toHaveBeenCalledTimes(1)
|
||||||
expect(RegionServiceMock.retrieve).toHaveBeenCalledWith(
|
expect(RegionServiceMock.retrieve).toHaveBeenCalledWith(
|
||||||
IdMap.getId("region")
|
IdMap.getId("testRegion")
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ describe("POST /store/carts/:id", () => {
|
|||||||
expect(LineItemServiceMock.generate).toHaveBeenCalledTimes(1)
|
expect(LineItemServiceMock.generate).toHaveBeenCalledTimes(1)
|
||||||
expect(LineItemServiceMock.generate).toHaveBeenCalledWith(
|
expect(LineItemServiceMock.generate).toHaveBeenCalledWith(
|
||||||
IdMap.getId("testVariant"),
|
IdMap.getId("testVariant"),
|
||||||
3,
|
IdMap.getId("testRegion"),
|
||||||
IdMap.getId("testRegion")
|
3
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -71,8 +71,8 @@ describe("POST /store/carts/:id", () => {
|
|||||||
expect(LineItemServiceMock.generate).toHaveBeenCalledTimes(1)
|
expect(LineItemServiceMock.generate).toHaveBeenCalledTimes(1)
|
||||||
expect(LineItemServiceMock.generate).toHaveBeenCalledWith(
|
expect(LineItemServiceMock.generate).toHaveBeenCalledWith(
|
||||||
IdMap.getId("fail"),
|
IdMap.getId("fail"),
|
||||||
3,
|
IdMap.getId("testRegion"),
|
||||||
IdMap.getId("testRegion")
|
3
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ describe("GET /store/carts", () => {
|
|||||||
expect(CartServiceMock.retrieve).toHaveBeenCalledWith("none")
|
expect(CartServiceMock.retrieve).toHaveBeenCalledWith("none")
|
||||||
})
|
})
|
||||||
|
|
||||||
it("returns products", () => {
|
it("returns 404 status", () => {
|
||||||
expect(subject.status).toEqual(404)
|
expect(subject.status).toEqual(404)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ export default async (req, res) => {
|
|||||||
|
|
||||||
const lineItem = await lineItemService.generate(
|
const lineItem = await lineItemService.generate(
|
||||||
value.variant_id,
|
value.variant_id,
|
||||||
value.quantity,
|
cart.region_id,
|
||||||
cart.region_id
|
value.quantity
|
||||||
)
|
)
|
||||||
await cartService.addLineItem(cart._id, lineItem)
|
await cartService.addLineItem(cart._id, lineItem)
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
const { id } = req.params
|
const { id } = req.params
|
||||||
|
|
||||||
|
try {
|
||||||
const cartService = req.scope.resolve("cartService")
|
const cartService = req.scope.resolve("cartService")
|
||||||
let cart = await cartService.retrieve(id)
|
let cart = await cartService.retrieve(id)
|
||||||
|
|
||||||
if (!cart) {
|
|
||||||
res.sendStatus(404)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
cart = await cartService.decorate(cart)
|
cart = await cartService.decorate(cart)
|
||||||
|
|
||||||
res.json(cart)
|
res.json(cart)
|
||||||
|
} catch (err) {
|
||||||
|
throw err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ export const orders = {
|
|||||||
quantity: 10,
|
quantity: 10,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
region: IdMap.getId("region-france"),
|
region_id: IdMap.getId("region-france"),
|
||||||
customer_id: IdMap.getId("test-customer"),
|
customer_id: IdMap.getId("test-customer"),
|
||||||
payment_method: {
|
payment_method: {
|
||||||
provider_id: "default_provider",
|
provider_id: "default_provider",
|
||||||
@@ -102,7 +102,7 @@ export const orders = {
|
|||||||
quantity: 10,
|
quantity: 10,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
region: IdMap.getId("region-france"),
|
region_id: IdMap.getId("region-france"),
|
||||||
customer_id: IdMap.getId("test-customer"),
|
customer_id: IdMap.getId("test-customer"),
|
||||||
payment_method: {
|
payment_method: {
|
||||||
provider_id: "default_provider",
|
provider_id: "default_provider",
|
||||||
@@ -182,7 +182,7 @@ export const orders = {
|
|||||||
quantity: 10,
|
quantity: 10,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
region: IdMap.getId("region-france"),
|
region_id: IdMap.getId("region-france"),
|
||||||
customer_id: IdMap.getId("test-customer"),
|
customer_id: IdMap.getId("test-customer"),
|
||||||
payment_method: {
|
payment_method: {
|
||||||
provider_id: "default_provider",
|
provider_id: "default_provider",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import LineItemSchema from "./schemas/line-item"
|
|||||||
import PaymentMethodSchema from "./schemas/payment-method"
|
import PaymentMethodSchema from "./schemas/payment-method"
|
||||||
import ShippingMethodSchema from "./schemas/shipping-method"
|
import ShippingMethodSchema from "./schemas/shipping-method"
|
||||||
import AddressSchema from "./schemas/address"
|
import AddressSchema from "./schemas/address"
|
||||||
import DiscountModel from "./discount"
|
import DiscountSchema from "./schemas/discount"
|
||||||
|
|
||||||
class CartModel extends BaseModel {
|
class CartModel extends BaseModel {
|
||||||
static modelName = "Cart"
|
static modelName = "Cart"
|
||||||
@@ -19,7 +19,7 @@ class CartModel extends BaseModel {
|
|||||||
shipping_address: { type: AddressSchema },
|
shipping_address: { type: AddressSchema },
|
||||||
items: { type: [LineItemSchema], default: [] },
|
items: { type: [LineItemSchema], default: [] },
|
||||||
region_id: { type: String, required: true },
|
region_id: { type: String, required: true },
|
||||||
discounts: { type: [DiscountModel.schema], default: [] },
|
discounts: { type: [DiscountSchema], default: [] },
|
||||||
customer_id: { type: String, default: "" },
|
customer_id: { type: String, default: "" },
|
||||||
payment_sessions: { type: [PaymentMethodSchema], default: [] },
|
payment_sessions: { type: [PaymentMethodSchema], default: [] },
|
||||||
shipping_options: { type: [ShippingMethodSchema], default: [] },
|
shipping_options: { type: [ShippingMethodSchema], default: [] },
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class OrderModel extends BaseModel {
|
|||||||
billing_address: { type: AddressSchema, required: true },
|
billing_address: { type: AddressSchema, required: true },
|
||||||
shipping_address: { type: AddressSchema, required: true },
|
shipping_address: { type: AddressSchema, required: true },
|
||||||
items: { type: [LineItemSchema], required: true },
|
items: { type: [LineItemSchema], required: true },
|
||||||
region: { type: String, required: true },
|
region_id: { type: String, required: true },
|
||||||
discounts: { type: [DiscountModel.schema], default: [] },
|
discounts: { type: [DiscountModel.schema], default: [] },
|
||||||
customer_id: { type: String, required: true },
|
customer_id: { type: String, required: true },
|
||||||
payment_method: { type: PaymentMethodSchema, required: true },
|
payment_method: { type: PaymentMethodSchema, required: true },
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import mongoose from "mongoose"
|
||||||
|
|
||||||
|
import DiscountRule from "./discount-rule"
|
||||||
|
|
||||||
|
export default new mongoose.Schema({
|
||||||
|
code: { type: String },
|
||||||
|
discount_rule: { type: DiscountRule },
|
||||||
|
usage_count: { type: Number },
|
||||||
|
disabled: { type: Boolean },
|
||||||
|
starts_at: { type: Date },
|
||||||
|
ends_at: { type: Date },
|
||||||
|
regions: { type: [String], default: [] },
|
||||||
|
metadata: { type: mongoose.Schema.Types.Mixed, default: {} },
|
||||||
|
})
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { IdMap } from "medusa-test-utils"
|
import { IdMap } from "medusa-test-utils"
|
||||||
|
|
||||||
const adminUser = {
|
const adminUser = {
|
||||||
_id: IdMap.getId("admin_user"),
|
_id: IdMap.getId("admin_user", true),
|
||||||
password: "1235",
|
password: "1235",
|
||||||
name: "hi",
|
name: "hi",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ export const CartServiceMock = {
|
|||||||
if (cartId === IdMap.getId("cartWithPaySessions")) {
|
if (cartId === IdMap.getId("cartWithPaySessions")) {
|
||||||
return Promise.resolve(carts.cartWithPaySessions)
|
return Promise.resolve(carts.cartWithPaySessions)
|
||||||
}
|
}
|
||||||
return Promise.resolve(undefined)
|
throw new MedusaError(MedusaError.Types.NOT_FOUND, "cart not found")
|
||||||
}),
|
}),
|
||||||
addLineItem: jest.fn().mockImplementation((cartId, lineItem) => {
|
addLineItem: jest.fn().mockImplementation((cartId, lineItem) => {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export const orders = {
|
|||||||
quantity: 10,
|
quantity: 10,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
region: IdMap.getId("testRegion"),
|
region_id: IdMap.getId("testRegion"),
|
||||||
customer_id: IdMap.getId("testCustomer"),
|
customer_id: IdMap.getId("testCustomer"),
|
||||||
payment_method: {
|
payment_method: {
|
||||||
provider_id: "default_provider",
|
provider_id: "default_provider",
|
||||||
@@ -94,7 +94,7 @@ export const orders = {
|
|||||||
quantity: 10,
|
quantity: 10,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
region: IdMap.getId("region-france"),
|
region_id: IdMap.getId("region-france"),
|
||||||
customer_id: IdMap.getId("test-customer"),
|
customer_id: IdMap.getId("test-customer"),
|
||||||
payment_method: {
|
payment_method: {
|
||||||
provider_id: "default_provider",
|
provider_id: "default_provider",
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ const emptyVariant = {
|
|||||||
|
|
||||||
const eur10us12 = {
|
const eur10us12 = {
|
||||||
_id: IdMap.getId("eur-10-us-12"),
|
_id: IdMap.getId("eur-10-us-12"),
|
||||||
|
title: "EUR10US-12",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const variants = {
|
export const variants = {
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ export const ProductServiceMock = {
|
|||||||
{
|
{
|
||||||
_id: "1234",
|
_id: "1234",
|
||||||
title: "test",
|
title: "test",
|
||||||
|
thumbnail: "test.1234",
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,18 +21,21 @@ export const regions = {
|
|||||||
},
|
},
|
||||||
regionUs: {
|
regionUs: {
|
||||||
_id: IdMap.getId("region-us"),
|
_id: IdMap.getId("region-us"),
|
||||||
|
tax_rate: 0.25,
|
||||||
name: "USA",
|
name: "USA",
|
||||||
countries: ["US"],
|
countries: ["US"],
|
||||||
currency_code: "usd",
|
currency_code: "usd",
|
||||||
},
|
},
|
||||||
regionGermany: {
|
regionGermany: {
|
||||||
_id: IdMap.getId("region-de"),
|
_id: IdMap.getId("region-de"),
|
||||||
|
tax_rate: 0.25,
|
||||||
name: "Germany",
|
name: "Germany",
|
||||||
countries: ["DE"],
|
countries: ["DE"],
|
||||||
currency_code: "eur",
|
currency_code: "eur",
|
||||||
},
|
},
|
||||||
regionSweden: {
|
regionSweden: {
|
||||||
_id: IdMap.getId("region-se"),
|
_id: IdMap.getId("region-se"),
|
||||||
|
tax_rate: 0.25,
|
||||||
name: "Sweden",
|
name: "Sweden",
|
||||||
countries: ["SE"],
|
countries: ["SE"],
|
||||||
currency_code: "sek",
|
currency_code: "sek",
|
||||||
@@ -56,7 +59,7 @@ export const RegionServiceMock = {
|
|||||||
if (regionId === IdMap.getId("region-se")) {
|
if (regionId === IdMap.getId("region-se")) {
|
||||||
return Promise.resolve(regions.regionSweden)
|
return Promise.resolve(regions.regionSweden)
|
||||||
}
|
}
|
||||||
return Promise.resolve(undefined)
|
throw Error(regionId + "not found")
|
||||||
}),
|
}),
|
||||||
delete: jest.fn().mockImplementation(data => Promise.resolve()),
|
delete: jest.fn().mockImplementation(data => Promise.resolve()),
|
||||||
create: jest.fn().mockImplementation(data => Promise.resolve()),
|
create: jest.fn().mockImplementation(data => Promise.resolve()),
|
||||||
|
|||||||
@@ -24,24 +24,22 @@ describe("LineItemService", () => {
|
|||||||
|
|
||||||
it("generates line item and successfully defaults quantity of content to 1", () => {
|
it("generates line item and successfully defaults quantity of content to 1", () => {
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
|
title: "test",
|
||||||
|
description: "EUR10US-12",
|
||||||
|
thumbnail: "test.1234",
|
||||||
content: {
|
content: {
|
||||||
unit_price: 10,
|
unit_price: 10,
|
||||||
variant: {
|
variant: {
|
||||||
_id: IdMap.getId("eur-10-us-12"),
|
_id: IdMap.getId("eur-10-us-12"),
|
||||||
|
title: "EUR10US-12",
|
||||||
},
|
},
|
||||||
product: {
|
product: {
|
||||||
_id: "1234",
|
_id: "1234",
|
||||||
title: "test",
|
title: "test",
|
||||||
|
thumbnail: "test.1234",
|
||||||
},
|
},
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
},
|
},
|
||||||
product: {
|
|
||||||
_id: "1234",
|
|
||||||
title: "test",
|
|
||||||
},
|
|
||||||
variant: {
|
|
||||||
_id: IdMap.getId("eur-10-us-12"),
|
|
||||||
},
|
|
||||||
quantity: 2,
|
quantity: 2,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class CartService extends BaseService {
|
|||||||
shippingOptionService,
|
shippingOptionService,
|
||||||
shippingProfileService,
|
shippingProfileService,
|
||||||
discountService,
|
discountService,
|
||||||
|
totalsService,
|
||||||
}) {
|
}) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
@@ -55,6 +56,9 @@ class CartService extends BaseService {
|
|||||||
|
|
||||||
/** @private @const {DiscountService} */
|
/** @private @const {DiscountService} */
|
||||||
this.discountService_ = discountService
|
this.discountService_ = discountService
|
||||||
|
|
||||||
|
/** @private @const {DiscountService} */
|
||||||
|
this.totalsService_ = totalsService
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,7 +68,7 @@ class CartService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
validateId_(rawId) {
|
validateId_(rawId) {
|
||||||
const schema = Validator.objectId()
|
const schema = Validator.objectId()
|
||||||
const { value, error } = schema.validate(rawId)
|
const { value, error } = schema.validate(rawId.toString())
|
||||||
if (error) {
|
if (error) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_ARGUMENT,
|
MedusaError.Types.INVALID_ARGUMENT,
|
||||||
@@ -221,7 +225,9 @@ class CartService extends BaseService {
|
|||||||
* @return {Cart} return the decorated cart.
|
* @return {Cart} return the decorated cart.
|
||||||
*/
|
*/
|
||||||
async decorate(cart, fields, expandFields = []) {
|
async decorate(cart, fields, expandFields = []) {
|
||||||
return cart
|
const c = cart.toObject()
|
||||||
|
c.total = await this.totalsService_.getTotal(cart)
|
||||||
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -101,9 +101,10 @@ class LineItemService extends BaseService {
|
|||||||
)
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
variant,
|
title: product.title,
|
||||||
product,
|
description: variant.title,
|
||||||
quantity,
|
quantity,
|
||||||
|
thumbnail: product.thumbnail,
|
||||||
content: {
|
content: {
|
||||||
unit_price,
|
unit_price,
|
||||||
variant,
|
variant,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class ProductVariantService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
validateId_(rawId) {
|
validateId_(rawId) {
|
||||||
const schema = Validator.objectId()
|
const schema = Validator.objectId()
|
||||||
const { value, error } = schema.validate(rawId)
|
const { value, error } = schema.validate(rawId.toString())
|
||||||
if (error) {
|
if (error) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_ARGUMENT,
|
MedusaError.Types.INVALID_ARGUMENT,
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class ProductService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
validateId_(rawId) {
|
validateId_(rawId) {
|
||||||
const schema = Validator.objectId()
|
const schema = Validator.objectId()
|
||||||
const { value, error } = schema.validate(rawId)
|
const { value, error } = schema.validate(rawId.toString())
|
||||||
if (error) {
|
if (error) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_ARGUMENT,
|
MedusaError.Types.INVALID_ARGUMENT,
|
||||||
@@ -193,7 +193,7 @@ class ProductService extends BaseService {
|
|||||||
})
|
})
|
||||||
|
|
||||||
let combinationExists = false
|
let combinationExists = false
|
||||||
if (product.variants) {
|
if (product.variants && product.variants.length) {
|
||||||
// Check if option value of the variant to add already exists. Go through
|
// Check if option value of the variant to add already exists. Go through
|
||||||
// each existing variant. Check if this variants option values are
|
// each existing variant. Check if this variants option values are
|
||||||
// identical to the option values of the variant being added.
|
// identical to the option values of the variant being added.
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class RegionService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
validateId_(rawId) {
|
validateId_(rawId) {
|
||||||
const schema = Validator.objectId()
|
const schema = Validator.objectId()
|
||||||
const { value, error } = schema.validate(rawId)
|
const { value, error } = schema.validate(rawId.toString())
|
||||||
if (error) {
|
if (error) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_ARGUMENT,
|
MedusaError.Types.INVALID_ARGUMENT,
|
||||||
@@ -195,6 +195,16 @@ class RegionService extends BaseService {
|
|||||||
return region
|
return region
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lists all regions based on a query
|
||||||
|
* @param {string} regionId - the id of the region to retrieve
|
||||||
|
* @return {Region} the region
|
||||||
|
*/
|
||||||
|
async list(query) {
|
||||||
|
const regions = await this.regionModel_.find(query)
|
||||||
|
return regions
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a region.
|
* Deletes a region.
|
||||||
* @param {string} regionId - the region to delete
|
* @param {string} regionId - the region to delete
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class TotalsService extends BaseService {
|
|||||||
async getTaxTotal(object) {
|
async getTaxTotal(object) {
|
||||||
const subtotal = this.getSubtotal(object)
|
const subtotal = this.getSubtotal(object)
|
||||||
const shippingTotal = this.getShippingTotal(object)
|
const shippingTotal = this.getShippingTotal(object)
|
||||||
const region = await this.regionService_.retrieve(object.region)
|
const region = await this.regionService_.retrieve(object.region_id)
|
||||||
const { tax_rate } = region
|
const { tax_rate } = region
|
||||||
return (subtotal + shippingTotal) * tax_rate
|
return (subtotal + shippingTotal) * tax_rate
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ class TotalsService extends BaseService {
|
|||||||
|
|
||||||
const subtotal = this.getSubtotal({ items: lineItems })
|
const subtotal = this.getSubtotal({ items: lineItems })
|
||||||
|
|
||||||
const region = await this.regionService_.retrieve(order.region)
|
const region = await this.regionService_.retrieve(order.region_id)
|
||||||
|
|
||||||
// if nothing is discounted, return the subtotal of line items
|
// if nothing is discounted, return the subtotal of line items
|
||||||
if (!discount) {
|
if (!discount) {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class UserService extends BaseService {
|
|||||||
*/
|
*/
|
||||||
validateId_(rawId) {
|
validateId_(rawId) {
|
||||||
const schema = Validator.objectId()
|
const schema = Validator.objectId()
|
||||||
const { value, error } = schema.validate(rawId)
|
const { value, error } = schema.validate(rawId.toString())
|
||||||
if (error) {
|
if (error) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.INVALID_ARGUMENT,
|
MedusaError.Types.INVALID_ARGUMENT,
|
||||||
|
|||||||
@@ -4522,14 +4522,6 @@ media-typer@0.3.0:
|
|||||||
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
|
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
|
||||||
integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
|
integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
|
||||||
|
|
||||||
medusa-core-utils@^0.3.0:
|
|
||||||
version "0.1.39"
|
|
||||||
resolved "https://registry.yarnpkg.com/medusa-core-utils/-/medusa-core-utils-0.1.39.tgz#d57816c9bd43f9a92883650c1e66add1665291df"
|
|
||||||
integrity sha512-R8+U1ile7if+nR6Cjh5exunx0ETV0OfkWUUBUpz1KmHSDv0V0CcvQqU9lcZesPFDEbu3Y2iEjsCqidVA4nG2nQ==
|
|
||||||
dependencies:
|
|
||||||
"@hapi/joi" "^16.1.8"
|
|
||||||
joi-objectid "^3.0.1"
|
|
||||||
|
|
||||||
medusa-interfaces@^0.1.27:
|
medusa-interfaces@^0.1.27:
|
||||||
version "0.1.27"
|
version "0.1.27"
|
||||||
resolved "https://registry.yarnpkg.com/medusa-interfaces/-/medusa-interfaces-0.1.27.tgz#e77f9a9f82a7118eac8b35c1498ef8a5cec78898"
|
resolved "https://registry.yarnpkg.com/medusa-interfaces/-/medusa-interfaces-0.1.27.tgz#e77f9a9f82a7118eac8b35c1498ef8a5cec78898"
|
||||||
@@ -4537,13 +4529,6 @@ medusa-interfaces@^0.1.27:
|
|||||||
dependencies:
|
dependencies:
|
||||||
mongoose "^5.8.0"
|
mongoose "^5.8.0"
|
||||||
|
|
||||||
medusa-test-utils@^0.3.0:
|
|
||||||
version "0.1.39"
|
|
||||||
resolved "https://registry.yarnpkg.com/medusa-test-utils/-/medusa-test-utils-0.1.39.tgz#b7c166006a2fa4f02e52ab3bfafc19a3ae787f3e"
|
|
||||||
integrity sha512-M/Br8/HYvl7x2oLnme4NxdQwoyV0XUyOWiCyvPp7q1HUTB684lhJf1MikZVrcSjsh2L1rpyi3GRbKdf4cpJWvw==
|
|
||||||
dependencies:
|
|
||||||
mongoose "^5.8.0"
|
|
||||||
|
|
||||||
memory-pager@^1.0.2:
|
memory-pager@^1.0.2:
|
||||||
version "1.5.0"
|
version "1.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5"
|
resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5"
|
||||||
|
|||||||
Reference in new issue
Block a user