-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(condo): DOMA-10773 sendB2BAppPushMessage mutation and pass ticket created message #5667
base: main
Are you sure you want to change the base?
feat(condo): DOMA-10773 sendB2BAppPushMessage mutation and pass ticket created message #5667
Conversation
d203f2b
to
e98f206
Compare
}, | ||
|
||
isBlacklisted: { | ||
schemaDoc: 'Is message type in black list for this B2CApp', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schemaDoc: 'Is message type in black list for this B2CApp', | |
schemaDoc: 'Is message type in black list for this miniapp', |
b2cApp, | ||
}) | ||
|
||
const objs = await AppMessageSetting.getAll(admin, {}, { sortBy: ['updatedAt_DESC'] }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better add filter by id
b2cApp, | ||
}) | ||
|
||
const objs = await AppMessageSetting.getAll(support, {}, { sortBy: ['updatedAt_DESC'] }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^
test('can\'t read', async () => { | ||
const objs = await AppMessageSetting.getAll(user, {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better create a new object and filter by id
}) | ||
|
||
test('can update', async () => { | ||
const [b2cApp] = await createTestB2CApp(admin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You create a miniapp before each test, this line can be removed
const [b2cApp] = await createTestB2CApp(admin) |
const userEmployees = await find('OrganizationEmployee', { | ||
deletedAt: null, | ||
organization: { deletedAt: null }, | ||
role: { deletedAt: null }, | ||
user: { id: user.id }, | ||
isBlocked: false, | ||
isRejected: false, | ||
}) | ||
const organizationIds = uniq(userEmployees.map(employee => employee.organization)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use getEmployedOrganizationsByPermissions
?
to: { user: userFilter }, | ||
organization: organizationFilter, | ||
type, | ||
lang: get(organization, ['country', 'locale'], conf.DEFAULT_LOCALE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use the organization locale or the user locale?
organization: organizationFilter, | ||
app: b2bAppFilter, | ||
type, | ||
meta, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will a third party developer know what data needs to be passed to the meta? Is there any documentation?
mutations: [ | ||
{ | ||
access: access.canSendB2BAppPushMessage, | ||
schema: 'sendB2BAppPushMessage(data: SendB2BAppPushMessageInput!): SendB2BAppPushMessageOutput', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a few lines of documentation for this mutation?
await sendB2BAppPushMessageByTestClient(serviceUser, b2bApp, organization, staffClient.user, { | ||
type: TICKET_CREATED_TYPE, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TICKET_CREATED_TYPE
for sendB2BAppPushMessage?
apps/condo/lang/es/es.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Spanish there shouldn't be all the templates, just the default?
…ET_CREATED_MESSAGE_TYPE for Message
…ing, rename app field to b2cApp, added b2bApp field
…PushMessageService, wrote tests
…create AppMessageSetting
cc3932b
to
f176861
Compare
Quality Gate passedIssues Measures |
In this pr:
sendB2BAppPushMessage
mutation that allow to send messages from B2BApp. AddedcanExecuteSendB2BAppPushMessage
andcanReadOrganizationEmployees
toB2BAppAccessRightSet
B2CAppMessageSetting
toAppMessageSetting
(DROP old table and CREATE new table for recreate all indexes, migrate data from old table to new). Renameapp
field tob2cApp
, addedb2bApp
toAppMessageSetting
.Added read accesses for staff user who is employee in organization with b2bApp from
AppMessageSetting.b2bApp
B2B_APP_MESSAGE_PUSH
andPASS_TICKET_CREATED
message typesAlso tasks related to this feature:
defaultContent
toMessage
schema