Skip to content

Commit 44a26d2

Browse files
committed
fix: rename "weeklyCount" to "weeklyCost"
ref issue #47
1 parent 73936d7 commit 44a26d2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/services/TeamService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async function getTeamDetail (currentUser, projects, isSearch = true) {
100100
for (const project of projects) {
101101
const rbs = _.filter(resourceBookings, { projectId: project.id })
102102
const res = _.clone(project)
103-
res.weeklyCount = 0
103+
res.weeklyCost = 0
104104
res.resources = []
105105

106106
if (rbs && rbs.length > 0) {
@@ -131,7 +131,7 @@ async function getTeamDetail (currentUser, projects, isSearch = true) {
131131
// normally startDate is smaller than endDate for a resourceBooking so not check if startDate < endDate
132132
if ((!item.startDate || startDate < lastDay) &&
133133
(!item.endDate || endDate > firstDay)) {
134-
res.weeklyCount += item.customerRate
134+
res.weeklyCost += item.customerRate
135135
}
136136
}
137137

test/unit/TeamService.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe('Team service test', () => {
109109
expect(entity[0]).to.deep.eql({
110110
id: 9050,
111111
name: 'sample',
112-
weeklyCount: 0,
112+
weeklyCost: 0,
113113
resources: []
114114
})
115115
expect(stubGetProjects.calledOnce).to.be.true

test/unit/common/testData.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ const jobsRequestBody = [
590590
const taasTeamItem0ResponseBody = {
591591
id: 9050,
592592
name: 'sample',
593-
weeklyCount: 29.7,
593+
weeklyCost: 29.7,
594594
resources: [
595595
{
596596
id: '1b88e433-828b-4e0d-9fb5-ef75b9dcca6e',
@@ -620,7 +620,7 @@ const taasTeamItem0ResponseBody = {
620620
const taasTeam9050ResponseBody = {
621621
id: 9050,
622622
name: 'sample',
623-
weeklyCount: 29.7,
623+
weeklyCost: 29.7,
624624
resources: [
625625
{
626626
id: '1b88e433-828b-4e0d-9fb5-ef75b9dcca6e',

0 commit comments

Comments
 (0)