@yolo-croket-dev/amqp-access 0.7.255 → 0.7.256

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/AGENTS.md ADDED
@@ -0,0 +1,54 @@
1
+ # AMQP-ACCESS KNOWLEDGE BASE
2
+
3
+ ## OVERVIEW
4
+
5
+ 저트래픽 레거시 RabbitMQ RPC를 위한 서비스별 DTO와 Nest injectable client를 제공한다. 신규 고부하/비동기 흐름은 이 패키지보다 `amqp-rabbit-mq`를 먼저 검토한다.
6
+
7
+ ## STRUCTURE
8
+
9
+ ```text
10
+ amqp-access/
11
+ ├── index.ts # package public barrel
12
+ ├── <service>/
13
+ │ ├── dto/ # command/query payload/result
14
+ │ ├── services/ # AmqpXxxService
15
+ │ ├── amqp.<domain>.module.ts
16
+ │ ├── *.provider.ts
17
+ │ └── index.ts # domain public barrel
18
+ └── package.json
19
+ ```
20
+
21
+ 큰 영역은 `store-item-server`, `user-service`, `order-server`; 변경 전 해당 service의 `services`, `dto`, 모든 상위 barrel을 함께 추적한다.
22
+
23
+ ## WHERE TO LOOK
24
+
25
+ | 작업 | 위치 | 확인 |
26
+ |---|---|---|
27
+ | 호출 method 추가 | `<service>/services/amqp.*.service.ts` | `AmqpManagement.call` 인자와 return type |
28
+ | contract 추가 | `<service>/dto/<domain>/{command,query}` | validator, Payload/Result export |
29
+ | provider/module 추가 | `<service>/*.provider.ts`, `amqp.*.module.ts` | injection token과 package barrel |
30
+ | 상품/주문 대형 surface | `store-item-server`, `order-server` | 기존 domain naming과 route literal 검색 |
31
+
32
+ ## CONVENTIONS
33
+
34
+ - Service class는 `AmqpXxxService`, 파일은 `amqp.<domain>.service.ts` 패턴을 유지한다.
35
+ - DTO는 command/query와 도메인 경계를 유지하고 `class-validator` decorator를 boundary validation에 사용한다.
36
+ - Route 변경은 `rg "<actual.route.key>"`로 caller/consumer를 함께 찾고 실제 문자열을 코드 검색 가능하게 둔다.
37
+ - Public contract는 leaf `index.ts`부터 service, package root barrel까지 빠짐없이 export한다.
38
+ - `AbstractParam`과 `AbstractRequest` shape를 임의 복제하지 않고 `@yolo-croket-dev/core`를 사용한다.
39
+
40
+ ## ANTI-PATTERNS
41
+
42
+ - retry/DLQ/concurrency가 필요한 신규 작업을 편의상 legacy RPC에 추가하지 않는다.
43
+ - Repository/consumer의 비즈니스 상태 판단을 DTO/client service로 옮기지 않는다.
44
+ - 기존 route key를 새 wrapper constant 뒤에 숨기지 않는다.
45
+ - `entity`, `entity-v2`, `dto-v2` 호환성을 확인하지 않고 public type을 변경하지 않는다.
46
+
47
+ ## VERIFY
48
+
49
+ ```bash
50
+ yarn workspace @yolo-croket-dev/amqp-access build
51
+ yarn workspace @yolo-croket-dev/amqp-access lint
52
+ ```
53
+
54
+ 패키지 test script는 없다. contract 변경은 실제 소비 서비스의 compile/test까지 검증한다.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yolo-croket-dev/amqp-access",
3
- "version": "0.7.255",
3
+ "version": "0.7.256",
4
4
  "main": "index.js",
5
5
  "author": "Yolo Co., Ltd.",
6
6
  "description": "크로켓 amqp-access npm",
@@ -2,3 +2,5 @@ export * from './re-process-nicepay-billing-refund-by-refund-error.dto';
2
2
  export * from './re-process-tosspayments-refund-by-refund-error.dto';
3
3
  export * from './resolve-nicepay-billing-refund-by-refund-error.dto';
4
4
  export * from './resolve-tosspayments-refund-by-refund-error.dto';
