change source of account id in prepared token to domain account id, create consumer salesInvoiceModule

This commit is contained in:
2026-03-30 13:16:36 +03:30
parent c870a43e35
commit 9cf9209daa
22 changed files with 758 additions and 142 deletions
+4 -8
View File
@@ -60,7 +60,7 @@ export class PosGuard implements CanActivate {
user: {
accounts: {
some: {
account_id: account.account_id,
id: account.account_id,
},
},
},
@@ -81,20 +81,16 @@ export class PosGuard implements CanActivate {
throw new ForbiddenException('شما دسترسی لازم را ندارید.')
}
const foundedAccount = await this.prisma.account.findUnique({
const foundedAccount = await this.prisma.consumerAccount.findUnique({
where: {
id: account.account_id,
},
select: {
consumer_account: {
select: {
role: true,
},
},
role: true,
},
})
if (foundedAccount?.consumer_account?.role === 'OWNER') {
if (foundedAccount?.role === 'OWNER') {
return true
}