@@ -1,11 +1,9 @@
|
||||
import {
|
||||
IsString,
|
||||
IsArray,
|
||||
IsNumber,
|
||||
IsNotEmpty,
|
||||
ArrayMinSize,
|
||||
IsOptional,
|
||||
Min,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
@@ -36,11 +34,6 @@ export class CreateRequestItemDto {
|
||||
@ApiProperty()
|
||||
productId: string;
|
||||
|
||||
@IsNumber()
|
||||
@Min(1, { message: 'Quantity must be at least 1' })
|
||||
@ApiProperty({ minimum: 1 })
|
||||
quantity: number;
|
||||
|
||||
@ApiPropertyOptional({ type: [RequestItemDto], description: 'Product attribute field values' })
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@@ -69,7 +62,6 @@ export class CreateRequestDto {
|
||||
example: [
|
||||
{
|
||||
productId: '01ARZ3NDEKTSV4RRFFQ69G5FAV',
|
||||
quantity: 100,
|
||||
attributes: [{ fieldId: 'field_01', value: 'blue' }],
|
||||
attachments: [{ type: 'image', url: 'https://example.com/photo.jpg' }],
|
||||
description: 'توضیحات',
|
||||
|
||||
@@ -18,9 +18,6 @@ export class RequestItem extends BaseEntity {
|
||||
@ManyToOne(() => Request)
|
||||
request!: Request;
|
||||
|
||||
@Property({ type: 'int' })
|
||||
quantity!: number;
|
||||
|
||||
@Property({ type: 'text', nullable: true })
|
||||
description?: string;
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ export class RequestService {
|
||||
const requestItem = em.create(RequestItem, {
|
||||
request,
|
||||
product,
|
||||
quantity: item.quantity,
|
||||
attributes: item.attributes,
|
||||
description: item.description,
|
||||
attachments: item.attachments,
|
||||
@@ -143,7 +142,6 @@ export class RequestService {
|
||||
const requestItem = em.create(RequestItem, {
|
||||
request,
|
||||
product,
|
||||
quantity: item.quantity,
|
||||
attributes: item.attributes,
|
||||
description: item.description,
|
||||
attachments: item.attachments,
|
||||
@@ -179,7 +177,6 @@ export class RequestService {
|
||||
const requestItem = em.create(RequestItem, {
|
||||
request,
|
||||
product,
|
||||
quantity: item.quantity,
|
||||
attributes: item.attributes,
|
||||
description: item.description,
|
||||
attachments: item.attachments,
|
||||
|
||||
Reference in New Issue
Block a user