@yolo-croket-dev/entity-v2 0.3.54 → 0.3.55
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/index.d.ts +1 -0
- package/index.js +1 -0
- package/notification-campaign/index.d.ts +30 -0
- package/notification-campaign/index.js +2 -0
- package/package.json +1 -1
- package/AGENTS.md +0 -50
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -99,3 +99,4 @@ __exportStar(require("./store-item-pending-settle"), exports);
|
|
|
99
99
|
__exportStar(require("./store-pending-settle"), exports);
|
|
100
100
|
__exportStar(require("./admin-settlement-limit"), exports);
|
|
101
101
|
__exportStar(require("./settle-adjustment-plan"), exports);
|
|
102
|
+
__exportStar(require("./notification-campaign"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author jun
|
|
3
|
+
* @description 캠페인별 수신자 불변 메시지와 발송 상태
|
|
4
|
+
* @process 등록 → 원자적 선점 → 푸시 → 결과 저장
|
|
5
|
+
*/
|
|
6
|
+
export interface NotificationCampaignMessage {
|
|
7
|
+
userId: string;
|
|
8
|
+
itemId: string;
|
|
9
|
+
couponCode: string;
|
|
10
|
+
pushTitle: string;
|
|
11
|
+
pushBody: string;
|
|
12
|
+
pushAppLink: string;
|
|
13
|
+
pushWebLink: string;
|
|
14
|
+
pushImage: string;
|
|
15
|
+
}
|
|
16
|
+
export type NotificationCampaignStatus = 'ready' | 'sending' | 'accepted' | 'failed' | 'unknown' | 'skipped';
|
|
17
|
+
export interface NotificationCampaignRecipientEntity {
|
|
18
|
+
_id: string;
|
|
19
|
+
campaignId: string;
|
|
20
|
+
snapshotHash: string;
|
|
21
|
+
messageHash: string;
|
|
22
|
+
message: NotificationCampaignMessage;
|
|
23
|
+
startsAt: string;
|
|
24
|
+
endsAt: string;
|
|
25
|
+
status: NotificationCampaignStatus;
|
|
26
|
+
reason: string;
|
|
27
|
+
providerRequestId?: string;
|
|
28
|
+
createdAt: Date;
|
|
29
|
+
updatedAt: Date;
|
|
30
|
+
}
|
package/package.json
CHANGED
package/AGENTS.md
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# ENTITY-V2 KNOWLEDGE BASE
|
|
2
|
-
|
|
3
|
-
## OVERVIEW
|
|
4
|
-
|
|
5
|
-
Mongo 영속 모델과 서비스 contract가 공유하는 최신 entity interface 중심 패키지다. 신규 entity의 우선 위치지만 legacy `entity`와 양방향 호환 import가 남아 있어 일괄 분리하지 않는다.
|
|
6
|
-
|
|
7
|
-
## STRUCTURE
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
entity-v2/
|
|
11
|
-
├── index.ts # 약 80개 domain public export
|
|
12
|
-
├── <domain>/index.ts
|
|
13
|
-
├── <domain>/*.entity.ts
|
|
14
|
-
└── <domain>.modules/ # 세부 bounded context
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
대형 호환 surface는 `store-item/store-item.entity.ts`, `purchased-info/purchased-info.entity.ts`; 수정 전 `@deprecated` 필드와 legacy import를 먼저 확인한다.
|
|
18
|
-
|
|
19
|
-
## WHERE TO LOOK
|
|
20
|
-
|
|
21
|
-
| 작업 | 위치 | 확인 |
|
|
22
|
-
|---|---|---|
|
|
23
|
-
| 신규 Mongo entity | `<domain>/*.entity.ts` | 실제 schema field/type/nullability |
|
|
24
|
-
| Public export | `<domain>/index.ts`, root `index.ts` | named/type export 호환성 |
|
|
25
|
-
| Legacy 결합 | `packages/entity`, v2의 legacy imports | 양방향 dependency 확대 여부 |
|
|
26
|
-
| 대형 commerce 모델 | `store-item`, `purchased-info`, `refund`, `cart` | deprecated 대체 필드 |
|
|
27
|
-
|
|
28
|
-
## CONVENTIONS
|
|
29
|
-
|
|
30
|
-
- 실제 DB 문서를 표현하는 서비스의 Mongoose `@Schema` class는 이 패키지의 대응 interface를 `implements`해야 한다.
|
|
31
|
-
- `_id`, `ObjectId|string`, optional, `null`, array element type을 실제 저장 shape와 정확히 맞춘다.
|
|
32
|
-
- 신규 domain은 local `index.ts`와 root barrel을 함께 갱신하되 기존 namespace/named export를 깨지 않는다.
|
|
33
|
-
- 기존 v2→legacy import는 호환성 경계로 취급한다. 신규 reverse dependency는 소비 영향 근거 없이 추가하지 않는다.
|
|
34
|
-
- 제거 예정 필드는 `@deprecated`와 대체 필드 설명을 유지한다.
|
|
35
|
-
|
|
36
|
-
## ANTI-PATTERNS
|
|
37
|
-
|
|
38
|
-
- DTO/response 전용 임시 shape를 영속 entity로 추가하지 않는다.
|
|
39
|
-
- Deprecated 필드를 신규 feature의 정식 모델로 사용하지 않는다.
|
|
40
|
-
- Legacy field를 소비자와 migration 확인 없이 삭제하거나 type을 축소하지 않는다.
|
|
41
|
-
- `dist`, `.d.ts`, 생성 JS를 source 대신 수정하지 않는다.
|
|
42
|
-
|
|
43
|
-
## VERIFY
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
yarn workspace @yolo-croket-dev/entity-v2 build
|
|
47
|
-
yarn workspace @yolo-croket-dev/entity-v2 lint
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Entity 변경은 `entity`, `dto-v2`, AMQP contract와 실제 Mongoose schema 소비 서비스까지 의존 순서대로 검증한다.
|