@tossplace/pos-plugin-sdk 0.0.12 → 0.0.14

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/sdk.d.ts CHANGED
@@ -500,13 +500,18 @@ declare type NumberInput = BaseInput & {
500
500
  export declare interface Order {
501
501
  getOrder: (id: string) => Promise<PluginOrder>;
502
502
  /**
503
- * @param start yyyy-MM-dd
504
- * @param end yyyy-MM-dd
503
+ * @param start ISO 8601 포맷
504
+ * @param end ISO 8601 포맷
505
+ * @param page default 1
506
+ * @param size default 20
505
507
  * @description createdAt 기준으로 주문을 조회합니다
506
508
  */
507
- getOrders: (range: {
509
+ getOrders: (params: {
508
510
  start: string;
509
511
  end: string;
512
+ page?: number;
513
+ size?: number;
514
+ orderStates?: PluginOrderState[];
510
515
  }) => Promise<PluginOrder[]>;
511
516
  /**
512
517
  * @deprecated
@@ -922,6 +927,7 @@ export declare interface PluginCatalogItemOptionChoice {
922
927
  /** 키오스크에서 표시되는 아이콘 URL */
923
928
  imageUrl?: string | null;
924
929
  state: CatalogItemOptionChoiceState;
930
+ quantityInputEnabled: boolean;
925
931
  }
926
932
 
927
933
  /**
@@ -1027,6 +1033,7 @@ export declare type PluginDeliveryOrderDto = Omit<PluginOrderDto, 'lineItems' |
1027
1033
  optionChoices: Array<{
1028
1034
  title: string;
1029
1035
  priceValue: number;
1036
+ quantity: number;
1030
1037
  }>;
1031
1038
  discounts?: Array<PluginDeliveryDiscount>;
1032
1039
  }>;
@@ -1094,7 +1101,7 @@ export declare interface PluginDraftOrderItem {
1094
1101
  /** 요청사항 */
1095
1102
  memo: string;
1096
1103
  /** 선택된 옵션 정보 */
1097
- optionChoices: PluginCatalogItemOptionChoice[];
1104
+ optionChoices: PluginOrderItemOptionChoice[];
1098
1105
  /** 수량 */
1099
1106
  quantity: number;
1100
1107
  /** 식사 유형 */
@@ -1324,7 +1331,7 @@ export declare type PluginOrderDto = {
1324
1331
  numGuests?: number;
1325
1332
  discounts: PluginDiscount[];
1326
1333
  tableId?: number;
1327
- lineItems: Omit<PluginOrderItem, 'id' | 'orderId'>[];
1334
+ lineItems: PluginOrderItemDto[];
1328
1335
  };
1329
1336
 
1330
1337
  /**
@@ -1346,11 +1353,48 @@ export declare interface PluginOrderItem {
1346
1353
  chargePrice: {
1347
1354
  value: number;
1348
1355
  };
1349
- optionChoices: PluginCatalogItemOptionChoice[];
1356
+ optionChoices: PluginOrderItemOptionChoice[];
1350
1357
  discounts?: PluginDiscount[];
1351
1358
  memo?: string;
1352
1359
  }
1353
1360
 
1361
+ /**
1362
+ * @publicApi
1363
+ */
1364
+ declare interface PluginOrderItemDto {
1365
+ diningOption: PluginOrderDiningOption;
1366
+ item: Pick<PluginCatalogItem, 'id' | 'title' | 'category' | 'code'> & {
1367
+ type: OrderItemType;
1368
+ };
1369
+ quantity: {
1370
+ value: number;
1371
+ };
1372
+ /**
1373
+ * @description 실제 고객이 결제하는 금액에 대한 정보입니다. (할인 적용 금액)
1374
+ */
1375
+ chargePrice: {
1376
+ value: number;
1377
+ };
1378
+ optionChoices: PluginOrderItemItemOptionChoiceDto[];
1379
+ discounts?: PluginDiscount[];
1380
+ memo?: string;
1381
+ }
1382
+
1383
+ /**
1384
+ * @publicApi
1385
+ */
1386
+ declare interface PluginOrderItemItemOptionChoiceDto {
1387
+ id: number;
1388
+ quantity: number;
1389
+ }
1390
+
1391
+ /**
1392
+ * 주문항목 옵션 선택
1393
+ */
1394
+ declare interface PluginOrderItemOptionChoice extends PluginCatalogItemOptionChoice {
1395
+ quantity: number;
1396
+ }
1397
+
1354
1398
  declare interface PluginOrderPaymentPrice {
1355
1399
  /** 미납 결제 금액 */
1356
1400
  paymentUnpaidValue: number;
@@ -1361,10 +1405,6 @@ declare interface PluginOrderPaymentPrice {
1361
1405
  /**
1362
1406
  * @publicApi
1363
1407
  * 주문의 결제상태
1364
- * 상태 전이 규칙은 아래 문서를 참조해주세요. (22.09)
1365
- * https://www.notion.so/tossteam/1affab9356d24d2d9256ca21be2db473
1366
- * 또다른 문서도 있어요. (25.03)
1367
- * https://www.notion.so/tossteam/1c3a360d33e380979d4df2a1ba3bfd31
1368
1408
  *
1369
1409
  * OPENED: 결제 전 (초기 상태)
1370
1410
  * PAID: 부분 결제 (일부 금액만 결제된 상태)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tossplace/pos-plugin-sdk",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "포스 플러그인 sdk",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/types/index.d.ts CHANGED
@@ -487,13 +487,18 @@ declare type NumberInput = BaseInput & {
487
487
  export declare interface Order {
488
488
  getOrder: (id: string) => Promise<PluginOrder>;
489
489
  /**
490
- * @param start yyyy-MM-dd
491
- * @param end yyyy-MM-dd
490
+ * @param start ISO 8601 포맷
491
+ * @param end ISO 8601 포맷
492
+ * @param page default 1
493
+ * @param size default 20
492
494
  * @description createdAt 기준으로 주문을 조회합니다
493
495
  */
494
- getOrders: (range: {
496
+ getOrders: (params: {
495
497
  start: string;
496
498
  end: string;
499
+ page?: number;
500
+ size?: number;
501
+ orderStates?: PluginOrderState[];
497
502
  }) => Promise<PluginOrder[]>;
498
503
  /**
499
504
  * @deprecated
@@ -909,6 +914,7 @@ export declare interface PluginCatalogItemOptionChoice {
909
914
  /** 키오스크에서 표시되는 아이콘 URL */
910
915
  imageUrl?: string | null;
911
916
  state: CatalogItemOptionChoiceState;
917
+ quantityInputEnabled: boolean;
912
918
  }
913
919
 
914
920
  /**
@@ -1014,6 +1020,7 @@ export declare type PluginDeliveryOrderDto = Omit<PluginOrderDto, 'lineItems' |
1014
1020
  optionChoices: Array<{
1015
1021
  title: string;
1016
1022
  priceValue: number;
1023
+ quantity: number;
1017
1024
  }>;
1018
1025
  discounts?: Array<PluginDeliveryDiscount>;
1019
1026
  }>;
@@ -1081,7 +1088,7 @@ export declare interface PluginDraftOrderItem {
1081
1088
  /** 요청사항 */
1082
1089
  memo: string;
1083
1090
  /** 선택된 옵션 정보 */
1084
- optionChoices: PluginCatalogItemOptionChoice[];
1091
+ optionChoices: PluginOrderItemOptionChoice[];
1085
1092
  /** 수량 */
1086
1093
  quantity: number;
1087
1094
  /** 식사 유형 */
@@ -1311,7 +1318,7 @@ export declare type PluginOrderDto = {
1311
1318
  numGuests?: number;
1312
1319
  discounts: PluginDiscount[];
1313
1320
  tableId?: number;
1314
- lineItems: Omit<PluginOrderItem, 'id' | 'orderId'>[];
1321
+ lineItems: PluginOrderItemDto[];
1315
1322
  };
1316
1323
 
1317
1324
  /**
@@ -1333,11 +1340,48 @@ export declare interface PluginOrderItem {
1333
1340
  chargePrice: {
1334
1341
  value: number;
1335
1342
  };
1336
- optionChoices: PluginCatalogItemOptionChoice[];
1343
+ optionChoices: PluginOrderItemOptionChoice[];
1337
1344
  discounts?: PluginDiscount[];
1338
1345
  memo?: string;
1339
1346
  }
1340
1347
 
1348
+ /**
1349
+ * @publicApi
1350
+ */
1351
+ declare interface PluginOrderItemDto {
1352
+ diningOption: PluginOrderDiningOption;
1353
+ item: Pick<PluginCatalogItem, 'id' | 'title' | 'category' | 'code'> & {
1354
+ type: OrderItemType;
1355
+ };
1356
+ quantity: {
1357
+ value: number;
1358
+ };
1359
+ /**
1360
+ * @description 실제 고객이 결제하는 금액에 대한 정보입니다. (할인 적용 금액)
1361
+ */
1362
+ chargePrice: {
1363
+ value: number;
1364
+ };
1365
+ optionChoices: PluginOrderItemItemOptionChoiceDto[];
1366
+ discounts?: PluginDiscount[];
1367
+ memo?: string;
1368
+ }
1369
+
1370
+ /**
1371
+ * @publicApi
1372
+ */
1373
+ declare interface PluginOrderItemItemOptionChoiceDto {
1374
+ id: number;
1375
+ quantity: number;
1376
+ }
1377
+
1378
+ /**
1379
+ * 주문항목 옵션 선택
1380
+ */
1381
+ declare interface PluginOrderItemOptionChoice extends PluginCatalogItemOptionChoice {
1382
+ quantity: number;
1383
+ }
1384
+
1341
1385
  declare interface PluginOrderPaymentPrice {
1342
1386
  /** 미납 결제 금액 */
1343
1387
  paymentUnpaidValue: number;
@@ -1348,10 +1392,6 @@ declare interface PluginOrderPaymentPrice {
1348
1392
  /**
1349
1393
  * @publicApi
1350
1394
  * 주문의 결제상태
1351
- * 상태 전이 규칙은 아래 문서를 참조해주세요. (22.09)
1352
- * https://www.notion.so/tossteam/1affab9356d24d2d9256ca21be2db473
1353
- * 또다른 문서도 있어요. (25.03)
1354
- * https://www.notion.so/tossteam/1c3a360d33e380979d4df2a1ba3bfd31
1355
1395
  *
1356
1396
  * OPENED: 결제 전 (초기 상태)
1357
1397
  * PAID: 부분 결제 (일부 금액만 결제된 상태)