test-entity-library-asm 3.9.48 → 3.9.49
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/Local.d.ts +1 -0
- package/dist/entities/Local.js +8 -0
- package/dist/entities/Partner.d.ts +1 -0
- package/dist/entities/Partner.js +4 -0
- package/dist/index.js +0 -11
- package/package.json +1 -1
- package/src/entities/Local.ts +8 -4
- package/src/entities/Partner.ts +3 -0
- package/src/index.ts +0 -13
package/dist/entities/Local.d.ts
CHANGED
package/dist/entities/Local.js
CHANGED
|
@@ -87,6 +87,14 @@ __decorate([
|
|
|
87
87
|
(0, typeorm_1.Column)({ type: "datetime", default: () => "CURRENT_TIMESTAMP" }),
|
|
88
88
|
__metadata("design:type", Date)
|
|
89
89
|
], Local.prototype, "created", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, typeorm_1.ManyToOne)(() => Partner_1.Partner, (partner) => partner.created_by_locals, {
|
|
92
|
+
onDelete: "NO ACTION",
|
|
93
|
+
onUpdate: "NO ACTION",
|
|
94
|
+
}),
|
|
95
|
+
(0, typeorm_1.JoinColumn)({ name: "created_by" }),
|
|
96
|
+
__metadata("design:type", Partner_1.Partner)
|
|
97
|
+
], Local.prototype, "created_by", void 0);
|
|
90
98
|
__decorate([
|
|
91
99
|
(0, typeorm_1.Column)({
|
|
92
100
|
type: "datetime",
|
package/dist/entities/Partner.js
CHANGED
|
@@ -316,6 +316,10 @@ __decorate([
|
|
|
316
316
|
(0, typeorm_1.OneToMany)(() => __1.LocalChange, (localChange) => localChange.created_by),
|
|
317
317
|
__metadata("design:type", Array)
|
|
318
318
|
], Partner.prototype, "local_changes", void 0);
|
|
319
|
+
__decorate([
|
|
320
|
+
(0, typeorm_1.OneToMany)(() => Local_1.Local, (local) => local.created_by),
|
|
321
|
+
__metadata("design:type", Array)
|
|
322
|
+
], Partner.prototype, "created_by_locals", void 0);
|
|
319
323
|
exports.Partner = Partner = __decorate([
|
|
320
324
|
(0, typeorm_1.Entity)({
|
|
321
325
|
comment: "Tabla agregada para los usuarios qué quieran registrar su local o empresa de comida rápida en la plataforma.\r\n\r\nEste usuario es independiente a los usuarios de la tabla `user` ya que tiene diferentes plataformas.\r\n\r\nTambién van a estar los usuarios qué el administrador/dueño desee agregar como empleados/colaboradores.",
|
package/dist/index.js
CHANGED
|
@@ -42,17 +42,6 @@ let connection = null;
|
|
|
42
42
|
function createDataBaseSource() {
|
|
43
43
|
if (!connection) {
|
|
44
44
|
(0, dotenv_1.config)({ path: (0, path_1.resolve)(process.cwd(), ".env") });
|
|
45
|
-
console.log("ENTIDADES REGISTRADAS:");
|
|
46
|
-
console.log(Object.keys(EntitiesViewsRoutes));
|
|
47
|
-
console.log({
|
|
48
|
-
type: process.env.DB_TYPE,
|
|
49
|
-
host: process.env.DB_HOST,
|
|
50
|
-
port: process.env.DB_PORT,
|
|
51
|
-
username: process.env.DB_USERNAME,
|
|
52
|
-
database: process.env.DB_DATABASE,
|
|
53
|
-
password: process.env.DB_PASSWORD,
|
|
54
|
-
synchronize: process.env.DB_SYNCHRONIZE,
|
|
55
|
-
});
|
|
56
45
|
connection = new typeorm_1.DataSource({
|
|
57
46
|
type: process.env.DB_TYPE,
|
|
58
47
|
// dateStrings: true,
|
package/package.json
CHANGED
package/src/entities/Local.ts
CHANGED
|
@@ -90,6 +90,13 @@ export class Local {
|
|
|
90
90
|
@Column({ type: "datetime", default: () => "CURRENT_TIMESTAMP" })
|
|
91
91
|
created: Date;
|
|
92
92
|
|
|
93
|
+
@ManyToOne(() => Partner, (partner) => partner.created_by_locals, {
|
|
94
|
+
onDelete: "NO ACTION",
|
|
95
|
+
onUpdate: "NO ACTION",
|
|
96
|
+
})
|
|
97
|
+
@JoinColumn({ name: "created_by" })
|
|
98
|
+
created_by: Partner;
|
|
99
|
+
|
|
93
100
|
@Column({
|
|
94
101
|
type: "datetime",
|
|
95
102
|
onUpdate: "CURRENT_TIMESTAMP",
|
|
@@ -269,9 +276,6 @@ export class Local {
|
|
|
269
276
|
)
|
|
270
277
|
locals_payment_method: LocalPaymentMethod[];
|
|
271
278
|
|
|
272
|
-
@OneToMany(
|
|
273
|
-
() => LocalChange,
|
|
274
|
-
(localChange) => localChange.local,
|
|
275
|
-
)
|
|
279
|
+
@OneToMany(() => LocalChange, (localChange) => localChange.local)
|
|
276
280
|
locals_changes: LocalChange[];
|
|
277
281
|
}
|
package/src/entities/Partner.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -34,19 +34,6 @@ export function createDataBaseSource(): DataSource {
|
|
|
34
34
|
if (!connection) {
|
|
35
35
|
config({ path: resolve(process.cwd(), ".env") });
|
|
36
36
|
|
|
37
|
-
console.log("ENTIDADES REGISTRADAS:");
|
|
38
|
-
console.log(Object.keys(EntitiesViewsRoutes));
|
|
39
|
-
|
|
40
|
-
console.log({
|
|
41
|
-
type: process.env.DB_TYPE,
|
|
42
|
-
host: process.env.DB_HOST,
|
|
43
|
-
port: process.env.DB_PORT,
|
|
44
|
-
username: process.env.DB_USERNAME,
|
|
45
|
-
database: process.env.DB_DATABASE,
|
|
46
|
-
password: process.env.DB_PASSWORD,
|
|
47
|
-
synchronize: process.env.DB_SYNCHRONIZE,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
37
|
connection = new DataSource({
|
|
51
38
|
type: process.env.DB_TYPE as unknown as IType,
|
|
52
39
|
// dateStrings: true,
|