Skip to content

Add new partner config fields to CreatePartnerDto #1040

@bl00dymarie

Description

@bl00dymarie

Overview

ℹ️ This is ticket 2/6 of #1038 Epic: Extract Partner Config from Frontend to Database.

Now that the partner table has new columns (from #1039), we need to allow these fields to be set when creating a new partner. The CreatePartnerDto currently only accepts name. We need to add the new fields as optional properties with appropriate validation decorators.

❗️ Blockers: #1039 (database migration) must be merged first

Action Items

  • Update src/partner/dtos/create-partner.dto.ts to add the following optional fields:

    • logo (optional string)
    • logoAlt (optional string)
    • partnershipLogo (optional string)
    • partnershipLogoAlt (optional string)
    • bloomGirlIllustration (optional string)
    • website (optional string)
    • footerLine1 (optional string)
    • footerLine2 (optional string)
    • facebookUrl (optional string)
    • twitterUrl (optional string)
    • instagramUrl (optional string)
    • youtubeUrl (optional string)
    • tiktokUrl (optional string)
    • githubUrl (optional string)
  • Use @IsOptional(), @IsString(), and @ApiProperty({ type: String, required: false }) decorators on each new field

  • For URL fields (website, facebookUrl, twitterUrl, instagramUrl, youtubeUrl, tiktokUrl, githubUrl), consider adding @IsUrl() validation

  • Verify the createPartner method in src/partner/partner.service.ts passes the DTO through correctly (it uses this.partnerRepository.create(createPartnerDto) which should pick up new fields automatically since they match entity column names)

  • Run existing tests: npm run test

  • Test manually by creating a partner via POST /v1/partner with the new fields

Resources

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions