Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-373

Enable/disable logging date and user per tenant and table

    XMLWordPrintable

    Details

    • Template:
    • Sprint:
      CP: ready for planning
    • Development Team:
      Core: Platform

      Description

      Currently RMB's metadata logging (into the fields in the record's metadata property: createdDate, createdByUserId, updatedDate, updatedByUserId) can be enabled/disabled per record only: RestVerticle.java logs updatedUser and updatedDate if createdDate is not null.

      The most common use case is that each tenant can decide for each table whether logging should be enabled or disabled.

      This can be implemented by using different triggers.
      RestVerticle always sends the date and user data to the database.
      If the "with metadata" trigger is installed the data is saved.
      If the "without metadata" trigger is installed the date and user data is removed and not saved.

      Tasks:

      • Move the trigger functions from metadata.ftl to general_funtions.ftl.
      • Rename metadata.ftl to metadata_enable.ftl.
      • Create metadata_disable.ftl that installs a trigger that removes the metadata values coming from RestVerticle.java before saving the record.
      • Write a method to run either metadata_enable.ftl or metadata_disable.ftl to install the "with metadata" trigger or the "without metadata" trigger, for example PgUtil.setMetadataEnabled(String tableName).
      • Write a method that reads the status (which trigger is installed?), for example boolean PgUtil.isMetadataEnabled().
      • RestVerticle.java no longer checks whether createdDate is null, it always sets updatedUser and updatedDate.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    TestRail: Runs

                      TestRail: Cases