This commit is contained in:
@@ -24,6 +24,12 @@ export class Campaign extends BaseEntity {
|
||||
@Property({ default: 0 })
|
||||
totalCount: number = 0;
|
||||
|
||||
@Property({ default: 0 })
|
||||
totalCost: number = 0;
|
||||
|
||||
@Property({ default: 0 })
|
||||
refunded: number = 0;
|
||||
|
||||
@Property({ default: 0 })
|
||||
sentCount: number = 0;
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ export class CampaignDispatchListener {
|
||||
reason: RestaurantCreditTransactionReason.ADJUSTMENT,
|
||||
em,
|
||||
});
|
||||
campaign.refunded = refundAmount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ export class CampaignService {
|
||||
discountCode: dto.discountCode,
|
||||
status: dto.sentType === CampaignSentType.SMS ? CampaignStatus.SENDING : CampaignStatus.COMPLETED,
|
||||
totalCount: 0,
|
||||
totalCost: 0,
|
||||
refunded: 0,
|
||||
sentCount: 0,
|
||||
failedCount: 0,
|
||||
};
|
||||
@@ -71,6 +73,7 @@ export class CampaignService {
|
||||
);
|
||||
|
||||
campaign.totalCount = smsDispatchPlan.totalCount;
|
||||
campaign.totalCost = smsDispatchPlan.totalCost;
|
||||
if (smsDispatchPlan.totalCount === 0) {
|
||||
campaign.status = CampaignStatus.COMPLETED;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user