You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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
CreatePartnerDtocurrently only acceptsname. 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.tsto 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 fieldFor URL fields (
website,facebookUrl,twitterUrl,instagramUrl,youtubeUrl,tiktokUrl,githubUrl), consider adding@IsUrl()validationVerify the
createPartnermethod insrc/partner/partner.service.tspasses the DTO through correctly (it usesthis.partnerRepository.create(createPartnerDto)which should pick up new fields automatically since they match entity column names)Run existing tests:
npm run testTest manually by creating a partner via POST
/v1/partnerwith the new fieldsResources
src/partner/dtos/create-partner.dto.tssrc/entities/partner.entity.tssrc/partner/partner.service.ts