test-entity-library-asm 2.5.1 → 2.5.3

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.
@@ -37,11 +37,12 @@ export { TerminalSession } from './entities/TerminalSession';
37
37
  export { TypeMeasureIngredient } from './entities/TypeMeasureIngredient';
38
38
  export { User } from './entities/User';
39
39
  export { UserAddress } from './entities/UserAddress';
40
- export { LocalsCompany } from './views/LocalsCompany';
41
40
  export { BusinessType } from './entities/BusinessType';
42
41
  export { AuthenticationCredential } from './entities/AuthenticationCredential';
43
42
  export { PosSystem } from './entities/PosSystem';
44
43
  export { VerifyLocal } from './entities/VerifyLocal';
45
44
  export { MasterNotification } from './entities/MasterNotification';
45
+ export { LocalsCompany } from './views/LocalsCompany';
46
+ export { VerifyLocals } from './views/VerifyLocals';
46
47
  export { CustomRepository } from './CustomRepository';
47
48
  export * from './utils';
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.CustomRepository = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.LocalsCompany = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.TerminalSession = exports.Terminal = exports.Square = exports.RequestStatus = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
17
+ exports.CustomRepository = exports.VerifyLocals = exports.LocalsCompany = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.TerminalSession = exports.Terminal = exports.Square = exports.RequestStatus = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
18
18
  var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
19
19
  Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
20
20
  var Category_1 = require("./entities/Category");
@@ -93,8 +93,6 @@ var User_1 = require("./entities/User");
93
93
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
94
94
  var UserAddress_1 = require("./entities/UserAddress");
95
95
  Object.defineProperty(exports, "UserAddress", { enumerable: true, get: function () { return UserAddress_1.UserAddress; } });
96
- var LocalsCompany_1 = require("./views/LocalsCompany");
97
- Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
98
96
  var BusinessType_1 = require("./entities/BusinessType");
99
97
  Object.defineProperty(exports, "BusinessType", { enumerable: true, get: function () { return BusinessType_1.BusinessType; } });
100
98
  var AuthenticationCredential_1 = require("./entities/AuthenticationCredential");
@@ -105,6 +103,10 @@ var VerifyLocal_1 = require("./entities/VerifyLocal");
105
103
  Object.defineProperty(exports, "VerifyLocal", { enumerable: true, get: function () { return VerifyLocal_1.VerifyLocal; } });
106
104
  var MasterNotification_1 = require("./entities/MasterNotification");
107
105
  Object.defineProperty(exports, "MasterNotification", { enumerable: true, get: function () { return MasterNotification_1.MasterNotification; } });
106
+ var LocalsCompany_1 = require("./views/LocalsCompany");
107
+ Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
108
+ var VerifyLocals_1 = require("./views/VerifyLocals");
109
+ Object.defineProperty(exports, "VerifyLocals", { enumerable: true, get: function () { return VerifyLocals_1.VerifyLocals; } });
108
110
  var CustomRepository_1 = require("./CustomRepository");
109
111
  Object.defineProperty(exports, "CustomRepository", { enumerable: true, get: function () { return CustomRepository_1.CustomRepository; } });
110
112
  __exportStar(require("./utils"), exports);
@@ -0,0 +1,18 @@
1
+ export declare class VerifyLocals {
2
+ id: number;
3
+ local_information: any;
4
+ basic_information: any;
5
+ settings: any;
6
+ opening_hours: any;
7
+ terminal_users: any;
8
+ terminals: any;
9
+ details: any;
10
+ created: string;
11
+ verification_date: string;
12
+ update_partner: string;
13
+ status: number;
14
+ master_notification_id: number;
15
+ master_notification_settings: any;
16
+ partner_notification_id: number;
17
+ partner_notification_settings: any;
18
+ }
@@ -0,0 +1,103 @@
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.VerifyLocals = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var moment = require("moment-timezone");
15
+ var __1 = require("..");
16
+ // JSON Transformer
17
+ var jsonTransformer = {
18
+ to: function (value) { return JSON.stringify(value); },
19
+ from: function (value) { return JSON.parse(value); },
20
+ };
21
+ var DateTransformer = {
22
+ to: function (value) {
23
+ return moment.utc(value).format('YYYY-MM-DD HH:mm:ss');
24
+ },
25
+ from: function (value) {
26
+ return moment.utc(value).tz((0, __1.getTimeZone)()).format('YYYY-MM-DD HH:mm:ss');
27
+ },
28
+ };
29
+ var VerifyLocals = /** @class */ (function () {
30
+ function VerifyLocals() {
31
+ }
32
+ __decorate([
33
+ (0, typeorm_1.ViewColumn)(),
34
+ __metadata("design:type", Number)
35
+ ], VerifyLocals.prototype, "id", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
38
+ __metadata("design:type", Object)
39
+ ], VerifyLocals.prototype, "local_information", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
42
+ __metadata("design:type", Object)
43
+ ], VerifyLocals.prototype, "basic_information", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
46
+ __metadata("design:type", Object)
47
+ ], VerifyLocals.prototype, "settings", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
50
+ __metadata("design:type", Object)
51
+ ], VerifyLocals.prototype, "opening_hours", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
54
+ __metadata("design:type", Object)
55
+ ], VerifyLocals.prototype, "terminal_users", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
58
+ __metadata("design:type", Object)
59
+ ], VerifyLocals.prototype, "terminals", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
62
+ __metadata("design:type", Object)
63
+ ], VerifyLocals.prototype, "details", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.ViewColumn)({ transformer: DateTransformer }),
66
+ __metadata("design:type", String)
67
+ ], VerifyLocals.prototype, "created", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.ViewColumn)({ transformer: DateTransformer }),
70
+ __metadata("design:type", String)
71
+ ], VerifyLocals.prototype, "verification_date", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.ViewColumn)({ transformer: DateTransformer }),
74
+ __metadata("design:type", String)
75
+ ], VerifyLocals.prototype, "update_partner", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.ViewColumn)(),
78
+ __metadata("design:type", Number)
79
+ ], VerifyLocals.prototype, "status", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.ViewColumn)(),
82
+ __metadata("design:type", Number)
83
+ ], VerifyLocals.prototype, "master_notification_id", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
86
+ __metadata("design:type", Object)
87
+ ], VerifyLocals.prototype, "master_notification_settings", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.ViewColumn)(),
90
+ __metadata("design:type", Number)
91
+ ], VerifyLocals.prototype, "partner_notification_id", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
94
+ __metadata("design:type", Object)
95
+ ], VerifyLocals.prototype, "partner_notification_settings", void 0);
96
+ VerifyLocals = __decorate([
97
+ (0, typeorm_1.ViewEntity)({
98
+ name: 'verify_locals',
99
+ })
100
+ ], VerifyLocals);
101
+ return VerifyLocals;
102
+ }());
103
+ exports.VerifyLocals = VerifyLocals;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,12 +37,14 @@ export { TerminalSession } from './entities/TerminalSession'
37
37
  export { TypeMeasureIngredient } from './entities/TypeMeasureIngredient'
