feat: implement connection request management including schema, API endpoints, and business logic for users and agents.

This commit is contained in:
pradeepkumar
2026-02-02 09:59:25 +05:30
parent 497a1a4ba6
commit 93070474f1
10 changed files with 601 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsString, IsOptional, IsUUID, MaxLength } from 'class-validator';
export class CreateConnectionRequestDto {
@ApiProperty({
example: 'uuid-agent-profile-id',
description: 'The ID of the agent profile to connect with',
})
@IsUUID('4')
agentProfileId: string;
@ApiPropertyOptional({
example: 'Hi, I am interested in your services for buying a home.',
description: 'Optional message to send with the connection request',
})
@IsOptional()
@IsString()
@MaxLength(1000)
message?: string;
}

View File

@@ -0,0 +1,2 @@
export * from './create-connection-request.dto';
export * from './respond-connection-request.dto';

View File

@@ -0,0 +1,14 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsIn } from 'class-validator';
export class RespondConnectionRequestDto {
@ApiProperty({
enum: ['ACCEPTED', 'REJECTED'],
example: 'ACCEPTED',
description: 'The response status (ACCEPTED or REJECTED)',
})
@IsIn(['ACCEPTED', 'REJECTED'], {
message: 'Status must be ACCEPTED or REJECTED',
})
status: 'ACCEPTED' | 'REJECTED';
}