This commit is contained in:
Daniel Cortés
2019-07-17 16:14:55 -04:00
commit c21919db55
134 changed files with 25294 additions and 0 deletions

21
.gitignore vendored Normal file
View File

@@ -0,0 +1,21 @@
# Created by https://www.gitignore.io/api/netbeans
# Edit at https://www.gitignore.io/?templates=netbeans
### NetBeans ###
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
# End of https://www.gitignore.io/api/netbeans
# Visual paradigm thing
*.bak*
*.lck
nohup.out

68
bank-ejb/build.xml Normal file
View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="bank-ejb" default="default" basedir="." xmlns:ejbjarproject="http://www.netbeans.org/ns/j2ee-ejbjarproject/3">
<description>Builds, tests, and runs the project bank-ejb.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-dist: called before archive building
-post-dist: called after archive building
-post-clean: called after cleaning build products
-pre-run-deploy: called before deploying
-post-run-deploy: called after deploying
(Targets beginning with '-' are not intended to be called on their own.)
Example of pluging an obfuscator after the compilation could look like
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Other way how to customize the build is by overriding existing main targets.
The target of interest are:
init-macrodef-javac: defines macro for javac compilation
init-macrodef-debug: defines macro for class debugging
do-dist: archive building
run: execution of project
javadoc-build: javadoc generation
Example of overriding the target for project execution could look like
<target name="run" depends="<PROJNAME>-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that overridden target depends on jar target and not only on
compile target as regular run target does. Again, for list of available
properties which you can use check the target you are overriding in
nbproject/build-impl.xml file.
-->
</project>

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 2008, 2016 Oracle and/or its affiliates. All rights reserved.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://www.netbeans.org/cddl-gplv2.html
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License file at
nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the GPL Version 2 section of the License file that
accompanied this code. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 2] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 2 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 2 code and therefore, elected the GPL
Version 2 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
-->
<project default="-deploy-ant" basedir=".">
<target name="-init-cl-deployment-env" if="deploy.ant.enabled">
<property file="${deploy.ant.properties.file}" />
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/>
<available file="${deploy.ant.resource.dir}" property="has.setup"/>
<tempfile prefix="pfv3" property="pfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<echo message="AS_ADMIN_PASSWORD=${pfv3.password}" file="${pfv3.password.file}"/>
</target>
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present">
<tempfile prefix="pfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<sun-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.sun.web}" validate="false">
</xmlproperty>
<delete file="${temp.sun.web}"/>
<condition property="deploy.ant.client.url" value="${pfv3.url}${sun-web-app.context-root}" else="${pfv3.url}/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${sun-web-app.context-root}" else="/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
</target>
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present">
<tempfile prefix="pfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.gf.web}" validate="false">
</xmlproperty>
<delete file="${temp.gf.web}"/>
<condition property="deploy.ant.client.url" value="${pfv3.url}${glassfish-web-app.context-root}" else="${pfv3.url}/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
</target>
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
<property name="deploy.context.root.argument" value=""/>
</target>
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup">
<tempfile prefix="pfv3" property="pfv3.resources.dir" destdir="${java.io.tmpdir}"/>
<mkdir dir="${pfv3.resources.dir}"/>
<mkdir dir="${pfv3.resources.dir}/META-INF"/>
<copy todir="${pfv3.resources.dir}/META-INF">
<fileset dir="${deploy.ant.resource.dir}"/>
</copy>
<jar destfile="${deploy.ant.archive}" update="true">
<fileset dir="${pfv3.resources.dir}"/>
</jar>
<delete dir="${pfv3.resources.dir}"/>
</target>
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
<antcall target="-deploy-without-pw"/>
<antcall target="-deploy-with-pw"/>
</target>
<target name="-deploy-without-pw" unless="pfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="pfv3" property="pfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get src="${pfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${pfv3.results.file}"/>
<delete file="${pfv3.results.file}"/>
</target>
<target name="-deploy-with-pw" if="pfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="pfv3" property="pfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get username="${pfv3.username}" password="${pfv3.password}" src="${pfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${pfv3.results.file}"/>
<delete file="${pfv3.results.file}"/>
</target>
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled">
<antcall target="-undeploy-without-pw"/>
<antcall target="-undeploy-with-pw"/>
</target>
<target name="-undeploy-without-pw" unless="pfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="pfv3" property="pfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get src="${pfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${pfv3.results.file}"/>
<delete file="${pfv3.results.file}"/>
</target>
<target name="-undeploy-with-pw" if="pfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="pfv3" property="pfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get username="${pfv3.username}" password="${pfv3.password}" src="${pfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${pfv3.results.file}"/>
<delete file="${pfv3.results.file}"/>
</target>
</project>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
build.xml.data.CRC32=484327a3
build.xml.script.CRC32=94cd987b
build.xml.stylesheet.CRC32=5910fda3@1.56.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=484327a3
nbproject/build-impl.xml.script.CRC32=ef3f7026
nbproject/build-impl.xml.stylesheet.CRC32=6096d939@1.56.1

View File

@@ -0,0 +1,76 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=true
annotation.processing.processor.options=-Aeclipselink.canonicalmodel.use_static_factory=false
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form,**/.nbattrs
build.dir=build
build.ear.classes.dir=${build.dir}/classes
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=${javac.classpath}:${build.classes.dir}
debug.test.classpath=\
${run.test.classpath}
dist.dir=dist
dist.ear.jar=${dist.dir}/${jar.name}
dist.jar=${dist.dir}/${jar.name}
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=\
${libs.javaee-endorsed-api-7.0.classpath}
excludes=
includes=**
j2ee.compile.on.save=true
j2ee.deploy.on.save=true
j2ee.platform=1.7
j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jakarta.xml.bind-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/cdi-api.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.security.enterprise.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.security.enterprise-api.jar:${j2ee.server.home}/modules/javax.json.bind-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar
j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar
j2ee.platform.wsit.classpath=
j2ee.server.type=pfv3ee6
jar.compress=false
jar.name=bank-ejb.jar
javac.classpath=
javac.debug=true
javac.deprecation=false
javac.processorpath=\
${javac.classpath}:\
${libs.eclipselink.classpath}:\
${libs.eclipselinkmodelgen.classpath}
javac.source=1.8
javac.target=1.8
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
javac.test.processorpath=${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.preview=true
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
meta.inf=${source.root}/conf
meta.inf.excludes=sun-cmp-mappings.xml
platform.active=default_platform
resource.dir=setup
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
# Space-separated list of JVM arguments used when running a class with a main method or a unit test
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value):
runmain.jvmargs=
source.encoding=UTF-8
source.root=src
src.dir=${source.root}/java
test.src.dir=test

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.j2ee.ejbjarproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2ee-ejbjarproject/3">
<name>bank-ejb</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir" name="Source Packages"/>
</source-roots>
<test-roots>
<root id="test.src.dir" name="Test Packages"/>
</test-roots>
</data>
</configuration>
</project>

View File

@@ -0,0 +1,2 @@
Manifest-Version: 1.0

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="bank-ejbPU" transaction-type="JTA">
<jta-data-source>bank_jndi</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
</persistence>

View File

@@ -0,0 +1,64 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import java.util.List;
import javax.persistence.EntityManager;
/**
*
* @author ryuuji
*/
public abstract class AbstractFacade<T> {
private Class<T> entityClass;
public AbstractFacade(Class<T> entityClass) {
this.entityClass = entityClass;
}
protected abstract EntityManager getEntityManager();
public void create(T entity) {
getEntityManager().persist(entity);
}
public void edit(T entity) {
getEntityManager().merge(entity);
}
public void remove(T entity) {
getEntityManager().remove(getEntityManager().merge(entity));
}
public T find(Object id) {
return getEntityManager().find(entityClass, id);
}
public List<T> findAll() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
return getEntityManager().createQuery(cq).getResultList();
}
public List<T> findRange(int[] range) {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
javax.persistence.Query q = getEntityManager().createQuery(cq);
q.setMaxResults(range[1] - range[0] + 1);
q.setFirstResult(range[0]);
return q.getResultList();
}
public int count() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
javax.persistence.criteria.Root<T> rt = cq.from(entityClass);
cq.select(getEntityManager().getCriteriaBuilder().count(rt));
javax.persistence.Query q = getEntityManager().createQuery(cq);
return ((Long) q.getSingleResult()).intValue();
}
}

View File

@@ -0,0 +1,47 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.Cliente;
import entities.Usuario;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.NonUniqueResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
/**
*
* @author ryuuji
*/
@Stateless
public class ClienteFacade extends AbstractFacade<Cliente> implements ClienteFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public ClienteFacade() {
super(Cliente.class);
}
@Override
public Cliente findByRut(String rut) {
TypedQuery<Cliente> query = em.createNamedQuery("Cliente.findByRut", Cliente.class);
query.setParameter("rut", rut);
try {
return query.getSingleResult();
} catch (NoResultException | NonUniqueResultException ex) {
return null;
}
}
}

View File

