Multi-environment and multi-user construction

This commit is contained in:
2026-09-15 21:37:58 +03:30
parent e61fad95c6
commit d3f97b9dc4
37 changed files with 1349 additions and 201 deletions
@@ -96,10 +96,24 @@ export class ChequeRemindersService {
const staff = await this.prisma.user.findMany({
where: {
organizationId: row.organizationId,
OR: [
{ role: { in: ['owner', 'admin'] } },
...(row.ownerId ? [{ id: row.ownerId }] : []),
{
memberships: {
some: {
organizationId: row.organizationId,
role: { in: ['owner', 'admin'] },
isActive: true,
},
},
},
...(row.ownerId
? [
{
id: row.ownerId,
memberships: { some: { organizationId: row.organizationId } },
},
]
: []),
],
},
select: { id: true, mobile: true },