Project

General

Profile

Actions

User Story #688

open

EPIC #670: Package Catalogue Management - 2 days front end and 2 days backend

Feature #686: Delete & Restore Package

backend – Delete & Restore Package

Added by Islam Mansoori about 1 month ago.

Status:
To Do
Priority:
low
Assignee:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

As a Super Admin, I want the system to safely deactivate and restore package records so that business data remains intact while preventing deleted packages from participating in active business operations.


Business Background

Packages are connected to multiple business processes including enquiries, quotations, bookings, reporting, and audit history. Permanently deleting a package may result in broken business references and data inconsistencies. Therefore, the backend shall implement Soft Delete, ensuring packages are excluded from active operations while preserving historical integrity.


Objective

The backend shall:

  • Soft delete package records.
  • Restore deleted packages.
  • Preserve historical references.
  • Prevent accidental data loss.
  • Maintain audit history.

Functional Behaviour

The system shall:

  • Validate delete permission.
  • Verify package existence.
  • Check whether deletion is allowed.
  • Mark the package as Deleted.
  • Record deletion information.
  • Exclude deleted packages from active catalogue operations.
  • Restore packages when requested.

Business Workflow

Delete Request
      │
      ▼
Permission Validation
      │
      ▼
Business Validation
      │
      ▼
Soft Delete Package
      │
      ▼
Update Audit Information
      │
      ▼
Hide From Active Catalogue

Restore Workflow

Restore Request
      │
      ▼
Permission Validation
      │
      ▼
Validate Package
      │
      ▼
Restore Previous Status
      │
      ▼
Update Audit Information
      │
      ▼
Return Package To Catalogue

Business Logic

Delete

The system shall:

  • Not physically remove the package.
  • Mark the package as Deleted.
  • Store Deleted By.
  • Store Deleted Date.
  • Preserve all relationships.

Deleted packages shall not:

  • Appear on customer website.
  • Accept new enquiries.
  • Appear in default package listing.

Restore

The system shall:

  • Remove Deleted status.
  • Reinstate previous lifecycle status (Draft, Published, or Archived).
  • Restore administrative access.
  • Maintain all business relationships.

Database Entity Changes

Package

Updated fields

  • Deleted Flag
  • Deleted By
  • Deleted Date
  • Last Updated By
  • Last Updated Date
  • Current Status

No records shall be physically removed.


Validation Rules

Validation Rule
Package exists Mandatory
Delete permission Required
Restore permission Required
Package already deleted Cannot delete again
Package not deleted Cannot restore

Business Rule Matrix

Scenario Result
Package has enquiries Allow Soft Delete
Package has quotations Allow Soft Delete
Package has bookings Allow Soft Delete
Package has reports Allow Soft Delete
Permanent deletion Not Supported

Audit Requirements

Capture

  • Deleted By
  • Deleted Date
  • Restored By
  • Restored Date
  • Previous Status
  • New Status
  • Activity Type

Permission Matrix

Role Delete Restore
Super Admin Allowed
Admin Configurable
Supplier Not Allowed
Partner Not Allowed
Customer Not Allowed

Impact Analysis

Delete

Business impact

  • Hidden from website
  • Hidden from package search
  • Hidden from enquiry creation
  • Existing enquiries remain intact
  • Existing quotations remain intact
  • Existing bookings remain intact
  • Historical reporting unaffected

Restore

Business impact

  • Returns to package catalogue.
  • Available for administration.
  • Can be published according to lifecycle rules.
  • Historical relationships remain unchanged.

Acceptance Criteria

AC-1

Given a valid package

When Delete is processed

Then the package shall be soft deleted.


AC-2

Given a deleted package

When Restore is processed

Then the package shall become active again.


AC-3

Given the package has business transactions

When Delete occurs

Then historical records shall remain unaffected.


AC-4

Given an unauthorised user

When Delete or Restore is requested

Then the operation shall not proceed.


AC-5

Given Delete or Restore completes successfully

When processing finishes

Then audit history shall be updated.


In Scope

  • Soft Delete
  • Restore
  • Audit updates
  • Business validation
  • Permission validation
  • Historical data preservation

Out of Scope

  • Permanent deletion
  • Database cleanup
  • Archiving
  • Publishing
  • Package editing

Dependencies

  • Authentication
  • Authorization
  • Package Master
  • Audit Framework
  • Lifecycle Management

Edge Cases

  • Restore after related master data becomes inactive.
  • Concurrent delete and publish requests.
  • Package referenced by active quotations.
  • Package referenced by confirmed bookings.
  • Interrupted delete or restore transaction.

Definition of Done

  • Soft Delete implemented.
  • Restore implemented.
  • Business relationships preserved.
  • Audit history captured.
  • Permission rules enforced.
  • Acceptance criteria verified.
  • QA sign-off completed.
  • Product Owner approval obtained.

No data to display

Actions

Also available in: Atom PDF