import { ApiProperty } from '@nestjs/swagger';
import { IsNumber, IsObject } from 'class-validator';
import { ItemEntity } from 'src/modules/item-related/item/domain/entities/item.entity';

export class TransactionItemDto {
  @ApiProperty({
    type: Object,
    required: true,
    example: {
      id: 'uuid',
      name: 'Bundling 1',
      price: 10000,
      hpp: 1000,
      tenant: {
        id: 'uuid',
        name: 'tenant 1',
        share_margin: 10,
      },
    },
  })
  @IsObject()
  item: ItemEntity;

  @ApiProperty({
    type: Number,
    required: true,
    example: 1,
  })
  @IsNumber()
  total_price: number;

  @ApiProperty({
    type: Number,
    required: true,
    example: 1,
  })
  @IsNumber()
  qty: number;
}