38
38
  export { User } from './entities/User'
39
39
  export { UserAddress } from './entities/UserAddress'
40
- export { LocalsCompany } from './views/LocalsCompany'
41
40
  export { BusinessType } from './entities/BusinessType'
42
41
  export { AuthenticationCredential } from './entities/AuthenticationCredential'
43
42
  export { PosSystem } from './entities/PosSystem'
44
43
  export { VerifyLocal } from './entities/VerifyLocal'
45
44
  export { MasterNotification } from './entities/MasterNotification'
46
45
 
46
+ export { LocalsCompany } from './views/LocalsCompany'
47
+ export { VerifyLocals } from './views/VerifyLocals'
48
+
47
49
  export { CustomRepository } from './CustomRepository'
48
50
  export * from './utils'
@@ -0,0 +1,77 @@
1
+ import { ViewEntity, ViewColumn } from 'typeorm'
2
+ import moment = require('moment-timezone')
3
+ import { getTimeZone } from '..'
4
+
5
+ // JSON Transformer
6
+ const jsonTransformer = {
7
+ to: (value: any) => JSON.stringify(value),
8
+ from: (value: string) => JSON.parse(value),
9
+ }
10
+
11
+ const DateTransformer = {
12
+ to(value: Date | string): string {
13
+ return moment.utc(value).format('YYYY-MM-DD HH:mm:ss')
14
+ },
15
+ from(value: string): string {
16
+ return moment.utc(value).tz(getTimeZone()).format('YYYY-MM-DD HH:mm:ss')
17
+ },
18
+ }
19
+
20
+ @ViewEntity({
21
+ name: 'verify_locals',
22
+ })
23
+ export class VerifyLocals {
24
+ @ViewColumn()
25
+ id: number
26
+
27
+ @ViewColumn({ transformer: jsonTransformer })
28
+ local_information: any
29
+
30
+ @ViewColumn({ transformer: jsonTransformer })
31
+ basic_information: any
32
+
33
+ @ViewColumn()
34
+ partner: number
35
+
36
+ @ViewColumn()
37
+ assigned_master: number
38
+
39
+ @ViewColumn({ transformer: jsonTransformer })
40
+ settings: any
41
+
42
+ @ViewColumn({ transformer: jsonTransformer })
43
+ opening_hours: any
44
+
45
+ @ViewColumn({ transformer: jsonTransformer })
46
+ terminal_users: any
47
+
48
+ @ViewColumn({ transformer: jsonTransformer })
49
+ terminals: any
50
+
51
+ @ViewColumn({ transformer: jsonTransformer })
52
+ details: any
53
+
54
+ @ViewColumn({ transformer: DateTransformer })
55
+ created: string
56
+
57
+ @ViewColumn({ transformer: DateTransformer })
58
+ verification_date: string
59
+
60
+ @ViewColumn({ transformer: DateTransformer })
61
+ update_partner: string
62
+
63
+ @ViewColumn()
64
+ status: number
65
+
66
+ @ViewColumn()
67
+ master_notification_id: number
68
+
69
+ @ViewColumn({ transformer: jsonTransformer })
70
+ master_notification_settings: any
71
+
72
+ @ViewColumn()
73
+ partner_notification_id: number
74
+
75
+ @ViewColumn({ transformer: jsonTransformer })
76
+ partner_notification_settings: any
77
+ }