@imaginamossas/farmabien-common 1.0.29 → 1.0.31
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.
- package/dist/entities/customer-address.entity.d.ts +7 -7
- package/dist/entities/customer-address.entity.js +31 -28
- package/dist/entities/customer-address.entity.js.map +1 -1
- package/dist/entities/index.d.ts +0 -2
- package/dist/entities/index.js +0 -2
- package/dist/entities/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/repositories/global.repository.d.ts +10 -0
- package/dist/repositories/global.repository.js +57 -0
- package/dist/repositories/global.repository.js.map +1 -0
- package/dist/repositories/index.d.ts +1 -0
- package/dist/repositories/index.js +18 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/entities/city.entity.d.ts +0 -11
- package/dist/entities/city.entity.js +0 -63
- package/dist/entities/city.entity.js.map +0 -1
- package/dist/entities/state.entity.d.ts +0 -9
- package/dist/entities/state.entity.js +0 -56
- package/dist/entities/state.entity.js.map +0 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { CustomerEntity } from './customer.entity';
|
|
2
|
-
import { CityEntity } from './city.entity';
|
|
3
2
|
export declare class CustomerAddressEntity {
|
|
4
3
|
id: number;
|
|
5
4
|
customerId: number;
|
|
6
|
-
cityId: number;
|
|
7
5
|
countryId: string;
|
|
8
6
|
label: string;
|
|
9
|
-
recipientName: string;
|
|
10
7
|
recipientPhone: string;
|
|
11
|
-
|
|
8
|
+
mainAddress: string;
|
|
9
|
+
city: string;
|
|
10
|
+
state: string;
|
|
12
11
|
complement: string | null;
|
|
13
12
|
neighborhood: string | null;
|
|
14
13
|
postalCode: string | null;
|
|
15
|
-
latitude: number
|
|
16
|
-
longitude: number
|
|
14
|
+
latitude: number;
|
|
15
|
+
longitude: number;
|
|
16
|
+
googlePlaceId: string;
|
|
17
|
+
rawGoogleResponse: object | null;
|
|
17
18
|
deliveryInstructions: string | null;
|
|
18
19
|
isMain: boolean;
|
|
19
20
|
isActive: boolean;
|
|
@@ -21,5 +22,4 @@ export declare class CustomerAddressEntity {
|
|
|
21
22
|
updatedAt: Date;
|
|
22
23
|
deletedAt: Date | null;
|
|
23
24
|
customer: CustomerEntity;
|
|
24
|
-
city: CityEntity;
|
|
25
25
|
}
|
|
@@ -12,21 +12,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CustomerAddressEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const customer_entity_1 = require("./customer.entity");
|
|
15
|
-
const city_entity_1 = require("./city.entity");
|
|
16
15
|
let CustomerAddressEntity = class CustomerAddressEntity {
|
|
17
16
|
id;
|
|
18
17
|
customerId;
|
|
19
|
-
cityId;
|
|
20
18
|
countryId;
|
|
21
19
|
label;
|
|
22
|
-
recipientName;
|
|
23
20
|
recipientPhone;
|
|
24
|
-
|
|
21
|
+
mainAddress;
|
|
22
|
+
city;
|
|
23
|
+
state;
|
|
25
24
|
complement;
|
|
26
25
|
neighborhood;
|
|
27
26
|
postalCode;
|
|
28
27
|
latitude;
|
|
29
28
|
longitude;
|
|
29
|
+
googlePlaceId;
|
|
30
|
+
rawGoogleResponse;
|
|
30
31
|
deliveryInstructions;
|
|
31
32
|
isMain;
|
|
32
33
|
isActive;
|
|
@@ -34,7 +35,6 @@ let CustomerAddressEntity = class CustomerAddressEntity {
|
|
|
34
35
|
updatedAt;
|
|
35
36
|
deletedAt;
|
|
36
37
|
customer;
|
|
37
|
-
city;
|
|
38
38
|
};
|
|
39
39
|
exports.CustomerAddressEntity = CustomerAddressEntity;
|
|
40
40
|
__decorate([
|
|
@@ -45,10 +45,6 @@ __decorate([
|
|
|
45
45
|
(0, typeorm_1.Column)({ name: 'customer_id', type: 'int' }),
|
|
46
46
|
__metadata("design:type", Number)
|
|
47
47
|
], CustomerAddressEntity.prototype, "customerId", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, typeorm_1.Column)({ name: 'city_id', type: 'int' }),
|
|
50
|
-
__metadata("design:type", Number)
|
|
51
|
-
], CustomerAddressEntity.prototype, "cityId", void 0);
|
|
52
48
|
__decorate([
|
|
53
49
|
(0, typeorm_1.Column)({ name: 'country_id', type: 'char', length: 2 }),
|
|
54
50
|
__metadata("design:type", String)
|
|
@@ -57,18 +53,22 @@ __decorate([
|
|
|
57
53
|
(0, typeorm_1.Column)({ type: 'varchar', length: 60 }),
|
|
58
54
|
__metadata("design:type", String)
|
|
59
55
|
], CustomerAddressEntity.prototype, "label", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, typeorm_1.Column)({ name: 'recipient_name', type: 'varchar', length: 200 }),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], CustomerAddressEntity.prototype, "recipientName", void 0);
|
|
64
56
|
__decorate([
|
|
65
57
|
(0, typeorm_1.Column)({ name: 'recipient_phone', type: 'varchar', length: 25 }),
|
|
66
58
|
__metadata("design:type", String)
|
|
67
59
|
], CustomerAddressEntity.prototype, "recipientPhone", void 0);
|
|
68
60
|
__decorate([
|
|
69
|
-
(0, typeorm_1.Column)({ name: '
|
|
61
|
+
(0, typeorm_1.Column)({ name: 'main_address', type: 'varchar', length: 500 }),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], CustomerAddressEntity.prototype, "mainAddress", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], CustomerAddressEntity.prototype, "city", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
|
|
70
70
|
__metadata("design:type", String)
|
|
71
|
-
], CustomerAddressEntity.prototype, "
|
|
71
|
+
], CustomerAddressEntity.prototype, "state", void 0);
|
|
72
72
|
__decorate([
|
|
73
73
|
(0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
|
|
74
74
|
__metadata("design:type", Object)
|
|
@@ -86,27 +86,35 @@ __decorate([
|
|
|
86
86
|
type: 'decimal',
|
|
87
87
|
precision: 10,
|
|
88
88
|
scale: 8,
|
|
89
|
-
nullable:
|
|
89
|
+
nullable: false,
|
|
90
90
|
transformer: {
|
|
91
91
|
to: (value) => value,
|
|
92
|
-
from: (value) =>
|
|
92
|
+
from: (value) => parseFloat(value),
|
|
93
93
|
},
|
|
94
94
|
}),
|
|
95
|
-
__metadata("design:type",
|
|
95
|
+
__metadata("design:type", Number)
|
|
96
96
|
], CustomerAddressEntity.prototype, "latitude", void 0);
|
|
97
97
|
__decorate([
|
|
98
98
|
(0, typeorm_1.Column)({
|
|
99
99
|
type: 'decimal',
|
|
100
100
|
precision: 11,
|
|
101
101
|
scale: 8,
|
|
102
|
-
nullable:
|
|
102
|
+
nullable: false,
|
|
103
103
|
transformer: {
|
|
104
104
|
to: (value) => value,
|
|
105
|
-
from: (value) =>
|
|
105
|
+
from: (value) => parseFloat(value),
|
|
106
106
|
},
|
|
107
107
|
}),
|
|
108
|
-
__metadata("design:type",
|
|
108
|
+
__metadata("design:type", Number)
|
|
109
109
|
], CustomerAddressEntity.prototype, "longitude", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, typeorm_1.Column)({ name: 'google_place_id', type: 'varchar', length: 300 }),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], CustomerAddressEntity.prototype, "googlePlaceId", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.Column)({ name: 'raw_google_response', type: 'jsonb', nullable: true }),
|
|
116
|
+
__metadata("design:type", Object)
|
|
117
|
+
], CustomerAddressEntity.prototype, "rawGoogleResponse", void 0);
|
|
110
118
|
__decorate([
|
|
111
119
|
(0, typeorm_1.Column)({ name: 'delivery_instructions', type: 'varchar', length: 500, nullable: true }),
|
|
112
120
|
__metadata("design:type", Object)
|
|
@@ -136,15 +144,10 @@ __decorate([
|
|
|
136
144
|
(0, typeorm_1.JoinColumn)({ name: 'customer_id' }),
|
|
137
145
|
__metadata("design:type", customer_entity_1.CustomerEntity)
|
|
138
146
|
], CustomerAddressEntity.prototype, "customer", void 0);
|
|
139
|
-
__decorate([
|
|
140
|
-
(0, typeorm_1.ManyToOne)(() => city_entity_1.CityEntity, (city) => city.addresses),
|
|
141
|
-
(0, typeorm_1.JoinColumn)({ name: 'city_id' }),
|
|
142
|
-
__metadata("design:type", city_entity_1.CityEntity)
|
|
143
|
-
], CustomerAddressEntity.prototype, "city", void 0);
|
|
144
147
|
exports.CustomerAddressEntity = CustomerAddressEntity = __decorate([
|
|
145
148
|
(0, typeorm_1.Entity)('customer_addresses'),
|
|
146
149
|
(0, typeorm_1.Index)('idx_customer_addresses_customer_id', ['customerId']),
|
|
147
|
-
(0, typeorm_1.Index)('
|
|
148
|
-
(0, typeorm_1.Index)('
|
|
150
|
+
(0, typeorm_1.Index)('idx_customer_addresses_country_id', ['countryId']),
|
|
151
|
+
(0, typeorm_1.Index)('idx_customer_addresses_google_place_id', ['googlePlaceId'])
|
|
149
152
|
], CustomerAddressEntity);
|
|
150
153
|
//# sourceMappingURL=customer-address.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer-address.entity.js","sourceRoot":"","sources":["../../src/entities/customer-address.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAUiB;AACjB,uDAAmD;
|
|
1
|
+
{"version":3,"file":"customer-address.entity.js","sourceRoot":"","sources":["../../src/entities/customer-address.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAUiB;AACjB,uDAAmD;AAqB5C,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAKhC,EAAE,CAAS;IAMX,UAAU,CAAS;IAOnB,SAAS,CAAS;IAMlB,KAAK,CAAS;IAOd,cAAc,CAAS;IAOvB,WAAW,CAAS;IAOpB,IAAI,CAAS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* from './base.entity';
|
|
2
2
|
export * from './customer.entity';
|
|
3
3
|
export * from './customer-address.entity';
|
|
4
|
-
export * from './state.entity';
|
|
5
|
-
export * from './city.entity';
|
|
6
4
|
export * from './providers-code.entity';
|
|
7
5
|
export * from './customer-provider.entity';
|
|
8
6
|
export * from './email-verification-token.entity';
|
package/dist/entities/index.js
CHANGED
|
@@ -17,8 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./base.entity"), exports);
|
|
18
18
|
__exportStar(require("./customer.entity"), exports);
|
|
19
19
|
__exportStar(require("./customer-address.entity"), exports);
|
|
20
|
-
__exportStar(require("./state.entity"), exports);
|
|
21
|
-
__exportStar(require("./city.entity"), exports);
|
|
22
20
|
__exportStar(require("./providers-code.entity"), exports);
|
|
23
21
|
__exportStar(require("./customer-provider.entity"), exports);
|
|
24
22
|
__exportStar(require("./email-verification-token.entity"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgBA,gDAA8B;AAC9B,oDAAkC;AAClC,4DAA0C;AAC1C,0DAAwC;AACxC,6DAA2C;AAC3C,oEAAkD;AAClD,yDAAuC;AACvC,gEAA8C;AAC9C,yDAAuC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ __exportStar(require("./filters"), exports);
|
|
|
22
22
|
__exportStar(require("./guards"), exports);
|
|
23
23
|
__exportStar(require("./interceptors"), exports);
|
|
24
24
|
__exportStar(require("./middlewares"), exports);
|
|
25
|
+
__exportStar(require("./repositories"), exports);
|
|
25
26
|
__exportStar(require("./services"), exports);
|
|
26
27
|
__exportStar(require("./utils"), exports);
|
|
27
28
|
__exportStar(require("./queues"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,4CAA0B;AAC1B,2CAAyB;AACzB,iDAA+B;AAC/B,gDAA8B;AAC9B,6CAA2B;AAC3B,0CAAwB;AACxB,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,4CAA0B;AAC1B,2CAAyB;AACzB,iDAA+B;AAC/B,gDAA8B;AAC9B,iDAA+B;AAC/B,6CAA2B;AAC3B,0CAAwB;AACxB,2CAAyB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EntityManager, QueryRunner } from 'typeorm';
|
|
2
|
+
export declare class GlobalRepository {
|
|
3
|
+
protected readonly entityManager: EntityManager;
|
|
4
|
+
constructor(entityManager: EntityManager);
|
|
5
|
+
createQueryRunner(): Promise<QueryRunner>;
|
|
6
|
+
commitQueryRunner(queryRunner: QueryRunner): Promise<void>;
|
|
7
|
+
rollbackQueryRunner(queryRunner: QueryRunner): Promise<void>;
|
|
8
|
+
releaseQueryRunner(queryRunner: QueryRunner): Promise<void>;
|
|
9
|
+
protected get manager(): EntityManager;
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GlobalRepository = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
let GlobalRepository = class GlobalRepository {
|
|
20
|
+
entityManager;
|
|
21
|
+
constructor(entityManager) {
|
|
22
|
+
this.entityManager = entityManager;
|
|
23
|
+
}
|
|
24
|
+
async createQueryRunner() {
|
|
25
|
+
const queryRunner = this.entityManager.connection.createQueryRunner();
|
|
26
|
+
try {
|
|
27
|
+
await queryRunner.connect();
|
|
28
|
+
await queryRunner.startTransaction();
|
|
29
|
+
return queryRunner;
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (queryRunner) {
|
|
33
|
+
await queryRunner.release();
|
|
34
|
+
}
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
commitQueryRunner(queryRunner) {
|
|
39
|
+
return queryRunner.commitTransaction();
|
|
40
|
+
}
|
|
41
|
+
rollbackQueryRunner(queryRunner) {
|
|
42
|
+
return queryRunner.rollbackTransaction();
|
|
43
|
+
}
|
|
44
|
+
releaseQueryRunner(queryRunner) {
|
|
45
|
+
return queryRunner.release();
|
|
46
|
+
}
|
|
47
|
+
get manager() {
|
|
48
|
+
return this.entityManager;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.GlobalRepository = GlobalRepository;
|
|
52
|
+
exports.GlobalRepository = GlobalRepository = __decorate([
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
__param(0, (0, typeorm_1.InjectEntityManager)()),
|
|
55
|
+
__metadata("design:paramtypes", [typeorm_2.EntityManager])
|
|
56
|
+
], GlobalRepository);
|
|
57
|
+
//# sourceMappingURL=global.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.repository.js","sourceRoot":"","sources":["../../src/repositories/global.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAuCA,2CAA4C;AAC5C,6CAAsD;AACtD,qCAAqD;AAG9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC2B;IAAtD,YAAsD,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAS/E,KAAK,CAAC,iBAAiB;QAC5B,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;QACtE,IAAI,CAAC;YACH,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;YAC5B,MAAM,WAAW,CAAC,gBAAgB,EAAE,CAAC;YACrC,OAAO,WAAW,CAAC;QACrB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAEf,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;YAC9B,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAOM,iBAAiB,CAAC,WAAwB;QAC/C,OAAO,WAAW,CAAC,iBAAiB,EAAE,CAAC;IACzC,CAAC;IAOM,mBAAmB,CAAC,WAAwB;QACjD,OAAO,WAAW,CAAC,mBAAmB,EAAE,CAAC;IAC3C,CAAC;IAQM,kBAAkB,CAAC,WAAwB;QAChD,OAAO,WAAW,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;IAKD,IAAc,OAAO;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;CACF,CAAA;AA3DY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,6BAAmB,GAAE,CAAA;qCAAmC,uBAAa;GADvE,gBAAgB,CA2D5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './global.repository';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./global.repository"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/repositories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
|