@@ -0,0 +1,35 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.Cliente;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface ClienteFacadeLocal {
void create(Cliente cliente);
void edit(Cliente cliente);
void remove(Cliente cliente);
Cliente find(Object id);
Cliente findByRut(String rut);
List<Cliente> findAll();
List<Cliente> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.CompraTarjetaCredito;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class CompraTarjetaCreditoFacade extends AbstractFacade<CompraTarjetaCredito> implements CompraTarjetaCreditoFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public CompraTarjetaCreditoFacade() {
super(CompraTarjetaCredito.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.CompraTarjetaCredito;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface CompraTarjetaCreditoFacadeLocal {
void create(CompraTarjetaCredito compraTarjetaCredito);
void edit(CompraTarjetaCredito compraTarjetaCredito);
void remove(CompraTarjetaCredito compraTarjetaCredito);
CompraTarjetaCredito find(Object id);
List<CompraTarjetaCredito> findAll();
List<CompraTarjetaCredito> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.CompraTarjetaDebito;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class CompraTarjetaDebitoFacade extends AbstractFacade<CompraTarjetaDebito> implements CompraTarjetaDebitoFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public CompraTarjetaDebitoFacade() {
super(CompraTarjetaDebito.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.CompraTarjetaDebito;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface CompraTarjetaDebitoFacadeLocal {
void create(CompraTarjetaDebito compraTarjetaDebito);
void edit(CompraTarjetaDebito compraTarjetaDebito);
void remove(CompraTarjetaDebito compraTarjetaDebito);
CompraTarjetaDebito find(Object id);
List<CompraTarjetaDebito> findAll();
List<CompraTarjetaDebito> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.CuentaCorriente;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class CuentaCorrienteFacade extends AbstractFacade<CuentaCorriente> implements CuentaCorrienteFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public CuentaCorrienteFacade() {
super(CuentaCorriente.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.CuentaCorriente;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface CuentaCorrienteFacadeLocal {
void create(CuentaCorriente cuentaCorriente);
void edit(CuentaCorriente cuentaCorriente);
void remove(CuentaCorriente cuentaCorriente);
CuentaCorriente find(Object id);
List<CuentaCorriente> findAll();
List<CuentaCorriente> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.DepositoCuentaCorriente;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class DepositoCuentaCorrienteFacade extends AbstractFacade<DepositoCuentaCorriente> implements DepositoCuentaCorrienteFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public DepositoCuentaCorrienteFacade() {
super(DepositoCuentaCorriente.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.DepositoCuentaCorriente;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface DepositoCuentaCorrienteFacadeLocal {
void create(DepositoCuentaCorriente depositoCuentaCorriente);
void edit(DepositoCuentaCorriente depositoCuentaCorriente);
void remove(DepositoCuentaCorriente depositoCuentaCorriente);
DepositoCuentaCorriente find(Object id);
List<DepositoCuentaCorriente> findAll();
List<DepositoCuentaCorriente> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.DepositoTarjetaDebito;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class DepositoTarjetaDebitoFacade extends AbstractFacade<DepositoTarjetaDebito> implements DepositoTarjetaDebitoFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public DepositoTarjetaDebitoFacade() {
super(DepositoTarjetaDebito.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.DepositoTarjetaDebito;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface DepositoTarjetaDebitoFacadeLocal {
void create(DepositoTarjetaDebito depositoTarjetaDebito);
void edit(DepositoTarjetaDebito depositoTarjetaDebito);
void remove(DepositoTarjetaDebito depositoTarjetaDebito);
DepositoTarjetaDebito find(Object id);
List<DepositoTarjetaDebito> findAll();
List<DepositoTarjetaDebito> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.GiroCuentaCorriente;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class GiroCuentaCorrienteFacade extends AbstractFacade<GiroCuentaCorriente> implements GiroCuentaCorrienteFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public GiroCuentaCorrienteFacade() {
super(GiroCuentaCorriente.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.GiroCuentaCorriente;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface GiroCuentaCorrienteFacadeLocal {
void create(GiroCuentaCorriente giroCuentaCorriente);
void edit(GiroCuentaCorriente giroCuentaCorriente);
void remove(GiroCuentaCorriente giroCuentaCorriente);
GiroCuentaCorriente find(Object id);
List<GiroCuentaCorriente> findAll();
List<GiroCuentaCorriente> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.GiroTarjetaDebito;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class GiroTarjetaDebitoFacade extends AbstractFacade<GiroTarjetaDebito> implements GiroTarjetaDebitoFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public GiroTarjetaDebitoFacade() {
super(GiroTarjetaDebito.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.GiroTarjetaDebito;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface GiroTarjetaDebitoFacadeLocal {
void create(GiroTarjetaDebito giroTarjetaDebito);
void edit(GiroTarjetaDebito giroTarjetaDebito);
void remove(GiroTarjetaDebito giroTarjetaDebito);
GiroTarjetaDebito find(Object id);
List<GiroTarjetaDebito> findAll();
List<GiroTarjetaDebito> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.LineaSobregiro;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class LineaSobregiroFacade extends AbstractFacade<LineaSobregiro> implements LineaSobregiroFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public LineaSobregiroFacade() {
super(LineaSobregiro.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.LineaSobregiro;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface LineaSobregiroFacadeLocal {
void create(LineaSobregiro lineaSobregiro);
void edit(LineaSobregiro lineaSobregiro);
void remove(LineaSobregiro lineaSobregiro);
LineaSobregiro find(Object id);
List<LineaSobregiro> findAll();
List<LineaSobregiro> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.Metodo;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class MetodoFacade extends AbstractFacade<Metodo> implements MetodoFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public MetodoFacade() {
super(Metodo.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.Metodo;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface MetodoFacadeLocal {
void create(Metodo metodo);
void edit(Metodo metodo);
void remove(Metodo metodo);
Metodo find(Object id);
List<Metodo> findAll();
List<Metodo> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.PagoTarjetaCredito;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class PagoTarjetaCreditoFacade extends AbstractFacade<PagoTarjetaCredito> implements PagoTarjetaCreditoFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public PagoTarjetaCreditoFacade() {
super(PagoTarjetaCredito.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.PagoTarjetaCredito;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface PagoTarjetaCreditoFacadeLocal {
void create(PagoTarjetaCredito pagoTarjetaCredito);
void edit(PagoTarjetaCredito pagoTarjetaCredito);
void remove(PagoTarjetaCredito pagoTarjetaCredito);
PagoTarjetaCredito find(Object id);
List<PagoTarjetaCredito> findAll();
List<PagoTarjetaCredito> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.TarjetaCredito;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class TarjetaCreditoFacade extends AbstractFacade<TarjetaCredito> implements TarjetaCreditoFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public TarjetaCreditoFacade() {
super(TarjetaCredito.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.TarjetaCredito;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface TarjetaCreditoFacadeLocal {
void create(TarjetaCredito tarjetaCredito);
void edit(TarjetaCredito tarjetaCredito);
void remove(TarjetaCredito tarjetaCredito);
TarjetaCredito find(Object id);
List<TarjetaCredito> findAll();
List<TarjetaCredito> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.TarjetaDebito;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class TarjetaDebitoFacade extends AbstractFacade<TarjetaDebito> implements TarjetaDebitoFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public TarjetaDebitoFacade() {
super(TarjetaDebito.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.TarjetaDebito;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface TarjetaDebitoFacadeLocal {
void create(TarjetaDebito tarjetaDebito);
void edit(TarjetaDebito tarjetaDebito);
void remove(TarjetaDebito tarjetaDebito);
TarjetaDebito find(Object id);
List<TarjetaDebito> findAll();
List<TarjetaDebito> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.TransferenciaCuentaCorriente;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class TransferenciaCuentaCorrienteFacade extends AbstractFacade<TransferenciaCuentaCorriente> implements TransferenciaCuentaCorrienteFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public TransferenciaCuentaCorrienteFacade() {
super(TransferenciaCuentaCorriente.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.TransferenciaCuentaCorriente;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface TransferenciaCuentaCorrienteFacadeLocal {
void create(TransferenciaCuentaCorriente transferenciaCuentaCorriente);
void edit(TransferenciaCuentaCorriente transferenciaCuentaCorriente);
void remove(TransferenciaCuentaCorriente transferenciaCuentaCorriente);
TransferenciaCuentaCorriente find(Object id);
List<TransferenciaCuentaCorriente> findAll();
List<TransferenciaCuentaCorriente> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,32 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.TransferenciaTarjetaDebito;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author ryuuji
*/
@Stateless
public class TransferenciaTarjetaDebitoFacade extends AbstractFacade<TransferenciaTarjetaDebito> implements TransferenciaTarjetaDebitoFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public TransferenciaTarjetaDebitoFacade() {
super(TransferenciaTarjetaDebito.class);
}
}

View File

@@ -0,0 +1,33 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.TransferenciaTarjetaDebito;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface TransferenciaTarjetaDebitoFacadeLocal {
void create(TransferenciaTarjetaDebito transferenciaTarjetaDebito);
void edit(TransferenciaTarjetaDebito transferenciaTarjetaDebito);
void remove(TransferenciaTarjetaDebito transferenciaTarjetaDebito);
TransferenciaTarjetaDebito find(Object id);
List<TransferenciaTarjetaDebito> findAll();
List<TransferenciaTarjetaDebito> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,45 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.Usuario;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.NonUniqueResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
/**
*
* @author ryuuji
*/
@Stateless
public class UsuarioFacade extends AbstractFacade<Usuario> implements UsuarioFacadeLocal {
@PersistenceContext(unitName = "bank-ejbPU")
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
return em;
}
public UsuarioFacade() {
super(Usuario.class);
}
@Override
public Usuario findByNombre(String name) {
TypedQuery<Usuario> query = em.createNamedQuery("Usuario.findByNombre", Usuario.class);
query.setParameter("nombre", name);
try{
return query.getSingleResult();
}catch(NoResultException|NonUniqueResultException ex){
return null;
}
}
}

View File

@@ -0,0 +1,35 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import entities.Usuario;
import java.util.List;
import javax.ejb.Local;
/**
*
* @author ryuuji
*/
@Local
public interface UsuarioFacadeLocal {
void create(Usuario usuario);
void edit(Usuario usuario);
void remove(Usuario usuario);
Usuario find(Object id);
Usuario findByNombre(String name);
List<Usuario> findAll();
List<Usuario> findRange(int[] range);
int count();
}

View File

@@ -0,0 +1,201 @@
package entities;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "cliente")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Cliente.findAll", query = "SELECT c FROM Cliente c")
, @NamedQuery(name = "Cliente.findById", query = "SELECT c FROM Cliente c WHERE c.id = :id")
, @NamedQuery(name = "Cliente.findByRut", query = "SELECT c FROM Cliente c WHERE c.rut = :rut")
, @NamedQuery(name = "Cliente.findByNombre", query = "SELECT c FROM Cliente c WHERE c.nombre = :nombre")
, @NamedQuery(name = "Cliente.findByCiudad", query = "SELECT c FROM Cliente c WHERE c.ciudad = :ciudad")
, @NamedQuery(name = "Cliente.findByInsertedAt", query = "SELECT c FROM Cliente c WHERE c.insertedAt = :insertedAt")})
public class Cliente implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "rut")
private String rut;
@Basic(optional = false)
@Column(name = "nombre")
private String nombre;
@Basic(optional = false)
@Column(name = "ciudad")
private String ciudad;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "cliente")
private List<CuentaCorriente> cuentaCorrienteList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "cliente")
private List<TarjetaDebito> tarjetaDebitoList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "cliente")
private List<TarjetaCredito> tarjetaCreditoList;
@JoinColumn(name = "linea_sobregiro", referencedColumnName = "id")
@OneToOne(optional = true)
private LineaSobregiro lineaSobregiro;
@JoinColumn(name = "usuario", referencedColumnName = "id")
@OneToOne(optional = false)
private Usuario usuario;
public Cliente() {
}
public Cliente(Integer id) {
this.id = id;
}
public Cliente(Integer id, String rut, String nombre, String ciudad, Date insertedAt) {
this.id = id;
this.rut = rut;
this.nombre = nombre;
this.ciudad = ciudad;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getRut() {
return rut;
}
public void setRut(String rut) {
this.rut = rut;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getCiudad() {
return ciudad;
}
public void setCiudad(String ciudad) {
this.ciudad = ciudad;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
@XmlTransient
public List<CuentaCorriente> getCuentaCorrienteList() {
if (cuentaCorrienteList == null)
cuentaCorrienteList = new ArrayList<>();
return cuentaCorrienteList;
}
public void setCuentaCorrienteList(List<CuentaCorriente> cuentaCorrienteList) {
this.cuentaCorrienteList = cuentaCorrienteList;
}
@XmlTransient
public List<TarjetaDebito> getTarjetaDebitoList() {
return tarjetaDebitoList;
}
public void setTarjetaDebitoList(List<TarjetaDebito> tarjetaDebitoList) {
if (tarjetaDebitoList == null)
tarjetaDebitoList = new ArrayList<>();
this.tarjetaDebitoList = tarjetaDebitoList;
}
@XmlTransient
public List<TarjetaCredito> getTarjetaCreditoList() {
return tarjetaCreditoList;
}
public void setTarjetaCreditoList(List<TarjetaCredito> tarjetaCreditoList) {
if (tarjetaCreditoList == null)
tarjetaCreditoList = new ArrayList<>();
this.tarjetaCreditoList = tarjetaCreditoList;
}
public LineaSobregiro getLineaSobregiro() {
return lineaSobregiro;
}
public void setLineaSobregiro(LineaSobregiro lineaSobregiro) {
this.lineaSobregiro = lineaSobregiro;
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Cliente)) {
return false;
}
Cliente other = (Cliente) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.Cliente[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,136 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "compra_tarjeta_credito")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "CompraTarjetaCredito.findAll", query = "SELECT c FROM CompraTarjetaCredito c")
, @NamedQuery(name = "CompraTarjetaCredito.findById", query = "SELECT c FROM CompraTarjetaCredito c WHERE c.id = :id")
, @NamedQuery(name = "CompraTarjetaCredito.findByMonto", query = "SELECT c FROM CompraTarjetaCredito c WHERE c.monto = :monto")
, @NamedQuery(name = "CompraTarjetaCredito.findByComentario", query = "SELECT c FROM CompraTarjetaCredito c WHERE c.comentario = :comentario")
, @NamedQuery(name = "CompraTarjetaCredito.findByInsertedAt", query = "SELECT c FROM CompraTarjetaCredito c WHERE c.insertedAt = :insertedAt")})
public class CompraTarjetaCredito implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "monto")
private int monto;
@Column(name = "comentario")
private String comentario;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "tarjeta_credito", referencedColumnName = "id")
@ManyToOne
private TarjetaCredito tarjetaCredito;
public CompraTarjetaCredito() {
}
public CompraTarjetaCredito(Integer id) {
this.id = id;
}
public CompraTarjetaCredito(Integer id, int monto, Date insertedAt) {
this.id = id;
this.monto = monto;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public TarjetaCredito getTarjetaCredito() {
return tarjetaCredito;
}
public void setTarjetaCredito(TarjetaCredito tarjetaCredito) {
this.tarjetaCredito = tarjetaCredito;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CompraTarjetaCredito)) {
return false;
}
CompraTarjetaCredito other = (CompraTarjetaCredito) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.CompraTarjetaCredito[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,136 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "compra_tarjeta_debito")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "CompraTarjetaDebito.findAll", query = "SELECT c FROM CompraTarjetaDebito c")
, @NamedQuery(name = "CompraTarjetaDebito.findById", query = "SELECT c FROM CompraTarjetaDebito c WHERE c.id = :id")
, @NamedQuery(name = "CompraTarjetaDebito.findByMonto", query = "SELECT c FROM CompraTarjetaDebito c WHERE c.monto = :monto")
, @NamedQuery(name = "CompraTarjetaDebito.findByComentario", query = "SELECT c FROM CompraTarjetaDebito c WHERE c.comentario = :comentario")
, @NamedQuery(name = "CompraTarjetaDebito.findByInsertedAt", query = "SELECT c FROM CompraTarjetaDebito c WHERE c.insertedAt = :insertedAt")})
public class CompraTarjetaDebito implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "monto")
private int monto;
@Column(name = "comentario")
private String comentario;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "tarjeta_debito", referencedColumnName = "id")
@ManyToOne(optional = false)
private TarjetaDebito tarjetaDebito;
public CompraTarjetaDebito() {
}
public CompraTarjetaDebito(Integer id) {
this.id = id;
}
public CompraTarjetaDebito(Integer id, int monto, Date insertedAt) {
this.id = id;
this.monto = monto;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public TarjetaDebito getTarjetaDebito() {
return tarjetaDebito;
}
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
this.tarjetaDebito = tarjetaDebito;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CompraTarjetaDebito)) {
return false;
}
CompraTarjetaDebito other = (CompraTarjetaDebito) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.CompraTarjetaDebito[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,172 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "cuenta_corriente")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "CuentaCorriente.findAll", query = "SELECT c FROM CuentaCorriente c")
, @NamedQuery(name = "CuentaCorriente.findById", query = "SELECT c FROM CuentaCorriente c WHERE c.id = :id")
, @NamedQuery(name = "CuentaCorriente.findBySaldo", query = "SELECT c FROM CuentaCorriente c WHERE c.saldo = :saldo")
, @NamedQuery(name = "CuentaCorriente.findByInsertedAt", query = "SELECT c FROM CuentaCorriente c WHERE c.insertedAt = :insertedAt")})
public class CuentaCorriente implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "saldo")
private int saldo;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "cliente", referencedColumnName = "id")
@ManyToOne(optional = false)
private Cliente cliente;
@OneToMany(mappedBy = "cuentaCorriente")
private List<DepositoCuentaCorriente> depositoList;
@OneToMany(mappedBy = "cuentaCorrienteFrom")
private List<TransferenciaCuentaCorriente> transferenciaFromList;
@OneToMany(mappedBy = "cuentaCorrienteTo")
private List<TransferenciaCuentaCorriente> transferenciaToList;
@OneToMany(mappedBy = "cuentaCorriente")
private List<GiroCuentaCorriente> giroList;
public CuentaCorriente() {
}
public CuentaCorriente(Integer id) {
this.id = id;
}
public CuentaCorriente(Integer id, int saldo, Date insertedAt) {
this.id = id;
this.saldo = saldo;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getSaldo() {
return saldo;
}
public void setSaldo(int saldo) {
this.saldo = saldo;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
@XmlTransient
public List<DepositoCuentaCorriente> getDepositoList() {
return depositoList;
}
public void setDepositoList(List<DepositoCuentaCorriente> depositoList) {
this.depositoList = depositoList;
}
@XmlTransient
public List<TransferenciaCuentaCorriente> getTransferenciaFromList() {
return transferenciaFromList;
}
public void setTransferenciaFromList(List<TransferenciaCuentaCorriente> transferenciaFromList) {
this.transferenciaFromList = transferenciaFromList;
}
@XmlTransient
public List<TransferenciaCuentaCorriente> getTransferenciaToList() {
return transferenciaToList;
}
public void setTransferenciaToList(List<TransferenciaCuentaCorriente> transferenciaToList) {
this.transferenciaToList = transferenciaToList;
}
@XmlTransient
public List<GiroCuentaCorriente> getGiroList() {
return giroList;
}
public void setGiroList(List<GiroCuentaCorriente> giroList) {
this.giroList = giroList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CuentaCorriente)) {
return false;
}
CuentaCorriente other = (CuentaCorriente) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.CuentaCorriente[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,147 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "deposito_cuenta_corriente")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "DepositoCuentaCorriente.findAll", query = "SELECT d FROM DepositoCuentaCorriente d")
, @NamedQuery(name = "DepositoCuentaCorriente.findById", query = "SELECT d FROM DepositoCuentaCorriente d WHERE d.id = :id")
, @NamedQuery(name = "DepositoCuentaCorriente.findByMonto", query = "SELECT d FROM DepositoCuentaCorriente d WHERE d.monto = :monto")
, @NamedQuery(name = "DepositoCuentaCorriente.findByComentario", query = "SELECT d FROM DepositoCuentaCorriente d WHERE d.comentario = :comentario")
, @NamedQuery(name = "DepositoCuentaCorriente.findByInsertedAt", query = "SELECT d FROM DepositoCuentaCorriente d WHERE d.insertedAt = :insertedAt")})
public class DepositoCuentaCorriente implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "monto")
private int monto;
@Column(name = "comentario")
private String comentario;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "metodo", referencedColumnName = "id")
@ManyToOne
private Metodo metodo;
@JoinColumn(name = "cuenta_corriente", referencedColumnName = "id")
@ManyToOne
private CuentaCorriente cuentaCorriente;
public DepositoCuentaCorriente() {
}
public DepositoCuentaCorriente(Integer id) {
this.id = id;
}
public DepositoCuentaCorriente(Integer id, int monto, Date insertedAt) {
this.id = id;
this.monto = monto;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public Metodo getMetodo() {
return metodo;
}
public void setMetodo(Metodo metodo) {
this.metodo = metodo;
}
public CuentaCorriente getCuentaCorriente() {
return cuentaCorriente;
}
public void setCuentaCorriente(CuentaCorriente cuentaCorriente) {
this.cuentaCorriente = cuentaCorriente;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof DepositoCuentaCorriente)) {
return false;
}
DepositoCuentaCorriente other = (DepositoCuentaCorriente) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.DepositoCuentaCorriente[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,147 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "deposito_tarjeta_debito")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "DepositoTarjetaDebito.findAll", query = "SELECT d FROM DepositoTarjetaDebito d")
, @NamedQuery(name = "DepositoTarjetaDebito.findById", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.id = :id")
, @NamedQuery(name = "DepositoTarjetaDebito.findByMonto", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.monto = :monto")
, @NamedQuery(name = "DepositoTarjetaDebito.findByComentario", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.comentario = :comentario")
, @NamedQuery(name = "DepositoTarjetaDebito.findByInsertedAt", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.insertedAt = :insertedAt")})
public class DepositoTarjetaDebito implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "monto")
private int monto;
@Column(name = "comentario")
private String comentario;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "metodo", referencedColumnName = "id")
@ManyToOne
private Metodo metodo;
@JoinColumn(name = "tarjeta_debito", referencedColumnName = "id")
@ManyToOne
private TarjetaDebito tarjetaDebito;
public DepositoTarjetaDebito() {
}
public DepositoTarjetaDebito(Integer id) {
this.id = id;
}
public DepositoTarjetaDebito(Integer id, int monto, Date insertedAt) {
this.id = id;
this.monto = monto;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public Metodo getMetodo() {
return metodo;
}
public void setMetodo(Metodo metodo) {
this.metodo = metodo;
}
public TarjetaDebito getTarjetaDebito() {
return tarjetaDebito;
}
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
this.tarjetaDebito = tarjetaDebito;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof DepositoTarjetaDebito)) {
return false;
}
DepositoTarjetaDebito other = (DepositoTarjetaDebito) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.DepositoTarjetaDebito[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,147 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "giro_cuenta_corriente")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "GiroCuentaCorriente.findAll", query = "SELECT g FROM GiroCuentaCorriente g")
, @NamedQuery(name = "GiroCuentaCorriente.findById", query = "SELECT g FROM GiroCuentaCorriente g WHERE g.id = :id")
, @NamedQuery(name = "GiroCuentaCorriente.findByMonto", query = "SELECT g FROM GiroCuentaCorriente g WHERE g.monto = :monto")
, @NamedQuery(name = "GiroCuentaCorriente.findByComentario", query = "SELECT g FROM GiroCuentaCorriente g WHERE g.comentario = :comentario")
, @NamedQuery(name = "GiroCuentaCorriente.findByInsertedAt", query = "SELECT g FROM GiroCuentaCorriente g WHERE g.insertedAt = :insertedAt")})
public class GiroCuentaCorriente implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "monto")
private int monto;
@Column(name = "comentario")
private String comentario;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "metodo", referencedColumnName = "id")
@ManyToOne
private Metodo metodo;
@JoinColumn(name = "cuenta_corriente", referencedColumnName = "id")
@ManyToOne
private CuentaCorriente cuentaCorriente;
public GiroCuentaCorriente() {
}
public GiroCuentaCorriente(Integer id) {
this.id = id;
}
public GiroCuentaCorriente(Integer id, int monto, Date insertedAt) {
this.id = id;
this.monto = monto;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public Metodo getMetodo() {
return metodo;
}
public void setMetodo(Metodo metodo) {
this.metodo = metodo;
}
public CuentaCorriente getCuentaCorriente() {
return cuentaCorriente;
}
public void setCuentaCorriente(CuentaCorriente cuentaCorriente) {
this.cuentaCorriente = cuentaCorriente;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof GiroCuentaCorriente)) {
return false;
}
GiroCuentaCorriente other = (GiroCuentaCorriente) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.GiroCuentaCorriente[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,147 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "giro_tarjeta_debito")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "GiroTarjetaDebito.findAll", query = "SELECT g FROM GiroTarjetaDebito g")
, @NamedQuery(name = "GiroTarjetaDebito.findById", query = "SELECT g FROM GiroTarjetaDebito g WHERE g.id = :id")
, @NamedQuery(name = "GiroTarjetaDebito.findByMonto", query = "SELECT g FROM GiroTarjetaDebito g WHERE g.monto = :monto")
, @NamedQuery(name = "GiroTarjetaDebito.findByComentario", query = "SELECT g FROM GiroTarjetaDebito g WHERE g.comentario = :comentario")
, @NamedQuery(name = "GiroTarjetaDebito.findByInsertedAt", query = "SELECT g FROM GiroTarjetaDebito g WHERE g.insertedAt = :insertedAt")})
public class GiroTarjetaDebito implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "monto")
private int monto;
@Column(name = "comentario")
private String comentario;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "tarjeta_debito", referencedColumnName = "id")
@ManyToOne
private TarjetaDebito tarjetaDebito;
@JoinColumn(name = "metodo", referencedColumnName = "id")
@ManyToOne
private Metodo metodo;
public GiroTarjetaDebito() {
}
public GiroTarjetaDebito(Integer id) {
this.id = id;
}
public GiroTarjetaDebito(Integer id, int monto, Date insertedAt) {
this.id = id;
this.monto = monto;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public TarjetaDebito getTarjetaDebito() {
return tarjetaDebito;
}
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
this.tarjetaDebito = tarjetaDebito;
}
public Metodo getMetodo() {
return metodo;
}
public void setMetodo(Metodo metodo) {
this.metodo = metodo;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof GiroTarjetaDebito)) {
return false;
}
GiroTarjetaDebito other = (GiroTarjetaDebito) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.GiroTarjetaDebito[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,137 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "linea_sobregiro")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "LineaSobregiro.findAll", query = "SELECT l FROM LineaSobregiro l")
, @NamedQuery(name = "LineaSobregiro.findById", query = "SELECT l FROM LineaSobregiro l WHERE l.id = :id")
, @NamedQuery(name = "LineaSobregiro.findBySobregiro", query = "SELECT l FROM LineaSobregiro l WHERE l.sobregiro = :sobregiro")
, @NamedQuery(name = "LineaSobregiro.findByLimite", query = "SELECT l FROM LineaSobregiro l WHERE l.limite = :limite")
, @NamedQuery(name = "LineaSobregiro.findByInsertedAt", query = "SELECT l FROM LineaSobregiro l WHERE l.insertedAt = :insertedAt")})
public class LineaSobregiro implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "sobregiro")
private int sobregiro;
@Basic(optional = false)
@Column(name = "limite")
private int limite;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@OneToOne(cascade = CascadeType.ALL, mappedBy = "lineaSobregiro")
private Cliente cliente;
public LineaSobregiro() {
}
public LineaSobregiro(Integer id) {
this.id = id;
}
public LineaSobregiro(Integer id, int sobregiro, int limite, Date insertedAt) {
this.id = id;
this.sobregiro = sobregiro;
this.limite = limite;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getSobregiro() {
return sobregiro;
}
public void setSobregiro(int sobregiro) {
this.sobregiro = sobregiro;
}
public int getLimite() {
return limite;
}
public void setLimite(int limite) {
this.limite = limite;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof LineaSobregiro)) {
return false;
}
LineaSobregiro other = (LineaSobregiro) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.LineaSobregiro[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,159 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "metodo")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Metodo.findAll", query = "SELECT m FROM Metodo m")
, @NamedQuery(name = "Metodo.findById", query = "SELECT m FROM Metodo m WHERE m.id = :id")
, @NamedQuery(name = "Metodo.findByNombre", query = "SELECT m FROM Metodo m WHERE m.nombre = :nombre")
, @NamedQuery(name = "Metodo.findByInsertedAt", query = "SELECT m FROM Metodo m WHERE m.insertedAt = :insertedAt")})
public class Metodo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "nombre")
private String nombre;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@OneToMany(mappedBy = "metodo")
private List<DepositoCuentaCorriente> depositoCuentaCorrienteList;
@OneToMany(mappedBy = "metodo")
private List<DepositoTarjetaDebito> depositoTarjetaDebitoList;
@OneToMany(mappedBy = "metodo")
private List<GiroTarjetaDebito> giroTarjetaDebitoList;
@OneToMany(mappedBy = "metodo")
private List<GiroCuentaCorriente> giroCuentaCorrienteList;
public Metodo() {
}
public Metodo(Integer id) {
this.id = id;
}
public Metodo(Integer id, String nombre, Date insertedAt) {
this.id = id;
this.nombre = nombre;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
@XmlTransient
public List<DepositoCuentaCorriente> getDepositoCuentaCorrienteList() {
return depositoCuentaCorrienteList;
}
public void setDepositoCuentaCorrienteList(List<DepositoCuentaCorriente> depositoCuentaCorrienteList) {
this.depositoCuentaCorrienteList = depositoCuentaCorrienteList;
}
@XmlTransient
public List<DepositoTarjetaDebito> getDepositoTarjetaDebitoList() {
return depositoTarjetaDebitoList;
}
public void setDepositoTarjetaDebitoList(List<DepositoTarjetaDebito> depositoTarjetaDebitoList) {
this.depositoTarjetaDebitoList = depositoTarjetaDebitoList;
}
@XmlTransient
public List<GiroTarjetaDebito> getGiroTarjetaDebitoList() {
return giroTarjetaDebitoList;
}
public void setGiroTarjetaDebitoList(List<GiroTarjetaDebito> giroTarjetaDebitoList) {
this.giroTarjetaDebitoList = giroTarjetaDebitoList;
}
@XmlTransient
public List<GiroCuentaCorriente> getGiroCuentaCorrienteList() {
return giroCuentaCorrienteList;
}
public void setGiroCuentaCorrienteList(List<GiroCuentaCorriente> giroCuentaCorrienteList) {
this.giroCuentaCorrienteList = giroCuentaCorrienteList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Metodo)) {
return false;
}
Metodo other = (Metodo) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.Metodo[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,136 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "pago_tarjeta_credito")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "PagoTarjetaCredito.findAll", query = "SELECT p FROM PagoTarjetaCredito p")
, @NamedQuery(name = "PagoTarjetaCredito.findById", query = "SELECT p FROM PagoTarjetaCredito p WHERE p.id = :id")
, @NamedQuery(name = "PagoTarjetaCredito.findByMonto", query = "SELECT p FROM PagoTarjetaCredito p WHERE p.monto = :monto")
, @NamedQuery(name = "PagoTarjetaCredito.findByComentario", query = "SELECT p FROM PagoTarjetaCredito p WHERE p.comentario = :comentario")
, @NamedQuery(name = "PagoTarjetaCredito.findByInsertedAt", query = "SELECT p FROM PagoTarjetaCredito p WHERE p.insertedAt = :insertedAt")})
public class PagoTarjetaCredito implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "monto")
private int monto;
@Column(name = "comentario")
private String comentario;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "tarjeta_credito", referencedColumnName = "id")
@ManyToOne
private TarjetaCredito tarjetaCredito;
public PagoTarjetaCredito() {
}
public PagoTarjetaCredito(Integer id) {
this.id = id;
}
public PagoTarjetaCredito(Integer id, int monto, Date insertedAt) {
this.id = id;
this.monto = monto;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public TarjetaCredito getTarjetaCredito() {
return tarjetaCredito;
}
public void setTarjetaCredito(TarjetaCredito tarjetaCredito) {
this.tarjetaCredito = tarjetaCredito;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof PagoTarjetaCredito)) {
return false;
}
PagoTarjetaCredito other = (PagoTarjetaCredito) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.PagoTarjetaCredito[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,186 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "tarjeta_credito")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "TarjetaCredito.findAll", query = "SELECT t FROM TarjetaCredito t")
, @NamedQuery(name = "TarjetaCredito.findById", query = "SELECT t FROM TarjetaCredito t WHERE t.id = :id")
, @NamedQuery(name = "TarjetaCredito.findByLimiteNacional", query = "SELECT t FROM TarjetaCredito t WHERE t.limiteNacional = :limiteNacional")
, @NamedQuery(name = "TarjetaCredito.findByLimiteInternacional", query = "SELECT t FROM TarjetaCredito t WHERE t.limiteInternacional = :limiteInternacional")
, @NamedQuery(name = "TarjetaCredito.findByInsertedAt", query = "SELECT t FROM TarjetaCredito t WHERE t.insertedAt = :insertedAt")})
public class TarjetaCredito implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "limite_nacional")
private int limiteNacional;
@Basic(optional = false)
@Column(name = "limite_internacional")
private int limiteInternacional;
@Basic(optional = false)
@Column(name = "deuda_nacional")
private int deudaNacional;
@Basic(optional = false)
@Column(name = "deuda_internacional")
private int deudaInternacional;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "cliente", referencedColumnName = "id")
@ManyToOne(optional = false)
private Cliente cliente;
@OneToMany(mappedBy = "tarjetaCredito")
private List<PagoTarjetaCredito> pagoList;
@OneToMany(mappedBy = "tarjetaCredito")
private List<CompraTarjetaCredito> compraList;
public TarjetaCredito() {
}
public TarjetaCredito(Integer id) {
this.id = id;
}
public TarjetaCredito(Integer id, int limiteNacional, int limiteInternacional, Date insertedAt) {
this.id = id;
this.limiteNacional = limiteNacional;
this.limiteInternacional = limiteInternacional;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getLimiteNacional() {
return limiteNacional;
}
public void setLimiteNacional(int limiteNacional) {
this.limiteNacional = limiteNacional;
}
public int getLimiteInternacional() {
return limiteInternacional;
}
public void setLimiteInternacional(int limiteInternacional) {
this.limiteInternacional = limiteInternacional;
}
public int getDeudaNacional() {
return deudaNacional;
}
public int getDeudaInternacional() {
return deudaInternacional;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
@XmlTransient
public List<PagoTarjetaCredito> getPagoList() {
return pagoList;
}
public void setPagoList(List<PagoTarjetaCredito> pagoList) {
this.pagoList = pagoList;
}
@XmlTransient
public List<CompraTarjetaCredito> getCompraList() {
return compraList;
}
public void setCompraList(List<CompraTarjetaCredito> compraList) {
this.compraList = compraList;
}
public void setDeudaNacional(int deudaNacional) {
this.deudaNacional = deudaNacional;
}
public void setDeudaInternacional(int deudaInternacional) {
this.deudaInternacional = deudaInternacional;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TarjetaCredito)) {
return false;
}
TarjetaCredito other = (TarjetaCredito) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.TarjetaCredito[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,185 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "tarjeta_debito")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "TarjetaDebito.findAll", query = "SELECT t FROM TarjetaDebito t")
, @NamedQuery(name = "TarjetaDebito.findById", query = "SELECT t FROM TarjetaDebito t WHERE t.id = :id")
, @NamedQuery(name = "TarjetaDebito.findBySaldo", query = "SELECT t FROM TarjetaDebito t WHERE t.saldo = :saldo")
, @NamedQuery(name = "TarjetaDebito.findByInsertedAt", query = "SELECT t FROM TarjetaDebito t WHERE t.insertedAt = :insertedAt")})
public class TarjetaDebito implements Serializable {
@OneToMany(cascade = CascadeType.ALL, mappedBy = "tarjetaDebito")
private List<CompraTarjetaDebito> compraList;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "saldo")
private int saldo;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "cliente", referencedColumnName = "id")
@ManyToOne(optional = false)
private Cliente cliente;
@OneToMany(mappedBy = "tarjetaDebitoFrom")
private List<TransferenciaTarjetaDebito> transferenciaFromList;
@OneToMany(mappedBy = "tarjetaDebitoTo")
private List<TransferenciaTarjetaDebito> transferenciaToList;
@OneToMany(mappedBy = "tarjetaDebito")
private List<DepositoTarjetaDebito> depositoList;
@OneToMany(mappedBy = "tarjetaDebito")
private List<GiroTarjetaDebito> giroList;
public TarjetaDebito() {
}
public TarjetaDebito(Integer id) {
this.id = id;
}
public TarjetaDebito(Integer id, int saldo, Date insertedAt) {
this.id = id;
this.saldo = saldo;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getSaldo() {
return saldo;
}
public void setSaldo(int saldo) {
this.saldo = saldo;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
@XmlTransient
public List<TransferenciaTarjetaDebito> getTransferenciaFromList() {
return transferenciaFromList;
}
public void setTransferenciaFromList(List<TransferenciaTarjetaDebito> transferenciaFromList) {
this.transferenciaFromList = transferenciaFromList;
}
@XmlTransient
public List<TransferenciaTarjetaDebito> getTransferenciaToList() {
return transferenciaToList;
}
public void setTransferenciaToList(List<TransferenciaTarjetaDebito> transferenciaToList) {
this.transferenciaToList = transferenciaToList;
}
@XmlTransient
public List<DepositoTarjetaDebito> getDepositoList() {
return depositoList;
}
public void setDepositoList(List<DepositoTarjetaDebito> depositoList) {
this.depositoList = depositoList;
}
@XmlTransient
public List<GiroTarjetaDebito> getGiroList() {
return giroList;
}
public void setGiroList(List<GiroTarjetaDebito> giroList) {
this.giroList = giroList;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TarjetaDebito)) {
return false;
}
TarjetaDebito other = (TarjetaDebito) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.TarjetaDebito[ id=" + id + " ]";
}
@XmlTransient
public List<CompraTarjetaDebito> getCompraList() {
return compraList;
}
public void setCompraList(List<CompraTarjetaDebito> compraList) {
this.compraList = compraList;
}
}

