generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cms): update case stats with new stages
Jira: PWNN-1528
- Loading branch information
1 parent
bca0a7d
commit d5e875f
Showing
6 changed files
with
65 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
db/migrate/20230830101649_update_support_tower_cases_to_version_4.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class UpdateSupportTowerCasesToVersion4 < ActiveRecord::Migration[7.0] | ||
def change | ||
update_view :support_tower_cases, version: 4, revert_to_version: 3 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
SELECT sc.id, | ||
sc.state, | ||
sc.value, | ||
sc.procurement_id, | ||
sc.organisation_id, | ||
sc.procurement_stage_id AS procurement_stage_id, | ||
COALESCE(sc.support_level, 99) AS support_level, | ||
COALESCE(tow.title, 'No Tower') AS tower_name, | ||
LOWER(REPLACE(COALESCE(tow.title, 'No Tower'), ' ', '-')) AS tower_slug, | ||
tow.id AS tower_id, | ||
sc.created_at, | ||
sc.updated_at | ||
FROM support_cases sc | ||
LEFT JOIN support_categories AS cat ON sc.category_id = cat.id | ||
LEFT JOIN support_towers AS tow ON cat.support_tower_id = tow.id | ||
WHERE sc.state IN (0, 1, 3) -- new, opened, on-hold |