Process Endorsement Rules
Target Status Allowed From Target Description Allowed Description Actions
Loading rules...

A. General Usage

Purpose: The Process Endorsement Rules define which TCT statuses can endorse to which other statuses in the system.

How to Set Up: Super users can add rules through the "Add Rule" button on the Process Endorsement Rules tab.

Rule Structure: Each rule consists of:

  • Target Status (tctstatus_id): The destination status you want to endorse to
  • Allowed From (allowed_tctstatus_id): The current status that is allowed to endorse to the target

Example: If status "A" can endorse to status "B", create a rule with tctstatus_id="B" and allowed_tctstatus_id="A".

Concrete Example: 03 (tctstatus_id) <- 01 (allowed_tctstatus_id) means status 03 allows endorsements from status 01. In other words, buyers with status 01 can be endorsed to status 03.

Important Notes:

  • Only users with "Super User" role can manage these rules
  • Rules are validated to ensure both statuses exist in the tct_status table
  • A status cannot endorse to itself (target and allowed must be different)

B. Technical Details

Database Table: process_ways

  • id - Primary key (auto-increment)
  • tctstatus_id - The target status for endorsement (VARCHAR 10)
  • allowed_tctstatus_id - The current status allowed to endorse (VARCHAR 10)
  • created_at - Timestamp when rule was created
  • updated_at - Timestamp when rule was last updated

Database Constraints:

  • Foreign keys to tct_status table on both status columns
  • Unique constraint on (tctstatus_id, allowed_tctstatus_id) to prevent duplicates
  • CASCADE delete on status removal

API Endpoint: /api/v1/process-ways.php

  • GET - Retrieve all rules or filter by tctstatus_id parameter
  • POST - Create new rule (requires Super User role)
  • DELETE - Remove rule by ID parameter

Security:

  • Authentication required via session
  • Authorization: Only users with "Super User" role can access/manage process ways
  • Role check performed against user_roles and roles tables

Related Files:

  • api/v1/process-ways.php - API endpoint implementation
  • db/migrations/create_process_ways_table.sql - Database table schema
  • db/seeders/process_ways_seeder.php - Initial data seeder
  • public/processes.php - UI for managing rules