Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
cde5585
Budget sub target model schema
Jul 30, 2021
678909c
Merge branch 'development' of https://github.com/FundImpact/fundimpac…
Jul 30, 2021
9f12f7f
create sub target module models
Jul 30, 2021
e88e0b1
update columns in year tag sub target
20Manish20 Aug 3, 2021
e7875f7
Merge pull request #295 from FundImpact/dev_manish
Arjun-8624 Aug 3, 2021
ec35617
change relation
Aug 25, 2021
8096d33
new Api for manage project target
Aug 27, 2021
14cf523
set relation in schema
Aug 27, 2021
a962fc2
add relation in schema
Aug 27, 2021
5ad8373
Bug-fix
Aug 27, 2021
bcf610d
change route Method
Aug 27, 2021
52173a7
minor changes
Aug 30, 2021
647d9a9
schema changes
Aug 30, 2021
52f037a
query changes
Aug 31, 2021
0e5bad7
add logs
Aug 31, 2021
d68cda5
query changes for project_budget_target_amount_sum
Aug 31, 2021
15fa878
query changes for sub-target amount sum
Aug 31, 2021
0508c74
add delete column for schema
Aug 31, 2021
0657994
changes
Aug 31, 2021
7f1ac04
add name column
Sep 7, 2021
476d987
query-changes
Sep 10, 2021
8d3d420
add join for the query
Sep 10, 2021
6800eb8
add join for the query
Sep 10, 2021
930617b
debug query
Sep 10, 2021
5bdc6f2
query fixes
Sep 10, 2021
5e637a7
changes
Sep 10, 2021
34b7fc0
query fixes
Sep 10, 2021
a2776ec
query changes
Sep 10, 2021
8654a9a
query changes
Sep 10, 2021
4bbde5a
query changes
Sep 10, 2021
de678c9
changes
Sep 10, 2021
d48a039
changes
Sep 10, 2021
6067771
changes
Sep 10, 2021
a1284b2
changes
Sep 10, 2021
f742097
query changes
Sep 10, 2021
08983fe
query changes
Sep 10, 2021
a6dafc3
remove target_value column from db
Sep 10, 2021
1338ada
add graphql query
Sep 10, 2021
b59e340
code restructure
Sep 10, 2021
56ea0ce
add enum
Sep 20, 2021
f80f53d
changes
Sep 20, 2021
e621b8d
add deliverable type
Sep 20, 2021
420379e
schema changes
Sep 21, 2021
62268b2
rename changes
Sep 30, 2021
42d6acc
changes
Sep 30, 2021
5b74f44
key parent_id add in deliverable-target-project
20Manish20 Oct 8, 2021
da04848
Merge pull request #298 from FundImpact/dev_manish
m123shkum Oct 8, 2021
b5719f2
deliverale type geo-region-mapper and geo-regions new table
Oct 20, 2021
7c3208a
Merge pull request #299 from FundImpact/dev_suresh
htimali Oct 20, 2021
a4a6590
grampanchayat
Oct 20, 2021
4a6e573
grampanchayat and village in add new fields grampanchayat
Oct 20, 2021
5f1a2d2
Merge pull request #301 from FundImpact/dev_suresh
htimali Oct 20, 2021
3f8659f
budget target in fields add
Oct 25, 2021
30e8c1a
Merge pull request #306 from FundImpact/dev_suresh
htimali Oct 25, 2021
d1574b3
field remove
Oct 26, 2021
b3c743b
Merge pull request #308 from FundImpact/dev_suresh
htimali Oct 26, 2021
33554bd
bug fix
Oct 26, 2021
d966b09
Merge pull request #309 from FundImpact/dev_suresh
htimali Oct 26, 2021
9f7ed2b
bug fix
Oct 26, 2021
68eb270
Merge pull request #310 from FundImpact/dev_suresh
htimali Oct 26, 2021
c109867
deleverable type in add parent id and weight
Oct 26, 2021
db37248
Merge pull request #311 from FundImpact/dev_suresh
htimali Oct 26, 2021
1df35a2
fields add
Oct 27, 2021
120edaf
Merge pull request #312 from FundImpact/dev_suresh
htimali Oct 27, 2021
bbd5ede
tally new all model
Oct 28, 2021
c8a0e94
Merge pull request #313 from FundImpact/dev_suresh
htimali Oct 28, 2021
fd7eff0
geo region add field
Oct 28, 2021
68b94af
Merge pull request #314 from FundImpact/dev_suresh
htimali Oct 28, 2021
ac9a803
isActive
Oct 28, 2021
4a9e803
Merge pull request #315 from FundImpact/dev_suresh
htimali Oct 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ logs
results
node_modules
.node_history
package-lock.json
yarn.lock


