Spaces:
Running
Running
Download apps/api/src/network/network.dto.ts from Benaah/MicProtocol: direct link, hf CLI and curl.
- Browser
- Download file 9.38 kB
-
https://huggingface.co/spaces/Benaah/MicProtocol/resolve/main/apps/api/src/network/network.dto.ts
- Command line
-
hf download hf://spaces/Benaah/MicProtocol/apps/api/src/network/network.dto.ts
-
curl -L -o network.dto.ts https://huggingface.co/spaces/Benaah/MicProtocol/resolve/main/apps/api/src/network/network.dto.ts
9.38 kB
| import { | |
| IsBoolean, | |
| IsOptional, | |
| IsString, | |
| IsArray, | |
| IsInt, | |
| IsEnum, | |
| IsUrl, | |
| MaxLength, | |
| Min, | |
| Max, | |
| MinLength, | |
| IsNumber, | |
| IsUUID, | |
| ValidateNested, | |
| IsDateString, | |
| } from "class-validator"; | |
| import { Type } from "class-transformer"; | |
| import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; | |
| import { | |
| VerificationStatus, | |
| BookmarkStatus, | |
| ProfileViewSource, | |
| NetworkBookingRequestStatus, | |
| ReputationTier, | |
| } from "@micprotocol/shared-types"; | |
| // βββ Expertise Tag DTO βββββββββββββββββββββββββββββββ | |
| export class ExpertiseTagDto { | |
| ({ example: "Fintech" }) | |
| () | |
| (1) | |
| (100) | |
| name!: string; | |
| ({ example: "Technology" }) | |
| () | |
| () | |
| (100) | |
| category?: string; | |
| } | |
| // βββ Availability Window DTO βββββββββββββββββββββββββ | |
| export class AvailabilityWindowDto { | |
| ({ example: 1, description: "0=Sunday, 6=Saturday" }) | |
| () | |
| (0) | |
| (6) | |
| dayOfWeek!: number; | |
| ({ example: 9 }) | |
| () | |
| (0) | |
| (23) | |
| startHour!: number; | |
| ({ example: 17 }) | |
| () | |
| (0) | |
| (23) | |
| endHour!: number; | |
| ({ example: "Africa/Nairobi" }) | |
| () | |
| () | |
| timezone?: string; | |
| } | |
| // βββ Visibility Settings DTO βββββββββββββββββββββββββ | |
| export class VisibilitySettingsDto { | |
| ({ default: false }) | |
| () | |
| () | |
| showEmail?: boolean; | |
| ({ default: false }) | |
| () | |
| () | |
| showPhone?: boolean; | |
| ({ default: true }) | |
| () | |
| () | |
| showAppearances?: boolean; | |
| ({ default: true }) | |
| () | |
| () | |
| showReliabilityScore?: boolean; | |
| } | |
| // βββ Create Guest Public Profile βββββββββββββββββββββ | |
| export class CreateGuestPublicProfileDto { | |
| ({ example: "Fintech Founder | Nairobi" }) | |
| () | |
| () | |
| (255) | |
| headline?: string; | |
| ({ example: "Building payment infrastructure for informal economies..." }) | |
| () | |
| () | |
| (5000) | |
| fullBio?: string; | |
| ({ example: "Kenya" }) | |
| () | |
| () | |
| (100) | |
| country?: string; | |
| ({ example: "Nairobi" }) | |
| () | |
| () | |
| (100) | |
| city?: string; | |
| ({ example: ["English", "Swahili"] }) | |
| () | |
| () | |
| ({ each: true }) | |
| languages?: string[]; | |
| ({ example: "Africa/Nairobi" }) | |
| () | |
| () | |
| (100) | |
| timezone?: string; | |
| ({ example: "+254700123456" }) | |
| () | |
| () | |
| (20) | |
| phoneNumber?: string; | |
| ({ example: "+254700123456" }) | |
| () | |
| () | |
| (20) | |
| whatsappNumber?: string; | |
| () | |
| () | |
| () | |
| avatarUrl?: string; | |
| ({ default: true }) | |
| () | |
| () | |
| isPublic?: boolean; | |
| ({ type: VisibilitySettingsDto }) | |
| () | |
| () | |
| (() => VisibilitySettingsDto) | |
| visibilitySettings?: VisibilitySettingsDto; | |
| ({ type: [ExpertiseTagDto] }) | |
| () | |
| () | |
| ({ each: true }) | |
| (() => ExpertiseTagDto) | |
| expertiseTags?: ExpertiseTagDto[]; | |
| ({ type: [AvailabilityWindowDto] }) | |
| () | |
| () | |
| ({ each: true }) | |
| (() => AvailabilityWindowDto) | |
| availabilityWindows?: AvailabilityWindowDto[]; | |
| } | |
| // βββ Update Guest Public Profile βββββββββββββββββββββ | |
| export class UpdateGuestPublicProfileDto extends CreateGuestPublicProfileDto {} | |
| // βββ Guest Network Search DTO ββββββββββββββββββββββββ | |
| export class GuestNetworkSearchDto { | |
| ({ example: "fintech climate" }) | |
| () | |
| () | |
| (500) | |
| query?: string; | |
| ({ example: "Kenya" }) | |
| () | |
| () | |
| country?: string; | |
| ({ example: ["Kenya", "Nigeria"] }) | |
| () | |
| () | |
| ({ each: true }) | |
| countries?: string[]; | |
| ({ example: ["Fintech", "Climate"] }) | |
| () | |
| () | |
| ({ each: true }) | |
| expertise?: string[]; | |
| ({ example: ["English", "Swahili"] }) | |
| () | |
| () | |
| ({ each: true }) | |
| languages?: string[]; | |
| ({ example: 70 }) | |
| () | |
| () | |
| (0) | |
| (100) | |
| minReliabilityScore?: number; | |
| ({ example: 2 }) | |
| () | |
| () | |
| (0) | |
| minAppearances?: number; | |
| ({ enum: VerificationStatus }) | |
| () | |
| (VerificationStatus) | |
| verificationStatus?: VerificationStatus; | |
| ({ enum: ReputationTier }) | |
| () | |
| (ReputationTier) | |
| tier?: ReputationTier; | |
| ({ example: 24 }) | |
| () | |
| () | |
| (1) | |
| maxResponseTimeHours?: number; | |
| ({ default: "relevance" }) | |
| () | |
| () | |
| sortBy?: string; | |
| ({ default: "desc" }) | |
| () | |
| () | |
| sortOrder?: string; | |
| ({ default: 1 }) | |
| () | |
| () | |
| (1) | |
| page?: number; | |
| ({ default: 20 }) | |
| () | |
| () | |
| (1) | |
| (50) | |
| limit?: number; | |
| } | |
| // βββ Create Network Booking Request ββββββββββββββββββ | |
| export class CreateNetworkBookingRequestDto { | |
| () | |
| () | |
| toProfileId!: string; | |
| () | |
| () | |
| fromPodcastId!: string; | |
| ({ example: "We'd love to have you on our podcast to discuss fintech in East Africa" }) | |
| () | |
| (10) | |
| (2000) | |
| message!: string; | |
| ({ example: ["Mobile Money", "Payment Rails"] }) | |
| () | |
| () | |
| ({ each: true }) | |
| proposedTopics?: string[]; | |
| () | |
| () | |
| () | |
| ({}, { each: true }) | |
| proposedDates?: string[]; | |
| } | |
| // βββ Respond to Booking Request ββββββββββββββββββββββ | |
| export class RespondToBookingRequestDto { | |
| ({ enum: ["accepted", "declined"] }) | |
| (NetworkBookingRequestStatus) | |
| status!: "accepted" | "declined"; | |
| } | |
| // βββ Create Network Bookmark βββββββββββββββββββββββββ | |
| export class CreateNetworkBookmarkDto { | |
| () | |
| () | |
| guestProfileId!: string; | |
| () | |
| () | |
| podcastId!: string; | |
| ({ example: "Great fit for our fintech series" }) | |
| () | |
| () | |
| (1000) | |
| notes?: string; | |
| } | |
| // βββ Update Network Bookmark βββββββββββββββββββββββββ | |
| export class UpdateNetworkBookmarkDto { | |
| ({ enum: BookmarkStatus }) | |
| () | |
| (BookmarkStatus) | |
| status?: BookmarkStatus; | |
| () | |
| () | |
| () | |
| (1000) | |
| notes?: string; | |
| } | |
| // βββ Create Host Review ββββββββββββββββββββββββββββββ | |
| export class CreateHostReviewDto { | |
| () | |
| () | |
| bookingRequestId!: string; | |
| () | |
| () | |
| profileId!: string; | |
| ({ example: 5, minimum: 1, maximum: 5 }) | |
| () | |
| (1) | |
| (5) | |
| contentRating!: number; | |
| ({ example: 5, minimum: 1, maximum: 5 }) | |
| () | |
| (1) | |
| (5) | |
| prepQuality!: number; | |
| ({ example: 5, minimum: 1, maximum: 5 }) | |
| () | |
| (1) | |
| (5) | |
| overallRating!: number; | |
| ({ example: "Excellent guest, very well prepared." }) | |
| () | |
| () | |
| (2000) | |
| comment?: string; | |
| } | |
| // βββ Track Profile View ββββββββββββββββββββββββββββββ | |
| export class TrackProfileViewDto { | |
| () | |
| () | |
| profileId!: string; | |
| () | |
| () | |
| () | |
| viewerPodcastId?: string; | |
| ({ enum: ProfileViewSource }) | |
| () | |
| (ProfileViewSource) | |
| source?: ProfileViewSource; | |
| } | |