5
+ export * from './refund-waiting-buyer-action.dto';
6
+ export * from './process-refund-waiting-unavailable-by-admin.dto';
@@ -18,3 +18,5 @@ __exportStar(require("./re-process-nicepay-billing-refund-by-refund-error.dto"),
18
18
  __exportStar(require("./re-process-tosspayments-refund-by-refund-error.dto"), exports);
19
19
  __exportStar(require("./resolve-nicepay-billing-refund-by-refund-error.dto"), exports);
20
20
  __exportStar(require("./resolve-tosspayments-refund-by-refund-error.dto"), exports);
21
+ __exportStar(require("./refund-waiting-buyer-action.dto"), exports);
22
+ __exportStar(require("./process-refund-waiting-unavailable-by-admin.dto"), exports);
@@ -0,0 +1,4 @@
1
+ /** @author sj */
2
+ export declare class ProcessRefundWaitingUnavailableByAdminPayload {
3
+ PInfoId: string;
4
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ProcessRefundWaitingUnavailableByAdminPayload = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /** @author sj */
15
+ class ProcessRefundWaitingUnavailableByAdminPayload {
16
+ }
17
+ exports.ProcessRefundWaitingUnavailableByAdminPayload = ProcessRefundWaitingUnavailableByAdminPayload;
18
+ __decorate([
19
+ (0, class_validator_1.IsMongoId)(),
20
+ (0, class_validator_1.IsNotEmpty)(),
21
+ __metadata("design:type", String)
22
+ ], ProcessRefundWaitingUnavailableByAdminPayload.prototype, "PInfoId", void 0);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @author sj
3
+ * @description 구매자가 환불 대기 건에서 상품 기다리기 또는 환불 받기를 선택할 때 사용하는 계약이다.
4
+ * @process PurchasedInfo 식별 → payment-service가 구매자 권한과 환불 대기 상태를 검증 → 액션 처리
5
+ */
6
+ export declare class RefundWaitingBuyerActionPayload {
7
+ PInfoId: string;
8
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RefundWaitingBuyerActionPayload = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /**
15
+ * @author sj
16
+ * @description 구매자가 환불 대기 건에서 상품 기다리기 또는 환불 받기를 선택할 때 사용하는 계약이다.
17
+ * @process PurchasedInfo 식별 → payment-service가 구매자 권한과 환불 대기 상태를 검증 → 액션 처리
18
+ */
19
+ class RefundWaitingBuyerActionPayload {
20
+ }
21
+ exports.RefundWaitingBuyerActionPayload = RefundWaitingBuyerActionPayload;
22
+ __decorate([
23
+ (0, class_validator_1.IsMongoId)(),
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ __metadata("design:type", String)
26
+ ], RefundWaitingBuyerActionPayload.prototype, "PInfoId", void 0);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @author sj
3
+ * @description 선택한 환불 사유가 환불 대기 정책으로 분기되는지 조회하기 위한 요청/응답 계약이다.
4
+ * @process 결제 ID와 환불 사유 코드를 전달 → payment-service가 셀러 권한 및 주문 상태를 확인 → Boolean 결과 반환
5
+ */
6
+ export declare class CheckRefundWaitingApplicabilityPayload {
7
+ /** 환불 대기 대상 여부를 확인할 PurchasedInfo ID */
8
+ PInfoId: string;
9
+ /** 셀러가 선택한 기존 환불 사유 코드. SELLER_0~2만 환불 대기 대상이다. */
10
+ refundTypeCode: string;
11
+ }
12
+ export declare class CheckRefundWaitingApplicabilityResult {
13
+ /** 선택한 사유로 환불을 요청하면 환불 대기 워크플로가 적용되는지 여부 */
14
+ isRefundWaitingApplicable: boolean;
15
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CheckRefundWaitingApplicabilityResult = exports.CheckRefundWaitingApplicabilityPayload = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /**
15
+ * @author sj
16
+ * @description 선택한 환불 사유가 환불 대기 정책으로 분기되는지 조회하기 위한 요청/응답 계약이다.
17
+ * @process 결제 ID와 환불 사유 코드를 전달 → payment-service가 셀러 권한 및 주문 상태를 확인 → Boolean 결과 반환
18
+ */
19
+ class CheckRefundWaitingApplicabilityPayload {
20
+ }
21
+ exports.CheckRefundWaitingApplicabilityPayload = CheckRefundWaitingApplicabilityPayload;
22
+ __decorate([
23
+ (0, class_validator_1.IsMongoId)(),
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ __metadata("design:type", String)
26
+ ], CheckRefundWaitingApplicabilityPayload.prototype, "PInfoId", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsString)(),
29
+ (0, class_validator_1.IsNotEmpty)(),
30
+ __metadata("design:type", String)
31
+ ], CheckRefundWaitingApplicabilityPayload.prototype, "refundTypeCode", void 0);
32
+ class CheckRefundWaitingApplicabilityResult {
33
+ }
34
+ exports.CheckRefundWaitingApplicabilityResult = CheckRefundWaitingApplicabilityResult;
35
+ __decorate([
36
+ (0, class_validator_1.IsBoolean)(),
37
+ __metadata("design:type", Boolean)
38
+ ], CheckRefundWaitingApplicabilityResult.prototype, "isRefundWaitingApplicable", void 0);
@@ -1,5 +1,6 @@
1
1
  export * from './get-refunds-analytics-aggregation-refunding-top3.dto';
2
2
  export * from './check-for-immediate-refund-availability-v2.dto';
3
+ export * from './check-refund-waiting-eligibility.dto';
3
4
  export * from './get-refund-notice.dto';
4
5
  export * from './get-refunds-for-admin.dto';
5
6
  export * from './get-refund-errors-for-admin.dto';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-refunds-analytics-aggregation-refunding-top3.dto"), exports);
18
18
  __exportStar(require("./check-for-immediate-refund-availability-v2.dto"), exports);
19
+ __exportStar(require("./check-refund-waiting-eligibility.dto"), exports);
19
20
  __exportStar(require("./get-refund-notice.dto"), exports);
20
21
  __exportStar(require("./get-refunds-for-admin.dto"), exports);
21
22
  __exportStar(require("./get-refund-errors-for-admin.dto"), exports);
@@ -1,7 +1,7 @@
1
1
  import { ClientProxy } from '@nestjs/microservices';
2
2
  import { AbstractParam } from '@yolo-croket-dev/core';
3
- import { ReProcessNicepayBillingRefundByRefundErrorPayload, ReProcessTosspaymentsRefundByRefundErrorPayload, ResolveNicepayBillingRefundByRefundErrorPayload, ResolveTosspaymentsRefundByRefundErrorPayload } from '../dto';
4
- import { CheckForImmediateRefundAvailabilityV2Payload, CheckForImmediateRefundAvailabilityV2Result, GetRefundErrorsForAdminPayload, GetRefundsForAdminPayload, GetRefundsForAdminResult, GetRefundsAnalyticsAggregationRefundingTop3Payload, GetRefundsAnalyticsAggregationRefundingTop3Result, GetRefundNoticePayload, GetRefundNoticeResult } from '../dto/refund/query';
3
+ import { ReProcessNicepayBillingRefundByRefundErrorPayload, ReProcessTosspaymentsRefundByRefundErrorPayload, ResolveNicepayBillingRefundByRefundErrorPayload, ResolveTosspaymentsRefundByRefundErrorPayload, RefundWaitingBuyerActionPayload, ProcessRefundWaitingUnavailableByAdminPayload } from '../dto';
4
+ import { CheckForImmediateRefundAvailabilityV2Payload, CheckForImmediateRefundAvailabilityV2Result, CheckRefundWaitingApplicabilityPayload, CheckRefundWaitingApplicabilityResult, GetRefundErrorsForAdminPayload, GetRefundsForAdminPayload, GetRefundsForAdminResult, GetRefundsAnalyticsAggregationRefundingTop3Payload, GetRefundsAnalyticsAggregationRefundingTop3Result, GetRefundNoticePayload, GetRefundNoticeResult } from '../dto/refund/query';
5
5
  export declare class AmqpRefundService {
6
6
  private readonly client;
7
7
  private readonly amqpManager;
@@ -15,5 +15,13 @@ export declare class AmqpRefundService {
15
15
  getRefundsForAdmin(payload: GetRefundsForAdminPayload, param: AbstractParam): Promise<GetRefundsForAdminResult>;
16
16
  getRefundErrorsForAdmin(payload: GetRefundErrorsForAdminPayload, param: AbstractParam): Promise<GetRefundsForAdminResult>;
17
17
  checkForImmediateRefundAvailabilityV2(payload: CheckForImmediateRefundAvailabilityV2Payload, param: AbstractParam): Promise<CheckForImmediateRefundAvailabilityV2Result>;
18
+ /** 선택한 환불 사유에 환불 대기 정책이 적용되는지 조회한다. */
19
+ checkRefundWaitingApplicability(payload: CheckRefundWaitingApplicabilityPayload, param: AbstractParam): Promise<CheckRefundWaitingApplicabilityResult>;
20
+ /** 구매자의 상품 기다리기 선택을 처리한다. */
21
+ waitForRefundWaitingItem(payload: RefundWaitingBuyerActionPayload, param: AbstractParam): Promise<void>;
22
+ /** 구매자의 환불 받기 선택을 기존 일반 환불 프로세스로 전환한다. */
23
+ requestRefundFromWaiting(payload: RefundWaitingBuyerActionPayload, param: AbstractParam): Promise<void>;
24
+ /** 관리자의 환불 대기 이관 불가 처리를 실제 환불로 전환한다. */
25
+ processRefundWaitingUnavailableByAdmin(payload: ProcessRefundWaitingUnavailableByAdminPayload, param: AbstractParam): Promise<void>;
18
26
  getRefundNotice(payload: GetRefundNoticePayload, param: AbstractParam): Promise<GetRefundNoticeResult>;
19
27
  }
@@ -49,6 +49,22 @@ let AmqpRefundService = class AmqpRefundService {
49
49
  async checkForImmediateRefundAvailabilityV2(payload, param) {
50
50
  return this.amqpManager.call('환불 가능 여부 조회', 'refund.check-for-immediate-refund-availability-v2', payload, param, { isErrorThrowing: true });
51
51
  }
52
+ /** 선택한 환불 사유에 환불 대기 정책이 적용되는지 조회한다. */
53
+ async checkRefundWaitingApplicability(payload, param) {
54
+ return this.amqpManager.call('환불 대기 정책 적용 여부 조회', 'refund.check-refund-waiting-applicability', payload, param, { isErrorThrowing: true });
55
+ }
56
+ /** 구매자의 상품 기다리기 선택을 처리한다. */
57
+ async waitForRefundWaitingItem(payload, param) {
58
+ return this.amqpManager.call('구매자 상품 기다리기 선택', 'refund.waiting.wait-for-item', payload, param, { isErrorThrowing: true });
59
+ }
60
+ /** 구매자의 환불 받기 선택을 기존 일반 환불 프로세스로 전환한다. */
61
+ async requestRefundFromWaiting(payload, param) {
62
+ return this.amqpManager.call('구매자 환불 대기 환불 요청', 'refund.waiting.request-refund', payload, param, { isErrorThrowing: true });
63
+ }
64
+ /** 관리자의 환불 대기 이관 불가 처리를 실제 환불로 전환한다. */
65
+ async processRefundWaitingUnavailableByAdmin(payload, param) {
66
+ return this.amqpManager.call('관리자 환불 대기 이관 불가 처리', 'refund.waiting.process-unavailable-by-admin', payload, param, { isErrorThrowing: true });
67
+ }
52
68
  async getRefundNotice(payload, param) {
53
69
  return this.amqpManager.call('환불 안내 조회', 'refund.get.notice', payload, param, { isErrorThrowing: true });
54
70
  }
@@ -21,7 +21,7 @@ export declare class EditStoreItemUsedInfo {
21
21
  conditionGrade?: StoreItemUsedConditionGradeEnum | null;
22
22
  releasePriceInfo?: EditStoreItemUsedReleasePriceInfo | null;
23
23
  }
24
- declare const EditStoreItemBasePayload_base: import("@nestjs/mapped-types").MappedType<Omit<RegStoreItemPayload, "itemType" | "mainSku" | "usedItemInfo">>;
24
+ declare const EditStoreItemBasePayload_base: import("@nestjs/mapped-types").MappedType<Omit<RegStoreItemPayload, "itemType" | "usedItemInfo" | "mainSku">>;
25
25
  declare class EditStoreItemBasePayload extends EditStoreItemBasePayload_base {
26
26
  }
27
27
  /**
@@ -49,6 +49,8 @@ export declare class GetStoreItemIdsByAtlasSearchPayload {
49
49
  DType?: GetStoreItemByAtlasDTypeEnum;
50
50
  /** 검색어 */
51
51
  inputText?: string;
52
+ /** OR 조건으로 함께 검색할 검색어 목록 */
53
+ inputTexts?: string[];
52
54
  /** 검색 키워드로 검색한 상품 리스트인가 */
53
55
  searchKeywordId?: string;
54
56
  /** 최소 가격 */
@@ -112,6 +112,16 @@ __decorate([
112
112
  (0, class_validator_1.IsOptional)(),
113
113
  __metadata("design:type", String)
114
114
  ], GetStoreItemIdsByAtlasSearchPayload.prototype, "inputText", void 0);
115
+ __decorate([
116
+ (0, class_validator_1.IsOptional)(),
117
+ (0, class_validator_1.IsArray)(),
118
+ (0, class_validator_1.ArrayMinSize)(1),
119
+ (0, class_validator_1.ArrayMaxSize)(7),
120
+ (0, class_validator_1.ArrayUnique)(),
121
+ (0, class_validator_1.IsString)({ each: true }),
122
+ (0, class_validator_1.MinLength)(1, { each: true }),
123
+ __metadata("design:type", Array)
124
+ ], GetStoreItemIdsByAtlasSearchPayload.prototype, "inputTexts", void 0);
115
125
  __decorate([
116
126
  (0, class_validator_1.IsString)(),
117
127
  (0, class_validator_1.IsOptional)(),