############################
Expand Down
Empty file modified api/.gitkeep
100644 → 100755
Empty file.
Empty file modified api/account/config/routes.json
100644 → 100755
Empty file.
Empty file modified api/account/controllers/account.js
100644 → 100755
Empty file.
Empty file modified api/account/documentation/1.0.0/account.json
100644 → 100755
Empty file.
Empty file modified api/account/models/account.js
100644 → 100755
Empty file.
Empty file modified api/account/models/account.settings.json
100644 → 100755
Empty file.
Empty file modified api/account/services/account.js
100644 → 100755
Empty file.
Empty file modified api/annual-year/config/routes.json
100644 → 100755
Empty file.
Empty file modified api/annual-year/config/schema.graphql.js
100644 → 100755
Empty file.
Empty file modified api/annual-year/controllers/annual-year.js
100644 → 100755
Empty file.
Empty file modified api/annual-year/documentation/1.0.0/annual-year.json
100644 → 100755
Empty file.
Empty file modified api/annual-year/models/annual-year.js
100644 → 100755
Empty file.
Empty file modified api/annual-year/models/annual-year.settings.json
100644 → 100755
Empty file.
Empty file modified api/annual-year/services/annual-year.js
100644 → 100755
Empty file.
Empty file modified api/block/config/routes.json
100644 → 100755
Empty file.
Empty file modified api/block/controllers/block.js
100644 → 100755
Empty file.
Empty file modified api/block/models/block.js
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions api/block/models/block.settings.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"villages": {
"via": "block",
"collection": "village"
},
"geo_regions": {
"via": "block_id",
"collection": "geo-regions"
}
}
}
Empty file modified api/block/services/block.js
100644 → 100755
Empty file.
Empty file modified api/budget-category-organization/config/policies/addFilter.js
100644 → 100755
Empty file.
Empty file.
Empty file modified api/budget-category-organization/config/routes.json
100644 → 100755
Empty file.
Empty file modified api/budget-category-organization/config/schema.graphql.js
100644 → 100755
Empty file.
Empty file.
Empty file.
4 changes: 4 additions & 0 deletions api/budget-category-organization/models/budget-category-organization.settings.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"deleted": {
"type": "boolean",
"default": false
},
"project_id": {
"via": "budget_category_organizations",
"model": "project"
}
}
}
Empty file.
52 changes: 52 additions & 0 deletions api/budget-sub-target/config/routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/budget-sub-targets",
"handler": "budget-sub-target.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/budget-sub-targets/count",
"handler": "budget-sub-target.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/budget-sub-targets/:id",
"handler": "budget-sub-target.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/budget-sub-targets",
"handler": "budget-sub-target.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/budget-sub-targets/:id",
"handler": "budget-sub-target.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/budget-sub-targets/:id",
"handler": "budget-sub-target.delete",
"config": {
"policies": []
}
}
]
}
8 changes: 8 additions & 0 deletions api/budget-sub-target/controllers/budget-sub-target.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers)
* to customize this controller
*/

module.exports = {};
8 changes: 8 additions & 0 deletions api/budget-sub-target/models/budget-sub-target.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks)
* to customize this model
*/

module.exports = {};
50 changes: 50 additions & 0 deletions api/budget-sub-target/models/budget-sub-target.settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"kind": "collectionType",
"collectionName": "budget_sub_targets",
"info": {
"name": "Budget Sub Target"
},
"options": {
"increments": true,
"timestamps": true
},
"attributes": {
"project": {
"model": "project"
},
"budget_targets_project": {
"model": "budget-targets-project"
},
"target_value": {
"type": "float"
},
"deleted": {
"type": "boolean",
"default": false
},
"timeperiod_start": {
"type": "date"
},
"timeperiod_end": {
"type": "date"
},
"donor": {
"model": "donor"
},
"grant_periods_project": {
"model": "grant-periods-project"
},
"financial_year_org": {
"model": "year-tag"
},
"financial_year_donor": {
"model": "year-tag"
},
"annual_year": {
"model": "year-tag"
},
"name": {
"type": "string"
}
}
}
8 changes: 8 additions & 0 deletions api/budget-sub-target/services/budget-sub-target.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services)
* to customize this service
*/

