@asumano/worklip-typeorm-db 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ export declare class Associate {
14
14
  surname: string;
15
15
  email: string;
16
16
  phone: string;
17
- city: City;
17
+ city: City | null;
18
18
  address: string | null;
19
19
  password: string;
20
20
  details: any | null;
@@ -88,9 +88,10 @@ __decorate([
88
88
  (0, typeorm_1.ManyToOne)(() => City_1.City, (city) => city.associates, {
89
89
  onDelete: "RESTRICT",
90
90
  onUpdate: "NO ACTION",
91
+ nullable: true,
91
92
  }),
92
93
  (0, typeorm_1.JoinColumn)({ name: "city" }),
93
- __metadata("design:type", City_1.City)
94
+ __metadata("design:type", Object)
94
95
  ], Associate.prototype, "city", void 0);
95
96
  __decorate([
96
97
  (0, typeorm_1.Column)({
@@ -1,6 +1,6 @@
1
1
  import { Repository } from "typeorm";
2
2
  import { IBasicFilter } from "../types";
3
- export declare function getAssociatesForTheTable(repository: Repository<any>, { company, status, visible, lazyEvent }: IBasicFilter): Promise<{
3
+ export declare function getAssociatesForTheTable(repository: Repository<any>, { company, workshop, status, visible, lazyEvent }: IBasicFilter): Promise<{
4
4
  data: any[];
5
5
  totalRecords: number;
6
6
  }>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAssociatesForTheTable = getAssociatesForTheTable;
4
- async function getAssociatesForTheTable(repository, { company, status, visible, lazyEvent }) {
4
+ async function getAssociatesForTheTable(repository, { company, workshop, status, visible, lazyEvent }) {
5
5
  try {
6
6
  const queryBuilder = repository
7
7
  .createQueryBuilder("associates")
@@ -24,6 +24,12 @@ async function getAssociatesForTheTable(repository, { company, status, visible,
24
24
  company,
25
25
  });
26
26
  }
27
+ // DOC: Filtro por workshop FILTRO POR DEFECTO.
28
+ if (workshop !== null && workshop >= 0) {
29
+ queryBuilder.andWhere("associates.workshop_id = :workshop", {
30
+ workshop,
31
+ });
32
+ }
27
33
  // DOC: Filtro por visible FILTRO POR DEFECTO.
28
34
  if (visible !== null) {
29
35
  queryBuilder.andWhere("associates.visible = :visible", {
package/dist/types.d.ts CHANGED
@@ -11,6 +11,7 @@ export interface IBasicLazyEvent {
11
11
  export interface IBasicFilter extends IBasicLazyEvent {
12
12
  status: number | null;
13
13
  company: number | null;
14
+ workshop: number | null;
14
15
  visible: number | null;
15
16
  }
16
17
  export type IType = "mysql" | "mariadb";
@@ -19,4 +19,6 @@ export declare class Associates {
19
19
  city_name: string;
20
20
  city_region: number;
21
21
  city_status: number;
22
+ workshop_id: number;
23
+ workshop_name: string;
22
24
  }
@@ -94,6 +94,14 @@ __decorate([
94
94
  (0, typeorm_1.ViewColumn)(),
95
95
  __metadata("design:type", Number)
96
96
  ], Associates.prototype, "city_status", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.ViewColumn)(),
99
+ __metadata("design:type", Number)
100
+ ], Associates.prototype, "workshop_id", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.ViewColumn)(),
103
+ __metadata("design:type", String)
104
+ ], Associates.prototype, "workshop_name", void 0);
97
105
  exports.Associates = Associates = __decorate([
98
106
  (0, typeorm_1.ViewEntity)()
99
107
  ], Associates);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asumano/worklip-typeorm-db",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "publishConfig": {
5
5
  "access": "restricted"
6
6
  },