feat: Remove positionCompany column from usuario table and references in frontend and backend

feat-scaling-ticket-remote-creation
adriano 2024-05-03 15:16:35 -03:00
parent b85aa4d5ba
commit 8eb2156845
11 changed files with 32 additions and 46 deletions

View File

@ -143,7 +143,6 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
password,
name,
profile,
positionCompany,
positionId,
queueIds,
transferToOtherQueues
@ -170,7 +169,6 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
email,
password,
name,
positionCompany,
positionId,
profile,
queueIds,

View File

@ -0,0 +1,14 @@
import { QueryInterface, DataTypes } from "sequelize";
module.exports = {
up: (queryInterface: QueryInterface) => {
return queryInterface.removeColumn("Users", "positionCompany");
},
down: (queryInterface: QueryInterface) => {
return queryInterface.addColumn("Users", "positionCompany", {
type: DataTypes.STRING,
allowNull: true
});
}
};

View File

@ -4,7 +4,6 @@ import User from "../models/User";
interface SerializedUser {
id: number;
name: string;
positionCompany: string;
positionId: string | number;
position: object;
email: string;
@ -16,7 +15,6 @@ export const SerializeUser = (user: User): SerializedUser => {
return {
id: user.id,
name: user.name,
positionCompany: user.positionCompany,
positionId: user.positionId,
position: user.position,
email: user.email,

View File

@ -45,9 +45,6 @@ class User extends Model<User> {
@Column
tokenVersion: number;
@Column
positionCompany: string;
@Column
secondaryId: string;

View File

@ -10,7 +10,6 @@ import Queue from "../../models/Queue";
interface SerializedUser {
id: number;
name: string;
positionCompany: string;
email: string;
profile: string;
queues: Queue[];

View File

@ -9,7 +9,6 @@ interface Request {
email: string;
password: string;
name: string;
positionCompany?: string;
positionId?: string;
queueIds?: number[];
profile?: string;
@ -20,7 +19,6 @@ interface Request {
interface Response {
email: string;
name: string;
positionCompany: string;
positionId: string;
id: number;
profile: string;
@ -31,7 +29,6 @@ const CreateUserService = async ({
email,
password,
name,
positionCompany,
positionId,
queueIds = [],
profile = "master",
@ -85,7 +82,6 @@ const CreateUserService = async ({
email,
password,
name,
positionCompany,
positionId: !positionId ? null : positionId,
profile,
transferToOtherQueues: transferToOtherQueues? transferToOtherQueues : false

View File

@ -75,7 +75,7 @@ const ListUser = async ({
const users = await User.findAll({
where: where_clause,
raw,
attributes: ["id", "name", "email", "positionCompany", "transferToOtherQueues"],
attributes: ["id", "name", "email", "transferToOtherQueues"],
include: [
{ model: Queue, as: "queues", attributes: ["id", "name", "color"] }

View File

@ -64,7 +64,6 @@ const ListUsersService = async ({
"name",
"id",
"email",
"positionCompany",
"profile",
"createdAt",
"transferToOtherQueues"

View File

@ -10,7 +10,6 @@ const ShowUserService = async (id: string | number): Promise<User> => {
"id",
"email",
"profile",
"positionCompany",
"positionId",
"tokenVersion",
"transferToOtherQueues"

View File

@ -8,7 +8,6 @@ interface UserData {
email?: string;
password?: string;
name?: string;
positionCompany?: string;
positionId?: string;
profile?: string;
queueIds?: number[];
@ -74,7 +73,6 @@ const UpdateUserService = async ({
password,
profile,
name,
positionCompany,
positionId,
queueIds = [],
transferToOtherQueues
@ -90,7 +88,6 @@ const UpdateUserService = async ({
email,
password,
profile,
positionCompany,
positionId: !positionId ? null : positionId,
name,
transferToOtherQueues

View File

@ -85,7 +85,6 @@ const UserModal = ({ open, onClose, userId, }) => {
name: "",
email: "",
password: "",
positionCompany: "",
profile: "user",
}
@ -262,16 +261,6 @@ const UserModal = ({ open, onClose, userId, }) => {
fullWidth
/>
<div className={classes.multFieldLine}>
{/* <Field
as={TextField}
label="Cargo"
name="positionCompany"
error={touched.name && Boolean(errors.name)}
helperText={touched.name && errors.name}
variant="outlined"
margin="dense"
fullWidth
/> */}
<label style={{display: 'flex', alignItems:'center'}}>
Transferir para outras filas
<Switch