RPS Admin db schema changes + flag updates.

This commit is contained in:
Patrick Fic
2020-11-12 14:25:48 -08:00
parent 0aa8d2ead6
commit 8d858cbf9b
6 changed files with 85 additions and 17 deletions

View File

@@ -351,22 +351,26 @@ async function DecodeLinFile(extensionlessFilePath) {
// jobline.glass_flag === false
// )
.map((jobline) => {
if (
(jobline.db_price === null || jobline.db_price === 0) &&
!!jobline.act_price &&
jobline.act_price > 0
) {
// log.info(
// "DB Price null/lower than act price",
// jobline.line_desc,
// jobline.db_price,
// jobline.act_price
// );
jobline.db_price = jobline.act_price;
}
//Removed as a result of conversation with Norm.
// Appears you are calculating based on N.A. part values in the Mitchell database.
// Reminder if Mitchell DB has $0.00 price updates can be tracked, if it has N.A. it cannot calculate RPS value.
// if (
// (jobline.db_price === null || jobline.db_price === 0) &&
// !!jobline.act_price &&
// jobline.act_price > 0
// ) {
// // log.info(
// // "DB Price null/lower than act price",
// // jobline.line_desc,
// // jobline.db_price,
// // jobline.act_price
// // );
// jobline.db_price = jobline.act_price;
// }
if (
jobline.db_price &&
jobline.db_price > 0 &&
jobline.act_price &&
jobline.act_price > jobline.db_price
) {
@@ -388,11 +392,12 @@ async function DecodeLinFile(extensionlessFilePath) {
jobline.line_desc.toLowerCase().startsWith("hazardous") ||
jobline.line_desc.toLowerCase().startsWith("detail") ||
jobline.line_desc.toLowerCase().startsWith("clean") ||
jobline.part_type.toUpperCase() === "PAG" ||
// jobline.part_type.toUpperCase() === "PAG" ||
jobline.part_type.toUpperCase() === "PAS" ||
jobline.part_type.toUpperCase() === "PASL" ||
jobline.part_type.toUpperCase() === "PAE" ||
jobline.glass_flag === true
//jobline.glass_flag === true ||
jobline.db_price === 0
)
jobline.ignore = true;

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."users" DROP COLUMN "id";
type: run_sql

View File

@@ -0,0 +1,10 @@
- args:
cascade: false
read_only: false
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."users" ADD COLUMN "id" uuid NULL UNIQUE DEFAULT gen_random_uuid();
type: run_sql

View File

@@ -0,0 +1,23 @@
- args:
role: user
table:
name: users
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- authid
- email
- created_at
- updated_at
computed_fields: []
filter:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: users
schema: public
type: create_select_permission

View File

@@ -0,0 +1,24 @@
- args:
role: user
table:
name: users
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- authid
- created_at
- email
- id
- updated_at
computed_fields: []
filter:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: users
schema: public
type: create_select_permission

View File

@@ -317,8 +317,9 @@ tables:
permission:
columns:
- authid
- email
- created_at
- email
- id
- updated_at
filter:
authid: