refactor(nestjs): wip

This commit is contained in:
Ahmed Bouhuolia
2025-05-27 15:42:27 +02:00
parent 83c9392b74
commit b7a3c42074
33 changed files with 186 additions and 72 deletions

View File

@@ -57,7 +57,7 @@ export class WarehousesController {
return this.warehousesApplication.activateWarehouses();
}
@Post(':id/mark-primary')
@Put(':id/mark-primary')
@ApiOperation({ summary: 'Mark a warehouse as primary' })
markWarehousePrimary(@Param('id') warehouseId: string) {
return this.warehousesApplication.markWarehousePrimary(Number(warehouseId));

View File

@@ -17,6 +17,8 @@ export class WarehousesSettings {
const settings = await this.settingsStore();
settings.set({ group: 'features', key: Features.WAREHOUSES, value: 1 });
await settings.save();
};
/**

View File

@@ -1,16 +1,16 @@
import { CreateWarehouse } from './CreateWarehouse.service';
import { Injectable } from '@nestjs/common';
import { I18nContext } from 'nestjs-i18n';
import { I18nService } from 'nestjs-i18n';
@Injectable()
export class CreateInitialWarehouse {
/**
* @param {CreateWarehouse} createWarehouse - Create warehouse service.
* @param {I18nContext} i18n - I18n context.
* @param {I18nService} i18n - I18n service.
*/
constructor(
private readonly createWarehouse: CreateWarehouse,
private readonly i18n: I18nContext,
private readonly i18n: I18nService,
) {}
/**

View File

@@ -1,5 +1,6 @@
import { IsOptional } from "@/common/decorators/Validators";
import { ApiProperty } from "@nestjs/swagger";
import { IsBoolean, IsEmail, IsOptional, IsUrl } from "class-validator";
import { IsBoolean, IsEmail, IsUrl } from "class-validator";
import { IsNotEmpty } from "class-validator";
import { IsString } from "class-validator";