File

src/entities/client.ts

Index

Properties

Properties

Optional application
Type : ApplicationClient[]
Decorators :
@OneToMany(type => ApplicationClient, application => application.client, {eager: false})
Optional cnpj
Type : string
Decorators :
@Column({unique: true, nullable: true})
Optional cnpjClient
Type : CnpjClient
Decorators :
@OneToOne(undefined, cnpj => cnpj.client, {eager: false})
company
Type : string
Decorators :
@Column()
data_destinations
Type : string
Decorators :
@Column({nullable: false, default: 'ALGAR'})
enabled
Type : boolean
Decorators :
@Column({nullable: false, default: true})
historicConfig
Type : HistClientConfig
Decorators :
@OneToMany(undefined, x => x.client)
id
Type : number
Decorators :
@PrimaryGeneratedColumn({type: 'bigint'})
idOrigem
Type : string
Decorators :
@Column({name: 'id_origem', nullable: true})
idRefSql
Type : number
Decorators :
@Column({name: 'id_ref_sql', nullable: true})
Optional internalCode
Type : string
Decorators :
@Column({name: 'internal_code', nullable: true})
mtrixCode
Type : number
Decorators :
@Column({name: 'mtrix_code', nullable: false, type: 'int4'})
name
Type : string
Decorators :
@Column({unique: false, nullable: false})
Optional observation
Type : Observation[]
Decorators :
@OneToMany(undefined, observation => observation.client)
Optional partnership
Type : Partnership[]
Decorators :
@OneToMany(undefined, partnership => partnership.client)
Optional realm
Type : string
Decorators :
@Column({nullable: true})
Optional salesForceLevel
Type : SalesForceLevel[]
Decorators :
@OneToMany(undefined, salesForceLevel => salesForceLevel.client)
statusDeploymentId
Type : statusDeployment
Decorators :
@Column({name: 'status_deployment_id', nullable: false, type: 'int4'})
type
Type : "F" | "D"
Decorators :
@Column({name: 'client_type', nullable: false})
useChannel
Type : boolean
Decorators :
@Column({type: 'boolean', name: 'use_channel'})
Optional users
Type : UserClient[]
Decorators :
@OneToMany(undefined, x => x.client)
import {
  Column,
  JoinColumn,
  ManyToOne,
  OneToMany,
  OneToOne,
  PrimaryGeneratedColumn,
  Unique,
} from 'typeorm';
import { ApplicationClient } from './applicationClient';
import { BaseEntity } from './baseEntity';
import { CnpjClient } from './cnpjClient';
import { Observation } from './observation';
import { Partnership } from './partnership';
import { UserClient } from './user-client';
import { SalesForceLevel } from './salesForceLevel';
import { statusDeployment } from 'src/types/statusDeployment';
import { HistClientConfig } from './hist-client-config';

@BaseEntity('clients')
@Unique(['cnpj'])
export class Client {
  @PrimaryGeneratedColumn({ type: 'bigint' })
  id: number;
  @Column({ unique: false, nullable: false })
  name: string;
  @Column({ name: 'internal_code', nullable: true })
  internalCode?: string;
  @Column({ unique: true, nullable: true })
  cnpj?: string;
  @Column({ nullable: true })
  realm?: string;
  @Column({ nullable: false, default: true })
  enabled: boolean;
  @Column({ nullable: false, default: 'ALGAR' })
  data_destinations: string;
  @Column({ name: 'id_ref_sql', nullable: true })
  idRefSql: number;
  @Column({ name: 'id_origem', nullable: true })
  idOrigem: string;
  @Column()
  company: string;

  @Column({ name: 'client_type', nullable: false })
  type: 'F' | 'D';

  @Column({ name: 'mtrix_code', nullable: false, type: 'int4' })
  mtrixCode: number; // supplier or distributor code

  @Column({ name: 'status_deployment_id', nullable: false, type: 'int4' })
  statusDeploymentId: statusDeployment;

  @OneToOne(() => CnpjClient, (cnpj) => cnpj.client, { eager: false })
  cnpjClient?: CnpjClient;

  @OneToMany(() => Observation, (observation) => observation.client)
  observation?: Observation[];

  @Column({ type: 'boolean', name: 'use_channel' })
  useChannel: boolean;

  @OneToMany((type) => ApplicationClient, (application) => application.client, {
    eager: false,
  })
  application?: ApplicationClient[];

  @OneToMany(() => Partnership, (partnership) => partnership.client)
  partnership?: Partnership[];

  @OneToMany(() => UserClient, (x) => x.client)
  users?: UserClient[];

  @OneToMany(() => SalesForceLevel, (salesForceLevel) => salesForceLevel.client)
  salesForceLevel?: SalesForceLevel[];

  @OneToMany(() => HistClientConfig, (x) => x.client)
  historicConfig: HistClientConfig;
}

results matching ""

    No results matching ""