Generic Application Features

This system provides a complete, repeatable set of database-backed application features suitable for operational CRUD systems.


Editing

Editing

Dropdown Selections

Table Lookups and Quick Adds

Table Lookups and Quick Adds

Filtering

Filtering

Printed Reports

Printed reports

PDF’s

PDF or Hard Copies

1) CRUD for Each Model

Each model ships with standard screens and endpoints:

  • Create: form + validation + defaults
  • Read: list + detail views
  • Update: edit form + optimistic locking (optional)
  • Delete:
    • default: soft delete
    • optional: hard delete (admin only)

UI

  • List view with pagination and column controls
  • Detail view with relationships / drill-downs
  • Inline actions: edit, clone, archive, export

2) Soft Deletes (Recoverable Records)

Instead of removing rows, records are marked inactive:

  • deleted_at timestamp
  • deleted_by user id
  • optional delete_reason

Behaviour

  • Default queries exclude deleted rows
  • Admin can view deleted rows and restore
  • Deletes are auditable

3) Denormalised Fields for Fast Search (Avoid Expensive Joins)

To support fast list pages and global search, the system maintains one or more search-friendly fields:

  • search_text: concatenated important values (e.g. codes, names, refs)
  • search_tags: simplified tokens / keywords
  • optional search_hash: for exact match acceleration

Update policy

  • recomputed on write (create/update)
  • optionally recomputed in background after bulk imports

This eliminates heavy joins in common search flows while preserving the normalised source of truth.


4) JSON Fields for Ad-Hoc Attributes (Avoid Migrations)

Models can include a meta (JSON) field for client- or workflow-specific attributes:

  • avoids frequent schema migrations for minor additions
  • stores flexible key/value pairs
  • supports simple filtering and reporting

Example keys

  • meta.priority
  • meta.custom_reference
  • meta.flags

Governance (recommended)

  • optional JSON schema or validation rules per model
  • clearly separate “core fields” vs “ad-hoc fields”

5) Comprehensive Reporting per Model (Print + Extract)

Each model supports a reporting suite:

  • Printouts: PDF/HTML “record view” with related data
  • Exports: CSV/XLSX/JSON extracts (filtered + scoped)
  • Templates: per-customer layouts if required
  • Audit-friendly: include timestamps, user, source IDs

Common report types

  • List report (filters applied)
  • Detail report (one record + children)
  • Operational summaries (grouped totals)

6) Lookup Tables; Editable On the Fly

Reference/lookup tables (e.g. status codes, types, ports) can be updated without deployment:

  • Add/edit lookup values via UI
  • Effective-dating (optional): valid_from, valid_to
  • Protect in-use values (prevent deletion if referenced)
  • Audit changes (who/when/what)

This prevents operational stoppages when a new code/value is needed urgently.


7) Searching and Filtering

Search works at multiple levels:

  • Quick search: single box, uses search_text / denormalised indexes
  • Advanced filters:
    • field filters (equals/contains/range)
    • date ranges
    • status filters
    • relationship filters (safe join paths only)
    • JSON filters (e.g. meta.priority = "High")
  • Saved searches: personal or shared
  • Export current view: “what you see is what you export”

Performance goals

  • list pages respond without multi-join queries
  • filtering is index-aware
  • pagination is stable and deterministic