View File

@@ -0,0 +1,147 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "transferencia_cuenta_corriente")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "TransferenciaCuentaCorriente.findAll", query = "SELECT t FROM TransferenciaCuentaCorriente t")
, @NamedQuery(name = "TransferenciaCuentaCorriente.findById", query = "SELECT t FROM TransferenciaCuentaCorriente t WHERE t.id = :id")
, @NamedQuery(name = "TransferenciaCuentaCorriente.findByMonto", query = "SELECT t FROM TransferenciaCuentaCorriente t WHERE t.monto = :monto")
, @NamedQuery(name = "TransferenciaCuentaCorriente.findByComentario", query = "SELECT t FROM TransferenciaCuentaCorriente t WHERE t.comentario = :comentario")
, @NamedQuery(name = "TransferenciaCuentaCorriente.findByInsertedAt", query = "SELECT t FROM TransferenciaCuentaCorriente t WHERE t.insertedAt = :insertedAt")})
public class TransferenciaCuentaCorriente implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "monto")
private int monto;
@Column(name = "comentario")
private String comentario;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "cuenta_corriente_from", referencedColumnName = "id")
@ManyToOne
private CuentaCorriente cuentaCorrienteFrom;
@JoinColumn(name = "cuenta_corriente_to", referencedColumnName = "id")
@ManyToOne
private CuentaCorriente cuentaCorrienteTo;
public TransferenciaCuentaCorriente() {
}
public TransferenciaCuentaCorriente(Integer id) {
this.id = id;
}
public TransferenciaCuentaCorriente(Integer id, int monto, Date insertedAt) {
this.id = id;
this.monto = monto;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public CuentaCorriente getCuentaCorrienteFrom() {
return cuentaCorrienteFrom;
}
public void setCuentaCorrienteFrom(CuentaCorriente cuentaCorrienteFrom) {
this.cuentaCorrienteFrom = cuentaCorrienteFrom;
}
public CuentaCorriente getCuentaCorrienteTo() {
return cuentaCorrienteTo;
}
public void setCuentaCorrienteTo(CuentaCorriente cuentaCorrienteTo) {
this.cuentaCorrienteTo = cuentaCorrienteTo;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TransferenciaCuentaCorriente)) {
return false;
}
TransferenciaCuentaCorriente other = (TransferenciaCuentaCorriente) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.TransferenciaCuentaCorriente[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,147 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "transferencia_tarjeta_debito")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "TransferenciaTarjetaDebito.findAll", query = "SELECT t FROM TransferenciaTarjetaDebito t")
, @NamedQuery(name = "TransferenciaTarjetaDebito.findById", query = "SELECT t FROM TransferenciaTarjetaDebito t WHERE t.id = :id")
, @NamedQuery(name = "TransferenciaTarjetaDebito.findByMonto", query = "SELECT t FROM TransferenciaTarjetaDebito t WHERE t.monto = :monto")
, @NamedQuery(name = "TransferenciaTarjetaDebito.findByComentario", query = "SELECT t FROM TransferenciaTarjetaDebito t WHERE t.comentario = :comentario")
, @NamedQuery(name = "TransferenciaTarjetaDebito.findByInsertedAt", query = "SELECT t FROM TransferenciaTarjetaDebito t WHERE t.insertedAt = :insertedAt")})
public class TransferenciaTarjetaDebito implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "monto")
private int monto;
@Column(name = "comentario")
private String comentario;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@JoinColumn(name = "tarjeta_debito_from", referencedColumnName = "id")
@ManyToOne
private TarjetaDebito tarjetaDebitoFrom;
@JoinColumn(name = "tarjeta_debito_to", referencedColumnName = "id")
@ManyToOne
private TarjetaDebito tarjetaDebitoTo;
public TransferenciaTarjetaDebito() {
}
public TransferenciaTarjetaDebito(Integer id) {
this.id = id;
}
public TransferenciaTarjetaDebito(Integer id, int monto, Date insertedAt) {
this.id = id;
this.monto = monto;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public TarjetaDebito getTarjetaDebitoFrom() {
return tarjetaDebitoFrom;
}
public void setTarjetaDebitoFrom(TarjetaDebito tarjetaDebitoFrom) {
this.tarjetaDebitoFrom = tarjetaDebitoFrom;
}
public TarjetaDebito getTarjetaDebitoTo() {
return tarjetaDebitoTo;
}
public void setTarjetaDebitoTo(TarjetaDebito tarjetaDebitoTo) {
this.tarjetaDebitoTo = tarjetaDebitoTo;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TransferenciaTarjetaDebito)) {
return false;
}
TransferenciaTarjetaDebito other = (TransferenciaTarjetaDebito) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.TransferenciaTarjetaDebito[ id=" + id + " ]";
}
}

