Opened 4 years ago
Last modified 4 years ago
#2705 assigned enhancement
Add is_web_visible column to the code value table
| Reported by: | dbmulg | Owned by: | Benjamin Haag |
|---|---|---|---|
| Priority: | medium | Milestone: | |
| Component: | Database, Schema Changes | Version: | N/A |
| Severity: | Keywords: | ||
| Cc: | Database Engine: | N/A | |
| Operating System: | N/A |
Description (last modified by )
There are several cases which would benefit from having this new is_web_visible column added to the code_value table.
For example, currently there is no way CT user could see and control what order action code PW user could see from his/her web order history detail page, since the visibility information is not in the database, but in an dataview.
Note: It is possible we may need more column later for the table, for dealing with other arising requirements, say, we many add is_archive new column.
Note: Make the new column with default value 'Y':
ALTER TABLE code_value
ADD is_web_visible nvarchar(1) NOT NULL
DEFAULT('Y')
Change History (12)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
| Description: | modified (diff) |
|---|
comment:3 by , 4 years ago
after changing CT get_code_value dataview, CT user could see and edit the order_action_code web visibility, and PW could use the database data to show the visibility instead of hard-code it.
comment:4 by , 4 years ago
| Description: | modified (diff) |
|---|
comment:5 by , 4 years ago
| Owner: | changed from to |
|---|
comment:6 by , 4 years ago
This needs more discussion. Code values are for universal reference; linking them to one particular context isn't ideal.
comment:7 by , 4 years ago
Not recommended. This is one specific use case involving a business rule covering which order request actions should/should not be visible within the PW and CT. Adding a column that applies to every single code value in the database is not a good design.
This should be handled in the dataview(s). Alternately, Marty had recommended the use of a set of web-visible codes.
comment:8 by , 4 years ago
Of the existing structure it would be worth considering creating a new code group called ORDER_REQUEST_ACTIONS_PW_VISIBLE and having the dataview check the order action codes against that. If the action_name_code is in the PW_VISIBLE list show it, otherwise don’t. Then the curators could execute some simple SQL to check which codes would be visible, such as
SELECT value FROM code_value cv WHERE cv.group_name = 'ORDER_REQUEST_ACTIONS_PW_VISIBLE'
comment:9 by , 4 years ago
per comment 8, then we need to maintain 2 sets of identical code, since all ORDER_REQUEST_ACTIONS_PW_VISIBLE codes need to be ORDER_REQUEST_ACTION code in order for CT to use it, so it's a kind of duplicated set of data. That doesn't seem the best way of managing data.
comment:10 by , 4 years ago
We have total 2500 codes now, this is the second time we try to use a different code group to make up PW visible case. While a is_web_visible column would solve this and future similar case once for all.
comment:11 by , 4 years ago
This use case is exactly what code groups, and dataviews, are for.
The business rule here is "some order actions should not be visible to a web user." The action is what is being restricted -- if there were a need for a new column (and I do not believe that there is), the order_request_action or web_order_request_action table would be the place for it.
If the concern is duplication of data, then the solution is a WHERE clause in the dataview.
comment:12 by , 4 years ago
Refer the newer TRAC ticket 2782, the WEB_ORDER_REQUEST_ACTION table code are now all be copied to the ORDER_REQUEST_ACTION code group, causing the NRR_* code displayed to the user problem. then have to fine tune the dataview to fix the problem.

I added the column to my local dev environment, run PW and CT, looks fine.