From a23691a30dd5f5ecc497f239cf79a9a81b46c40b Mon Sep 17 00:00:00 2001 From: Traym17 <51390112+Traym17@users.noreply.github.com> Date: Mon, 29 Aug 2022 20:45:34 -0600 Subject: [PATCH] =?UTF-8?q?Agregar=20categor=C3=ADa=20al=20invitado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cambio en el formulario del invitado y en el servicio para agregar la categoría --- api-gateway/package-lock.json | 1 - api-gateway/src/app.controller.ts | 2 ++ api-gateway/src/app.service.ts | 3 ++- mobile-ui/components/AgregarInvitados.js | 25 ++++++++++++++++--- mobile-ui/components/Invitados.js | 9 +++++-- servicio-invitados/package-lock.json | 1 - .../src/guests/guests.service.ts | 2 +- .../src/schemas/guest.schema.ts | 3 +++ servicio-usuarios/package-lock.json | 1 - 9 files changed, 36 insertions(+), 11 deletions(-) diff --git a/api-gateway/package-lock.json b/api-gateway/package-lock.json index 157219f0..ffffe99e 100644 --- a/api-gateway/package-lock.json +++ b/api-gateway/package-lock.json @@ -5,7 +5,6 @@ "requires": true, "packages": { "": { - "name": "api-gateway", "version": "0.0.1", "license": "UNLICENSED", "dependencies": { diff --git a/api-gateway/src/app.controller.ts b/api-gateway/src/app.controller.ts index 821808d9..eaf4e71f 100644 --- a/api-gateway/src/app.controller.ts +++ b/api-gateway/src/app.controller.ts @@ -403,6 +403,7 @@ export class AppController { @Body('tenant_id') tenant_id: string, @Body('community_id') community_id: string, @Body('date_entry') date_entry: Date, + @Body('type_guest') type_guest: string, ) { return this.appService.createGuest( name, @@ -414,6 +415,7 @@ export class AppController { tenant_id, community_id, date_entry, + type_guest, ); } diff --git a/api-gateway/src/app.service.ts b/api-gateway/src/app.service.ts index c9b1aa6a..73077be2 100644 --- a/api-gateway/src/app.service.ts +++ b/api-gateway/src/app.service.ts @@ -512,11 +512,12 @@ export class AppService { tenant_id: string, community_id: string, date_entry: Date, + type_guest: string, ) { const pattern = { cmd: 'createGuest' }; const payload = { name: name, last_name: last_name, dni: dni, number_plate: number_plate, phone: phone, - status: status,tenant_id:tenant_id, community_id:community_id,date_entry: date_entry + status: status,tenant_id:tenant_id, community_id:community_id,date_entry: date_entry,type_guest:type_guest }; return this.clientGuestApp .send(pattern, payload) diff --git a/mobile-ui/components/AgregarInvitados.js b/mobile-ui/components/AgregarInvitados.js index 288cd7c9..034a1b81 100644 --- a/mobile-ui/components/AgregarInvitados.js +++ b/mobile-ui/components/AgregarInvitados.js @@ -1,9 +1,9 @@ import React, { useContext, useState } from "react"; import { API } from "../environment/api"; - +import { MaterialCommunityIcons } from '@expo/vector-icons'; import { Box, Button, - Center, FormControl, Heading, ScrollView, VStack + Center, FormControl, Heading, ScrollView, VStack,Select } from "native-base"; import { StyleSheet, TextInput } from "react-native"; @@ -21,6 +21,7 @@ export default function AgregarInvitados({ navigation }) { const [community_id, setCommunity_id] = useState(); const { user } = useContext(UserContext); const [errors, setErrors] = useState({}); + const [categoria, setCategoria] = React.useState(""); const [info, setInfo] = useState({ name: "", @@ -28,9 +29,12 @@ export default function AgregarInvitados({ navigation }) { dni: "", phone: "", number_plate:"", - status: "-0", + status: "1", tenant_id: user._id, - community_id: user.community_id + //tenant_id: "6301df20dac7dcf76dcecade", + community_id: user.community_id, + //community_id: "62be68215692582bbfd77134", + type_guest:"" }); const onHandleChange = (name) => (value) => setInfo(prev => ({...prev, [name]: value})) @@ -90,6 +94,7 @@ export default function AgregarInvitados({ navigation }) { if (response.status != 201){ console.log('ocurrio un error '); }else{ + navigation.navigate('Inicio'); return response.json(); } }) @@ -143,6 +148,18 @@ export default function AgregarInvitados({ navigation }) { Placa + + + Tipo de invitado + + + +