module.exports = {};
Empty file modified api/budget-targets-project/config/policies/addFilter.js
100644 → 100755
Empty file.
Empty file modified api/budget-targets-project/config/routes.json
100644 → 100755
Empty file.
Empty file modified api/budget-targets-project/config/schema.graphql.js
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified api/budget-targets-project/models/budget-targets-project.js
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions api/budget-targets-project/models/budget-targets-project.settings.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"deleted": {
"type": "boolean",
"default": false
},
"project_with_budget_targets": {
"collection": "project-with-budget-target",
"via": "budget_targets_project"
}
}
}
2 changes: 1 addition & 1 deletion api/budget-targets-project/services/budget-targets-project.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
module.exports = {
totalTargetExpense: async ctx => {
try {
let sumData = await strapi.connections.default.raw(`SELECT SUM(total_target_amount) FROM budget_targets_project where project = ${ctx.params.where.project} and COALESCE(budget_targets_project.deleted, false) <> true`)
let sumData = await strapi.connections.default.raw(`SELECT SUM(target_value) FROM budget_sub_targets where project = ${ctx.params.where.project} and COALESCE(budget_sub_targets.deleted, false) <> true`)
return sumData.rows && sumData.rows.length > 0 && sumData.rows[0].sum != null ? sumData.rows[0].sum : 0;
} catch (error) {
return ctx.badRequest(null, error.message);
Expand Down
Empty file modified api/budget-tracking-lineitem/config/policies/addFilter.js
100644 → 100755
Empty file.
Empty file modified api/budget-tracking-lineitem/config/routes.json
100644 → 100755
Empty file.
Empty file modified api/budget-tracking-lineitem/config/schema.graphql.js
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified api/budget-tracking-lineitem/models/budget-tracking-lineitem.js
100644 → 100755
Empty file.
17 changes: 16 additions & 1 deletion api/budget-tracking-lineitem/models/budget-tracking-lineitem.settings.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"model": "budget-targets-project"
},
"annual_year": {
"model": "annual-year"
"model": "year-tag"
},
"grant_periods_project": {
"model": "grant-periods-project"
Expand Down Expand Up @@ -47,6 +47,21 @@
"deleted": {
"type": "boolean",
"default": false
},
"budget_sub_target": {
"model": "budget-sub-target"
},
"timeperiod_start": {
"type": "date"
},
"timeperiod_end": {
"type": "date"
},
"financial_year_org": {
"model": "year-tag"
},
"financial_year_donor": {
"model": "year-tag"
}
}
}
73 changes: 45 additions & 28 deletions api/budget-tracking-lineitem/services/budget-tracking-lineitem.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,36 +1,53 @@
'use strict';
"use strict";

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services)
* to customize this service
*/

