git clone https://github.com/DavidNazareno/HPrueba.git
Para ejecutar acceder desde la terminal y escribir
Cuando se hace una mutacion GenerateRequest retonar url, esa url abre un html statico sencillo donde le muestra la informacion de la solicitud y su tecnico.
go run ./main.go
mutation{
AddClient{
id
ticket
}
}
mutation {
GenerateRequest(ticket: "Agregar Ticket para validar cliente y crear solicitud")
}
Digrama de base de datos, con relacions corresondientes para la funcionalidad de la app
- getRequest() recibe como parametro el token generado, y retorna el Objecto Request desde la tabla requests en la base de datos.
- getTechOrders() recibe como parametro el id del tecnico y retorna la cantidad de ordenes que tiene el tecnico en ese momento.
getRequest(token: String!): Request!
getTechOrders(id: String!): String!
AddClient: Client!
GenerateRequest(ticket: String!): String!
-
AddClient() recibe como parametro el cliente y es para crear el ticket y almacenarlo en la base de datos
-
GenerateRequest() recibe como parametro el input NewRequest creado en AddCliente para validar el cliente y crear la solicitud junto al token y asingarlo aleatoriamente a un tecnico, retornando el link para el seguimiento.
input NewRequest {
token: String!
client: Int!
status: Int!
score: Int!
}
Objeto client para gestionar los ticket y validacion de cada cliente que haga una solictud al servicio
type Client {
id: ID!
ticket: String!
}
Objeto Order para construir las ordenes y relacionarla a la tabla technician
type Order {
id: ID!
technician: Technician!
}
Objeto Request para construir las solicitudes de los clientes, cuando se valida el ticket, con relacion a a las tablas Client y Status
type Request {
token: String!
clients: Client!
status: Int!
score: Int
}
Objeto Technician para hacer hacer uso de los tecnicos almacenados en la base de datos.
type Technician {
id: ID!
name: String!
}