View File

@@ -0,0 +1,177 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author ryuuji
*/
@Entity
@Table(name = "usuario")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Usuario.findAll", query = "SELECT u FROM Usuario u")
, @NamedQuery(name = "Usuario.findById", query = "SELECT u FROM Usuario u WHERE u.id = :id")
, @NamedQuery(name = "Usuario.findByNombre", query = "SELECT u FROM Usuario u WHERE u.nombre = :nombre")
, @NamedQuery(name = "Usuario.findByRole", query = "SELECT u FROM Usuario u WHERE u.role = :role")
, @NamedQuery(name = "Usuario.findByInsertedAt", query = "SELECT u FROM Usuario u WHERE u.insertedAt = :insertedAt")})
public class Usuario implements Serializable {
@Basic(optional = false)
@Lob
@Column(name = "password")
private byte[] password;
@Basic(optional = false)
@Lob
@Column(name = "salt")
private byte[] salt;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@Column(name = "nombre")
private String nombre;
@Basic(optional = false)
@Column(name = "role")
private String role;
@Basic(optional = false)
@Column(name = "inserted_at")
@Temporal(TemporalType.TIMESTAMP)
private Date insertedAt;
@OneToOne(cascade = CascadeType.ALL, mappedBy = "usuario")
private Cliente cliente;
@Transient
private String transientPassword;
public Usuario() {
}
public Usuario(Integer id) {
this.id = id;
}
public Usuario(Integer id, String nombre, byte[] password, byte[] salt, String role, Date insertedAt) {
this.id = id;
this.nombre = nombre;
this.password = password;
this.salt = salt;
this.role = role;
this.insertedAt = insertedAt;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public Date getInsertedAt() {
return insertedAt;
}
public void setInsertedAt(Date insertedAt) {
this.insertedAt = insertedAt;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
public String getTransientPassword() {
return transientPassword;
}
public void setTransientPassword(String transientPassword) {
this.transientPassword = transientPassword;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Usuario)) {
return false;
}
Usuario other = (Usuario) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
return false;
return true;
}
@Override
public String toString() {
return "entities.Usuario[ id=" + id + " ]";
}
public byte[] getPassword() {
return password;
}
public void setPassword(byte[] password) {
this.password = password;
}
public byte[] getSalt() {
return salt;
}
public void setSalt(byte[] salt) {
this.salt = salt;
}
}

71
bank-war/build.xml Normal file
View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="bank-war" default="default" basedir=".">
<description>Builds, tests, and runs the project bank-war.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-dist: called before archive building
-post-dist: called after archive building
-post-clean: called after cleaning build products
-pre-run-deploy: called before deploying
-post-run-deploy: called after deploying
Example of pluging an obfuscator after the compilation could look like
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Other way how to customize the build is by overriding existing main targets.
The target of interest are:
init-macrodef-javac: defines macro for javac compilation
init-macrodef-junit: defines macro for junit execution
init-macrodef-debug: defines macro for class debugging
do-dist: archive building
run: execution of project
javadoc-build: javadoc generation
Example of overriding the target for project execution could look like
<target name="run" depends="<PROJNAME>-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that overridden target depends on jar target and not only on
compile target as regular run target does. Again, for list of available
properties which you can use check the target you are overriding in
nbproject/build-impl.xml file.
-->
</project>

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 2008, 2016 Oracle and/or its affiliates. All rights reserved.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://www.netbeans.org/cddl-gplv2.html
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License file at
nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the GPL Version 2 section of the License file that
accompanied this code. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 2] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 2 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 2 code and therefore, elected the GPL
Version 2 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
-->
<project default="-deploy-ant" basedir=".">
<target name="-init-cl-deployment-env" if="deploy.ant.enabled">
<property file="${deploy.ant.properties.file}" />
<available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
<available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/>
<available file="${deploy.ant.resource.dir}" property="has.setup"/>
<tempfile prefix="pfv3" property="pfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<echo message="AS_ADMIN_PASSWORD=${pfv3.password}" file="${pfv3.password.file}"/>
</target>
<target name="-parse-sun-web" depends="-init-cl-deployment-env" if="sun.web.present">
<tempfile prefix="pfv3" property="temp.sun.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" tofile="${temp.sun.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.sun.web}">
<replacetoken><![CDATA[<sun-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <sun-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.sun.web}" validate="false">
</xmlproperty>
<delete file="${temp.sun.web}"/>
<condition property="deploy.ant.client.url" value="${pfv3.url}${sun-web-app.context-root}" else="${pfv3.url}/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${sun-web-app.context-root}" else="/${ant.project.name}">
<isset property="sun-web-app.context-root"/>
</condition>
</target>
<target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present">
<tempfile prefix="pfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/>
<copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/>
<!-- The doctype triggers resolution which can fail -->
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
<replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
</replace>
<replace file="${temp.gf.web}">
<replacetoken><![CDATA[<glassfish-web-app]]></replacetoken>
<replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue>
</replace>
<xmlproperty file="${temp.gf.web}" validate="false">
</xmlproperty>
<delete file="${temp.gf.web}"/>
<condition property="deploy.ant.client.url" value="${pfv3.url}${glassfish-web-app.context-root}" else="${pfv3.url}/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
<condition property="deploy.context.root.argument" value="&amp;contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}">
<isset property="glassfish-web-app.context-root"/>
</condition>
</target>
<target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
<property name="deploy.context.root.argument" value=""/>
</target>
<target name="-add-resources" depends="-init-cl-deployment-env" if="has.setup">
<tempfile prefix="pfv3" property="pfv3.resources.dir" destdir="${java.io.tmpdir}"/>
<mkdir dir="${pfv3.resources.dir}"/>
<mkdir dir="${pfv3.resources.dir}/META-INF"/>
<copy todir="${pfv3.resources.dir}/META-INF">
<fileset dir="${deploy.ant.resource.dir}"/>
</copy>
<jar destfile="${deploy.ant.archive}" update="true">
<fileset dir="${pfv3.resources.dir}"/>
</jar>
<delete dir="${pfv3.resources.dir}"/>
</target>
<target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
<antcall target="-deploy-without-pw"/>
<antcall target="-deploy-with-pw"/>
</target>
<target name="-deploy-without-pw" unless="pfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="pfv3" property="pfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get src="${pfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${pfv3.results.file}"/>
<delete file="${pfv3.results.file}"/>
</target>
<target name="-deploy-with-pw" if="pfv3.password">
<echo message="Deploying ${deploy.ant.archive}"/>
<tempfile prefix="pfv3" property="pfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/>
<get username="${pfv3.username}" password="${pfv3.password}" src="${pfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}"
dest="${pfv3.results.file}"/>
<delete file="${pfv3.results.file}"/>
</target>
<target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled">
<antcall target="-undeploy-without-pw"/>
<antcall target="-undeploy-with-pw"/>
</target>
<target name="-undeploy-without-pw" unless="pfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="pfv3" property="pfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get src="${pfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${pfv3.results.file}"/>
<delete file="${pfv3.results.file}"/>
</target>
<target name="-undeploy-with-pw" if="pfv3.password">
<echo message="Undeploying ${deploy.ant.archive}"/>
<tempfile prefix="pfv3" property="pfv3.results.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
<get username="${pfv3.username}" password="${pfv3.password}" src="${pfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}"
dest="${pfv3.results.file}"/>
<delete file="${pfv3.results.file}"/>
</target>
</project>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
build.xml.data.CRC32=96504904
build.xml.script.CRC32=4244a639
build.xml.stylesheet.CRC32=651128d4@1.77.1.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=96504904
nbproject/build-impl.xml.script.CRC32=3f726bc9
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1

View File

@@ -0,0 +1,96 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=true
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
auxiliary.org-netbeans-modules-projectapi.jsf_2e_language=Facelets
build.classes.dir=${build.web.dir}/WEB-INF/classes
build.classes.excludes=**/*.java,**/*.form
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
build.web.dir=${build.dir}/web
build.web.excludes=${build.classes.excludes}
client.urlPart=
compile.jsps=false
conf.dir=${source.root}/conf
debug.classpath=${build.classes.dir}:${javac.classpath}
debug.test.classpath=\
${run.test.classpath}
display.browser=true
# Files to be excluded from distribution war
dist.archive.excludes=
dist.dir=dist
dist.ear.war=${dist.dir}/${war.ear.name}
dist.javadoc.dir=${dist.dir}/javadoc
dist.war=${dist.dir}/${war.name}
endorsed.classpath=\
${libs.javaee-endorsed-api-7.0.classpath}
excludes=
includes=**
j2ee.compile.on.save=true
j2ee.copy.static.files.on.save=true
j2ee.deploy.on.save=true
j2ee.platform=1.7
j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jakarta.xml.bind-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/cdi-api.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.security.enterprise.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.security.enterprise-api.jar:${j2ee.server.home}/modules/javax.json.bind-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar
j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar
j2ee.platform.wsit.classpath=
j2ee.server.type=pfv3ee6
jar.compress=false
javac.classpath=\
${reference.bank-ejb.dist}:\
${libs.jsf20.classpath}:\
${libs.MySQLDriver.classpath}:\
${libs.Primefaces_7.classpath}
# Space-separated list of extra javac options
javac.compilerargs=
javac.debug=true
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.8
javac.target=1.8
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.preview=true
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
lib.dir=${web.docbase.dir}/WEB-INF/lib
no.dependencies=false
persistence.xml.dir=${conf.dir}
platform.active=default_platform
project.bank-ejb=../bank-ejb
reference.bank-ejb.dist=${project.bank-ejb}/dist/bank-ejb.jar
resource.dir=setup
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
# Space-separated list of JVM arguments used when running a class with a main method or a unit test
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value):
runmain.jvmargs=
source.encoding=UTF-8
source.root=src
src.dir=${source.root}/java
test.src.dir=test
war.content.additional=
war.ear.name=${war.name}
war.name=bank-war.war
web.docbase.dir=web
webinf.dir=web/WEB-INF

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.web.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/web-project/3">
<name>bank-war</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<web-module-libraries>
<library dirs="100">
<file>${reference.bank-ejb.dist}</file>
</library>
<library dirs="200">
<file>${libs.jsf20.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${libs.MySQLDriver.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library dirs="200">
<file>${libs.Primefaces_7.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
</web-module-libraries>
<web-module-additional-libraries/>
<source-roots>
<root id="src.dir" name="Source Packages"/>
</source-roots>
<test-roots>
<root id="test.src.dir" name="Test Packages"/>
</test-roots>
</data>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
<reference>
<foreign-project>bank-ejb</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>dist</target>
<clean-target>clean</clean-target>
<id>dist</id>
</reference>
</references>
</configuration>
</project>

View File

@@ -0,0 +1,2 @@
Manifest-Version: 1.0

View File

@@ -0,0 +1,209 @@
package bean;
import beans.ClienteFacadeLocal;
import beans.UsuarioFacadeLocal;
import entities.Cliente;
import entities.CuentaCorriente;
import entities.TarjetaCredito;
import entities.TarjetaDebito;
import entities.Usuario;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;
import utils.Passwords;
@Named(value = "clienteBean")
@SessionScoped
public class ClienteBean implements Serializable {
@EJB
private ClienteFacadeLocal clienteFacade;
@EJB
private UsuarioFacadeLocal usuarioFacade;
private List<Cliente> clienteList;
private Cliente cliente;
private Usuario usuario;
@PostConstruct
public void init() {
this.clienteList = this.clienteFacade.findAll();
this.cliente = new Cliente();
this.usuario = new Usuario();
}
public String gotoView(Cliente cliente) {
this.cliente = cliente;
return "admin_cliente_view";
}
public String gotoCreate() {
this.resetInnerCliente();
return "admin_cliente_create";
}
public String create() {
byte[] salt = Passwords.getNextSalt();
byte[] hash = Passwords.hash(usuario.getTransientPassword().toCharArray(), salt);
usuario.setNombre(cliente.getRut());
usuario.setPassword(hash);
usuario.setSalt(salt);
usuario.setRole("Cliente");
CuentaCorriente cc = new CuentaCorriente();
cc.setSaldo(0);
cc.setCliente(cliente);
cc.setInsertedAt(new Date());
cliente.getCuentaCorrienteList().add(cc);
cliente.setUsuario(usuario);
usuario.setCliente(cliente);
usuarioFacade.create(usuario);
this.clienteList.add(cliente);
resetInnerCliente();
return "admin_main";
}
public String gotoUpdate(Cliente cliente) {
this.cliente = cliente;
this.usuario = cliente.getUsuario();
return "admin_cliente_edit";
}
public String update() {
if (usuario.getTransientPassword() != null) {
byte[] salt = Passwords.getNextSalt();
byte[] hash = Passwords.hash(usuario.getTransientPassword().toCharArray(), salt);
usuario.setPassword(hash);
usuario.setSalt(salt);
}
usuarioFacade.edit(usuario);
clienteFacade.edit(cliente);
this.resetInnerCliente();
return "admin_main";
}
public String gotoDelete(Cliente cliente) {
this.cliente = cliente;
return "admin_cliente_delete";
}
public String delete() {
this.clienteList.remove(cliente);
usuarioFacade.remove(cliente.getUsuario());
this.resetInnerCliente();
return "admin_main";
}
public String gotoContratarCuentaCorriente() {
FacesContext context = FacesContext.getCurrentInstance();
CuentaCorrienteBean ccb = context.getApplication().evaluateExpressionGet(context, "#{cuentaCorrienteBean}", CuentaCorrienteBean.class);
ccb.setCliente(cliente);
return "admin_cuenta_corriente_contratar";
}
public String gotoContratarTarjetaCredito() {
FacesContext context = FacesContext.getCurrentInstance();
TarjetaCreditoBean tcb = context.getApplication().evaluateExpressionGet(context, "#{tarjetaCreditoBean}", TarjetaCreditoBean.class);
tcb.setCliente(cliente);
return "admin_tarjeta_credito_contratar";
}
public String gotoContratarTarjetaDebito() {
FacesContext context = FacesContext.getCurrentInstance();
TarjetaDebitoBean tdb = context.getApplication().evaluateExpressionGet(context, "#{tarjetaDebitoBean}", TarjetaDebitoBean.class);
tdb.setCliente(cliente);
return "admin_tarjeta_debito_contratar";
}
public String gotoEditTarjetaCredito(TarjetaCredito tarjetaCredito) {
FacesContext context = FacesContext.getCurrentInstance();
TarjetaCreditoBean tcb = context.getApplication().evaluateExpressionGet(context, "#{tarjetaCreditoBean}", TarjetaCreditoBean.class);
tcb.setCliente(cliente);
tcb.setTarjetaCredito(tarjetaCredito);
return "admin_tarjeta_credito_edit";
}
public String gotoViewCuentaCorriente(CuentaCorriente cuentaCorriente) {
FacesContext context = FacesContext.getCurrentInstance();
CuentaCorrienteBean ccb = context.getApplication().evaluateExpressionGet(context, "#{cuentaCorrienteBean}", CuentaCorrienteBean.class);
ccb.setCliente(cliente);
ccb.setCuentaCorriente(cuentaCorriente);
return "cliente_cuenta_corriente_view";
}
public String gotoViewTarjetaDebito(TarjetaDebito tarjetaDebito) {
FacesContext context = FacesContext.getCurrentInstance();
TarjetaDebitoBean tdb = context.getApplication().evaluateExpressionGet(context, "#{tarjetaDebitoBean}", TarjetaDebitoBean.class);
tdb.setCliente(cliente);
tdb.setTarjetaDebito(tarjetaDebito);
return "cliente_tarjeta_debito_view";
}
public String gotoViewTarjetaCredito(TarjetaCredito tarjetaCredito) {
FacesContext context = FacesContext.getCurrentInstance();
TarjetaCreditoBean tcb = context.getApplication().evaluateExpressionGet(context, "#{tarjetaCreditoBean}", TarjetaCreditoBean.class);
tcb.setCliente(cliente);
tcb.setTarjetaCredito(tarjetaCredito);
return "cliente_tarjeta_credito_view";
}
public String gotoAdminViewCuentaCorriente(CuentaCorriente cuentaCorriente) {
FacesContext context = FacesContext.getCurrentInstance();
CuentaCorrienteBean ccb = context.getApplication().evaluateExpressionGet(context, "#{cuentaCorrienteBean}", CuentaCorrienteBean.class);
ccb.setCliente(cliente);
ccb.setCuentaCorriente(cuentaCorriente);
return "admin_cuenta_corriente_view";
}
private void resetInnerCliente() {
this.cliente = new Cliente();
this.usuario = new Usuario();
}
//////////////////////////////////////////////////////////////////////////////
///////////////////////////GETTERS Y SETTERS//////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
public List<Cliente> getClienteList() {
return clienteList;
}
public void setClienteList(List<Cliente> clienteList) {
this.clienteList = clienteList;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
}

View File

@@ -0,0 +1,155 @@
package bean;
import beans.CompraTarjetaCreditoFacadeLocal;
import beans.CompraTarjetaDebitoFacadeLocal;
import beans.TarjetaCreditoFacadeLocal;
import beans.TarjetaDebitoFacadeLocal;
import entities.CompraTarjetaCredito;
import entities.CompraTarjetaDebito;
import entities.TarjetaCredito;
import entities.TarjetaDebito;
import java.io.Serializable;
import java.util.Date;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Named;
@Named(value = "compraBean")
@SessionScoped
public class CompraBean implements Serializable {
@EJB
private CompraTarjetaCreditoFacadeLocal compraTarjetaCreditoFacade;
@EJB
private CompraTarjetaDebitoFacadeLocal compraTarjetaDebitoFacade;
@EJB
private TarjetaDebitoFacadeLocal tarjetaDebitoFacade;
@EJB
private TarjetaCreditoFacadeLocal tarjetaCreditoFacade;
private TarjetaDebito tarjetaDebito;
private TarjetaCredito tarjetaCredito;
private int monto;
private String comentario;
private String clase;
public String comprar() {
if (tarjetaDebito != null) {
return comprarTarjetaDebito();
} else if (tarjetaCredito != null) {
return comprarTarjetaCredito();
}
return null;
}
public String comprarTarjetaDebito() {
CompraTarjetaDebito compra = new CompraTarjetaDebito();
compra.setMonto(monto);
compra.setComentario(comentario);
compra.setInsertedAt(new Date());
compra.setTarjetaDebito(tarjetaDebito);
if (tarjetaDebito.getSaldo() - monto < 0) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("La compra sobrepasa el saldo de su tarjeta de debito"));
context.validationFailed();
return "cliente_tarjeta_debito_compra";
}
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() - monto);
tarjetaDebito.getCompraList().add(compra);
compraTarjetaDebitoFacade.edit(compra);
tarjetaDebitoFacade.edit(tarjetaDebito);
this.resetInput();
return "cliente_tarjeta_debito_view";
}
public String comprarTarjetaCredito() {
CompraTarjetaCredito compra = new CompraTarjetaCredito();
compra.setMonto(monto);
compra.setComentario(comentario);
compra.setInsertedAt(new Date());
compra.setTarjetaCredito(tarjetaCredito);
if (clase.equals("Nacional")) {
if (tarjetaCredito.getDeudaNacional() + monto > tarjetaCredito.getLimiteNacional()) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("La compra sobrepasa el limite nacional de su cuenta"));
context.validationFailed();
return "cliente_tarjeta_credito_compra";
}
tarjetaCredito.setDeudaNacional(tarjetaCredito.getDeudaNacional() + monto);
} else if (clase.equals("Internacional")) {
if (tarjetaCredito.getDeudaInternacional()+ monto > tarjetaCredito.getLimiteInternacional()) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("La compra sobrepasa el limite internacional de su cuenta"));
context.validationFailed();
return "cliente_tarjeta_credito_compra";
}
tarjetaCredito.setDeudaInternacional(tarjetaCredito.getDeudaInternacional() + monto);
}
tarjetaCredito.getCompraList().add(compra);
compraTarjetaCreditoFacade.edit(compra);
tarjetaCreditoFacade.edit(tarjetaCredito);
this.resetInput();
return "cliente_tarjeta_credito_view";
}
private void resetInput() {
this.monto = 0;
this.tarjetaCredito = null;
this.tarjetaDebito = null;
this.comentario = null;
}
public TarjetaDebito getTarjetaDebito() {
return tarjetaDebito;
}
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
this.tarjetaDebito = tarjetaDebito;
}
public TarjetaCredito getTarjetaCredito() {
return tarjetaCredito;
}
public void setTarjetaCredito(TarjetaCredito tarjetaCredito) {
this.tarjetaCredito = tarjetaCredito;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public String getClase() {
return clase;
}
public void setClase(String clase) {
this.clase = clase;
}
}

View File

@@ -0,0 +1,89 @@
package bean;
import beans.ClienteFacadeLocal;
import beans.CuentaCorrienteFacadeLocal;
import entities.Cliente;
import entities.CuentaCorriente;
import entities.DepositoCuentaCorriente;
import java.io.Serializable;
import java.util.Date;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;
@Named(value = "cuentaCorrienteBean")
@SessionScoped
public class CuentaCorrienteBean implements Serializable{
@EJB
private CuentaCorrienteFacadeLocal cuentaCorrienteFacade;
@EJB
private ClienteFacadeLocal clienteFacade;
private CuentaCorriente cuentaCorriente;
private Cliente cliente;
public String contratar() {
CuentaCorriente cc = new CuentaCorriente();
cc.setSaldo(0);
cc.setCliente(cliente);
cc.setInsertedAt(new Date());
cliente.getCuentaCorrienteList().add(cc);
clienteFacade.edit(cliente);
return "admin_cliente_view";
}
public String edit() {
return "admin_cliente_view";
}
public String gotoDepositar() {
FacesContext context = FacesContext.getCurrentInstance();
DepositoBean db = context.getApplication().evaluateExpressionGet(context, "#{depositoBean}", DepositoBean.class);
db.setCuentaCorriente(cuentaCorriente);
return "cliente_cuenta_corriente_depositar";
}
public String gotoDeleteDeposito(DepositoCuentaCorriente deposito) {
FacesContext context = FacesContext.getCurrentInstance();
DepositoBean db = context.getApplication().evaluateExpressionGet(context, "#{depositoBean}", DepositoBean.class);
db.setCuentaCorriente(cuentaCorriente);
db.setDepositoCuentaCorriente(deposito);
return "admin_cuenta_corriente_delete_deposito";
}
public String gotoGirar() {
FacesContext context = FacesContext.getCurrentInstance();
GiroBean gb = context.getApplication().evaluateExpressionGet(context, "#{giroBean}", GiroBean.class);
gb.setCuentaCorriente(cuentaCorriente);
return "cliente_cuenta_corriente_girar";
}
public String gotoTransferir() {
FacesContext context = FacesContext.getCurrentInstance();
TransferenciaBean tb = context.getApplication().evaluateExpressionGet(context, "#{transferenciaBean}", TransferenciaBean.class);
tb.setCuentaCorriente(cuentaCorriente);
return "cliente_cuenta_corriente_transferir";
}
public CuentaCorriente getCuentaCorriente() {
return cuentaCorriente;
}
public void setCuentaCorriente(CuentaCorriente cuentaCorriente) {
this.cuentaCorriente = cuentaCorriente;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
}

View File

@@ -0,0 +1,184 @@
package bean;
import beans.CuentaCorrienteFacadeLocal;
import beans.DepositoCuentaCorrienteFacadeLocal;
import beans.DepositoTarjetaDebitoFacadeLocal;
import beans.MetodoFacadeLocal;
import beans.TarjetaDebitoFacadeLocal;
import entities.CuentaCorriente;
import entities.DepositoCuentaCorriente;
import entities.DepositoTarjetaDebito;
import entities.Metodo;
import entities.TarjetaDebito;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
@Named(value = "depositoBean")
@SessionScoped
public class DepositoBean implements Serializable {
@EJB
private DepositoCuentaCorrienteFacadeLocal depositoCCFacade;
@EJB
private DepositoTarjetaDebitoFacadeLocal depositoTDFacade;
@EJB
private CuentaCorrienteFacadeLocal cuentaCorrienteFacade;
@EJB
private TarjetaDebitoFacadeLocal tarjetaDebitoFacade;
@EJB
private MetodoFacadeLocal metodoFacade;
private int monto;
private String comentario;
private Metodo metodo;
private List<Metodo> metodoList;
private CuentaCorriente cuentaCorriente;
private TarjetaDebito tarjetaDebito;
private DepositoCuentaCorriente depositoCuentaCorriente;
private DepositoTarjetaDebito depositoTarjetaDebito;
@PostConstruct
private void init(){
this.metodoList = metodoFacade.findAll();
}
public String depositar() {
if(cuentaCorriente != null){
return depositarEnCuentaCorriente();
}else if(tarjetaDebito != null){
return depositarEnTarjetaDebito();
}else{
return null;
}
}
public String depositarEnCuentaCorriente() {
DepositoCuentaCorriente deposito = new DepositoCuentaCorriente();
deposito.setComentario(comentario);
deposito.setMonto(monto);
deposito.setMetodo(metodo);
deposito.setInsertedAt(new Date());
deposito.setCuentaCorriente(cuentaCorriente);
cuentaCorriente.getDepositoList().add(deposito);
cuentaCorriente.setSaldo(cuentaCorriente.getSaldo() + monto);
depositoCCFacade.create(deposito);
cuentaCorrienteFacade.edit(cuentaCorriente);
resetInput();
return "cliente_cuenta_corriente_view";
}
public String depositarEnTarjetaDebito() {
DepositoTarjetaDebito deposito = new DepositoTarjetaDebito();
deposito.setComentario(comentario);
deposito.setMonto(monto);
deposito.setMetodo(metodo);
deposito.setInsertedAt(new Date());
deposito.setTarjetaDebito(tarjetaDebito);
tarjetaDebito.getDepositoList().add(deposito);
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() + monto);
depositoTDFacade.create(deposito);
tarjetaDebitoFacade.edit(tarjetaDebito);
resetInput();
return "cliente_tarjeta_debito_view";
}
public String delete() {
if(cuentaCorriente != null) {
return deleteDepositoCuentaCorriente();
}else if (depositoTarjetaDebito != null) {
return deleteDepositoTarjetaDebito();
}
return "error/505";
}
public String deleteDepositoCuentaCorriente() {
return "";
}
public String deleteDepositoTarjetaDebito() {
return "";
}
private void resetInput() {
this.cuentaCorriente = null;
this.tarjetaDebito = null;
this.metodo = null;
this.monto = 0;
this.comentario = "";
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Metodo getMetodo() {
return metodo;
}
public void setMetodo(Metodo metodo) {
this.metodo = metodo;
}
public CuentaCorriente getCuentaCorriente() {
return cuentaCorriente;
}
public void setCuentaCorriente(CuentaCorriente cuentaCorriente) {
this.cuentaCorriente = cuentaCorriente;
}
public TarjetaDebito getTarjetaDebito() {
return tarjetaDebito;
}
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
this.tarjetaDebito = tarjetaDebito;
}
public List<Metodo> getMetodoList() {
return metodoList;
}
public void setMetodoList(List<Metodo> metodoList) {
this.metodoList = metodoList;
}
public DepositoCuentaCorriente getDepositoCuentaCorriente() {
return depositoCuentaCorriente;
}
public void setDepositoCuentaCorriente(DepositoCuentaCorriente depositoCuentaCorriente) {
this.depositoCuentaCorriente = depositoCuentaCorriente;
}
public DepositoTarjetaDebito getDepositoTarjetaDebito() {
return depositoTarjetaDebito;
}
public void setDepositoTarjetaDebito(DepositoTarjetaDebito depositoTarjetaDebito) {
this.depositoTarjetaDebito = depositoTarjetaDebito;
}
}

View File

@@ -0,0 +1,165 @@
package bean;
import beans.CuentaCorrienteFacade;
import beans.CuentaCorrienteFacadeLocal;
import beans.GiroCuentaCorrienteFacadeLocal;
import beans.GiroTarjetaDebitoFacadeLocal;
import beans.MetodoFacadeLocal;
import beans.TarjetaDebitoFacadeLocal;
import entities.CuentaCorriente;
import entities.GiroCuentaCorriente;
import entities.GiroTarjetaDebito;
import entities.Metodo;
import entities.TarjetaDebito;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Named;
@Named(value = "giroBean")
@SessionScoped
public class GiroBean implements Serializable {
@EJB
private GiroCuentaCorrienteFacadeLocal giroCCFacade;
@EJB
private GiroTarjetaDebitoFacadeLocal giroTDFacade;
@EJB
private MetodoFacadeLocal metodoFacade;
@EJB
private CuentaCorrienteFacadeLocal cuentaCorrienteFacade;
@EJB
private TarjetaDebitoFacadeLocal tarjetaDebitoFacade;
private int monto;
private String comentario;
private Metodo metodo;
private List<Metodo> metodoList;
private CuentaCorriente cuentaCorriente;
private TarjetaDebito tarjetaDebito;
@PostConstruct
private void init(){
this.metodoList = metodoFacade.findAll();
}
public String girar() {
if(cuentaCorriente != null){
return girarEnCuentaCorriente();
}else if(tarjetaDebito != null){
return girarEnTarjetaDebito();
}else{
return null;
}
}
public String girarEnCuentaCorriente() {
if(cuentaCorriente.getSaldo() - monto < 0 ){
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("El monto sobrepasa el saldo de la cuenta corriente"));
FacesContext.getCurrentInstance().validationFailed();
return "cliente_cuenta_corriente_girar";
}
GiroCuentaCorriente giro = new GiroCuentaCorriente();
giro.setComentario(comentario);
giro.setMonto(monto);
giro.setMetodo(metodo);
giro.setInsertedAt(new Date());
giro.setCuentaCorriente(cuentaCorriente);
cuentaCorriente.getGiroList().add(giro);
cuentaCorriente.setSaldo(cuentaCorriente.getSaldo() - monto);
giroCCFacade.create(giro);
cuentaCorrienteFacade.edit(cuentaCorriente);
resetInput();
return "cliente_cuenta_corriente_view";
}
public String girarEnTarjetaDebito() {
if(tarjetaDebito.getSaldo() - monto < 0 ){
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("El monto sobrepasa el saldo de la tarjeta de debito"));
FacesContext.getCurrentInstance().validationFailed();
return "cliente_tarjeta_debito_girar";
}
GiroTarjetaDebito giro = new GiroTarjetaDebito();
giro.setComentario(comentario);
giro.setMonto(monto);
giro.setMetodo(metodo);
giro.setInsertedAt(new Date());
giro.setTarjetaDebito(tarjetaDebito);
tarjetaDebito.getGiroList().add(giro);
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() - monto);
giroTDFacade.create(giro);
tarjetaDebitoFacade.edit(tarjetaDebito);
resetInput();
return "cliente_tarjeta_debito_view";
}
private void resetInput() {
this.cuentaCorriente = null;
this.tarjetaDebito = null;
this.metodo = null;
this.monto = 0;
this.comentario = "";
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public Metodo getMetodo() {
return metodo;
}
public void setMetodo(Metodo metodo) {
this.metodo = metodo;
}
public CuentaCorriente getCuentaCorriente() {
return cuentaCorriente;
}
public void setCuentaCorriente(CuentaCorriente cuentaCorriente) {
this.cuentaCorriente = cuentaCorriente;
}
public TarjetaDebito getTarjetaDebito() {
return tarjetaDebito;
}
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
this.tarjetaDebito = tarjetaDebito;
}
public List<Metodo> getMetodoList() {
return metodoList;
}
public void setMetodoList(List<Metodo> metodoList) {
this.metodoList = metodoList;
}
}

View File

@@ -0,0 +1,127 @@
package bean;
import beans.PagoTarjetaCreditoFacadeLocal;
import beans.TarjetaCreditoFacadeLocal;
import entities.PagoTarjetaCredito;
import entities.TarjetaCredito;
import java.io.Serializable;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Named;
@Named(value = "pagoBean")
@SessionScoped
public class PagoBean implements Serializable {
@EJB
private PagoTarjetaCreditoFacadeLocal pagoTarjetaCreditoFacade;
@EJB
private TarjetaCreditoFacadeLocal tarjetaCreditoFacade;
private TarjetaCredito tarjetaCredito;
private int monto;
private String comentario;
private String clase;
public String pagar() {
if (clase.equals("Nacional")) {
if (tarjetaCredito.getDeudaNacional() == 0) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("No hay ninguna deuda nacional que pagar"));
context.validationFailed();
return "cliente_tarjeta_credito_pagar";
}
if (tarjetaCredito.getDeudaNacional() - monto < 0) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("El pago sobrepasa la deuda"));
context.validationFailed();
return "cliente_tarjeta_credito_pagar";
}
PagoTarjetaCredito pago = new PagoTarjetaCredito();
pago.setComentario(comentario);
pago.setMonto(monto);
pago.setTarjetaCredito(tarjetaCredito);
tarjetaCredito.setDeudaNacional(tarjetaCredito.getDeudaNacional() - monto);
tarjetaCreditoFacade.edit(tarjetaCredito);
pagoTarjetaCreditoFacade.create(pago);
this.resetInput();
return "cliente_tarjeta_credito_view";
}
if (clase.equals("Internacional")) {
if (tarjetaCredito.getDeudaInternacional() == 0) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("No hay ninguna deuda internacional que pagar"));
context.validationFailed();
return "cliente_tarjeta_credito_pagar";
}
if (tarjetaCredito.getDeudaInternacional() - monto < 0) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("El pago sobrepasa la deuda internacional"));
context.validationFailed();
return "cliente_tarjeta_credito_pagar";
}
PagoTarjetaCredito pago = new PagoTarjetaCredito();
pago.setComentario(comentario);
pago.setMonto(monto);
pago.setTarjetaCredito(tarjetaCredito);
tarjetaCredito.setDeudaInternacional(tarjetaCredito.getDeudaInternacional() - monto);
tarjetaCredito.getPagoList().add(pago);
tarjetaCreditoFacade.edit(tarjetaCredito);
pagoTarjetaCreditoFacade.create(pago);
this.resetInput();
return "cliente_tarjeta_credito_view";
}
return "cliente_tarjeta_credito_view";
}
public void resetInput() {
this.monto = 0;
this.comentario = null;
this.clase = null;
}
public TarjetaCredito getTarjetaCredito() {
return tarjetaCredito;
}
public void setTarjetaCredito(TarjetaCredito tarjetaCredito) {
this.tarjetaCredito = tarjetaCredito;
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public String getClase() {
return clase;
}
public void setClase(String clase) {
this.clase = clase;
}
}

View File

@@ -0,0 +1,86 @@
package bean;
import beans.ClienteFacadeLocal;
import beans.TarjetaCreditoFacadeLocal;
import entities.Cliente;
import entities.TarjetaCredito;
import java.io.Serializable;
import java.util.Date;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;
@Named(value = "tarjetaCreditoBean")
@SessionScoped
public class TarjetaCreditoBean implements Serializable {
@EJB
private TarjetaCreditoFacadeLocal tarjetaCreditoFacade;
@EJB
private ClienteFacadeLocal clienteFacade;
private Cliente cliente;
private TarjetaCredito tarjetaCredito;
@PostConstruct
public void init() {
this.cliente = new Cliente();
this.tarjetaCredito = new TarjetaCredito();
}
public String contratar() {
tarjetaCredito.setCliente(cliente);
tarjetaCredito.setInsertedAt(new Date());
cliente.getTarjetaCreditoList().add(tarjetaCredito);
clienteFacade.edit(cliente);
this.resetClases();
return "admin_cliente_view";
}
public String gotoComprar() {
FacesContext context = FacesContext.getCurrentInstance();
CompraBean cb = context.getApplication().evaluateExpressionGet(context, "#{compraBean}", CompraBean.class);
cb.setTarjetaCredito(tarjetaCredito);
return "cliente_tarjeta_credito_comprar";
}
public String gotoPagar() {
FacesContext context = FacesContext.getCurrentInstance();
PagoBean pb = context.getApplication().evaluateExpressionGet(context, "#{pagoBean}", PagoBean.class);
pb.setTarjetaCredito(tarjetaCredito);
return "cliente_tarjeta_credito_pagar";
}
public String edit() {
tarjetaCreditoFacade.edit(tarjetaCredito);
this.resetClases();
return "admin_cliente_view";
}
private void resetClases() {
this.cliente = new Cliente();
this.tarjetaCredito = new TarjetaCredito();
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
public TarjetaCredito getTarjetaCredito() {
return tarjetaCredito;
}
public void setTarjetaCredito(TarjetaCredito tarjetaCredito) {
this.tarjetaCredito = tarjetaCredito;
}
}

View File

@@ -0,0 +1,94 @@
package bean;
import beans.ClienteFacadeLocal;
import beans.TarjetaDebitoFacadeLocal;
import entities.Cliente;
import entities.TarjetaDebito;
import java.io.Serializable;
import java.util.Date;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;
@Named(value = "tarjetaDebitoBean")
@SessionScoped
public class TarjetaDebitoBean implements Serializable {
@EJB
private TarjetaDebitoFacadeLocal tarjetaDebitoFacade;
@EJB
private ClienteFacadeLocal clienteFacade;
private Cliente cliente;
private TarjetaDebito tarjetaDebito;
@PostConstruct
public void init() {
this.cliente = new Cliente();
this.tarjetaDebito = new TarjetaDebito();
}
public String contratar() {
tarjetaDebito.setCliente(cliente);
tarjetaDebito.setInsertedAt(new Date());
cliente.getTarjetaDebitoList().add(tarjetaDebito);
clienteFacade.edit(cliente);
this.resetInput();
return "admin_cliente_view";
}
public String gotoDepositar() {
FacesContext context = FacesContext.getCurrentInstance();
DepositoBean db = context.getApplication().evaluateExpressionGet(context, "#{depositoBean}", DepositoBean.class);
db.setTarjetaDebito(tarjetaDebito);
return "cliente_tarjeta_debito_depositar";
}
public String gotoGirar() {
FacesContext context = FacesContext.getCurrentInstance();
GiroBean gb = context.getApplication().evaluateExpressionGet(context, "#{giroBean}", GiroBean.class);
gb.setTarjetaDebito(tarjetaDebito);
return "cliente_tarjeta_debito_girar";
}
public String gotoTransferir() {
FacesContext context = FacesContext.getCurrentInstance();
TransferenciaBean tb = context.getApplication().evaluateExpressionGet(context, "#{transferenciaBean}", TransferenciaBean.class);
tb.setTarjetaDebito(tarjetaDebito);
return "cliente_tarjeta_debito_transferir";
}
public String gotoComprar() {
FacesContext context = FacesContext.getCurrentInstance();
CompraBean cb = context.getApplication().evaluateExpressionGet(context, "#{compraBean}", CompraBean.class);
cb.setTarjetaDebito(tarjetaDebito);
return "cliente_tarjeta_debito_comprar";
}
private void resetInput() {
this.cliente = new Cliente();
this.tarjetaDebito = new TarjetaDebito();
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
public TarjetaDebito getTarjetaDebito() {
return tarjetaDebito;
}
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
this.tarjetaDebito = tarjetaDebito;
}
}

View File

@@ -0,0 +1,179 @@
package bean;
import beans.CuentaCorrienteFacadeLocal;
import beans.TarjetaDebitoFacadeLocal;
import beans.TransferenciaCuentaCorrienteFacadeLocal;
import beans.TransferenciaTarjetaDebitoFacadeLocal;
import entities.CuentaCorriente;
import entities.TarjetaDebito;
import entities.TransferenciaCuentaCorriente;
import entities.TransferenciaTarjetaDebito;
import java.io.Serializable;
import java.util.Date;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Named;
@Named(value = "transferenciaBean")
@SessionScoped
public class TransferenciaBean implements Serializable {
@EJB
private TransferenciaCuentaCorrienteFacadeLocal transferenciaCCFacade;
@EJB
private TransferenciaTarjetaDebitoFacadeLocal transferenciaTDFacade;
@EJB
private CuentaCorrienteFacadeLocal cuentaCorrienteFacade;
@EJB
private TarjetaDebitoFacadeLocal tarjetaDebitoFacade;
private int monto;
private int destinatario_id;
private String comentario;
private CuentaCorriente cuentaCorriente;
private TarjetaDebito tarjetaDebito;
public String transferir() {
if (cuentaCorriente != null) {
return transferirEnCuentaCorriente();
} else if (tarjetaDebito != null) {
return transferirEnTarjetaDebito();
} else {
return null;
}
}
public String transferirEnCuentaCorriente() {
if(this.destinatario_id == this.cuentaCorriente.getId()){
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("No se puede transferir hacia si mismo"));
FacesContext.getCurrentInstance().validationFailed();
return "cliente_cuenta_corriente_transferir";
}
CuentaCorriente destinatario = cuentaCorrienteFacade.find(this.destinatario_id);
if (destinatario == null) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("La cuenta corriente ingresada no existe"));
FacesContext.getCurrentInstance().validationFailed();
return "cliente_cuenta_corriente_transferir";
}
if (cuentaCorriente.getSaldo() - monto < 0) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("El monto sobrepasa el saldo de la cuenta corriente"));
FacesContext.getCurrentInstance().validationFailed();
return "cliente_cuenta_corriente_transferir";
}
TransferenciaCuentaCorriente transferencia = new TransferenciaCuentaCorriente();
transferencia.setComentario(comentario);
transferencia.setMonto(monto);
transferencia.setInsertedAt(new Date());
transferencia.setCuentaCorrienteFrom(cuentaCorriente);
transferencia.setCuentaCorrienteTo(destinatario);
cuentaCorriente.getTransferenciaFromList().add(transferencia);
destinatario.getTransferenciaToList().add(transferencia);
cuentaCorriente.setSaldo(cuentaCorriente.getSaldo() - monto);
destinatario.setSaldo(destinatario.getSaldo() + monto);
transferenciaCCFacade.create(transferencia);
cuentaCorrienteFacade.edit(cuentaCorriente);
cuentaCorrienteFacade.edit(destinatario);
resetInput();
return "cliente_cuenta_corriente_view";
}
public String transferirEnTarjetaDebito() {
if(this.destinatario_id == this.tarjetaDebito.getId()){
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("No se puede transferir hacia si mismo"));
FacesContext.getCurrentInstance().validationFailed();
return "cliente_tarjeta_debito_transferir";
}
TarjetaDebito destinatario = tarjetaDebitoFacade.find(this.destinatario_id);
if (destinatario == null) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("La tarjeta de debito ingresada no existe"));
FacesContext.getCurrentInstance().validationFailed();
return "cliente_tarjeta_debito_transferir";
}
if (tarjetaDebito.getSaldo() - monto < 0) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("El monto sobrepasa el saldo de la tarjeta de debito"));
FacesContext.getCurrentInstance().validationFailed();
return "cliente_tarjeta_debito_transferir";
}
TransferenciaTarjetaDebito transferencia = new TransferenciaTarjetaDebito();
transferencia.setComentario(comentario);
transferencia.setMonto(monto);
transferencia.setInsertedAt(new Date());
transferencia.setTarjetaDebitoFrom(tarjetaDebito);
transferencia.setTarjetaDebitoTo(destinatario);
tarjetaDebito.getTransferenciaFromList().add(transferencia);
destinatario.getTransferenciaToList().add(transferencia);
tarjetaDebito.setSaldo(tarjetaDebito.getSaldo() - monto);
destinatario.setSaldo(destinatario.getSaldo() + monto);
transferenciaTDFacade.create(transferencia);
tarjetaDebitoFacade.edit(tarjetaDebito);
tarjetaDebitoFacade.edit(destinatario);
resetInput();
return "cliente_tarjeta_debito_view";
}
private void resetInput() {
this.cuentaCorriente = null;
this.tarjetaDebito = null;
this.monto = 0;
this.destinatario_id = 0;
this.comentario = "";
}
public int getMonto() {
return monto;
}
public void setMonto(int monto) {
this.monto = monto;
}
public String getComentario() {
return comentario;
}
public void setComentario(String comentario) {
this.comentario = comentario;
}
public CuentaCorriente getCuentaCorriente() {
return cuentaCorriente;
}
public void setCuentaCorriente(CuentaCorriente cuentaCorriente) {
this.cuentaCorriente = cuentaCorriente;
}
public TarjetaDebito getTarjetaDebito() {
return tarjetaDebito;
}
public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
this.tarjetaDebito = tarjetaDebito;
}
public int getDestinatario_id() {
return destinatario_id;
}
public void setDestinatario_id(int destinatario_id) {
this.destinatario_id = destinatario_id;
}
}

View File

@@ -0,0 +1,113 @@
package bean;
import beans.UsuarioFacadeLocal;
import entities.Usuario;
import java.io.Serializable;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Named;
import utils.Passwords;
@Named(value = "userBean")
@SessionScoped
public class UsuarioBean implements Serializable {
@EJB
private UsuarioFacadeLocal usuarioFacade;
private String nombre;
private String password;
public String login() {
Usuario u = usuarioFacade.findByNombre(nombre);
if (u == null) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("El usuario o la contraseña son invalidos"));
context.validationFailed();
return "index";
}
if (!Passwords.isExpectedPassword(password.toCharArray(), u.getSalt(), u.getPassword())) {
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("El usuario o la contraseña son invalidos"));
context.validationFailed();
return "index";
}
this.setUsuario(u);
if(isAdmin())
return "admin_main";
if(isClient()){
FacesContext context = FacesContext.getCurrentInstance();
ClienteBean clienteBean = context.getApplication().evaluateExpressionGet(context, "#{clienteBean}", ClienteBean.class);
clienteBean.setCliente(u.getCliente());
return "cliente_main";
}
return "error/500";
}
public String register() {
byte[] salt = Passwords.getNextSalt();
byte[] hash = Passwords.hash(password.toCharArray(), salt);
Usuario u = new Usuario();
u.setNombre(nombre);
u.setPassword(hash);
u.setSalt(salt);
u.setRole("Admin");
usuarioFacade.create(u);
return "index";
}
public String logout() {
FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
return "index";
}
public boolean isLogged() {
return this.getUsuario() != null;
}
public boolean isAdmin() {
return this.getUsuario().getRole().equals("Admin");
}
public boolean isClient() {
return this.getUsuario().getRole().equals("Cliente");
}
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////GETTERS Y SETTERS//////////////////////////////
//////////////////////////////////////////////////////////////////////////////
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Usuario getUsuario() {
return (Usuario) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("usuario");
}
public void setUsuario(Usuario usuario) {
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("usuario", usuario);
}
}

View File

@@ -0,0 +1,47 @@
package utils;
import beans.MetodoFacadeLocal;
import entities.Metodo;
import javax.ejb.EJB;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
@ManagedBean
@RequestScoped
public class MetodoConverter implements Converter {
@EJB
private MetodoFacadeLocal metodoFacade;
@Override
public Object getAsObject(FacesContext context, UIComponent component, String submittedValue) {
if (submittedValue == null || submittedValue.isEmpty()) {
return null;
}
try {
return metodoFacade.find(Integer.valueOf(submittedValue));
} catch (NumberFormatException e) {
throw new ConverterException(new FacesMessage(String.format("%s no es id de metodo valido", submittedValue)), e);
}
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object modelValue) {
if (modelValue == null) {
return "";
}
if (modelValue instanceof Metodo) {
return String.valueOf(((Metodo) modelValue).getId());
} else {
throw new ConverterException(new FacesMessage(String.format("%s no es un metodo valido", modelValue)));
}
}
}

View File

@@ -0,0 +1,73 @@
package utils;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.spec.InvalidKeySpecException;
import java.util.Arrays;
import java.util.Random;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
/**
* Clase encargada de crear y comparar contraseñas de forma segura
*/
public class Passwords {
private static final Random RANDOM = new SecureRandom();
private static final int ITERATIONS = 10000;
private static final int KEY_LENGHT = 256;
private Passwords() {
}
/**
* Genera aleatoriamente un <code>byte[]</code> de tamaño 16
*
* @return El <code>byte[]</code> generados
*/
public static byte[] getNextSalt() {
byte[] salt = new byte[16];
RANDOM.nextBytes(salt);
return salt;
}
/**
* Compara 2 constraseñas, la primera sin hashear aun y la segunda ya hasheada
*
* @param password <code>char[]</code> que contiene la contraseña sin hashear aun
* @param salt <code>byte[]</code> que contiene la sal con la que juntar la contraseña al momento de hashearla
* @param expectedHash <code>byte[]</code> con una contraseña ya hasheada con la que comprar
* @return un boleano indicando que las constraseñas son iguales o no
*/
public static boolean isExpectedPassword(char[] password, byte[] salt, byte[] expectedHash) {
byte[] pwdHash = hash(password, salt);
Arrays.fill(password, Character.MIN_VALUE);
if (pwdHash.length != expectedHash.length)
return false;
for (int i = 0; i < pwdHash.length; i++) {
if (pwdHash[i] != expectedHash[i])
return false;
}
return true;
}
/**
* Hashea una contraseña.
*
* @param password <code>char[]</code> con la contraseña a hashear
* @param salt <code>byte[]</code> con la salt que se le aplicara a la contraseña
* @return <code>byte[]</code> con la constraseña hasheada
*/
public static byte[] hash(char[] password, byte[] salt) {
PBEKeySpec spec = new PBEKeySpec(password, salt, ITERATIONS, KEY_LENGHT);
Arrays.fill(password, Character.MIN_VALUE);
try {
SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
return skf.generateSecret(spec).getEncoded();
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
throw new AssertionError("Error while hashing a password: " + e.getMessage(), e);
} finally {
spec.clearPassword();
}
}
}

View File

@@ -0,0 +1,55 @@
package utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
@FacesValidator(value = "rutValidator")
public class RutValidator implements Validator {
private final static Pattern PATTERN = Pattern.compile("(\\d+)-(\\d|k)", Pattern.CASE_INSENSITIVE);
@Override
public void validate(FacesContext fc, UIComponent uic, Object o) throws ValidatorException {
Matcher matcher = PATTERN.matcher(o.toString());
if (!matcher.matches()) {
FacesMessage message = new FacesMessage("Rut: El formato no es correcto");
message.setSeverity(FacesMessage.SEVERITY_ERROR);
throw new ValidatorException(message);
}
if (!rutChecksum(matcher.group(1), matcher.group(2).toLowerCase().charAt(0))) {
FacesMessage message = new FacesMessage("Rut: El digito verificador no es correcto");
message.setSeverity(FacesMessage.SEVERITY_ERROR);
throw new ValidatorException(message);
}
}
private boolean rutChecksum(String body, char dv) {
int sum = 0;
for (int i = body.length() - 1, j = 2; i >= 0; i--, j++) {
int digit = body.charAt(i) - '0';
if (j == 8)
j = 2;
sum += digit * j;
}
int mod11 = 11 - (sum % 11);
char digitoVerificador = (char) (mod11 + '0');
if (mod11 == 11)
digitoVerificador = '0';
if (mod11 == 10)
digitoVerificador = 'k';
return dv == digitoVerificador ;
}
}

View File

@@ -0,0 +1,31 @@
package utils;
import beans.ClienteFacadeLocal;
import entities.Cliente;
import javax.ejb.EJB;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
@ManagedBean
@RequestScoped
public class UniqueRutValidator implements Validator {
@EJB
private ClienteFacadeLocal clienteFacade;
@Override
public void validate(FacesContext fc, UIComponent uic, Object o) throws ValidatorException {
Cliente cliente = clienteFacade.findByRut(o.toString());
if (cliente != null) {
FacesMessage message = new FacesMessage("Rut: Ya existe un usuario con ese rut");
message.setSeverity(FacesMessage.SEVERITY_ERROR);
throw new ValidatorException(message);
}
}
}

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
</web-app>

View File

@@ -0,0 +1,65 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<h1 class="f1 tc">Crear cliente</h1>
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="rut" value="Rut:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="rut" value="#{clienteBean.cliente.rut}" required="true" label="Rut:">
<f:validator validatorId="rutValidator"/>
<f:validator binding="#{uniqueRutValidator}"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="nombre" value="Nombre:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="nombre" value="#{clienteBean.cliente.nombre}" required="true" label="Nombre"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="ciudad" value="Ciudad:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="ciudad" value="#{clienteBean.cliente.ciudad}" required="true" label="Ciudad"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="password" value="Contraseña:"/>
<h:inputSecret class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="password" value="#{clienteBean.usuario.transientPassword}" required="true" label="Contraseña">
<f:validateLength minimum="4"/>
</h:inputSecret>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 dib white bg-blue" action="#{clienteBean.create()}">
<li class="fas fa-plus-circle"></li> Crear
</h:commandLink>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="admin_main">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandButton class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,62 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<h1 class="f1 tc">Eliminar Cliente</h1>
<h:messages class="f4 w-40 list white bg-red pa4 tc center" />
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="rut" value="Rut:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="rut" value="#{clienteBean.cliente.rut}" readonly="true"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="nombre" value="Nombre:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="nombre" value="#{clienteBean.cliente.nombre}" readonly="true"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="ciudad" value="Ciudad:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="ciudad" value="#{clienteBean.cliente.ciudad}" readonly="true"/>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="#{clienteBean.delete()}">
<li class="fas fa-trash"></li> Eliminar
</h:commandLink>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_main">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandButton class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,64 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<h1 class="f1 tc">Editar cliente</h1>
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="rut" value="Rut:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="rut" value="#{clienteBean.cliente.rut}" required="true" label="Rut:">
<f:validator validatorId="rutValidator"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="nombre" value="Nombre:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="nombre" value="#{clienteBean.cliente.nombre}" required="true" label="Nombre"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="ciudad" value="Ciudad:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="ciudad" value="#{clienteBean.cliente.ciudad}" required="true" label="Ciudad"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="password" value="Contraseña:"/>
<h:inputSecret class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="password" value="#{clienteBean.usuario.transientPassword}" label="Contraseña">
<f:validateLength minimum="4"/>
</h:inputSecret>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 dib white bg-blue" action="#{clienteBean.update()}">
<li class="fas fa-edit"></li> Actualizar
</h:commandLink>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 dib white bg-red" immediate="true" action="admin_main">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandButton class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,207 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<div class="flex justify-between">
<h1 class="f1">Cliente</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_main" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<h:messages class="f4 w-40 list white bg-red pa4" />
<!--
////////////////////////////////////////////////////////////////////
///////////////////////////Datos del cliente////////////////////////
////////////////////////////////////////////////////////////////////
-->
<div class="mv3 pa2 fl w-33">
<h:outputLabel class="db fw4 lh-copy f6" for="rut" value="Rut:"/>
<h:inputText class="pa2 input-reset ba b--black-20 w-100" id="rut" value="#{clienteBean.cliente.rut}" readonly="true"/>
</div>
<div class="mv3 pa2 fl w-33">
<h:outputLabel class="db fw4 lh-copy f6" for="nombre" value="Nombre:"/>
<h:inputText class="pa2 input-reset ba b--black-20 w-100" id="nombre" value="#{clienteBean.cliente.nombre}" readonly="true"/>
</div>
<div class="mv3 pa2 fl w-33">
<h:outputLabel class="db fw4 lh-copy f6" for="ciudad" value="Ciudad:"/>
<h:inputText class="pa2 input-reset ba b--black-20 w-100" id="ciudad" value="#{clienteBean.cliente.ciudad}" readonly="true"/>
</div>
<h2 class="f2">Servicios</h2>
<!--
////////////////////////////////////////////////////////////////////
///////////////////////////Cuentas Corrientes///////////////////////
////////////////////////////////////////////////////////////////////
-->
<div class="flex justify-between">
<h3 class="f3 dib">Cuentas Corrientes</h3>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="#{clienteBean.gotoContratarCuentaCorriente()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-wallet"></li> Contratar
</h:commandLink>
</div>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.cuentaCorrienteList}" var="cuentaCorriente">
<h:column>
<f:facet name="header">
<h:outputLabel value="Id"/>
</f:facet>
<h:outputLabel value="#{cuentaCorriente.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Saldo"/>
</f:facet>
<h:outputLabel value="#{cuentaCorriente.saldo}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha creacion"/>
</f:facet>
<h:outputLabel value="#{cuentaCorriente.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column class="tr">
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green" action="#{clienteBean.gotoAdminViewCuentaCorriente(cuentaCorriente)}">
<li class="fas fa-eye"></li>
</h:commandLink>
</h:column>
</h:dataTable>
<!--
////////////////////////////////////////////////////////////////////
///////////////////////////Tarjetas de Debito//////////////////////
////////////////////////////////////////////////////////////////////
-->
<div class="flex justify-between">
<h3 class="f3 dib">Tarjetas de Debito</h3>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="#{clienteBean.gotoContratarTarjetaDebito()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-money-check"></li> Contratar
</h:commandLink>
</div>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.tarjetaDebitoList}" var="tarjetaDebito">
<h:column>
<f:facet name="header">
<h:outputLabel value="Id"/>
</f:facet>
<h:outputLabel value="#{tarjetaDebito.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Saldo"/>
</f:facet>
<h:outputLabel value="#{tarjetaDebito.saldo}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha creacion"/>
</f:facet>
<h:outputLabel value="#{tarjetaDebito.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column class="tr">
<h:commandLink class="f6 link dim br2 ph3 pv2 dib white bg-green">
<li class="fas fa-eye"></li>
</h:commandLink>
</h:column>
</h:dataTable>
<!--
////////////////////////////////////////////////////////////////////
///////////////////////////Tarjetas de Credito//////////////////////
////////////////////////////////////////////////////////////////////
-->
<div class="flex justify-between">
<h3 class="f3 dib">Tarjetas de Credito</h3>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="#{clienteBean.gotoContratarTarjetaCredito()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-credit-card"></li> Contratar
</h:commandLink>
</div>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.tarjetaCreditoList}" var="tarjetaCredito">
<h:column>
<f:facet name="header">
<h:outputLabel value="Id"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Limite Nacional"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.limiteNacional}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Deuda Nacional"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.deudaNacional}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Limite Internacional"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.limiteInternacional}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Deuda Internacional"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.deudaInternacional}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha creacion"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column class="tr">
<h:commandLink class="f6 link dim br2 ph3 pv2 dib white bg-green">
<li class="fas fa-eye"></li>
</h:commandLink>
<h:commandLink class="f6 link dim br2 ph3 pv2 ml2 dib white bg-blue" action="#{clienteBean.gotoEditTarjetaCredito(tarjetaCredito)}">
<li class="fas fa-edit"></li>
</h:commandLink>
</h:column>
</h:dataTable>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandButton class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,41 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<h1 class="f1 tc">Contratar Cuenta Corriente</h1>
<p class="tc">¿Esta seguro?</p>
<div class="flex mt3 justify-center">
<h:commandLink class="f5 tc link dim br2 ph3 pv2 dib white bg-blue" action="#{cuentaCorrienteBean.contratar()}">
<li class="fas fa-check-circle"></li>
</h:commandLink>
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 dib white bg-red" immediate="true" action="admin_cliente_view">
<li class="fas fa-times-circle"></li>
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandButton class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,159 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<div class="flex justify-between">
<h1 class="f1">Cuenta Corriente</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="admin_main" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<div class="mv4 ph2 fl w-33">
<h:outputLabel class="db fw4 lh-copy f6" for="id" value="Id:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100" id="id" value="#{cuentaCorrienteBean.cuentaCorriente.id}" readonly="true" label="Id:"/>
</div>
<div class="mv4 ph2 fl w-33">
<h:outputLabel class="db fw4 lh-copy f6" for="saldo" value="Saldo:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100" id="saldo" value="#{cuentaCorrienteBean.cuentaCorriente.saldo}" readonly="true" label="Saldo:"/>
</div>
<div class="mv4 ph2 fl w-33">
<h:outputLabel class="db fw4 lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100" id="fecha_creacion" value="#{cuentaCorrienteBean.cuentaCorriente.insertedAt}" readonly="true" label="Fecha Creacion:">
<f:convertDateTime pattern="dd/MM/yyyy"/>
</h:inputText>
</div>
<h1 class="f2 ">Depositos</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.depositoList}" var="deposito">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{deposito.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{deposito.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{deposito.monto}"/>
</h:column>
</h:dataTable>
<h1 class="f2">Giros</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.giroList}" var="giro">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{giro.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{giro.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{giro.monto}"/>
</h:column>
</h:dataTable>
<h1 class="f2">Transferencias Hechas</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.transferenciaFromList}" var="transferencia">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{transferencia.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column><h:column>
<f:facet name="header">
<h:outputLabel value="Destinatario"/>
</f:facet>
<h:outputLabel value="#{transferencia.cuentaCorrienteTo.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{transferencia.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{transferencia.monto}"/>
</h:column>
</h:dataTable>
<h1 class="f2">Transferencias Recibidas</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.transferenciaToList}" var="transferencia">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{transferencia.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column><h:column>
<f:facet name="header">
<h:outputLabel value="Emisor"/>
</f:facet>
<h:outputLabel value="#{transferencia.cuentaCorrienteFrom.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{transferencia.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{transferencia.monto}"/>
</h:column>
</h:dataTable>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,72 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<h1 class="f1 w-100 dib tc">Administracion</h1>
<div>
<h:commandLink class="f5 fr link dim br2 ph3 pv2 mb2 dib white bg-blue" action="#{clienteBean.gotoCreate()}">
<li class="fas fa-plus-circle"></li> Crear Cliente
</h:commandLink>
<h:commandLink class="f5 fl link dim br2 ph3 pv2 mb2 dib white bg-red" immediate="true" action="#{userBean.logout()}">
<li class="fas fa-sign-out-alt"></li> Cerrar sesion
</h:commandLink>
</div>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{clienteBean.clienteList}" var="cliente">
<h:column>
<f:facet name="header">
<h:outputLabel value="Rut"/>
</f:facet>
<h:outputLabel value="#{cliente.rut}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Nombre"/>
</f:facet>
<h:outputLabel value="#{cliente.nombre}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Ciudad"/>
</f:facet>
<h:outputLabel value="#{cliente.ciudad}"/>
</h:column>
<h:column class="tr">
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-green tc" action="#{clienteBean.gotoView(cliente)}">
<li class="fas fa-eye"></li>
</h:commandLink>
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-blue tc" action="#{clienteBean.gotoUpdate(cliente)}">
<li class="fas fa-edit"></li>
</h:commandLink>
<h:commandLink class="f6 link dim br2 ph3 pv2 mr2 dib white bg-red tc" action="#{clienteBean.gotoDelete(cliente)}">
<li class="fas fa-trash"></li>
</h:commandLink>
</h:column>
</h:dataTable>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Volver al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,49 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<h1 class="f1 tc">Contratar Tarjeta de Credito</h1>
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="limite_nacional" value="Limite Nacional"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent measure" id="limite_nacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteNacional}" required="true" label="Limite Nacional"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="limite_internacional" value="Limite Internacional"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent measure" id="limite_internacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteInternacional}" required="true" label="Limite Internacional"/>
</div>
<div class="flex mt3 justify-center">
<h:commandLink class="f5 tc link dim br2 ph3 pv2 dib white bg-blue" action="#{tarjetaCreditoBean.contratar()}">
<li class="fas fa-plus-circle"></li>
</h:commandLink>
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 dib white bg-red" immediate="true" action="admin_cliente_view">
<li class="fas fa-times-circle"></li>
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandButton class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,49 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<h1 class="f1 tc">Editar Tarjeta de Credito</h1>
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="limite_nacional" value="Limite Nacional"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent measure" id="limite_nacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteNacional}" required="true" label="Limite Nacional"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="limite_internacional" value="Limite Internacional"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent measure" id="limite_internacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteInternacional}" required="true" label="Limite Internacional"/>
</div>
<div class="flex mt3 justify-center">
<h:commandLink class="f5 tc link w-10 dim br2 ph3 pv2 dib white bg-blue" action="#{tarjetaCreditoBean.edit()}">
<li class="fas fa-plus-circle"></li>
</h:commandLink>
<h:commandLink class="f5 tc link w-10 dim br2 ph3 pv2 ml2 dib white bg-red" immediate="true" action="admin_cliente_view">
<li class="fas fa-times-circle"></li>
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandButton class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,41 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isAdmin()}">
<h1 class="f1 tc">Contratar Tarjeta Debito</h1>
<p class="tc">¿Esta seguro?</p>
<div class="flex mt3 justify-center">
<h:commandLink class="f5 tc link dim br2 ph3 pv2 dib white bg-blue" action="#{tarjetaDebitoBean.contratar()}">
<li class="fas fa-plus-circle"></li>
</h:commandLink>
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 dib white bg-red" immediate="true" action="admin_cliente_view">
<li class="fas fa-times-circle"></li>
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandButton class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,64 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1">Cuenta Corriente - Depositar</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="cliente_main" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{depositoBean.monto}" required="true" label="Monto">
<f:validateLongRange minimum="1000" maximum="500000"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{depositoBean.comentario}" label="Comentario">
<f:validateLength maximum="50"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="metodo" value="Metodo:"/>
<h:selectOneMenu class="pa2 ba b--black-20 bg-transparent w-100 measure" id="metodo" value="#{depositoBean.metodo}" converter="#{metodoConverter}" required="true" label="Metodo">
<f:selectItems value="#{depositoBean.metodoList}" var="metodo" itemValue="#{metodo}" itemLabel="#{metodo.nombre}"/>
</h:selectOneMenu>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{depositoBean.depositar()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-piggy-bank"></li> Depositar
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,64 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1">Cuenta Corriente - Girar</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="cliente_cuenta_corriente_view" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<h:messages class="f4 w-40 list tc center white bg-red pa4 "/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{giroBean.monto}" required="true" label="Monto">
<f:validateLongRange minimum="1000" maximum="500000"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{giroBean.comentario}" label="Comentario">
<f:validateLength maximum="50"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="metodo" value="Metodo:"/>
<h:selectOneMenu class="pa2 ba b--black-20 bg-transparent w-100 measure" id="metodo" value="#{giroBean.metodo}" converter="#{metodoConverter}" required="true" label="Metodo">
<f:selectItems value="#{giroBean.metodoList}" var="metodo" itemValue="#{metodo}" itemLabel="#{metodo.nombre}"/>
</h:selectOneMenu>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{giroBean.girar()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-hand-holding-usd"></li> Girar
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,62 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1">Cuenta Corriente - Transferir</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="cliente_cuenta_corriente_view" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<h:messages class="f4 w-40 list tc center white bg-red pa4"/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{transferenciaBean.monto}" required="true" label="Monto">
<f:validateLongRange minimum="1000" maximum="500000"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{transferenciaBean.comentario}" label="Comentario">
<f:validateLength maximum="50"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="destinatario" value="Cuenta Corriente Destinatario: "/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="destinatario" value="#{transferenciaBean.destinatario_id}" label="Destinatario"/>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{transferenciaBean.transferir()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-comments-dollar"></li> Transferir
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,171 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1">Cuenta Corriente</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="cliente_main" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="id" value="Id:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="id" value="#{cuentaCorrienteBean.cuentaCorriente.id}" readonly="true" label="Id:"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="saldo" value="Saldo:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="saldo" value="#{cuentaCorrienteBean.cuentaCorriente.saldo}" readonly="true" label="Saldo:"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="fecha_creacion" value="#{cuentaCorrienteBean.cuentaCorriente.insertedAt}" readonly="true" label="Fecha Creacion:">
<f:convertDateTime pattern="dd/MM/yyyy"/>
</h:inputText>
</div>
<div class="flex mt3 justify-center">
<h:commandLink class="f5 tc link dim br2 ph3 pv2 w-20 dib white bg-green" action="#{cuentaCorrienteBean.gotoDepositar()}">
<li class="fas fa-piggy-bank"></li> Depositar
</h:commandLink>
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 w-20 dib white bg-red" action="#{cuentaCorrienteBean.gotoGirar()}">
<li class="fas fa-hand-holding-usd"></li> Girar
</h:commandLink>
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 dib w-20 white bg-blue" action="#{cuentaCorrienteBean.gotoTransferir()}">
<li class="fas fa-comments-dollar"></li> Transferir
</h:commandLink>
</div>
<h1 class="f1">Depositos</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.depositoList}" var="deposito">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{deposito.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{deposito.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{deposito.monto}"/>
</h:column>
</h:dataTable>
<h1 class="f1">Giros</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.giroList}" var="giro">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{giro.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{giro.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{giro.monto}"/>
</h:column>
</h:dataTable>
<h1 class="f1">Transferencias Hechas</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.transferenciaFromList}" var="transferencia">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{transferencia.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column><h:column>
<f:facet name="header">
<h:outputLabel value="Destinatario"/>
</f:facet>
<h:outputLabel value="#{transferencia.cuentaCorrienteTo.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{transferencia.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{transferencia.monto}"/>
</h:column>
</h:dataTable>
<h1 class="f1">Transferencias Recibidas</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{cuentaCorrienteBean.cuentaCorriente.transferenciaToList}" var="transferencia">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{transferencia.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column><h:column>
<f:facet name="header">
<h:outputLabel value="Emisor"/>
</f:facet>
<h:outputLabel value="#{transferencia.cuentaCorrienteFrom.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{transferencia.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{transferencia.monto}"/>
</h:column>
</h:dataTable>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,165 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1 w-100 dib">¡Bienvenido #{clienteBean.cliente.nombre}!</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="#{userBean.logout()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-sign-out-alt"></li> Cerrar sesion
</h:commandLink>
</div>
<h2 class="f2">Productos</h2>
<!--
////////////////////////////////////////////////////////////////////
///////////////////////////Cuentas Corrientes///////////////////////
////////////////////////////////////////////////////////////////////
-->
<h3 class="f3">Cuentas Corrientes</h3>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.cuentaCorrienteList}" var="cuentaCorriente">
<h:column>
<f:facet name="header">
<h:outputLabel value="Id"/>
</f:facet>
<h:outputLabel value="#{cuentaCorriente.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Saldo"/>
</f:facet>
<h:outputLabel value="#{cuentaCorriente.saldo}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha creacion"/>
</f:facet>
<h:outputLabel value="#{cuentaCorriente.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column class="tr">
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green tc" action="#{clienteBean.gotoViewCuentaCorriente(cuentaCorriente)}">
<li class="fas fa-eye"></li>
</h:commandLink>
</h:column>
</h:dataTable>
<!--
////////////////////////////////////////////////////////////////////
///////////////////////////Tarjetas de Debito///////////////////////
////////////////////////////////////////////////////////////////////
-->
<h3 class="f3">Tarjetas de Debito</h3>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.tarjetaDebitoList}" var="tarjetaDebito">
<h:column>
<f:facet name="header">
<h:outputLabel value="Id"/>
</f:facet>
<h:outputLabel value="#{tarjetaDebito.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Saldo"/>
</f:facet>
<h:outputLabel value="#{tarjetaDebito.saldo}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha creacion"/>
</f:facet>
<h:outputLabel value="#{tarjetaDebito.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column class="tr">
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green tc" action="#{clienteBean.gotoViewTarjetaDebito(tarjetaDebito)}">
<li class="fas fa-eye"></li>
</h:commandLink>
</h:column>
</h:dataTable>
<!--
////////////////////////////////////////////////////////////////////
///////////////////////////Tarjetas de Credito//////////////////////
////////////////////////////////////////////////////////////////////
-->
<h3 class="f3">Tarjetas de Credito</h3>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3" value="#{clienteBean.cliente.tarjetaCreditoList}" var="tarjetaCredito">
<h:column>
<f:facet name="header">
<h:outputLabel value="Id"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.id}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Limite Nacional"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.limiteNacional}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Deuda Nacional"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.deudaNacional}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Limite Internacional"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.limiteInternacional}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Deuda Internacional"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.deudaInternacional}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha creacion"/>
</f:facet>
<h:outputLabel value="#{tarjetaCredito.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column class="tr">
<h:commandLink class="f6 link dim br2 ph3 pv2 mb2 dib white bg-green tc" action="#{clienteBean.gotoViewTarjetaCredito(tarjetaCredito)}">
<li class="fas fa-eye"></li>
</h:commandLink>
</h:column>
</h:dataTable>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Volver al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,65 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1">Tarjeta Credito - Comprar</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="cliente_tarjeta_credito_view" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<h:messages class="f4 w-40 list tc center white bg-red pa4"/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{compraBean.monto}" required="true" label="Monto">
<f:validateLongRange minimum="1"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{compraBean.comentario}" label="Comentario">
<f:validateLength maximum="50"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="tipo" value="Tipo:"/>
<h:selectOneMenu class="pa2 ba b--black-20 bg-transparent w-100 measure" id="tipo" value="#{compraBean.clase}" required="true" label="Tipo">
<f:selectItem itemValue="Nacional"/>
<f:selectItem itemValue="Internacional"/>
</h:selectOneMenu>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{compraBean.comprar()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-shopping-basket"></li> Comprar
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,65 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1">Tarjeta Credito - Pagar</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="cliente_tarjeta_credito_view" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<h:messages class="f4 w-40 list tc center white bg-red pa4"/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{pagoBean.monto}" required="true" label="Monto">
<f:validateLongRange minimum="1"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{pagoBean.comentario}" label="Comentario">
<f:validateLength maximum="50"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="tipo" value="Tipo:"/>
<h:selectOneMenu class="pa2 ba b--black-20 bg-transparent w-100 measure" id="tipo" value="#{pagoBean.clase}" required="true" label="Tipo">
<f:selectItem itemValue="Nacional"/>
<f:selectItem itemValue="Internacional"/>
</h:selectOneMenu>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{pagoBean.pagar()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-money-bill"></li> Pagar
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,122 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1">Tarjeta Credito</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-blue" immediate="true" action="cliente_main" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="id" value="Id:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="id" value="#{tarjetaCreditoBean.tarjetaCredito.id}" readonly="true" label="Id:"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="limite_nacional" value="Limite Nacional: "/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="limite_nacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteNacional}" readonly="true" label="Limite Nacional:"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="deuda_nacional" value="Deuda Nacional: "/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="deuda_nacional" value="#{tarjetaCreditoBean.tarjetaCredito.deudaNacional}" readonly="true" label="Deuda Nacional"/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="limite_internacional" value="Limite Internacional: "/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="limite_internacional" value="#{tarjetaCreditoBean.tarjetaCredito.limiteInternacional}" readonly="true" label="Limite Internacional: "/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="deuda_internacional" value="Deuda Internacional"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="deuda_internacional" value="#{tarjetaCreditoBean.tarjetaCredito.deudaInternacional}" readonly="true" label="Deuda Internacional: "/>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="fecha_creacion" value="Fecha Creacion:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-60" id="fecha_creacion" value="#{tarjetaCreditoBean.tarjetaCredito.insertedAt}" readonly="true" label="Fecha Creacion:">
<f:convertDateTime pattern="dd/MM/yyyy"/>
</h:inputText>
</div>
<div class="flex mt3 justify-center">
<h:commandLink class="f5 tc link dim br2 ph3 pv2 w-30 dib white bg-green" action="#{tarjetaCreditoBean.gotoComprar()}">
<li class="fas fa-shopping-basket"></li> Comprar
</h:commandLink>
<h:commandLink class="f5 tc link dim br2 ph3 pv2 ml2 w-30 dib white bg-red" action="#{tarjetaCreditoBean.gotoPagar()}">
<li class="fas fa-money-bill"></li> Pagar
</h:commandLink>
</div>
<h1 class="f1">Compras</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaCreditoBean.tarjetaCredito.compraList}" var="compra">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{compra.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{compra.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{compra.monto}"/>
</h:column>
</h:dataTable>
<h1 class="f1">Pagos</h1>
<h:dataTable class="w-100 pv3" headerClass="fw6 bb b--black-20 tl pb2 pr3 bg-white" value="#{tarjetaCreditoBean.tarjetaCredito.pagoList}" var="pago">
<h:column>
<f:facet name="header">
<h:outputLabel value="Fecha"/>
</f:facet>
<h:outputLabel value="#{pago.insertedAt}">
<f:convertDateTime pattern="dd/MM/yyyy HH:mm"/>
</h:outputLabel>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Comentario"/>
</f:facet>
<h:outputLabel value="#{pago.comentario}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputLabel value="Monto"/>
</f:facet>
<h:outputLabel value="#{pago.monto}"/>
</h:column>
</h:dataTable>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,58 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1">Tarjeta Debito - Comprar</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="cliente_tarjeta_debito_view" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<h:messages class="f4 w-40 list tc center white bg-red pa4"/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{compraBean.monto}" required="true" label="Monto">
<f:validateLongRange minimum="1"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{compraBean.comentario}" label="Comentario">
<f:validateLength maximum="50"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{compraBean.comprar()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-shopping-basket"></li> Comprar
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

View File

@@ -0,0 +1,64 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8.0.1/normalize.css"/>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet"/>
<h:outputStylesheet library="css" name="all.css"/>
<style>
body {
font-family: 'Open Sans', sans-serif;
}
</style>
</h:head>
<body class="black-70 pa4">
<h:form rendered="#{userBean.isLogged() and userBean.isClient()}">
<div class="flex justify-between">
<h1 class="f1">Tarjeta Debito - Depositar</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" immediate="true" action="cliente_tarjeta_debito_view" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-arrow-left"></li> Volver
</h:commandLink>
</div>
<h:messages class="f4 w-40 list tc center white bg-red pa4"/>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="monto" value="Monto:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="monto" value="#{depositoBean.monto}" required="true" label="Monto">
<f:validateLongRange minimum="1000" maximum="500000"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="comentario" value="Comentario:"/>
<h:inputText class="pa2 input-reset ba b--black-20 bg-transparent w-100 measure" id="comentario" value="#{depositoBean.comentario}" label="Comentario">
<f:validateLength maximum="50"/>
</h:inputText>
</div>
<div class="mt3 tc">
<h:outputLabel class="db fw4 lh-copy f6" for="metodo" value="Metodo:"/>
<h:selectOneMenu class="pa2 ba b--black-20 bg-transparent w-100 measure" id="metodo" value="#{depositoBean.metodo}" converter="#{metodoConverter}" required="true" label="Metodo">
<f:selectItems value="#{depositoBean.metodoList}" var="metodo" itemValue="#{metodo}" itemLabel="#{metodo.nombre}"/>
</h:selectOneMenu>
</div>
<div class="mt3 tc">
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-green" action="#{depositoBean.depositar()}" style="margin-top: auto; margin-bottom: auto">
<li class="fas fa-piggy-bank"></li> Depositar
</h:commandLink>
</div>
</h:form>
<h:form rendered="#{!userBean.isLogged()}">
<div class="tc">
<h1 class="f1 tc">Acceso no autorizado</h1>
<h:commandLink class="f5 tc link w-20 dim br2 ph3 pv2 mb1 mr2 dib white bg-red" value="Ir al index" action="index"/>
</div>
</h:form>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More