fbe7230865
- 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.
48 lines
1013 B
TypeScript
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) {}
|