email to id updation

This commit is contained in:
harshithnrao 2025-04-11 13:43:36 +05:30
parent 0fceef8c44
commit 5c24732ae4
8 changed files with 32 additions and 32 deletions

View File

@ -1,4 +1,4 @@
import { IsString, IsNumber, IsDate, IsOptional, IsEmail, IsArray, IsObject } from 'class-validator';
import { IsString, IsNumber, IsDate, IsOptional, IsObject } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';

View File

@ -1,4 +1,4 @@
import { IsString, IsNumber, IsDate, IsOptional, IsEmail, IsObject } from 'class-validator';
import { IsString, IsNumber, IsDate, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';

View File

@ -1,13 +1,13 @@
import { IsString, IsEmail, IsNumber, IsDate, IsOptional, IsNotEmpty, IsEnum } from 'class-validator';
import { IsString, IsNumber, IsDate, IsOptional, IsNotEmpty, IsEnum } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
export class PayoutDTO {
@ApiProperty({ type: String })
@IsEmail()
@ApiProperty({ type: Number })
@IsNumber()
@IsNotEmpty()
payeeEmail: string;
payeeId: number;
@ApiProperty({ type: Number })
@IsNumber()
@ -24,15 +24,15 @@ export class PayoutDTO {
@IsNotEmpty()
transactionId: string;
@ApiProperty({ type: String })
@IsEmail()
@ApiProperty({ type: Number })
@IsNotEmpty()
paidToEmail: string;
@IsNumber()
paidToId: number;
@ApiProperty({ type: Date })
@IsDate()
@IsNotEmpty()
@Transform(({ value }) => new Date(value))
@Transform(({ value }) => new Date(value))
payoutDate: Date;
@ApiProperty({ type: String })
@ -42,22 +42,22 @@ export class PayoutDTO {
@ApiProperty({ type: Date })
@IsDate()
@Transform(({ value }) => new Date(value))
@Transform(({ value }) => new Date(value))
validFrom: Date;
@ApiProperty({ type: Date })
@IsDate()
@Transform(({ value }) => new Date(value))
@Transform(({ value }) => new Date(value))
validTill: Date;
@ApiProperty({ type: Date })
@IsDate()
@Transform(({ value }) => new Date(value))
@Transform(({ value }) => new Date(value))
createdAt: Date;
@ApiProperty({ type: Date })
@IsDate()
@Transform(({ value }) => new Date(value))
@Transform(({ value }) => new Date(value))
updatedAt: Date;
@ApiProperty({ type: String })
@ -71,7 +71,7 @@ export class PayoutDTO {
@ApiProperty({ type: Date })
@IsOptional()
@IsDate()
@Transform(({ value }) => value ? new Date(value) : null)
@Transform(({ value }) => value ? new Date(value) : null)
deletedAt: Date;
@ApiProperty({ type: Number })

View File

@ -4,9 +4,9 @@ import { ApiProperty } from '@nestjs/swagger';
@Table({ tableName: 'payouts', paranoid: true })
export default class Payout extends Model {
@ApiProperty({ type: String })
@Column({ type: DataType.TEXT, field: 'payee_email' })
payeeEmail: string;
@ApiProperty({ type: Number })
@Column({ type: DataType.NUMBER, field: 'payee_id' })
payeeId: number;
@ApiProperty({ type: Number })
@Column({ type: DataType.NUMBER, field: 'amount' })
@ -21,8 +21,8 @@ export default class Payout extends Model {
transactionId: string;
@ApiProperty({ type: String })
@Column({ type: DataType.TEXT, field: 'paid_to_email' })
paidToEmail: string;
@Column({ type: DataType.TEXT, field: 'paid_to_id' })
paidToId: string;
@ApiProperty({ type: Date })
@Column({ type: DataType.DATEONLY, field: 'payout_date' })

View File

@ -1,4 +1,4 @@
import { IsString, IsNumber, IsDate, IsNotEmpty, IsOptional, IsEmail } from 'class-validator';
import { IsString, IsNumber, IsDate, IsNotEmpty, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
@ -9,10 +9,10 @@ export class ReviewDTO {
@IsNotEmpty()
eventId: number;
@ApiProperty({ type: String })
@IsEmail()
@ApiProperty({ type: Number })
@IsNotEmpty()
buyerEmail: string;
@IsNumber()
buyerId: number;
@ApiProperty({ type: Number })
@IsNumber()

View File

@ -9,8 +9,8 @@ export default class Review extends Model {
eventId: number;
@ApiProperty({ type: String })
@Column({ type: DataType.TEXT, field: 'buyer_email' })
buyerEmail: string;
@Column({ type: DataType.TEXT, field: 'buyer_id' })
buyerId: string;
@ApiProperty({ type: Number })
@Column({ type: DataType.NUMBER, field: 'rating' })

View File

@ -1,4 +1,4 @@
import { IsString, IsNumber, IsDate, IsNotEmpty, IsEmail, IsOptional } from 'class-validator';
import { IsString, IsNumber, IsDate, IsNotEmpty, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
@ -30,9 +30,9 @@ export class TicketDTO {
qrCode: string;
@ApiProperty({ type: String })
@IsEmail()
@IsNotEmpty()
buyerEmail: string;
@IsNumber()
buyerId: number;
@ApiProperty({ type: Date })
@IsDate()

View File

@ -24,9 +24,9 @@ export default class Ticket extends Model {
@Column({ type: DataType.TEXT, field: 'qr_code' })
qrCode: string;
@ApiProperty({ type: String })
@Column({ type: DataType.TEXT, field: 'buyer_email', allowNull: false })
buyerEmail: string;
@ApiProperty({ type: Number })
@Column({ type: DataType.NUMBER, field: 'buyer_id', allowNull: false })
buyerId: number;
@ApiProperty({ type: Date })
@Column({ type: DataType.DATEONLY, field: 'booking_date' })