test-entity-library-asm 2.3.7 → 2.3.8
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.
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CodeRedemptionHistoryUser } from './CodeRedemptionHistoryUser';
|
|
2
2
|
import { Company } from './Company';
|
|
3
3
|
import { Partner } from './Partner';
|
|
4
|
+
import { Local } from '..';
|
|
4
5
|
export declare class DiscountCodeUser {
|
|
5
6
|
id: number;
|
|
6
7
|
company: Company;
|
|
8
|
+
local: Local;
|
|
7
9
|
code: string;
|
|
8
10
|
discount: string;
|
|
9
11
|
type: number;
|
|
@@ -14,6 +14,7 @@ var typeorm_1 = require("typeorm");
|
|
|
14
14
|
var CodeRedemptionHistoryUser_1 = require("./CodeRedemptionHistoryUser");
|
|
15
15
|
var Company_1 = require("./Company");
|
|
16
16
|
var Partner_1 = require("./Partner");
|
|
17
|
+
var __1 = require("..");
|
|
17
18
|
var DiscountCodeUser = /** @class */ (function () {
|
|
18
19
|
function DiscountCodeUser() {
|
|
19
20
|
}
|
|
@@ -31,6 +32,15 @@ var DiscountCodeUser = /** @class */ (function () {
|
|
|
31
32
|
(0, typeorm_1.JoinColumn)({ name: 'company' }),
|
|
32
33
|
__metadata("design:type", Company_1.Company)
|
|
33
34
|
], DiscountCodeUser.prototype, "company", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(function () { return __1.Local; }, function (local) { return local.discount_code_locals; }, {
|
|
37
|
+
onDelete: 'CASCADE',
|
|
38
|
+
onUpdate: 'NO ACTION',
|
|
39
|
+
nullable: true,
|
|
40
|
+
}),
|
|
41
|
+
(0, typeorm_1.JoinColumn)({ name: 'local' }),
|
|
42
|
+
__metadata("design:type", __1.Local)
|
|
43
|
+
], DiscountCodeUser.prototype, "local", void 0);
|
|
34
44
|
__decorate([
|
|
35
45
|
(0, typeorm_1.Column)({ length: 10, comment: 'Código del descuento para compartirlo.' }),
|
|
36
46
|
__metadata("design:type", String)
|
package/dist/entities/Local.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { Terminal } from './Terminal';
|
|
|
10
10
|
import { User } from './User';
|
|
11
11
|
import { Partner } from './Partner';
|
|
12
12
|
import { BusinessTypeProduct } from './BusinessTypeProduct';
|
|
13
|
-
import { PosSystem } from '..';
|
|
13
|
+
import { DiscountCodeUser, PosSystem } from '..';
|
|
14
14
|
export declare class Local {
|
|
15
15
|
id: number;
|
|
16
16
|
company: Company;
|
|
@@ -36,4 +36,5 @@ export declare class Local {
|
|
|
36
36
|
terminals: Terminal[];
|
|
37
37
|
users_favorite_local: User[];
|
|
38
38
|
business_type_products: BusinessTypeProduct[];
|
|
39
|
+
discount_code_locals: DiscountCodeUser[];
|
|
39
40
|
}
|
package/dist/entities/Local.js
CHANGED
|
@@ -187,6 +187,10 @@ var Local = /** @class */ (function () {
|
|
|
187
187
|
}),
|
|
188
188
|
__metadata("design:type", Array)
|
|
189
189
|
], Local.prototype, "business_type_products", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, typeorm_1.OneToMany)(function () { return __1.DiscountCodeUser; }, function (discountCodeUser) { return discountCodeUser.local; }),
|
|
192
|
+
__metadata("design:type", Array)
|
|
193
|
+
], Local.prototype, "discount_code_locals", void 0);
|
|
190
194
|
Local = __decorate([
|
|
191
195
|
(0, typeorm_1.Entity)({ comment: 'Locales disponibles de las empresas (company).' })
|
|
192
196
|
], Local);
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { CodeRedemptionHistoryUser } from './CodeRedemptionHistoryUser'
|
|
10
10
|
import { Company } from './Company'
|
|
11
11
|
import { Partner } from './Partner'
|
|
12
|
+
import { Local } from '..'
|
|
12
13
|
|
|
13
14
|
@Entity('discount_code_user', {
|
|
14
15
|
comment: 'Códigos de descuento para los usuarios.',
|
|
@@ -26,6 +27,14 @@ export class DiscountCodeUser {
|
|
|
26
27
|
@JoinColumn({ name: 'company' })
|
|
27
28
|
company: Company
|
|
28
29
|
|
|
30
|
+
@ManyToOne(() => Local, (local) => local.discount_code_locals, {
|
|
31
|
+
onDelete: 'CASCADE',
|
|
32
|
+
onUpdate: 'NO ACTION',
|
|
33
|
+
nullable: true,
|
|
34
|
+
})
|
|
35
|
+
@JoinColumn({ name: 'local' })
|
|
36
|
+
local: Local
|
|
37
|
+
|
|
29
38
|
@Column({ length: 10, comment: 'Código del descuento para compartirlo.' })
|
|
30
39
|
code: string
|
|
31
40
|
|
package/src/entities/Local.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { Terminal } from './Terminal'
|
|
|
20
20
|
import { User } from './User'
|
|
21
21
|
import { Partner } from './Partner'
|
|
22
22
|
import { BusinessTypeProduct } from './BusinessTypeProduct'
|
|
23
|
-
import { PosSystem } from '..'
|
|
23
|
+
import { DiscountCodeUser, PosSystem } from '..'
|
|
24
24
|
import { jsonTransformer } from '../transformers/jsonTransformer'
|
|
25
25
|
|
|
26
26
|
@Entity({ comment: 'Locales disponibles de las empresas (company).' })
|
|
@@ -165,4 +165,8 @@ export class Local {
|
|
|
165
165
|
},
|
|
166
166
|
})
|
|
167
167
|
business_type_products: BusinessTypeProduct[]
|
|
168
|
+
|
|
169
|
+
@OneToMany(() => DiscountCodeUser, (discountCodeUser) => discountCodeUser.local)
|
|
170
|
+
discount_code_locals: DiscountCodeUser[]
|
|
168
171
|
}
|
|
172
|
+
|