Overview
ℹ️ This is 3/6 of #1038 Epic: Extract Partner Config from Frontend to Database.
The IPartner interface in src/partner/partner.interface.ts is a redundant abstraction over PartnerEntity. It only defines a subset of the entity's fields (id, createdAt, updatedAt, name, partnerFeature) and will become increasingly out of sync as we add new fields to the entity. We should remove the interface and use PartnerEntity directly as the type throughout the codebase.
❗️ Blockers: None — can be done in parallel with other tickets
Action Items
Resources
- File to delete:
src/partner/partner.interface.ts
- Files that import
IPartner (7 total):
src/partner/partner.controller.ts
src/utils/serialize.ts
src/partner-admin/partner-admin.interface.ts
src/partner-access/partner-access.interface.ts
src/user/dtos/get-user.dto.ts (indirectly via above interfaces)
src/partner-feature/partner-feature.interface.ts (defines IPartnerFeature, used by IPartner)
Overview
ℹ️ This is 3/6 of #1038 Epic: Extract Partner Config from Frontend to Database.
The
IPartnerinterface insrc/partner/partner.interface.tsis a redundant abstraction overPartnerEntity. It only defines a subset of the entity's fields (id,createdAt,updatedAt,name,partnerFeature) and will become increasingly out of sync as we add new fields to the entity. We should remove the interface and usePartnerEntitydirectly as the type throughout the codebase.❗️ Blockers: None — can be done in parallel with other tickets
Action Items
src/partner/partner.interface.tssrc/partner/partner.controller.ts:import { IPartner }linegetPartner()return type fromPromise<IPartner>toPromise<PartnerEntity>(or keep theformatPartnerObjectreturn type as-is and update that function's return type instead)src/utils/serialize.ts:import { IPartner }lineformatPartnerObjectreturn type fromIPartnertoPartial<PartnerEntity>(or create aGetPartnerDtoresponse DTO if preferred)src/partner-admin/partner-admin.interface.ts:import { IPartner }withimport { PartnerEntity }and update theIPartnerAdminWithPartner.partnertypesrc/partner-access/partner-access.interface.ts:import { IPartner }withimport { PartnerEntity }and update theIPartnerAccessWithPartner.partnertypesrc/user/dtos/get-user.dto.tsif it referencesIPartnerindirectly through the above interfacesnpm run test/v1/partner/:nameendpointResources
src/partner/partner.interface.tsIPartner(7 total):src/partner/partner.controller.tssrc/utils/serialize.tssrc/partner-admin/partner-admin.interface.tssrc/partner-access/partner-access.interface.tssrc/user/dtos/get-user.dto.ts(indirectly via above interfaces)src/partner-feature/partner-feature.interface.ts(definesIPartnerFeature, used byIPartner)