@yolo-croket-dev/entity-v2 0.3.57 → 0.3.58-beta.1
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/buyma-order/buyma-order.entity.d.ts +176 -0
- package/buyma-order/buyma-order.entity.js +29 -0
- package/buyma-order/index.d.ts +1 -0
- package/buyma-order/index.js +17 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +2 -2
- package/user-sensitive-identity/user-sensitive-identity.entity.d.ts +1 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/** @author jun @description Buyma MVP의 주문·이력 영속 계약. @process 상품·사입·배송은 주문에 내장하고 변경 근거를 별도 저장한다. */
|
|
2
|
+
import { Types } from 'mongoose';
|
|
3
|
+
export declare const BUYMA_PAYMENT_STATUSES: readonly ["UNVERIFIED", "PENDING_PAYMENT", "PAID"];
|
|
4
|
+
export type BuymaPaymentStatus = (typeof BUYMA_PAYMENT_STATUSES)[number];
|
|
5
|
+
export declare const BUYMA_ORDER_STATUSES: readonly ["ORDER_CHECKING", "STOCK_CHECKING", "PREPARING_SHIPMENT", "LOCAL_IN_TRANSIT", "INTERNATIONAL_IN_TRANSIT", "DELIVERED", "REFUNDED"];
|
|
6
|
+
export type BuymaOrderStatus = (typeof BUYMA_ORDER_STATUSES)[number];
|
|
7
|
+
export declare const BUYMA_PROCUREMENT_WORK_STATUSES: readonly ["UNSPECIFIED", "NOT_REQUIRED", "SELLER_DIRECT_INQUIRY", "STOCK_INQUIRY", "ALTERNATIVE_STOCK_CHECK", "EXTRA_PAYMENT_INQUIRY", "OPTION_CHANGE_INQUIRY", "PROCURED", "ALTERNATIVE_PROCURED", "ISSUE"];
|
|
8
|
+
export type BuymaProcurementWorkStatus = (typeof BUYMA_PROCUREMENT_WORK_STATUSES)[number];
|
|
9
|
+
export interface BuymaMoney {
|
|
10
|
+
amount: number;
|
|
11
|
+
currency: string;
|
|
12
|
+
}
|
|
13
|
+
export interface BuymaBuyer {
|
|
14
|
+
buymaBuyerId: string | null;
|
|
15
|
+
name: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface BuymaRecipient {
|
|
18
|
+
name: string | null;
|
|
19
|
+
phone: string | null;
|
|
20
|
+
countryCode: string | null;
|
|
21
|
+
postalCode: string | null;
|
|
22
|
+
address1: string | null;
|
|
23
|
+
address2: string | null;
|
|
24
|
+
address3: string | null;
|
|
25
|
+
address4: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface BuymaProductSnapshot {
|
|
28
|
+
buymaProductId: string | null;
|
|
29
|
+
croketItemId: Types.ObjectId | null;
|
|
30
|
+
storeName: string | null;
|
|
31
|
+
sourceCountry: string | null;
|
|
32
|
+
croketName: string | null;
|
|
33
|
+
buymaName: string | null;
|
|
34
|
+
brandName: string | null;
|
|
35
|
+
optionName: string | null;
|
|
36
|
+
weightGrams: number | null;
|
|
37
|
+
croketItemUrl: string | null;
|
|
38
|
+
buymaItemUrl: string | null;
|
|
39
|
+
}
|
|
40
|
+
export interface BuymaPayment {
|
|
41
|
+
status: BuymaPaymentStatus;
|
|
42
|
+
reportedStatus: string | null;
|
|
43
|
+
preOrderedAt: Date | null;
|
|
44
|
+
paidAt: Date | null;
|
|
45
|
+
confirmationSource: 'BUYMA_ORDERED_AT' | 'ADMIN' | null;
|
|
46
|
+
confirmedAt: Date | null;
|
|
47
|
+
confirmedBy: Types.ObjectId | null;
|
|
48
|
+
evidence: string | null;
|
|
49
|
+
}
|
|
50
|
+
export interface BuymaLocalShipment {
|
|
51
|
+
invoiceRegisteredAt: Date | null;
|
|
52
|
+
carrierName: string | null;
|
|
53
|
+
trackingNumber: string | null;
|
|
54
|
+
}
|
|
55
|
+
export interface BuymaProcurement {
|
|
56
|
+
source: 'CROKET' | 'MANUAL';
|
|
57
|
+
orderUrl: string;
|
|
58
|
+
croketPurchaseReceiptId: Types.ObjectId | null;
|
|
59
|
+
croketPurchasedInfoId: Types.ObjectId | null;
|
|
60
|
+
croketPurchasedInfoPublicId: string | null;
|
|
61
|
+
/** 원래 완료된 결제의 개당 기본 상품 가격. */
|
|
62
|
+
croketProductPrice: BuymaMoney | null;
|
|
63
|
+
/** 선택 구매 건에 청구한 배송비. */
|
|
64
|
+
croketShippingCost: BuymaMoney | null;
|
|
65
|
+
/** 시트 AG 대응 금액. 위 두 금액의 합으로 덮어쓰지 않는다. */
|
|
66
|
+
purchaseCost: BuymaMoney | null;
|
|
67
|
+
sellerSettlementCost: BuymaMoney | null;
|
|
68
|
+
sourceStatus: string | null;
|
|
69
|
+
localShipment: BuymaLocalShipment | null;
|
|
70
|
+
}
|
|
71
|
+
export interface BuymaInternationalShipment {
|
|
72
|
+
carrierName: string;
|
|
73
|
+
trackingNumber: string;
|
|
74
|
+
trackingUrl: string | null;
|
|
75
|
+
/** 운송장 전체 금액이 아닌 해당 주문에 배분한 비용. */
|
|
76
|
+
shippingCost: BuymaMoney | null;
|
|
77
|
+
deliveredAt: Date | null;
|
|
78
|
+
deliveryEvidence: string | null;
|
|
79
|
+
}
|
|
80
|
+
export interface BuymaCommunications {
|
|
81
|
+
stockSecuredNotified: boolean | null;
|
|
82
|
+
forwarderDispatchNotified: boolean | null;
|
|
83
|
+
}
|
|
84
|
+
export interface BuymaRefundRecord {
|
|
85
|
+
amount: BuymaMoney;
|
|
86
|
+
refundedAt: Date;
|
|
87
|
+
evidence: string;
|
|
88
|
+
}
|
|
89
|
+
export interface BuymaLegacySettlement {
|
|
90
|
+
appliedExchangeRate: string | null;
|
|
91
|
+
exchangeRateUnit: string | null;
|
|
92
|
+
feeRateText: string | null;
|
|
93
|
+
buymaFee: BuymaMoney | null;
|
|
94
|
+
sellerSettlementJPY: BuymaMoney | null;
|
|
95
|
+
productMargin: BuymaMoney | null;
|
|
96
|
+
productMarginRate: string | null;
|
|
97
|
+
shippingFee: BuymaMoney | null;
|
|
98
|
+
outboundShippingJPY: BuymaMoney | null;
|
|
99
|
+
shippingMargin: BuymaMoney | null;
|
|
100
|
+
shippingMarginRate: string | null;
|
|
101
|
+
totalMargin: BuymaMoney | null;
|
|
102
|
+
totalMarginRate: string | null;
|
|
103
|
+
memo: string | null;
|
|
104
|
+
}
|
|
105
|
+
export interface BuymaRecipientChange {
|
|
106
|
+
status: 'PENDING' | 'APPLIED' | 'UNVERIFIED';
|
|
107
|
+
reportedStatus: string | null;
|
|
108
|
+
sourceOrderStatus: string | null;
|
|
109
|
+
previousAddress: string | null;
|
|
110
|
+
previousPhone: string | null;
|
|
111
|
+
requestedAddress: string | null;
|
|
112
|
+
requestedPhone: string | null;
|
|
113
|
+
}
|
|
114
|
+
export interface BuymaLegacySheetData {
|
|
115
|
+
sourceRecordedLocalDate: string | null;
|
|
116
|
+
sourceDispatchDate: string | null;
|
|
117
|
+
sourceDeliveredDate: string | null;
|
|
118
|
+
sourceOrderStatus: string | null;
|
|
119
|
+
sourceProcurementWorkStatus: string | null;
|
|
120
|
+
legacySettlement: BuymaLegacySettlement | null;
|
|
121
|
+
recipientChange: BuymaRecipientChange | null;
|
|
122
|
+
}
|
|
123
|
+
export interface BuymaOrderEntity {
|
|
124
|
+
_id: Types.ObjectId;
|
|
125
|
+
buymaAccountId: string;
|
|
126
|
+
buymaOrderNumber: string;
|
|
127
|
+
buymaOrderUrl: string | null;
|
|
128
|
+
buyer: BuymaBuyer;
|
|
129
|
+
recipient: BuymaRecipient | null;
|
|
130
|
+
productSnapshot: BuymaProductSnapshot;
|
|
131
|
+
quantity: number;
|
|
132
|
+
productRevenue: BuymaMoney | null;
|
|
133
|
+
shippingRevenue: BuymaMoney | null;
|
|
134
|
+
reportedTotalRevenue: BuymaMoney | null;
|
|
135
|
+
payment: BuymaPayment;
|
|
136
|
+
/** null은 상태를 매핑하지 못한 기존 시트 주문에만 허용한다. */
|
|
137
|
+
orderStatus: BuymaOrderStatus | null;
|
|
138
|
+
procurementWorkStatus: BuymaProcurementWorkStatus;
|
|
139
|
+
procurement: BuymaProcurement | null;
|
|
140
|
+
internationalShipment: BuymaInternationalShipment | null;
|
|
141
|
+
communications: BuymaCommunications;
|
|
142
|
+
refundRecord: BuymaRefundRecord | null;
|
|
143
|
+
holdReason: string | null;
|
|
144
|
+
memo: string | null;
|
|
145
|
+
slackThreadUrls: string[];
|
|
146
|
+
revision: number;
|
|
147
|
+
createdAt: Date;
|
|
148
|
+
updatedAt: Date;
|
|
149
|
+
legacySheetData: BuymaLegacySheetData | null;
|
|
150
|
+
}
|
|
151
|
+
export type BuymaJsonValue = string | number | boolean | null | BuymaJsonValue[] | {
|
|
152
|
+
[key: string]: BuymaJsonValue;
|
|
153
|
+
};
|
|
154
|
+
export interface BuymaFieldChange {
|
|
155
|
+
field: string;
|
|
156
|
+
before: BuymaJsonValue;
|
|
157
|
+
after: BuymaJsonValue;
|
|
158
|
+
}
|
|
159
|
+
export interface BuymaOrderEventEntity {
|
|
160
|
+
_id: Types.ObjectId;
|
|
161
|
+
orderId: Types.ObjectId | null;
|
|
162
|
+
buymaAccountId: string;
|
|
163
|
+
buymaOrderNumber: string;
|
|
164
|
+
source: 'BUYMA_WEBHOOK' | 'ADMIN' | 'SHEET_IMPORT';
|
|
165
|
+
eventId: string;
|
|
166
|
+
eventType: string;
|
|
167
|
+
receivedAt: Date;
|
|
168
|
+
actorId: Types.ObjectId | null;
|
|
169
|
+
changes: BuymaFieldChange[];
|
|
170
|
+
reason: string | null;
|
|
171
|
+
payload: {
|
|
172
|
+
[key: string]: BuymaJsonValue;
|
|
173
|
+
} | null;
|
|
174
|
+
result: 'APPLIED' | 'FAILED' | 'EXCLUDED';
|
|
175
|
+
errorMessage: string | null;
|
|
176
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BUYMA_PROCUREMENT_WORK_STATUSES = exports.BUYMA_ORDER_STATUSES = exports.BUYMA_PAYMENT_STATUSES = void 0;
|
|
4
|
+
exports.BUYMA_PAYMENT_STATUSES = [
|
|
5
|
+
'UNVERIFIED',
|
|
6
|
+
'PENDING_PAYMENT',
|
|
7
|
+
'PAID',
|
|
8
|
+
];
|
|
9
|
+
exports.BUYMA_ORDER_STATUSES = [
|
|
10
|
+
'ORDER_CHECKING',
|
|
11
|
+
'STOCK_CHECKING',
|
|
12
|
+
'PREPARING_SHIPMENT',
|
|
13
|
+
'LOCAL_IN_TRANSIT',
|
|
14
|
+
'INTERNATIONAL_IN_TRANSIT',
|
|
15
|
+
'DELIVERED',
|
|
16
|
+
'REFUNDED',
|
|
17
|
+
];
|
|
18
|
+
exports.BUYMA_PROCUREMENT_WORK_STATUSES = [
|
|
19
|
+
'UNSPECIFIED',
|
|
20
|
+
'NOT_REQUIRED',
|
|
21
|
+
'SELLER_DIRECT_INQUIRY',
|
|
22
|
+
'STOCK_INQUIRY',
|
|
23
|
+
'ALTERNATIVE_STOCK_CHECK',
|
|
24
|
+
'EXTRA_PAYMENT_INQUIRY',
|
|
25
|
+
'OPTION_CHANGE_INQUIRY',
|
|
26
|
+
'PROCURED',
|
|
27
|
+
'ALTERNATIVE_PROCURED',
|
|
28
|
+
'ISSUE',
|
|
29
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './buyma-order.entity';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./buyma-order.entity"), exports);
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -100,3 +100,4 @@ __exportStar(require("./store-pending-settle"), exports);
|
|
|
100
100
|
__exportStar(require("./admin-settlement-limit"), exports);
|
|
101
101
|
__exportStar(require("./settle-adjustment-plan"), exports);
|
|
102
102
|
__exportStar(require("./notification-campaign"), exports);
|
|
103
|
+
__exportStar(require("./buyma-order"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yolo-croket-dev/entity-v2",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.58-beta.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "Yolo Co., Ltd.",
|
|
6
6
|
"description": "크로켓 nest 용 entity-v3",
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "UNLICENSED",
|
|
25
25
|
"dependencies": {}
|
|
26
|
-
}
|
|
26
|
+
}
|