@kohost/api-client 3.0.0-beta.60 → 3.0.0-beta.62
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/cjs/Client/index.js +80 -40
- package/dist/cjs/Commands/DiscoverRoomsCommand.js +2 -2
- package/dist/cjs/Events/SystemCategoryUpdatedEvent.js +17 -0
- package/dist/cjs/Events/index.js +2 -2
- package/dist/cjs/Models/Category.js +36 -0
- package/dist/cjs/Models/MediaFile.js +1 -0
- package/dist/cjs/Models/Ticket.js +1 -0
- package/dist/cjs/Models/index.js +2 -2
- package/dist/cjs/schemas/{SpaceTypeSchema.d.ts → CategorySchema.d.ts} +3 -2
- package/dist/cjs/schemas/PropertySchema.d.ts +1 -0
- package/dist/cjs/schemas/ReservationSchema.d.ts +14 -1
- package/dist/cjs/schemas/SpaceSchema.d.ts +6 -12
- package/dist/cjs/schemas/TicketSchema.d.ts +18 -3
- package/dist/cjs/schemas/UserSchema.d.ts +10 -3
- package/dist/cjs/schemas/{spaceType.json → category.json} +9 -3
- package/dist/cjs/schemas/product.json +2 -1
- package/dist/cjs/schemas/property.json +3 -0
- package/dist/cjs/schemas/reservation.json +25 -2
- package/dist/cjs/schemas/space.json +9 -9
- package/dist/cjs/schemas/ticket.json +48 -3
- package/dist/esm/Client.js +80 -40
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Commands.js +2 -2
- package/dist/esm/Commands.js.map +1 -1
- package/dist/esm/Events.js +10 -10
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +119 -38
- package/dist/esm/Models.js.map +3 -3
- package/dist/useCases/{CreateSpaceType.js → CreateCateory.js} +2 -2
- package/dist/useCases/{DeleteSpaceType.js → DeleteCategory.js} +2 -2
- package/dist/useCases/{DescribeSpaceType.js → DescribeCategory.js} +2 -2
- package/dist/useCases/{ListSpaceTypes.js → ListCategories.js} +2 -2
- package/dist/useCases/TipUser.js +32 -0
- package/dist/useCases/{UpdateSpaceType.js → UpdateCategory.js} +2 -2
- package/package.json +1 -1
- package/dist/cjs/Events/SystemSpaceTypeUpdatedEvent.js +0 -17
- package/dist/cjs/Models/SpaceType.js +0 -36
package/dist/cjs/Client/index.js
CHANGED
|
@@ -803,6 +803,44 @@ var require_DescribeMyAccessCredentials = __commonJS({
|
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
805
|
|
|
806
|
+
// dist/useCases/TipUser.js
|
|
807
|
+
var require_TipUser = __commonJS({
|
|
808
|
+
"dist/useCases/TipUser.js"(exports2, module2) {
|
|
809
|
+
module2.exports = /* @__PURE__ */ __name(function TipUser2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
810
|
+
if (!requestData)
|
|
811
|
+
requestData = {};
|
|
812
|
+
const pathParams = [":id"];
|
|
813
|
+
const { data, query, headers } = requestData;
|
|
814
|
+
let url = "/users/:id/tip";
|
|
815
|
+
if (pathParams && data) {
|
|
816
|
+
for (const param of pathParams) {
|
|
817
|
+
const paramName = param.replace(":", "");
|
|
818
|
+
url = url.replace(param, data[paramName]);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
822
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
823
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
824
|
+
return Promise.reject(
|
|
825
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
826
|
+
);
|
|
827
|
+
}
|
|
828
|
+
const config = {
|
|
829
|
+
method: "post",
|
|
830
|
+
url,
|
|
831
|
+
...httpConfigOptions
|
|
832
|
+
};
|
|
833
|
+
if (data)
|
|
834
|
+
config.data = data;
|
|
835
|
+
if (query)
|
|
836
|
+
config.params = query;
|
|
837
|
+
if (headers)
|
|
838
|
+
config.headers = headers;
|
|
839
|
+
return this._http.request(config);
|
|
840
|
+
}, "TipUser");
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
|
|
806
844
|
// dist/useCases/ListSpaces.js
|
|
807
845
|
var require_ListSpaces = __commonJS({
|
|
808
846
|
"dist/useCases/ListSpaces.js"(exports2, module2) {
|
|
@@ -1145,15 +1183,15 @@ var require_SetSpaceScene = __commonJS({
|
|
|
1145
1183
|
}
|
|
1146
1184
|
});
|
|
1147
1185
|
|
|
1148
|
-
// dist/useCases/
|
|
1149
|
-
var
|
|
1150
|
-
"dist/useCases/
|
|
1151
|
-
module2.exports = /* @__PURE__ */ __name(function
|
|
1186
|
+
// dist/useCases/CreateCateory.js
|
|
1187
|
+
var require_CreateCateory = __commonJS({
|
|
1188
|
+
"dist/useCases/CreateCateory.js"(exports2, module2) {
|
|
1189
|
+
module2.exports = /* @__PURE__ */ __name(function CreateCateory2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
1152
1190
|
if (!requestData)
|
|
1153
1191
|
requestData = {};
|
|
1154
1192
|
const pathParams = null;
|
|
1155
1193
|
const { data, query, headers } = requestData;
|
|
1156
|
-
let url = "/
|
|
1194
|
+
let url = "/categories";
|
|
1157
1195
|
if (pathParams && data) {
|
|
1158
1196
|
for (const param of pathParams) {
|
|
1159
1197
|
const paramName = param.replace(":", "");
|
|
@@ -1179,19 +1217,19 @@ var require_CreateSpaceType = __commonJS({
|
|
|
1179
1217
|
if (headers)
|
|
1180
1218
|
config.headers = headers;
|
|
1181
1219
|
return this._http.request(config);
|
|
1182
|
-
}, "
|
|
1220
|
+
}, "CreateCateory");
|
|
1183
1221
|
}
|
|
1184
1222
|
});
|
|
1185
1223
|
|
|
1186
|
-
// dist/useCases/
|
|
1187
|
-
var
|
|
1188
|
-
"dist/useCases/
|
|
1189
|
-
module2.exports = /* @__PURE__ */ __name(function
|
|
1224
|
+
// dist/useCases/DeleteCategory.js
|
|
1225
|
+
var require_DeleteCategory = __commonJS({
|
|
1226
|
+
"dist/useCases/DeleteCategory.js"(exports2, module2) {
|
|
1227
|
+
module2.exports = /* @__PURE__ */ __name(function DeleteCategory2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
1190
1228
|
if (!requestData)
|
|
1191
1229
|
requestData = {};
|
|
1192
1230
|
const pathParams = [":id"];
|
|
1193
1231
|
const { data, query, headers } = requestData;
|
|
1194
|
-
let url = "/
|
|
1232
|
+
let url = "/categories/:id";
|
|
1195
1233
|
if (pathParams && data) {
|
|
1196
1234
|
for (const param of pathParams) {
|
|
1197
1235
|
const paramName = param.replace(":", "");
|
|
@@ -1217,19 +1255,19 @@ var require_DeleteSpaceType = __commonJS({
|
|
|
1217
1255
|
if (headers)
|
|
1218
1256
|
config.headers = headers;
|
|
1219
1257
|
return this._http.request(config);
|
|
1220
|
-
}, "
|
|
1258
|
+
}, "DeleteCategory");
|
|
1221
1259
|
}
|
|
1222
1260
|
});
|
|
1223
1261
|
|
|
1224
|
-
// dist/useCases/
|
|
1225
|
-
var
|
|
1226
|
-
"dist/useCases/
|
|
1227
|
-
module2.exports = /* @__PURE__ */ __name(function
|
|
1262
|
+
// dist/useCases/DescribeCategory.js
|
|
1263
|
+
var require_DescribeCategory = __commonJS({
|
|
1264
|
+
"dist/useCases/DescribeCategory.js"(exports2, module2) {
|
|
1265
|
+
module2.exports = /* @__PURE__ */ __name(function DescribeCategory2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
1228
1266
|
if (!requestData)
|
|
1229
1267
|
requestData = {};
|
|
1230
1268
|
const pathParams = [":id"];
|
|
1231
1269
|
const { data, query, headers } = requestData;
|
|
1232
|
-
let url = "/
|
|
1270
|
+
let url = "/categories/:id";
|
|
1233
1271
|
if (pathParams && data) {
|
|
1234
1272
|
for (const param of pathParams) {
|
|
1235
1273
|
const paramName = param.replace(":", "");
|
|
@@ -1255,19 +1293,19 @@ var require_DescribeSpaceType = __commonJS({
|
|
|
1255
1293
|
if (headers)
|
|
1256
1294
|
config.headers = headers;
|
|
1257
1295
|
return this._http.request(config);
|
|
1258
|
-
}, "
|
|
1296
|
+
}, "DescribeCategory");
|
|
1259
1297
|
}
|
|
1260
1298
|
});
|
|
1261
1299
|
|
|
1262
|
-
// dist/useCases/
|
|
1263
|
-
var
|
|
1264
|
-
"dist/useCases/
|
|
1265
|
-
module2.exports = /* @__PURE__ */ __name(function
|
|
1300
|
+
// dist/useCases/ListCategories.js
|
|
1301
|
+
var require_ListCategories = __commonJS({
|
|
1302
|
+
"dist/useCases/ListCategories.js"(exports2, module2) {
|
|
1303
|
+
module2.exports = /* @__PURE__ */ __name(function ListCategories2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
1266
1304
|
if (!requestData)
|
|
1267
1305
|
requestData = {};
|
|
1268
1306
|
const pathParams = null;
|
|
1269
1307
|
const { data, query, headers } = requestData;
|
|
1270
|
-
let url = "/
|
|
1308
|
+
let url = "/categories";
|
|
1271
1309
|
if (pathParams && data) {
|
|
1272
1310
|
for (const param of pathParams) {
|
|
1273
1311
|
const paramName = param.replace(":", "");
|
|
@@ -1293,19 +1331,19 @@ var require_ListSpaceTypes = __commonJS({
|
|
|
1293
1331
|
if (headers)
|
|
1294
1332
|
config.headers = headers;
|
|
1295
1333
|
return this._http.request(config);
|
|
1296
|
-
}, "
|
|
1334
|
+
}, "ListCategories");
|
|
1297
1335
|
}
|
|
1298
1336
|
});
|
|
1299
1337
|
|
|
1300
|
-
// dist/useCases/
|
|
1301
|
-
var
|
|
1302
|
-
"dist/useCases/
|
|
1303
|
-
module2.exports = /* @__PURE__ */ __name(function
|
|
1338
|
+
// dist/useCases/UpdateCategory.js
|
|
1339
|
+
var require_UpdateCategory = __commonJS({
|
|
1340
|
+
"dist/useCases/UpdateCategory.js"(exports2, module2) {
|
|
1341
|
+
module2.exports = /* @__PURE__ */ __name(function UpdateCategory2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
1304
1342
|
if (!requestData)
|
|
1305
1343
|
requestData = {};
|
|
1306
1344
|
const pathParams = [":id"];
|
|
1307
1345
|
const { data, query, headers } = requestData;
|
|
1308
|
-
let url = "/
|
|
1346
|
+
let url = "/categories/:id";
|
|
1309
1347
|
if (pathParams && data) {
|
|
1310
1348
|
for (const param of pathParams) {
|
|
1311
1349
|
const paramName = param.replace(":", "");
|
|
@@ -1331,7 +1369,7 @@ var require_UpdateSpaceType = __commonJS({
|
|
|
1331
1369
|
if (headers)
|
|
1332
1370
|
config.headers = headers;
|
|
1333
1371
|
return this._http.request(config);
|
|
1334
|
-
}, "
|
|
1372
|
+
}, "UpdateCategory");
|
|
1335
1373
|
}
|
|
1336
1374
|
});
|
|
1337
1375
|
|
|
@@ -5765,6 +5803,7 @@ var ListUserSpaces = require_ListUserSpaces();
|
|
|
5765
5803
|
var ListUserOrders = require_ListUserOrders();
|
|
5766
5804
|
var ListTeam = require_ListTeam();
|
|
5767
5805
|
var DescribeMyAccessCredentials = require_DescribeMyAccessCredentials();
|
|
5806
|
+
var TipUser = require_TipUser();
|
|
5768
5807
|
var ListSpaces = require_ListSpaces();
|
|
5769
5808
|
var ListMySpaces = require_ListMySpaces();
|
|
5770
5809
|
var ListRoomsInSpace = require_ListRoomsInSpace();
|
|
@@ -5774,11 +5813,11 @@ var DescribeSpace = require_DescribeSpace();
|
|
|
5774
5813
|
var DeleteSpace = require_DeleteSpace();
|
|
5775
5814
|
var CreateRoomInSpace = require_CreateRoomInSpace();
|
|
5776
5815
|
var SetSpaceScene = require_SetSpaceScene();
|
|
5777
|
-
var
|
|
5778
|
-
var
|
|
5779
|
-
var
|
|
5780
|
-
var
|
|
5781
|
-
var
|
|
5816
|
+
var CreateCateory = require_CreateCateory();
|
|
5817
|
+
var DeleteCategory = require_DeleteCategory();
|
|
5818
|
+
var DescribeCategory = require_DescribeCategory();
|
|
5819
|
+
var ListCategories = require_ListCategories();
|
|
5820
|
+
var UpdateCategory = require_UpdateCategory();
|
|
5782
5821
|
var ListRooms = require_ListRooms();
|
|
5783
5822
|
var DescribeRoom = require_DescribeRoom();
|
|
5784
5823
|
var CreateRoom = require_CreateRoom();
|
|
@@ -6028,6 +6067,7 @@ KohostApiClient.prototype.ListUserSpaces = ListUserSpaces;
|
|
|
6028
6067
|
KohostApiClient.prototype.ListUserOrders = ListUserOrders;
|
|
6029
6068
|
KohostApiClient.prototype.ListTeam = ListTeam;
|
|
6030
6069
|
KohostApiClient.prototype.DescribeMyAccessCredentials = DescribeMyAccessCredentials;
|
|
6070
|
+
KohostApiClient.prototype.TipUser = TipUser;
|
|
6031
6071
|
KohostApiClient.prototype.ListSpaces = ListSpaces;
|
|
6032
6072
|
KohostApiClient.prototype.ListMySpaces = ListMySpaces;
|
|
6033
6073
|
KohostApiClient.prototype.ListRoomsInSpace = ListRoomsInSpace;
|
|
@@ -6037,11 +6077,11 @@ KohostApiClient.prototype.DescribeSpace = DescribeSpace;
|
|
|
6037
6077
|
KohostApiClient.prototype.DeleteSpace = DeleteSpace;
|
|
6038
6078
|
KohostApiClient.prototype.CreateRoomInSpace = CreateRoomInSpace;
|
|
6039
6079
|
KohostApiClient.prototype.SetSpaceScene = SetSpaceScene;
|
|
6040
|
-
KohostApiClient.prototype.
|
|
6041
|
-
KohostApiClient.prototype.
|
|
6042
|
-
KohostApiClient.prototype.
|
|
6043
|
-
KohostApiClient.prototype.
|
|
6044
|
-
KohostApiClient.prototype.
|
|
6080
|
+
KohostApiClient.prototype.CreateCateory = CreateCateory;
|
|
6081
|
+
KohostApiClient.prototype.DeleteCategory = DeleteCategory;
|
|
6082
|
+
KohostApiClient.prototype.DescribeCategory = DescribeCategory;
|
|
6083
|
+
KohostApiClient.prototype.ListCategories = ListCategories;
|
|
6084
|
+
KohostApiClient.prototype.UpdateCategory = UpdateCategory;
|
|
6045
6085
|
KohostApiClient.prototype.ListRooms = ListRooms;
|
|
6046
6086
|
KohostApiClient.prototype.DescribeRoom = DescribeRoom;
|
|
6047
6087
|
KohostApiClient.prototype.CreateRoom = CreateRoom;
|
|
@@ -4,7 +4,7 @@ class DiscoverRoomsCommand extends Command {
|
|
|
4
4
|
constructor({
|
|
5
5
|
id,
|
|
6
6
|
types,
|
|
7
|
-
|
|
7
|
+
categories,
|
|
8
8
|
startDate,
|
|
9
9
|
endDate,
|
|
10
10
|
serviceStatus,
|
|
@@ -14,7 +14,7 @@ class DiscoverRoomsCommand extends Command {
|
|
|
14
14
|
super({
|
|
15
15
|
id,
|
|
16
16
|
types,
|
|
17
|
-
|
|
17
|
+
categories,
|
|
18
18
|
startDate,
|
|
19
19
|
endDate,
|
|
20
20
|
serviceStatus,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const Event = require("./Event");
|
|
2
|
+
|
|
3
|
+
class SystemCategoryUpdatedEvent extends Event {
|
|
4
|
+
constructor(space) {
|
|
5
|
+
super(space);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
get name() {
|
|
9
|
+
return "SystemCategoryUpdated";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get routingKey() {
|
|
13
|
+
return `category.${this.keyId}.updated`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = SystemCategoryUpdatedEvent;
|
package/dist/cjs/Events/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const SceneSetEvent = require("./SceneSetEvent");
|
|
|
15
15
|
|
|
16
16
|
const SystemUserUpdatedEvent = require("./SystemUserUpdatedEvent");
|
|
17
17
|
const SystemSpaceUpdatedEvent = require("./SystemSpaceUpdatedEvent");
|
|
18
|
-
const
|
|
18
|
+
const SystemCategoryUpdatedEvent = require("./SystemCategoryUpdatedEvent");
|
|
19
19
|
const SystemProductUpdatedEvent = require("./SystemProductUpdatedEvent");
|
|
20
20
|
|
|
21
21
|
const SystemReservationUpdatedEvent = require("./SystemReservationUpdatedEvent");
|
|
@@ -42,7 +42,7 @@ module.exports = {
|
|
|
42
42
|
SystemCourtesyUpdatedEvent,
|
|
43
43
|
SystemUserUpdatedEvent,
|
|
44
44
|
SystemSpaceUpdatedEvent,
|
|
45
|
-
|
|
45
|
+
SystemCategoryUpdatedEvent,
|
|
46
46
|
SystemProductUpdatedEvent,
|
|
47
47
|
SystemReservationUpdatedEvent,
|
|
48
48
|
SceneSetEvent,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Create the Category Model
|
|
2
|
+
// Originally used for hotel room category e.g. Double Queen
|
|
3
|
+
const schemas = require("../utils/schema");
|
|
4
|
+
const schema = require("../schemas/category.json");
|
|
5
|
+
const Kohost = require("./Kohost");
|
|
6
|
+
|
|
7
|
+
schemas.add(schema);
|
|
8
|
+
const validator = schemas.compile(schema);
|
|
9
|
+
|
|
10
|
+
class Category extends Kohost {
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import("../schemas/CategorySchema").Category} CategoryType
|
|
13
|
+
* Create a Category instance.
|
|
14
|
+
* @constructor
|
|
15
|
+
* @param {CategoryType} category - The category object of type SpaceType.
|
|
16
|
+
*/
|
|
17
|
+
constructor(category) {
|
|
18
|
+
super(category);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Object.defineProperty(Category.prototype, "schema", {
|
|
23
|
+
value: schema,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
Object.defineProperty(Category.prototype, "validator", {
|
|
27
|
+
get: function () {
|
|
28
|
+
return validator;
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
Object.defineProperty(Category, "validProperties", {
|
|
33
|
+
value: Object.keys(schema.properties),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
module.exports = Category;
|
|
@@ -20,6 +20,7 @@ class MediaFile extends Kohost {
|
|
|
20
20
|
createImageVariant(params) {
|
|
21
21
|
if (this.mimeType != "image/*")
|
|
22
22
|
throw new RequestError("Only dynamic images can have variants");
|
|
23
|
+
if (!this.url) throw new RequestError("MediaFile has no url");
|
|
23
24
|
// convert params to "key=value" pairs
|
|
24
25
|
const query = Object.keys(params)
|
|
25
26
|
.map((key) => `${key}=${params[key]}`)
|
|
@@ -99,6 +99,7 @@ Object.defineProperty(Ticket.prototype, "lastResponder", {
|
|
|
99
99
|
|
|
100
100
|
function mapConversationData(data) {
|
|
101
101
|
const ticketData = cloneDeep(data);
|
|
102
|
+
if (!ticketData.conversation) ticketData.conversation = [];
|
|
102
103
|
ticketData.conversation = ticketData.conversation.map((msg) => {
|
|
103
104
|
if (msg.media) {
|
|
104
105
|
msg.media = new MediaFile(msg.media);
|
package/dist/cjs/Models/index.js
CHANGED
|
@@ -16,7 +16,7 @@ const MediaSource = require("./MediaSource");
|
|
|
16
16
|
const Room = require("./Room");
|
|
17
17
|
|
|
18
18
|
const Space = require("./Space");
|
|
19
|
-
const
|
|
19
|
+
const Category = require("./Category");
|
|
20
20
|
|
|
21
21
|
const Ticket = require("./Ticket");
|
|
22
22
|
const Scene = require("./Scene");
|
|
@@ -56,7 +56,7 @@ module.exports = {
|
|
|
56
56
|
SystemUser,
|
|
57
57
|
Room,
|
|
58
58
|
Space,
|
|
59
|
-
|
|
59
|
+
Category,
|
|
60
60
|
Ticket,
|
|
61
61
|
Scene,
|
|
62
62
|
DiscoveredDevice,
|
|
@@ -11,9 +11,9 @@ export type Date =
|
|
|
11
11
|
[k: string]: unknown;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export interface
|
|
14
|
+
export interface Category {
|
|
15
15
|
id?: string;
|
|
16
|
-
type
|
|
16
|
+
type: string;
|
|
17
17
|
name?: string;
|
|
18
18
|
driver?:
|
|
19
19
|
| "aws-kinesis"
|
|
@@ -45,6 +45,7 @@ export interface SpaceType {
|
|
|
45
45
|
description?: string;
|
|
46
46
|
image?: MediaFile;
|
|
47
47
|
rating?: number;
|
|
48
|
+
discriminator: "space" | "product";
|
|
48
49
|
systemData?: SystemData;
|
|
49
50
|
[k: string]: unknown;
|
|
50
51
|
}
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
* and run json-schema-to-typescript to regenerate this file.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
export type UpdatedAt =
|
|
9
|
+
| string
|
|
10
|
+
| {
|
|
11
|
+
[k: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
|
|
8
14
|
export interface Reservation {
|
|
9
15
|
id?: string;
|
|
10
16
|
driver?:
|
|
@@ -37,7 +43,7 @@ export interface Reservation {
|
|
|
37
43
|
primaryGuest?: string;
|
|
38
44
|
type: string;
|
|
39
45
|
sharedGuests?: string[];
|
|
40
|
-
|
|
46
|
+
spaceCategory?: string;
|
|
41
47
|
space?: string;
|
|
42
48
|
/**
|
|
43
49
|
* reserved - confirmed by both parties, before check-in
|
|
@@ -71,6 +77,12 @@ export interface Reservation {
|
|
|
71
77
|
};
|
|
72
78
|
adultCount?: number;
|
|
73
79
|
childCount?: number;
|
|
80
|
+
spaceCategoryAvailabilites?: {
|
|
81
|
+
id?: string;
|
|
82
|
+
price?: number;
|
|
83
|
+
unit?: "night" | "stay" | "hour";
|
|
84
|
+
[k: string]: unknown;
|
|
85
|
+
}[];
|
|
74
86
|
revenue?: {
|
|
75
87
|
date?: string;
|
|
76
88
|
amount?: number;
|
|
@@ -85,6 +97,7 @@ export interface Reservation {
|
|
|
85
97
|
metadata?: {
|
|
86
98
|
[k: string]: unknown;
|
|
87
99
|
};
|
|
100
|
+
updatedAt?: UpdatedAt;
|
|
88
101
|
[k: string]: unknown;
|
|
89
102
|
}
|
|
90
103
|
export interface SystemData {
|
|
@@ -8,17 +8,8 @@
|
|
|
8
8
|
export interface Space {
|
|
9
9
|
id?: string;
|
|
10
10
|
name?: string;
|
|
11
|
-
type?:
|
|
12
|
-
|
|
13
|
-
| "hotelRoom"
|
|
14
|
-
| "office"
|
|
15
|
-
| "building"
|
|
16
|
-
| "commonArea"
|
|
17
|
-
| "conferenceRoom"
|
|
18
|
-
| "lobby"
|
|
19
|
-
| "gym"
|
|
20
|
-
| "pool"
|
|
21
|
-
| "restaurant";
|
|
11
|
+
type?: string;
|
|
12
|
+
discriminator?: "classRoom" | "hotelRoom" | "office" | "building" | "commonArea";
|
|
22
13
|
driver?:
|
|
23
14
|
| "aws-kinesis"
|
|
24
15
|
| "butler"
|
|
@@ -46,7 +37,10 @@ export interface Space {
|
|
|
46
37
|
| "cloudflare-images"
|
|
47
38
|
| "cloudflare-stream"
|
|
48
39
|
| "insperia-privacy";
|
|
49
|
-
|
|
40
|
+
/**
|
|
41
|
+
* This is the category id
|
|
42
|
+
*/
|
|
43
|
+
category?: string;
|
|
50
44
|
rooms?: string[];
|
|
51
45
|
subGroups?: string[];
|
|
52
46
|
occupied?: boolean;
|
|
@@ -17,7 +17,7 @@ export type Date =
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* A ticket is a request
|
|
20
|
+
* A ticket is a request from a user.
|
|
21
21
|
*/
|
|
22
22
|
export interface Ticket {
|
|
23
23
|
id: string;
|
|
@@ -30,12 +30,27 @@ export interface Ticket {
|
|
|
30
30
|
readBy?: string[];
|
|
31
31
|
media?: MediaFile | null;
|
|
32
32
|
}[];
|
|
33
|
-
requester:
|
|
34
|
-
|
|
33
|
+
requester: {
|
|
34
|
+
userId?: string;
|
|
35
|
+
userName?: string;
|
|
36
|
+
userPhoto?: MediaFile | null | string;
|
|
37
|
+
deviceId?: string;
|
|
38
|
+
roomId?: string;
|
|
39
|
+
spaceId?: string;
|
|
40
|
+
spaceName?: string;
|
|
41
|
+
[k: string]: unknown;
|
|
42
|
+
};
|
|
43
|
+
assignedTo?: {
|
|
44
|
+
userId?: string;
|
|
45
|
+
userName?: string;
|
|
46
|
+
userPhoto?: MediaFile | null | string;
|
|
47
|
+
[k: string]: unknown;
|
|
48
|
+
};
|
|
35
49
|
status: "open" | "pending" | "solved" | "closed";
|
|
36
50
|
tags: string[];
|
|
37
51
|
rating?: number;
|
|
38
52
|
ratingComment?: string;
|
|
53
|
+
tipAmount?: string;
|
|
39
54
|
createdAt: Date;
|
|
40
55
|
updatedAt: Date;
|
|
41
56
|
solvedAt?: Date;
|
|
@@ -18,12 +18,12 @@ export type Identification2 =
|
|
|
18
18
|
| {
|
|
19
19
|
[k: string]: unknown;
|
|
20
20
|
};
|
|
21
|
-
export type
|
|
21
|
+
export type UpdatedAt =
|
|
22
22
|
| string
|
|
23
23
|
| {
|
|
24
24
|
[k: string]: unknown;
|
|
25
25
|
};
|
|
26
|
-
export type
|
|
26
|
+
export type CreatedAt =
|
|
27
27
|
| string
|
|
28
28
|
| {
|
|
29
29
|
[k: string]: unknown;
|
|
@@ -210,7 +210,7 @@ export interface Reservation {
|
|
|
210
210
|
primaryGuest?: string;
|
|
211
211
|
type: string;
|
|
212
212
|
sharedGuests?: string[];
|
|
213
|
-
|
|
213
|
+
spaceCategory?: string;
|
|
214
214
|
space?: string;
|
|
215
215
|
/**
|
|
216
216
|
* reserved - confirmed by both parties, before check-in
|
|
@@ -244,6 +244,12 @@ export interface Reservation {
|
|
|
244
244
|
};
|
|
245
245
|
adultCount?: number;
|
|
246
246
|
childCount?: number;
|
|
247
|
+
spaceCategoryAvailabilites?: {
|
|
248
|
+
id?: string;
|
|
249
|
+
price?: number;
|
|
250
|
+
unit?: "night" | "stay" | "hour";
|
|
251
|
+
[k: string]: unknown;
|
|
252
|
+
}[];
|
|
247
253
|
revenue?: {
|
|
248
254
|
date?: string;
|
|
249
255
|
amount?: number;
|
|
@@ -258,5 +264,6 @@ export interface Reservation {
|
|
|
258
264
|
metadata?: {
|
|
259
265
|
[k: string]: unknown;
|
|
260
266
|
};
|
|
267
|
+
updatedAt?: UpdatedAt;
|
|
261
268
|
[k: string]: unknown;
|
|
262
269
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "
|
|
4
|
-
"title": "
|
|
3
|
+
"$id": "category.json",
|
|
4
|
+
"title": "Category",
|
|
5
5
|
"type": "object",
|
|
6
|
+
"required": ["type", "discriminator"],
|
|
6
7
|
"properties": {
|
|
7
8
|
"id": {
|
|
8
9
|
"$ref": "definitions.json#/definitions/id"
|
|
9
10
|
},
|
|
10
11
|
"type": {
|
|
11
|
-
"type": "string"
|
|
12
|
+
"type": "string",
|
|
13
|
+
"default": "category"
|
|
12
14
|
},
|
|
13
15
|
"name": {
|
|
14
16
|
"type": "string",
|
|
@@ -29,6 +31,10 @@
|
|
|
29
31
|
"maximum": 10,
|
|
30
32
|
"default": 9
|
|
31
33
|
},
|
|
34
|
+
"discriminator": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"enum": ["space", "product"]
|
|
37
|
+
},
|
|
32
38
|
"systemData": {
|
|
33
39
|
"$ref": "definitions.json#/definitions/systemData"
|
|
34
40
|
}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"type": "string"
|
|
16
16
|
},
|
|
17
17
|
"type": {
|
|
18
|
-
"type": "string"
|
|
18
|
+
"type": "string",
|
|
19
|
+
"default": "reservation"
|
|
19
20
|
},
|
|
20
21
|
"sharedGuests": {
|
|
21
22
|
"type": "array",
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
"type": "string"
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
|
-
"
|
|
27
|
+
"spaceCategory": {
|
|
27
28
|
"type": "string"
|
|
28
29
|
},
|
|
29
30
|
"space": {
|
|
@@ -77,6 +78,25 @@
|
|
|
77
78
|
"type": "number",
|
|
78
79
|
"default": 0
|
|
79
80
|
},
|
|
81
|
+
|
|
82
|
+
"spaceCategoryAvailabilites": {
|
|
83
|
+
"type": "array",
|
|
84
|
+
"items": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"properties": {
|
|
87
|
+
"id": {
|
|
88
|
+
"type": "string"
|
|
89
|
+
},
|
|
90
|
+
"price": {
|
|
91
|
+
"type": "number"
|
|
92
|
+
},
|
|
93
|
+
"unit": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"enum": ["night", "stay", "hour"]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
80
100
|
"revenue": {
|
|
81
101
|
"type": "array",
|
|
82
102
|
"items": {
|
|
@@ -113,6 +133,9 @@
|
|
|
113
133
|
},
|
|
114
134
|
"metadata": {
|
|
115
135
|
"ref": "definitions.json#/definitions/metadata"
|
|
136
|
+
},
|
|
137
|
+
"updatedAt": {
|
|
138
|
+
"$ref": "definitions.json#/definitions/updatedAt"
|
|
116
139
|
}
|
|
117
140
|
}
|
|
118
141
|
}
|