fix: adjustments based on feedback

rename RMAShippingOption to CustomShippingOption
update models and relations
update unit and integration tests
update services
This commit is contained in:
zakariaelas
2021-10-06 14:17:36 +01:00
parent db83448d18
commit 52be911e50
29 changed files with 467 additions and 604 deletions
+9 -9
View File
@@ -101,7 +101,7 @@ module.exports = async (connection, data = {}) => {
await manager.save(swap)
const rmaCart = manager.create(Cart, {
const cartWithCustomSo = manager.create(Cart, {
id: "test-cart-rma",
customer_id: "test-customer",
email: "test-customer@email.com",
@@ -109,20 +109,26 @@ module.exports = async (connection, data = {}) => {
billing_address_id: "test-billing-address",
region_id: "test-region",
type: "swap",
custom_shipping_options: [
{
shipping_option_id: "test-option",
price: 0,
},
],
metadata: {
swap_id: "test-swap",
parent_order_id: orderWithSwap.id,
},
})
await manager.save(rmaCart)
await manager.save(cartWithCustomSo)
const swapWithRMAMethod = manager.create(Swap, {
id: "test-swap-rma",
order_id: "order-with-swap",
payment_status: "captured",
fulfillment_status: "fulfilled",
cart_id: "test-cart-rma",
cart_id: cartWithCustomSo.id,
payment: {
id: "test-payment-swap",
amount: 10000,
@@ -144,12 +150,6 @@ module.exports = async (connection, data = {}) => {
cart_id: "test-cart",
},
],
rma_shipping_options: [
{
shipping_option_id: "test-option",
price: 0,
},
],
})
await manager.save(swapWithRMAMethod)