From f8405159447a003afc8fdb048a7f3a5f403b8196 Mon Sep 17 00:00:00 2001 From: "it@app-quality.com" Date: Fri, 12 Dec 2025 15:56:26 +0100 Subject: [PATCH 1/5] Modified src/reference/openapi.yml --- src/reference/openapi.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/reference/openapi.yml b/src/reference/openapi.yml index eaf818ca0..e5dc569a7 100644 --- a/src/reference/openapi.yml +++ b/src/reference/openapi.yml @@ -6048,6 +6048,7 @@ paths: - string notes: string notify_everyone: 0 + ux_notify: 1 outOfScope: string productLink: string productType: 0 @@ -6068,8 +6069,10 @@ paths: schema: allOf: - $ref: '#/components/schemas/DossierCreationData' - - properties: + - type: object + properties: duplicate: + type: object properties: campaign: type: integer @@ -6083,9 +6086,8 @@ paths: type: integer useCases: type: integer - type: object - type: object - - properties: + - type: object + properties: autoApply: maximum: 1 minimum: 0 @@ -6115,14 +6117,20 @@ paths: maximum: 1 minimum: 0 type: integer - type: object - - properties: + - type: object + properties: notify_everyone: default: 0 enum: - 0 - 1 - type: object + ux_notify: + type: integer + x-stoplight: + id: 0gogh4w9jbf6i + minimum: 0 + maximum: 1 + example: 1 responses: '201': content: From ab88a6c95e1c10c3b68704dba70ea1af0ad1a94e Mon Sep 17 00:00:00 2001 From: Kariamos Date: Tue, 16 Dec 2025 10:02:11 +0100 Subject: [PATCH 2/5] feat: add ux_notify field to operations interface for UX notifications --- src/schema.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/schema.ts b/src/schema.ts index 7fa5eb36c..05530f136 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -2994,6 +2994,8 @@ export interface operations { } & { /** @enum {undefined} */ notify_everyone?: 0 | 1; + /** @example 1 */ + ux_notify?: number; }; }; }; From 59c42dbf3f188f143153b57a64c9aa722f47b313 Mon Sep 17 00:00:00 2001 From: Kariamos Date: Tue, 16 Dec 2025 10:40:50 +0100 Subject: [PATCH 3/5] wip: handle ux notifications on campaign --- src/routes/dossiers/_post/creation.spec.ts | 27 ++++++++++++++++++++++ src/routes/dossiers/_post/index.ts | 20 +++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/routes/dossiers/_post/creation.spec.ts b/src/routes/dossiers/_post/creation.spec.ts index 7e95b1c7a..b0d779a58 100644 --- a/src/routes/dossiers/_post/creation.spec.ts +++ b/src/routes/dossiers/_post/creation.spec.ts @@ -1362,5 +1362,32 @@ describe("Route POST /dossiers", () => { ]) ); }); + + it("Should insert send_ux_notification = 1 if ux_notify = 1 is passed", async () => { + const postResponse = await request(app) + .post("/dossiers") + .set("authorization", "Bearer admin") + .send({ ...baseRequest, ux_notify: 1 }); + + const data = await tryber.tables.WpAppqEvdCampaign.do() + .select("send_ux_notification") + .where({ id: postResponse.body.id }) + .first(); + + expect(data).toHaveProperty("send_ux_notification", 1); + }); + + it("Should insert send_ux_notification = 0 if ux_notify is not passed", async () => { + const postResponse = await request(app) + .post("/dossiers") + .set("authorization", "Bearer admin") + .send({ ...baseRequest }); + const data = await tryber.tables.WpAppqEvdCampaign.do() + .select("send_ux_notification") + .where({ id: postResponse.body.id }) + .first(); + + expect(data).toHaveProperty("send_ux_notification", 0); + }); }); }); diff --git a/src/routes/dossiers/_post/index.ts b/src/routes/dossiers/_post/index.ts index b7b5d8fb3..cedadc785 100644 --- a/src/routes/dossiers/_post/index.ts +++ b/src/routes/dossiers/_post/index.ts @@ -103,7 +103,8 @@ export default class PostDossiers extends UserRoute<{ } protected async prepare(): Promise { - const { skipPagesAndTasks, bugLanguage, notify_everyone } = this.getBody(); + const { skipPagesAndTasks, bugLanguage, notify_everyone, ux_notify } = + this.getBody(); try { const campaignId = await this.createCampaign(); @@ -121,6 +122,10 @@ export default class PostDossiers extends UserRoute<{ await this.setupNotifications(campaignId); } + if (ux_notify === 1) { + await this.enableUXTaskNotifications(campaignId); + } + const webhook = new WebhookTrigger({ type: "campaign_created", data: { @@ -894,6 +899,19 @@ export default class PostDossiers extends UserRoute<{ } } + private async enableUXTaskNotifications(campaignId: number) { + try { + await tryber.tables.WpAppqEvdCampaign.do() + .update({ + send_ux_notifications: 1, + }) + .where("id", campaignId); + } catch (error) { + console.error("Error enabling UX task notifications:", error); + return; + } + } + private async retrieveProjectAndWorkspaceUsers(): Promise< { users: { id: number }[] } | undefined > { From 42c6285a283ab749d8114aa12dd787d322073de0 Mon Sep 17 00:00:00 2001 From: Kariamos Date: Tue, 16 Dec 2025 11:18:50 +0100 Subject: [PATCH 4/5] updated db version --- package.json | 2 +- yarn.lock | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 432700c51..7a9f63047 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "author": "", "license": "ISC", "dependencies": { - "@appquality/tryber-database": "^0.46.4", + "@appquality/tryber-database": "^0.46.9", "@appquality/wp-auth": "^1.0.7", "@aws-crypto/sha256-js": "^5.2.0", "@aws-sdk/hash-node": "^3.374.0", diff --git a/yarn.lock b/yarn.lock index 41dc7e721..39ef0fa85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28,13 +28,13 @@ "@babel/parser" "^7.22.5" "@babel/traverse" "^7.22.5" -"@appquality/tryber-database@^0.46.4": - version "0.46.4" - resolved "https://registry.yarnpkg.com/@appquality/tryber-database/-/tryber-database-0.46.4.tgz#5ff0c9459aa19a7428b2817d00618971e70df3a4" - integrity sha512-ohjjM8lwEHQaO+Tk9k5irJF3mUAEZ/Sm4E1e7w8FpC3OmFUuQhXQgY4zVKa+BdBYAXm/ADErgfzdQ2FXrupSuA== +"@appquality/tryber-database@^0.46.9": + version "0.46.9" + resolved "https://registry.yarnpkg.com/@appquality/tryber-database/-/tryber-database-0.46.9.tgz#a3e600157144828f2aa82672e82d0fee177e0069" + integrity sha512-uXknjuEU1VevX1ozv47j0rK6wqK7DgCzEYG1gbQNs1NXVrFb9X+tR82BmTMiBP1FY3Aqov5Zu61KvoZw9zvDww== dependencies: - better-sqlite3 "^8.1.0" - knex "^2.5.1" + better-sqlite3 "^12.5.0" + knex "^3.1.0" mysql "^2.18.1" "@appquality/wp-auth@^1.0.7": @@ -2415,10 +2415,10 @@ better-sqlite3@^11.9.1: bindings "^1.5.0" prebuild-install "^7.1.1" -better-sqlite3@^8.1.0: - version "8.7.0" - resolved "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.7.0.tgz#bcc341856187b1d110a8a47234fa89c48c8ef538" - integrity sha512-99jZU4le+f3G6aIl6PmmV0cxUIWqKieHxsiF7G34CVFiE+/UabpYqkU0NJIkY/96mQKikHeBjtR27vFfs5JpEw== +better-sqlite3@^12.5.0: + version "12.5.0" + resolved "https://registry.yarnpkg.com/better-sqlite3/-/better-sqlite3-12.5.0.tgz#c570873d9635b5d56baa52f7e72634c2c589f35f" + integrity sha512-WwCZ/5Diz7rsF29o27o0Gcc1Du+l7Zsv7SYtVPG0X3G/uUI1LqdxrQI7c9Hs2FWpqXXERjW9hp6g3/tH7DlVKg== dependencies: bindings "^1.5.0" prebuild-install "^7.1.1" @@ -4724,10 +4724,10 @@ kleur@^3.0.3: resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -knex@^2.5.1: - version "2.5.1" - resolved "https://registry.npmjs.org/knex/-/knex-2.5.1.tgz#a6c6b449866cf4229f070c17411f23871ba52ef9" - integrity sha512-z78DgGKUr4SE/6cm7ku+jHvFT0X97aERh/f0MUKAKgFnwCYBEW4TFBqtHWFYiJFid7fMrtpZ/gxJthvz5mEByA== +knex@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/knex/-/knex-3.1.0.tgz#b6ddd5b5ad26a6315234a5b09ec38dc4a370bd8c" + integrity sha512-GLoII6hR0c4ti243gMs5/1Rb3B+AjwMOfjYm97pu0FOQa7JH56hgBxYf5WK2525ceSbBY1cjeZ9yk99GPMB6Kw== dependencies: colorette "2.0.19" commander "^10.0.0" @@ -4738,7 +4738,7 @@ knex@^2.5.1: getopts "2.3.0" interpret "^2.2.0" lodash "^4.17.21" - pg-connection-string "2.6.1" + pg-connection-string "2.6.2" rechoir "^0.8.0" resolve-from "^5.0.0" tarn "^3.0.2" @@ -5575,10 +5575,10 @@ path-type@^4.0.0: resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pg-connection-string@2.6.1: - version "2.6.1" - resolved "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.1.tgz#78c23c21a35dd116f48e12e23c0965e8d9e2cbfb" - integrity sha512-w6ZzNu6oMmIzEAYVw+RLK0+nqHPt8K3ZnknKi+g48Ak2pr3dtljJW3o+D/n2zzCG07Zoe9VOX3aiKpj+BN0pjg== +pg-connection-string@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.6.2.tgz#713d82053de4e2bd166fab70cd4f26ad36aab475" + integrity sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA== php-serialize@^4.1.1: version "4.1.1" From 3810a7a77c47d79042738324e4ee1adb49d8aa5e Mon Sep 17 00:00:00 2001 From: Kariamos Date: Tue, 16 Dec 2025 11:19:04 +0100 Subject: [PATCH 5/5] fix: correct field name for UX notification in campaign update --- src/routes/dossiers/_post/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/dossiers/_post/index.ts b/src/routes/dossiers/_post/index.ts index cedadc785..a26e1824c 100644 --- a/src/routes/dossiers/_post/index.ts +++ b/src/routes/dossiers/_post/index.ts @@ -903,7 +903,7 @@ export default class PostDossiers extends UserRoute<{ try { await tryber.tables.WpAppqEvdCampaign.do() .update({ - send_ux_notifications: 1, + send_ux_notification: 1, }) .where("id", campaignId); } catch (error) {