test-entity-library-asm 3.2.13 → 3.3.0
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/AuthenticationCredential.d.ts +1 -1
- package/dist/entities/AuthenticationCredential.js +16 -7
- package/dist/entities/Bank.js +5 -0
- package/dist/entities/BusinessType.js +9 -3
- package/dist/entities/BusinessTypeProduct.js +4 -1
- package/dist/entities/Category.d.ts +3 -3
- package/dist/entities/Category.js +24 -8
- package/dist/entities/CategoryDate.js +3 -2
- package/dist/entities/CategorySchedule.js +3 -2
- package/dist/entities/City.d.ts +8 -8
- package/dist/entities/City.js +13 -10
- package/dist/entities/CodeRedemptionHistoryCompany.d.ts +2 -2
- package/dist/entities/CodeRedemptionHistoryCompany.js +19 -9
- package/dist/entities/CodeRedemptionHistoryUser.d.ts +2 -2
- package/dist/entities/CodeRedemptionHistoryUser.js +21 -11
- package/dist/entities/Company.js +14 -2
- package/dist/entities/Configuration.js +5 -4
- package/dist/entities/Country.d.ts +1 -1
- package/dist/entities/Country.js +15 -5
- package/dist/entities/Day.js +3 -0
- package/dist/entities/DiscountCodeCompany.js +11 -1
- package/dist/entities/DiscountCodeUser.js +17 -2
- package/dist/entities/Local.d.ts +1 -1
- package/dist/entities/Local.js +10 -3
- package/dist/entities/LocalPlan.js +9 -0
- package/dist/entities/LocalQualification.js +4 -1
- package/dist/entities/Master.js +25 -4
- package/dist/entities/MasterNotification.js +7 -0
- package/dist/entities/MasterPermission.js +11 -1
- package/dist/entities/MasterRole.js +12 -1
- package/dist/entities/Partner.js +28 -4
- package/dist/entities/PartnerNotification.js +7 -0
- package/dist/entities/PartnerPermission.d.ts +1 -1
- package/dist/entities/PartnerPermission.js +15 -2
- package/dist/entities/PartnerPermissionSection.js +14 -1
- package/dist/entities/PartnerPlatform.js +14 -1
- package/dist/entities/PartnerRole.js +12 -1
- package/dist/entities/PartnerSession.js +8 -0
- package/dist/entities/PaymentMethod.d.ts +2 -2
- package/dist/entities/PaymentMethod.js +10 -1
- package/dist/entities/Plan.d.ts +1 -1
- package/dist/entities/Plan.js +16 -3
- package/dist/entities/PosSystem.d.ts +2 -2
- package/dist/entities/PosSystem.js +16 -4
- package/dist/entities/Product.d.ts +2 -2
- package/dist/entities/Product.js +30 -6
- package/dist/entities/ProductDate.js +3 -2
- package/dist/entities/ProductGroup.d.ts +3 -3
- package/dist/entities/ProductGroup.js +24 -14
- package/dist/entities/ProductIngredient.d.ts +2 -2
- package/dist/entities/ProductIngredient.js +16 -13
- package/dist/entities/ProductSchedule.js +3 -2
- package/dist/entities/ProductTopping.js +4 -0
- package/dist/entities/Region.d.ts +2 -2
- package/dist/entities/Region.js +12 -8
- package/dist/entities/Request.d.ts +1 -1
- package/dist/entities/Request.js +14 -2
- package/dist/entities/RequestLocal.js +13 -1
- package/dist/entities/RequestLocalHistory.js +8 -1
- package/dist/entities/RequestLocalPayment.js +10 -0
- package/dist/entities/RequestProduct.d.ts +3 -3
- package/dist/entities/RequestProduct.js +19 -15
- package/dist/entities/RequestProductGroupComplement.d.ts +3 -3
- package/dist/entities/RequestProductGroupComplement.js +14 -13
- package/dist/entities/Square.d.ts +2 -2
- package/dist/entities/Square.js +36 -5
- package/dist/entities/ToppingImage.js +6 -0
- package/dist/entities/TypeMeasureIngredient.d.ts +1 -1
- package/dist/entities/TypeMeasureIngredient.js +11 -6
- package/dist/entities/User.d.ts +2 -2
- package/dist/entities/User.js +22 -5
- package/dist/entities/UserAddress.js +14 -1
- package/dist/entities/UserPaymentMethod.d.ts +1 -1
- package/dist/entities/UserPaymentMethod.js +13 -1
- package/dist/entities/VerifyLocal.d.ts +2 -2
- package/dist/entities/VerifyLocal.js +11 -0
- package/dist/entities/productGroupComplement.js +23 -3
- package/package.json +1 -1
- package/src/entities/AuthenticationCredential.ts +24 -15
- package/src/entities/Bank.ts +8 -6
- package/src/entities/BusinessType.ts +9 -2
- package/src/entities/BusinessTypeProduct.ts +4 -1
- package/src/entities/Category.ts +24 -8
- package/src/entities/CategoryDate.ts +3 -2
- package/src/entities/CategorySchedule.ts +3 -2
- package/src/entities/City.ts +31 -28
- package/src/entities/CodeRedemptionHistoryCompany.ts +28 -18
- package/src/entities/CodeRedemptionHistoryUser.ts +31 -21
- package/src/entities/Company.ts +14 -2
- package/src/entities/Configuration.ts +8 -7
- package/src/entities/Country.ts +15 -5
- package/src/entities/Day.ts +4 -1
- package/src/entities/DiscountCodeCompany.ts +11 -1
- package/src/entities/DiscountCodeUser.ts +17 -2
- package/src/entities/Local.ts +12 -11
- package/src/entities/LocalPlan.ts +9 -0
- package/src/entities/LocalQualification.ts +4 -1
- package/src/entities/Master.ts +25 -4
- package/src/entities/MasterNotification.ts +7 -0
- package/src/entities/MasterPermission.ts +11 -1
- package/src/entities/MasterRole.ts +12 -1
- package/src/entities/Partner.ts +28 -4
- package/src/entities/PartnerNotification.ts +7 -0
- package/src/entities/PartnerPermission.ts +15 -2
- package/src/entities/PartnerPermissionSection.ts +14 -1
- package/src/entities/PartnerPlatform.ts +14 -1
- package/src/entities/PartnerRole.ts +12 -1
- package/src/entities/PartnerSession.ts +9 -1
- package/src/entities/PaymentMethod.ts +11 -2
- package/src/entities/Plan.ts +17 -4
- package/src/entities/PosSystem.ts +16 -4
- package/src/entities/Product.ts +31 -7
- package/src/entities/ProductDate.ts +3 -3
- package/src/entities/ProductGroup.ts +40 -30
- package/src/entities/ProductIngredient.ts +27 -24
- package/src/entities/ProductSchedule.ts +3 -2
- package/src/entities/ProductTopping.ts +4 -0
- package/src/entities/Region.ts +22 -19
- package/src/entities/Request.ts +14 -2
- package/src/entities/RequestLocal.ts +13 -1
- package/src/entities/RequestLocalHistory.ts +8 -1
- package/src/entities/RequestLocalPayment.ts +10 -0
- package/src/entities/RequestProduct.ts +30 -26
- package/src/entities/RequestProductGroupComplement.ts +23 -22
- package/src/entities/Square.ts +37 -6
- package/src/entities/ToppingImage.ts +6 -0
- package/src/entities/TypeMeasureIngredient.ts +18 -18
- package/src/entities/User.ts +23 -6
- package/src/entities/UserAddress.ts +14 -1
- package/src/entities/UserPaymentMethod.ts +13 -1
- package/src/entities/VerifyLocal.ts +13 -2
- package/src/entities/productGroupComplement.ts +23 -3
|
@@ -3,40 +3,50 @@ import {
|
|
|
3
3
|
Entity,
|
|
4
4
|
JoinColumn,
|
|
5
5
|
ManyToOne,
|
|
6
|
-
PrimaryGeneratedColumn
|
|
7
|
-
} from
|
|
8
|
-
import { Company } from
|
|
9
|
-
import { DiscountCodeCompany } from
|
|
6
|
+
PrimaryGeneratedColumn,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { Company } from "./Company";
|
|
9
|
+
import { DiscountCodeCompany } from "./DiscountCodeCompany";
|
|
10
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
10
11
|
|
|
11
|
-
@Entity(
|
|
12
|
+
@Entity("code_redemption_history_company", {
|
|
12
13
|
comment:
|
|
13
|
-
|
|
14
|
+
"Historial de códigos redimidos por la empresa, si en algún momento cuando una empresa se registre en la plataforma, entonces se le puede dar un descuento o un plan personalizado.",
|
|
14
15
|
})
|
|
15
16
|
export class CodeRedemptionHistoryCompany {
|
|
16
17
|
@PrimaryGeneratedColumn({
|
|
17
|
-
|
|
18
|
+
type: "int",
|
|
19
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
18
20
|
})
|
|
19
|
-
id: number
|
|
21
|
+
id: number;
|
|
20
22
|
|
|
21
23
|
@ManyToOne(
|
|
22
24
|
() => DiscountCodeCompany,
|
|
23
25
|
(company) => company.code_redemptions_history_company,
|
|
24
|
-
{ onDelete:
|
|
26
|
+
{ onDelete: "CASCADE", onUpdate: "NO ACTION" }
|
|
25
27
|
)
|
|
26
|
-
@JoinColumn({ name:
|
|
27
|
-
discount_code_company: DiscountCodeCompany
|
|
28
|
+
@JoinColumn({ name: "discount_code_company" })
|
|
29
|
+
discount_code_company: DiscountCodeCompany;
|
|
28
30
|
|
|
29
31
|
@ManyToOne(
|
|
30
32
|
() => Company,
|
|
31
33
|
(company) => company.code_redemption_history_company,
|
|
32
|
-
{ onDelete:
|
|
34
|
+
{ onDelete: "CASCADE", onUpdate: "NO ACTION" }
|
|
33
35
|
)
|
|
34
|
-
@JoinColumn({ name:
|
|
35
|
-
company: Company
|
|
36
|
+
@JoinColumn({ name: "company" })
|
|
37
|
+
company: Company;
|
|
36
38
|
|
|
37
|
-
@Column({
|
|
38
|
-
|
|
39
|
+
@Column({
|
|
40
|
+
type: "datetime",
|
|
41
|
+
transformer: new DateTransformer(),
|
|
42
|
+
comment: "Fecha cuando se usó el descuento.",
|
|
43
|
+
})
|
|
44
|
+
date_used: Date;
|
|
39
45
|
|
|
40
|
-
@Column({
|
|
41
|
-
|
|
46
|
+
@Column({
|
|
47
|
+
length: 10,
|
|
48
|
+
type: "varchar",
|
|
49
|
+
comment: "El valor del descuento aplicado.",
|
|
50
|
+
})
|
|
51
|
+
discount_applied: string;
|
|
42
52
|
}
|
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Entity,
|
|
3
2
|
Column,
|
|
4
|
-
|
|
5
|
-
ManyToOne,
|
|
3
|
+
Entity,
|
|
6
4
|
JoinColumn,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
ManyToOne,
|
|
6
|
+
PrimaryGeneratedColumn,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { DiscountCodeUser } from "./DiscountCodeUser";
|
|
9
|
+
import { User } from "./User";
|
|
10
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
10
11
|
|
|
11
|
-
@Entity(
|
|
12
|
+
@Entity("code_redemption_history_user", {
|
|
12
13
|
comment:
|
|
13
|
-
|
|
14
|
+
"Historial de los códigos redimidos por los usuarios, es decir, si un local desea agregar un código de descuento para qué los usuarios puedan tener un descuento, entonces acá van a estar los que lo redimieron.",
|
|
14
15
|
})
|
|
15
16
|
export class CodeRedemptionHistoryUser {
|
|
16
17
|
@PrimaryGeneratedColumn({
|
|
17
|
-
|
|
18
|
+
type: "int",
|
|
19
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
18
20
|
})
|
|
19
|
-
id: number
|
|
21
|
+
id: number;
|
|
20
22
|
|
|
21
23
|
@ManyToOne(
|
|
22
24
|
() => DiscountCodeUser,
|
|
23
25
|
(discountCodeUser) => discountCodeUser.code_redemptions_history_users,
|
|
24
|
-
{ onDelete:
|
|
26
|
+
{ onDelete: "CASCADE", onUpdate: "NO ACTION" }
|
|
25
27
|
)
|
|
26
|
-
@JoinColumn({ name:
|
|
27
|
-
discount_code_user: DiscountCodeUser
|
|
28
|
+
@JoinColumn({ name: "discount_code_user" })
|
|
29
|
+
discount_code_user: DiscountCodeUser;
|
|
28
30
|
|
|
29
31
|
@ManyToOne(() => User, (user) => user.code_redemption_history_users, {
|
|
30
|
-
onDelete:
|
|
31
|
-
onUpdate:
|
|
32
|
+
onDelete: "CASCADE",
|
|
33
|
+
onUpdate: "NO ACTION",
|
|
32
34
|
})
|
|
33
|
-
@JoinColumn({ name:
|
|
34
|
-
user: User
|
|
35
|
+
@JoinColumn({ name: "user" })
|
|
36
|
+
user: User;
|
|
35
37
|
|
|
36
|
-
@Column({
|
|
37
|
-
|
|
38
|
+
@Column({
|
|
39
|
+
type: "datetime",
|
|
40
|
+
transformer: new DateTransformer(),
|
|
41
|
+
comment: "Fecha cuando se usó el descuento.",
|
|
42
|
+
})
|
|
43
|
+
date_used: Date;
|
|
38
44
|
|
|
39
|
-
@Column({
|
|
40
|
-
|
|
45
|
+
@Column({
|
|
46
|
+
length: 10,
|
|
47
|
+
type: "varchar",
|
|
48
|
+
comment: "El valor del descuento aplicado.",
|
|
49
|
+
})
|
|
50
|
+
discount_applied: string;
|
|
41
51
|
}
|
package/src/entities/Company.ts
CHANGED
|
@@ -24,14 +24,20 @@ import { ProductTopping } from "./ProductTopping";
|
|
|
24
24
|
})
|
|
25
25
|
export class Company {
|
|
26
26
|
@PrimaryGeneratedColumn({
|
|
27
|
+
type: "int",
|
|
27
28
|
comment: "Número de identificación (ID) único de cada empresa.",
|
|
28
29
|
})
|
|
29
30
|
id: number;
|
|
30
31
|
|
|
31
|
-
@Column({
|
|
32
|
+
@Column({
|
|
33
|
+
length: 30,
|
|
34
|
+
type: "varchar",
|
|
35
|
+
unique: true,
|
|
36
|
+
comment: "Código único de la empresa.",
|
|
37
|
+
})
|
|
32
38
|
code: string;
|
|
33
39
|
|
|
34
|
-
@Column({ length: 50, comment: "Nombre de la empresa." })
|
|
40
|
+
@Column({ length: 50, type: "varchar", comment: "Nombre de la empresa." })
|
|
35
41
|
name: string;
|
|
36
42
|
|
|
37
43
|
@ManyToOne(() => City, (city) => city.companies, {
|
|
@@ -51,6 +57,7 @@ export class Company {
|
|
|
51
57
|
@Column({
|
|
52
58
|
type: "longtext",
|
|
53
59
|
nullable: true,
|
|
60
|
+
default: null,
|
|
54
61
|
transformer: jsonTransformer,
|
|
55
62
|
comment:
|
|
56
63
|
"Campo de tipo JSON donde se guarda información necesaria para la empresa.",
|
|
@@ -60,6 +67,7 @@ export class Company {
|
|
|
60
67
|
@Column({
|
|
61
68
|
type: "text",
|
|
62
69
|
nullable: true,
|
|
70
|
+
default: null,
|
|
63
71
|
transformer: jsonTransformer,
|
|
64
72
|
comment:
|
|
65
73
|
"Campo de tipo JSON donde se guarda información para guardar el teléfono y el correo electrónico, también los nuevos valores qué tengan esos 2 campos.",
|
|
@@ -69,6 +77,7 @@ export class Company {
|
|
|
69
77
|
@Column({
|
|
70
78
|
type: "longtext",
|
|
71
79
|
nullable: true,
|
|
80
|
+
default: null,
|
|
72
81
|
transformer: jsonTransformer,
|
|
73
82
|
comment:
|
|
74
83
|
"Información de tipo JSON donde se guarda la información legal de la empresa.",
|
|
@@ -78,6 +87,7 @@ export class Company {
|
|
|
78
87
|
@Column({
|
|
79
88
|
type: "longtext",
|
|
80
89
|
nullable: true,
|
|
90
|
+
default: null,
|
|
81
91
|
transformer: jsonTransformer,
|
|
82
92
|
comment:
|
|
83
93
|
"Información de tipo JSON donde se guarda la información del representante legal del representante.",
|
|
@@ -87,6 +97,7 @@ export class Company {
|
|
|
87
97
|
@Column({
|
|
88
98
|
type: "longtext",
|
|
89
99
|
nullable: true,
|
|
100
|
+
default: null,
|
|
90
101
|
transformer: jsonTransformer,
|
|
91
102
|
comment: "Configuración de la empresa.",
|
|
92
103
|
})
|
|
@@ -102,6 +113,7 @@ export class Company {
|
|
|
102
113
|
@Column({
|
|
103
114
|
type: "date",
|
|
104
115
|
nullable: true,
|
|
116
|
+
default: null,
|
|
105
117
|
comment: "Cuándo expira el plan de la empresa.",
|
|
106
118
|
})
|
|
107
119
|
expiration: Date | null;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryColumn } from
|
|
1
|
+
import { Column, Entity, PrimaryColumn } from "typeorm";
|
|
2
2
|
|
|
3
3
|
@Entity({
|
|
4
4
|
comment:
|
|
5
|
-
|
|
5
|
+
"Esta tabla tiene como fin agregar toda la información de la empresa, logos, urls de documentación, nombres, urls de las páginas... \n\n Esto se se guarda como un string de tipo JSON para que sea fácil almacenarlo y generar nuevos campos si es necesario.",
|
|
6
6
|
})
|
|
7
7
|
export class Configuration {
|
|
8
8
|
@PrimaryColumn({
|
|
9
9
|
length: 20,
|
|
10
|
-
|
|
10
|
+
type: "varchar",
|
|
11
|
+
comment: "Nombre del perfil que se está usando en la aplicación.",
|
|
11
12
|
})
|
|
12
|
-
profile: string
|
|
13
|
+
profile: string;
|
|
13
14
|
|
|
14
15
|
@Column({
|
|
15
|
-
type:
|
|
16
|
+
type: "longtext",
|
|
16
17
|
comment:
|
|
17
|
-
|
|
18
|
+
"Columna de tipo JSON para agregar la información y configuración respecto a la plataforma.",
|
|
18
19
|
})
|
|
19
|
-
settings: string
|
|
20
|
+
settings: string;
|
|
20
21
|
}
|
package/src/entities/Country.ts
CHANGED
|
@@ -1,32 +1,39 @@
|
|
|
1
1
|
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
2
|
-
import { Region } from "./Region";
|
|
3
|
-
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
4
2
|
import { Bank } from "..";
|
|
3
|
+
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
4
|
+
import { Region } from "./Region";
|
|
5
5
|
|
|
6
6
|
@Entity({ comment: "Países donde está disponible la plataforma." })
|
|
7
7
|
export class Country {
|
|
8
8
|
@PrimaryGeneratedColumn({
|
|
9
|
+
type: "int",
|
|
9
10
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
10
11
|
})
|
|
11
12
|
id: number;
|
|
12
13
|
|
|
13
|
-
@Column({ length: 10, comment: "Código del país." })
|
|
14
|
+
@Column({ length: 10, type: "varchar", comment: "Código del país." })
|
|
14
15
|
code: string;
|
|
15
16
|
|
|
16
|
-
@Column({ length: 50, comment: "Nombre del país." })
|
|
17
|
+
@Column({ length: 50, type: "varchar", comment: "Nombre del país." })
|
|
17
18
|
name: string;
|
|
18
19
|
|
|
19
20
|
@Column({
|
|
20
21
|
length: 10,
|
|
22
|
+
type: "varchar",
|
|
21
23
|
comment:
|
|
22
24
|
"Usamos esta columna para saber la moneda del país y sugerírsela al usuario o al local.",
|
|
23
25
|
})
|
|
24
26
|
currency: string;
|
|
25
27
|
|
|
26
|
-
@Column({
|
|
28
|
+
@Column({
|
|
29
|
+
length: 10,
|
|
30
|
+
type: "varchar",
|
|
31
|
+
comment: "Prefijo para los números de teléfono.",
|
|
32
|
+
})
|
|
27
33
|
prefix: string;
|
|
28
34
|
|
|
29
35
|
@Column({
|
|
36
|
+
type: "varchar",
|
|
30
37
|
length: 15,
|
|
31
38
|
comment: "Estructura que tiene el teléfono en ese país.",
|
|
32
39
|
})
|
|
@@ -51,6 +58,7 @@ export class Country {
|
|
|
51
58
|
@Column({
|
|
52
59
|
type: "longtext",
|
|
53
60
|
nullable: true,
|
|
61
|
+
default: null,
|
|
54
62
|
transformer: jsonTransformer,
|
|
55
63
|
comment:
|
|
56
64
|
"Columna de tipo JSON para almacenar información adicional sobre el país.",
|
|
@@ -59,6 +67,8 @@ export class Country {
|
|
|
59
67
|
|
|
60
68
|
@Column({
|
|
61
69
|
default: 1,
|
|
70
|
+
type: "int",
|
|
71
|
+
width: 1,
|
|
62
72
|
comment:
|
|
63
73
|
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
64
74
|
})
|
package/src/entities/Day.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
2
|
-
import {
|
|
2
|
+
import { ProductSchedule, ScheduleCategory } from "..";
|
|
3
3
|
|
|
4
4
|
@Entity({ comment: "Días de la semana." })
|
|
5
5
|
export class Day {
|
|
6
6
|
@PrimaryGeneratedColumn({
|
|
7
|
+
type: "int",
|
|
7
8
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
8
9
|
})
|
|
9
10
|
id: number;
|
|
10
11
|
|
|
11
12
|
@Column({
|
|
12
13
|
length: 50,
|
|
14
|
+
type: "varchar",
|
|
13
15
|
comment:
|
|
14
16
|
'Nombre del día.\r\n\r\nID/KEY de la variable que se encuentra en los archivos "locale" para el multilenguaje.',
|
|
15
17
|
})
|
|
@@ -17,6 +19,7 @@ export class Day {
|
|
|
17
19
|
|
|
18
20
|
@Column({
|
|
19
21
|
default: 1,
|
|
22
|
+
type: "varchar",
|
|
20
23
|
comment:
|
|
21
24
|
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
22
25
|
})
|
|
@@ -17,21 +17,24 @@ import { ServiceDiscountsPlan } from "./ServiceDiscountsPlan";
|
|
|
17
17
|
})
|
|
18
18
|
export class DiscountCodeCompany {
|
|
19
19
|
@PrimaryGeneratedColumn({
|
|
20
|
+
type: "int",
|
|
20
21
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
21
22
|
})
|
|
22
23
|
id: number;
|
|
23
24
|
|
|
24
25
|
@Column({
|
|
25
26
|
length: 10,
|
|
27
|
+
type: "varchar",
|
|
26
28
|
comment: "Código de descuento para las empresas (company).",
|
|
27
29
|
})
|
|
28
30
|
code: string;
|
|
29
31
|
|
|
30
|
-
@Column({ length: 10, comment: "Descuento que se aplica." })
|
|
32
|
+
@Column({ length: 10, type: "varchar", comment: "Descuento que se aplica." })
|
|
31
33
|
discount: string;
|
|
32
34
|
|
|
33
35
|
@Column({
|
|
34
36
|
default: 1,
|
|
37
|
+
type: "int",
|
|
35
38
|
comment:
|
|
36
39
|
"Campo para el tipo de descuento:\r\n1. Porcentaje.\r\n2. Valor en moneda.",
|
|
37
40
|
})
|
|
@@ -39,6 +42,7 @@ export class DiscountCodeCompany {
|
|
|
39
42
|
|
|
40
43
|
@Column({
|
|
41
44
|
default: 1,
|
|
45
|
+
type: "int",
|
|
42
46
|
comment:
|
|
43
47
|
"Con esto validamos si la empresa puede usar el código una vez o varias veces:\r\n1. Una sola vez.\r\n0. Más de una vez.\r\n\r\nCon esto validamos sí tenemos qué ir a buscar a la tabla code_redemption_history_company.",
|
|
44
48
|
})
|
|
@@ -46,6 +50,8 @@ export class DiscountCodeCompany {
|
|
|
46
50
|
|
|
47
51
|
@Column({
|
|
48
52
|
nullable: true,
|
|
53
|
+
type: "int",
|
|
54
|
+
default: null,
|
|
49
55
|
comment:
|
|
50
56
|
"Validamos sí el descuento se aplica para una cantidad límite de usuarios. Entonces, no debería tener en cuenta la fecha de expiración o, si quiero agregar las 2 condicionales.",
|
|
51
57
|
})
|
|
@@ -67,6 +73,7 @@ export class DiscountCodeCompany {
|
|
|
67
73
|
@Column({
|
|
68
74
|
type: "date",
|
|
69
75
|
nullable: true,
|
|
76
|
+
default: null,
|
|
70
77
|
comment: "Fecha de expiración del registro.",
|
|
71
78
|
})
|
|
72
79
|
expiration: Date | null;
|
|
@@ -75,6 +82,7 @@ export class DiscountCodeCompany {
|
|
|
75
82
|
type: "text",
|
|
76
83
|
transformer: jsonTransformer,
|
|
77
84
|
nullable: true,
|
|
85
|
+
default: null,
|
|
78
86
|
comment:
|
|
79
87
|
"Columna de tipos JSON para agregar en un arreglo los días que se pueden repetir el descuento.",
|
|
80
88
|
})
|
|
@@ -89,6 +97,8 @@ export class DiscountCodeCompany {
|
|
|
89
97
|
|
|
90
98
|
@Column({
|
|
91
99
|
default: 1,
|
|
100
|
+
type: "int",
|
|
101
|
+
width: 1,
|
|
92
102
|
comment:
|
|
93
103
|
"Estado del registro, es decir: \n 1. Activo: Es visible en la plataforma. \n 0. Inactivo: No será visible en la plataforma.",
|
|
94
104
|
})
|
|
@@ -18,6 +18,7 @@ import { Partner } from "./Partner";
|
|
|
18
18
|
})
|
|
19
19
|
export class DiscountCodeUser {
|
|
20
20
|
@PrimaryGeneratedColumn({
|
|
21
|
+
type: "int",
|
|
21
22
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
22
23
|
})
|
|
23
24
|
id: number;
|
|
@@ -37,13 +38,19 @@ export class DiscountCodeUser {
|
|
|
37
38
|
@JoinColumn({ name: "local" })
|
|
38
39
|
local: Local | null;
|
|
39
40
|
|
|
40
|
-
@Column({
|
|
41
|
+
@Column({
|
|
42
|
+
length: 10,
|
|
43
|
+
type: "varchar",
|
|
44
|
+
comment: "Código del descuento para compartirlo.",
|
|
45
|
+
})
|
|
41
46
|
code: string;
|
|
42
47
|
|
|
43
|
-
@Column({ length: 10, comment: "Descuento que se aplica." })
|
|
48
|
+
@Column({ length: 10, type: "varchar", comment: "Descuento que se aplica." })
|
|
44
49
|
discount: string;
|
|
45
50
|
|
|
46
51
|
@Column({
|
|
52
|
+
type: "int",
|
|
53
|
+
width: 1,
|
|
47
54
|
comment:
|
|
48
55
|
"Campo para el tipo de descuento: \r\n1. Porcentaje.\r\n2. Valor en moneda.",
|
|
49
56
|
})
|
|
@@ -51,6 +58,8 @@ export class DiscountCodeUser {
|
|
|
51
58
|
|
|
52
59
|
@Column({
|
|
53
60
|
default: 1,
|
|
61
|
+
type: "int",
|
|
62
|
+
width: 1,
|
|
54
63
|
comment:
|
|
55
64
|
"Con esto validamos si la empresa puede usar el código una vez o varias veces:\r\n1. Una sola vez.\r\n0. Más de una vez.\r\n\r\nCon esto validamos sí tenemos que ir a buscar a la tabla code_redemption_history_user",
|
|
56
65
|
})
|
|
@@ -58,6 +67,8 @@ export class DiscountCodeUser {
|
|
|
58
67
|
|
|
59
68
|
@Column({
|
|
60
69
|
nullable: true,
|
|
70
|
+
default: null,
|
|
71
|
+
type: "int",
|
|
61
72
|
comment:
|
|
62
73
|
"Validamos sí el descuento se aplica para una cantidad límite de usuarios. Entonces, no debería tener en cuenta la fecha de expiración o, si quiero agregar las 2 condicionales.",
|
|
63
74
|
})
|
|
@@ -79,6 +90,7 @@ export class DiscountCodeUser {
|
|
|
79
90
|
@Column({
|
|
80
91
|
type: "date",
|
|
81
92
|
nullable: true,
|
|
93
|
+
default: null,
|
|
82
94
|
comment: "Fecha de expiración del registro.",
|
|
83
95
|
})
|
|
84
96
|
expiration: Date | null;
|
|
@@ -87,6 +99,7 @@ export class DiscountCodeUser {
|
|
|
87
99
|
type: "text",
|
|
88
100
|
transformer: jsonTransformer,
|
|
89
101
|
nullable: true,
|
|
102
|
+
default: null,
|
|
90
103
|
comment:
|
|
91
104
|
"Columna de tipos JSON para agregar en un arreglo los días que se pueden repetir el descuento.",
|
|
92
105
|
})
|
|
@@ -108,6 +121,8 @@ export class DiscountCodeUser {
|
|
|
108
121
|
|
|
109
122
|
@Column({
|
|
110
123
|
default: 1,
|
|
124
|
+
type: "int",
|
|
125
|
+
width: 1,
|
|
111
126
|
comment:
|
|
112
127
|
"Estado del registro, es decir: \n 1. Activo: Es visible en la plataforma. \n 0. Inactivo: No será visible en la plataforma.",
|
|
113
128
|
})
|
package/src/entities/Local.ts
CHANGED
|
@@ -8,13 +8,8 @@ import {
|
|
|
8
8
|
OneToMany,
|
|
9
9
|
PrimaryGeneratedColumn,
|
|
10
10
|
} from "typeorm";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
LocalPlan,
|
|
14
|
-
PosSystem,
|
|
15
|
-
Request,
|
|
16
|
-
RequestLocal,
|
|
17
|
-
} from "..";
|
|
11
|
+
import { DiscountCodeUser, LocalPlan, PosSystem, RequestLocal } from "..";
|
|
12
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
18
13
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
19
14
|
import { BusinessTypeProduct } from "./BusinessTypeProduct";
|
|
20
15
|
import { Category } from "./Category";
|
|
@@ -25,11 +20,11 @@ import { Partner } from "./Partner";
|
|
|
25
20
|
import { PaymentMethod } from "./PaymentMethod";
|
|
26
21
|
import { Square } from "./Square";
|
|
27
22
|
import { User } from "./User";
|
|
28
|
-
import { DateTransformer } from "../transformers/dateTransformer";
|
|
29
23
|
|
|
30
24
|
@Entity({ comment: "Locales disponibles de las empresas (company)." })
|
|
31
25
|
export class Local {
|
|
32
26
|
@PrimaryGeneratedColumn({
|
|
27
|
+
type: "int",
|
|
33
28
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
34
29
|
})
|
|
35
30
|
id: number;
|
|
@@ -41,7 +36,7 @@ export class Local {
|
|
|
41
36
|
@JoinColumn({ name: "company" })
|
|
42
37
|
company: Company;
|
|
43
38
|
|
|
44
|
-
@Column({ length: 100 })
|
|
39
|
+
@Column({ type: "varchar", length: 100 })
|
|
45
40
|
name: string;
|
|
46
41
|
|
|
47
42
|
@ManyToOne(() => City, (city) => city.locals, {
|
|
@@ -51,7 +46,7 @@ export class Local {
|
|
|
51
46
|
@JoinColumn({ name: "city" })
|
|
52
47
|
city: City;
|
|
53
48
|
|
|
54
|
-
@Column({ length: 120 })
|
|
49
|
+
@Column({ type: "varchar", length: 120 })
|
|
55
50
|
address: string;
|
|
56
51
|
|
|
57
52
|
@Column({ type: "decimal", precision: 10, scale: 8 })
|
|
@@ -63,6 +58,7 @@ export class Local {
|
|
|
63
58
|
@Column({
|
|
64
59
|
type: "longtext",
|
|
65
60
|
nullable: true,
|
|
61
|
+
default: null,
|
|
66
62
|
transformer: jsonTransformer,
|
|
67
63
|
comment:
|
|
68
64
|
"Campo de tipo JSON por si es necesario agregar información adicional",
|
|
@@ -99,14 +95,17 @@ export class Local {
|
|
|
99
95
|
@Column({
|
|
100
96
|
type: "text",
|
|
101
97
|
nullable: true,
|
|
98
|
+
default: null,
|
|
102
99
|
transformer: jsonTransformer,
|
|
103
100
|
comment:
|
|
104
101
|
"Campo de tipo JSON por si es necesario agregar información adicional",
|
|
105
102
|
})
|
|
106
|
-
pos_system_settings:
|
|
103
|
+
pos_system_settings: any | null;
|
|
107
104
|
|
|
108
105
|
@Column({
|
|
109
106
|
default: 1,
|
|
107
|
+
type: "int",
|
|
108
|
+
width: 1,
|
|
110
109
|
comment:
|
|
111
110
|
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
112
111
|
})
|
|
@@ -114,6 +113,8 @@ export class Local {
|
|
|
114
113
|
|
|
115
114
|
@Column({
|
|
116
115
|
default: 1,
|
|
116
|
+
type: "int",
|
|
117
|
+
width: 1,
|
|
117
118
|
comment: "Es el estado para verificar si se envía en la papelera o no.",
|
|
118
119
|
})
|
|
119
120
|
visible: number;
|
|
@@ -15,6 +15,7 @@ import { DateTransformer } from "../transformers/dateTransformer";
|
|
|
15
15
|
})
|
|
16
16
|
export class LocalPlan {
|
|
17
17
|
@PrimaryGeneratedColumn({
|
|
18
|
+
type: "int",
|
|
18
19
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
19
20
|
})
|
|
20
21
|
id: number;
|
|
@@ -35,12 +36,17 @@ export class LocalPlan {
|
|
|
35
36
|
|
|
36
37
|
@Column({
|
|
37
38
|
default: 0,
|
|
39
|
+
type: "int",
|
|
40
|
+
width: 1,
|
|
38
41
|
comment:
|
|
39
42
|
"Valor de tipo numérico para saber sí el local tiene el plan mensual o anual:\n\n 1. Mensual. \n\n2. Anual.",
|
|
40
43
|
})
|
|
41
44
|
type: number;
|
|
42
45
|
|
|
43
46
|
@Column({
|
|
47
|
+
type: "decimal",
|
|
48
|
+
precision: 10,
|
|
49
|
+
scale: 2,
|
|
44
50
|
comment: "Precio por el plan del local.",
|
|
45
51
|
})
|
|
46
52
|
price: number;
|
|
@@ -48,6 +54,7 @@ export class LocalPlan {
|
|
|
48
54
|
@Column({
|
|
49
55
|
type: "mediumtext",
|
|
50
56
|
nullable: true,
|
|
57
|
+
default: null,
|
|
51
58
|
transformer: jsonTransformer,
|
|
52
59
|
comment:
|
|
53
60
|
"Por si necesitamos agregar más elementos a la tabla. \n\nEsto se comporta como un Objeto guardado en la columna.",
|
|
@@ -70,6 +77,8 @@ export class LocalPlan {
|
|
|
70
77
|
|
|
71
78
|
@Column({
|
|
72
79
|
default: 1,
|
|
80
|
+
type: "int",
|
|
81
|
+
width: 1,
|
|
73
82
|
comment:
|
|
74
83
|
"¿El master tiene acceso a la plataforma?:\r\n1. Activo: El master tiene acceso.\r\n0. Inactivo: El master no tiene acceso a la plataforma.",
|
|
75
84
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
|
2
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
2
3
|
import { Local } from "./Local";
|
|
3
4
|
import { User } from "./User";
|
|
4
|
-
import { DateTransformer } from "../transformers/dateTransformer";
|
|
5
5
|
|
|
6
6
|
@Entity("local_qualification", {
|
|
7
7
|
comment:
|
|
@@ -9,11 +9,14 @@ import { DateTransformer } from "../transformers/dateTransformer";
|
|
|
9
9
|
})
|
|
10
10
|
export class LocalQualification {
|
|
11
11
|
@PrimaryColumn({
|
|
12
|
+
type: "int",
|
|
12
13
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
13
14
|
})
|
|
14
15
|
id: number;
|
|
15
16
|
|
|
16
17
|
@Column({
|
|
18
|
+
type: "int",
|
|
19
|
+
width: 5,
|
|
17
20
|
comment:
|
|
18
21
|
"Calificación que tiene el local.\r\n1. Mínimo: Mal servicio.\r\n5. Máximo: Excelente servicio\r\n\r\nLa calificación se evalúa haciéndole 3 o 4 preguntas al usuario:\r\n1. Qué tal fue el servicio a la hora de realizar el pedido.\r\n......",
|
|
19
22
|
})
|