@imaginamossas/farmabien-common 1.0.42 → 1.0.44
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/brand.entity.d.ts +7 -0
- package/dist/entities/brand.entity.js +44 -0
- package/dist/entities/brand.entity.js.map +1 -0
- package/dist/entities/category.entity.d.ts +10 -0
- package/dist/entities/category.entity.js +56 -0
- package/dist/entities/category.entity.js.map +1 -0
- package/dist/entities/customer.entity.d.ts +3 -3
- package/dist/entities/customer.entity.js +6 -7
- package/dist/entities/customer.entity.js.map +1 -1
- package/dist/entities/department.entity.d.ts +7 -0
- package/dist/entities/department.entity.js +43 -0
- package/dist/entities/department.entity.js.map +1 -0
- package/dist/entities/index.d.ts +7 -0
- package/dist/entities/index.js +7 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/product-inventory.entity.d.ts +13 -0
- package/dist/entities/product-inventory.entity.js +69 -0
- package/dist/entities/product-inventory.entity.js.map +1 -0
- package/dist/entities/product-price.entity.d.ts +15 -0
- package/dist/entities/product-price.entity.js +85 -0
- package/dist/entities/product-price.entity.js.map +1 -0
- package/dist/entities/product.entity.d.ts +24 -0
- package/dist/entities/product.entity.js +126 -0
- package/dist/entities/product.entity.js.map +1 -0
- package/dist/entities/sub-category.entity.d.ts +11 -0
- package/dist/entities/sub-category.entity.js +61 -0
- package/dist/entities/sub-category.entity.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BrandEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("./base.entity");
|
|
15
|
+
let BrandEntity = class BrandEntity extends base_entity_1.BaseEntity {
|
|
16
|
+
id;
|
|
17
|
+
externalCode;
|
|
18
|
+
name;
|
|
19
|
+
isActive;
|
|
20
|
+
};
|
|
21
|
+
exports.BrandEntity = BrandEntity;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('increment'),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], BrandEntity.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ name: 'external_code', type: 'varchar', length: 50, unique: true }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], BrandEntity.prototype, "externalCode", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 150 }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], BrandEntity.prototype, "name", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ name: 'is_active', type: 'boolean', default: true }),
|
|
36
|
+
__metadata("design:type", Boolean)
|
|
37
|
+
], BrandEntity.prototype, "isActive", void 0);
|
|
38
|
+
exports.BrandEntity = BrandEntity = __decorate([
|
|
39
|
+
(0, typeorm_1.Entity)('brands'),
|
|
40
|
+
(0, typeorm_1.Index)('idx_brands_external_code', ['externalCode'], { unique: true }),
|
|
41
|
+
(0, typeorm_1.Index)('idx_brands_active', ['isActive']),
|
|
42
|
+
(0, typeorm_1.Index)('idx_brands_name', ['name'])
|
|
43
|
+
], BrandEntity);
|
|
44
|
+
//# sourceMappingURL=brand.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand.entity.js","sourceRoot":"","sources":["../../src/entities/brand.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwE;AACxE,+CAA2C;AAuBpC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,wBAAU;IAMzC,EAAE,CAAS;IASX,YAAY,CAAS;IAQrB,IAAI,CAAS;IAOb,QAAQ,CAAU;CAOnB,CAAA;AArCY,kCAAW;AAMtB;IADC,IAAA,gCAAsB,EAAC,WAAW,CAAC;;uCACzB;AASX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;iDACxD;AAQrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;yCAC5B;AAOb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;6CAC5C;sBA9BP,WAAW;IAJvB,IAAA,gBAAM,EAAC,QAAQ,CAAC;IAChB,IAAA,eAAK,EAAC,0BAA0B,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrE,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,UAAU,CAAC,CAAC;IACxC,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,MAAM,CAAC,CAAC;GACtB,WAAW,CAqCvB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
import { DepartmentEntity } from './department.entity';
|
|
3
|
+
export declare class CategoryEntity extends BaseEntity {
|
|
4
|
+
id: number;
|
|
5
|
+
externalCode: string;
|
|
6
|
+
name: string;
|
|
7
|
+
departmentId: number;
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
department: DepartmentEntity;
|
|
10
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CategoryEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("./base.entity");
|
|
15
|
+
const department_entity_1 = require("./department.entity");
|
|
16
|
+
let CategoryEntity = class CategoryEntity extends base_entity_1.BaseEntity {
|
|
17
|
+
id;
|
|
18
|
+
externalCode;
|
|
19
|
+
name;
|
|
20
|
+
departmentId;
|
|
21
|
+
isActive;
|
|
22
|
+
department;
|
|
23
|
+
};
|
|
24
|
+
exports.CategoryEntity = CategoryEntity;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('increment'),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], CategoryEntity.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ name: 'external_code', type: 'varchar', length: 50, unique: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CategoryEntity.prototype, "externalCode", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CategoryEntity.prototype, "name", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ name: 'department_id', type: 'int' }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], CategoryEntity.prototype, "departmentId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ name: 'is_active', type: 'boolean', default: true }),
|
|
43
|
+
__metadata("design:type", Boolean)
|
|
44
|
+
], CategoryEntity.prototype, "isActive", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.ManyToOne)(() => department_entity_1.DepartmentEntity, { onDelete: 'CASCADE' }),
|
|
47
|
+
(0, typeorm_1.JoinColumn)({ name: 'department_id' }),
|
|
48
|
+
__metadata("design:type", department_entity_1.DepartmentEntity)
|
|
49
|
+
], CategoryEntity.prototype, "department", void 0);
|
|
50
|
+
exports.CategoryEntity = CategoryEntity = __decorate([
|
|
51
|
+
(0, typeorm_1.Entity)('categories'),
|
|
52
|
+
(0, typeorm_1.Index)('idx_categories_external_code', ['externalCode'], { unique: true }),
|
|
53
|
+
(0, typeorm_1.Index)('idx_categories_department', ['departmentId']),
|
|
54
|
+
(0, typeorm_1.Index)('idx_categories_active', ['isActive'])
|
|
55
|
+
], CategoryEntity);
|
|
56
|
+
//# sourceMappingURL=category.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.entity.js","sourceRoot":"","sources":["../../src/entities/category.entity.ts"],"names":[],"mappings":";;;;;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C,CAAC;GAChC,cAAc,CAqD1B"}
|
|
@@ -5,14 +5,14 @@ import { EmailVerificationTokenEntity } from './email-verification-token.entity'
|
|
|
5
5
|
export declare class CustomerEntity extends BaseEntity {
|
|
6
6
|
id: number;
|
|
7
7
|
email: string;
|
|
8
|
-
passwordHash: string;
|
|
8
|
+
passwordHash: string | null;
|
|
9
9
|
emailVerified: boolean;
|
|
10
10
|
emailVerifiedAt: Date | null;
|
|
11
11
|
role: string;
|
|
12
12
|
firstName: string;
|
|
13
13
|
lastName: string;
|
|
14
|
-
idType: string;
|
|
15
|
-
idNumber: string;
|
|
14
|
+
idType: string | null;
|
|
15
|
+
idNumber: string | null;
|
|
16
16
|
phoneCountryCode: string;
|
|
17
17
|
phoneNumber: string;
|
|
18
18
|
gender: string | null;
|
|
@@ -63,8 +63,8 @@ __decorate([
|
|
|
63
63
|
], CustomerEntity.prototype, "email", void 0);
|
|
64
64
|
__decorate([
|
|
65
65
|
(0, class_transformer_1.Exclude)({ toPlainOnly: true }),
|
|
66
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 255, name: 'password_hash' }),
|
|
67
|
-
__metadata("design:type",
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, name: 'password_hash', nullable: true }),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
68
|
], CustomerEntity.prototype, "passwordHash", void 0);
|
|
69
69
|
__decorate([
|
|
70
70
|
(0, typeorm_1.Column)({ type: 'boolean', default: false, name: 'email_verified' }),
|
|
@@ -87,12 +87,12 @@ __decorate([
|
|
|
87
87
|
__metadata("design:type", String)
|
|
88
88
|
], CustomerEntity.prototype, "lastName", void 0);
|
|
89
89
|
__decorate([
|
|
90
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 10, name: 'id_type' }),
|
|
91
|
-
__metadata("design:type",
|
|
90
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 10, name: 'id_type', nullable: true }),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
92
|
], CustomerEntity.prototype, "idType", void 0);
|
|
93
93
|
__decorate([
|
|
94
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 50, name: 'id_number' }),
|
|
95
|
-
__metadata("design:type",
|
|
94
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, name: 'id_number', nullable: true }),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
96
|
], CustomerEntity.prototype, "idNumber", void 0);
|
|
97
97
|
__decorate([
|
|
98
98
|
(0, typeorm_1.Column)({ type: 'varchar', length: 5, name: 'phone_country_code' }),
|
|
@@ -145,7 +145,6 @@ __decorate([
|
|
|
145
145
|
exports.CustomerEntity = CustomerEntity = __decorate([
|
|
146
146
|
(0, typeorm_1.Entity)('customers'),
|
|
147
147
|
(0, typeorm_1.Index)('idx_customers_email', ['email'], { unique: true }),
|
|
148
|
-
(0, typeorm_1.Index)('idx_customers_document', ['idType', 'idNumber'], { unique: true }),
|
|
149
148
|
(0, typeorm_1.Index)('idx_customers_phone', ['phoneCountryCode', 'phoneNumber'], { unique: true })
|
|
150
149
|
], CustomerEntity);
|
|
151
150
|
//# sourceMappingURL=customer.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer.entity.js","sourceRoot":"","sources":["../../src/entities/customer.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmF;AACnF,+CAA2C;AAC3C,+EAAmE;AACnE,iEAAsD;AACtD,uFAAiF;AACjF,yDAA4C;
|
|
1
|
+
{"version":3,"file":"customer.entity.js","sourceRoot":"","sources":["../../src/entities/customer.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmF;AACnF,+CAA2C;AAC3C,+EAAmE;AACnE,iEAAsD;AACtD,uFAAiF;AACjF,yDAA4C;AA6BrC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,wBAAU;IAM5C,EAAE,CAAS;IAWX,KAAK,CAAS;IASd,YAAY,CAAgB;IAM5B,aAAa,CAAU;IAMv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AAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACvE,cAAc,CAwL1B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DepartmentEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("./base.entity");
|
|
15
|
+
let DepartmentEntity = class DepartmentEntity extends base_entity_1.BaseEntity {
|
|
16
|
+
id;
|
|
17
|
+
externalCode;
|
|
18
|
+
name;
|
|
19
|
+
isActive;
|
|
20
|
+
};
|
|
21
|
+
exports.DepartmentEntity = DepartmentEntity;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('increment'),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], DepartmentEntity.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ name: 'external_code', type: 'varchar', length: 50, unique: true }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], DepartmentEntity.prototype, "externalCode", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], DepartmentEntity.prototype, "name", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ name: 'is_active', type: 'boolean', default: true }),
|
|
36
|
+
__metadata("design:type", Boolean)
|
|
37
|
+
], DepartmentEntity.prototype, "isActive", void 0);
|
|
38
|
+
exports.DepartmentEntity = DepartmentEntity = __decorate([
|
|
39
|
+
(0, typeorm_1.Entity)('departments'),
|
|
40
|
+
(0, typeorm_1.Index)('idx_departments_external_code', ['externalCode'], { unique: true }),
|
|
41
|
+
(0, typeorm_1.Index)('idx_departments_active', ['isActive'])
|
|
42
|
+
], DepartmentEntity);
|
|
43
|
+
//# sourceMappingURL=department.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"department.entity.js","sourceRoot":"","sources":["../../src/entities/department.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwE;AACxE,+CAA2C;AAqBpC,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,wBAAU;IAM9C,EAAE,CAAS;IASX,YAAY,CAAS;IAQrB,IAAI,CAAS;IAOb,QAAQ,CAAU;CAOnB,CAAA;AArCY,4CAAgB;AAM3B;IADC,IAAA,gCAAsB,EAAC,WAAW,CAAC;;4CACzB;AASX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;sDACxD;AAQrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;8CAC5B;AAOb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;kDAC5C;2BA9BP,gBAAgB;IAH5B,IAAA,gBAAM,EAAC,aAAa,CAAC;IACrB,IAAA,eAAK,EAAC,+BAA+B,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1E,IAAA,eAAK,EAAC,wBAAwB,EAAE,CAAC,UAAU,CAAC,CAAC;GACjC,gBAAgB,CAqC5B"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export * from './address-store-assignment.entity';
|
|
2
2
|
export * from './base.entity';
|
|
3
|
+
export * from './brand.entity';
|
|
4
|
+
export * from './category.entity';
|
|
3
5
|
export * from './country.entity';
|
|
4
6
|
export * from './customer.entity';
|
|
5
7
|
export * from './customer-address.entity';
|
|
8
|
+
export * from './department.entity';
|
|
9
|
+
export * from './product.entity';
|
|
10
|
+
export * from './product-inventory.entity';
|
|
11
|
+
export * from './product-price.entity';
|
|
6
12
|
export * from './providers-code.entity';
|
|
7
13
|
export * from './customer-provider.entity';
|
|
8
14
|
export * from './email-verification-token.entity';
|
|
@@ -10,3 +16,4 @@ export * from './refresh-token.entity';
|
|
|
10
16
|
export * from './password-reset-token.entity';
|
|
11
17
|
export * from './login-attempt.entity';
|
|
12
18
|
export * from './store.entity';
|
|
19
|
+
export * from './sub-category.entity';
|
package/dist/entities/index.js
CHANGED
|
@@ -16,9 +16,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./address-store-assignment.entity"), exports);
|
|
18
18
|
__exportStar(require("./base.entity"), exports);
|
|
19
|
+
__exportStar(require("./brand.entity"), exports);
|
|
20
|
+
__exportStar(require("./category.entity"), exports);
|
|
19
21
|
__exportStar(require("./country.entity"), exports);
|
|
20
22
|
__exportStar(require("./customer.entity"), exports);
|
|
21
23
|
__exportStar(require("./customer-address.entity"), exports);
|
|
24
|
+
__exportStar(require("./department.entity"), exports);
|
|
25
|
+
__exportStar(require("./product.entity"), exports);
|
|
26
|
+
__exportStar(require("./product-inventory.entity"), exports);
|
|
27
|
+
__exportStar(require("./product-price.entity"), exports);
|
|
22
28
|
__exportStar(require("./providers-code.entity"), exports);
|
|
23
29
|
__exportStar(require("./customer-provider.entity"), exports);
|
|
24
30
|
__exportStar(require("./email-verification-token.entity"), exports);
|
|
@@ -26,4 +32,5 @@ __exportStar(require("./refresh-token.entity"), exports);
|
|
|
26
32
|
__exportStar(require("./password-reset-token.entity"), exports);
|
|
27
33
|
__exportStar(require("./login-attempt.entity"), exports);
|
|
28
34
|
__exportStar(require("./store.entity"), exports);
|
|
35
|
+
__exportStar(require("./sub-category.entity"), exports);
|
|
29
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -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":";;;;;;;;;;;;;;;;AAwBA,oEAAkD;AAClD,gDAA8B;AAC9B,iDAA+B;AAC/B,oDAAkC;AAClC,mDAAiC;AACjC,oDAAkC;AAClC,4DAA0C;AAC1C,sDAAoC;AACpC,mDAAiC;AACjC,6DAA2C;AAC3C,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAC3C,oEAAkD;AAClD,yDAAuC;AACvC,gEAA8C;AAC9C,yDAAuC;AACvC,iDAA+B;AAC/B,wDAAsC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
import { ProductEntity } from './product.entity';
|
|
3
|
+
import { StoreEntity } from './store.entity';
|
|
4
|
+
export declare class ProductInventoryEntity extends BaseEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
productId: number;
|
|
7
|
+
storeId: number;
|
|
8
|
+
storeExternalCode: string;
|
|
9
|
+
stock: number;
|
|
10
|
+
lastSyncAt: Date;
|
|
11
|
+
product: ProductEntity;
|
|
12
|
+
store: StoreEntity;
|
|
13
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProductInventoryEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("./base.entity");
|
|
15
|
+
const product_entity_1 = require("./product.entity");
|
|
16
|
+
const store_entity_1 = require("./store.entity");
|
|
17
|
+
let ProductInventoryEntity = class ProductInventoryEntity extends base_entity_1.BaseEntity {
|
|
18
|
+
id;
|
|
19
|
+
productId;
|
|
20
|
+
storeId;
|
|
21
|
+
storeExternalCode;
|
|
22
|
+
stock;
|
|
23
|
+
lastSyncAt;
|
|
24
|
+
product;
|
|
25
|
+
store;
|
|
26
|
+
};
|
|
27
|
+
exports.ProductInventoryEntity = ProductInventoryEntity;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('increment'),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], ProductInventoryEntity.prototype, "id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ name: 'product_id', type: 'int' }),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], ProductInventoryEntity.prototype, "productId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ name: 'store_id', type: 'int' }),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], ProductInventoryEntity.prototype, "storeId", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ name: 'store_external_code', type: 'varchar', length: 50 }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ProductInventoryEntity.prototype, "storeExternalCode", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], ProductInventoryEntity.prototype, "stock", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ name: 'last_sync_at', type: 'timestamp', nullable: true }),
|
|
50
|
+
__metadata("design:type", Date)
|
|
51
|
+
], ProductInventoryEntity.prototype, "lastSyncAt", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.ManyToOne)(() => product_entity_1.ProductEntity, { onDelete: 'CASCADE' }),
|
|
54
|
+
(0, typeorm_1.JoinColumn)({ name: 'product_id' }),
|
|
55
|
+
__metadata("design:type", product_entity_1.ProductEntity)
|
|
56
|
+
], ProductInventoryEntity.prototype, "product", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.ManyToOne)(() => store_entity_1.StoreEntity, { onDelete: 'CASCADE' }),
|
|
59
|
+
(0, typeorm_1.JoinColumn)({ name: 'store_id' }),
|
|
60
|
+
__metadata("design:type", store_entity_1.StoreEntity)
|
|
61
|
+
], ProductInventoryEntity.prototype, "store", void 0);
|
|
62
|
+
exports.ProductInventoryEntity = ProductInventoryEntity = __decorate([
|
|
63
|
+
(0, typeorm_1.Entity)('product_inventories'),
|
|
64
|
+
(0, typeorm_1.Unique)('uq_product_inventory_product_store', ['productId', 'storeId']),
|
|
65
|
+
(0, typeorm_1.Index)('idx_product_inventories_product', ['productId']),
|
|
66
|
+
(0, typeorm_1.Index)('idx_product_inventories_store', ['storeId']),
|
|
67
|
+
(0, typeorm_1.Index)('idx_product_inventories_stock', ['stock'])
|
|
68
|
+
], ProductInventoryEntity);
|
|
69
|
+
//# sourceMappingURL=product-inventory.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-inventory.entity.js","sourceRoot":"","sources":["../../src/entities/product-inventory.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAQiB;AACjB,+CAA2C;AAC3C,qDAAiD;AACjD,iDAA6C;AAwBtC,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,wBAAU;IAMpD,EAAE,CAAS;IAMX,SAAS,CAAS;IAMlB,OAAO,CAAS;IAOhB,iBAAiB,CAAS;IAO1B,KAAK,CAAS;IAOd,UAAU,CAAO;IAWjB,OAAO,CAAgB;IAOvB,KAAK,CAAc;CACpB,CAAA;AA1DY,wDAAsB;AAMjC;IADC,IAAA,gCAAsB,EAAC,WAAW,CAAC;;kDACzB;AAMX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;yDAC1B;AAMlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;uDAC1B;AAOhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;iEAC3C;AAO1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDACtB;AAOd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACxD,IAAI;0DAAC;AAWjB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8BAAa,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACvD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BAC1B,8BAAa;uDAAC;AAOvB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAW,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACrD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;8BAC1B,0BAAW;qDAAC;iCAzDR,sBAAsB;IALlC,IAAA,gBAAM,EAAC,qBAAqB,CAAC;IAC7B,IAAA,gBAAM,EAAC,oCAAoC,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACtE,IAAA,eAAK,EAAC,iCAAiC,EAAE,CAAC,WAAW,CAAC,CAAC;IACvD,IAAA,eAAK,EAAC,+BAA+B,EAAE,CAAC,SAAS,CAAC,CAAC;IACnD,IAAA,eAAK,EAAC,+BAA+B,EAAE,CAAC,OAAO,CAAC,CAAC;GACrC,sBAAsB,CA0DlC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
import { ProductEntity } from './product.entity';
|
|
3
|
+
import { StoreEntity } from './store.entity';
|
|
4
|
+
export declare class ProductPriceEntity extends BaseEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
productId: number;
|
|
7
|
+
storeId: number;
|
|
8
|
+
price: number;
|
|
9
|
+
compareAtPrice: number;
|
|
10
|
+
currency: string;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
lastSyncAt: Date;
|
|
13
|
+
product: ProductEntity;
|
|
14
|
+
store: StoreEntity;
|
|
15
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProductPriceEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_entity_1 = require("./base.entity");
|
|
15
|
+
const product_entity_1 = require("./product.entity");
|
|
16
|
+
const store_entity_1 = require("./store.entity");
|
|
17
|
+
let ProductPriceEntity = class ProductPriceEntity extends base_entity_1.BaseEntity {
|
|
18
|
+
id;
|
|
19
|
+
productId;
|
|
20
|
+
storeId;
|
|
21
|
+
price;
|
|
22
|
+
compareAtPrice;
|
|
23
|
+
currency;
|
|
24
|
+
isActive;
|
|
25
|
+
lastSyncAt;
|
|
26
|
+
product;
|
|
27
|
+
store;
|
|
28
|
+
};
|
|
29
|
+
exports.ProductPriceEntity = ProductPriceEntity;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('increment'),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], ProductPriceEntity.prototype, "id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ name: 'product_id', type: 'int' }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], ProductPriceEntity.prototype, "productId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ name: 'store_id', type: 'int' }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], ProductPriceEntity.prototype, "storeId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'decimal', precision: 12, scale: 2 }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], ProductPriceEntity.prototype, "price", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({
|
|
48
|
+
name: 'compare_at_price',
|
|
49
|
+
type: 'decimal',
|
|
50
|
+
precision: 12,
|
|
51
|
+
scale: 2,
|
|
52
|
+
nullable: true,
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], ProductPriceEntity.prototype, "compareAtPrice", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 3, default: 'COP' }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], ProductPriceEntity.prototype, "currency", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ name: 'is_active', type: 'boolean', default: true }),
|
|
62
|
+
__metadata("design:type", Boolean)
|
|
63
|
+
], ProductPriceEntity.prototype, "isActive", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ name: 'last_sync_at', type: 'timestamp', nullable: true }),
|
|
66
|
+
__metadata("design:type", Date)
|
|
67
|
+
], ProductPriceEntity.prototype, "lastSyncAt", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.ManyToOne)(() => product_entity_1.ProductEntity, { onDelete: 'CASCADE' }),
|
|
70
|
+
(0, typeorm_1.JoinColumn)({ name: 'product_id' }),
|
|
71
|
+
__metadata("design:type", product_entity_1.ProductEntity)
|
|
72
|
+
], ProductPriceEntity.prototype, "product", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.ManyToOne)(() => store_entity_1.StoreEntity, { onDelete: 'CASCADE' }),
|
|
75
|
+
(0, typeorm_1.JoinColumn)({ name: 'store_id' }),
|
|
76
|
+
__metadata("design:type", store_entity_1.StoreEntity)
|
|
77
|
+
], ProductPriceEntity.prototype, "store", void 0);
|
|
78
|
+
exports.ProductPriceEntity = ProductPriceEntity = __decorate([
|
|
79
|
+
(0, typeorm_1.Entity)('product_prices'),
|
|
80
|
+
(0, typeorm_1.Unique)('uq_product_price_product_store', ['productId', 'storeId']),
|
|
81
|
+
(0, typeorm_1.Index)('idx_product_prices_product', ['productId']),
|
|
82
|
+
(0, typeorm_1.Index)('idx_product_prices_store', ['storeId']),
|
|
83
|
+
(0, typeorm_1.Index)('idx_product_prices_active', ['isActive'])
|
|
84
|
+
], ProductPriceEntity);
|
|
85
|
+
//# sourceMappingURL=product-price.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-price.entity.js","sourceRoot":"","sources":["../../src/entities/product-price.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAQiB;AACjB,+CAA2C;AAC3C,qDAAiD;AACjD,iDAA6C;AAyBtC,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,wBAAU;IAMhD,EAAE,CAAS;IAMX,SAAS,CAAS;IAOlB,OAAO,CAAS;IAQhB,KAAK,CAAS;IAcd,cAAc,CAAS;IAOvB,QAAQ,CAAS;IAOjB,QAAQ,CAAU;IAMlB,UAAU,CAAO;IAWjB,OAAO,CAAgB;IAOvB,KAAK,CAAc;CACpB,CAAA;AAhFY,gDAAkB;AAM7B;IADC,IAAA,gCAAsB,EAAC,WAAW,CAAC;;8CACzB;AAMX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE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CAAC;IACxB,IAAA,gBAAM,EAAC,gCAAgC,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAClE,IAAA,eAAK,EAAC,4BAA4B,EAAE,CAAC,WAAW,CAAC,CAAC;IAClD,IAAA,eAAK,EAAC,0BAA0B,EAAE,CAAC,SAAS,CAAC,CAAC;IAC9C,IAAA,eAAK,EAAC,2BAA2B,EAAE,CAAC,UAAU,CAAC,CAAC;GACpC,kBAAkB,CAgF9B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseEntity } from './base.entity';
|
|
2
|
+
import { BrandEntity } from './brand.entity';
|
|
3
|
+
import { SubCategoryEntity } from './sub-category.entity';
|
|
4
|
+
export declare class ProductEntity extends BaseEntity {
|
|
5
|
+
id: number;
|
|
6
|
+
externalCode: string;
|
|
7
|
+
barcode: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
indications: string;
|
|
11
|
+
atc: string;
|
|
12
|
+
presentation: string;
|
|
13
|
+
imageUrl: string;
|
|
14
|
+
brandId: number;
|
|
15
|
+
subCategoryId: number;
|
|
16
|
+
departmentName: string;
|
|
17
|
+
categoryName: string;
|
|
18
|
+
subCategoryName: string;
|
|
19
|
+
brandName: string;
|
|
20
|
+
rawData: object;
|
|
21
|
+
isActive: boolean;
|
|
22
|
+
brand: BrandEntity;
|
|
23
|
+
subCategory: SubCategoryEntity;
|
|
24
|
+
}
|