add point

This commit is contained in:
Timi
2026-08-11 22:25:30 +08:00
parent e612cfd382
commit 9f60a36c6c
21 changed files with 2928 additions and 36 deletions
+1
View File
@@ -7,6 +7,7 @@ export type EventRecord = {
customerId?: string;
customerIdList?: string[];
eventId?: string;
pointValue?: number;
operatorUserId?: string;
remark?: string;
registeredAt?: number;
+77
View File
@@ -0,0 +1,77 @@
import type { BasePage, Model } from "timi-web";
export type PointRuleStatus = "DRAFT" | "ACTIVE" | "INACTIVE" | "DELETED";
export type PointRuleTriggerType = "EVERY_TIME" | "FIRST_TIME" | "AFTER_COUNT_EVERY_TIME" | "SOURCE_VALUE";
export type PointRuleMode = "FIXED" | "SOURCE_VALUE";
export type PointLedgerChangeType = "EARN" | "REVOKE" | "ADJUST";
export type PointLedgerDirection = "INCREASE" | "DECREASE";
export type PointRuleCondition = {
min?: number;
max?: number;
threshold?: number;
includeCurrent?: boolean;
scope?: "CUSTOMER_EVENT";
};
export type PointAccount = {
storeId?: string;
customerId?: string;
balance?: number;
totalEarned?: number;
totalRevoked?: number;
totalAdjusted?: number;
version?: number;
} & Model;
export type PointLedger = {
accountId?: string;
storeId?: string;
customerId?: string;
changeType?: PointLedgerChangeType;
direction?: PointLedgerDirection;
pointDelta?: number;
balanceBefore?: number;
balanceAfter?: number;
ruleId?: string;
eventId?: string;
eventRecordId?: string;
sourcePayload?: Record<string, unknown>;
idempotencyKey?: string;
remark?: string;
operatorUserId?: string;
occurredAt?: number;
} & Model;
export type PointLedgerPage = {
storeId?: string;
customerId?: string;
accountId?: string;
changeType?: PointLedgerChangeType;
beginAt?: number;
endAt?: number;
} & BasePage;
export type PointRule = {
storeId?: string;
eventId?: string;
name: string;
status?: PointRuleStatus;
triggerType?: PointRuleTriggerType;
pointMode?: PointRuleMode;
pointValue?: number | null;
conditionJson?: PointRuleCondition;
beginAt?: number;
endAt?: number;
priority?: number;
exclusive?: boolean;
remark?: string;
} & Model;
export type PointAdjustRequest = {
adjustRequestId: string;
storeId?: string;
customerId: string;
pointDelta: number;
remark: string;
};