-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from TC4Y-777/familyPage
Create tithe queries for getting sum of tithe amounts
- Loading branch information
Showing
10 changed files
with
402 additions
and
12 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
Tithe-Spring/src/main/java/com/tithe/controller/query/TitheQueries.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* | ||
*/ | ||
package com.tithe.controller.query; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.graphql.data.method.annotation.Argument; | ||
import org.springframework.graphql.data.method.annotation.QueryMapping; | ||
import org.springframework.stereotype.Controller; | ||
|
||
import com.tithe.model.AnnualTitheTotalInterface; | ||
import com.tithe.service.query.TitheQueryService; | ||
|
||
/** | ||
* @author Ashish Sam T George | ||
* | ||
*/ | ||
@Controller | ||
public class TitheQueries { | ||
|
||
@Autowired | ||
private TitheQueryService titheQueryService; | ||
|
||
@QueryMapping(name = "getCurrentYearPersonTitheTotal") | ||
public Double getCurrentYearPersonTitheTotal(@Argument(name = "personId") Long personId){ | ||
return titheQueryService.getCurrentYearPersonTitheTotal(personId); | ||
} | ||
|
||
@QueryMapping(name = "getAnnualPersonTitheTotal") | ||
public List<AnnualTitheTotalInterface> getAnnualPersonTitheTotal(@Argument(name = "personId") Long personId){ | ||
return titheQueryService.getAnnualPersonTitheTotal(personId); | ||
} | ||
|
||
@QueryMapping(name = "getCurrentYearFamilyTitheTotal") | ||
public Double getCurrentYearFamilyTitheTotal(@Argument(name = "familyId") Long familyId){ | ||
return titheQueryService.getCurrentYearFamilyTitheTotal(familyId); | ||
} | ||
|
||
@QueryMapping(name = "getAnnualFamilyTitheTotal") | ||
public List<AnnualTitheTotalInterface> getAnnualFamilyTitheTotal(@Argument(name = "familyId") Long familyId){ | ||
return titheQueryService.getAnnualFamilyTitheTotal(familyId); | ||
} | ||
|
||
@QueryMapping(name = "getCurrentYearKoottaymaTitheTotal") | ||
public Double getCurrentYearKoottaymaTitheTotal(@Argument(name = "koottaymaId") Long koottaymaId){ | ||
return titheQueryService.getCurrentYearKoottaymaTitheTotal(koottaymaId); | ||
} | ||
|
||
@QueryMapping(name = "getAnnualKoottaymaTitheTotal") | ||
public List<AnnualTitheTotalInterface> getAnnualKoottaymaTitheTotal(@Argument(name = "koottaymaId") Long koottaymaId){ | ||
return titheQueryService.getAnnualKoottaymaTitheTotal(koottaymaId); | ||
} | ||
|
||
@QueryMapping(name = "getCurrentYearParishTitheTotal") | ||
public Double getCurrentYearParishTitheTotal(@Argument(name = "parishId") Long parishId){ | ||
return titheQueryService.getCurrentYearParishTitheTotal(parishId); | ||
} | ||
|
||
@QueryMapping(name = "getAnnualParishTitheTotal") | ||
public List<AnnualTitheTotalInterface> getAnnualParishTitheTotal(@Argument(name = "parishId") Long parishId){ | ||
return titheQueryService.getAnnualParishTitheTotal(parishId); | ||
} | ||
|
||
@QueryMapping(name = "getCurrentYearForaneTitheTotal") | ||
public Double getCurrentYearForaneTitheTotal(@Argument(name = "foraneId") Long foraneId){ | ||
return titheQueryService.getCurrentYearForaneTitheTotal(foraneId); | ||
} | ||
|
||
@QueryMapping(name = "getAnnualForaneTitheTotal") | ||
public List<AnnualTitheTotalInterface> getAnnualForaneTitheTotal(@Argument(name = "foraneId") Long foraneId){ | ||
return titheQueryService.getAnnualForaneTitheTotal(foraneId); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
Tithe-Spring/src/main/java/com/tithe/model/AnnualTitheTotalInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* | ||
*/ | ||
package com.tithe.model; | ||
|
||
import java.time.LocalDate; | ||
|
||
/** | ||
* @author Ashish Sam T George | ||
* | ||
*/ | ||
public interface AnnualTitheTotalInterface { | ||
|
||
String getYear(); | ||
Double getTitheTotal(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Tithe-Spring/src/main/resources/graphql/queries/TitheQueries.graphqls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
extend type Query{ | ||
getCurrentYearPersonTitheTotal(personId: ID!): Float! | ||
getAnnualPersonTitheTotal(personId: ID!): [AnnualTitheTotalSchema] | ||
|
||
getCurrentYearFamilyTitheTotal(familyId: ID!): Float! | ||
getAnnualFamilyTitheTotal(familyId: ID!): [AnnualTitheTotalSchema] | ||
|
||
getCurrentYearKoottaymaTitheTotal(koottaymaId: ID!): Float! | ||
getAnnualKoottaymaTitheTotal(koottaymaId: ID!): [AnnualTitheTotalSchema] | ||
|
||
getCurrentYearParishTitheTotal(parishId: ID!): Float! | ||
getAnnualParishTitheTotal(parishId: ID!): [AnnualTitheTotalSchema] | ||
|
||
getCurrentYearForaneTitheTotal(foraneId: ID!): Float! | ||
getAnnualForaneTitheTotal(foraneId: ID!): [AnnualTitheTotalSchema] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.