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
The PATCH /v1/partner/:id endpoint currently only supports updating the active (boolean) field. We need to extend it so that all the new partner config fields (added in #1039) can also be updated. This allows the Chayn team to modify partner branding data (logos, websites, social links, footer text) via the API without needing a code deployment.
❗️ Blockers:#1039 (database migration) must be merged first
Action Items
Update src/partner/dtos/update-partner.dto.ts to add the new optional fields:
active (boolean, optional — keep existing)
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)
Make the existing active field optional too (with @IsOptional()) so callers can update other fields without always specifying active
Use @IsOptional(), @IsString(), and @ApiProperty({ type: String, required: false }) decorators
For URL fields, consider adding @IsUrl() validation (same as Ticket 2, covers website, facebookUrl, twitterUrl, instagramUrl, youtubeUrl, tiktokUrl, githubUrl)
Update src/partner/partner.service.ts — the updatePartnerActiveStatus method currently only sets isActive:
// Current:.set({active: active})// Needs to handle all updatable fields
Refactor to accept all DTO fields and pass them through to the update query
Be careful to map active → isActive (the DTO field name differs from the entity column name)
Only set fields that are provided (don't overwrite existing values with undefined)
Update the existing tests in src/partner/partner.service.spec.ts:
Add test case for updating a single new field (e.g. website)
Add test case for updating multiple fields at once
Add test case for partial update (only some fields provided)
Verify the active → isActive mapping still works
Run all tests: npm run test
Test manually via PATCH /v1/partner/:id with various field combinations
Resources
DTO to update: src/partner/dtos/update-partner.dto.ts
Service to update: src/partner/partner.service.ts (line 62, [updatePartnerActiveStatus](https://github.com/chaynHQ/bloom-backend/blob/develop/src/partner/partner.service.ts#L62) method)
Overview
ℹ️ This is ticket 5/6 of #1038 Epic: Extract Partner Config from Frontend to Database.
The
PATCH /v1/partner/:idendpoint currently only supports updating theactive(boolean) field. We need to extend it so that all the new partner config fields (added in #1039) can also be updated. This allows the Chayn team to modify partner branding data (logos, websites, social links, footer text) via the API without needing a code deployment.❗️ Blockers: #1039 (database migration) must be merged first
Action Items
Update
src/partner/dtos/update-partner.dto.tsto add the new optional fields:active(boolean, optional — keep existing)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)activefield optional too (with@IsOptional()) so callers can update other fields without always specifyingactiveUse
@IsOptional(),@IsString(), and@ApiProperty({ type: String, required: false })decoratorsFor URL fields, consider adding
@IsUrl()validation (same as Ticket 2, coverswebsite,facebookUrl,twitterUrl,instagramUrl,youtubeUrl,tiktokUrl,githubUrl)Update
src/partner/partner.service.ts— theupdatePartnerActiveStatusmethod currently only setsisActive:active→isActive(the DTO field name differs from the entity column name)undefined)Update the existing tests in
src/partner/partner.service.spec.ts:website)active→isActivemapping still worksRun all tests:
npm run testTest manually via
PATCH /v1/partner/:idwith various field combinationsResources
src/partner/dtos/update-partner.dto.tssrc/partner/partner.service.ts(line 62,[updatePartnerActiveStatus](https://github.com/chaynHQ/bloom-backend/blob/develop/src/partner/partner.service.ts#L62)method)src/partner/partner.service.spec.tssrc/entities/partner.entity.ts