module.exports = {
spendAmount: async ctx => {
try {
let sumData = await strapi.connections.default.raw(`SELECT SUM(amount) FROM budget_tracking_lineitem where budget_targets_project = ${ctx.params.where.budgetTargetsProject} and COALESCE(deleted, false) <> true`)
return sumData.rows && sumData.rows.length > 0 && sumData.rows[0].sum != null ? sumData.rows[0].sum : 0;
} catch (error) {
console.log(error)
return ctx.badRequest(null, error.message);

}
},
totalSpendAmountByProject: async ctx => {
try {
console.log( ctx.params.where);
let budget_targets_projectIds = await strapi.query("budget-targets-project").find({project : ctx.params.where.project, _limit: 1000 })
let sumData = 0;
budget_targets_projectIds = budget_targets_projectIds.filter(m => !m.deleted).map(m => m.id);
if(budget_targets_projectIds.length > 0){
budget_targets_projectIds = budget_targets_projectIds.map(x => "'" + x + "'").toString();
sumData = await strapi.connections.default.raw(`SELECT SUM(amount) FROM budget_tracking_lineitem where budget_targets_project IN (${budget_targets_projectIds}) and COALESCE(budget_tracking_lineitem.deleted, false) <> true`)
}
return sumData.rows && sumData.rows.length > 0 && sumData.rows[0].sum != null ? sumData.rows[0].sum : 0;
} catch (error) {
console.log(error)
return ctx.badRequest(null, error.message);
}
},

spendAmount: async (ctx) => {
try {
let sumData = await strapi.connections.default.raw(
`SELECT SUM(amount) FROM budget_tracking_lineitem where budget_targets_project = ${ctx.params.where.budgetTargetsProject} and COALESCE(deleted, false) <> true`
);
return sumData.rows &&
sumData.rows.length > 0 &&
sumData.rows[0].sum != null
? sumData.rows[0].sum
: 0;
} catch (error) {
console.log(error);
return ctx.badRequest(null, error.message);
}
},
totalSpendAmountByProject: async (ctx) => {
try {
console.log(ctx.params.where);
let budget_sub_targets_projectIds = await strapi
.query("budget-sub-target")
.find({ project: ctx.params.where.project, _limit: 1000 });
console.log('budget-sub-target',budget_sub_targets_projectIds.length,budget_sub_targets_projectIds)
let sumData = 0;
budget_sub_targets_projectIds = budget_sub_targets_projectIds
.filter((m) => !m.deleted)
.map((m) => m.id);
if (budget_sub_targets_projectIds.length > 0) {
budget_sub_targets_projectIds = budget_sub_targets_projectIds
.map((x) => "'" + x + "'")
.toString();
sumData = await strapi.connections.default.raw(
`SELECT SUM(amount) FROM budget_tracking_lineitem where budget_sub_target IN (${budget_sub_targets_projectIds}) and COALESCE(budget_tracking_lineitem.deleted, false) <> true`
);
}
return sumData.rows &&
sumData.rows.length > 0 &&
sumData.rows[0].sum != null
? sumData.rows[0].sum
: 0;
} catch (error) {
console.log(error);
return ctx.badRequest(null, error.message);
}
},
};
Empty file modified api/category-unit/config/routes.json
100644 → 100755
Empty file.
Empty file modified api/category-unit/config/schema.graphql.js
100644 → 100755
Empty file.
Empty file modified api/category-unit/controllers/category-unit.js
100644 → 100755
Empty file.
Empty file modified api/category-unit/models/category-unit.js
100644 → 100755
Empty file.
Empty file modified api/category-unit/models/category-unit.settings.json
100644 → 100755
Empty file.
Empty file modified api/category-unit/services/category-unit.js
100644 → 100755
Empty file.
Empty file modified api/category/config/routes.json
100644 → 100755
Empty file.
Empty file modified api/category/config/schema.graphql.js
100644 → 100755
Empty file.
Empty file modified api/category/controllers/category.js
100644 → 100755
Empty file.
Empty file modified api/category/models/category.js
100644 → 100755
Empty file.
Empty file modified api/category/models/category.settings.json
100644 → 100755
Empty file.
Empty file modified api/category/services/category.js
100644 → 100755
Empty file.
Empty file modified api/configuration/config/routes.json
100644 → 100755
Empty file.
Empty file modified api/configuration/controllers/configuration.js
100644 → 100755
Empty file.
52 changes: 52 additions & 0 deletions api/cost-categories/config/routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/cost-categories",
"handler": "cost-categories.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/cost-categories/count",
"handler": "cost-categories.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/cost-categories/:id",
"handler": "cost-categories.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/cost-categories",
"handler": "cost-categories.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/cost-categories/:id",
"handler": "cost-categories.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/cost-categories/:id",
"handler": "cost-categories.delete",
"config": {
"policies": []
}
}
]
}
8 changes: 8 additions & 0 deletions api/cost-categories/controllers/cost-categories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers)
* to customize this controller
*/

module.exports = {};
8 changes: 8 additions & 0 deletions api/cost-categories/models/cost-categories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks)
* to customize this model
*/

module.exports = {};
Loading