Initial commit: Hedena Gold monorepo.

First commit of the Hedena Gold product (separate from gold-bank): branding, package names, and deploy defaults aligned to the new brand; legacy Henza trees stay local-only via .gitignore.
This commit is contained in:
s.esmaeili
2026-10-15 17:19:10 +03:30
commit ea86636027
1121 changed files with 401065 additions and 0 deletions
@@ -0,0 +1,59 @@
import { Body, Controller, Get, HttpCode, Param, Post, Put } from '@nestjs/common';
import { AdminBranchesService } from '../admin-branches/admin-branches.service';
import { TableQueryDto } from '../admin-table/table-query.dto';
import { RequirePermission, SuperAdminOnly } from '../auth/guards';
/**
* Workshops — legacy views/workshop/*, served by WorkshopController:
* POST workshop/table -> the grid (also the picker the PreOrder detail uses)
* POST workshop -> create (workshop + its supervisor, together)
* GET/PUT workshop/{id}
* GET workshop/active/{id} -> toggle
*
* The list route predates the rest (Batch 3 added it for the made-to-order
* screen's workshop picker); the CRUD arrived with Batch 11. Both live here so
* there is one owner of /admin/workshops, and the logic sits in
* AdminBranchesService alongside the branch code it mirrors.
*
* Managing workshops is super-admin-only; the list stays open because the
* made-to-order screen picks a workshop from it.
*/
@Controller('admin/workshops')
export class AdminWorkshopsController {
constructor(private readonly branches: AdminBranchesService) {}
@Post('list')
@HttpCode(200)
list(@Body() query: TableQueryDto) {
return this.branches.listWorkshops(query);
}
@Post()
@HttpCode(200)
@SuperAdminOnly()
@RequirePermission('workshop.create')
create(@Body() data: Record<string, unknown>) {
return this.branches.createWorkshop(data);
}
@Get('active/:id')
@SuperAdminOnly()
@RequirePermission('workshop.list')
toggleActive(@Param('id') id: string) {
return this.branches.toggleWorkshopActive(id);
}
@Get(':id')
@SuperAdminOnly()
@RequirePermission('workshop.list')
findOne(@Param('id') id: string) {
return this.branches.findWorkshop(id);
}
@Put(':id')
@SuperAdminOnly()
@RequirePermission('workshop.list')
update(@Param('id') id: string, @Body() data: Record<string, unknown>) {
return this.branches.updateWorkshop(id, data);
}
}
@@ -0,0 +1,10 @@
import { Module } from '@nestjs/common';
import { PrismaModule } from '../../prisma/prisma.module';
import { AdminBranchesModule } from '../admin-branches/admin-branches.module';
import { AdminWorkshopsController } from './admin-workshops.controller';
@Module({
imports: [PrismaModule, AdminBranchesModule],
controllers: [AdminWorkshopsController],
})
export class AdminWorkshopsModule {}