Skip to content

Remove IPartner interface — use PartnerEntity directly #1041

Description

@bl00dymarie

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

  • Delete the file src/partner/partner.interface.ts
  • Update src/partner/partner.controller.ts:
    • Remove the import { IPartner } line
    • Change getPartner() return type from Promise<IPartner> to Promise<PartnerEntity> (or keep the formatPartnerObject return type as-is and update that function's return type instead)
  • Update src/utils/serialize.ts:
    • Remove the import { IPartner } line
    • Change formatPartnerObject return type from IPartner to Partial<PartnerEntity> (or create a GetPartnerDto response DTO if preferred)
  • Update src/partner-admin/partner-admin.interface.ts:
    • Replace import { IPartner } with import { PartnerEntity } and update the IPartnerAdminWithPartner.partner type
  • Update src/partner-access/partner-access.interface.ts:
    • Replace import { IPartner } with import { PartnerEntity } and update the IPartnerAccessWithPartner.partner type
  • Update src/user/dtos/get-user.dto.ts if it references IPartner indirectly through the above interfaces
  • Run tests to verify nothing breaks: npm run test
  • Verify the API responses are unchanged by testing GET /v1/partner/:name endpoint

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity: beginnerTime needed to do this ticket is less than 1 day.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions