summaryrefslogtreecommitdiff
path: root/Gestor.Infrastructure/Gestor.Infrastructure.Mappings.Seguros/ClienteMap.cs
blob: 91956516bfd74f6b88fff01f705fc4aa255ecf29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using FluentNHibernate.Mapping;
using Gestor.Infrastructure.Entities.Common;
using Gestor.Infrastructure.Entities.Generic;
using Gestor.Infrastructure.Entities.Seguros;
using System;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;

namespace Gestor.Infrastructure.Mappings.Seguros
{
	public class ClienteMap : ClassMap<ClienteDb>
	{
		public ClienteMap()
		{
			base.Table("cliente");
			base.LazyLoad();
			base.Id((ClienteDb x) => (object)x.Id).GeneratedBy.Identity().Column("idcliente");
			base.References<AtividadeDb>((ClienteDb x) => x.Atividade).Column("idatividade").Fetch.Join().NotFound.Ignore();
			base.References<ProfissaoDb>((ClienteDb x) => x.Profissao).Column("idprofissao").Fetch.Join().NotFound.Ignore();
			base.References<BancoDb>((ClienteDb x) => x.Banco).Column("idcodigobanco").Fetch.Join().NotFound.Ignore();
			base.Map((ClienteDb x) => (object)x.IdEmpresa).Column("idempresa").Not.Nullable();
			base.Map((ClienteDb x) => x.Nome).Column("nome").Not.Nullable();
			base.Map((ClienteDb x) => (object)x.Nascimento).Column("dtnasc");
			base.Map((ClienteDb x) => (object)x.Sexo).CustomType<CustomEnumType<Sexo>>().Column("sexo");
			base.Map((ClienteDb x) => (object)x.EstadoCivil).CustomType<CustomEnumType<EstadoCivil>>().Column("estadocivi");
			base.Map((ClienteDb x) => x.Documento).Column("cgccpf");
			base.Map((ClienteDb x) => x.Identidade).Column("rg");
			base.Map((ClienteDb x) => x.Emissor).Column("emissor");
			base.Map((ClienteDb x) => x.EstadoEmissor).Column("rguf");
			base.Map((ClienteDb x) => (object)x.Expedicao).Column("rgexpedica");
			base.Map((ClienteDb x) => x.Habilitacao).Column("numehabili");
			base.Map((ClienteDb x) => (object)x.PrimeiraHabilitacao).Column("primehabil");
			base.Map((ClienteDb x) => (object)x.VencimentoHabilitacao).Column("venchabili");
			base.Map((ClienteDb x) => x.CategoriaHabilitacao).Column("cathabili");
			base.Map((ClienteDb x) => x.Cei).Column("cei");
			base.Map((ClienteDb x) => x.Pasta).Column("pasta");
			base.Map((ClienteDb x) => x.Agencia).Column("agencia");
			base.Map((ClienteDb x) => x.TipoConta).Column("tipoconta");
			base.Map((ClienteDb x) => x.Conta).Column("conta");
			base.Map((ClienteDb x) => (object)x.ClienteDesde).Column("clidesde");
			base.Map((ClienteDb x) => x.Observacao).Column("anotacoes").CustomType("StringClob").CustomSqlType("varchar(MAX)");
			base.Map((ClienteDb x) => (object)x.Excluido).Column("excluido").CustomType<CustomBoolType>();
			base.Map((ClienteDb x) => (object)x.DocumentoPrincipal).CustomType<TipoDocumento>().Column("documentoprincipal");
			base.Map((ClienteDb x) => x.Rne).Column("rne");
			base.Map((ClienteDb x) => (object)x.Falecido).Column("Falecido");
			base.Map((ClienteDb x) => (object)x.RendaMensal).Column("RendaMensal");
			base.Map((ClienteDb x) => x.Caepf).Column("caepf");
			base.Map((ClienteDb x) => (object)x.MalaDireta).Default("1");
			base.Map((ClienteDb c) => (object)c.EstaNaCentralSegurado);
			base.Map((ClienteDb x) => x.NomeSocialRg).Column("nomesocialRg");
		}
	}
}