Adding a task generated from the account balance to products
This commit is contained in:
@@ -15,17 +15,21 @@ import { Roles } from '../../auth/roles.decorator';
|
||||
import { RolesGuard } from '../../auth/roles.guard';
|
||||
import { TahesabConnectionsService } from './connections.service';
|
||||
import { TahesabPersonLinkService } from './person-link.service';
|
||||
import { TahesabProductLinkService } from './product-link.service';
|
||||
import { TahesabBalanceService } from './balance.service';
|
||||
import { TahesabDocumentsService } from './documents.service';
|
||||
import {
|
||||
CreateInTahesabDto,
|
||||
CreateTahesabConnectionDto,
|
||||
ImportBulkFromTahesabDto,
|
||||
ImportBulkProductsFromTahesabDto,
|
||||
ImportFromTahesabDto,
|
||||
ImportProductFromTahesabDto,
|
||||
ManualLinkDto,
|
||||
MatchPersonDto,
|
||||
PushSanadDto,
|
||||
SearchTahesabDto,
|
||||
SearchTahesabProductsDto,
|
||||
UpdateTahesabConnectionDto,
|
||||
} from './dto';
|
||||
|
||||
@@ -35,6 +39,7 @@ export class TahesabController {
|
||||
constructor(
|
||||
private readonly connections: TahesabConnectionsService,
|
||||
private readonly links: TahesabPersonLinkService,
|
||||
private readonly products: TahesabProductLinkService,
|
||||
private readonly balance: TahesabBalanceService,
|
||||
private readonly documents: TahesabDocumentsService,
|
||||
) {}
|
||||
@@ -210,4 +215,31 @@ export class TahesabController {
|
||||
) {
|
||||
return this.links.importBulk(user.organizationId, dto);
|
||||
}
|
||||
|
||||
@Post('sync/products/search')
|
||||
@Roles('owner', 'admin', 'sales')
|
||||
searchProducts(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Body() dto: SearchTahesabProductsDto,
|
||||
) {
|
||||
return this.products.search(user.organizationId, dto);
|
||||
}
|
||||
|
||||
@Post('sync/products/import')
|
||||
@Roles('owner', 'admin', 'sales')
|
||||
importProduct(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Body() dto: ImportProductFromTahesabDto,
|
||||
) {
|
||||
return this.products.importOne(user.organizationId, dto);
|
||||
}
|
||||
|
||||
@Post('sync/products/import-bulk')
|
||||
@Roles('owner', 'admin')
|
||||
importProductsBulk(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Body() dto: ImportBulkProductsFromTahesabDto,
|
||||
) {
|
||||
return this.products.importBulk(user.organizationId, dto);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user