turf-common 1.2.1-beta.45 → 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.
|
@@ -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;
|