events
This commit is contained in:
parent
f4ccb246b2
commit
a810aa52ca
|
@ -106,7 +106,7 @@ const AppStack = createBottomTabNavigator(
|
|||
|
||||
},
|
||||
{
|
||||
initialRouteName: 'Home',
|
||||
initialRouteName: 'Eventos',
|
||||
|
||||
tabBarOptions: {
|
||||
showLabel: true, // hide labels
|
||||
|
|
|
@ -1,11 +1,25 @@
|
|||
import * as React from "react";
|
||||
|
||||
import {View, StyleSheet, Dimensions, Text, Button, ScrollView, Image, TouchableOpacity} from "react-native";
|
||||
import {View,
|
||||
StyleSheet,
|
||||
Dimensions,
|
||||
Text,
|
||||
Button,
|
||||
ScrollView,
|
||||
Image,
|
||||
TouchableOpacity,
|
||||
FlatList
|
||||
} from "react-native";
|
||||
|
||||
import {TabView, TabBar, SceneMap} from "react-native-tab-view";
|
||||
|
||||
import rallyImg from '../assets/rallyTascas.jpg';
|
||||
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { bindActionCreators } from "redux";
|
||||
|
||||
import * as Actions from "../store/actions"; //Import your actionss
|
||||
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
||||
const SCREEN_WIDTH = Dimensions.get("window").width;
|
||||
|
||||
|
@ -24,10 +38,14 @@ const ThirdRoute = () => (
|
|||
const FourthRoute = () => (
|
||||
<View style={[styles.scene, {backgroundColor: "#673ab7"}]}/>
|
||||
);
|
||||
import PTRView from "react-native-pull-to-refresh";
|
||||
|
||||
|
||||
export default class Eventos extends React.Component {
|
||||
class Eventos extends React.Component {
|
||||
|
||||
_update=()=> {
|
||||
this.props.getAllEvents("eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODQ3NTg5LCJleHAiOjE1NTI5MzM5ODksImlhdCI6MTU1Mjg0NzU4OX0.geNuHNEmo8EGn9yK5FyykDuDRhNQTAcEhheY-nwXTVFbs8hmHLbzPkV4xbPq2qMzEDffzxoc7WWdPwC6D-uTEQ"
|
||||
);
|
||||
}
|
||||
state = {
|
||||
index: 0,
|
||||
routes: [
|
||||
|
@ -38,91 +56,87 @@ export default class Eventos extends React.Component {
|
|||
]
|
||||
};
|
||||
|
||||
|
||||
renderFebrada = (navigate) => {
|
||||
return (
|
||||
<View>
|
||||
<TouchableOpacity onPress={() => navigate('eventDetail')}>
|
||||
<View style={styles.cardContainer}>
|
||||
<Image
|
||||
style={{
|
||||
flex: 1,
|
||||
width: undefined,
|
||||
height: undefined
|
||||
}}
|
||||
resizeMode="contain"
|
||||
source={require('../assets/altice_logo.png')}
|
||||
>
|
||||
</Image>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
componentDidMount(){
|
||||
this.props.getAllEvents("eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODQ3NTg5LCJleHAiOjE1NTI5MzM5ODksImlhdCI6MTU1Mjg0NzU4OX0.geNuHNEmo8EGn9yK5FyykDuDRhNQTAcEhheY-nwXTVFbs8hmHLbzPkV4xbPq2qMzEDffzxoc7WWdPwC6D-uTEQ"
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
renderRally = () => {
|
||||
|
||||
return (
|
||||
<View>
|
||||
<View style={styles.cardContainer}>
|
||||
<Image
|
||||
style={{
|
||||
flex: 1,
|
||||
width: undefined,
|
||||
height: undefined
|
||||
}}
|
||||
resizeMode="contain"
|
||||
source={require('../assets/altice_logo.png')}
|
||||
>
|
||||
</Image>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
renderCaching = () => {
|
||||
|
||||
return (
|
||||
<View>
|
||||
<View style={styles.cardContainer}>
|
||||
<Image
|
||||
style={{
|
||||
flex: 1,
|
||||
width: undefined,
|
||||
height: undefined
|
||||
}}
|
||||
resizeMode="contain"
|
||||
source={require('../assets/altice_logo.png')}
|
||||
>
|
||||
</Image>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
const {navigate} = this.props.navigation;
|
||||
return (
|
||||
<PTRView onRefresh={this._update}>
|
||||
<View style={styles.container}>
|
||||
<ScrollView styles={styles.scroll}>
|
||||
{this.renderFebrada(navigate)}
|
||||
{this.renderRally()}
|
||||
{this.renderCaching()}
|
||||
<FlatList
|
||||
data={this.props.events}
|
||||
renderItem={({item}) =>
|
||||
<View>
|
||||
<TouchableOpacity onPress={() => navigate('eventDetail')}>
|
||||
<View style={styles.cardContainer}>
|
||||
<Image
|
||||
style={{
|
||||
flex: 1,
|
||||
width: undefined,
|
||||
height: undefined
|
||||
}}
|
||||
resizeMode="contain"
|
||||
source={{uri: item.imagem}}
|
||||
|
||||
>
|
||||
</Image>
|
||||
<View style={styles.cardDesc}>
|
||||
<Text style={styles.cardDescText}>{item.nome}</Text>
|
||||
<Text style={styles.cardHours}>{item.horas}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>}
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
</ScrollView>
|
||||
</View>
|
||||
</PTRView>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
cardHours:{
|
||||
textAlign:'center',
|
||||
color:'white',
|
||||
margin:10,
|
||||
|
||||
// width:'20%'
|
||||
},
|
||||
|
||||
cardDesc:{
|
||||
//alignSelf:'center',
|
||||
backgroundColor:'#CC1A17',
|
||||
// flex:1,
|
||||
flexDirection:'row',
|
||||
|
||||
|
||||
},
|
||||
cardDescText:{
|
||||
fontWeight:'bold',
|
||||
color:'white',
|
||||
fontSize:18,
|
||||
|
||||
width:'45%',
|
||||
margin:10
|
||||
|
||||
},
|
||||
container: {
|
||||
backgroundColor: '#eee',
|
||||
flex: 1,
|
||||
flexGrow: 1,
|
||||
flexDirection: 'column',
|
||||
paddingBottom:20
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
@ -132,11 +146,12 @@ const styles = StyleSheet.create({
|
|||
|
||||
cardContainer: {
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
padding: 10,
|
||||
//flexDirection: 'row',
|
||||
//padding: 10,
|
||||
margin: 20,
|
||||
marginBottom:0,
|
||||
backgroundColor: '#fff',
|
||||
height: SCREEN_WIDTH * (1 / 2),
|
||||
height: SCREEN_WIDTH * (1 /2),
|
||||
borderRadius: 5,
|
||||
//borderWidth: 2,
|
||||
},
|
||||
|
@ -145,3 +160,28 @@ const styles = StyleSheet.create({
|
|||
flex: 1
|
||||
}
|
||||
});
|
||||
function mapStateToProps(state, props) {
|
||||
return {
|
||||
token: state.apiReducer.token,
|
||||
user: state.apiReducer.user,
|
||||
logged: state.apiReducer.logged,
|
||||
userDetails: state.apiReducer.userDetails,
|
||||
onHold: state.apiReducer.onHold,
|
||||
bilhete: state.apiReducer.bilhete,
|
||||
alimentacao: state.apiReducer.alimentacao,
|
||||
alojamento: state.apiReducer.alojamento,
|
||||
acesso: state.apiReducer.acesso,
|
||||
team: state.apiReducer.team,
|
||||
internalToken: state.apiReducer.internalToken,
|
||||
events:state.apiReducer.events
|
||||
};
|
||||
}
|
||||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
return bindActionCreators(Actions, dispatch);
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(Eventos);
|
|
@ -80,8 +80,7 @@ class Home extends Component {
|
|||
this.props.getUserInfo(this.props.token);
|
||||
|
||||
console.log(this.props.internalToken)
|
||||
this.props.getUserTeam(this.props.user, "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODM4NTk5LCJleHAiOjE1NTI5MjQ5OTksImlhdCI6MTU1MjgzODU5OX0.KmzDoneEdlzyaTS3N4pSuRYHkdrpTVjPFXVIB4tMKPh1BK4KtIOfqHJ_H3FsrUEkXKb_tnf38swO5SKQ1wt0cg"
|
||||
);
|
||||
this.props.getUserTeam(this.props.user, "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODQ3NTg5LCJleHAiOjE1NTI5MzM5ODksImlhdCI6MTU1Mjg0NzU4OX0.geNuHNEmo8EGn9yK5FyykDuDRhNQTAcEhheY-nwXTVFbs8hmHLbzPkV4xbPq2qMzEDffzxoc7WWdPwC6D-uTEQ" );
|
||||
this.props.getEvents(this.props.user);
|
||||
}
|
||||
componentWillUnmount() {}
|
||||
|
@ -99,15 +98,19 @@ class Home extends Component {
|
|||
_update = () => {
|
||||
this.props.getUserInfo(this.props.token);
|
||||
this.props.getEvents(this.props.user);
|
||||
this.props.getUserTeam(this.props.user,"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODQ3NTg5LCJleHAiOjE1NTI5MzM5ODksImlhdCI6MTU1Mjg0NzU4OX0.geNuHNEmo8EGn9yK5FyykDuDRhNQTAcEhheY-nwXTVFbs8hmHLbzPkV4xbPq2qMzEDffzxoc7WWdPwC6D-uTEQ" )
|
||||
};
|
||||
onSuccess=e=>{
|
||||
//fecha o scanner
|
||||
this.props.addUserTeam({id:this.props.team.id, newQr:e.data}, "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODM4NTk5LCJleHAiOjE1NTI5MjQ5OTksImlhdCI6MTU1MjgzODU5OX0.KmzDoneEdlzyaTS3N4pSuRYHkdrpTVjPFXVIB4tMKPh1BK4KtIOfqHJ_H3FsrUEkXKb_tnf38swO5SKQ1wt0cg"
|
||||
)
|
||||
this.props.addUserTeam({id:this.props.team.id, newQr:e.data}, "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODQ3NTg5LCJleHAiOjE1NTI5MzM5ODksImlhdCI6MTU1Mjg0NzU4OX0.geNuHNEmo8EGn9yK5FyykDuDRhNQTAcEhheY-nwXTVFbs8hmHLbzPkV4xbPq2qMzEDffzxoc7WWdPwC6D-uTEQ" )
|
||||
this.setState({addUser:!this.state.addUser})
|
||||
|
||||
|
||||
}
|
||||
_rm=(qr)=>{
|
||||
this.props.removeUserTeam({TeamId: this.props.team.id, UserQR: this.props.team.cap.qRcode, UserToRemoveQR: qr},"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODQ3NTg5LCJleHAiOjE1NTI5MzM5ODksImlhdCI6MTU1Mjg0NzU4OX0.geNuHNEmo8EGn9yK5FyykDuDRhNQTAcEhheY-nwXTVFbs8hmHLbzPkV4xbPq2qMzEDffzxoc7WWdPwC6D-uTEQ"
|
||||
)
|
||||
}
|
||||
_toggle=()=>{
|
||||
this.setState({addUser:!this.state.addUser})
|
||||
|
||||
|
@ -302,8 +305,8 @@ _toggle=()=>{
|
|||
</Text>
|
||||
<Text>{item.qRcode}</Text>
|
||||
</View>
|
||||
|
||||
<TouchableOpacity style={styles.userRemove}>
|
||||
|
||||
<TouchableOpacity style={styles.userRemove} onPress={()=>this._rm(item.qRcode)}>
|
||||
<Text style={{ fontWeight: "bold" }}>
|
||||
remover
|
||||
</Text>
|
||||
|
|
|
@ -1,246 +1,460 @@
|
|||
import * as React from 'react';
|
||||
import * as React from "react";
|
||||
import {
|
||||
View,
|
||||
StyleSheet,
|
||||
Dimensions,
|
||||
ScrollView,
|
||||
Text,
|
||||
ImageBackground
|
||||
} from 'react-native';
|
||||
View,
|
||||
StyleSheet,
|
||||
Dimensions,
|
||||
Image,
|
||||
ScrollView,
|
||||
Text,
|
||||
Button,
|
||||
TouchableOpacity,
|
||||
ImageBackground,
|
||||
ListView,
|
||||
FlatList,
|
||||
ActivityIndicator
|
||||
} from "react-native";
|
||||
|
||||
import {Divider} from 'react-native-elements'
|
||||
import AppIntroSlider from 'react-native-app-intro-slider';
|
||||
import moment from "moment";
|
||||
import { Divider, Icon, Avatar } from "react-native-elements";
|
||||
import { TabView, TabBar, SceneMap } from "react-native-tab-view";
|
||||
import { RkButton, RkCard, RkText, RkTheme } from "react-native-ui-kitten";
|
||||
import Timeline from "react-native-timeline-feed";
|
||||
|
||||
import NavAbsolute from '../components/Nav';
|
||||
import * as Actions from "../store/actions";
|
||||
import {connect} from "react-redux";
|
||||
import {bindActionCreators} from "redux";
|
||||
import * as Progress from "react-native-progress";
|
||||
|
||||
import NavAbsolute from "../components/Nav";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import { bindActionCreators } from "redux";
|
||||
|
||||
import * as Actions from "../store/actions"; //Import your actionss
|
||||
import Swiper from "react-native-swiper";
|
||||
|
||||
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
||||
const SCREEN_WIDTH = Dimensions.get("window").width;
|
||||
|
||||
import FitImage from "react-native-fit-image";
|
||||
|
||||
import MapView, { PROVIDER_GOOGLE } from "react-native-maps";
|
||||
|
||||
const formatObj = obj => {
|
||||
let a = {};
|
||||
|
||||
a.push({});
|
||||
|
||||
return a;
|
||||
};
|
||||
|
||||
class eventDetail extends React.Component {
|
||||
static navigationOptions = ({ navigation }) => ({
|
||||
header: (
|
||||
<NavAbsolute
|
||||
navigation={navigation}
|
||||
// title={navigation.state.params.info.name}
|
||||
/>
|
||||
)
|
||||
});
|
||||
|
||||
state = {};
|
||||
|
||||
componentDidMount() {
|
||||
this.props.getEvents(this.props.user);
|
||||
|
||||
const { navigation } = this.props;
|
||||
const info = navigation.getParam("info", "error");
|
||||
|
||||
|
||||
static navigationOptions = ({navigation}) => ({
|
||||
header: (
|
||||
<NavAbsolute
|
||||
navigation={navigation}
|
||||
// title={navigation.state.params.info.name}
|
||||
/>
|
||||
),
|
||||
});
|
||||
var a = moment(info.SessionStart);
|
||||
var b = moment(info.SessionEnd);
|
||||
|
||||
console.log(b.diff(a, "minutes")); // 44700
|
||||
}
|
||||
|
||||
_update = () => {
|
||||
this.setState({ user: this.props.user });
|
||||
console.log(this.props.events);
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.data = [];
|
||||
}
|
||||
|
||||
|
||||
renderHeader = () => {
|
||||
return (
|
||||
render() {
|
||||
const { navigation } = this.props;
|
||||
const info = navigation.getParam("info", "error");
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<View style={styles.mainViewStyle}>
|
||||
<ScrollView style={styles.scroll}>
|
||||
<View style={styles.container}>
|
||||
<View style={styles.headerContainer}>
|
||||
<View style={styles.coverContainer}>
|
||||
<ImageBackground
|
||||
source={{
|
||||
uri: 'https://upload.wikimedia.org/wikipedia/commons/9/94/Logo_TvAAC_2014.png',
|
||||
}}
|
||||
style={styles.coverImage}
|
||||
>
|
||||
</ImageBackground>
|
||||
</View>
|
||||
<View style={styles.headerContainer}>
|
||||
<View style={styles.coverContainer}>
|
||||
<ImageBackground
|
||||
source={{
|
||||
uri: `https://tickets.enei.pt/adminpoint/Content/Images/Uploads/Sessions/${this.props.sessionDetail.Image}`
|
||||
}}
|
||||
style={styles.coverImage}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
};
|
||||
|
||||
renderDescription = () => {
|
||||
return (
|
||||
<View style={{height: SCREEN_HEIGHT * (1 / 3)}}>
|
||||
<View>
|
||||
<View style={styles.header}>
|
||||
<View
|
||||
style={{flexDirection: "row"}}>
|
||||
<View style={styles.header}>
|
||||
<View style={styles.nameText}>
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
alignSelf: "center"
|
||||
}}
|
||||
>
|
||||
<View style={styles.timeText}>
|
||||
<Text style={{ color: "#CC1A17", fontSize: 15 }}>
|
||||
{`${moment(this.props.sessionDetail.SessionStart).format("HH:mm")}H - ${moment(this.props.sessionDetail.SessionEnd).format("HH:mm")}H`}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View>
|
||||
<Text
|
||||
style={{
|
||||
margin: 10,
|
||||
marginBottom: 0,
|
||||
marginTop: 0,
|
||||
fontSize: 20,
|
||||
color: "#CC1A17"
|
||||
}}
|
||||
>
|
||||
{this.props.sessionDetail.Name}
|
||||
</Text>
|
||||
|
||||
</View>
|
||||
|
||||
<View style={{ margin: 10 }}>
|
||||
<Progress.Bar
|
||||
color={"#000000"}
|
||||
progress={this.props.sessionDetail.Enrolled / this.props.sessionDetail.MaxAttendees}
|
||||
height={10}
|
||||
unfilledColor={"white"}
|
||||
width={210}
|
||||
/>
|
||||
<Text>
|
||||
{this.props.sessionDetail.Enrolled} / {this.props.sessionDetail.MaxAttendees}
|
||||
</Text>
|
||||
</View>
|
||||
{this.props.sessionDetail != undefined && (
|
||||
<FlatList
|
||||
data={this.props.sessionDetail.Speakers}
|
||||
renderItem={({ item }) => (
|
||||
<View>
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
flexDirection: "row",
|
||||
marginTop: 10
|
||||
}}
|
||||
>
|
||||
<View style={{ width: 100, height: 100, padding: 5 }}>
|
||||
<FitImage
|
||||
source={{
|
||||
uri:
|
||||
"https://tickets.enei.pt/adminpoint/Content/Images/Uploads/Speakers/ffb043cb-3073-421c-a070-5d273b50fc23.jpeg"
|
||||
}}
|
||||
style={{ padding: 5 }}
|
||||
/>
|
||||
</View>
|
||||
<View>
|
||||
<Text
|
||||
style={{color: '#CC1A17', fontSize: 20}}>Febrada</Text>
|
||||
</View>
|
||||
<View style={styles.timeText}>
|
||||
<Text style={{color: "#CC1A17", fontSize: 15}}>
|
||||
<Text style={{color: "#CC1A17", fontSize: 15}}>
|
||||
Sexta 12 -
|
||||
</Text>
|
||||
14h00{/*{info.time === info.timeEnd ? info.time : `${info.time} - ${info.timeEnd}`}*/}
|
||||
style={{
|
||||
fontWeight: "bold",
|
||||
fontSize: 20,
|
||||
margin: 10
|
||||
}}
|
||||
>
|
||||
{item.Name}
|
||||
</Text>
|
||||
<Text style={{ marginLeft: 10 }}>
|
||||
{item.MoreInfo}
|
||||
</Text>
|
||||
<TouchableOpacity>
|
||||
<Text
|
||||
style={{ color: "#CC1A17", marginLeft: 10 }}
|
||||
>
|
||||
{item.Title}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.descContainer}>
|
||||
<Text style={{fontSize: 20, color: '#CC1A17'}}>Descrição</Text>
|
||||
<Divider style={{backgroundColor: '#000'}}/>
|
||||
<Text style={{paddingRight: 10, paddingTop: 10}}>g</Text>
|
||||
</View>
|
||||
<View>
|
||||
<Text
|
||||
style={{
|
||||
fontWeight: "bold",
|
||||
color: "#CC1A17",
|
||||
margin: 10,
|
||||
marginBottom: 0,
|
||||
fontSize: 15
|
||||
}}
|
||||
>
|
||||
Descrição do orador:
|
||||
</Text>
|
||||
<Text style={{ margin: 10 }}>{item.Description}</Text>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
|
||||
<View style={styles.block}>
|
||||
<Text
|
||||
style={{ fontSize: 15, color: "#CC1A17", fontWeight: "bold" }}
|
||||
>
|
||||
Descrição da palestra/workshop
|
||||
</Text>
|
||||
<Divider style={{ backgroundColor: "#000" }} />
|
||||
<View style={{ marginTop: 10 }}>
|
||||
<Text>{this.props.sessionDetail.Description}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
renderSlider = () => {
|
||||
const slides = [
|
||||
{
|
||||
key: 'somethun',
|
||||
title: 'Title 1',
|
||||
titleStyle: '',
|
||||
text: 'blblbalbalba',
|
||||
textStyle: '',
|
||||
backgroundColor: '#59b2ab',
|
||||
},
|
||||
{
|
||||
key: 'somethun-dos',
|
||||
title: 'Title 2',
|
||||
titleStyle: '',
|
||||
text: 'blblbalbalba',
|
||||
textStyle: '',
|
||||
backgroundColor: '#febe29',
|
||||
},
|
||||
{
|
||||
key: 'somethun1',
|
||||
title: 'Rocket guy',
|
||||
titleStyle: '',
|
||||
text: 'blblbalbalba',
|
||||
textStyle: '',
|
||||
backgroundColor: '#22bcb5',
|
||||
}
|
||||
];
|
||||
return (
|
||||
<AppIntroSlider
|
||||
slides={slides}
|
||||
style={{height: SCREEN_WIDTH * 0.54}}
|
||||
activeDotStyle={{backgroundColor:'#CC1A17'}}
|
||||
renderDoneButton={this._buyFinosOrBifanas()}
|
||||
renderNextButton={this._renderNextButton}
|
||||
</View>
|
||||
<View style={styles.block}>
|
||||
<Text
|
||||
style={{ fontSize: 15, color: "#CC1A17", fontWeight: "bold" }}
|
||||
>
|
||||
Localização
|
||||
</Text>
|
||||
<Divider style={{ backgroundColor: "#000", marginBottom: 10 }} />
|
||||
<Image
|
||||
source={require("../assets/img/campus.png")}
|
||||
style={{ width: SCREEN_WIDTH * 0.9 }}
|
||||
/>
|
||||
)
|
||||
};
|
||||
|
||||
_buyFinosOrBifanas = () => {
|
||||
//Modal
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
|
||||
<View style={styles.mainViewStyle}>
|
||||
<ScrollView style={styles.scroll}>
|
||||
<View style={styles.container}>
|
||||
<View style={styles.headerContainer}>
|
||||
{this.renderHeader()}
|
||||
</View>
|
||||
<View style={{backgroundColor: "#fff"}}>
|
||||
{this.renderDescription()}
|
||||
{this.renderSlider()}
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
</View>
|
||||
</ScrollView>
|
||||
<Divider style={{ backgroundColor: "black" }} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
block: {
|
||||
marginTop: 15,
|
||||
|
||||
mainContent: {
|
||||
flex: 1,
|
||||
backgroundColor: "white",
|
||||
padding: 20,
|
||||
shadowOffset: {
|
||||
width: 0,
|
||||
height: 2
|
||||
},
|
||||
shadowOpacity: 0.25,
|
||||
shadowRadius: 3.84,
|
||||
|
||||
elevation: 3
|
||||
},
|
||||
AttendeeContainer: {
|
||||
flexDirection: "row",
|
||||
height: 55,
|
||||
justifyContent: "center",
|
||||
marginLeft: 10,
|
||||
marginRight: 10
|
||||
},
|
||||
|
||||
centerRow: {
|
||||
alignItems: "center",
|
||||
backgroundColor: "transparent",
|
||||
flex: 3,
|
||||
flexDirection: "column",
|
||||
justifyContent: "center"
|
||||
},
|
||||
|
||||
leftRow: {
|
||||
backgroundColor: "transparent",
|
||||
flex: 1,
|
||||
flexDirection: "row",
|
||||
justifyContent: "flex-start",
|
||||
alignSelf: "center"
|
||||
},
|
||||
rightRow: {
|
||||
alignItems: "flex-end",
|
||||
backgroundColor: "transparent",
|
||||
flex: 2,
|
||||
flexDirection: "row",
|
||||
justifyContent: "flex-end",
|
||||
marginRight: 4,
|
||||
alignSelf: "center"
|
||||
},
|
||||
|
||||
icon: {
|
||||
justifyContent: "flex-start",
|
||||
marginTop: 2.8
|
||||
},
|
||||
|
||||
nameAttendee: {
|
||||
alignSelf: "center",
|
||||
fontSize: 20,
|
||||
fontWeight: "400",
|
||||
color: "#000",
|
||||
marginBottom: 10
|
||||
},
|
||||
|
||||
details: {
|
||||
marginTop: 20,
|
||||
flex: 1,
|
||||
alignSelf: "center"
|
||||
},
|
||||
|
||||
infoRow: {
|
||||
margin: 25
|
||||
},
|
||||
|
||||
ramoText: {
|
||||
alignSelf: "flex-start",
|
||||
marginBottom: 5,
|
||||
color: "white",
|
||||
fontSize: 17,
|
||||
fontWeight: "400"
|
||||
},
|
||||
|
||||
timeText: {
|
||||
alignItems: "flex-end",
|
||||
flex: 2,
|
||||
lineHeight: 10,
|
||||
marginRight: 20
|
||||
},
|
||||
|
||||
mainViewStyle: {
|
||||
flex: 1,
|
||||
flexGrow: 1,
|
||||
flexDirection: "column"
|
||||
},
|
||||
|
||||
scroll: {
|
||||
backgroundColor: "#eee",
|
||||
flex: 1
|
||||
//marginBottom: 55,
|
||||
},
|
||||
|
||||
header: {
|
||||
flex: 1,
|
||||
padding: 10,
|
||||
backgroundColor: "white",
|
||||
borderRadius: 0,
|
||||
shadowColor: "#000",
|
||||
shadowOffset: {
|
||||
width: 0,
|
||||
height: 2
|
||||
},
|
||||
shadowOpacity: 0.25,
|
||||
shadowRadius: 3.84,
|
||||
|
||||
elevation: 3
|
||||
},
|
||||
cardContainer: {
|
||||
flex: 1,
|
||||
padding: 10,
|
||||
// margin: 20,
|
||||
backgroundColor: "white",
|
||||
borderRadius: 5
|
||||
},
|
||||
|
||||
headerContainer: {
|
||||
flex: 1
|
||||
},
|
||||
|
||||
container: {
|
||||
flex: 1,
|
||||
flexDirection: "column"
|
||||
},
|
||||
coverContainer: {
|
||||
position: "relative"
|
||||
},
|
||||
coverImage: {
|
||||
height: Dimensions.get("window").width * (2 / 4),
|
||||
width: Dimensions.get("window").width
|
||||
},
|
||||
/*headerContainer: {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-around',
|
||||
},
|
||||
text: {
|
||||
//color: 'rgba(255, 255, 255, 0.8)',
|
||||
backgroundColor: 'transparent',
|
||||
textAlign: 'center',
|
||||
color:'#000',
|
||||
paddingHorizontal: 16,
|
||||
},
|
||||
title: {
|
||||
fontSize: 22,
|
||||
color: 'white',
|
||||
backgroundColor: 'transparent',
|
||||
textAlign: 'center',
|
||||
marginBottom: 16,
|
||||
},
|
||||
backgroundColor: '#FFF',
|
||||
},*/
|
||||
|
||||
carreerPathContainer: {
|
||||
backgroundColor: "#CC1A17",
|
||||
height: 50,
|
||||
flex: 1,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
paddingTop: 15
|
||||
},
|
||||
carreerPathText: {
|
||||
height: 50,
|
||||
color: "white",
|
||||
fontWeight: "bold",
|
||||
fontSize: 20
|
||||
},
|
||||
companyHeader: {
|
||||
backgroundColor: "#dddddd",
|
||||
// height:150,
|
||||
borderRadius: 5,
|
||||
margin: 10,
|
||||
padding: 10
|
||||
},
|
||||
companyTitle: {
|
||||
paddingBottom: 5,
|
||||
fontWeight: "bold",
|
||||
color: "#777777",
|
||||
fontSize: 17
|
||||
|
||||
header: {
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
padding: 10,
|
||||
backgroundColor: 'white',
|
||||
//height: SCREEN_HEIGHT * (1 / 3),
|
||||
},
|
||||
// padding:20
|
||||
},
|
||||
companyLogo: {
|
||||
borderRadius: 20
|
||||
},
|
||||
|
||||
nameText: {
|
||||
alignSelf: 'flex-start',
|
||||
flex: 1,
|
||||
|
||||
},
|
||||
|
||||
timeText: {
|
||||
alignItems: 'flex-end',
|
||||
flex: 1,
|
||||
marginRight: 4,
|
||||
},
|
||||
|
||||
mainViewStyle: {
|
||||
flex: 1,
|
||||
flexGrow: 1,
|
||||
flexDirection: 'column',
|
||||
},
|
||||
|
||||
scroll: {
|
||||
backgroundColor: '#eee',
|
||||
flex: 1,
|
||||
//marginBottom: 55,
|
||||
},
|
||||
|
||||
|
||||
descContainer: {
|
||||
padding: 10,
|
||||
},
|
||||
|
||||
headerContainer: {
|
||||
flex: 1,
|
||||
},
|
||||
|
||||
container: {
|
||||
flex: 1,
|
||||
flexDirection: 'column',
|
||||
},
|
||||
coverContainer: {
|
||||
position: 'relative',
|
||||
},
|
||||
coverImage: {
|
||||
height: Dimensions.get('window').width * (2 / 4),
|
||||
width: Dimensions.get('window').width,
|
||||
},
|
||||
wrapper: {},
|
||||
company: {
|
||||
flex: 1,
|
||||
flexDirection: "row",
|
||||
// backgroundColor:'red',
|
||||
color: "black"
|
||||
},
|
||||
|
||||
companyLogoContainer: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
width: "60%",
|
||||
// backgroundColor:'white',
|
||||
margin: 20
|
||||
},
|
||||
aboutCompany: {
|
||||
width: SCREEN_WIDTH,
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function mapStateToProps(state, props) {
|
||||
|
||||
return {
|
||||
|
||||
token: state.apiReducer.token,
|
||||
user: state.apiReducer.user,
|
||||
logged: state.apiReducer.logged,
|
||||
events: state.apiReducer.events,
|
||||
careerPath: state.apiReducer.careerPath,
|
||||
|
||||
}
|
||||
return {
|
||||
token: state.apiReducer.token,
|
||||
user: state.apiReducer.user,
|
||||
logged: state.apiReducer.logged,
|
||||
events: state.apiReducer.events,
|
||||
careerPath: state.apiReducer.careerPath,
|
||||
sessionDetail: state.apiReducer.sessionDetail
|
||||
};
|
||||
}
|
||||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
|
||||
return bindActionCreators(Actions, dispatch);
|
||||
return bindActionCreators(Actions, dispatch);
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(eventDetail);
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(eventDetail);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//MINHA API
|
||||
|
||||
export const GET_TEAM='GET_TEAM'
|
||||
|
||||
export const GET_INTERNAL_EVENTS ='GET_EVENTS'
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -24,7 +24,8 @@ import {
|
|||
REMOVE_SESSION,
|
||||
UPDATE_USER,
|
||||
SESSION_DETAIL,
|
||||
GET_TEAM
|
||||
GET_TEAM,
|
||||
GET_INTERNAL_EVENTS
|
||||
} from "./actionTypes"; //Import the actions types constant we defined in our actions
|
||||
|
||||
import moment from "moment";
|
||||
|
@ -41,6 +42,71 @@ axios.defaults.baseURL = "https://tickets.enei.pt/internal/api";
|
|||
|
||||
const map = require("lodash/fp/map").convert({ cap: false });
|
||||
|
||||
|
||||
export function getAllEvents(tokenInternal){
|
||||
|
||||
axios.defaults.headers.common = {
|
||||
Authorization: `bearer ${tokenInternal}`
|
||||
};
|
||||
axios.defaults.baseURL = "http://127.0.0.1:5000/api";
|
||||
return dispatch => {
|
||||
axios
|
||||
.get('/Events')
|
||||
.then(a => {
|
||||
console.log("sucesso!");
|
||||
console.log(a);
|
||||
dispatch({
|
||||
type: GET_INTERNAL_EVENTS,
|
||||
events:a.data
|
||||
});
|
||||
})
|
||||
.catch(p => {
|
||||
|
||||
console.log(p);
|
||||
Alert.alert("ERRO!", "erro a obter os eventos")
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: OPEN_MODAL
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export function removeUserTeam(data, tokenInternal){
|
||||
|
||||
//remove/member
|
||||
axios.defaults.headers.common = {
|
||||
Authorization: `bearer ${tokenInternal}`
|
||||
};
|
||||
|
||||
axios.defaults.baseURL = "http://127.0.0.1:5000";
|
||||
return dispatch => {
|
||||
axios
|
||||
.post("/api/Teams/remove/member",data)
|
||||
.then(a => {
|
||||
|
||||
if(a.status==201){
|
||||
console.log("sucesso!");
|
||||
console.log(a.data);
|
||||
Alert.alert("Sucesso!","Elemento removido com sucesso!!")
|
||||
}
|
||||
|
||||
})
|
||||
.catch(p => {
|
||||
console.log(p);
|
||||
Alert.alert("ERRO!!", "Erro a remover!")
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: OPEN_MODAL
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export function addUserTeam(data, tokenInternal){
|
||||
axios.defaults.headers.common = {
|
||||
Authorization: `bearer ${tokenInternal}`
|
||||
|
@ -48,13 +114,19 @@ export function addUserTeam(data, tokenInternal){
|
|||
axios.defaults.baseURL = "http://127.0.0.1:5000";
|
||||
return dispatch => {
|
||||
axios
|
||||
.post("/api/add/member",data)
|
||||
.post("/api/Teams/add/member",data)
|
||||
.then(a => {
|
||||
console.log("sucesso!");
|
||||
console.log(a.data);
|
||||
|
||||
if(a.status==201){
|
||||
console.log("sucesso!");
|
||||
console.log(a.data);
|
||||
Alert.alert("Sucesso!","Elemento adicionado com sucesso!!")
|
||||
}
|
||||
|
||||
})
|
||||
.catch(p => {
|
||||
console.log(p);
|
||||
Alert.alert("ERRO!!", "Esse utlizador já se encontra numa equipa!!")
|
||||
});
|
||||
|
||||
dispatch({
|
||||
|
|
|
@ -22,7 +22,9 @@ export {checkUser,
|
|||
resetPassword,
|
||||
getSessionDetails,
|
||||
getUserTeam,
|
||||
addUserTeam
|
||||
addUserTeam,
|
||||
removeUserTeam,
|
||||
getAllEvents
|
||||
|
||||
} from "./api"
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@ import {
|
|||
REMOVE_SESSION,
|
||||
UPDATE_USER,
|
||||
SESSION_DETAIL,
|
||||
GET_TEAM
|
||||
GET_TEAM,
|
||||
GET_INTERNAL_EVENTS
|
||||
} from "../actions/actionTypes"; //Import the actions types constant we defined in our actions
|
||||
|
||||
import { REHYDRATE } from "redux-persist";
|
||||
|
@ -58,8 +59,8 @@ let apiState = {
|
|||
alojamento: [],
|
||||
sessionDetail:{},
|
||||
team:{},
|
||||
internalToken: "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODM4NTk5LCJleHAiOjE1NTI5MjQ5OTksImlhdCI6MTU1MjgzODU5OX0.KmzDoneEdlzyaTS3N4pSuRYHkdrpTVjPFXVIB4tMKPh1BK4KtIOfqHJ_H3FsrUEkXKb_tnf38swO5SKQ1wt0cg"
|
||||
|
||||
internalToken: "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODM4NTk5LCJleHAiOjE1NTI5MjQ5OTksImlhdCI6MTU1MjgzODU5OX0.KmzDoneEdlzyaTS3N4pSuRYHkdrpTVjPFXVIB4tMKPh1BK4KtIOfqHJ_H3FsrUEkXKb_tnf38swO5SKQ1wt0cg",
|
||||
events:[]
|
||||
};
|
||||
|
||||
const apiReducer = (state = apiState, action) => {
|
||||
|
@ -105,9 +106,11 @@ const apiReducer = (state = apiState, action) => {
|
|||
},
|
||||
token: action.payload.apiReducer.token,
|
||||
team: action.payload.apiReducer.team,
|
||||
events: action.payload.apiReducer.events
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
case "CHANGE_CONNECTION_STATUS":
|
||||
return Object.assign({}, state, {
|
||||
isConnected: action.isConnected
|
||||
|
@ -154,6 +157,10 @@ const apiReducer = (state = apiState, action) => {
|
|||
|
||||
team: action.team
|
||||
});
|
||||
case GET_INTERNAL_EVENTS:
|
||||
return Object.assign({}, state, {
|
||||
events: action.events
|
||||
});
|
||||
|
||||
return state;
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace api.Controllers
|
|||
|
||||
// GET api/events
|
||||
// GET all events
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetEvents()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using api.Data;
|
||||
using api.Dtos;
|
||||
|
@ -109,25 +110,27 @@ namespace api.Controllers
|
|||
|
||||
var users = await context.Users.ToListAsync();
|
||||
|
||||
List<UserForListDto> usersToReturn= new List<UserForListDto>();
|
||||
List<UserForListDto> usersToReturn = new List<UserForListDto>();
|
||||
|
||||
for (var t = 0; t < users.Count; t++){
|
||||
|
||||
if(users[t].team!= null && users[t].team.Id == allTeams[i].Id){
|
||||
|
||||
UserForListDto u = new UserForListDto();
|
||||
|
||||
_mapper.Map(users[t], u);
|
||||
for (var t = 0; t < users.Count; t++)
|
||||
{
|
||||
|
||||
usersToReturn.Add(u);
|
||||
}
|
||||
if (users[t].team != null && users[t].team.Id == allTeams[i].Id)
|
||||
{
|
||||
|
||||
UserForListDto u = new UserForListDto();
|
||||
|
||||
_mapper.Map(users[t], u);
|
||||
|
||||
usersToReturn.Add(u);
|
||||
}
|
||||
}
|
||||
|
||||
UserForListDto uT = new UserForListDto();
|
||||
|
||||
_mapper.Map(usr, uT);
|
||||
|
||||
rTeam.Membros= usersToReturn;
|
||||
rTeam.Membros = usersToReturn;
|
||||
rTeam.Cap = uT;
|
||||
|
||||
}
|
||||
|
@ -253,32 +256,48 @@ namespace api.Controllers
|
|||
public async Task<IActionResult> RemoveTeamMember(TeamRemoveMEmber MemberToRemove)
|
||||
{
|
||||
|
||||
User rmMember = await context.Users.FirstOrDefaultAsync(u => u.QRcode == MemberToRemove.UserToRemoveQR);
|
||||
Console.WriteLine(MemberToRemove.TeamID);
|
||||
//obtem o user para remover
|
||||
|
||||
Team tEdit = await context.Teams.FirstOrDefaultAsync(t => t.Id == MemberToRemove.TeamID);
|
||||
try
|
||||
{
|
||||
User rmMember = await context.Users.FirstOrDefaultAsync(u => u.QRcode == MemberToRemove.UserToRemoveQR);
|
||||
|
||||
if (rmMember.QRcode == tEdit.CapQR)
|
||||
Console.WriteLine(rmMember.QRcode);
|
||||
|
||||
//encontra a equipa de onde quer remover o user
|
||||
Team tEdit = await context.Teams.FirstOrDefaultAsync(t => t.Id == MemberToRemove.TeamID);
|
||||
|
||||
Console.WriteLine(tEdit.Nome);
|
||||
|
||||
var id = 0;
|
||||
|
||||
if (rmMember.QRcode == tEdit.CapQR)
|
||||
{
|
||||
return StatusCode(403);
|
||||
}
|
||||
|
||||
if (rmMember.team == tEdit)
|
||||
{
|
||||
tEdit.NMembros--;
|
||||
rmMember.team = null;
|
||||
|
||||
context.Teams.Update(tEdit);
|
||||
context.Users.Update(rmMember);
|
||||
|
||||
var result = context.SaveChanges();
|
||||
|
||||
return StatusCode(201);
|
||||
}
|
||||
else
|
||||
{
|
||||
return StatusCode(403);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return StatusCode(403);
|
||||
}
|
||||
|
||||
if (rmMember.team == tEdit)
|
||||
{
|
||||
tEdit.NMembros--;
|
||||
rmMember.team = null;
|
||||
|
||||
context.Teams.Update(tEdit);
|
||||
context.Users.Update(rmMember);
|
||||
|
||||
var result = context.SaveChanges();
|
||||
|
||||
return StatusCode(201);
|
||||
}
|
||||
else
|
||||
{
|
||||
return StatusCode(403);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,488 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using api.Data;
|
||||
|
||||
namespace api.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20190317185246_update")]
|
||||
partial class update
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<int>("RoleId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("ProviderKey");
|
||||
|
||||
b.Property<string>("ProviderDisplayName");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
||||
{
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Cromos", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("DescLocked");
|
||||
|
||||
b.Property<string>("DescMostrar");
|
||||
|
||||
b.Property<string>("DescUnlocked");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<string>("QRCode");
|
||||
|
||||
b.Property<int?>("imgId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("imgId");
|
||||
|
||||
b.ToTable("Cromos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Event", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Desc");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<bool>("aDecorrer");
|
||||
|
||||
b.Property<string>("horas");
|
||||
|
||||
b.Property<string>("imagem");
|
||||
|
||||
b.Property<string>("localizacaoo");
|
||||
|
||||
b.Property<string>("notas");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLoc", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Desc");
|
||||
|
||||
b.Property<int>("EventId");
|
||||
|
||||
b.Property<int?>("ImgId");
|
||||
|
||||
b.Property<float>("Lat");
|
||||
|
||||
b.Property<float>("Long");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ImgId");
|
||||
|
||||
b.ToTable("EventLocs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLocVisited", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int?>("LocationId");
|
||||
|
||||
b.Property<int?>("TeamId");
|
||||
|
||||
b.Property<DateTime>("timestamp");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LocationId");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("EventLocsVisited");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Log", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int?>("UserId");
|
||||
|
||||
b.Property<int?>("UserId1");
|
||||
|
||||
b.Property<int>("amount");
|
||||
|
||||
b.Property<int>("available");
|
||||
|
||||
b.Property<string>("logType");
|
||||
|
||||
b.Property<int?>("productId");
|
||||
|
||||
b.Property<string>("transactionId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("UserId1");
|
||||
|
||||
b.HasIndex("productId");
|
||||
|
||||
b.ToTable("Logs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Photo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("DateAdded");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<bool>("IsMain");
|
||||
|
||||
b.Property<string>("Url");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Photos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Product", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("basePrice");
|
||||
|
||||
b.Property<string>("name");
|
||||
|
||||
b.Property<float>("revenue");
|
||||
|
||||
b.Property<int>("sold");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Products");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Role", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Team", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("CapQR");
|
||||
|
||||
b.Property<int>("EventId");
|
||||
|
||||
b.Property<int>("NMembros");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<int>("Pontos");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Teams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.User", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("AccessFailedCount");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<bool>("EmailConfirmed");
|
||||
|
||||
b.Property<bool>("LockoutEnabled");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("PasswordHash");
|
||||
|
||||
b.Property<string>("PhoneNumber");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed");
|
||||
|
||||
b.Property<string>("QRcode");
|
||||
|
||||
b.Property<string>("SecurityStamp");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("cromos");
|
||||
|
||||
b.Property<int>("drinks");
|
||||
|
||||
b.Property<int>("food");
|
||||
|
||||
b.Property<string>("fullName");
|
||||
|
||||
b.Property<int?>("teamID");
|
||||
|
||||
b.Property<string>("university");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasName("UserNameIndex");
|
||||
|
||||
b.HasIndex("teamID");
|
||||
|
||||
b.ToTable("AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.UserRole", b =>
|
||||
{
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.Property<int>("RoleId");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Value", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("Values");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Role")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Cromos", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Photo", "img")
|
||||
.WithMany()
|
||||
.HasForeignKey("imgId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLoc", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Photo", "Img")
|
||||
.WithMany()
|
||||
.HasForeignKey("ImgId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLocVisited", b =>
|
||||
{
|
||||
b.HasOne("api.Models.EventLoc", "Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId");
|
||||
|
||||
b.HasOne("api.Models.Team", "Team")
|
||||
.WithMany()
|
||||
.HasForeignKey("TeamId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Log", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany("logsFebrada")
|
||||
.HasForeignKey("UserId");
|
||||
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany("logsFestarola")
|
||||
.HasForeignKey("UserId1");
|
||||
|
||||
b.HasOne("api.Models.Product", "product")
|
||||
.WithMany()
|
||||
.HasForeignKey("productId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Photo", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User", "User")
|
||||
.WithMany("Photos")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.User", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Team", "team")
|
||||
.WithMany()
|
||||
.HasForeignKey("teamID");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.UserRole", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("api.Models.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace api.Migrations
|
||||
{
|
||||
public partial class update : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "aDecorrer",
|
||||
table: "Events",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "horas",
|
||||
table: "Events",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "imagem",
|
||||
table: "Events",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "localizacaoo",
|
||||
table: "Events",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "notas",
|
||||
table: "Events",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "fullName",
|
||||
table: "AspNetUsers",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "university",
|
||||
table: "AspNetUsers",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "aDecorrer",
|
||||
table: "Events");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "horas",
|
||||
table: "Events");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "imagem",
|
||||
table: "Events");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "localizacaoo",
|
||||
table: "Events");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "notas",
|
||||
table: "Events");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "fullName",
|
||||
table: "AspNetUsers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "university",
|
||||
table: "AspNetUsers");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,488 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using api.Data;
|
||||
|
||||
namespace api.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20190317185432_updatev2")]
|
||||
partial class updatev2
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<int>("RoleId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("ProviderKey");
|
||||
|
||||
b.Property<string>("ProviderDisplayName");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
||||
{
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Cromos", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("DescLocked");
|
||||
|
||||
b.Property<string>("DescMostrar");
|
||||
|
||||
b.Property<string>("DescUnlocked");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<string>("QRCode");
|
||||
|
||||
b.Property<int?>("imgId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("imgId");
|
||||
|
||||
b.ToTable("Cromos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Event", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Desc");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<bool>("aDecorrer");
|
||||
|
||||
b.Property<string>("horas");
|
||||
|
||||
b.Property<string>("imagem");
|
||||
|
||||
b.Property<string>("localizacao");
|
||||
|
||||
b.Property<string>("notas");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLoc", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Desc");
|
||||
|
||||
b.Property<int>("EventId");
|
||||
|
||||
b.Property<int?>("ImgId");
|
||||
|
||||
b.Property<float>("Lat");
|
||||
|
||||
b.Property<float>("Long");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ImgId");
|
||||
|
||||
b.ToTable("EventLocs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLocVisited", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int?>("LocationId");
|
||||
|
||||
b.Property<int?>("TeamId");
|
||||
|
||||
b.Property<DateTime>("timestamp");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LocationId");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("EventLocsVisited");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Log", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int?>("UserId");
|
||||
|
||||
b.Property<int?>("UserId1");
|
||||
|
||||
b.Property<int>("amount");
|
||||
|
||||
b.Property<int>("available");
|
||||
|
||||
b.Property<string>("logType");
|
||||
|
||||
b.Property<int?>("productId");
|
||||
|
||||
b.Property<string>("transactionId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("UserId1");
|
||||
|
||||
b.HasIndex("productId");
|
||||
|
||||
b.ToTable("Logs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Photo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("DateAdded");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<bool>("IsMain");
|
||||
|
||||
b.Property<string>("Url");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Photos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Product", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("basePrice");
|
||||
|
||||
b.Property<string>("name");
|
||||
|
||||
b.Property<float>("revenue");
|
||||
|
||||
b.Property<int>("sold");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Products");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Role", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Team", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("CapQR");
|
||||
|
||||
b.Property<int>("EventId");
|
||||
|
||||
b.Property<int>("NMembros");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<int>("Pontos");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Teams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.User", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("AccessFailedCount");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<bool>("EmailConfirmed");
|
||||
|
||||
b.Property<bool>("LockoutEnabled");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("PasswordHash");
|
||||
|
||||
b.Property<string>("PhoneNumber");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed");
|
||||
|
||||
b.Property<string>("QRcode");
|
||||
|
||||
b.Property<string>("SecurityStamp");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("cromos");
|
||||
|
||||
b.Property<int>("drinks");
|
||||
|
||||
b.Property<int>("food");
|
||||
|
||||
b.Property<string>("fullName");
|
||||
|
||||
b.Property<int?>("teamID");
|
||||
|
||||
b.Property<string>("university");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasName("UserNameIndex");
|
||||
|
||||
b.HasIndex("teamID");
|
||||
|
||||
b.ToTable("AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.UserRole", b =>
|
||||
{
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.Property<int>("RoleId");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Value", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("Values");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Role")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Cromos", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Photo", "img")
|
||||
.WithMany()
|
||||
.HasForeignKey("imgId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLoc", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Photo", "Img")
|
||||
.WithMany()
|
||||
.HasForeignKey("ImgId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLocVisited", b =>
|
||||
{
|
||||
b.HasOne("api.Models.EventLoc", "Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId");
|
||||
|
||||
b.HasOne("api.Models.Team", "Team")
|
||||
.WithMany()
|
||||
.HasForeignKey("TeamId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Log", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany("logsFebrada")
|
||||
.HasForeignKey("UserId");
|
||||
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany("logsFestarola")
|
||||
.HasForeignKey("UserId1");
|
||||
|
||||
b.HasOne("api.Models.Product", "product")
|
||||
.WithMany()
|
||||
.HasForeignKey("productId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Photo", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User", "User")
|
||||
.WithMany("Photos")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.User", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Team", "team")
|
||||
.WithMany()
|
||||
.HasForeignKey("teamID");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.UserRole", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("api.Models.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace api.Migrations
|
||||
{
|
||||
public partial class updatev2 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "localizacaoo",
|
||||
table: "Events",
|
||||
newName: "localizacao");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "localizacao",
|
||||
table: "Events",
|
||||
newName: "localizacaoo");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,492 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using api.Data;
|
||||
|
||||
namespace api.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20190317190817_updatev3")]
|
||||
partial class updatev3
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<int>("RoleId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("ProviderKey");
|
||||
|
||||
b.Property<string>("ProviderDisplayName");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
||||
{
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Cromos", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("DescLocked");
|
||||
|
||||
b.Property<string>("DescMostrar");
|
||||
|
||||
b.Property<string>("DescUnlocked");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<string>("QRCode");
|
||||
|
||||
b.Property<int?>("imgId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("imgId");
|
||||
|
||||
b.ToTable("Cromos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Event", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Desc");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<bool>("aDecorrer");
|
||||
|
||||
b.Property<string>("horas");
|
||||
|
||||
b.Property<string>("imagem");
|
||||
|
||||
b.Property<string>("localizacao");
|
||||
|
||||
b.Property<string>("notas");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLoc", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Desc");
|
||||
|
||||
b.Property<int>("EventId");
|
||||
|
||||
b.Property<int?>("ImgId");
|
||||
|
||||
b.Property<float>("Lat");
|
||||
|
||||
b.Property<float>("Long");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ImgId");
|
||||
|
||||
b.ToTable("EventLocs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLocVisited", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int?>("LocationId");
|
||||
|
||||
b.Property<int?>("TeamId");
|
||||
|
||||
b.Property<DateTime>("timestamp");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LocationId");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("EventLocsVisited");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Log", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int?>("UserId");
|
||||
|
||||
b.Property<int?>("UserId1");
|
||||
|
||||
b.Property<int>("amount");
|
||||
|
||||
b.Property<int>("available");
|
||||
|
||||
b.Property<string>("logType");
|
||||
|
||||
b.Property<int?>("productId");
|
||||
|
||||
b.Property<string>("transactionId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("UserId1");
|
||||
|
||||
b.HasIndex("productId");
|
||||
|
||||
b.ToTable("Logs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Photo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("DateAdded");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<bool>("IsMain");
|
||||
|
||||
b.Property<string>("Url");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Photos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Product", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("basePrice");
|
||||
|
||||
b.Property<string>("name");
|
||||
|
||||
b.Property<float>("revenue");
|
||||
|
||||
b.Property<int>("sold");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Products");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Role", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Team", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("CapQR");
|
||||
|
||||
b.Property<int>("EventId");
|
||||
|
||||
b.Property<int>("NMembros");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<int>("Pontos");
|
||||
|
||||
b.Property<int>("pagamento");
|
||||
|
||||
b.Property<int>("pagamentoVerifyCode");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Teams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.User", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("AccessFailedCount");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<bool>("EmailConfirmed");
|
||||
|
||||
b.Property<bool>("LockoutEnabled");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("PasswordHash");
|
||||
|
||||
b.Property<string>("PhoneNumber");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed");
|
||||
|
||||
b.Property<string>("QRcode");
|
||||
|
||||
b.Property<string>("SecurityStamp");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("cromos");
|
||||
|
||||
b.Property<int>("drinks");
|
||||
|
||||
b.Property<int>("food");
|
||||
|
||||
b.Property<string>("fullName");
|
||||
|
||||
b.Property<int?>("teamID");
|
||||
|
||||
b.Property<string>("university");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasName("UserNameIndex");
|
||||
|
||||
b.HasIndex("teamID");
|
||||
|
||||
b.ToTable("AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.UserRole", b =>
|
||||
{
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.Property<int>("RoleId");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Value", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("Values");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Role")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Cromos", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Photo", "img")
|
||||
.WithMany()
|
||||
.HasForeignKey("imgId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLoc", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Photo", "Img")
|
||||
.WithMany()
|
||||
.HasForeignKey("ImgId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLocVisited", b =>
|
||||
{
|
||||
b.HasOne("api.Models.EventLoc", "Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId");
|
||||
|
||||
b.HasOne("api.Models.Team", "Team")
|
||||
.WithMany()
|
||||
.HasForeignKey("TeamId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Log", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany("logsFebrada")
|
||||
.HasForeignKey("UserId");
|
||||
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany("logsFestarola")
|
||||
.HasForeignKey("UserId1");
|
||||
|
||||
b.HasOne("api.Models.Product", "product")
|
||||
.WithMany()
|
||||
.HasForeignKey("productId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Photo", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User", "User")
|
||||
.WithMany("Photos")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.User", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Team", "team")
|
||||
.WithMany()
|
||||
.HasForeignKey("teamID");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.UserRole", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("api.Models.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace api.Migrations
|
||||
{
|
||||
public partial class updatev3 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pagamento",
|
||||
table: "Teams",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pagamentoVerifyCode",
|
||||
table: "Teams",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pagamento",
|
||||
table: "Teams");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pagamentoVerifyCode",
|
||||
table: "Teams");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,492 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using api.Data;
|
||||
|
||||
namespace api.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20190317190928_updatev5")]
|
||||
partial class updatev5
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<int>("RoleId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("ProviderKey");
|
||||
|
||||
b.Property<string>("ProviderDisplayName");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
||||
{
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<string>("Value");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Cromos", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("DescLocked");
|
||||
|
||||
b.Property<string>("DescMostrar");
|
||||
|
||||
b.Property<string>("DescUnlocked");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<string>("QRCode");
|
||||
|
||||
b.Property<int?>("imgId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("imgId");
|
||||
|
||||
b.ToTable("Cromos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Event", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Desc");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<bool>("aDecorrer");
|
||||
|
||||
b.Property<string>("horas");
|
||||
|
||||
b.Property<string>("imagem");
|
||||
|
||||
b.Property<string>("localizacao");
|
||||
|
||||
b.Property<string>("notas");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLoc", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Desc");
|
||||
|
||||
b.Property<int>("EventId");
|
||||
|
||||
b.Property<int?>("ImgId");
|
||||
|
||||
b.Property<float>("Lat");
|
||||
|
||||
b.Property<float>("Long");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ImgId");
|
||||
|
||||
b.ToTable("EventLocs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLocVisited", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int?>("LocationId");
|
||||
|
||||
b.Property<int?>("TeamId");
|
||||
|
||||
b.Property<DateTime>("timestamp");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LocationId");
|
||||
|
||||
b.HasIndex("TeamId");
|
||||
|
||||
b.ToTable("EventLocsVisited");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Log", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int?>("UserId");
|
||||
|
||||
b.Property<int?>("UserId1");
|
||||
|
||||
b.Property<int>("amount");
|
||||
|
||||
b.Property<int>("available");
|
||||
|
||||
b.Property<string>("logType");
|
||||
|
||||
b.Property<int?>("productId");
|
||||
|
||||
b.Property<string>("transactionId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.HasIndex("UserId1");
|
||||
|
||||
b.HasIndex("productId");
|
||||
|
||||
b.ToTable("Logs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Photo", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("DateAdded");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<bool>("IsMain");
|
||||
|
||||
b.Property<string>("Url");
|
||||
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Photos");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Product", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("basePrice");
|
||||
|
||||
b.Property<string>("name");
|
||||
|
||||
b.Property<float>("revenue");
|
||||
|
||||
b.Property<int>("sold");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Products");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Role", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasName("RoleNameIndex");
|
||||
|
||||
b.ToTable("AspNetRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Team", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("CapQR");
|
||||
|
||||
b.Property<int>("EventId");
|
||||
|
||||
b.Property<int>("NMembros");
|
||||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<int>("Pontos");
|
||||
|
||||
b.Property<bool>("pagamento");
|
||||
|
||||
b.Property<string>("pagamentoVerifyCode");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Teams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.User", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("AccessFailedCount");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<bool>("EmailConfirmed");
|
||||
|
||||
b.Property<bool>("LockoutEnabled");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("PasswordHash");
|
||||
|
||||
b.Property<string>("PhoneNumber");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed");
|
||||
|
||||
b.Property<string>("QRcode");
|
||||
|
||||
b.Property<string>("SecurityStamp");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256);
|
||||
|
||||
b.Property<string>("cromos");
|
||||
|
||||
b.Property<int>("drinks");
|
||||
|
||||
b.Property<int>("food");
|
||||
|
||||
b.Property<string>("fullName");
|
||||
|
||||
b.Property<int?>("teamID");
|
||||
|
||||
b.Property<string>("university");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasName("UserNameIndex");
|
||||
|
||||
b.HasIndex("teamID");
|
||||
|
||||
b.ToTable("AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.UserRole", b =>
|
||||
{
|
||||
b.Property<int>("UserId");
|
||||
|
||||
b.Property<int>("RoleId");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Value", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("Values");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Role")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Cromos", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Photo", "img")
|
||||
.WithMany()
|
||||
.HasForeignKey("imgId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLoc", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Photo", "Img")
|
||||
.WithMany()
|
||||
.HasForeignKey("ImgId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.EventLocVisited", b =>
|
||||
{
|
||||
b.HasOne("api.Models.EventLoc", "Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId");
|
||||
|
||||
b.HasOne("api.Models.Team", "Team")
|
||||
.WithMany()
|
||||
.HasForeignKey("TeamId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Log", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany("logsFebrada")
|
||||
.HasForeignKey("UserId");
|
||||
|
||||
b.HasOne("api.Models.User")
|
||||
.WithMany("logsFestarola")
|
||||
.HasForeignKey("UserId1");
|
||||
|
||||
b.HasOne("api.Models.Product", "product")
|
||||
.WithMany()
|
||||
.HasForeignKey("productId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.Photo", b =>
|
||||
{
|
||||
b.HasOne("api.Models.User", "User")
|
||||
.WithMany("Photos")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.User", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Team", "team")
|
||||
.WithMany()
|
||||
.HasForeignKey("teamID");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("api.Models.UserRole", b =>
|
||||
{
|
||||
b.HasOne("api.Models.Role", "Role")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("api.Models.User", "User")
|
||||
.WithMany("UserRoles")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace api.Migrations
|
||||
{
|
||||
public partial class updatev5 : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "pagamentoVerifyCode",
|
||||
table: "Teams",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int));
|
||||
|
||||
migrationBuilder.AlterColumn<bool>(
|
||||
name: "pagamento",
|
||||
table: "Teams",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "pagamentoVerifyCode",
|
||||
table: "Teams",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "pagamento",
|
||||
table: "Teams",
|
||||
nullable: false,
|
||||
oldClrType: typeof(bool));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -118,6 +118,16 @@ namespace api.Migrations
|
|||
|
||||
b.Property<string>("Nome");
|
||||
|
||||
b.Property<bool>("aDecorrer");
|
||||
|
||||
b.Property<string>("horas");
|
||||
|
||||
b.Property<string>("imagem");
|
||||
|
||||
b.Property<string>("localizacao");
|
||||
|
||||
b.Property<string>("notas");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Events");
|
||||
|
@ -275,6 +285,10 @@ namespace api.Migrations
|
|||
|
||||
b.Property<int>("Pontos");
|
||||
|
||||
b.Property<bool>("pagamento");
|
||||
|
||||
b.Property<string>("pagamentoVerifyCode");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Teams");
|
||||
|
@ -326,8 +340,12 @@ namespace api.Migrations
|
|||
|
||||
b.Property<int>("food");
|
||||
|
||||
b.Property<string>("fullName");
|
||||
|
||||
b.Property<int?>("teamID");
|
||||
|
||||
b.Property<string>("university");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
|
|
|
@ -9,6 +9,15 @@ namespace api.Models
|
|||
public int Id{get;set;} //id
|
||||
public String Nome{get;set;} //nome
|
||||
public String Desc{get;set;} //descrição
|
||||
public String imagem{get;set;}
|
||||
|
||||
public String horas{get;set;}
|
||||
|
||||
public bool aDecorrer{get;set;}
|
||||
|
||||
public string localizacao{get;set;}
|
||||
|
||||
public string notas{get;set;}
|
||||
|
||||
}
|
||||
}
|
|
@ -13,5 +13,7 @@ namespace api.Models
|
|||
public string CapQR{get;set;} //Capitao da equipa
|
||||
public int NMembros {get;set;} //Numero de Membros na equipa
|
||||
public int Pontos {get;set;} //Postos da equipa
|
||||
public Boolean pagamento{get;set;}
|
||||
public string pagamentoVerifyCode{get;set;}
|
||||
}
|
||||
}
|
|
@ -9,8 +9,8 @@ namespace api.Models
|
|||
{
|
||||
public class User: IdentityUser<int>
|
||||
{
|
||||
// public string fullName{get;set;}
|
||||
// public string university{get;set;}
|
||||
public string fullName{get;set;}
|
||||
public string university{get;set;}
|
||||
public string QRcode{get;set;}
|
||||
public ICollection<UserRole> UserRoles{get;set;}
|
||||
public ICollection<Log> logsFebrada{get;set;}
|
||||
|
|
Loading…
Reference in New Issue