From b8833055b2c51815a5ee1aa99bd2f1a23e161628 Mon Sep 17 00:00:00 2001 From: --list Date: Thu, 3 Jun 2021 12:07:03 +0200 Subject: [PATCH] began impl. of no_notification --- .../src/api/routes/store/returns/create-return.js | 9 ++------- .../src/migrations/1622713782458-no_notification.ts | 11 +++++++++++ packages/medusa/src/models/claim-order.ts | 3 +++ packages/medusa/src/models/order.ts | 3 +++ packages/medusa/src/models/return.ts | 3 +++ packages/medusa/src/models/swap.ts | 3 +++ 6 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 packages/medusa/src/migrations/1622713782458-no_notification.ts diff --git a/packages/medusa/src/api/routes/store/returns/create-return.js b/packages/medusa/src/api/routes/store/returns/create-return.js index c61727c4c5..1101dbd08e 100644 --- a/packages/medusa/src/api/routes/store/returns/create-return.js +++ b/packages/medusa/src/api/routes/store/returns/create-return.js @@ -31,9 +31,6 @@ import { MedusaError, Validator } from "medusa-core-utils" * option_id: * type: string * description: The id of the Shipping Option to create the Shipping Method from. - * no_notification: - * description: If set to true no notification will be send - * type: boolean * * tags: * - Return @@ -62,8 +59,7 @@ export default async (req, res) => { .keys({ option_id: Validator.string().optional(), }) - .optional(), - no_notification: Validator.boolean().optional() + .optional() }) const { value, error } = schema.validate(req.body) @@ -136,8 +132,7 @@ export default async (req, res) => { .withTransaction(manager) .emit("order.return_requested", { id: value.order_id, - return_id: createdReturn.id, - no_notification: no_notification + return_id: createdReturn.id }) return { diff --git a/packages/medusa/src/migrations/1622713782458-no_notification.ts b/packages/medusa/src/migrations/1622713782458-no_notification.ts new file mode 100644 index 0000000000..0e0ac4ef00 --- /dev/null +++ b/packages/medusa/src/migrations/1622713782458-no_notification.ts @@ -0,0 +1,11 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class noNotification1622713782458 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + } + + public async down(queryRunner: QueryRunner): Promise { + } + +} diff --git a/packages/medusa/src/models/claim-order.ts b/packages/medusa/src/models/claim-order.ts index 91ab66b450..c5c8ec430b 100644 --- a/packages/medusa/src/models/claim-order.ts +++ b/packages/medusa/src/models/claim-order.ts @@ -226,6 +226,9 @@ export class ClaimOrder { * deleted_at: * type: string * format: date-time + * no_notification: + * description: "Flag for describing whether or not notifications related to this should be send." + * type: boolean * metadata: * type: object */ diff --git a/packages/medusa/src/models/order.ts b/packages/medusa/src/models/order.ts index 10258270d9..6aab13bc40 100644 --- a/packages/medusa/src/models/order.ts +++ b/packages/medusa/src/models/order.ts @@ -417,4 +417,7 @@ export class Order { * type: integer * paid_total: * type: integer + * no_notification: + * description: "Flag for describing whether or not notifications related to this should be send." + * type: boolean */ diff --git a/packages/medusa/src/models/return.ts b/packages/medusa/src/models/return.ts index 98a52122b9..c79d012646 100644 --- a/packages/medusa/src/models/return.ts +++ b/packages/medusa/src/models/return.ts @@ -168,6 +168,9 @@ export class Return { * description: "The date with timezone at which the resource was last updated." * type: string * format: date-time + * no_notification: + * description: "Flag for describing whether or not notifications related to this should be send." + * type: boolean * metadata: * description: "An optional key-value map with additional information." * type: object diff --git a/packages/medusa/src/models/swap.ts b/packages/medusa/src/models/swap.ts index e0c173c1ba..f8c8bc8aee 100644 --- a/packages/medusa/src/models/swap.ts +++ b/packages/medusa/src/models/swap.ts @@ -227,6 +227,9 @@ export class Swap { * description: "The date with timezone at which the resource was last updated." * type: string * format: date-time + * no_notification: + * description: "Flag for describing whether or not notifications related to this should be send." + * type: boolean * metadata: * description: "An optional key-value map with additional information." * type: object