test-entity-library-asm 3.5.4 → 3.5.6
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/CustomRepository.d.ts +6 -2
- package/dist/CustomRepository.js +15 -8
- package/dist/entities/Company.d.ts +2 -2
- package/dist/entities.views.routes.d.ts +6 -0
- package/dist/entities.views.routes.js +13 -1
- package/dist/filters/LocalReservesInformation.d.ts +6 -0
- package/dist/filters/LocalReservesInformation.js +85 -0
- package/dist/filters/VerifyLocalsInformation.d.ts +2 -2
- package/dist/interfaces.d.ts +9 -2
- package/dist/views/LocalReserves.d.ts +61 -0
- package/dist/views/LocalReserves.js +283 -0
- package/package.json +1 -1
- package/src/CustomRepository.ts +16 -7
- package/src/entities/Company.ts +2 -2
- package/src/entities.views.routes.ts +7 -0
- package/src/filters/LocalReservesInformation.ts +51 -0
- package/src/filters/VerifyLocalsInformation.ts +7 -2
- package/src/interfaces.ts +11 -2
- package/src/views/LocalReserves.ts +207 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataSource, EntityTarget, ObjectLiteral, Repository } from "typeorm";
|
|
2
|
-
import { IBasicCompany, IBasicLazyEvent, IPropsDiscountUserOrCompany,
|
|
2
|
+
import { IBasicCompany, IBasicLazyEvent, IPropsDiscountUserOrCompany, IPropsLocalReserve, IPropsQueryVerifyLocalInformation } from "./interfaces";
|
|
3
3
|
export declare class CustomRepository<T extends ObjectLiteral> extends Repository<T> {
|
|
4
4
|
constructor(target: EntityTarget<T>, dataSource: DataSource);
|
|
5
5
|
getDiscountsCodeUserWrapper(params: IPropsDiscountUserOrCompany): Promise<{
|
|
@@ -14,7 +14,11 @@ export declare class CustomRepository<T extends ObjectLiteral> extends Repositor
|
|
|
14
14
|
data: any[];
|
|
15
15
|
totalRecords: number;
|
|
16
16
|
}>;
|
|
17
|
-
getVerifyLocalsInformationWrapper(params:
|
|
17
|
+
getVerifyLocalsInformationWrapper(params: IPropsQueryVerifyLocalInformation): Promise<{
|
|
18
|
+
data: any[];
|
|
19
|
+
totalRecords: number;
|
|
20
|
+
}>;
|
|
21
|
+
getLocalReservesInformationWrapper(params: IPropsLocalReserve): Promise<{
|
|
18
22
|
data: any[];
|
|
19
23
|
totalRecords: number;
|
|
20
24
|
}>;
|
package/dist/CustomRepository.js
CHANGED
|
@@ -53,10 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
54
|
exports.CustomRepository = void 0;
|
|
55
55
|
var typeorm_1 = require("typeorm");
|
|
56
|
-
var
|
|
57
|
-
var DiscountsCodeUserInformation_1 = require("./filters/DiscountsCodeUserInformation");
|
|
58
|
-
var LocalsCompanyInformation_1 = require("./filters/LocalsCompanyInformation");
|
|
59
|
-
var VerifyLocalsInformation_1 = require("./filters/VerifyLocalsInformation");
|
|
56
|
+
var _1 = require(".");
|
|
60
57
|
var CustomRepository = /** @class */ (function (_super) {
|
|
61
58
|
__extends(CustomRepository, _super);
|
|
62
59
|
function CustomRepository(target, dataSource) {
|
|
@@ -66,7 +63,7 @@ var CustomRepository = /** @class */ (function (_super) {
|
|
|
66
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
67
64
|
return __generator(this, function (_a) {
|
|
68
65
|
switch (_a.label) {
|
|
69
|
-
case 0: return [4 /*yield*/, (0,
|
|
66
|
+
case 0: return [4 /*yield*/, (0, _1.getDiscountsCodeUserInformation)(this, params)];
|
|
70
67
|
case 1: return [2 /*return*/, _a.sent()];
|
|
71
68
|
}
|
|
72
69
|
});
|
|
@@ -76,7 +73,7 @@ var CustomRepository = /** @class */ (function (_super) {
|
|
|
76
73
|
return __awaiter(this, void 0, void 0, function () {
|
|
77
74
|
return __generator(this, function (_a) {
|
|
78
75
|
switch (_a.label) {
|
|
79
|
-
case 0: return [4 /*yield*/, (0,
|
|
76
|
+
case 0: return [4 /*yield*/, (0, _1.getDiscountsCodeCompanyInformation)(this, params)];
|
|
80
77
|
case 1: return [2 /*return*/, _a.sent()];
|
|
81
78
|
}
|
|
82
79
|
});
|
|
@@ -86,7 +83,7 @@ var CustomRepository = /** @class */ (function (_super) {
|
|
|
86
83
|
return __awaiter(this, void 0, void 0, function () {
|
|
87
84
|
return __generator(this, function (_a) {
|
|
88
85
|
switch (_a.label) {
|
|
89
|
-
case 0: return [4 /*yield*/, (0,
|
|
86
|
+
case 0: return [4 /*yield*/, (0, _1.getLocalsCompanyInformation)(this, params)];
|
|
90
87
|
case 1: return [2 /*return*/, _a.sent()];
|
|
91
88
|
}
|
|
92
89
|
});
|
|
@@ -96,7 +93,17 @@ var CustomRepository = /** @class */ (function (_super) {
|
|
|
96
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
97
94
|
return __generator(this, function (_a) {
|
|
98
95
|
switch (_a.label) {
|
|
99
|
-
case 0: return [4 /*yield*/, (0,
|
|
96
|
+
case 0: return [4 /*yield*/, (0, _1.getVerifyLocalsInformation)(this, params)];
|
|
97
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
CustomRepository.prototype.getLocalReservesInformationWrapper = function (params) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
104
|
+
return __generator(this, function (_a) {
|
|
105
|
+
switch (_a.label) {
|
|
106
|
+
case 0: return [4 /*yield*/, (0, _1.getLocalReservesInformation)(this, params)];
|
|
100
107
|
case 1: return [2 /*return*/, _a.sent()];
|
|
101
108
|
}
|
|
102
109
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IPropsContactDetail } from "../interfaces";
|
|
2
2
|
import { City } from "./City";
|
|
3
3
|
import { CodeRedemptionHistoryCompany } from "./CodeRedemptionHistoryCompany";
|
|
4
4
|
import { DiscountCodeUser } from "./DiscountCodeUser";
|
|
@@ -15,7 +15,7 @@ export declare class Company {
|
|
|
15
15
|
city: City;
|
|
16
16
|
partner: Partner;
|
|
17
17
|
profile: any | null;
|
|
18
|
-
contact_details:
|
|
18
|
+
contact_details: IPropsContactDetail | null;
|
|
19
19
|
legal_information: any | null;
|
|
20
20
|
legal_agent: any | null;
|
|
21
21
|
settings: any | null;
|
|
@@ -69,5 +69,11 @@ export { Partners } from "./views/Partners";
|
|
|
69
69
|
export { DiscountsCodeUser } from "./views/DiscountsCodeUser";
|
|
70
70
|
export { PartnerNotifications } from "./views/PartnerNotifications";
|
|
71
71
|
export { LocalTableZonesFilter } from "./views/LocalTableZonesFilter";
|
|
72
|
+
export { LocalReserves } from "./views/LocalReserves";
|
|
73
|
+
export { getDiscountsCodeCompanyInformation } from "./filters/DiscountsCodeCompanyInformation";
|
|
74
|
+
export { getDiscountsCodeUserInformation } from "./filters/DiscountsCodeUserInformation";
|
|
75
|
+
export { getLocalsCompanyInformation } from "./filters/LocalsCompanyInformation";
|
|
76
|
+
export { getVerifyLocalsInformation } from "./filters/VerifyLocalsInformation";
|
|
77
|
+
export { getLocalReservesInformation } from "./filters/LocalReservesInformation";
|
|
72
78
|
export { CustomRepository } from "./CustomRepository";
|
|
73
79
|
export * from "./utils";
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.ToppingImage = exports.ProductDate = exports.ProductSchedule = exports.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPermissionSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.Square = 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
|
-
exports.CustomRepository = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.LocalReserve = exports.LocalTableReservePayment = exports.DecorationReserve = exports.LocalDecorationReserve = exports.LocalTable = exports.LocalTableZone = exports.RequestPrint = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = void 0;
|
|
18
|
+
exports.CustomRepository = exports.getLocalReservesInformation = exports.getVerifyLocalsInformation = exports.getLocalsCompanyInformation = exports.getDiscountsCodeUserInformation = exports.getDiscountsCodeCompanyInformation = exports.LocalReserves = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.LocalReserve = exports.LocalTableReservePayment = exports.DecorationReserve = exports.LocalDecorationReserve = exports.LocalTable = exports.LocalTableZone = exports.RequestPrint = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = void 0;
|
|
19
19
|
var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
|
|
20
20
|
Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
|
|
21
21
|
var Category_1 = require("./entities/Category");
|
|
@@ -158,6 +158,18 @@ var PartnerNotifications_1 = require("./views/PartnerNotifications");
|
|
|
158
158
|
Object.defineProperty(exports, "PartnerNotifications", { enumerable: true, get: function () { return PartnerNotifications_1.PartnerNotifications; } });
|
|
159
159
|
var LocalTableZonesFilter_1 = require("./views/LocalTableZonesFilter");
|
|
160
160
|
Object.defineProperty(exports, "LocalTableZonesFilter", { enumerable: true, get: function () { return LocalTableZonesFilter_1.LocalTableZonesFilter; } });
|
|
161
|
+
var LocalReserves_1 = require("./views/LocalReserves");
|
|
162
|
+
Object.defineProperty(exports, "LocalReserves", { enumerable: true, get: function () { return LocalReserves_1.LocalReserves; } });
|
|
163
|
+
var DiscountsCodeCompanyInformation_1 = require("./filters/DiscountsCodeCompanyInformation");
|
|
164
|
+
Object.defineProperty(exports, "getDiscountsCodeCompanyInformation", { enumerable: true, get: function () { return DiscountsCodeCompanyInformation_1.getDiscountsCodeCompanyInformation; } });
|
|
165
|
+
var DiscountsCodeUserInformation_1 = require("./filters/DiscountsCodeUserInformation");
|
|
166
|
+
Object.defineProperty(exports, "getDiscountsCodeUserInformation", { enumerable: true, get: function () { return DiscountsCodeUserInformation_1.getDiscountsCodeUserInformation; } });
|
|
167
|
+
var LocalsCompanyInformation_1 = require("./filters/LocalsCompanyInformation");
|
|
168
|
+
Object.defineProperty(exports, "getLocalsCompanyInformation", { enumerable: true, get: function () { return LocalsCompanyInformation_1.getLocalsCompanyInformation; } });
|
|
169
|
+
var VerifyLocalsInformation_1 = require("./filters/VerifyLocalsInformation");
|
|
170
|
+
Object.defineProperty(exports, "getVerifyLocalsInformation", { enumerable: true, get: function () { return VerifyLocalsInformation_1.getVerifyLocalsInformation; } });
|
|
171
|
+
var LocalReservesInformation_1 = require("./filters/LocalReservesInformation");
|
|
172
|
+
Object.defineProperty(exports, "getLocalReservesInformation", { enumerable: true, get: function () { return LocalReservesInformation_1.getLocalReservesInformation; } });
|
|
161
173
|
var CustomRepository_1 = require("./CustomRepository");
|
|
162
174
|
Object.defineProperty(exports, "CustomRepository", { enumerable: true, get: function () { return CustomRepository_1.CustomRepository; } });
|
|
163
175
|
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Repository } from "typeorm";
|
|
2
|
+
import { IPropsLocalReserve } from "../interfaces";
|
|
3
|
+
export declare function getLocalReservesInformation(repository: Repository<any>, { globalFilter, date, status, zone, local }: IPropsLocalReserve): Promise<{
|
|
4
|
+
data: any[];
|
|
5
|
+
totalRecords: number;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getLocalReservesInformation = void 0;
|
|
40
|
+
function getLocalReservesInformation(repository_1, _a) {
|
|
41
|
+
return __awaiter(this, arguments, void 0, function (repository, _b) {
|
|
42
|
+
var queryBuilder, globalValue, _c, discountsCodeUser, totalRecords, error_1;
|
|
43
|
+
var globalFilter = _b.globalFilter, date = _b.date, status = _b.status, zone = _b.zone, local = _b.local;
|
|
44
|
+
return __generator(this, function (_d) {
|
|
45
|
+
switch (_d.label) {
|
|
46
|
+
case 0:
|
|
47
|
+
_d.trys.push([0, 2, , 3]);
|
|
48
|
+
queryBuilder = repository.createQueryBuilder("local_reserves");
|
|
49
|
+
if (globalFilter) {
|
|
50
|
+
globalValue = "%".concat(globalFilter.toLowerCase(), "%");
|
|
51
|
+
queryBuilder.andWhere("(LOWER(local_reserves.code) LIKE :globalValue OR local_reserves.user_document LIKE :globalValue OR LOWER(local_reserves.user_name) LIKE :globalValue OR local_reserves.user_phone LIKE :globalValue OR LOWER(local_reserves.user_email) LIKE :globalValue", { globalValue: globalValue });
|
|
52
|
+
}
|
|
53
|
+
if (date) {
|
|
54
|
+
queryBuilder.andWhere("local_reserves.date = :date", { date: date });
|
|
55
|
+
}
|
|
56
|
+
if (status) {
|
|
57
|
+
queryBuilder.andWhere("local_reserves.status = :status", { status: status });
|
|
58
|
+
}
|
|
59
|
+
if (local) {
|
|
60
|
+
queryBuilder.andWhere("local_reserves.local_table_zone_local = :local", {
|
|
61
|
+
local: local,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (zone) {
|
|
65
|
+
queryBuilder.andWhere("local_reserves.zone = :zone", { zone: zone });
|
|
66
|
+
}
|
|
67
|
+
return [4 /*yield*/, queryBuilder.getManyAndCount()];
|
|
68
|
+
case 1:
|
|
69
|
+
_c = _d.sent(), discountsCodeUser = _c[0], totalRecords = _c[1];
|
|
70
|
+
return [2 /*return*/, {
|
|
71
|
+
data: discountsCodeUser,
|
|
72
|
+
totalRecords: totalRecords,
|
|
73
|
+
}];
|
|
74
|
+
case 2:
|
|
75
|
+
error_1 = _d.sent();
|
|
76
|
+
return [2 /*return*/, {
|
|
77
|
+
data: [],
|
|
78
|
+
totalRecords: 0,
|
|
79
|
+
}];
|
|
80
|
+
case 3: return [2 /*return*/];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
exports.getLocalReservesInformation = getLocalReservesInformation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Repository } from "typeorm";
|
|
2
|
-
import {
|
|
3
|
-
export declare function getVerifyLocalsInformation(repository: Repository<any>, { status, lazyEvent, partner, assigned_master }:
|
|
2
|
+
import { IPropsQueryVerifyLocalInformation } from "../interfaces";
|
|
3
|
+
export declare function getVerifyLocalsInformation(repository: Repository<any>, { status, lazyEvent, partner, assigned_master, }: IPropsQueryVerifyLocalInformation): Promise<{
|
|
4
4
|
data: any[];
|
|
5
5
|
totalRecords: number;
|
|
6
6
|
}>;
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface IBasicCompany extends IBasicLazyEvent {
|
|
|
29
29
|
visible?: number | null;
|
|
30
30
|
owner?: number | null;
|
|
31
31
|
}
|
|
32
|
-
export interface
|
|
32
|
+
export interface IPropsQueryVerifyLocalInformation extends IPropsQueryVerifyLocal {
|
|
33
33
|
partner: number | null;
|
|
34
34
|
assigned_master: number | null;
|
|
35
35
|
}
|
|
@@ -48,7 +48,7 @@ export interface IPropsDiscountUserOrCompany extends IBasicLazyEvent {
|
|
|
48
48
|
company: number | null;
|
|
49
49
|
status: number | null;
|
|
50
50
|
}
|
|
51
|
-
export interface
|
|
51
|
+
export interface IPropsContactDetail {
|
|
52
52
|
phone: string;
|
|
53
53
|
email: string;
|
|
54
54
|
new_phone: string;
|
|
@@ -57,4 +57,11 @@ export interface IPropsContactDetails {
|
|
|
57
57
|
export interface IPropsLoginTerminalPartner {
|
|
58
58
|
user: string;
|
|
59
59
|
}
|
|
60
|
+
export interface IPropsLocalReserve {
|
|
61
|
+
globalFilter: string | null;
|
|
62
|
+
date: string | null;
|
|
63
|
+
zone: number | null;
|
|
64
|
+
status: number | null;
|
|
65
|
+
local: number | null;
|
|
66
|
+
}
|
|
60
67
|
export type IType = "mysql" | "mariadb";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare class LocalReserves {
|
|
2
|
+
id: number;
|
|
3
|
+
code: string;
|
|
4
|
+
zone: number;
|
|
5
|
+
user_document: string | null;
|
|
6
|
+
user_name: string;
|
|
7
|
+
user_phone: string | null;
|
|
8
|
+
user_email: string | null;
|
|
9
|
+
user: number | null;
|
|
10
|
+
date: string;
|
|
11
|
+
start_time: string;
|
|
12
|
+
end_time: string;
|
|
13
|
+
details: string | null;
|
|
14
|
+
decoration: number | null;
|
|
15
|
+
persons: number;
|
|
16
|
+
created: string;
|
|
17
|
+
updated: string | null;
|
|
18
|
+
partner: number | null;
|
|
19
|
+
status: number;
|
|
20
|
+
status_color: string;
|
|
21
|
+
status_text: string;
|
|
22
|
+
start: string | null;
|
|
23
|
+
end: string | null;
|
|
24
|
+
title: string;
|
|
25
|
+
startTimeReserve: string | null;
|
|
26
|
+
endTimeReserve: string | null;
|
|
27
|
+
local_table_zone_id: number;
|
|
28
|
+
local_table_zone_code: string;
|
|
29
|
+
local_table_zone_name: string;
|
|
30
|
+
local_table_zone_local: number | null;
|
|
31
|
+
local_table_zone_status: number;
|
|
32
|
+
local_decoration_reserve_id: number | null;
|
|
33
|
+
local_decoration_reserve_code: string | null;
|
|
34
|
+
local_decoration_reserve_name: number | null;
|
|
35
|
+
local_decoration_reserve_price: string | null;
|
|
36
|
+
local_decoration_reserve_status: number | null;
|
|
37
|
+
decoration_reserve_id: number | null;
|
|
38
|
+
decoration_reserve_name: string | null;
|
|
39
|
+
decoration_reserve_details: string | null;
|
|
40
|
+
decoration_reserve_status: number | null;
|
|
41
|
+
partner_id: number | null;
|
|
42
|
+
partner_code: string | null;
|
|
43
|
+
partner_document: string | null;
|
|
44
|
+
partner_name: string | null;
|
|
45
|
+
partner_surname: string | null;
|
|
46
|
+
partner_full_name: string | null;
|
|
47
|
+
partner_phone: string | null;
|
|
48
|
+
partner_email: string | null;
|
|
49
|
+
partner_profile: any | null;
|
|
50
|
+
partner_status: number | null;
|
|
51
|
+
user_table_id: number | null;
|
|
52
|
+
user_table_code: string | null;
|
|
53
|
+
user_table_document: string | null;
|
|
54
|
+
user_table_name: string | null;
|
|
55
|
+
user_table_surname: string | null;
|
|
56
|
+
user_table_full_name: string | null;
|
|
57
|
+
user_table_email: string | null;
|
|
58
|
+
user_table_phone: string | null;
|
|
59
|
+
user_table_profile: any | null;
|
|
60
|
+
user_table_status: number | null;
|
|
61
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
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.LocalReserves = 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) {
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(value);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.log(error, "Transformer error");
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
var DateTransformer = {
|
|
30
|
+
to: function (value) {
|
|
31
|
+
return moment.utc(value).format("YYYY-MM-DD HH:mm:ss");
|
|
32
|
+
},
|
|
33
|
+
from: function (value) {
|
|
34
|
+
return moment.utc(value).tz((0, __1.getTimeZone)()).format("YYYY-MM-DD HH:mm:ss");
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
var LocalReserves = /** @class */ (function () {
|
|
38
|
+
function LocalReserves() {
|
|
39
|
+
}
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.ViewColumn)(),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], LocalReserves.prototype, "id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.ViewColumn)(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], LocalReserves.prototype, "code", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.ViewColumn)(),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], LocalReserves.prototype, "zone", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.ViewColumn)(),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], LocalReserves.prototype, "user_document", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.ViewColumn)(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], LocalReserves.prototype, "user_name", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.ViewColumn)(),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], LocalReserves.prototype, "user_phone", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.ViewColumn)(),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], LocalReserves.prototype, "user_email", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.ViewColumn)(),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], LocalReserves.prototype, "user", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.ViewColumn)(),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], LocalReserves.prototype, "date", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.ViewColumn)(),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], LocalReserves.prototype, "start_time", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.ViewColumn)(),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], LocalReserves.prototype, "end_time", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.ViewColumn)(),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], LocalReserves.prototype, "details", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.ViewColumn)(),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], LocalReserves.prototype, "decoration", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.ViewColumn)(),
|
|
94
|
+
__metadata("design:type", Number)
|
|
95
|
+
], LocalReserves.prototype, "persons", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.ViewColumn)({ transformer: DateTransformer }),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], LocalReserves.prototype, "created", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.ViewColumn)({ transformer: DateTransformer }),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], LocalReserves.prototype, "updated", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.ViewColumn)(),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], LocalReserves.prototype, "partner", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.ViewColumn)(),
|
|
110
|
+
__metadata("design:type", Number)
|
|
111
|
+
], LocalReserves.prototype, "status", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.ViewColumn)(),
|
|
114
|
+
__metadata("design:type", String)
|
|
115
|
+
], LocalReserves.prototype, "status_color", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typeorm_1.ViewColumn)(),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], LocalReserves.prototype, "status_text", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, typeorm_1.ViewColumn)(),
|
|
122
|
+
__metadata("design:type", Object)
|
|
123
|
+
], LocalReserves.prototype, "start", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.ViewColumn)(),
|
|
126
|
+
__metadata("design:type", Object)
|
|
127
|
+
], LocalReserves.prototype, "end", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, typeorm_1.ViewColumn)(),
|
|
130
|
+
__metadata("design:type", String)
|
|
131
|
+
], LocalReserves.prototype, "title", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, typeorm_1.ViewColumn)(),
|
|
134
|
+
__metadata("design:type", Object)
|
|
135
|
+
], LocalReserves.prototype, "startTimeReserve", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, typeorm_1.ViewColumn)(),
|
|
138
|
+
__metadata("design:type", Object)
|
|
139
|
+
], LocalReserves.prototype, "endTimeReserve", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, typeorm_1.ViewColumn)(),
|
|
142
|
+
__metadata("design:type", Number)
|
|
143
|
+
], LocalReserves.prototype, "local_table_zone_id", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, typeorm_1.ViewColumn)(),
|
|
146
|
+
__metadata("design:type", String)
|
|
147
|
+
], LocalReserves.prototype, "local_table_zone_code", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, typeorm_1.ViewColumn)(),
|
|
150
|
+
__metadata("design:type", String)
|
|
151
|
+
], LocalReserves.prototype, "local_table_zone_name", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, typeorm_1.ViewColumn)(),
|
|
154
|
+
__metadata("design:type", Object)
|
|
155
|
+
], LocalReserves.prototype, "local_table_zone_local", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, typeorm_1.ViewColumn)(),
|
|
158
|
+
__metadata("design:type", Number)
|
|
159
|
+
], LocalReserves.prototype, "local_table_zone_status", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
(0, typeorm_1.ViewColumn)(),
|
|
162
|
+
__metadata("design:type", Object)
|
|
163
|
+
], LocalReserves.prototype, "local_decoration_reserve_id", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, typeorm_1.ViewColumn)(),
|
|
166
|
+
__metadata("design:type", Object)
|
|
167
|
+
], LocalReserves.prototype, "local_decoration_reserve_code", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, typeorm_1.ViewColumn)(),
|
|
170
|
+
__metadata("design:type", Object)
|
|
171
|
+
], LocalReserves.prototype, "local_decoration_reserve_name", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, typeorm_1.ViewColumn)(),
|
|
174
|
+
__metadata("design:type", Object)
|
|
175
|
+
], LocalReserves.prototype, "local_decoration_reserve_price", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
(0, typeorm_1.ViewColumn)(),
|
|
178
|
+
__metadata("design:type", Object)
|
|
179
|
+
], LocalReserves.prototype, "local_decoration_reserve_status", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, typeorm_1.ViewColumn)(),
|
|
182
|
+
__metadata("design:type", Object)
|
|
183
|
+
], LocalReserves.prototype, "decoration_reserve_id", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, typeorm_1.ViewColumn)(),
|
|
186
|
+
__metadata("design:type", Object)
|
|
187
|
+
], LocalReserves.prototype, "decoration_reserve_name", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
(0, typeorm_1.ViewColumn)(),
|
|
190
|
+
__metadata("design:type", Object)
|
|
191
|
+
], LocalReserves.prototype, "decoration_reserve_details", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, typeorm_1.ViewColumn)(),
|
|
194
|
+
__metadata("design:type", Object)
|
|
195
|
+
], LocalReserves.prototype, "decoration_reserve_status", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, typeorm_1.ViewColumn)(),
|
|
198
|
+
__metadata("design:type", Object)
|
|
199
|
+
], LocalReserves.prototype, "partner_id", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
(0, typeorm_1.ViewColumn)(),
|
|
202
|
+
__metadata("design:type", Object)
|
|
203
|
+
], LocalReserves.prototype, "partner_code", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
(0, typeorm_1.ViewColumn)(),
|
|
206
|
+
__metadata("design:type", Object)
|
|
207
|
+
], LocalReserves.prototype, "partner_document", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
(0, typeorm_1.ViewColumn)(),
|
|
210
|
+
__metadata("design:type", Object)
|
|
211
|
+
], LocalReserves.prototype, "partner_name", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, typeorm_1.ViewColumn)(),
|
|
214
|
+
__metadata("design:type", Object)
|
|
215
|
+
], LocalReserves.prototype, "partner_surname", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
(0, typeorm_1.ViewColumn)(),
|
|
218
|
+
__metadata("design:type", Object)
|
|
219
|
+
], LocalReserves.prototype, "partner_full_name", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, typeorm_1.ViewColumn)(),
|
|
222
|
+
__metadata("design:type", Object)
|
|
223
|
+
], LocalReserves.prototype, "partner_phone", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
(0, typeorm_1.ViewColumn)(),
|
|
226
|
+
__metadata("design:type", Object)
|
|
227
|
+
], LocalReserves.prototype, "partner_email", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
|
|
230
|
+
__metadata("design:type", Object)
|
|
231
|
+
], LocalReserves.prototype, "partner_profile", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
(0, typeorm_1.ViewColumn)(),
|
|
234
|
+
__metadata("design:type", Object)
|
|
235
|
+
], LocalReserves.prototype, "partner_status", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
(0, typeorm_1.ViewColumn)(),
|
|
238
|
+
__metadata("design:type", Object)
|
|
239
|
+
], LocalReserves.prototype, "user_table_id", void 0);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, typeorm_1.ViewColumn)(),
|
|
242
|
+
__metadata("design:type", Object)
|
|
243
|
+
], LocalReserves.prototype, "user_table_code", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
(0, typeorm_1.ViewColumn)(),
|
|
246
|
+
__metadata("design:type", Object)
|
|
247
|
+
], LocalReserves.prototype, "user_table_document", void 0);
|
|
248
|
+
__decorate([
|
|
249
|
+
(0, typeorm_1.ViewColumn)(),
|
|
250
|
+
__metadata("design:type", Object)
|
|
251
|
+
], LocalReserves.prototype, "user_table_name", void 0);
|
|
252
|
+
__decorate([
|
|
253
|
+
(0, typeorm_1.ViewColumn)(),
|
|
254
|
+
__metadata("design:type", Object)
|
|
255
|
+
], LocalReserves.prototype, "user_table_surname", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
(0, typeorm_1.ViewColumn)(),
|
|
258
|
+
__metadata("design:type", Object)
|
|
259
|
+
], LocalReserves.prototype, "user_table_full_name", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
(0, typeorm_1.ViewColumn)(),
|
|
262
|
+
__metadata("design:type", Object)
|
|
263
|
+
], LocalReserves.prototype, "user_table_email", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
(0, typeorm_1.ViewColumn)(),
|
|
266
|
+
__metadata("design:type", Object)
|
|
267
|
+
], LocalReserves.prototype, "user_table_phone", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
(0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
|
|
270
|
+
__metadata("design:type", Object)
|
|
271
|
+
], LocalReserves.prototype, "user_table_profile", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
(0, typeorm_1.ViewColumn)(),
|
|
274
|
+
__metadata("design:type", Object)
|
|
275
|
+
], LocalReserves.prototype, "user_table_status", void 0);
|
|
276
|
+
LocalReserves = __decorate([
|
|
277
|
+
(0, typeorm_1.ViewEntity)({
|
|
278
|
+
name: "local_reserves",
|
|
279
|
+
})
|
|
280
|
+
], LocalReserves);
|
|
281
|
+
return LocalReserves;
|
|
282
|
+
}());
|
|
283
|
+
exports.LocalReserves = LocalReserves;
|
package/package.json
CHANGED
package/src/CustomRepository.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { DataSource, EntityTarget, ObjectLiteral, Repository } from "typeorm";
|
|
2
|
-
import { getDiscountsCodeCompanyInformation } from "./filters/DiscountsCodeCompanyInformation";
|
|
3
|
-
import { getDiscountsCodeUserInformation } from "./filters/DiscountsCodeUserInformation";
|
|
4
|
-
import { getLocalsCompanyInformation } from "./filters/LocalsCompanyInformation";
|
|
5
|
-
import { getVerifyLocalsInformation } from "./filters/VerifyLocalsInformation";
|
|
6
2
|
import {
|
|
7
3
|
IBasicCompany,
|
|
8
4
|
IBasicLazyEvent,
|
|
9
5
|
IPropsDiscountUserOrCompany,
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
IPropsLocalReserve,
|
|
7
|
+
IPropsQueryVerifyLocalInformation,
|
|
12
8
|
} from "./interfaces";
|
|
9
|
+
import {
|
|
10
|
+
getDiscountsCodeCompanyInformation,
|
|
11
|
+
getDiscountsCodeUserInformation,
|
|
12
|
+
getLocalReservesInformation,
|
|
13
|
+
getLocalsCompanyInformation,
|
|
14
|
+
getVerifyLocalsInformation,
|
|
15
|
+
} from ".";
|
|
13
16
|
|
|
14
17
|
export class CustomRepository<T extends ObjectLiteral> extends Repository<T> {
|
|
15
18
|
constructor(target: EntityTarget<T>, dataSource: DataSource) {
|
|
@@ -28,10 +31,16 @@ export class CustomRepository<T extends ObjectLiteral> extends Repository<T> {
|
|
|
28
31
|
return await getLocalsCompanyInformation(this, params);
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
async getVerifyLocalsInformationWrapper(
|
|
34
|
+
async getVerifyLocalsInformationWrapper(
|
|
35
|
+
params: IPropsQueryVerifyLocalInformation
|
|
36
|
+
) {
|
|
32
37
|
return await getVerifyLocalsInformation(this, params);
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
async getLocalReservesInformationWrapper(params: IPropsLocalReserve) {
|
|
41
|
+
return await getLocalReservesInformation(this, params);
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
//! DOC: ¿Necesita implementar un método personalizado aquí?
|
|
36
45
|
// async anyOtherRepository(args: any) {
|
|
37
46
|
// // Implementa otro método personalizado aquí
|
package/src/entities/Company.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
OneToMany,
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
8
|
} from "typeorm";
|
|
9
|
-
import {
|
|
9
|
+
import { IPropsContactDetail } from "../interfaces";
|
|
10
10
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
11
11
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
12
12
|
import { City } from "./City";
|
|
@@ -73,7 +73,7 @@ export class Company {
|
|
|
73
73
|
comment:
|
|
74
74
|
"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.",
|
|
75
75
|
})
|
|
76
|
-
contact_details:
|
|
76
|
+
contact_details: IPropsContactDetail | null;
|
|
77
77
|
|
|
78
78
|
@Column({
|
|
79
79
|
type: "longtext",
|
|
@@ -70,6 +70,13 @@ export { Partners } from "./views/Partners";
|
|
|
70
70
|
export { DiscountsCodeUser } from "./views/DiscountsCodeUser";
|
|
71
71
|
export { PartnerNotifications } from "./views/PartnerNotifications";
|
|
72
72
|
export { LocalTableZonesFilter } from "./views/LocalTableZonesFilter";
|
|
73
|
+
export { LocalReserves } from "./views/LocalReserves";
|
|
74
|
+
|
|
75
|
+
export { getDiscountsCodeCompanyInformation } from "./filters/DiscountsCodeCompanyInformation";
|
|
76
|
+
export { getDiscountsCodeUserInformation } from "./filters/DiscountsCodeUserInformation";
|
|
77
|
+
export { getLocalsCompanyInformation } from "./filters/LocalsCompanyInformation";
|
|
78
|
+
export { getVerifyLocalsInformation } from "./filters/VerifyLocalsInformation";
|
|
79
|
+
export { getLocalReservesInformation } from "./filters/LocalReservesInformation";
|
|
73
80
|
|
|
74
81
|
export { CustomRepository } from "./CustomRepository";
|
|
75
82
|
export * from "./utils";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Repository } from "typeorm";
|
|
2
|
+
import { IPropsLocalReserve } from "../interfaces";
|
|
3
|
+
|
|
4
|
+
export async function getLocalReservesInformation(
|
|
5
|
+
repository: Repository<any>,
|
|
6
|
+
{ globalFilter, date, status, zone, local }: IPropsLocalReserve
|
|
7
|
+
) {
|
|
8
|
+
try {
|
|
9
|
+
const queryBuilder = repository.createQueryBuilder("local_reserves");
|
|
10
|
+
|
|
11
|
+
if (globalFilter) {
|
|
12
|
+
const globalValue = `%${globalFilter.toLowerCase()}%`;
|
|
13
|
+
queryBuilder.andWhere(
|
|
14
|
+
"(LOWER(local_reserves.code) LIKE :globalValue OR local_reserves.user_document LIKE :globalValue OR LOWER(local_reserves.user_name) LIKE :globalValue OR local_reserves.user_phone LIKE :globalValue OR LOWER(local_reserves.user_email) LIKE :globalValue",
|
|
15
|
+
{ globalValue }
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (date) {
|
|
20
|
+
queryBuilder.andWhere("local_reserves.date = :date", { date });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (status) {
|
|
24
|
+
queryBuilder.andWhere("local_reserves.status = :status", { status });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (local) {
|
|
28
|
+
queryBuilder.andWhere("local_reserves.local_table_zone_local = :local", {
|
|
29
|
+
local,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (zone) {
|
|
34
|
+
queryBuilder.andWhere("local_reserves.zone = :zone", { zone });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// DOC: Ejecutar la consulta
|
|
38
|
+
const [discountsCodeUser, totalRecords] =
|
|
39
|
+
await queryBuilder.getManyAndCount();
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
data: discountsCodeUser,
|
|
43
|
+
totalRecords,
|
|
44
|
+
};
|
|
45
|
+
} catch (error) {
|
|
46
|
+
return {
|
|
47
|
+
data: [],
|
|
48
|
+
totalRecords: 0,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -6,11 +6,16 @@ import {
|
|
|
6
6
|
getTimezoneOffset,
|
|
7
7
|
Partner,
|
|
8
8
|
} from "..";
|
|
9
|
-
import {
|
|
9
|
+
import { IPropsQueryVerifyLocalInformation } from "../interfaces";
|
|
10
10
|
|
|
11
11
|
export async function getVerifyLocalsInformation(
|
|
12
12
|
repository: Repository<any>,
|
|
13
|
-
{
|
|
13
|
+
{
|
|
14
|
+
status,
|
|
15
|
+
lazyEvent,
|
|
16
|
+
partner,
|
|
17
|
+
assigned_master,
|
|
18
|
+
}: IPropsQueryVerifyLocalInformation
|
|
14
19
|
) {
|
|
15
20
|
try {
|
|
16
21
|
const timezone = getTimezoneOffset(getTimeZone());
|
package/src/interfaces.ts
CHANGED
|
@@ -34,7 +34,8 @@ export interface IBasicCompany extends IBasicLazyEvent {
|
|
|
34
34
|
owner?: number | null;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export interface
|
|
37
|
+
export interface IPropsQueryVerifyLocalInformation
|
|
38
|
+
extends IPropsQueryVerifyLocal {
|
|
38
39
|
partner: number | null;
|
|
39
40
|
assigned_master: number | null;
|
|
40
41
|
}
|
|
@@ -56,7 +57,7 @@ export interface IPropsDiscountUserOrCompany extends IBasicLazyEvent {
|
|
|
56
57
|
status: number | null;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
export interface
|
|
60
|
+
export interface IPropsContactDetail {
|
|
60
61
|
phone: string;
|
|
61
62
|
email: string;
|
|
62
63
|
new_phone: string;
|
|
@@ -67,4 +68,12 @@ export interface IPropsLoginTerminalPartner {
|
|
|
67
68
|
user: string;
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
export interface IPropsLocalReserve {
|
|
72
|
+
globalFilter: string | null;
|
|
73
|
+
date: string | null;
|
|
74
|
+
zone: number | null;
|
|
75
|
+
status: number | null;
|
|
76
|
+
local: number | null;
|
|
77
|
+
}
|
|
78
|
+
|
|
70
79
|
export type IType = "mysql" | "mariadb";
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { ViewColumn, ViewEntity } 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) => {
|
|
9
|
+
try {
|
|
10
|
+
return JSON.parse(value);
|
|
11
|
+
} catch (error) {
|
|
12
|
+
console.log(error, "Transformer error");
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const DateTransformer = {
|
|
19
|
+
to(value: Date | string): string {
|
|
20
|
+
return moment.utc(value).format("YYYY-MM-DD HH:mm:ss");
|
|
21
|
+
},
|
|
22
|
+
from(value: string): string {
|
|
23
|
+
return moment.utc(value).tz(getTimeZone()).format("YYYY-MM-DD HH:mm:ss");
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
@ViewEntity({
|
|
28
|
+
name: "local_reserves",
|
|
29
|
+
})
|
|
30
|
+
export class LocalReserves {
|
|
31
|
+
@ViewColumn()
|
|
32
|
+
id: number;
|
|
33
|
+
|
|
34
|
+
@ViewColumn()
|
|
35
|
+
code: string;
|
|
36
|
+
|
|
37
|
+
@ViewColumn()
|
|
38
|
+
zone: number;
|
|
39
|
+
|
|
40
|
+
@ViewColumn()
|
|
41
|
+
user_document: string | null;
|
|
42
|
+
|
|
43
|
+
@ViewColumn()
|
|
44
|
+
user_name: string;
|
|
45
|
+
|
|
46
|
+
@ViewColumn()
|
|
47
|
+
user_phone: string | null;
|
|
48
|
+
|
|
49
|
+
@ViewColumn()
|
|
50
|
+
user_email: string | null;
|
|
51
|
+
|
|
52
|
+
@ViewColumn()
|
|
53
|
+
user: number | null;
|
|
54
|
+
|
|
55
|
+
@ViewColumn()
|
|
56
|
+
date: string;
|
|
57
|
+
|
|
58
|
+
@ViewColumn()
|
|
59
|
+
start_time: string;
|
|
60
|
+
|
|
61
|
+
@ViewColumn()
|
|
62
|
+
end_time: string;
|
|
63
|
+
|
|
64
|
+
@ViewColumn()
|
|
65
|
+
details: string | null;
|
|
66
|
+
|
|
67
|
+
@ViewColumn()
|
|
68
|
+
decoration: number | null;
|
|
69
|
+
|
|
70
|
+
@ViewColumn()
|
|
71
|
+
persons: number;
|
|
72
|
+
|
|
73
|
+
@ViewColumn({ transformer: DateTransformer })
|
|
74
|
+
created: string;
|
|
75
|
+
|
|
76
|
+
@ViewColumn({ transformer: DateTransformer })
|
|
77
|
+
updated: string | null;
|
|
78
|
+
|
|
79
|
+
@ViewColumn()
|
|
80
|
+
partner: number | null;
|
|
81
|
+
|
|
82
|
+
@ViewColumn()
|
|
83
|
+
status: number;
|
|
84
|
+
|
|
85
|
+
@ViewColumn()
|
|
86
|
+
status_color: string;
|
|
87
|
+
|
|
88
|
+
@ViewColumn()
|
|
89
|
+
status_text: string;
|
|
90
|
+
|
|
91
|
+
@ViewColumn()
|
|
92
|
+
start: string | null;
|
|
93
|
+
|
|
94
|
+
@ViewColumn()
|
|
95
|
+
end: string | null;
|
|
96
|
+
|
|
97
|
+
@ViewColumn()
|
|
98
|
+
title: string;
|
|
99
|
+
|
|
100
|
+
@ViewColumn()
|
|
101
|
+
startTimeReserve: string | null;
|
|
102
|
+
|
|
103
|
+
@ViewColumn()
|
|
104
|
+
endTimeReserve: string | null;
|
|
105
|
+
|
|
106
|
+
@ViewColumn()
|
|
107
|
+
local_table_zone_id: number;
|
|
108
|
+
|
|
109
|
+
@ViewColumn()
|
|
110
|
+
local_table_zone_code: string;
|
|
111
|
+
|
|
112
|
+
@ViewColumn()
|
|
113
|
+
local_table_zone_name: string;
|
|
114
|
+
|
|
115
|
+
@ViewColumn()
|
|
116
|
+
local_table_zone_local: number | null;
|
|
117
|
+
|
|
118
|
+
@ViewColumn()
|
|
119
|
+
local_table_zone_status: number;
|
|
120
|
+
|
|
121
|
+
@ViewColumn()
|
|
122
|
+
local_decoration_reserve_id: number | null;
|
|
123
|
+
|
|
124
|
+
@ViewColumn()
|
|
125
|
+
local_decoration_reserve_code: string | null;
|
|
126
|
+
|
|
127
|
+
@ViewColumn()
|
|
128
|
+
local_decoration_reserve_name: number | null;
|
|
129
|
+
|
|
130
|
+
@ViewColumn()
|
|
131
|
+
local_decoration_reserve_price: string | null;
|
|
132
|
+
|
|
133
|
+
@ViewColumn()
|
|
134
|
+
local_decoration_reserve_status: number | null;
|
|
135
|
+
|
|
136
|
+
@ViewColumn()
|
|
137
|
+
decoration_reserve_id: number | null;
|
|
138
|
+
|
|
139
|
+
@ViewColumn()
|
|
140
|
+
decoration_reserve_name: string | null;
|
|
141
|
+
|
|
142
|
+
@ViewColumn()
|
|
143
|
+
decoration_reserve_details: string | null;
|
|
144
|
+
|
|
145
|
+
@ViewColumn()
|
|
146
|
+
decoration_reserve_status: number | null;
|
|
147
|
+
|
|
148
|
+
@ViewColumn()
|
|
149
|
+
partner_id: number | null;
|
|
150
|
+
|
|
151
|
+
@ViewColumn()
|
|
152
|
+
partner_code: string | null;
|
|
153
|
+
|
|
154
|
+
@ViewColumn()
|
|
155
|
+
partner_document: string | null;
|
|
156
|
+
|
|
157
|
+
@ViewColumn()
|
|
158
|
+
partner_name: string | null;
|
|
159
|
+
|
|
160
|
+
@ViewColumn()
|
|
161
|
+
partner_surname: string | null;
|
|
162
|
+
|
|
163
|
+
@ViewColumn()
|
|
164
|
+
partner_full_name: string | null;
|
|
165
|
+
|
|
166
|
+
@ViewColumn()
|
|
167
|
+
partner_phone: string | null;
|
|
168
|
+
|
|
169
|
+
@ViewColumn()
|
|
170
|
+
partner_email: string | null;
|
|
171
|
+
|
|
172
|
+
@ViewColumn({ transformer: jsonTransformer })
|
|
173
|
+
partner_profile: any | null;
|
|
174
|
+
|
|
175
|
+
@ViewColumn()
|
|
176
|
+
partner_status: number | null;
|
|
177
|
+
|
|
178
|
+
@ViewColumn()
|
|
179
|
+
user_table_id: number | null;
|
|
180
|
+
|
|
181
|
+
@ViewColumn()
|
|
182
|
+
user_table_code: string | null;
|
|
183
|
+
|
|
184
|
+
@ViewColumn()
|
|
185
|
+
user_table_document: string | null;
|
|
186
|
+
|
|
187
|
+
@ViewColumn()
|
|
188
|
+
user_table_name: string | null;
|
|
189
|
+
|
|
190
|
+
@ViewColumn()
|
|
191
|
+
user_table_surname: string | null;
|
|
192
|
+
|
|
193
|
+
@ViewColumn()
|
|
194
|
+
user_table_full_name: string | null;
|
|
195
|
+
|
|
196
|
+
@ViewColumn()
|
|
197
|
+
user_table_email: string | null;
|
|
198
|
+
|
|
199
|
+
@ViewColumn()
|
|
200
|
+
user_table_phone: string | null;
|
|
201
|
+
|
|
202
|
+
@ViewColumn({ transformer: jsonTransformer })
|
|
203
|
+
user_table_profile: any | null;
|
|
204
|
+
|
|
205
|
+
@ViewColumn()
|
|
206
|
+
user_table_status: number | null;
|
|
207
|
+
}
|