From 467841bea2f8f6a2773e6a4b67f028e902126039 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 6 May 2022 09:46:26 -0700 Subject: [PATCH] IO-1865 Add employee external ID --- bodyshop_translations.babel | 21 +++++++++++++++++++ .../shop-employees-form.component.jsx | 6 ++++++ client/src/graphql/bodyshop.queries.js | 2 ++ client/src/graphql/employees.queries.js | 1 + client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + hasura/metadata/tables.yaml | 3 +++ .../down.sql | 4 ++++ .../up.sql | 2 ++ 10 files changed, 42 insertions(+) create mode 100644 hasura/migrations/1651854742243_alter_table_public_employees_add_column_external_id/down.sql create mode 100644 hasura/migrations/1651854742243_alter_table_public_employees_add_column_external_id/up.sql diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index d03467a82..a8ae33e7b 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -14038,6 +14038,27 @@ + + external_id + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + first_name false diff --git a/client/src/components/shop-employees/shop-employees-form.component.jsx b/client/src/components/shop-employees/shop-employees-form.component.jsx index 2282d62ef..82fafb1aa 100644 --- a/client/src/components/shop-employees/shop-employees-form.component.jsx +++ b/client/src/components/shop-employees/shop-employees-form.component.jsx @@ -328,6 +328,12 @@ export function ShopEmployeesFormComponent({ bodyshop }) { > + + + {(fields, { add, remove, move }) => { diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js index 045fe4278..06d86ff3c 100644 --- a/client/src/graphql/bodyshop.queries.js +++ b/client/src/graphql/bodyshop.queries.js @@ -115,6 +115,7 @@ export const QUERY_BODYSHOP = gql` last_name employee_number rates + external_id } } } @@ -219,6 +220,7 @@ export const UPDATE_SHOP = gql` employee_number rates user_email + external_id } } } diff --git a/client/src/graphql/employees.queries.js b/client/src/graphql/employees.queries.js index c47b81919..207c10bab 100644 --- a/client/src/graphql/employees.queries.js +++ b/client/src/graphql/employees.queries.js @@ -25,6 +25,7 @@ export const QUERY_EMPLOYEE_BY_ID = gql` rates pin user_email + external_id employee_vacations(order_by: { start: desc }) { id start diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 713aeef22..f75ed1931 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -879,6 +879,7 @@ "base_rate": "Base Rate", "cost_center": "Cost Center", "employee_number": "Employee Number", + "external_id": "External Employee ID", "first_name": "First Name", "flat_rate": "Flat Rate (Disabled is Straight Time)", "hire_date": "Hire Date", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index e02845ee7..1d63e0ffc 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -879,6 +879,7 @@ "base_rate": "Tasa básica", "cost_center": "Centro de costos", "employee_number": "Numero de empleado", + "external_id": "", "first_name": "Nombre de pila", "flat_rate": "Tarifa plana (deshabilitado es tiempo recto)", "hire_date": "Fecha de contratación", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 8193fce89..002cba126 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -879,6 +879,7 @@ "base_rate": "Taux de base", "cost_center": "Centre de coûts", "employee_number": "Numéro d'employé", + "external_id": "", "first_name": "Prénom", "flat_rate": "Taux fixe (désactivé est le temps normal)", "hire_date": "Date d'embauche", diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 709a33ec0..9d71bdd90 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -1955,6 +1955,7 @@ - active - created_at - employee_number + - external_id - first_name - flat_rate - hire_date @@ -1973,6 +1974,7 @@ - active - created_at - employee_number + - external_id - first_name - flat_rate - hire_date @@ -2001,6 +2003,7 @@ - active - created_at - employee_number + - external_id - first_name - flat_rate - hire_date diff --git a/hasura/migrations/1651854742243_alter_table_public_employees_add_column_external_id/down.sql b/hasura/migrations/1651854742243_alter_table_public_employees_add_column_external_id/down.sql new file mode 100644 index 000000000..35e6b6b0d --- /dev/null +++ b/hasura/migrations/1651854742243_alter_table_public_employees_add_column_external_id/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."employees" add column "external_id" text +-- null; diff --git a/hasura/migrations/1651854742243_alter_table_public_employees_add_column_external_id/up.sql b/hasura/migrations/1651854742243_alter_table_public_employees_add_column_external_id/up.sql new file mode 100644 index 000000000..139abc4d9 --- /dev/null +++ b/hasura/migrations/1651854742243_alter_table_public_employees_add_column_external_id/up.sql @@ -0,0 +1,2 @@ +alter table "public"."employees" add column "external_id" text + null;