Skip to content

[BE-122] VendorsService is missing delete() #1264

Description

@yusuftomilola

Overview

VendorsService (backend/src/vendors/vendors.service.ts) has findAll, findById, create, and update, but no delete() — a vendor created by mistake, or one the org no longer works with, can never be removed.

Tasks

  • Add delete(id), guarding against removing a vendor still referenced by an open PurchaseOrder.vendorId (purchase_orders currently has no DB-level foreign key on this column — see [BE-134]).
  • Wire DELETE /vendors/:id into VendorsController.
  • Add a unit test covering both the happy path and the referenced-vendor rejection.

Acceptance Criteria

  • DELETE /vendors/:id removes a vendor with no open purchase orders.
  • Deleting a vendor referenced by an open PO is rejected.

Notes for Contributors

Comment below to be assigned.

Activity

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

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbackendbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions