#038b0
Back
2025/12/02
6 min read

派獎 - 建立審核新增

派獎 - 建立審核新增.md
106 additions, 18 deletions
... ... @@ -1,17 +1,26 @@
1 - 建立審核以建立派獎設定
1 + 建立審核以新增派獎設定,包含派獎群組、獎項、小樹點行動代碼、推播通知設定。
2 +* 需檢查派獎時間合理性 (start_time < end_time)
3 +* 需檢查 ETA 發放類型是否提供發放時間
4 +* 需檢查推播行為是否提供對應的 URL
5 +* 需檢查訊息夾按鈕是否提供對應的 URL
6 +
2 -* `DBMT.`
3 - * `DBMT.`
7 + * `DBMT.AWARD_GROUP`
8 +* `DBMT.AWARD`
9 +* `DBMT.AWARD_GP`
10 +* `DBMT.PUSHNOTIFY_RELATION`
11 +* `DBMT.PUSHNOTIFY_NOTIFICATION_ENTRY`
12 +* `DBMT.PUSHNOTIFY_MESSAGE_ENTRY`
4 -* * METHOD: **POST**
5 - * PATH: `/api/features/{}/audit/create`
13 + * METHOD: **POST**
14 +* PATH: `/api/features/award/group/audit/create`
6 15 * LOGIN REQUIRED: **TRUE**
7 - * FEATURE:
16 + * FEATURE: `AWARD_GROUP`
8 17 * PERMISSION: `CREATE` , `APPLY`
9 18 * CRYPTO: **None**
10 -| 1 | progress | String | * | | [](https://app.clickup.com/3626232/v/dc/3en7r-19300/3en7r-92958?block=block-d341a37c-c9ae-49d0-8e4f-caef01ab0dba) |
11 -| | | | |
12 - | 1 | data | Dict | * | | 允許異動欄位 |
19 + | 1 | progress | String | * | | 審核進度 |
20 +| 1 | data | Dict | * | | 派獎設定資料 |
13 -| 2 | | Dict | * | | 派獎主設定 |
14 -| | | | |
15 - | 2 | | List | * | | |
21 + | 2 | award_group | Dict | * | | 派獎群組設定 |
22 +| 2 | gp_action | Dict | * | | 小樹點行動代碼設定 |
23 +| 2 | awards | List(Dict) | * | | 獎項設定列表 |
24 +| 2 | delete_audit_entries | List(Integer) | * | * | 欲刪除的審核條目 ID |
16 - ### assigned_coupon
25 + ### award_group
17 -| 3 | | | * | | |
18 - | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
26 + | 3 | id | Integer | | * | 派獎群組 ID (建立時不需要) |
27 +| 3 | name | String(50) | * | | 派獎群組名稱 |
28 +| 3 | status | Enum | * | | 狀態:<br>ACTIVE: 上架<br>INACTIVE: 下架<br>RETIRED: 永久下架 |
29 +| 3 | start_time | Datetime | * | | 派獎開始時間 |
30 +| 3 | end_time | Datetime | * | | 派獎結束時間 |
31 +### gp_action
32 +
33 +| Level | Name | Type/Len | Required(*) | Nullable(*) | Desc |
34 +| ---| ---| ---| ---| ---| --- |
35 +| 3 | action_code | String(10) | * | | 小樹點行動代碼 |
36 +| 3 | expire_duration | Integer | * | * | 過期天數 (1-1095) |
37 +
38 +### awards (List Item)
39 +
40 +| Level | Name | Type/Len | Required(*) | Nullable(*) | Desc |
41 +| ---| ---| ---| ---| ---| --- |
42 +| 3 | award | Dict | * | | 獎項設定 |
43 +| 3 | prize_gp | Dict | * | | 小樹點獎項設定 |
44 +| 3 | notify | Dict | * | | 推播通知設定 |
45 +
46 +### award
47 +
48 +| Level | Name | Type/Len | Required(*) | Nullable(*) | Desc |
49 +| ---| ---| ---| ---| ---| --- |
50 +| 4 | id | Integer | | * | 獎項 ID (建立時不需要) |
51 +| 4 | code | String(50) | * | | 獎項代碼 |
52 +| 4 | name | String(50) | * | | 獎項名稱 |
53 +| 4 | active_status | Enum | * | | 啟用狀態:<br>ACTIVE: 啟用<br>INACTIVE: 停用 |
54 +| 4 | award_type | Enum | * | | 獎項類型:<br>ORCA_POINT: 小樹點<br>QWARE: Qware 點數<br>SELFGEN_VOUCHER: 自建票券<br>EDENRED: Edenred<br>SYSTEX: Systex |
55 +| 4 | deliver_type | Enum | * | | 發放類型:<br>IMMEDIATE: 立即發放<br>ETA: 預定時間發放 |
56 +| 4 | deliver_amount | Integer | * | | 發放數量 |
57 +| 4 | deliver_limit | Integer | * | | 發放上限 |
58 +| 4 | deliver_time | Datetime | | * | 預定發放時間 (deliver_type=ETA 時必填) |
59 +
60 +### prize_gp
61 +
62 +| Level | Name | Type/Len | Required(*) | Nullable(*) | Desc |
63 +| ---| ---| ---| ---| ---| --- |
64 +| 4 | id | Integer | | * | 小樹點獎項 ID (建立時不需要) |
65 +| 4 | note | String(64) | | * | 備註 |
66 +
67 +### notify
68 +
69 +| Level | Name | Type/Len | Required(*) | Nullable(*) | Desc |
70 +| ---| ---| ---| ---| ---| --- |
71 +| 4 | id | Integer | | * | 推播關聯 ID (建立時不需要) |
72 +| 4 | notification | Dict | | * | 外部推播設定 |
73 +| 4 | message | Dict | | * | 訊息夾設定 |
74 +
75 +### notification
76 +
77 +| Level | Name | Type/Len | Required(*) | Nullable(*) | Desc |
78 +| ---| ---| ---| ---| ---| --- |
79 +| 5 | id | Integer | | * | 推播 ID (建立時不需要) |
80 +| 5 | title | String(300) | * | | 推播標題 |
81 +| 5 | content | String(200) | * | | 推播內文 |
82 +| 5 | notification_behavior | Enum | * | | 推播點擊行為:<br>OPEN_URL: 開啟連結<br>OPEN_INBOX: 開啟訊息夾 |
83 +| 5 | url | String(200) | | * | DeepLink 網址 (notification_behavior=OPEN_URL 時必填) |
84 +
85 +### message
86 +
87 +| Level | Name | Type/Len | Required(*) | Nullable(*) | Desc |
88 +| ---| ---| ---| ---| ---| --- |
89 +| 5 | id | Integer | | * | 訊息夾 ID (建立時不需要) |
90 +| 5 | title | String(100) | * | | 訊息夾標題 |
91 +| 5 | content | String(4000) | * | | 訊息夾內文 |
92 +| 5 | btn_wording | String(50) | | * | 按鈕文字 |
93 +| 5 | url | String(4000) | | * | 網址 (btn_wording 有值時必填) |
94 +
19 - #### BODY
95 + #### BODY
20 -| | | | | | | | | | | | | | | | | | | | | | | |
21 - |  409 | | | 商品不存在 `T_BAS_BONUS_ITEM_INFO` |
96 + | 400 | ValidationError | Start time must be before end time | 開始時間必須早於結束時間 |
97 +| 400 | ValidationError | Deliver time must be provided for ETA delivery | ETA 發放類型必須提供發放時間 |
98 +| 400 | ValidationError | Deliver time must not be in the past | 發放時間不可為過去時間 |
99 +| 400 | ValidationError | URL must be provided for OPEN_URL notification behavior | OPEN_URL 行為必須提供 URL |
100 +| 400 | ValidationError | URL must be provided for button action | 按鈕文字有值時必須提供 URL |
101 +| 401 | Unauthorized | Unauthorized | 未授權 |
102 +| 403 | Forbidden | Forbidden | 無權限存取 |
103 +| 400 | AwardGroupAuditError.DELIVER_TIME_BAD_REQUEST | Deliver time must greater than end_time and system now. | 發放時間必須大於結束時間且晚於系統目前時間 |
104 +| 400 | AwardGroupAuditError.DELIVER_TIME_NOT_ALLOWED_CHANGE | Deliver time must greater than end_time and system now. | 發放時間必須大於結束時間且晚於系統目前時間 |
105 +| 400 | AwardGroupAuditError.AWARD_GROUP_STATUS_BAD_REQUEST | Award group status not allowed to changed. | 派獎群組狀態不允許變更 |
106 +| 400 | AwardGroupAuditError.AWARD_GROUP_START_TIME_BAD_REQUEST | Award group start time must greater than every awards. | 派獎開始時間必須早於所有獎項時間 |
107 +| 400 | AwardGroupAuditError.AWARD_LIMIT_BAD_REQUEST | Award limit should be greater than previous setting. | 獎項發放上限必須大於先前設定 |
108 +| 400 | AwardGroupAuditError.AWARD_MISSING_BAD_REQUEST | At lease one award setting. | 至少需要一個獎項設定 |
109 +| 500 | AwardGroupAuditError.ACTION_RULE_CREATE_FAILED | Failed to create action rule. | 建立行動規則失敗 |