update models and create consumer domain accounts permissions

This commit is contained in:
2026-04-11 14:47:05 +03:30
parent 89726c8904
commit 9cef733370
87 changed files with 2967 additions and 3352 deletions
+21 -3
View File
@@ -1,5 +1,6 @@
import { PosInfo } from '@/common/decorators/posInfo.decorator'
import { Controller, Get } from '@nestjs/common'
import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
import { Controller, Get, Res } from '@nestjs/common'
import { ApiTags } from '@nestjs/swagger'
import { PosService } from './pos.service'
@@ -9,7 +10,24 @@ export class PosController {
constructor(private service: PosService) {}
@Get()
async getInfo(@PosInfo('pos_id') pos_id: string) {
return await this.service.getInfo(pos_id)
async getInfo(@PosInfo('pos_id') pos_id: string, @Res({ passthrough: true }) res) {
const result = await this.service.getInfo(pos_id)
if (result) {
// @ts-ignore
res.cookie('posId', pos_id, {
httpOnly: true,
secure: process.env.NODE_ENV === 'production',
sameSite: 'lax',
maxAge: 1000 * 60 * 60 * 24 * 7, // 7 days
})
}
return result
}
@Get('/accessible')
async getAccessiblePos(@TokenAccount('account_id') account_id) {
return await this.service.getAccessible(account_id)
}
}