aBox - v1.0.0
    Preparing search index...

    Contract Prospect

    Tabela para gerir os prospectos de contrato

    Hierarchy (View Summary)

    Index

    Properties

    contract?: string
    contractConvert?: string
    deleted?: boolean
    lastStatus?: string
    relation_sw041: sw041
    restored?: boolean
    sw029s01: number

    ContractProspect ID

    sw029s01_code: string
    sw029s02: Date

    Date created

    sw029s03: Date

    Date updated

    sw029s04: null | Date

    Date deleted

    sw029s05: null | sw001

    Created By

    Field relation sw001.sw001s01

    sw029s06: null | sw001

    Updated By

    Field relation sw001.sw001s01

    sw029s07: null | sw001

    Deleted By

    Field relation sw001.sw001s01

    sw029s08: sw025

    Lead ID

    Field relation sw025.sw025s01

    sw029s09: null | sw028

    Simulation ID

    Field relation sw028.sw028s01

    sw029s10: sw077

    Tariff Price Movement ID

    Field relation sw077.sw077s01

    sw029s11: null | sw030

    Client ID

    Field relation sw030.sw030s01

    sw029s12: string

    CUPS - Postal code

    sw029s13: string

    CUPS - Province

    sw029s14: string

    CUPS

    sw029s16: sw019

    Document Type ID

    Field relation sw019.sw019s01

    sw029s17: string

    Document Number

    sw029s18: string

    Address - Postal code

    sw029s19: sw073

    Address - Province

    Field relation sw073.sw073s09

    sw029s20: sw073

    Address - Municipality

    Field relation sw073.sw073s09

    sw029s21: string

    Address - Locality

    sw029s22: sw018

    Address - Type of road ID

    Field relation sw018.sw018s01

    sw029s23: string

    Address - Description road

    sw029s24: null | string

    Address - Number

    sw029s25: null | string

    Address - Block

    sw029s26: null | string

    Address - Port

    sw029s27: null | string

    Address - Complement

    sw029s28: YesNoType

    Energy green

    YesNoType.NO

    sw029s29: string

    IBAN

    sw029s30: YesNoType

    IBAN - Is Owner

    YesNoType.YES

    sw029s31: null | string

    IBAN - Owner - Firstname

    sw029s32: null | string

    IBAN - Owner - Lastname

    sw029s33: null | string

    IBAN - Owner - Email

    sw029s34: null | string

    IBAN - Owner - Phone / Mobile

    sw029s35: YesNoType

    Invoice digital

    YesNoType.NO

    sw029s36: YesNoType

    Payment by card

    YesNoType.NO

    sw029s37: sw012

    Energy Tariff ID

    Field relation sw012.sw012s01

    Powers Energy intends contract

    sw029s39: sw011

    Powers Energy 1 ID

    Field relation sw011.sw011s01

    sw029s40: null | sw011

    Powers Energy 2 ID

    Field relation sw011.sw011s01

    sw029s41: null | string

    Powers Energy 1 - Other

    sw029s42: null | string

    Powers Energy 2 - Other

    sw029s43: null | sw011

    Powers Energy 3

    Field relation sw011.sw011s01

    sw029s44: null | string

    Powers Energy 3 - Other

    Total Powers Energy

    sw029s46: string

    UUID

    sw029s47: null | string

    IBAN - Owner - Address - Postal code

    sw029s48: null | sw073

    IBAN - Owner - Address - Province

    Field relation sw073.sw073s09

    sw029s49: null | sw073

    IBAN - Owner - Address - Municipality

    Field relation sw073.sw073s09

    sw029s50: null | string

    IBAN - Owner - Address - Locality

    sw029s51: null | sw018

    IBAN - Owner - Address - Type of road ID

    Field relation sw018.sw018s01

    sw029s52: null | string

    IBAN - Owner - Address - Description road

    sw029s53: null | string

    IBAN - Owner - Address - Number

    sw029s54: null | string

    IBAN - Owner - Address - Block

    sw029s55: null | string

    IBAN - Owner - Address - Port

    sw029s56: null | string

    IBAN - Owner - Address - Complement

    sw029s57: sw017

    Address - Country

    Field relation sw017.sw017s01

    sw029s58: null | sw017

    IBAN - Owner - Address - Country

    Field relation sw017.sw017s01

    sw029s59: sw073

    Address - Locality ID

    Field relation sw073.sw073s09

    sw029s60: null | sw073

    IBAN - Owner - Address - Locality ID

    Field relation sw073.sw073s09

    sw029s61: string

    Date of Birth

    sw029s62: string

    Document expiration date

    sw029s63: YesNoType

    CUPS - Self Consumption

    YesNoType.NO

    sw029s64: YesNoType

    CUPS - Social Bonus

    YesNoType.NO

    sw029s65: sw017

    Nationality ID

    Field relation sw017.sw017s01

    updated?: boolean
    version: number

    Accessors

    • get target(): EntityTarget<any>

      Returns object that is managed by this repository. If this repository manages entity from schema, then it returns a name of that schema instead.

      Returns EntityTarget<any>

    Methods

    • Checks if entity has an id. If entity composite compose ids, it will check them all.

      Returns boolean

    • Recovers a given entity in the database.

      Parameters

      • Optionaloptions: SaveOptions

      Returns Promise<sw029>

    • Reloads entity data from the database.

      Returns Promise<void>

    • Removes current entity from the database.

      Parameters

      • Optionaloptions: RemoveOptions

      Returns Promise<sw029>

    • Saves current entity in the database. If entity does not exist in the database then inserts, otherwise updates.

      Parameters

      • Optionaloptions: SaveOptions

      Returns Promise<sw029>

    • Records the delete date of current entity.

      Parameters

      • Optionaloptions: SaveOptions

      Returns Promise<sw029>

    • Return the AVG of a column

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • columnName: PickKeysByType<T, number>
      • where: FindOptionsWhere<T>

      Returns Promise<null | number>

    • Clears all the data from the given table/collection (truncates/drops it).

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity

      Returns Promise<void>

    • Counts entities that match given options.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • Optionaloptions: FindManyOptions<T>

      Returns Promise<number>

    • Counts entities that match given WHERE conditions.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • where: FindOptionsWhere<T>

      Returns Promise<number>

    • Creates a new entity instance.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity

      Returns T

    • Creates a new entities and copies all entity properties from given objects into their new entities. Note that it copies only properties that present in entity schema.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entityLikeArray: DeepPartial<T>[]

      Returns T[]

    • Creates a new entity instance and copies all entity properties from this object into a new entity. Note that it copies only properties that present in entity schema.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entityLike: DeepPartial<T>

      Returns T

    • Creates a new query builder that can be used to build a SQL query.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • Optionalalias: string

      Returns SelectQueryBuilder<T>

    • Deletes entities by a given criteria. Unlike remove method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient DELETE query. Does not check if entity exist in the database.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • criteria:
            | string
            | number
            | string[]
            | Date
            | number[]
            | ObjectId
            | Date[]
            | ObjectId[]
            | FindOptionsWhere<T>

      Returns Promise<DeleteResult>

    • Checks whether any entity exists that matches the given options.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • Optionaloptions: FindManyOptions<T>

      Returns Promise<boolean>

    • Checks whether any entity exists that matches the given conditions.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • where: FindOptionsWhere<T>

      Returns Promise<boolean>

    • Finds entities that match given options.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • Optionaloptions: FindManyOptions<T>

      Returns Promise<T[]>

    • Finds entities that match given find options. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • Optionaloptions: FindManyOptions<T>

      Returns Promise<[T[], number]>

    • Finds entities that match given WHERE conditions. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • where: FindOptionsWhere<T>

      Returns Promise<[T[], number]>

    • Finds entities that match given WHERE conditions.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • where: FindOptionsWhere<T>

      Returns Promise<T[]>

    • Finds entities by ids. Optionally find options can be applied.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • ids: any[]

      Returns Promise<T[]>

      use findBy method instead in conjunction with In operator, for example:

      .findBy({ id: In([1, 2, 3]) })

    • Finds first entity that matches given conditions.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • options: FindOneOptions<T>

      Returns Promise<null | T>

    • Finds first entity that matches given conditions.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • where: FindOptionsWhere<T>

      Returns Promise<null | T>

    • Finds first entity that matches given options.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • id: string | number | Date | ObjectId

      Returns Promise<null | T>

      use findOneBy method instead in conjunction with In operator, for example:

      .findOneBy({ id: 1 // where "id" is your primary column name })

    • Finds first entity that matches given conditions.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • where: FindOptionsWhere<T>

      Returns Promise<T>

    • Finds first entity that matches given conditions.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • options: FindOneOptions<T>

      Returns Promise<T>

    • Gets entity mixed id.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entity: T

      Returns any

    • Gets current entity's Repository.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity

      Returns Repository<T>

    • Checks entity has an id. If entity composite compose ids, it will check them all.

      Parameters

      • entity: BaseEntity

      Returns boolean

    • Inserts a given entity into the database. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT query. Does not check if entity exist in the database, so query will fail if duplicate entity is being inserted.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entity:
            | _QueryDeepPartialEntity<ObjectLiteral extends T ? unknown : T>
            | _QueryDeepPartialEntity<ObjectLiteral extends T ? unknown : T>[]

      Returns Promise<InsertResult>

    • Return the MAX of a column

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • columnName: PickKeysByType<T, number>
      • where: FindOptionsWhere<T>

      Returns Promise<null | number>

    • Merges multiple entities (or entity-like objects) into a given entity.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • mergeIntoEntity: T
      • ...entityLikes: DeepPartial<T>[]

      Returns T

    • Return the MIN of a column

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • columnName: PickKeysByType<T, number>
      • where: FindOptionsWhere<T>

      Returns Promise<null | number>

    • Creates a new entity from the given plain javascript object. If entity already exist in the database, then it loads it (and everything related to it), replaces all values with the new ones from the given object and returns this new entity. This new entity is actually a loaded from the db entity with all properties replaced from the new object.

      Note that given entity-like object must have an entity id / primary key to find entity by. Returns undefined if entity with given id was not found.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entityLike: DeepPartial<T>

      Returns Promise<undefined | T>

    • Executes a raw SQL query and returns a raw database results. Raw query execution is supported only by relational databases (MongoDB is not supported).

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • query: string
      • Optionalparameters: any[]

      Returns Promise<any>

    • Removes a given entities from the database.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entities: T[]
      • Optionaloptions: RemoveOptions

      Returns Promise<T[]>

    • Removes a given entity from the database.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entity: T
      • Optionaloptions: RemoveOptions

      Returns Promise<T>

    • Saves all given entities in the database. If entities do not exist in the database then inserts, otherwise updates.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entities: DeepPartial<T>[]
      • Optionaloptions: SaveOptions

      Returns Promise<T[]>

    • Saves a given entity in the database. If entity does not exist in the database then inserts, otherwise updates.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entity: DeepPartial<T>
      • Optionaloptions: SaveOptions

      Returns Promise<T>

    • Records the delete date of all given entities.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entities: T[]
      • Optionaloptions: SaveOptions

      Returns Promise<T[]>

    • Records the delete date of a given entity.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entity: T
      • Optionaloptions: SaveOptions

      Returns Promise<T>

    • Return the SUM of a column

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • columnName: PickKeysByType<T, number>
      • where: FindOptionsWhere<T>

      Returns Promise<null | number>

    • Updates entity partially. Entity can be found by a given conditions. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient UPDATE query. Does not check if entity exist in the database.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • criteria:
            | string
            | number
            | string[]
            | Date
            | number[]
            | ObjectId
            | Date[]
            | ObjectId[]
            | FindOptionsWhere<T>
      • partialEntity: QueryDeepPartialEntity<T>

      Returns Promise<UpdateResult>

    • Inserts a given entity into the database, unless a unique constraint conflicts then updates the entity Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.

      Type Parameters

      • T extends BaseEntity

      Parameters

      • this: new () => T & typeof BaseEntity
      • entityOrEntities:
            | _QueryDeepPartialEntity<ObjectLiteral extends T ? unknown : T>
            | _QueryDeepPartialEntity<ObjectLiteral extends T ? unknown : T>[]
      • conflictPathsOrOptions: string[] | UpsertOptions<T>

      Returns Promise<InsertResult>

    • Sets DataSource to be used by entity.

      Parameters

      • dataSource: null | DataSource

      Returns void