Files
psp_api/src/modules/pos/goods/dto/create-good.dto.ts
T
ahasani fbe7230865 feat: add stock keeping units management
- Created migration to drop `type` column from `stock_keeping_units` table.
- Added `Guild` model to Prisma schema.
- Implemented `BusinessActivitiesQueryService` for querying business activities.
- Developed `GoodsSharedService` for handling goods creation and updates.
- Introduced DTOs for creating and updating stock keeping units.
- Created controller and service for managing stock keeping units.
- Implemented response DTOs for stock keeping units service.
- Established module for stock keeping units management.
2026-05-07 20:30:24 +03:30

48 lines
1013 B
TypeScript

import { GoodPricingModel } from '@/generated/prisma/enums'
import { ApiProperty, PartialType } from '@nestjs/swagger'
import { IsEnum, IsNumber, IsOptional, IsString } from 'class-validator'
export class CreateGoodDto {
@IsString()
@ApiProperty()
name: string
@IsOptional()
@IsString()
@ApiProperty({ required: false })
description?: string
@IsString()
@ApiProperty({ required: true })
sku_id: string
@IsString()
@ApiProperty()
local_sku: string
@IsEnum(GoodPricingModel)
@ApiProperty({ required: true, enum: GoodPricingModel })
pricing_model: GoodPricingModel
@IsOptional()
@IsString()
@ApiProperty({ required: false })
barcode?: string
@IsOptional()
@IsString()
@ApiProperty({ required: false })
category_id?: string
@IsOptional()
@IsNumber()
@ApiProperty({ required: false })
base_sale_price?: number
@IsString()
@ApiProperty({ required: true })
measure_unit_id: string
}
export class UpdateGoodDto extends PartialType(CreateGoodDto) {}