turf-common 1.2.1-beta.44 → 1.2.1-beta.46
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/build/@utils.d.ts
CHANGED
package/build/@utils.js
CHANGED
|
@@ -18,3 +18,4 @@ __exportStar(require("./interface/api/utils"), exports);
|
|
|
18
18
|
__exportStar(require("./utils/string-utils"), exports);
|
|
19
19
|
__exportStar(require("./utils/date-util"), exports);
|
|
20
20
|
__exportStar(require("./utils/math-util"), exports);
|
|
21
|
+
__exportStar(require("./utils/constant"), exports);
|
|
@@ -20,6 +20,10 @@ export declare class TurfAvailability implements ITurfAvailability {
|
|
|
20
20
|
data: IGetAvailabilityByTurf;
|
|
21
21
|
dateCodes: string[];
|
|
22
22
|
timeSlotCodesDateWise: Record<string, string[]>;
|
|
23
|
+
startDateCode: string;
|
|
24
|
+
endDateCode: string;
|
|
25
|
+
fromTimeCode: string;
|
|
26
|
+
toTimeCode: string;
|
|
23
27
|
constructor(data: IGetAvailabilityByTurf);
|
|
24
28
|
getTotalAvailablePrice(): number;
|
|
25
29
|
getTotalNonAvailablePrice(): number;
|
|
@@ -37,5 +41,6 @@ export declare class TurfAvailability implements ITurfAvailability {
|
|
|
37
41
|
static toJson(turfAvailability: TurfAvailability): IGetAvailabilityByTurf;
|
|
38
42
|
getTotalTime(): number;
|
|
39
43
|
getCode(): string;
|
|
44
|
+
parse(): void;
|
|
40
45
|
}
|
|
41
46
|
export {};
|
|
@@ -12,6 +12,7 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
12
12
|
var key = _a[0], value = _a[1];
|
|
13
13
|
_this.timeSlotCodesDateWise[key] = Object.keys(value).sort();
|
|
14
14
|
});
|
|
15
|
+
this.parse();
|
|
15
16
|
}
|
|
16
17
|
TurfAvailability.prototype.getTotalAvailablePrice = function () {
|
|
17
18
|
var totalCost = 0;
|
|
@@ -173,6 +174,16 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
173
174
|
TurfAvailability.prototype.getCode = function () {
|
|
174
175
|
return "event#".concat(this.dateCodes[0]).concat(this.dateCodes[this.dateCodes.length - 1], "#").concat(this.timeSlotCodesDateWise[this.dateCodes[0]][0].slice(0, 4)).concat(this.timeSlotCodesDateWise[this.dateCodes[0]][this.timeSlotCodesDateWise[this.dateCodes[0]].length - 1].slice(4, 8), "#").concat(this.getPitchIds());
|
|
175
176
|
};
|
|
177
|
+
TurfAvailability.prototype.parse = function () {
|
|
178
|
+
var eventCode = this.getCode();
|
|
179
|
+
var eventCodes = eventCode.split("#");
|
|
180
|
+
var dateCodeRange = eventCodes[1];
|
|
181
|
+
var timeCodeRange = eventCodes[2];
|
|
182
|
+
this.startDateCode = dateCodeRange.slice(0, 6);
|
|
183
|
+
this.endDateCode = dateCodeRange.slice(6, 12);
|
|
184
|
+
this.fromTimeCode = timeCodeRange.slice(0, 4);
|
|
185
|
+
this.toTimeCode = timeCodeRange.slice(4, 8);
|
|
186
|
+
};
|
|
176
187
|
return TurfAvailability;
|
|
177
188
|
}());
|
|
178
189
|
exports.TurfAvailability = TurfAvailability;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = 7;
|
|
2
|
-
export declare const DEFAULT_PASSWORD = "turf@#
|
|
2
|
+
export declare const DEFAULT_PASSWORD = "turf@#123";
|
package/build/utils/constant.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_PASSWORD = exports.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = void 0;
|
|
4
4
|
exports.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = 7;
|
|
5
|
-
exports.DEFAULT_PASSWORD = "turf@#
|
|
5
|
+
exports.DEFAULT_PASSWORD = "turf@#123";
|