@yolo-croket-dev/amqp-access 0.7.257-sj3 → 0.7.258
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/manage-service/dto/exchange-rate/query/get-exchange-rate-by-country-code.dto.d.ts +24 -0
- package/manage-service/dto/exchange-rate/query/get-exchange-rate-by-country-code.dto.js +34 -1
- package/manage-service/services/amqp-exchange-rate.service.d.ts +2 -2
- package/order-server/dto/purchased-info.modules/purchased-info-admin/command/transfer-p-info-seller.dto.d.ts +0 -2
- package/order-server/dto/purchased-info.modules/purchased-info-admin/command/transfer-p-info-seller.dto.js +0 -5
- package/order-server/dto/purchased-info.modules/purchased-info-admin/query/index.d.ts +0 -1
- package/order-server/dto/purchased-info.modules/purchased-info-admin/query/index.js +0 -1
- package/order-server/dto/purchasedinfos/query/atlas/get-facet-p-infos-for-manage-buyer-by-atlas.dto.d.ts +0 -2
- package/order-server/dto/purchasedinfos/query/atlas/get-facet-p-infos-for-manage-buyer-by-atlas.dto.js +0 -4
- package/order-server/dto/purchasedinfos/query/atlas/get-p-infos-for-manage-buyer-by-atlas.dto.d.ts +0 -3
- package/order-server/dto/purchasedinfos/query/atlas/get-p-infos-for-manage-buyer-by-atlas.dto.js +0 -5
- package/order-server/services/purchased-info.modules/amqp.purchased-info-admin.service.d.ts +1 -3
- package/order-server/services/purchased-info.modules/amqp.purchased-info-admin.service.js +0 -4
- package/package.json +4 -4
- package/scripts/verify-exchange-rate-contract.mjs +121 -0
- package/test-fixtures/exchange-rate-contract/bad-currency.json +1 -0
- package/test-fixtures/exchange-rate-contract/bad-date.json +1 -0
- package/test-fixtures/exchange-rate-contract/bad-rate.json +6 -0
- package/test-fixtures/exchange-rate-contract/unsupported-extra-key.json +1 -0
- package/test-fixtures/exchange-rate-contract/unsupported-only.json +1 -0
- package/test-fixtures/exchange-rate-contract/valid-cad.json +1 -0
- package/test-fixtures/exchange-rate-contract/valid-jpy.json +1 -0
- package/test-fixtures/exchange-rate-contract/valid-usd.json +1 -0
- package/order-server/dto/purchased-info.modules/purchased-info-admin/query/get-refund-waiting-purchased-infos-for-admin.dto.d.ts +0 -42
- package/order-server/dto/purchased-info.modules/purchased-info-admin/query/get-refund-waiting-purchased-infos-for-admin.dto.js +0 -58
|
@@ -10,3 +10,27 @@ export interface GetExchangeRateByCountryCodeResult {
|
|
|
10
10
|
exchangeRate?: number;
|
|
11
11
|
currencyCode?: string;
|
|
12
12
|
}
|
|
13
|
+
type AsciiDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
|
14
|
+
type IsExactEightAsciiDigits<Value extends string, Digits extends unknown[] = []> = Value extends '' ? Digits['length'] extends 8 ? true : false : Digits['length'] extends 8 ? false : Value extends `${AsciiDigit}${infer Rest}` ? IsExactEightAsciiDigits<Rest, [...Digits, unknown]> : false;
|
|
15
|
+
export type ExchangeRateBaseDateLiteral<Value extends string> = string extends Value ? Value : IsExactEightAsciiDigits<Value> extends true ? Value : never;
|
|
16
|
+
type ExchangeRateBaseDateInput<Value extends string> = string extends Value ? unknown : ExchangeRateBaseDateLiteral<Value> extends never ? {
|
|
17
|
+
readonly exchangeRateBaseDateMustBeExactlyEightAsciiDigits: never;
|
|
18
|
+
} : unknown;
|
|
19
|
+
declare const exchangeRateBaseDateBrand: unique symbol;
|
|
20
|
+
export type ExchangeRateBaseDate = string & {
|
|
21
|
+
readonly [exchangeRateBaseDateBrand]: 'ExchangeRateBaseDate';
|
|
22
|
+
};
|
|
23
|
+
type UppercaseAsciiLetter = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
|
|
24
|
+
export type ExchangeRateCurrencyCode = `${UppercaseAsciiLetter}${UppercaseAsciiLetter}${UppercaseAsciiLetter}`;
|
|
25
|
+
export type GetExchangeRateByCountryCodeExactResult = {
|
|
26
|
+
readonly isSupported: true;
|
|
27
|
+
readonly baseDate: ExchangeRateBaseDate;
|
|
28
|
+
readonly exchangeRate: number;
|
|
29
|
+
readonly currencyCode: ExchangeRateCurrencyCode;
|
|
30
|
+
} | {
|
|
31
|
+
readonly isSupported: false;
|
|
32
|
+
};
|
|
33
|
+
export declare function isExchangeRateBaseDate(value: string): value is ExchangeRateBaseDate;
|
|
34
|
+
export declare function toExchangeRateBaseDate<const Value extends string>(value: Value & ExchangeRateBaseDateInput<Value>): ExchangeRateBaseDate;
|
|
35
|
+
export declare function isGetExchangeRateByCountryCodeExactResult(value: unknown): value is GetExchangeRateByCountryCodeExactResult;
|
|
36
|
+
export {};
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GetExchangeRateByCountryCodePayload = void 0;
|
|
12
|
+
exports.isGetExchangeRateByCountryCodeExactResult = exports.toExchangeRateBaseDate = exports.isExchangeRateBaseDate = exports.GetExchangeRateByCountryCodePayload = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
class GetExchangeRateByCountryCodePayload {
|
|
15
15
|
}
|
|
@@ -23,3 +23,36 @@ __decorate([
|
|
|
23
23
|
(0, class_validator_1.IsOptional)(),
|
|
24
24
|
__metadata("design:type", Date)
|
|
25
25
|
], GetExchangeRateByCountryCodePayload.prototype, "asOfDate", void 0);
|
|
26
|
+
function isObjectRecord(value) {
|
|
27
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
28
|
+
}
|
|
29
|
+
function isExchangeRateBaseDate(value) {
|
|
30
|
+
return /^\d{8}$/.test(value);
|
|
31
|
+
}
|
|
32
|
+
exports.isExchangeRateBaseDate = isExchangeRateBaseDate;
|
|
33
|
+
function toExchangeRateBaseDate(value) {
|
|
34
|
+
if (!isExchangeRateBaseDate(value)) {
|
|
35
|
+
throw new TypeError('Exchange-rate baseDate must be exactly eight ASCII digits');
|
|
36
|
+
}
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
exports.toExchangeRateBaseDate = toExchangeRateBaseDate;
|
|
40
|
+
function isGetExchangeRateByCountryCodeExactResult(value) {
|
|
41
|
+
if (!isObjectRecord(value)) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
const keys = Object.keys(value).sort();
|
|
45
|
+
if (value.isSupported === false) {
|
|
46
|
+
return keys.length === 1 && keys[0] === 'isSupported';
|
|
47
|
+
}
|
|
48
|
+
return value.isSupported === true
|
|
49
|
+
&& keys.join(',') === 'baseDate,currencyCode,exchangeRate,isSupported'
|
|
50
|
+
&& typeof value.baseDate === 'string'
|
|
51
|
+
&& isExchangeRateBaseDate(value.baseDate)
|
|
52
|
+
&& typeof value.currencyCode === 'string'
|
|
53
|
+
&& /^[A-Z]{3}$/.test(value.currencyCode)
|
|
54
|
+
&& typeof value.exchangeRate === 'number'
|
|
55
|
+
&& Number.isFinite(value.exchangeRate)
|
|
56
|
+
&& value.exchangeRate > 0;
|
|
57
|
+
}
|
|
58
|
+
exports.isGetExchangeRateByCountryCodeExactResult = isGetExchangeRateByCountryCodeExactResult;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ClientProxy } from '@nestjs/microservices';
|
|
2
2
|
import { AbstractParam } from '@yolo-croket-dev/core';
|
|
3
|
-
import { GetExchangedAmountByCountryCodePayload, GetExchangedAmountByCountryCodeResult, GetExchangeFeeByCountryCodePayload, GetExchangeFeeByCountryCodeResult, GetExchangeRateByCountryCodePayload,
|
|
3
|
+
import { GetExchangedAmountByCountryCodePayload, GetExchangedAmountByCountryCodeResult, GetExchangeFeeByCountryCodePayload, GetExchangeFeeByCountryCodeResult, GetExchangeRateByCountryCodePayload, GetExchangeRateByCountryCodeExactResult, GetExchangeRateResult } from '../dto';
|
|
4
4
|
export declare class AmqpExchangeRateService {
|
|
5
5
|
private readonly client;
|
|
6
6
|
private readonly amqpManager;
|
|
7
7
|
constructor(client: ClientProxy);
|
|
8
8
|
getExchangeRate(param: AbstractParam): Promise<GetExchangeRateResult[]>;
|
|
9
|
-
getExchangeRateByCountryCode(payload: GetExchangeRateByCountryCodePayload, param: AbstractParam): Promise<
|
|
9
|
+
getExchangeRateByCountryCode(payload: GetExchangeRateByCountryCodePayload, param: AbstractParam): Promise<GetExchangeRateByCountryCodeExactResult>;
|
|
10
10
|
getExchangeFeeByCountryCode(payload: GetExchangeFeeByCountryCodePayload, param: AbstractParam): Promise<GetExchangeFeeByCountryCodeResult>;
|
|
11
11
|
getExchangedAmountByCountryCode(payload: GetExchangedAmountByCountryCodePayload, param: AbstractParam): Promise<GetExchangedAmountByCountryCodeResult>;
|
|
12
12
|
refreshCurrentBaseDateExchangeRate(param: AbstractParam): Promise<void>;
|
|
@@ -26,8 +26,3 @@ __decorate([
|
|
|
26
26
|
(0, class_validator_1.IsMongoId)(),
|
|
27
27
|
__metadata("design:type", String)
|
|
28
28
|
], TransferPInfoSellerPayload.prototype, "newSellerId", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, class_validator_1.IsBoolean)(),
|
|
31
|
-
(0, class_validator_1.IsOptional)(),
|
|
32
|
-
__metadata("design:type", Boolean)
|
|
33
|
-
], TransferPInfoSellerPayload.prototype, "isRefundWaitingTransfer", void 0);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './get-purchased-infos-for-admin.dto';
|
|
2
|
-
export * from './get-refund-waiting-purchased-infos-for-admin.dto';
|
|
3
2
|
export * from './get-purchased-info-detail-for-admin-edit.dto';
|
|
4
3
|
export * from './get-purchased-info-logs-for-coupon-info.dto';
|
|
5
4
|
export * from './get-delivery-list-for-admin.dto';
|
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./get-purchased-infos-for-admin.dto"), exports);
|
|
18
|
-
__exportStar(require("./get-refund-waiting-purchased-infos-for-admin.dto"), exports);
|
|
19
18
|
__exportStar(require("./get-purchased-info-detail-for-admin-edit.dto"), exports);
|
|
20
19
|
__exportStar(require("./get-purchased-info-logs-for-coupon-info.dto"), exports);
|
|
21
20
|
__exportStar(require("./get-delivery-list-for-admin.dto"), exports);
|
|
@@ -14,12 +14,10 @@ export declare class GetFacetPInfosForManageBuyerByAtlasPayload {
|
|
|
14
14
|
paymentSDate?: Date;
|
|
15
15
|
paymentEDate?: Date;
|
|
16
16
|
searchText?: string;
|
|
17
|
-
isTransferred?: boolean;
|
|
18
17
|
}
|
|
19
18
|
export declare class GetFacetPInfosForManageBuyerByAtlasResult {
|
|
20
19
|
allCount: number;
|
|
21
20
|
facets: FacetPInfo[];
|
|
22
21
|
allCount_v2: number;
|
|
23
22
|
facets_v2: FacetPInfoV2[];
|
|
24
|
-
transferPInfoNums?: number;
|
|
25
23
|
}
|
|
@@ -44,10 +44,6 @@ __decorate([
|
|
|
44
44
|
(0, class_validator_1.IsOptional)(),
|
|
45
45
|
__metadata("design:type", String)
|
|
46
46
|
], GetFacetPInfosForManageBuyerByAtlasPayload.prototype, "searchText", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, class_validator_1.IsOptional)(),
|
|
49
|
-
__metadata("design:type", Boolean)
|
|
50
|
-
], GetFacetPInfosForManageBuyerByAtlasPayload.prototype, "isTransferred", void 0);
|
|
51
47
|
class GetFacetPInfosForManageBuyerByAtlasResult {
|
|
52
48
|
}
|
|
53
49
|
exports.GetFacetPInfosForManageBuyerByAtlasResult = GetFacetPInfosForManageBuyerByAtlasResult;
|
package/order-server/dto/purchasedinfos/query/atlas/get-p-infos-for-manage-buyer-by-atlas.dto.d.ts
CHANGED
|
@@ -25,8 +25,6 @@ export declare class GetPInfosForManageBuyerByAtlasPayload {
|
|
|
25
25
|
isUsedItem?: boolean;
|
|
26
26
|
/** 개인통관고유부호 등록 예정 모아보기 필터 여부 */
|
|
27
27
|
isPcccDeferred?: boolean;
|
|
28
|
-
/** 이관 완료 거래만 조회한다. */
|
|
29
|
-
isTransferred?: boolean;
|
|
30
28
|
}
|
|
31
29
|
export declare class GetPInfosForManageBuyerByAtlasResult {
|
|
32
30
|
allCount: number;
|
|
@@ -35,5 +33,4 @@ export declare class GetPInfosForManageBuyerByAtlasResult {
|
|
|
35
33
|
splitDeliveryPInfoNums?: number;
|
|
36
34
|
usedPInfoNums?: number;
|
|
37
35
|
pcccDeferredPInfoNums?: number;
|
|
38
|
-
transferPInfoNums?: number;
|
|
39
36
|
}
|
package/order-server/dto/purchasedinfos/query/atlas/get-p-infos-for-manage-buyer-by-atlas.dto.js
CHANGED
|
@@ -87,11 +87,6 @@ __decorate([
|
|
|
87
87
|
(0, class_validator_1.IsOptional)(),
|
|
88
88
|
__metadata("design:type", Boolean)
|
|
89
89
|
], GetPInfosForManageBuyerByAtlasPayload.prototype, "isPcccDeferred", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
(0, class_validator_1.IsBoolean)(),
|
|
92
|
-
(0, class_validator_1.IsOptional)(),
|
|
93
|
-
__metadata("design:type", Boolean)
|
|
94
|
-
], GetPInfosForManageBuyerByAtlasPayload.prototype, "isTransferred", void 0);
|
|
95
90
|
class GetPInfosForManageBuyerByAtlasResult {
|
|
96
91
|
}
|
|
97
92
|
exports.GetPInfosForManageBuyerByAtlasResult = GetPInfosForManageBuyerByAtlasResult;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { ClientProxy } from '@nestjs/microservices';
|
|
2
2
|
import { AbstractParam } from '@yolo-croket-dev/core';
|
|
3
|
-
import { GetPurchasedInfosForAdminPayload, GetPurchasedInfosForAdminResult,
|
|
3
|
+
import { GetPurchasedInfosForAdminPayload, GetPurchasedInfosForAdminResult, GetPurchasedInfoDetailForAdminEditPayload, GetPurchasedInfoDetailForAdminEditResult, EditPInfoEtcDataPayload, EditPInfoMemoPayload, EditPInfoPricePayload, EditPInfoProcessPayload, EditPInfoReceiverInfoPayload, EditPInfoWaitingReceiveInfoPayload, EditPInfoUsedCouponInfoPayload, DeletePInfoUsedCouponInfoPayload, GetPurchasedInfoLogsForCouponInfoPayload, GetPurchasedInfoLogsForCouponInfoResult, UpdateProcessFinishedToCancelledPayload, GetDeliveryListForAdminPayload, GetDeliveryListForAdminResult, UpsertInvoiceForAdminPayload, DeleteInvoiceForAdminPayload, UpsertSplitInvoiceForAdminPayload, DeleteSplitInvoiceForAdminPayload, TransferPInfoSellerPayload, GetPInfosByYgTypePayload, GetPInfosByYgTypeResult, GetCrawlerProxyOrderListForAdminPayload, GetCrawlerProxyOrderListForAdminResult, UpdateCrawlerProxyOrderInfoForAdminPayload, UpdateCrawlerProxyOrderPurchaseOrderNumberBulkPayload, UpdateCrawlerProxyOrderPurchaseOrderNumberBulkResult, UpdateCrawlerProxyOrderPurchaseInvoiceBulkPayload, UpdateCrawlerProxyOrderPurchaseInvoiceBulkResult, AcceptCrawlerProxyOrderForAdminPayload, CheckCrawlerProxyOrderStockForAdminPayload, RequestCrawlerProxyOrderPaymentForAdminPayload, GetPriceCompareAffiliatePInfosForAdminPayload, GetPriceCompareAffiliatePInfosForAdminResult, GetPriceCompareAffiliatePInfosForAdminExcelResult, GetPriceCompareAffiliateSettleDoneRefundedPInfosForAdminPayload, GetPriceCompareAffiliateSettleDoneRefundedPInfosForAdminExcelResult, UpdatePriceCompareAffiliateSettleStatusPayload, GetCrawlerForwardingAgentsForAdminPayload, GetCrawlerForwardingAgentsForAdminResult, CreateCrawlerForwardingAgentForAdminPayload, UpdateCrawlerForwardingAgentForAdminPayload, UpdateCrawlerForwardingAgentActiveForAdminPayload, GetShippingForwarderApplicationSnapshotPayload, GetShippingForwarderApplicationSnapshotResult, RegisterShippingForwarderDomesticInvoicePayload, RegisterShippingForwarderDomesticInvoiceResult } from '../../dto/purchased-info.modules/purchased-info-admin';
|
|
4
4
|
export declare class AmqpPurchasedInfoAdminService {
|
|
5
5
|
private readonly client;
|
|
6
6
|
private readonly amqpManager;
|
|
7
7
|
constructor(client: ClientProxy);
|
|
8
8
|
getPurchasedInfosForAdmin(payload: GetPurchasedInfosForAdminPayload, param: AbstractParam): Promise<GetPurchasedInfosForAdminResult>;
|
|
9
|
-
/** 관리자 환불 대기 운영 큐를 조회한다. */
|
|
10
|
-
getRefundWaitingPurchasedInfosForAdmin(payload: GetRefundWaitingPurchasedInfosForAdminPayload, param: AbstractParam): Promise<GetRefundWaitingPurchasedInfosForAdminResult>;
|
|
11
9
|
getPurchasedInfoDetailForAdminEdit(payload: GetPurchasedInfoDetailForAdminEditPayload, param: AbstractParam): Promise<GetPurchasedInfoDetailForAdminEditResult>;
|
|
12
10
|
editPInfoEtcData(payload: EditPInfoEtcDataPayload, param: AbstractParam): Promise<void>;
|
|
13
11
|
editPInfoMemo(payload: EditPInfoMemoPayload, param: AbstractParam): Promise<void>;
|
|
@@ -25,10 +25,6 @@ let AmqpPurchasedInfoAdminService = class AmqpPurchasedInfoAdminService {
|
|
|
25
25
|
async getPurchasedInfosForAdmin(payload, param) {
|
|
26
26
|
return this.amqpManager.call('결제 리스트 조회 (관리자)', 'purchased-info-admin.get.list', payload, param, { isErrorThrowing: true });
|
|
27
27
|
}
|
|
28
|
-
/** 관리자 환불 대기 운영 큐를 조회한다. */
|
|
29
|
-
async getRefundWaitingPurchasedInfosForAdmin(payload, param) {
|
|
30
|
-
return this.amqpManager.call('환불 대기 결제 리스트 조회 (관리자)', 'purchased-info-admin.get.refund-waiting-list', payload, param, { isErrorThrowing: true });
|
|
31
|
-
}
|
|
32
28
|
async getPurchasedInfoDetailForAdminEdit(payload, param) {
|
|
33
29
|
return this.amqpManager.call('결제 상세 조회 (관리자 수정용)', 'purchased-info-admin.get.detail-for-edit', payload, param, { isErrorThrowing: true });
|
|
34
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yolo-croket-dev/amqp-access",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.258",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "Yolo Co., Ltd.",
|
|
6
6
|
"description": "크로켓 amqp-access npm",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "node ../../node_modules/typescript/bin/tsc",
|
|
12
|
-
"lint": "eslint src/**/*.ts",
|
|
12
|
+
"lint": "eslint --no-error-on-unmatched-pattern src/**/*.ts",
|
|
13
13
|
"fix": "eslint --fix src/**/*.ts",
|
|
14
14
|
"clean": "node ../../node_modules/typescript/bin/tsc --build --clean",
|
|
15
15
|
"prepublishOnly": "npm run build",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"@yolo-croket-dev/domain": "0.2.40",
|
|
24
24
|
"@yolo-croket-dev/dto-v2": "0.2.23",
|
|
25
25
|
"@yolo-croket-dev/entity": "0.2.98",
|
|
26
|
-
"@yolo-croket-dev/entity-v2": "0.3.17
|
|
26
|
+
"@yolo-croket-dev/entity-v2": "0.3.17",
|
|
27
27
|
"class-transformer": "^0.5.1",
|
|
28
28
|
"class-validator": "^0.13.2",
|
|
29
29
|
"dotenv": "^16.3.1"
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
|
|
6
|
+
const packageRoot = resolve(import.meta.dirname, '..');
|
|
7
|
+
const fixtureRoot = resolve(packageRoot, 'test-fixtures/exchange-rate-contract');
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
const compileOptions = [
|
|
10
|
+
'--noEmit',
|
|
11
|
+
'--strict',
|
|
12
|
+
'--skipLibCheck',
|
|
13
|
+
'--target',
|
|
14
|
+
'es2019',
|
|
15
|
+
'--module',
|
|
16
|
+
'commonjs',
|
|
17
|
+
'--moduleResolution',
|
|
18
|
+
'node',
|
|
19
|
+
'--experimentalDecorators',
|
|
20
|
+
'--emitDecoratorMetadata',
|
|
21
|
+
'--allowSyntheticDefaultImports',
|
|
22
|
+
'--resolveJsonModule',
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
function compileTypeFixture(name) {
|
|
26
|
+
return spawnSync(
|
|
27
|
+
process.execPath,
|
|
28
|
+
[
|
|
29
|
+
'node_modules/typescript/bin/tsc',
|
|
30
|
+
...compileOptions,
|
|
31
|
+
resolve(fixtureRoot, `${name}.ts`),
|
|
32
|
+
],
|
|
33
|
+
{ cwd: resolve(packageRoot, '../..'), encoding: 'utf8' },
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function assertTypeFixturePasses(name) {
|
|
38
|
+
const result = compileTypeFixture(name);
|
|
39
|
+
if (result.status !== 0) {
|
|
40
|
+
throw new Error(`${name}: expected tsc exit 0, got ${result.status}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function assertTypeFixtureFails(name, expectedDiagnostic) {
|
|
45
|
+
const result = compileTypeFixture(name);
|
|
46
|
+
const output = `${result.stdout}${result.stderr}`;
|
|
47
|
+
if (result.status === 0) {
|
|
48
|
+
throw new Error(`${name}: expected tsc failure for ${expectedDiagnostic}`);
|
|
49
|
+
}
|
|
50
|
+
if (!expectedDiagnostic.test(output)) {
|
|
51
|
+
throw new Error(`${name}: missing expected diagnostic ${expectedDiagnostic}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function readJsonFixture(name) {
|
|
56
|
+
return JSON.parse(readFileSync(resolve(fixtureRoot, `${name}.json`), 'utf8'));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
for (const name of ['legacy-compatibility', 'supported-usd', 'supported-cad', 'supported-jpy', 'unsupported-only']) {
|
|
60
|
+
assertTypeFixturePasses(name);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
for (const [name, expectedDiagnostic] of [
|
|
64
|
+
['missing-field', /Property 'currencyCode' is missing/],
|
|
65
|
+
['bad-currency', /Type '"usd"' is not assignable/],
|
|
66
|
+
['bad-currency-digit', /Type '"US1"' is not assignable/],
|
|
67
|
+
['bad-currency-short', /Type '"US"' is not assignable/],
|
|
68
|
+
['bad-currency-long', /Type '"USDX"' is not assignable/],
|
|
69
|
+
['bad-date', /Argument of type '"2026-08-10"'[\s\S]*exchangeRateBaseDateMustBeExactlyEightAsciiDigits/],
|
|
70
|
+
['bad-date-short', /Argument of type '"2026081"'[\s\S]*exchangeRateBaseDateMustBeExactlyEightAsciiDigits/],
|
|
71
|
+
['bad-date-long', /Argument of type '"202608100"'[\s\S]*exchangeRateBaseDateMustBeExactlyEightAsciiDigits/],
|
|
72
|
+
['bad-date-alpha', /Argument of type '"20260A10"'[\s\S]*exchangeRateBaseDateMustBeExactlyEightAsciiDigits/],
|
|
73
|
+
['bad-date-fullwidth', /Argument of type '"20260810"'[\s\S]*exchangeRateBaseDateMustBeExactlyEightAsciiDigits/],
|
|
74
|
+
['unsupported-extra-key', /'baseDate' does not exist/],
|
|
75
|
+
]) {
|
|
76
|
+
assertTypeFixtureFails(name, expectedDiagnostic);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const packageBuild = spawnSync(
|
|
80
|
+
process.execPath,
|
|
81
|
+
['node_modules/typescript/bin/tsc', '-p', 'packages/amqp-access/tsconfig.json'],
|
|
82
|
+
{ cwd: resolve(packageRoot, '../..'), encoding: 'utf8' },
|
|
83
|
+
);
|
|
84
|
+
if (packageBuild.status !== 0) {
|
|
85
|
+
throw new Error(`package build: expected exit 0, got ${packageBuild.status}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const { isGetExchangeRateByCountryCodeExactResult } = require(
|
|
89
|
+
resolve(packageRoot, 'manage-service/dto/exchange-rate/query/get-exchange-rate-by-country-code.dto.js'),
|
|
90
|
+
);
|
|
91
|
+
for (const name of ['valid-usd', 'valid-cad', 'valid-jpy', 'unsupported-only']) {
|
|
92
|
+
const value = readJsonFixture(name);
|
|
93
|
+
if (!isGetExchangeRateByCountryCodeExactResult(value)) {
|
|
94
|
+
throw new Error(`${name}: expected runtime validation success`);
|
|
95
|
+
}
|
|
96
|
+
const expectedKeys = value.isSupported ? 'baseDate,currencyCode,exchangeRate,isSupported' : 'isSupported';
|
|
97
|
+
if (Object.keys(value).sort().join(',') !== expectedKeys) {
|
|
98
|
+
throw new Error(`${name}: unexpected serialized key set`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
for (const [name, value, field] of [
|
|
103
|
+
['bad-rate', readJsonFixture('bad-rate'), 'exchangeRate'],
|
|
104
|
+
['bad-nonfinite-rate', { isSupported: true, baseDate: '20260810', exchangeRate: Number.POSITIVE_INFINITY, currencyCode: 'USD' }, 'exchangeRate'],
|
|
105
|
+
['bad-date', readJsonFixture('bad-date'), 'baseDate'],
|
|
106
|
+
['bad-date-short', { isSupported: true, baseDate: '2026081', exchangeRate: 10.25, currencyCode: 'USD' }, 'baseDate'],
|
|
107
|
+
['bad-date-long', { isSupported: true, baseDate: '202608100', exchangeRate: 10.25, currencyCode: 'USD' }, 'baseDate'],
|
|
108
|
+
['bad-date-alpha', { isSupported: true, baseDate: '20260A10', exchangeRate: 10.25, currencyCode: 'USD' }, 'baseDate'],
|
|
109
|
+
['bad-date-fullwidth', { isSupported: true, baseDate: '20260810', exchangeRate: 10.25, currencyCode: 'USD' }, 'baseDate'],
|
|
110
|
+
['bad-currency', readJsonFixture('bad-currency'), 'currencyCode'],
|
|
111
|
+
['bad-currency-digit', { isSupported: true, baseDate: '20260810', exchangeRate: 10.25, currencyCode: 'US1' }, 'currencyCode'],
|
|
112
|
+
['bad-currency-short', { isSupported: true, baseDate: '20260810', exchangeRate: 10.25, currencyCode: 'US' }, 'currencyCode'],
|
|
113
|
+
['bad-currency-long', { isSupported: true, baseDate: '20260810', exchangeRate: 10.25, currencyCode: 'USDX' }, 'currencyCode'],
|
|
114
|
+
['unsupported-extra-key', readJsonFixture('unsupported-extra-key'), 'unsupported key set'],
|
|
115
|
+
]) {
|
|
116
|
+
if (isGetExchangeRateByCountryCodeExactResult(value)) {
|
|
117
|
+
throw new Error(`${name}: runtime validation accepted invalid ${field}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
console.log('exchange-rate contract fixtures verified');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSupported":true,"baseDate":"20260810","exchangeRate":10.25,"currencyCode":"usd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSupported":true,"baseDate":"2026-08-10","exchangeRate":10.25,"currencyCode":"USD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSupported":false,"baseDate":"20260810"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSupported":false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSupported":true,"baseDate":"20260810","exchangeRate":7.45,"currencyCode":"CAD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSupported":true,"baseDate":"20260810","exchangeRate":9.01,"currencyCode":"JPY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"isSupported":true,"baseDate":"20260810","exchangeRate":10.25,"currencyCode":"USD"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { RefundWaitingInfo, RefundWaitingStatusEnum } from '@yolo-croket-dev/entity-v2/purchased-info';
|
|
2
|
-
/**
|
|
3
|
-
* @author sj
|
|
4
|
-
* @description 관리자 환불 대기 결제건 목록 조회 조건
|
|
5
|
-
* @process 활성 환불 대기 상태를 기본 조회하고, 운영 이력 확인이 필요하면 상태 배열로 범위를 확장한다.
|
|
6
|
-
*/
|
|
7
|
-
export declare class GetRefundWaitingPurchasedInfosForAdminPayload {
|
|
8
|
-
/** 기본값은 관리자가 이관 또는 이관 불가를 처리할 수 있는 활성 상태다. */
|
|
9
|
-
statuses?: RefundWaitingStatusEnum[];
|
|
10
|
-
/** 한 번에 조회할 최대 결제건 수. 인덱스 없는 운영 조회의 부하를 제한한다. */
|
|
11
|
-
limit?: number;
|
|
12
|
-
/** 1부터 시작하는 페이지 번호 */
|
|
13
|
-
page?: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @author sj
|
|
17
|
-
* @description 관리자 환불 대기 운영 큐의 결제건 한 건
|
|
18
|
-
*/
|
|
19
|
-
export declare class RefundWaitingPurchasedInfoForAdmin {
|
|
20
|
-
PInfoId: string;
|
|
21
|
-
publicId?: string;
|
|
22
|
-
buyerId: string;
|
|
23
|
-
sellerId: string;
|
|
24
|
-
storeId?: string;
|
|
25
|
-
pastName?: string;
|
|
26
|
-
pastImg?: string;
|
|
27
|
-
paymentDate?: Date;
|
|
28
|
-
process: string;
|
|
29
|
-
process_v2?: string;
|
|
30
|
-
refundWaitingInfo: RefundWaitingInfo;
|
|
31
|
-
transferCount: number;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @author sj
|
|
35
|
-
* @description 관리자 환불 대기 운영 큐 조회 결과
|
|
36
|
-
*/
|
|
37
|
-
export declare class GetRefundWaitingPurchasedInfosForAdminResult {
|
|
38
|
-
allCount: number;
|
|
39
|
-
page: number;
|
|
40
|
-
limit: number;
|
|
41
|
-
pInfos: RefundWaitingPurchasedInfoForAdmin[];
|
|
42
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
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.GetRefundWaitingPurchasedInfosForAdminResult = exports.RefundWaitingPurchasedInfoForAdmin = exports.GetRefundWaitingPurchasedInfosForAdminPayload = void 0;
|
|
13
|
-
const class_transformer_1 = require("class-transformer");
|
|
14
|
-
const class_validator_1 = require("class-validator");
|
|
15
|
-
const purchased_info_1 = require("@yolo-croket-dev/entity-v2/purchased-info");
|
|
16
|
-
/**
|
|
17
|
-
* @author sj
|
|
18
|
-
* @description 관리자 환불 대기 결제건 목록 조회 조건
|
|
19
|
-
* @process 활성 환불 대기 상태를 기본 조회하고, 운영 이력 확인이 필요하면 상태 배열로 범위를 확장한다.
|
|
20
|
-
*/
|
|
21
|
-
class GetRefundWaitingPurchasedInfosForAdminPayload {
|
|
22
|
-
}
|
|
23
|
-
exports.GetRefundWaitingPurchasedInfosForAdminPayload = GetRefundWaitingPurchasedInfosForAdminPayload;
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, class_validator_1.IsOptional)(),
|
|
26
|
-
(0, class_validator_1.IsArray)(),
|
|
27
|
-
(0, class_validator_1.IsEnum)(purchased_info_1.RefundWaitingStatusEnum, { each: true }),
|
|
28
|
-
__metadata("design:type", Array)
|
|
29
|
-
], GetRefundWaitingPurchasedInfosForAdminPayload.prototype, "statuses", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, class_transformer_1.Type)(() => Number),
|
|
32
|
-
(0, class_validator_1.IsInt)(),
|
|
33
|
-
(0, class_validator_1.Min)(1),
|
|
34
|
-
(0, class_validator_1.Max)(100),
|
|
35
|
-
(0, class_validator_1.IsOptional)(),
|
|
36
|
-
__metadata("design:type", Number)
|
|
37
|
-
], GetRefundWaitingPurchasedInfosForAdminPayload.prototype, "limit", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, class_transformer_1.Type)(() => Number),
|
|
40
|
-
(0, class_validator_1.IsInt)(),
|
|
41
|
-
(0, class_validator_1.Min)(1),
|
|
42
|
-
(0, class_validator_1.IsOptional)(),
|
|
43
|
-
__metadata("design:type", Number)
|
|
44
|
-
], GetRefundWaitingPurchasedInfosForAdminPayload.prototype, "page", void 0);
|
|
45
|
-
/**
|
|
46
|
-
* @author sj
|
|
47
|
-
* @description 관리자 환불 대기 운영 큐의 결제건 한 건
|
|
48
|
-
*/
|
|
49
|
-
class RefundWaitingPurchasedInfoForAdmin {
|
|
50
|
-
}
|
|
51
|
-
exports.RefundWaitingPurchasedInfoForAdmin = RefundWaitingPurchasedInfoForAdmin;
|
|
52
|
-
/**
|
|
53
|
-
* @author sj
|
|
54
|
-
* @description 관리자 환불 대기 운영 큐 조회 결과
|
|
55
|
-
*/
|
|
56
|
-
class GetRefundWaitingPurchasedInfosForAdminResult {
|
|
57
|
-
}
|
|
58
|
-
exports.GetRefundWaitingPurchasedInfosForAdminResult = GetRefundWaitingPurchasedInfosForAdminResult;
|