turf-common 1.0.15 → 1.0.16-beta.2
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/README.md +9 -0
- package/build/enums/pitch-status.enum.d.ts +12 -0
- package/build/enums/pitch-status.enum.js +13 -0
- package/build/exceptions/app-badrequest.exception.d.ts +0 -3
- package/build/exceptions/app-badrequest.exception.js +0 -9
- package/build/index.d.ts +3 -0
- package/build/index.js +3 -0
- package/build/interface/get-turf-entity.interface.d.ts +27 -0
- package/build/interface/get-turf-entity.interface.js +2 -0
- package/build/types/entity/entity-audit-column.type.d.ts +6 -0
- package/build/types/entity/entity-audit-column.type.js +2 -0
- package/build/types/entity/turf-entity.type.d.ts +19 -0
- package/build/types/entity/turf-entity.type.js +2 -0
- package/package.json +32 -27
package/README.md
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum PitchStatus {
|
|
2
|
+
ACTIVE = "active",
|
|
3
|
+
DELETE = "delete",
|
|
4
|
+
DEACTIVE = "deactive",
|
|
5
|
+
NEW = "new",
|
|
6
|
+
SETUP_INVALID = "setup_invalid",
|
|
7
|
+
PAYMENT_INVALID = "payment_invalid",
|
|
8
|
+
ACCOUNT_SUSPENDED = "account_suspended"
|
|
9
|
+
}
|
|
10
|
+
export type IPitchStatus = {
|
|
11
|
+
[key in PitchStatus]: number;
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PitchStatus = void 0;
|
|
4
|
+
var PitchStatus;
|
|
5
|
+
(function (PitchStatus) {
|
|
6
|
+
PitchStatus["ACTIVE"] = "active";
|
|
7
|
+
PitchStatus["DELETE"] = "delete";
|
|
8
|
+
PitchStatus["DEACTIVE"] = "deactive";
|
|
9
|
+
PitchStatus["NEW"] = "new";
|
|
10
|
+
PitchStatus["SETUP_INVALID"] = "setup_invalid";
|
|
11
|
+
PitchStatus["PAYMENT_INVALID"] = "payment_invalid";
|
|
12
|
+
PitchStatus["ACCOUNT_SUSPENDED"] = "account_suspended";
|
|
13
|
+
})(PitchStatus || (exports.PitchStatus = PitchStatus = {}));
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { IAppBadRequestException } from "../types/app-badrequest-exception.type";
|
|
2
2
|
export declare class AppBadRequestException extends Error {
|
|
3
|
-
private _error;
|
|
4
|
-
private key;
|
|
5
3
|
constructor(appBadRequestException: IAppBadRequestException);
|
|
6
|
-
get error(): IAppBadRequestException;
|
|
7
4
|
}
|
|
@@ -21,17 +21,8 @@ var AppBadRequestException = /** @class */ (function (_super) {
|
|
|
21
21
|
function AppBadRequestException(appBadRequestException) {
|
|
22
22
|
var _this = _super.call(this) || this;
|
|
23
23
|
_this.message = appBadRequestException.message.join(",");
|
|
24
|
-
_this._error = appBadRequestException;
|
|
25
|
-
_this.key = appBadRequestException.key;
|
|
26
24
|
return _this;
|
|
27
25
|
}
|
|
28
|
-
Object.defineProperty(AppBadRequestException.prototype, "error", {
|
|
29
|
-
get: function () {
|
|
30
|
-
return this._error;
|
|
31
|
-
},
|
|
32
|
-
enumerable: false,
|
|
33
|
-
configurable: true
|
|
34
|
-
});
|
|
35
26
|
return AppBadRequestException;
|
|
36
27
|
}(Error));
|
|
37
28
|
exports.AppBadRequestException = AppBadRequestException;
|
package/build/index.d.ts
CHANGED
|
@@ -5,4 +5,7 @@ export * from "./exceptions/app-badrequest.exception";
|
|
|
5
5
|
export * from "./types/app-badrequest-exception.type";
|
|
6
6
|
export * from "./types/booking-modification.type";
|
|
7
7
|
export * from "./interface/get-booking-codes-per-thirty-min.interface";
|
|
8
|
+
export * from "./interface/get-turf-entity.interface";
|
|
8
9
|
export * from "./enums/modification-discount-policy.enum";
|
|
10
|
+
export * from "./types/entity/entity-audit-column.type";
|
|
11
|
+
export * from "./types/entity/turf-entity.type";
|
package/build/index.js
CHANGED
|
@@ -21,4 +21,7 @@ __exportStar(require("./exceptions/app-badrequest.exception"), exports);
|
|
|
21
21
|
__exportStar(require("./types/app-badrequest-exception.type"), exports);
|
|
22
22
|
__exportStar(require("./types/booking-modification.type"), exports);
|
|
23
23
|
__exportStar(require("./interface/get-booking-codes-per-thirty-min.interface"), exports);
|
|
24
|
+
__exportStar(require("./interface/get-turf-entity.interface"), exports);
|
|
24
25
|
__exportStar(require("./enums/modification-discount-policy.enum"), exports);
|
|
26
|
+
__exportStar(require("./types/entity/entity-audit-column.type"), exports);
|
|
27
|
+
__exportStar(require("./types/entity/turf-entity.type"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ITurf {
|
|
2
|
+
id: number;
|
|
3
|
+
turfName: string;
|
|
4
|
+
numberOfPitches: number;
|
|
5
|
+
address: string;
|
|
6
|
+
createdOn: Date;
|
|
7
|
+
updatedOn: Date;
|
|
8
|
+
createdBy: number;
|
|
9
|
+
updatedBy: number;
|
|
10
|
+
org_id: number;
|
|
11
|
+
pitches: IPitch[];
|
|
12
|
+
}
|
|
13
|
+
export interface IPitch {
|
|
14
|
+
turf: number;
|
|
15
|
+
number: number;
|
|
16
|
+
name: string;
|
|
17
|
+
status: string;
|
|
18
|
+
sports: ISport[];
|
|
19
|
+
createdOn: Date;
|
|
20
|
+
updatedOn: Date;
|
|
21
|
+
createdBy: number;
|
|
22
|
+
updatedBy: number;
|
|
23
|
+
}
|
|
24
|
+
interface ISport {
|
|
25
|
+
name: string;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IPitchStatus } from "../../enums/pitch-status.enum";
|
|
2
|
+
import { ITurf } from "../../interface/get-turf-entity.interface";
|
|
3
|
+
import { IEntityAuditColumn } from "./entity-audit-column.type";
|
|
4
|
+
export type ITurfEntity = {
|
|
5
|
+
id: number;
|
|
6
|
+
turfName: string;
|
|
7
|
+
numberOfPitches: number;
|
|
8
|
+
address: string;
|
|
9
|
+
org_id: number;
|
|
10
|
+
adhocRefund: boolean;
|
|
11
|
+
getPitchStatusCount(): IPitchStatus;
|
|
12
|
+
getModifiedTurfEntity(): ITurf;
|
|
13
|
+
toMap(turfEntities: ITurfEntity[]): {
|
|
14
|
+
[key: number]: ITurf;
|
|
15
|
+
};
|
|
16
|
+
toKeyValue(turfEntities: ITurfEntity[]): {
|
|
17
|
+
[key: number]: ITurfEntity;
|
|
18
|
+
};
|
|
19
|
+
} & IEntityAuditColumn;
|
package/package.json
CHANGED
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "turf-common",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "./build/index.js",
|
|
6
|
-
"types": "./build/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"build/**/*"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"clean": "del build",
|
|
12
|
-
"build": "npm run clean && tsc",
|
|
13
|
-
"version:deploy": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "turf-common",
|
|
3
|
+
"version": "1.0.16-beta.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "./build/index.js",
|
|
6
|
+
"types": "./build/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"build/**/*"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"clean": "del build",
|
|
12
|
+
"build": "npm run clean && tsc",
|
|
13
|
+
"version:deploy": "npm version patch && git push && npm run build && npm publish",
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
15
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" 2>&1| tee eslint.log",
|
|
16
|
+
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "github__bellex-dev__turf-common:bellex-dev/turf-common.git"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
|
27
|
+
"@typescript-eslint/parser": "^6.7.2",
|
|
28
|
+
"del-cli": "^5.1.0",
|
|
29
|
+
"eslint": "^8.50.0",
|
|
30
|
+
"typescript": "^5.2.2"
|
|
31
|
+
}
|
|
32
|
+
}
|