From cdc74144ce51a74591d7a42b2062e19a38acf4bc Mon Sep 17 00:00:00 2001 From: pakote Date: Fri, 3 Jun 2022 13:48:33 +0200 Subject: [PATCH] D06 --- reports/UML_domain_model.uxf | 246 +++++---- .../java/acme/entities/chimpums/Chimpum.java | 140 ++--- src/main/java/acme/entities/sisit/Sisit.java | 70 +++ .../AdministratorDashboardRepository.java | 22 +- .../AdministratorDashboardShowService.java | 36 +- .../chimpum/InventorChimpumController.java | 78 +-- .../chimpum/InventorChimpumCreateService.java | 516 +++++++++--------- .../chimpum/InventorChimpumDeleteService.java | 140 ++--- .../chimpum/InventorChimpumListService.java | 110 ++-- .../chimpum/InventorChimpumRepository.java | 78 +-- .../chimpum/InventorChimpumShowService.java | 148 ++--- .../chimpum/InventorChimpumUpdateService.java | 514 ++++++++--------- .../inventor/item/InventorItemRepository.java | 4 +- .../item/InventorItemShowService.java | 2 +- .../acme/forms/AdministratorDashboard.java | 10 +- .../WEB-INF/resources/sample-data/chimpum.csv | 3 - .../WEB-INF/resources/sample-data/sisit.csv | 3 + .../administrator-dashboard/form.jsp | 18 +- .../administrator-dashboard/messages-en.i18n | 12 +- .../administrator-dashboard/messages-es.i18n | 12 +- .../webapp/WEB-INF/views/fragments/menu.jsp | 3 + .../WEB-INF/views/inventor/chimpum/form.jsp | 4 +- .../WEB-INF/views/inventor/chimpum/list.jsp | 5 +- .../WEB-INF/views/inventor/item/form.jsp | 4 +- .../InventorChimpumCreateServiceTest.java | 146 ++--- .../chimpum/InventorChimpumDashboardTest.java | 48 +- .../InventorChimpumDeleteServiceTest.java | 96 ++-- .../chimpum/InventorChimpumListTest.java | 52 +- .../InventorChimpumShowServiceTest.java | 66 +-- .../InventorChimpumUpdateServiceTest.java | 118 ++-- 30 files changed, 1405 insertions(+), 1299 deletions(-) create mode 100644 src/main/java/acme/entities/sisit/Sisit.java delete mode 100644 src/main/webapp/WEB-INF/resources/sample-data/chimpum.csv create mode 100644 src/main/webapp/WEB-INF/resources/sample-data/sisit.csv diff --git a/reports/UML_domain_model.uxf b/reports/UML_domain_model.uxf index 3c1cbd1..39d0656 100644 --- a/reports/UML_domain_model.uxf +++ b/reports/UML_domain_model.uxf @@ -4,23 +4,23 @@ UMLClass - 1232 - 1067 + 1188 + 1122 781 451 <<Serializable>> AdministratorDashboard -- -+ ratioOfItemsWithChimpum: Double {Min(0)} -+ averageBudgetOfChimpumGroupedByCurrency: Map<Pair<String,String>,Double> ++ ratioOfToolsWithSisit: Double {Min(0)} ++ averageShareOfSisitGroupedByCurrency: Map<Pair<String,String>,Double> + deviationRetailPriceOfComponentsGroupedByTechnologyAndCurrency: Map<Pair<String,String>,Double> + minimunRetailPriceOfComponentsGroupedByTechnologyAndCurrency: Map<Pair<String,String>,Double> + maximunRetailPriceOfComponentsGroupedByTechnologyAndCurrency: Map<Pair<String,String>,Double> + totalNumberOfTools: Integer {Min(0)} + averageBudgetOfToolGroupedByCurrency: Map<String,Double> -+ deviationBudgetOfChimpumGroupedByCurrency: Map<String,Double> -+ minimunBudgetOfChimpumGroupedByCurrency: Map<String,Double> ++ deviationShareOfSisitGroupedByCurrency: Map<String,Double> ++ minimunShareOfSisitGroupedByCurrency: Map<String,Double> + maximunBudgetOfToolGroupedByCurrency: Map<String,Double> + totalNumberOfTools: Integer {Min(0)} + averageBudgetOfToolGroupedByCurrency: Map<String,Double> @@ -33,7 +33,7 @@ AdministratorDashboard + averageBudgetOfPatronagesGroupedByStatusAndCurrency: Map<Pair<PatronageStatus,String>,Double> + deviationBudgetOfPatronagesGroupedByStatusAndCurrency: Map<Pair<PatronageStatus,String>,Double> + minimunBudgetOfPatronagesGroupedByStatusAndCurrency: Map<Pair<PatronageStatus,String>,Double> -+ maximunBudgetOfChimpumGroupedByCurrency: Map<Pair<PatronageStatus,String>,Double> ++ maximunShareOfSisitGroupedByCurrency: Map<Pair<PatronageStatus,String>,Double> bg=yellow @@ -41,8 +41,8 @@ bg=yellow UMLClass - 132 - 1331 + 88 + 1386 407 154 @@ -61,8 +61,8 @@ bg=yellow UMLClass - 748 - 198 + 704 + 253 440 198 @@ -85,8 +85,8 @@ bg=yellow UMLClass - 1034 - 539 + 990 + 594 429 198 @@ -108,8 +108,8 @@ bg=yellow UMLClass - 1507 - 429 + 1463 + 484 418 209 @@ -132,8 +132,8 @@ bg=yellow UMLClass - 209 - 374 + 165 + 429 176 143 @@ -150,8 +150,8 @@ bg=yellow UMLClass - 1683 - 825 + 1639 + 880 704 143 @@ -170,8 +170,8 @@ bg=yellow Relation - 1584 - 627 + 1540 + 682 143 264 @@ -184,8 +184,8 @@ is composed of > UMLClass - 1738 - 286 + 1694 + 341 341 121 @@ -201,8 +201,8 @@ bg=yellow UMLClass - 1364 - 286 + 1320 + 341 352 121 @@ -218,8 +218,8 @@ bg=yellow Relation - 1375 - 396 + 1331 + 451 154 154 @@ -232,8 +232,8 @@ is given to < Relation - 1914 - 396 + 1870 + 451 242 121 @@ -246,8 +246,8 @@ is created by > UMLClass - 209 - 550 + 165 + 605 176 143 @@ -263,8 +263,8 @@ bg=yellow UMLClass - 473 - 561 + 429 + 616 275 88 @@ -280,8 +280,8 @@ bg=yellow Relation - 550 - 286 + 506 + 341 220 297 @@ -294,8 +294,8 @@ makes reference to ^ Relation - 737 - 594 + 693 + 649 319 55 @@ -308,8 +308,8 @@ refers to > UMLClass - 209 - 726 + 165 + 781 176 143 @@ -325,8 +325,8 @@ bg=yellow UMLClass - 209 - 902 + 165 + 957 176 143 @@ -343,8 +343,8 @@ bg=yellow UMLNote - 429 - 990 + 385 + 1045 176 110 @@ -357,8 +357,8 @@ bg=pink Relation - 946 - 66 + 902 + 121 1012 242 @@ -371,8 +371,8 @@ belongs to > UMLNote - 2013 - 638 + 1969 + 693 209 88 @@ -387,8 +387,8 @@ bg=pink UMLNote - 2013 - 517 + 1969 + 572 209 88 @@ -403,8 +403,8 @@ bg=pink Relation - 1914 - 550 + 1870 + 605 121 44 @@ -415,8 +415,8 @@ bg=pink Relation - 1914 - 583 + 1870 + 638 121 121 @@ -427,8 +427,8 @@ bg=pink UMLNote - 1804 - 726 + 1760 + 781 132 55 @@ -443,8 +443,8 @@ bg=pink Relation - 1859 - 627 + 1815 + 682 33 121 @@ -455,8 +455,8 @@ bg=pink UMLNote - 1331 - 748 + 1287 + 803 132 55 @@ -471,8 +471,8 @@ bg=pink Relation - 1375 - 726 + 1331 + 781 33 44 @@ -483,8 +483,8 @@ bg=pink UMLNote - 627 - 440 + 583 + 495 264 88 @@ -501,8 +501,8 @@ bg=pink Relation - 682 - 385 + 638 + 440 275 77 @@ -513,8 +513,8 @@ bg=pink UMLNote - 462 - 726 + 418 + 781 198 77 @@ -530,8 +530,8 @@ bg=pink Relation - 550 - 638 + 506 + 693 44 110 @@ -542,8 +542,8 @@ bg=pink UMLNote - 935 - 440 + 891 + 495 286 55 @@ -558,8 +558,8 @@ bg=pink Relation - 1001 - 484 + 957 + 539 264 77 @@ -570,8 +570,8 @@ bg=pink UMLClass - 1177 - 836 + 1133 + 891 407 154 @@ -590,8 +590,8 @@ bg=yellow UMLNote - 1672 - 1540 + 1628 + 1595 198 55 @@ -605,8 +605,8 @@ bg=pink UMLNote - 1408 - 1540 + 1364 + 1595 198 55 @@ -620,8 +620,8 @@ bg=pink Relation - 1760 - 1507 + 1716 + 1562 33 55 @@ -632,8 +632,8 @@ bg=pink Relation - 1496 - 1507 + 1452 + 1562 33 55 @@ -644,8 +644,8 @@ bg=pink UMLClass - 550 - 1166 + 506 + 1221 649 242 @@ -666,8 +666,8 @@ bg=yellow UMLNote - 594 - 1485 + 550 + 1540 198 55 @@ -681,8 +681,8 @@ bg=pink UMLNote - 924 - 1485 + 880 + 1540 198 55 @@ -696,8 +696,8 @@ bg=pink Relation - 671 - 1397 + 627 + 1452 33 110 @@ -708,8 +708,8 @@ bg=pink Relation - 1001 - 1397 + 957 + 1452 33 110 @@ -720,8 +720,8 @@ bg=pink Relation - 1243 - 143 + 1199 + 198 638 418 @@ -734,8 +734,8 @@ belongs to > UMLClass - 132 - 1155 + 88 + 1210 407 154 @@ -755,8 +755,8 @@ bg=yellow UMLClass - 748 - 836 + 704 + 891 407 154 @@ -776,8 +776,8 @@ bg=yellow Relation - 396 - 1089 + 352 + 1144 88 88 @@ -788,19 +788,18 @@ bg=yellow UMLClass - 121 - 0 + 77 + 55 418 209 <<Entity>> -Chimpum +Sisit -- -+ status: PatronageStatus + code: String {Pattern(^[A-Z]{3}-[0-9]{2}-[0-9]{2}-[0-9]{2}$)} -+ Title: String {NotBlank, Length(1,101)} -+ Body: String {NotBlank, Length(1,101)} -+ budget: Money ++ name: String {NotBlank, Length(1,100)} ++ summary: String {NotBlank, Length(1,255)} ++ share: Money + creationMoment: Date {Past, Temporal(TIMESTAMP)} + startDate: Date {Temporal(TIMESTAMP)} + endDate: Date {Temporal(TIMESTAMP)} @@ -813,8 +812,8 @@ bg=yellow Relation - 528 - 110 + 484 + 165 385 110 @@ -824,4 +823,31 @@ m2=0.1 Is associated with 220.0;80.0;220.0;10.0;10.0;10.0 + + UMLNote + + 561 + 66 + 264 + 88 + + Item == TOOL + + + +bg=pink + + + + Relation + + 484 + 88 + 99 + 44 + + lt=.. + + 70.0;20.0;10.0;20.0 + diff --git a/src/main/java/acme/entities/chimpums/Chimpum.java b/src/main/java/acme/entities/chimpums/Chimpum.java index a6cc5da..646a313 100644 --- a/src/main/java/acme/entities/chimpums/Chimpum.java +++ b/src/main/java/acme/entities/chimpums/Chimpum.java @@ -1,70 +1,70 @@ -package acme.entities.chimpums; - -import java.util.Date; - -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.OneToOne; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.validation.Valid; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Past; -import javax.validation.constraints.Pattern; - -import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.URL; - -import acme.entities.items.Item; -import acme.framework.datatypes.Money; -import acme.framework.entities.AbstractEntity; -import lombok.Getter; -import lombok.Setter; - -@Entity -@Getter -@Setter -public class Chimpum extends AbstractEntity{ - - protected static final long serialVersionUID = 1L; - - @NotNull - @Pattern(regexp = "^[A-Z]{3}-[0-9]{2}-[0-9]{2}-[0-9]{2}$") - protected String code; - - @NotNull - @Past - @Temporal(TemporalType.TIMESTAMP) - protected Date creationMoment; - - @NotNull - @Temporal(TemporalType.TIMESTAMP) - protected Date startDate; - - @NotNull - @Temporal(TemporalType.TIMESTAMP) - protected Date endDate; - - @NotBlank - @Length(min=1, max = 100) - protected String title; - - @NotBlank - @Length(min=1, max = 255) - protected String description; - - @NotNull - @Valid - protected Money budget; - - @URL - protected String moreInfo; - - @NotNull - @Valid - @OneToOne(optional = false) - @JoinColumn(unique = true) - protected Item item; - -} +//package acme.entities.chimpums; +// +//import java.util.Date; +// +//import javax.persistence.Entity; +//import javax.persistence.JoinColumn; +//import javax.persistence.OneToOne; +//import javax.persistence.Temporal; +//import javax.persistence.TemporalType; +//import javax.validation.Valid; +//import javax.validation.constraints.NotBlank; +//import javax.validation.constraints.NotNull; +//import javax.validation.constraints.Past; +//import javax.validation.constraints.Pattern; +// +//import org.hibernate.validator.constraints.Length; +//import org.hibernate.validator.constraints.URL; +// +//import acme.entities.items.Item; +//import acme.framework.datatypes.Money; +//import acme.framework.entities.AbstractEntity; +//import lombok.Getter; +//import lombok.Setter; +// +//@Entity +//@Getter +//@Setter +//public class Chimpum extends AbstractEntity{ +// +// protected static final long serialVersionUID = 1L; +// +// @NotNull +// @Pattern(regexp = "^[A-Z]{3}-[0-9]{2}-[0-9]{2}-[0-9]{2}$") +// protected String code; +// +// @NotNull +// @Past +// @Temporal(TemporalType.TIMESTAMP) +// protected Date creationMoment; +// +// @NotNull +// @Temporal(TemporalType.TIMESTAMP) +// protected Date startDate; +// +// @NotNull +// @Temporal(TemporalType.TIMESTAMP) +// protected Date endDate; +// +// @NotBlank +// @Length(min=1, max = 100) +// protected String title; +// +// @NotBlank +// @Length(min=1, max = 255) +// protected String description; +// +// @NotNull +// @Valid +// protected Money budget; +// +// @URL +// protected String moreInfo; +// +// @NotNull +// @Valid +// @OneToOne(optional = false) +// @JoinColumn(unique = true) +// protected Item item; +// +//} diff --git a/src/main/java/acme/entities/sisit/Sisit.java b/src/main/java/acme/entities/sisit/Sisit.java new file mode 100644 index 0000000..f909489 --- /dev/null +++ b/src/main/java/acme/entities/sisit/Sisit.java @@ -0,0 +1,70 @@ +package acme.entities.sisit; + +import java.util.Date; + +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Past; +import javax.validation.constraints.Pattern; + +import org.hibernate.validator.constraints.Length; +import org.hibernate.validator.constraints.URL; + +import acme.entities.items.Item; +import acme.framework.datatypes.Money; +import acme.framework.entities.AbstractEntity; +import lombok.Getter; +import lombok.Setter; + +@Entity +@Getter +@Setter +public class Sisit extends AbstractEntity{ + + protected static final long serialVersionUID = 1L; + + @NotNull + @Pattern(regexp = "^[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{1,3}$") + protected String code; + + @NotNull + @Past + @Temporal(TemporalType.TIMESTAMP) + protected Date creationMoment; + + @NotBlank + @Length(min=1, max = 100) + protected String name; + + @NotBlank + @Length(min=1, max = 255) + protected String summary; + + @NotNull + @Temporal(TemporalType.TIMESTAMP) + protected Date startDate; + + @NotNull + @Temporal(TemporalType.TIMESTAMP) + protected Date endDate; + + @NotNull + @Valid + protected Money share; + + @URL + protected String moreInfo; + + @NotNull + @Valid + @OneToOne(optional = false) + @JoinColumn(unique = true) + protected Item item; + +} diff --git a/src/main/java/acme/features/administrator/dashboard/AdministratorDashboardRepository.java b/src/main/java/acme/features/administrator/dashboard/AdministratorDashboardRepository.java index 750df6d..b494462 100644 --- a/src/main/java/acme/features/administrator/dashboard/AdministratorDashboardRepository.java +++ b/src/main/java/acme/features/administrator/dashboard/AdministratorDashboardRepository.java @@ -67,21 +67,21 @@ public interface AdministratorDashboardRepository extends AbstractRepository { List maximunBudgetOfToolGroupedByCurrency(); - //CHIMPUM - @Query("select 1.0 * count(a) / (select count(b) from Item b) from Chimpum a") - Double getRatioOfItemsWithChimpum(); + //Sisit + @Query("select 1.0 * count(a) / (select count(b) from Item b where b.itemType = acme.entities.items.ItemType.TOOL) from Sisit a") + Double getRatioOfToolsWithSisit(); - @Query("select t.budget.currency, avg(t.budget.amount) from Chimpum t group by t.budget.currency") - List getAverageBudgetOfChimpumGroupedByCurrency(); + @Query("select t.share.currency, avg(t.share.amount) from Sisit t where t.item.itemType = acme.entities.items.ItemType.TOOL group by t.share.currency") + List getAverageShareOfSisitGroupedByCurrency(); - @Query("select t.budget.currency, stddev(t.budget.amount) from Chimpum t group by t.budget.currency") - List getDeviationBudgetOfChimpumGroupedByCurrency(); + @Query("select t.share.currency, stddev(t.share.amount) from Sisit t where t.item.itemType = acme.entities.items.ItemType.TOOL group by t.share.currency") + List getDeviationShareOfSisitGroupedByCurrency(); - @Query("select t.budget.currency, min(t.budget.amount) from Chimpum t group by t.budget.currency") - List getMinimunBudgetOfChimpumGroupedByCurrency(); + @Query("select t.share.currency, min(t.share.amount) from Sisit t where t.item.itemType = acme.entities.items.ItemType.TOOL group by t.share.currency") + List getMinimunShareOfSisitGroupedByCurrency(); - @Query("select t.budget.currency, max(t.budget.amount) from Chimpum t group by t.budget.currency") - List getMaximunBudgetOfChimpumGroupedByCurrency(); + @Query("select t.share.currency, max(t.share.amount) from Sisit t where t.item.itemType = acme.entities.items.ItemType.TOOL group by t.share.currency") + List getMaximunShareOfSisitGroupedByCurrency(); //COMPONENT @Query("select count(c) from Item c where c.itemType = acme.entities.items.ItemType.COMPONENT") diff --git a/src/main/java/acme/features/administrator/dashboard/AdministratorDashboardShowService.java b/src/main/java/acme/features/administrator/dashboard/AdministratorDashboardShowService.java index 15ed990..5d2190d 100644 --- a/src/main/java/acme/features/administrator/dashboard/AdministratorDashboardShowService.java +++ b/src/main/java/acme/features/administrator/dashboard/AdministratorDashboardShowService.java @@ -65,12 +65,12 @@ public AdministratorDashboard findOne(final Request requ final Map maximunBudgetOfToolGroupedByCurrency; - //CHIMPUM DECLARACION - final Double ratioOfItemsWithChimpum; - final Map averageBudgetOfChimpumGroupedByCurrency; - final Map deviationBudgetOfChimpumGroupedByCurrency; - final Map minimunBudgetOfChimpumGroupedByCurrency; - final Map maximunBudgetOfChimpumGroupedByCurrency; + //SISIT DECLARACION + final Double ratioOfToolsWithSisit; + final Map averageShareOfSisitGroupedByCurrency; + final Map deviationShareOfSisitGroupedByCurrency; + final Map minimunShareOfSisitGroupedByCurrency; + final Map maximunShareOfSisitGroupedByCurrency; //PATRONAGE DECLARACION final AdministratorDashboard result; @@ -105,11 +105,11 @@ public AdministratorDashboard findOne(final Request requ maximunBudgetOfToolGroupedByCurrency = this.parseTool(this.repository.maximunBudgetOfToolGroupedByCurrency()); //TOOL INICIALIZACION - ratioOfItemsWithChimpum = this.repository.getRatioOfItemsWithChimpum(); - averageBudgetOfChimpumGroupedByCurrency = this.parseTool(this.repository.getAverageBudgetOfChimpumGroupedByCurrency()); - deviationBudgetOfChimpumGroupedByCurrency = this.parseTool(this.repository.getDeviationBudgetOfChimpumGroupedByCurrency()); - minimunBudgetOfChimpumGroupedByCurrency = this.parseTool(this.repository.getMinimunBudgetOfChimpumGroupedByCurrency()); - maximunBudgetOfChimpumGroupedByCurrency = this.parseTool(this.repository.getMaximunBudgetOfChimpumGroupedByCurrency()); + ratioOfToolsWithSisit= this.repository.getRatioOfToolsWithSisit(); + averageShareOfSisitGroupedByCurrency = this.parseTool(this.repository.getAverageShareOfSisitGroupedByCurrency()); + deviationShareOfSisitGroupedByCurrency = this.parseTool(this.repository.getDeviationShareOfSisitGroupedByCurrency()); + minimunShareOfSisitGroupedByCurrency = this.parseTool(this.repository.getDeviationShareOfSisitGroupedByCurrency()); + maximunShareOfSisitGroupedByCurrency = this.parseTool(this.repository.getMaximunShareOfSisitGroupedByCurrency()); //PATRONAGE INICIALIZACION totalNumberOfProposedPatronages = this.repository.totalNumberOfProposedPatronages(); @@ -145,11 +145,11 @@ public AdministratorDashboard findOne(final Request requ result.setMaximunBudgetOfToolGroupedByCurrency(maximunBudgetOfToolGroupedByCurrency); //CHIMPUM ASIGNACION - result.setRatioOfItemsWithChimpum(ratioOfItemsWithChimpum);; - result.setAverageBudgetOfChimpumGroupedByCurrency(averageBudgetOfChimpumGroupedByCurrency); - result.setDeviationBudgetOfChimpumGroupedByCurrency(deviationBudgetOfChimpumGroupedByCurrency); - result.setMinimunBudgetOfChimpumGroupedByCurrency(minimunBudgetOfChimpumGroupedByCurrency); - result.setMaximunBudgetOfChimpumGroupedByCurrency(maximunBudgetOfChimpumGroupedByCurrency); + result.setRatioOfToolsWithSisit(ratioOfToolsWithSisit);; + result.setAverageBudgetOfSisitGroupedByCurrency(averageShareOfSisitGroupedByCurrency); + result.setDeviationBudgetOfSisitGroupedByCurrency(deviationShareOfSisitGroupedByCurrency); + result.setMinimunBudgetOfSisitGroupedByCurrency(minimunShareOfSisitGroupedByCurrency); + result.setMaximunBudgetOfSisitGroupedByCurrency(maximunShareOfSisitGroupedByCurrency); //PATRONAGE ASIGNACION @@ -189,8 +189,8 @@ public void unbind(final Request request, final Administ "totalNumberOfTools", "averageBudgetOfToolGroupedByCurrency", "deviationBudgetOfToolGroupedByCurrency", "minimunBudgetOfToolGroupedByCurrency", "maximunBudgetOfToolGroupedByCurrency", - "ratioOfItemsWithChimpum", "averageBudgetOfChimpumGroupedByCurrency", "deviationBudgetOfChimpumGroupedByCurrency", - "minimunBudgetOfChimpumGroupedByCurrency", "maximunBudgetOfChimpumGroupedByCurrency", + "ratioOfToolsWithSisit", "averageBudgetOfSisitGroupedByCurrency", "deviationBudgetOfSisitGroupedByCurrency", + "minimunBudgetOfSisitGroupedByCurrency", "maximunBudgetOfSisitGroupedByCurrency", "totalNumberOfProposedPatronages", "totalNumberOfAcceptedPatronages", "totalNumberOfDeniedPatronages", "averageBudgetOfPatronagesGroupedByStatusAndCurrency", "deviationBudgetOfPatronagesGroupedByStatusAndCurrency", diff --git a/src/main/java/acme/features/inventor/chimpum/InventorChimpumController.java b/src/main/java/acme/features/inventor/chimpum/InventorChimpumController.java index 5cbe774..c60562e 100644 --- a/src/main/java/acme/features/inventor/chimpum/InventorChimpumController.java +++ b/src/main/java/acme/features/inventor/chimpum/InventorChimpumController.java @@ -1,39 +1,39 @@ -package acme.features.inventor.chimpum; - -import javax.annotation.PostConstruct; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; - -import acme.entities.chimpums.Chimpum; -import acme.framework.controllers.AbstractController; -import acme.roles.Inventor; - -@Controller -public class InventorChimpumController extends AbstractController{ - - @Autowired - protected InventorChimpumListService listService; - - @Autowired - protected InventorChimpumShowService showService; - - @Autowired - protected InventorChimpumCreateService createService; - - @Autowired - protected InventorChimpumUpdateService updateService; - - @Autowired - protected InventorChimpumDeleteService deleteService; - - @PostConstruct - protected void initialise() { - super.addCommand("show", this.showService); - super.addCommand("list", this.listService); - super.addCommand("create", this.createService); - super.addCommand("update", this.updateService); - super.addCommand("delete", this.deleteService); - } - -} \ No newline at end of file +//package acme.features.inventor.chimpum; +// +//import javax.annotation.PostConstruct; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Controller; +// +//import acme.entities.chimpums.Chimpum; +//import acme.framework.controllers.AbstractController; +//import acme.roles.Inventor; +// +//@Controller +//public class InventorChimpumController extends AbstractController{ +// +// @Autowired +// protected InventorChimpumListService listService; +// +// @Autowired +// protected InventorChimpumShowService showService; +// +// @Autowired +// protected InventorChimpumCreateService createService; +// +// @Autowired +// protected InventorChimpumUpdateService updateService; +// +// @Autowired +// protected InventorChimpumDeleteService deleteService; +// +// @PostConstruct +// protected void initialise() { +// super.addCommand("show", this.showService); +// super.addCommand("list", this.listService); +// super.addCommand("create", this.createService); +// super.addCommand("update", this.updateService); +// super.addCommand("delete", this.deleteService); +// } +// +//} \ No newline at end of file diff --git a/src/main/java/acme/features/inventor/chimpum/InventorChimpumCreateService.java b/src/main/java/acme/features/inventor/chimpum/InventorChimpumCreateService.java index b210e59..d783844 100644 --- a/src/main/java/acme/features/inventor/chimpum/InventorChimpumCreateService.java +++ b/src/main/java/acme/features/inventor/chimpum/InventorChimpumCreateService.java @@ -1,258 +1,258 @@ -package acme.features.inventor.chimpum; - -import java.time.LocalDate; -import java.time.ZoneId; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import SpamDetector.SpamDetector; -import acme.entities.chimpums.Chimpum; -import acme.entities.initialConfiguration.InitialConfiguration; -import acme.entities.items.Item; -import acme.framework.components.models.Model; -import acme.framework.controllers.Errors; -import acme.framework.controllers.Request; -import acme.framework.datatypes.Money; -import acme.framework.services.AbstractCreateService; -import acme.roles.Inventor; - -@Service -public class InventorChimpumCreateService implements AbstractCreateService{ - - @Autowired - protected InventorChimpumRepository repository; - - @Override - public boolean authorise(final Request request) { - assert request != null; - - Item item; - boolean result; - - item = this.repository.findOneItemById(request.getModel().getInteger("itemId")); - - result = item.getInventor().getId() == request.getPrincipal().getActiveRoleId() && !item.isDraftMode(); - - return result; - } - - - @Override - public void bind(final Request request, final Chimpum entity, final Errors errors) { - - request.bind(entity, errors, "title", "description", "budget", "creationMoment", "startDate", "endDate", "moreInfo"); - - String pattern; - pattern = request.getModel().getString("pattern"); - final LocalDate cm = entity.getCreationMoment().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - entity.setCode(pattern + "-" + this.codeGenerator(cm)); - - } - - - - @Override - public void unbind(final Request request, final Chimpum entity, final Model model) { - - - request.unbind(entity, model, "title", "description", "budget", "creationMoment", "startDate", "endDate", "moreInfo"); - - model.setAttribute("itemId", request.getModel().getInteger("itemId")); - if(entity.getCode()!=null) { - model.setAttribute("pattern", entity.getCode().substring(0,3)); - } - } - - - - @Override - public Chimpum instantiate(final Request request) { - assert request != null; - Chimpum result; - - Date moment; - - moment = new Date(System.currentTimeMillis() - 1); - - result = new Chimpum(); - result.setItem(this.repository.findOneItemById(request.getModel().getInteger("itemId"))); - result.setCreationMoment(moment); - return result; - } - - @Override - public void validate(final Request request, final Chimpum entity, final Errors errors) { - assert request != null; - assert entity != null; - assert errors != null; - - final InitialConfiguration initialConfig = this.repository.getSystemCofig(); - final String Strong = initialConfig.getStrongSpamTerms(); - final String Weak = initialConfig.getWeakSpamTerms(); - - final double StrongT = initialConfig.getStrongSpamTreshold(); - final double WeakT = initialConfig.getWeakSpamTreshold(); - - - String pattern; - - pattern = request.getModel().getString("pattern"); - - errors.state(request, pattern.matches("[A-Z]{3}"), "pattern", "inventor.chimpum.error.pattern"); - - - - if(!errors.hasErrors("title")) { - final boolean res; - - res = SpamDetector.spamDetector(entity.getTitle(),Strong,Weak,StrongT,WeakT); - - errors.state(request, res, "title", "any.chirp.form.error.spam"); - - } - - if(!errors.hasErrors("description")) { - final boolean res; - - res = SpamDetector.spamDetector(entity.getDescription(),Strong,Weak,StrongT,WeakT); - - errors.state(request, res, "description", "any.chirp.form.error.spam"); - - } - - if(!errors.hasErrors("moreInfo")) { - final boolean res; - - res = SpamDetector.spamDetector(entity.getMoreInfo(),Strong,Weak,StrongT,WeakT); - - errors.state(request, res, "moreInfo", "any.chirp.form.error.spam"); - - } - - - if(!errors.hasErrors("budget")) { - - final List currencies = new ArrayList<>(); - - String currency; - - for(final String c: this.repository.acceptedCurrencies().split(",")) { - currencies.add(c.trim()); - } - - currency = entity.getBudget().getCurrency(); - - errors.state(request, currencies.contains(currency) , "budget","patron.patronage.form.error.currency"); - - } - if(entity.getStartDate()!=null) { - if(!errors.hasErrors("startDate")) { - - Date startDate; - - startDate = entity.getStartDate(); - - final long diff = startDate.getTime() - entity.getCreationMoment().getTime(); - - final TimeUnit time = TimeUnit.DAYS; - final long diffrence = time.convert(diff, TimeUnit.MILLISECONDS); - - errors.state(request, diffrence>=30 , "startDate","inventor.chimpum.form.error.startDate"); - - - } - - if(!errors.hasErrors("endDate")) { - - Date endDate; - - endDate = entity.getEndDate(); - - final long diff = endDate.getTime() - entity.getStartDate().getTime(); - - final TimeUnit time = TimeUnit.DAYS; - final long diffrence = time.convert(diff, TimeUnit.MILLISECONDS); - - errors.state(request, diffrence>=7 , "endDate","inventor.chimpum.form.error.endDate"); - - - } - } - if(!errors.hasErrors("budget")) { - - Money budget; - - budget = entity.getBudget(); - - - errors.state(request, budget.getAmount()>0 , "budget","patron.patronage.form.error.amount"); - - } - - } - - @Override - public void create(final Request request, final Chimpum entity) { - assert request != null; - assert entity != null; - - this.repository.save(entity); - - } - - public String codeGenerator(final LocalDate creationMoment) { - String res = ""; - Integer day; - Integer month; - Integer year; - - day =creationMoment.getDayOfMonth(); - month =creationMoment.getMonthValue(); - year =creationMoment.getYear(); - - String strYear= ""; - String strDay= ""; - String strMonth= ""; - - strYear = year.toString().substring(2, 4); - - if(day.toString().length()==1) { - - strDay = "0" +day.toString(); - - - } - - else{ - - strDay = day.toString(); - - } - - if(month.toString().length()==1) { - - strMonth = "0" +month.toString(); - - - } - - else{ - - strMonth = month.toString(); - - - } - - res= strYear + "-" + strMonth + "-" + strDay; - - return res; - - - - } -} +//package acme.features.inventor.chimpum; +// +//import java.time.LocalDate; +//import java.time.ZoneId; +//import java.util.ArrayList; +//import java.util.Date; +//import java.util.List; +//import java.util.concurrent.TimeUnit; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +// +//import SpamDetector.SpamDetector; +//import acme.entities.chimpums.Chimpum; +//import acme.entities.initialConfiguration.InitialConfiguration; +//import acme.entities.items.Item; +//import acme.framework.components.models.Model; +//import acme.framework.controllers.Errors; +//import acme.framework.controllers.Request; +//import acme.framework.datatypes.Money; +//import acme.framework.services.AbstractCreateService; +//import acme.roles.Inventor; +// +//@Service +//public class InventorChimpumCreateService implements AbstractCreateService{ +// +// @Autowired +// protected InventorChimpumRepository repository; +// +// @Override +// public boolean authorise(final Request request) { +// assert request != null; +// +// Item item; +// boolean result; +// +// item = this.repository.findOneItemById(request.getModel().getInteger("itemId")); +// +// result = item.getInventor().getId() == request.getPrincipal().getActiveRoleId() && !item.isDraftMode(); +// +// return result; +// } +// +// +// @Override +// public void bind(final Request request, final Chimpum entity, final Errors errors) { +// +// request.bind(entity, errors, "title", "description", "budget", "creationMoment", "startDate", "endDate", "moreInfo"); +// +// String pattern; +// pattern = request.getModel().getString("pattern"); +// final LocalDate cm = entity.getCreationMoment().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); +// entity.setCode(pattern + "-" + this.codeGenerator(cm)); +// +// } +// +// +// +// @Override +// public void unbind(final Request request, final Chimpum entity, final Model model) { +// +// +// request.unbind(entity, model, "title", "description", "budget", "creationMoment", "startDate", "endDate", "moreInfo"); +// +// model.setAttribute("itemId", request.getModel().getInteger("itemId")); +// if(entity.getCode()!=null) { +// model.setAttribute("pattern", entity.getCode().substring(0,3)); +// } +// } +// +// +// +// @Override +// public Chimpum instantiate(final Request request) { +// assert request != null; +// Chimpum result; +// +// Date moment; +// +// moment = new Date(System.currentTimeMillis() - 1); +// +// result = new Chimpum(); +// result.setItem(this.repository.findOneItemById(request.getModel().getInteger("itemId"))); +// result.setCreationMoment(moment); +// return result; +// } +// +// @Override +// public void validate(final Request request, final Chimpum entity, final Errors errors) { +// assert request != null; +// assert entity != null; +// assert errors != null; +// +// final InitialConfiguration initialConfig = this.repository.getSystemCofig(); +// final String Strong = initialConfig.getStrongSpamTerms(); +// final String Weak = initialConfig.getWeakSpamTerms(); +// +// final double StrongT = initialConfig.getStrongSpamTreshold(); +// final double WeakT = initialConfig.getWeakSpamTreshold(); +// +// +// String pattern; +// +// pattern = request.getModel().getString("pattern"); +// +// errors.state(request, pattern.matches("[A-Z]{3}"), "pattern", "inventor.chimpum.error.pattern"); +// +// +// +// if(!errors.hasErrors("title")) { +// final boolean res; +// +// res = SpamDetector.spamDetector(entity.getTitle(),Strong,Weak,StrongT,WeakT); +// +// errors.state(request, res, "title", "any.chirp.form.error.spam"); +// +// } +// +// if(!errors.hasErrors("description")) { +// final boolean res; +// +// res = SpamDetector.spamDetector(entity.getDescription(),Strong,Weak,StrongT,WeakT); +// +// errors.state(request, res, "description", "any.chirp.form.error.spam"); +// +// } +// +// if(!errors.hasErrors("moreInfo")) { +// final boolean res; +// +// res = SpamDetector.spamDetector(entity.getMoreInfo(),Strong,Weak,StrongT,WeakT); +// +// errors.state(request, res, "moreInfo", "any.chirp.form.error.spam"); +// +// } +// +// +// if(!errors.hasErrors("budget")) { +// +// final List currencies = new ArrayList<>(); +// +// String currency; +// +// for(final String c: this.repository.acceptedCurrencies().split(",")) { +// currencies.add(c.trim()); +// } +// +// currency = entity.getBudget().getCurrency(); +// +// errors.state(request, currencies.contains(currency) , "budget","patron.patronage.form.error.currency"); +// +// } +// if(entity.getStartDate()!=null) { +// if(!errors.hasErrors("startDate")) { +// +// Date startDate; +// +// startDate = entity.getStartDate(); +// +// final long diff = startDate.getTime() - entity.getCreationMoment().getTime(); +// +// final TimeUnit time = TimeUnit.DAYS; +// final long diffrence = time.convert(diff, TimeUnit.MILLISECONDS); +// +// errors.state(request, diffrence>=30 , "startDate","inventor.chimpum.form.error.startDate"); +// +// +// } +// +// if(!errors.hasErrors("endDate")) { +// +// Date endDate; +// +// endDate = entity.getEndDate(); +// +// final long diff = endDate.getTime() - entity.getStartDate().getTime(); +// +// final TimeUnit time = TimeUnit.DAYS; +// final long diffrence = time.convert(diff, TimeUnit.MILLISECONDS); +// +// errors.state(request, diffrence>=7 , "endDate","inventor.chimpum.form.error.endDate"); +// +// +// } +// } +// if(!errors.hasErrors("budget")) { +// +// Money budget; +// +// budget = entity.getBudget(); +// +// +// errors.state(request, budget.getAmount()>0 , "budget","patron.patronage.form.error.amount"); +// +// } +// +// } +// +// @Override +// public void create(final Request request, final Chimpum entity) { +// assert request != null; +// assert entity != null; +// +// this.repository.save(entity); +// +// } +// +// public String codeGenerator(final LocalDate creationMoment) { +// String res = ""; +// Integer day; +// Integer month; +// Integer year; +// +// day =creationMoment.getDayOfMonth(); +// month =creationMoment.getMonthValue(); +// year =creationMoment.getYear(); +// +// String strYear= ""; +// String strDay= ""; +// String strMonth= ""; +// +// strYear = year.toString().substring(2, 4); +// +// if(day.toString().length()==1) { +// +// strDay = "0" +day.toString(); +// +// +// } +// +// else{ +// +// strDay = day.toString(); +// +// } +// +// if(month.toString().length()==1) { +// +// strMonth = "0" +month.toString(); +// +// +// } +// +// else{ +// +// strMonth = month.toString(); +// +// +// } +// +// res= strYear + "-" + strMonth + "-" + strDay; +// +// return res; +// +// +// +// } +//} diff --git a/src/main/java/acme/features/inventor/chimpum/InventorChimpumDeleteService.java b/src/main/java/acme/features/inventor/chimpum/InventorChimpumDeleteService.java index 52a5b20..d49e04f 100644 --- a/src/main/java/acme/features/inventor/chimpum/InventorChimpumDeleteService.java +++ b/src/main/java/acme/features/inventor/chimpum/InventorChimpumDeleteService.java @@ -1,70 +1,70 @@ -package acme.features.inventor.chimpum; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import acme.entities.chimpums.Chimpum; -import acme.framework.components.models.Model; -import acme.framework.controllers.Errors; -import acme.framework.controllers.Request; -import acme.framework.services.AbstractDeleteService; -import acme.roles.Inventor; - -@Service -public class InventorChimpumDeleteService implements AbstractDeleteService { - - @Autowired - protected InventorChimpumRepository repository; - - @Override - public boolean authorise(final Request request) { - assert request != null; - - return true; - } - - @Override - public void bind(final Request request, final Chimpum entity, final Errors errors) { - request.bind(entity, errors, "code", "legalStuff", "budget", "creationDate", "startDate", "endDate", "moreInfo"); - - - } - - @Override - public void unbind(final Request request, final Chimpum entity, final Model model) { - request.unbind(entity, model, "status", "code", "legalStuff", "budget", "creationDate", "startDate", "endDate", "moreInfo","published"); - - - } - - @Override - public Chimpum findOne(final Request request) { - assert request != null; - Chimpum result; - int id; - - id = request.getModel().getInteger("id"); - result = this.repository.findOneChimpumById(id); - - - return result; - } - - @Override - public void validate(final Request request, final Chimpum entity, final Errors errors) { - assert request != null; - assert entity != null; - assert errors != null; - - } - - @Override - public void delete(final Request request, final Chimpum entity) { - assert request != null; - assert entity != null; - - this.repository.delete(entity); - - } - -} +//package acme.features.inventor.chimpum; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +// +//import acme.entities.chimpums.Chimpum; +//import acme.framework.components.models.Model; +//import acme.framework.controllers.Errors; +//import acme.framework.controllers.Request; +//import acme.framework.services.AbstractDeleteService; +//import acme.roles.Inventor; +// +//@Service +//public class InventorChimpumDeleteService implements AbstractDeleteService { +// +// @Autowired +// protected InventorChimpumRepository repository; +// +// @Override +// public boolean authorise(final Request request) { +// assert request != null; +// +// return true; +// } +// +// @Override +// public void bind(final Request request, final Chimpum entity, final Errors errors) { +// request.bind(entity, errors, "code", "legalStuff", "budget", "creationDate", "startDate", "endDate", "moreInfo"); +// +// +// } +// +// @Override +// public void unbind(final Request request, final Chimpum entity, final Model model) { +// request.unbind(entity, model, "status", "code", "legalStuff", "budget", "creationDate", "startDate", "endDate", "moreInfo","published"); +// +// +// } +// +// @Override +// public Chimpum findOne(final Request request) { +// assert request != null; +// Chimpum result; +// int id; +// +// id = request.getModel().getInteger("id"); +// result = this.repository.findOneChimpumById(id); +// +// +// return result; +// } +// +// @Override +// public void validate(final Request request, final Chimpum entity, final Errors errors) { +// assert request != null; +// assert entity != null; +// assert errors != null; +// +// } +// +// @Override +// public void delete(final Request request, final Chimpum entity) { +// assert request != null; +// assert entity != null; +// +// this.repository.delete(entity); +// +// } +// +//} diff --git a/src/main/java/acme/features/inventor/chimpum/InventorChimpumListService.java b/src/main/java/acme/features/inventor/chimpum/InventorChimpumListService.java index 91183e9..1cf59f1 100644 --- a/src/main/java/acme/features/inventor/chimpum/InventorChimpumListService.java +++ b/src/main/java/acme/features/inventor/chimpum/InventorChimpumListService.java @@ -1,55 +1,55 @@ -package acme.features.inventor.chimpum; - -import java.util.Collection; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import acme.currencyExchangeFunction.ExchangeMoneyFunctionService; -import acme.entities.chimpums.Chimpum; -import acme.framework.components.models.Model; -import acme.framework.controllers.Request; -import acme.framework.services.AbstractListService; -import acme.roles.Inventor; - -@Service -public class InventorChimpumListService implements AbstractListService { - - @Autowired - protected InventorChimpumRepository repository; - - @Autowired - protected ExchangeMoneyFunctionService exchangeService; - - - @Override - public boolean authorise(final Request request) { - assert request != null; - - return true; - } - - @Override - public Collection findMany(final Request request) { - assert request != null; - - final Collection result; - - - result = this.repository.findChimpumsByInventorId(request.getPrincipal().getActiveRoleId()); - - return result; - - } - - @Override - public void unbind(final Request request, final Chimpum entity, final Model model) { - assert request != null; - assert entity != null; - assert model != null; - - request.unbind(entity, model, "code", "title","budget", "startDate","endDate"); - - } - -} \ No newline at end of file +//package acme.features.inventor.chimpum; +// +//import java.util.Collection; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +// +//import acme.currencyExchangeFunction.ExchangeMoneyFunctionService; +//import acme.entities.chimpums.Chimpum; +//import acme.framework.components.models.Model; +//import acme.framework.controllers.Request; +//import acme.framework.services.AbstractListService; +//import acme.roles.Inventor; +// +//@Service +//public class InventorChimpumListService implements AbstractListService { +// +// @Autowired +// protected InventorChimpumRepository repository; +// +// @Autowired +// protected ExchangeMoneyFunctionService exchangeService; +// +// +// @Override +// public boolean authorise(final Request request) { +// assert request != null; +// +// return true; +// } +// +// @Override +// public Collection findMany(final Request request) { +// assert request != null; +// +// final Collection result; +// +// +// result = this.repository.findChimpumsByInventorId(request.getPrincipal().getActiveRoleId()); +// +// return result; +// +// } +// +// @Override +// public void unbind(final Request request, final Chimpum entity, final Model model) { +// assert request != null; +// assert entity != null; +// assert model != null; +// +// request.unbind(entity, model, "code", "title","budget", "startDate","endDate"); +// +// } +// +//} \ No newline at end of file diff --git a/src/main/java/acme/features/inventor/chimpum/InventorChimpumRepository.java b/src/main/java/acme/features/inventor/chimpum/InventorChimpumRepository.java index c96803a..bffc3a3 100644 --- a/src/main/java/acme/features/inventor/chimpum/InventorChimpumRepository.java +++ b/src/main/java/acme/features/inventor/chimpum/InventorChimpumRepository.java @@ -1,39 +1,39 @@ -package acme.features.inventor.chimpum; - -import java.util.Collection; - -import org.springframework.data.jpa.repository.Query; -import org.springframework.stereotype.Repository; - -import acme.entities.chimpums.Chimpum; -import acme.entities.initialConfiguration.InitialConfiguration; -import acme.entities.items.Item; -import acme.framework.repositories.AbstractRepository; - -@Repository -public interface InventorChimpumRepository extends AbstractRepository { - - @Query("select i from Item i where i.id = :id") - Item findOneItemById(int id); - - @Query("select c from Chimpum c where c.id = :id") - Chimpum findOneChimpumById(int id); - - - @Query("select c from Chimpum c where c.item.inventor.id =:id") - Collection findChimpumsByInventorId(int id); - - @Query("select c.defaultCurrency from InitialConfiguration c") - String defaultCurrency(); - - @Query("select initialConfiguration from InitialConfiguration initialConfiguration") - InitialConfiguration getSystemCofig(); - - @Query("select p from Chimpum p where p.code = :code") - Chimpum findOneChimpumByCode(String code); - - @Query("SELECT ic.acceptedCurrencies FROM InitialConfiguration ic") - String acceptedCurrencies(); - - -} \ No newline at end of file +//package acme.features.inventor.chimpum; +// +//import java.util.Collection; +// +//import org.springframework.data.jpa.repository.Query; +//import org.springframework.stereotype.Repository; +// +//import acme.entities.chimpums.Chimpum; +//import acme.entities.initialConfiguration.InitialConfiguration; +//import acme.entities.items.Item; +//import acme.framework.repositories.AbstractRepository; +// +//@Repository +//public interface InventorChimpumRepository extends AbstractRepository { +// +// @Query("select i from Item i where i.id = :id") +// Item findOneItemById(int id); +// +// @Query("select c from Chimpum c where c.id = :id") +// Chimpum findOneChimpumById(int id); +// +// +// @Query("select c from Chimpum c where c.item.inventor.id =:id") +// Collection findChimpumsByInventorId(int id); +// +// @Query("select c.defaultCurrency from InitialConfiguration c") +// String defaultCurrency(); +// +// @Query("select initialConfiguration from InitialConfiguration initialConfiguration") +// InitialConfiguration getSystemCofig(); +// +// @Query("select p from Chimpum p where p.code = :code") +// Chimpum findOneChimpumByCode(String code); +// +// @Query("SELECT ic.acceptedCurrencies FROM InitialConfiguration ic") +// String acceptedCurrencies(); +// +// +//} \ No newline at end of file diff --git a/src/main/java/acme/features/inventor/chimpum/InventorChimpumShowService.java b/src/main/java/acme/features/inventor/chimpum/InventorChimpumShowService.java index 198efda..a6391ed 100644 --- a/src/main/java/acme/features/inventor/chimpum/InventorChimpumShowService.java +++ b/src/main/java/acme/features/inventor/chimpum/InventorChimpumShowService.java @@ -1,74 +1,74 @@ -package acme.features.inventor.chimpum; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import acme.currencyExchangeFunction.ExchangeMoneyFunctionService; -import acme.entities.chimpums.Chimpum; -import acme.forms.MoneyExchange; -import acme.framework.components.models.Model; -import acme.framework.controllers.Request; -import acme.framework.services.AbstractShowService; -import acme.roles.Inventor; - -@Service -public class InventorChimpumShowService implements AbstractShowService { - - @Autowired - protected InventorChimpumRepository repository; - - @Autowired - protected ExchangeMoneyFunctionService exchangeService; - - @Override - public boolean authorise(final Request request) { - assert request != null; - - boolean result; - int chimpumId; - Chimpum chimpum; - - chimpumId = request.getModel().getInteger("id"); - chimpum = this.repository.findOneChimpumById(chimpumId); - result = chimpum.getItem().getInventor().getId() == request.getPrincipal().getActiveRoleId(); - - return result; - } - - @Override - public Chimpum findOne(final Request request) { - assert request != null; - Chimpum result; - int id; - - id = request.getModel().getInteger("id"); - result = this.repository.findOneChimpumById(id); - - - return result; - } - - @Override - public void unbind(final Request request, final Chimpum entity, final Model model) { - assert request != null; - assert entity != null; - assert model != null; - - final String defaultCurrency; - MoneyExchange exchange; - boolean isExchange; - - defaultCurrency = this.repository.defaultCurrency(); - exchange = this.exchangeService.computeMoneyExchange(entity.getBudget(), defaultCurrency); - isExchange = ! entity.getBudget().getCurrency().equals(exchange.target.getCurrency()); - - request.unbind(entity, model, "code", "title", "description", "budget", "creationMoment", "startDate", "endDate", "moreInfo"); - - model.setAttribute("exchange", exchange.target); - model.setAttribute("isExchange", isExchange); - model.setAttribute("itemId", entity.getItem().getId()); - model.setAttribute("pattern", entity.getCode().substring(0,3)); - - } - -} \ No newline at end of file +//package acme.features.inventor.chimpum; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +// +//import acme.currencyExchangeFunction.ExchangeMoneyFunctionService; +//import acme.entities.chimpums.Chimpum; +//import acme.forms.MoneyExchange; +//import acme.framework.components.models.Model; +//import acme.framework.controllers.Request; +//import acme.framework.services.AbstractShowService; +//import acme.roles.Inventor; +// +//@Service +//public class InventorChimpumShowService implements AbstractShowService { +// +// @Autowired +// protected InventorChimpumRepository repository; +// +// @Autowired +// protected ExchangeMoneyFunctionService exchangeService; +// +// @Override +// public boolean authorise(final Request request) { +// assert request != null; +// +// boolean result; +// int chimpumId; +// Chimpum chimpum; +// +// chimpumId = request.getModel().getInteger("id"); +// chimpum = this.repository.findOneChimpumById(chimpumId); +// result = chimpum.getItem().getInventor().getId() == request.getPrincipal().getActiveRoleId(); +// +// return result; +// } +// +// @Override +// public Chimpum findOne(final Request request) { +// assert request != null; +// Chimpum result; +// int id; +// +// id = request.getModel().getInteger("id"); +// result = this.repository.findOneChimpumById(id); +// +// +// return result; +// } +// +// @Override +// public void unbind(final Request request, final Chimpum entity, final Model model) { +// assert request != null; +// assert entity != null; +// assert model != null; +// +// final String defaultCurrency; +// MoneyExchange exchange; +// boolean isExchange; +// +// defaultCurrency = this.repository.defaultCurrency(); +// exchange = this.exchangeService.computeMoneyExchange(entity.getBudget(), defaultCurrency); +// isExchange = ! entity.getBudget().getCurrency().equals(exchange.target.getCurrency()); +// +// request.unbind(entity, model, "code", "title", "description", "budget", "creationMoment", "startDate", "endDate", "moreInfo"); +// +// model.setAttribute("exchange", exchange.target); +// model.setAttribute("isExchange", isExchange); +// model.setAttribute("itemId", entity.getItem().getId()); +// model.setAttribute("pattern", entity.getCode().substring(0,3)); +// +// } +// +//} \ No newline at end of file diff --git a/src/main/java/acme/features/inventor/chimpum/InventorChimpumUpdateService.java b/src/main/java/acme/features/inventor/chimpum/InventorChimpumUpdateService.java index 1d543d7..12b3e8d 100644 --- a/src/main/java/acme/features/inventor/chimpum/InventorChimpumUpdateService.java +++ b/src/main/java/acme/features/inventor/chimpum/InventorChimpumUpdateService.java @@ -1,257 +1,257 @@ -package acme.features.inventor.chimpum; - -import java.time.LocalDate; -import java.time.ZoneId; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import SpamDetector.SpamDetector; -import acme.currencyExchangeFunction.ExchangeMoneyFunctionService; -import acme.entities.chimpums.Chimpum; -import acme.entities.initialConfiguration.InitialConfiguration; -import acme.framework.components.models.Model; -import acme.framework.controllers.Errors; -import acme.framework.controllers.Request; -import acme.framework.datatypes.Money; -import acme.framework.services.AbstractUpdateService; -import acme.roles.Inventor; - -@Service -public class InventorChimpumUpdateService implements AbstractUpdateService{ - - - @Autowired - protected InventorChimpumRepository repository; - - @Autowired - protected ExchangeMoneyFunctionService exchangeService; - - @Override - public boolean authorise(final Request request) { - assert request != null; - - boolean result; - int chimpumId; - Chimpum chimpum; - - chimpumId = request.getModel().getInteger("id"); - chimpum = this.repository.findOneChimpumById(chimpumId); - result = chimpum.getItem().getInventor().getId() == request.getPrincipal().getActiveRoleId(); - - return result; - } - - @Override - public void bind(final Request request, final Chimpum entity, final Errors errors) { - assert request != null; - assert entity != null; - assert errors != null; - - request.bind(entity, errors, "title", "description","creationMoment", "budget", "startDate", "endDate", "moreInfo"); - - - } - - @Override - public void unbind(final Request request, final Chimpum entity, final Model model) { - assert request != null; - assert entity != null; - assert model != null; - - request.unbind(entity, model, "code","title", "description","creationMoment", "budget", "startDate", "endDate", "moreInfo"); - - model.setAttribute("pattern", entity.getCode().substring(0,3)); - - } - - @Override - public Chimpum findOne(final Request request) { - assert request != null; - Chimpum result; - int id; - - id = request.getModel().getInteger("id"); - result = this.repository.findOneChimpumById(id); - - return result; - } - - @Override - public void validate(final Request request, final Chimpum entity, final Errors errors) { - assert request != null; - assert entity != null; - assert errors != null; - - final InitialConfiguration initialConfig = this.repository.getSystemCofig(); - final String Strong = initialConfig.getStrongSpamTerms(); - final String Weak = initialConfig.getWeakSpamTerms(); - - final double StrongT = initialConfig.getStrongSpamTreshold(); - final double WeakT = initialConfig.getWeakSpamTreshold(); - - String pattern; - - pattern = request.getModel().getString("pattern"); - - errors.state(request, pattern.matches("[A-Z]{3}"), "pattern", "inventor.chimpum.error.pattern"); - - if(!errors.hasErrors("title")) { - final boolean res; - - res = SpamDetector.spamDetector(entity.getTitle(),Strong,Weak,StrongT,WeakT); - - errors.state(request, res, "title", "any.chirp.form.error.spam"); - - } - - if(!errors.hasErrors("description")) { - final boolean res; - - res = SpamDetector.spamDetector(entity.getDescription(),Strong,Weak,StrongT,WeakT); - - errors.state(request, res, "description", "any.chirp.form.error.spam"); - - } - - if(!errors.hasErrors("moreInfo")) { - final boolean res; - - res = SpamDetector.spamDetector(entity.getMoreInfo(),Strong,Weak,StrongT,WeakT); - - errors.state(request, res, "moreInfo", "any.chirp.form.error.spam"); - - } - - - if(!errors.hasErrors("budget")) { - - final List currencies = new ArrayList<>(); - - String currency; - - for(final String c: this.repository.acceptedCurrencies().split(",")) { - currencies.add(c.trim()); - } - - currency = entity.getBudget().getCurrency(); - - errors.state(request, currencies.contains(currency) , "budget","patron.patronage.form.error.currency"); - - } - if(entity.getStartDate()!=null) { - if(!errors.hasErrors("startDate")) { - - Date startDate; - - startDate = entity.getStartDate(); - - final long diff = startDate.getTime() - entity.getCreationMoment().getTime(); - - final TimeUnit time = TimeUnit.DAYS; - final long diffrence = time.convert(diff, TimeUnit.MILLISECONDS); - - errors.state(request, diffrence>=30 , "startDate","inventor.chimpum.form.error.startDate"); - - - } - - if(!errors.hasErrors("endDate")) { - - Date endDate; - - endDate = entity.getEndDate(); - - final long diff = endDate.getTime() - entity.getStartDate().getTime(); - - final TimeUnit time = TimeUnit.DAYS; - final long diffrence = time.convert(diff, TimeUnit.MILLISECONDS); - - errors.state(request, diffrence>=7 , "endDate","inventor.chimpum.form.error.endDate"); - - - } - } - if(!errors.hasErrors("budget")) { - - Money budget; - - budget = entity.getBudget(); - - - errors.state(request, budget.getAmount()>0 , "budget","patron.patronage.form.error.amount"); - - } - - - } - - @Override - public void update(final Request request, final Chimpum entity) { - assert request != null; - assert entity != null; - - String pattern; - pattern = request.getModel().getString("pattern"); - final LocalDate cm = entity.getCreationMoment().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - entity.setCode(pattern + "-" + this.codeGenerator(cm)); - - this.repository.save(entity); - - } - - public String codeGenerator(final LocalDate creationMoment) { - String res = ""; - Integer day; - Integer month; - Integer year; - - day =creationMoment.getDayOfMonth(); - month =creationMoment.getMonthValue(); - year =creationMoment.getYear(); - - String strYear= ""; - String strDay= ""; - String strMonth= ""; - - strYear = year.toString().substring(2, 4); - - if(day.toString().length()==1) { - - strDay = "0" +day.toString(); - - - } - - else{ - - strDay = day.toString(); - - } - - if(month.toString().length()==1) { - - strMonth = "0" +month.toString(); - - - } - - else{ - - strMonth = month.toString(); - - - } - - res= strYear + "-" + strMonth + "-" + strDay; - - return res; - - - - } -} +//package acme.features.inventor.chimpum; +// +//import java.time.LocalDate; +//import java.time.ZoneId; +//import java.util.ArrayList; +//import java.util.Date; +//import java.util.List; +//import java.util.concurrent.TimeUnit; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +// +//import SpamDetector.SpamDetector; +//import acme.currencyExchangeFunction.ExchangeMoneyFunctionService; +//import acme.entities.chimpums.Chimpum; +//import acme.entities.initialConfiguration.InitialConfiguration; +//import acme.framework.components.models.Model; +//import acme.framework.controllers.Errors; +//import acme.framework.controllers.Request; +//import acme.framework.datatypes.Money; +//import acme.framework.services.AbstractUpdateService; +//import acme.roles.Inventor; +// +//@Service +//public class InventorChimpumUpdateService implements AbstractUpdateService{ +// +// +// @Autowired +// protected InventorChimpumRepository repository; +// +// @Autowired +// protected ExchangeMoneyFunctionService exchangeService; +// +// @Override +// public boolean authorise(final Request request) { +// assert request != null; +// +// boolean result; +// int chimpumId; +// Chimpum chimpum; +// +// chimpumId = request.getModel().getInteger("id"); +// chimpum = this.repository.findOneChimpumById(chimpumId); +// result = chimpum.getItem().getInventor().getId() == request.getPrincipal().getActiveRoleId(); +// +// return result; +// } +// +// @Override +// public void bind(final Request request, final Chimpum entity, final Errors errors) { +// assert request != null; +// assert entity != null; +// assert errors != null; +// +// request.bind(entity, errors, "title", "description","creationMoment", "budget", "startDate", "endDate", "moreInfo"); +// +// +// } +// +// @Override +// public void unbind(final Request request, final Chimpum entity, final Model model) { +// assert request != null; +// assert entity != null; +// assert model != null; +// +// request.unbind(entity, model, "code","title", "description","creationMoment", "budget", "startDate", "endDate", "moreInfo"); +// +// model.setAttribute("pattern", entity.getCode().substring(0,3)); +// +// } +// +// @Override +// public Chimpum findOne(final Request request) { +// assert request != null; +// Chimpum result; +// int id; +// +// id = request.getModel().getInteger("id"); +// result = this.repository.findOneChimpumById(id); +// +// return result; +// } +// +// @Override +// public void validate(final Request request, final Chimpum entity, final Errors errors) { +// assert request != null; +// assert entity != null; +// assert errors != null; +// +// final InitialConfiguration initialConfig = this.repository.getSystemCofig(); +// final String Strong = initialConfig.getStrongSpamTerms(); +// final String Weak = initialConfig.getWeakSpamTerms(); +// +// final double StrongT = initialConfig.getStrongSpamTreshold(); +// final double WeakT = initialConfig.getWeakSpamTreshold(); +// +// String pattern; +// +// pattern = request.getModel().getString("pattern"); +// +// errors.state(request, pattern.matches("[A-Z]{3}"), "pattern", "inventor.chimpum.error.pattern"); +// +// if(!errors.hasErrors("title")) { +// final boolean res; +// +// res = SpamDetector.spamDetector(entity.getTitle(),Strong,Weak,StrongT,WeakT); +// +// errors.state(request, res, "title", "any.chirp.form.error.spam"); +// +// } +// +// if(!errors.hasErrors("description")) { +// final boolean res; +// +// res = SpamDetector.spamDetector(entity.getDescription(),Strong,Weak,StrongT,WeakT); +// +// errors.state(request, res, "description", "any.chirp.form.error.spam"); +// +// } +// +// if(!errors.hasErrors("moreInfo")) { +// final boolean res; +// +// res = SpamDetector.spamDetector(entity.getMoreInfo(),Strong,Weak,StrongT,WeakT); +// +// errors.state(request, res, "moreInfo", "any.chirp.form.error.spam"); +// +// } +// +// +// if(!errors.hasErrors("budget")) { +// +// final List currencies = new ArrayList<>(); +// +// String currency; +// +// for(final String c: this.repository.acceptedCurrencies().split(",")) { +// currencies.add(c.trim()); +// } +// +// currency = entity.getBudget().getCurrency(); +// +// errors.state(request, currencies.contains(currency) , "budget","patron.patronage.form.error.currency"); +// +// } +// if(entity.getStartDate()!=null) { +// if(!errors.hasErrors("startDate")) { +// +// Date startDate; +// +// startDate = entity.getStartDate(); +// +// final long diff = startDate.getTime() - entity.getCreationMoment().getTime(); +// +// final TimeUnit time = TimeUnit.DAYS; +// final long diffrence = time.convert(diff, TimeUnit.MILLISECONDS); +// +// errors.state(request, diffrence>=30 , "startDate","inventor.chimpum.form.error.startDate"); +// +// +// } +// +// if(!errors.hasErrors("endDate")) { +// +// Date endDate; +// +// endDate = entity.getEndDate(); +// +// final long diff = endDate.getTime() - entity.getStartDate().getTime(); +// +// final TimeUnit time = TimeUnit.DAYS; +// final long diffrence = time.convert(diff, TimeUnit.MILLISECONDS); +// +// errors.state(request, diffrence>=7 , "endDate","inventor.chimpum.form.error.endDate"); +// +// +// } +// } +// if(!errors.hasErrors("budget")) { +// +// Money budget; +// +// budget = entity.getBudget(); +// +// +// errors.state(request, budget.getAmount()>0 , "budget","patron.patronage.form.error.amount"); +// +// } +// +// +// } +// +// @Override +// public void update(final Request request, final Chimpum entity) { +// assert request != null; +// assert entity != null; +// +// String pattern; +// pattern = request.getModel().getString("pattern"); +// final LocalDate cm = entity.getCreationMoment().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); +// entity.setCode(pattern + "-" + this.codeGenerator(cm)); +// +// this.repository.save(entity); +// +// } +// +// public String codeGenerator(final LocalDate creationMoment) { +// String res = ""; +// Integer day; +// Integer month; +// Integer year; +// +// day =creationMoment.getDayOfMonth(); +// month =creationMoment.getMonthValue(); +// year =creationMoment.getYear(); +// +// String strYear= ""; +// String strDay= ""; +// String strMonth= ""; +// +// strYear = year.toString().substring(2, 4); +// +// if(day.toString().length()==1) { +// +// strDay = "0" +day.toString(); +// +// +// } +// +// else{ +// +// strDay = day.toString(); +// +// } +// +// if(month.toString().length()==1) { +// +// strMonth = "0" +month.toString(); +// +// +// } +// +// else{ +// +// strMonth = month.toString(); +// +// +// } +// +// res= strYear + "-" + strMonth + "-" + strDay; +// +// return res; +// +// +// +// } +//} diff --git a/src/main/java/acme/features/inventor/item/InventorItemRepository.java b/src/main/java/acme/features/inventor/item/InventorItemRepository.java index e12fd58..33d13dc 100644 --- a/src/main/java/acme/features/inventor/item/InventorItemRepository.java +++ b/src/main/java/acme/features/inventor/item/InventorItemRepository.java @@ -38,8 +38,8 @@ public interface InventorItemRepository extends AbstractRepository { @Query("select i from Inventor i where i.id = :id") Inventor findOneInventorById(int id); - @Query("SELECT c.id FROM Chimpum c WHERE c.item.id =:id") - Integer findOneChimpumByItemId(int id); +// @Query("SELECT c.id FROM Chimpum c WHERE c.item.id =:id") +// Integer findOneChimpumByItemId(int id); } diff --git a/src/main/java/acme/features/inventor/item/InventorItemShowService.java b/src/main/java/acme/features/inventor/item/InventorItemShowService.java index 394f914..4a564e5 100644 --- a/src/main/java/acme/features/inventor/item/InventorItemShowService.java +++ b/src/main/java/acme/features/inventor/item/InventorItemShowService.java @@ -69,7 +69,7 @@ public void unbind(final Request request, final Item entity, final Model m model.setAttribute("exchange", exchange.target); model.setAttribute("isExchange", isExchange); model.setAttribute("itemId", entity.getId()); - model.setAttribute("chimpum", this.repository.findOneChimpumByItemId(entity.getId())); +// model.setAttribute("chimpum", this.repository.findOneChimpumByItemId(entity.getId())); } } diff --git a/src/main/java/acme/forms/AdministratorDashboard.java b/src/main/java/acme/forms/AdministratorDashboard.java index 61b210d..31eae9b 100644 --- a/src/main/java/acme/forms/AdministratorDashboard.java +++ b/src/main/java/acme/forms/AdministratorDashboard.java @@ -51,11 +51,11 @@ public class AdministratorDashboard implements Serializable { Map,Double> maximunBudgetOfPatronagesGroupedByStatusAndCurrency; @Min(0) - Double ratioOfItemsWithChimpum; - Map averageBudgetOfChimpumGroupedByCurrency; - Map deviationBudgetOfChimpumGroupedByCurrency; - Map minimunBudgetOfChimpumGroupedByCurrency; - Map maximunBudgetOfChimpumGroupedByCurrency; + Double ratioOfToolsWithSisit; + Map averageBudgetOfSisitGroupedByCurrency; + Map deviationBudgetOfSisitGroupedByCurrency; + Map minimunBudgetOfSisitGroupedByCurrency; + Map maximunBudgetOfSisitGroupedByCurrency; // Derived attributes ----------------------------------------------------- // Relationships ---------------------------------------------------------- diff --git a/src/main/webapp/WEB-INF/resources/sample-data/chimpum.csv b/src/main/webapp/WEB-INF/resources/sample-data/chimpum.csv deleted file mode 100644 index 1cb7586..0000000 --- a/src/main/webapp/WEB-INF/resources/sample-data/chimpum.csv +++ /dev/null @@ -1,3 +0,0 @@ -key,code,creationMoment,startDate,endDate,title,description,budget,moreInfo,key:item -chimpum-01,ABC-22-03-10,2022/03/10 16:00,2022/04/10 16:00,2022/05/27 16:00,test,test,EUR 100,null,item-01 -chimpum-02,DEF-22-04-10,2022/04/10 16:00,2022/05/10 16:00,2022/06/27 16:00,test2,test2,GBP 40,null,item-02 diff --git a/src/main/webapp/WEB-INF/resources/sample-data/sisit.csv b/src/main/webapp/WEB-INF/resources/sample-data/sisit.csv new file mode 100644 index 0000000..18f4178 --- /dev/null +++ b/src/main/webapp/WEB-INF/resources/sample-data/sisit.csv @@ -0,0 +1,3 @@ +key,code,creationMoment,startDate,endDate,name,summary,share,moreInfo,key:item +sisit-01,22-03-10-666,2022/03/10 16:00,2022/04/10 16:00,2022/05/27 16:00,test,test,EUR 100,null,item-01 +sisit-02,22-04-10-4,2022/04/10 16:00,2022/05/10 16:00,2022/06/27 16:00,test2,test2,GBP 40,null,item-02 diff --git a/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/form.jsp b/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/form.jsp index 1b394a6..b1fb62e 100644 --- a/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/form.jsp +++ b/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/form.jsp @@ -29,13 +29,13 @@ acme.entities.patronages.PatronageStatus"%> - + -

+


@@ -44,7 +44,7 @@ acme.entities.patronages.PatronageStatus"%> @@ -52,7 +52,7 @@ acme.entities.patronages.PatronageStatus"%> -

+


- +
@@ -61,7 +61,7 @@ acme.entities.patronages.PatronageStatus"%> @@ -69,7 +69,7 @@ acme.entities.patronages.PatronageStatus"%> -

+


- +
@@ -78,7 +78,7 @@ acme.entities.patronages.PatronageStatus"%> @@ -86,7 +86,7 @@ acme.entities.patronages.PatronageStatus"%> -

+


- +
@@ -95,7 +95,7 @@ acme.entities.patronages.PatronageStatus"%> diff --git a/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/messages-en.i18n b/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/messages-en.i18n index a05f475..6e1dfea 100644 --- a/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/messages-en.i18n +++ b/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/messages-en.i18n @@ -15,12 +15,12 @@ administrator.dashboard.form.label.deviation-retailPrice = Deviation retail pric administrator.dashboard.form.label.minimun-retailPrice = Minimun retail price of tools administrator.dashboard.form.label.maximun-retailPrice = Maximun retail price of tools -#CHIMPUM -administrator.dashboard.form.label.ratio = Ratio of items with chimpum -administrator.dashboard.form.label.chimpum.average-budget = Average retail price of chimpums -administrator.dashboard.form.label.chimpum.deviation-budget = Deviation retail price of chimpums -administrator.dashboard.form.label.chimpum.minimun-budget = Minimun retail price of chimpums -administrator.dashboard.form.label.chimpum.maximun-budget = Maximun retail price of chimpums +#sisit +administrator.dashboard.form.label.ratio = Ratio of items with sisit +administrator.dashboard.form.label.sisit.average-budget = Average retail price of sisit +administrator.dashboard.form.label.sisit.deviation-budget = Deviation retail price of sisit +administrator.dashboard.form.label.sisit.minimun-budget = Minimun retail price of sisit +administrator.dashboard.form.label.sisit.maximun-budget = Maximun retail price of sisit #PATRONAGE administrator.dashboard.form.title.patronages = Patronage indicators diff --git a/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/messages-es.i18n b/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/messages-es.i18n index 13f3849..bdcff7c 100644 --- a/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/messages-es.i18n +++ b/src/main/webapp/WEB-INF/views/administrator/administrator-dashboard/messages-es.i18n @@ -16,12 +16,12 @@ administrator.dashboard.form.label.deviation-retailPrice = Desviación del preci administrator.dashboard.form.label.minimun-retailPrice = Precio mínimo de herramientas administrator.dashboard.form.label.maximun-retailPrice = Precio máximo de herramientas -#CHIMPUM -administrator.dashboard.form.label.ratio = Ratio de items con chimpum -administrator.dashboard.form.label.chimpum.average-budget = Promedio del precio de chimpums -administrator.dashboard.form.label.chimpum.deviation-budget = Desviación del precio de chimpums -administrator.dashboard.form.label.chimpum.minimun-budget = Precio mínimo de chimpums -administrator.dashboard.form.label.chimpum.maximun-budget = Precio máximo de chimpums +#SISIT +administrator.dashboard.form.label.ratio = Ratio de tools con sisit +administrator.dashboard.form.label.sisit.average-budget = Promedio del precio de sisit +administrator.dashboard.form.label.sisit.deviation-budget = Desviación del precio de sisit +administrator.dashboard.form.label.sisit.minimun-budget = Precio mínimo de sisit +administrator.dashboard.form.label.sisit.maximun-budget = Precio máximo de sisit diff --git a/src/main/webapp/WEB-INF/views/fragments/menu.jsp b/src/main/webapp/WEB-INF/views/fragments/menu.jsp index 0d0cd6b..34a21d1 100644 --- a/src/main/webapp/WEB-INF/views/fragments/menu.jsp +++ b/src/main/webapp/WEB-INF/views/fragments/menu.jsp @@ -46,7 +46,10 @@ +<%-- + --%> + diff --git a/src/main/webapp/WEB-INF/views/inventor/chimpum/form.jsp b/src/main/webapp/WEB-INF/views/inventor/chimpum/form.jsp index 7c9acc4..539c36f 100644 --- a/src/main/webapp/WEB-INF/views/inventor/chimpum/form.jsp +++ b/src/main/webapp/WEB-INF/views/inventor/chimpum/form.jsp @@ -1,3 +1,5 @@ +<%-- + <%@page language="java"%> <%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%> @@ -30,4 +32,4 @@ - \ No newline at end of file + --%> diff --git a/src/main/webapp/WEB-INF/views/inventor/chimpum/list.jsp b/src/main/webapp/WEB-INF/views/inventor/chimpum/list.jsp index efd7402..29db174 100644 --- a/src/main/webapp/WEB-INF/views/inventor/chimpum/list.jsp +++ b/src/main/webapp/WEB-INF/views/inventor/chimpum/list.jsp @@ -1,3 +1,5 @@ +<%-- + <%@page language="java"%> <%@taglib prefix="jstl" uri="http://java.sun.com/jsp/jstl/core"%> @@ -9,4 +11,5 @@ - \ No newline at end of file + + --%> diff --git a/src/main/webapp/WEB-INF/views/inventor/item/form.jsp b/src/main/webapp/WEB-INF/views/inventor/item/form.jsp index f1505ad..36f3e40 100644 --- a/src/main/webapp/WEB-INF/views/inventor/item/form.jsp +++ b/src/main/webapp/WEB-INF/views/inventor/item/form.jsp @@ -40,6 +40,7 @@ + <%-- @@ -49,7 +50,8 @@ - + --%> + diff --git a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumCreateServiceTest.java b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumCreateServiceTest.java index dba69f4..09a7d5b 100644 --- a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumCreateServiceTest.java +++ b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumCreateServiceTest.java @@ -1,73 +1,73 @@ -package acme.testing.inventor.chimpum; - -import org.junit.jupiter.api.Order; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvFileSource; - -import acme.testing.TestHarness; - -public class InventorChimpumCreateServiceTest extends TestHarness { - - @ParameterizedTest - @Order(10) - @CsvFileSource(resources = "/inventor/chimpum/chimpum-create.csv", encoding = "utf-8", numLinesToSkip = 1) - public void positiveTest(final int recordIndex, final String pattern,final String title, final String description,final String budget - ,final String startDate,final String endDate, final String moreInfo){ - - - super.signIn("inventor1", "inventor1"); - super.clickOnMenu("Inventor", "List my items"); - super.sortListing(2, "asc"); - super.clickOnListingRecord(0); - - super.clickOnButton("Create chimpum"); - super.fillInputBoxIn("pattern", pattern); - super.fillInputBoxIn("title", title); - super.fillInputBoxIn("description", description); - super.fillInputBoxIn("budget", budget); - super.fillInputBoxIn("startDate",startDate); - super.fillInputBoxIn("endDate", endDate); - super.fillInputBoxIn("moreInfo", moreInfo); - - super.clickOnSubmit("Create"); - - super.clickOnMenu("Inventor", "List my chimpums"); - - super.sortListing(1, "asc"); - super.checkColumnHasValue(recordIndex, 1, title); - super.checkColumnHasValue(recordIndex, 2, budget); - super.checkColumnHasValue(recordIndex, 3, startDate); - super.checkColumnHasValue(recordIndex, 4, endDate); - - - super.signOut(); - } - - @ParameterizedTest - @CsvFileSource(resources = "/inventor/chimpum/chimpum-create-negative.csv", encoding = "utf-8", numLinesToSkip = 1) - public void negativeTest(final int recordIndex,final String pattern, final String title, final String description,final String budget - ,final String startDate,final String endDate, final String moreInfo) { - - - super.signIn("inventor1", "inventor1"); - super.clickOnMenu("Inventor", "List my items"); - super.sortListing(2, "asc"); - super.clickOnListingRecord(0); - - super.clickOnButton("Create chimpum"); - super.fillInputBoxIn("pattern", pattern); - super.fillInputBoxIn("title", title); - super.fillInputBoxIn("description", description); - super.fillInputBoxIn("budget", budget); - super.fillInputBoxIn("startDate",startDate); - super.fillInputBoxIn("endDate", endDate); - super.fillInputBoxIn("moreInfo", moreInfo); - - super.clickOnSubmit("Create"); - super.checkErrorsExist(); - - - super.signOut(); - } - -} +//package acme.testing.inventor.chimpum; +// +//import org.junit.jupiter.api.Order; +//import org.junit.jupiter.params.ParameterizedTest; +//import org.junit.jupiter.params.provider.CsvFileSource; +// +//import acme.testing.TestHarness; +// +//public class InventorChimpumCreateServiceTest extends TestHarness { +// +// @ParameterizedTest +// @Order(10) +// @CsvFileSource(resources = "/inventor/chimpum/chimpum-create.csv", encoding = "utf-8", numLinesToSkip = 1) +// public void positiveTest(final int recordIndex, final String pattern,final String title, final String description,final String budget +// ,final String startDate,final String endDate, final String moreInfo){ +// +// +// super.signIn("inventor1", "inventor1"); +// super.clickOnMenu("Inventor", "List my items"); +// super.sortListing(2, "asc"); +// super.clickOnListingRecord(0); +// +// super.clickOnButton("Create chimpum"); +// super.fillInputBoxIn("pattern", pattern); +// super.fillInputBoxIn("title", title); +// super.fillInputBoxIn("description", description); +// super.fillInputBoxIn("budget", budget); +// super.fillInputBoxIn("startDate",startDate); +// super.fillInputBoxIn("endDate", endDate); +// super.fillInputBoxIn("moreInfo", moreInfo); +// +// super.clickOnSubmit("Create"); +// +// super.clickOnMenu("Inventor", "List my chimpums"); +// +// super.sortListing(1, "asc"); +// super.checkColumnHasValue(recordIndex, 1, title); +// super.checkColumnHasValue(recordIndex, 2, budget); +// super.checkColumnHasValue(recordIndex, 3, startDate); +// super.checkColumnHasValue(recordIndex, 4, endDate); +// +// +// super.signOut(); +// } +// +// @ParameterizedTest +// @CsvFileSource(resources = "/inventor/chimpum/chimpum-create-negative.csv", encoding = "utf-8", numLinesToSkip = 1) +// public void negativeTest(final int recordIndex,final String pattern, final String title, final String description,final String budget +// ,final String startDate,final String endDate, final String moreInfo) { +// +// +// super.signIn("inventor1", "inventor1"); +// super.clickOnMenu("Inventor", "List my items"); +// super.sortListing(2, "asc"); +// super.clickOnListingRecord(0); +// +// super.clickOnButton("Create chimpum"); +// super.fillInputBoxIn("pattern", pattern); +// super.fillInputBoxIn("title", title); +// super.fillInputBoxIn("description", description); +// super.fillInputBoxIn("budget", budget); +// super.fillInputBoxIn("startDate",startDate); +// super.fillInputBoxIn("endDate", endDate); +// super.fillInputBoxIn("moreInfo", moreInfo); +// +// super.clickOnSubmit("Create"); +// super.checkErrorsExist(); +// +// +// super.signOut(); +// } +// +//} diff --git a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumDashboardTest.java b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumDashboardTest.java index 50be668..57162f6 100644 --- a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumDashboardTest.java +++ b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumDashboardTest.java @@ -1,24 +1,24 @@ -package acme.testing.inventor.chimpum; - -import org.junit.jupiter.api.Order; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvFileSource; - -import acme.testing.TestHarness; - -public class InventorChimpumDashboardTest extends TestHarness { - - @ParameterizedTest - @CsvFileSource(resources = "/administrator/administrator-dashboard/administrator-dashboard.csv", encoding = "utf-8", numLinesToSkip = 1) - @Order(10) - public void positivePatronDashboardTest(final int recordIndex) { - - super.signIn("administrator", "administrator"); - super.clickOnMenu("Administrator","Dashboard"); - super.checkNotPanicExists(); - super.signOut(); - - - } - -} +//package acme.testing.inventor.chimpum; +// +//import org.junit.jupiter.api.Order; +//import org.junit.jupiter.params.ParameterizedTest; +//import org.junit.jupiter.params.provider.CsvFileSource; +// +//import acme.testing.TestHarness; +// +//public class InventorChimpumDashboardTest extends TestHarness { +// +// @ParameterizedTest +// @CsvFileSource(resources = "/administrator/administrator-dashboard/administrator-dashboard.csv", encoding = "utf-8", numLinesToSkip = 1) +// @Order(10) +// public void positivePatronDashboardTest(final int recordIndex) { +// +// super.signIn("administrator", "administrator"); +// super.clickOnMenu("Administrator","Dashboard"); +// super.checkNotPanicExists(); +// super.signOut(); +// +// +// } +// +//} diff --git a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumDeleteServiceTest.java b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumDeleteServiceTest.java index 51355bc..89839df 100644 --- a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumDeleteServiceTest.java +++ b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumDeleteServiceTest.java @@ -1,48 +1,48 @@ -package acme.testing.inventor.chimpum; - -import org.junit.jupiter.api.Order; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvFileSource; - -import acme.testing.TestHarness; - -public class InventorChimpumDeleteServiceTest extends TestHarness { - - @ParameterizedTest - @Order(10) - @CsvFileSource(resources = "/inventor/chimpum/chimpum-delete.csv", encoding = "utf-8", numLinesToSkip = 1) - public void positiveTest(final int recordIndex,final String pattern, final String title, final String description,final String budget - ,final String startDate,final String endDate, final String moreInfo){ - - - super.signIn("inventor1", "inventor1"); - super.clickOnMenu("Inventor", "List my items"); - super.sortListing(2, "asc"); - super.clickOnListingRecord(0); - - super.clickOnButton("Create chimpum"); - super.fillInputBoxIn("pattern", pattern); - super.fillInputBoxIn("title", title); - super.fillInputBoxIn("description", description); - super.fillInputBoxIn("budget", budget); - super.fillInputBoxIn("startDate",startDate); - super.fillInputBoxIn("endDate", endDate); - super.fillInputBoxIn("moreInfo", moreInfo); - - super.clickOnSubmit("Create"); - - super.clickOnMenu("Inventor", "List my chimpums"); - - super.sortListing(1, "asc"); - super.clickOnListingRecord(0); - super.clickOnSubmit("Delete"); - super.checkNotErrorsExist(); - - - super.signOut(); - - - - } - -} +//package acme.testing.inventor.chimpum; +// +//import org.junit.jupiter.api.Order; +//import org.junit.jupiter.params.ParameterizedTest; +//import org.junit.jupiter.params.provider.CsvFileSource; +// +//import acme.testing.TestHarness; +// +//public class InventorChimpumDeleteServiceTest extends TestHarness { +// +// @ParameterizedTest +// @Order(10) +// @CsvFileSource(resources = "/inventor/chimpum/chimpum-delete.csv", encoding = "utf-8", numLinesToSkip = 1) +// public void positiveTest(final int recordIndex,final String pattern, final String title, final String description,final String budget +// ,final String startDate,final String endDate, final String moreInfo){ +// +// +// super.signIn("inventor1", "inventor1"); +// super.clickOnMenu("Inventor", "List my items"); +// super.sortListing(2, "asc"); +// super.clickOnListingRecord(0); +// +// super.clickOnButton("Create chimpum"); +// super.fillInputBoxIn("pattern", pattern); +// super.fillInputBoxIn("title", title); +// super.fillInputBoxIn("description", description); +// super.fillInputBoxIn("budget", budget); +// super.fillInputBoxIn("startDate",startDate); +// super.fillInputBoxIn("endDate", endDate); +// super.fillInputBoxIn("moreInfo", moreInfo); +// +// super.clickOnSubmit("Create"); +// +// super.clickOnMenu("Inventor", "List my chimpums"); +// +// super.sortListing(1, "asc"); +// super.clickOnListingRecord(0); +// super.clickOnSubmit("Delete"); +// super.checkNotErrorsExist(); +// +// +// super.signOut(); +// +// +// +// } +// +//} diff --git a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumListTest.java b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumListTest.java index 4017619..f377834 100644 --- a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumListTest.java +++ b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumListTest.java @@ -1,26 +1,26 @@ -package acme.testing.inventor.chimpum; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvFileSource; - -import acme.testing.TestHarness; - -public class InventorChimpumListTest extends TestHarness{ - - @ParameterizedTest - @CsvFileSource(resources = "/inventor/chimpum/chimpum-list.csv", encoding = "utf-8", numLinesToSkip = 1) - public void positiveTest(final int recordIndex, final String code, final String title,final String budget, - final String startDate,final String endDate) { - super.signIn("inventor1", "inventor1"); - - super.clickOnMenu("Inventor", "List my chimpums"); - super.checkListingExists(); - super.sortListing(3, "asc"); - super.checkColumnHasValue(recordIndex, 0, code); - super.checkColumnHasValue(recordIndex, 1, title); - super.checkColumnHasValue(recordIndex, 2, budget); - super.checkColumnHasValue(recordIndex, 3, startDate); - super.checkColumnHasValue(recordIndex, 4, endDate); - } - -} +//package acme.testing.inventor.chimpum; +// +//import org.junit.jupiter.params.ParameterizedTest; +//import org.junit.jupiter.params.provider.CsvFileSource; +// +//import acme.testing.TestHarness; +// +//public class InventorChimpumListTest extends TestHarness{ +// +// @ParameterizedTest +// @CsvFileSource(resources = "/inventor/chimpum/chimpum-list.csv", encoding = "utf-8", numLinesToSkip = 1) +// public void positiveTest(final int recordIndex, final String code, final String title,final String budget, +// final String startDate,final String endDate) { +// super.signIn("inventor1", "inventor1"); +// +// super.clickOnMenu("Inventor", "List my chimpums"); +// super.checkListingExists(); +// super.sortListing(3, "asc"); +// super.checkColumnHasValue(recordIndex, 0, code); +// super.checkColumnHasValue(recordIndex, 1, title); +// super.checkColumnHasValue(recordIndex, 2, budget); +// super.checkColumnHasValue(recordIndex, 3, startDate); +// super.checkColumnHasValue(recordIndex, 4, endDate); +// } +// +//} diff --git a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumShowServiceTest.java b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumShowServiceTest.java index 0103c34..fec76a4 100644 --- a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumShowServiceTest.java +++ b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumShowServiceTest.java @@ -1,33 +1,33 @@ -package acme.testing.inventor.chimpum; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvFileSource; - -import acme.testing.TestHarness; - -public class InventorChimpumShowServiceTest extends TestHarness { - - @ParameterizedTest - @CsvFileSource(resources = "/inventor/chimpum/chimpum-show.csv", encoding = "utf-8", numLinesToSkip = 1) - public void positiveTest(final int recordIndex, final String code, final String title, final String description,final String budget, - final String creationMoment,final String startDate,final String endDate, final String moreInfo) { - super.signIn("inventor1", "inventor1"); - - super.clickOnMenu("Inventor", "List my chimpums"); - - super.sortListing(3, "asc"); - super.clickOnListingRecord(recordIndex); - super.checkInputBoxHasValue("code", code); - super.checkInputBoxHasValue("title",title); - super.checkInputBoxHasValue("description",description); - super.checkInputBoxHasValue("budget", budget); - super.checkInputBoxHasValue("creationMoment",creationMoment); - super.checkInputBoxHasValue("startDate",startDate); - super.checkInputBoxHasValue("endDate", endDate); - super.checkInputBoxHasValue("moreInfo", moreInfo); - - super.signOut(); - } - - -} +//package acme.testing.inventor.chimpum; +// +//import org.junit.jupiter.params.ParameterizedTest; +//import org.junit.jupiter.params.provider.CsvFileSource; +// +//import acme.testing.TestHarness; +// +//public class InventorChimpumShowServiceTest extends TestHarness { +// +// @ParameterizedTest +// @CsvFileSource(resources = "/inventor/chimpum/chimpum-show.csv", encoding = "utf-8", numLinesToSkip = 1) +// public void positiveTest(final int recordIndex, final String code, final String title, final String description,final String budget, +// final String creationMoment,final String startDate,final String endDate, final String moreInfo) { +// super.signIn("inventor1", "inventor1"); +// +// super.clickOnMenu("Inventor", "List my chimpums"); +// +// super.sortListing(3, "asc"); +// super.clickOnListingRecord(recordIndex); +// super.checkInputBoxHasValue("code", code); +// super.checkInputBoxHasValue("title",title); +// super.checkInputBoxHasValue("description",description); +// super.checkInputBoxHasValue("budget", budget); +// super.checkInputBoxHasValue("creationMoment",creationMoment); +// super.checkInputBoxHasValue("startDate",startDate); +// super.checkInputBoxHasValue("endDate", endDate); +// super.checkInputBoxHasValue("moreInfo", moreInfo); +// +// super.signOut(); +// } +// +// +//} diff --git a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumUpdateServiceTest.java b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumUpdateServiceTest.java index 6b851e8..b26ac83 100644 --- a/src/test/java/acme/testing/inventor/chimpum/InventorChimpumUpdateServiceTest.java +++ b/src/test/java/acme/testing/inventor/chimpum/InventorChimpumUpdateServiceTest.java @@ -1,59 +1,59 @@ -package acme.testing.inventor.chimpum; - -import org.junit.jupiter.api.Order; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvFileSource; - -import acme.testing.TestHarness; - -public class InventorChimpumUpdateServiceTest extends TestHarness { - - @ParameterizedTest - @Order(10) - @CsvFileSource(resources = "/inventor/chimpum/chimpum-update.csv", encoding = "utf-8", numLinesToSkip = 1) - public void positiveTest(final int recordIndex, final String pattern,final String title, final String description,final String budget - ,final String startDate,final String endDate, final String moreInfo){ - - super.signIn("inventor1", "inventor1"); - super.clickOnMenu("Inventor", "List my chimpums"); - super.sortListing(1, "asc"); - super.clickOnListingRecord(0); - super.fillInputBoxIn("pattern", pattern); - super.fillInputBoxIn("title", title); - super.fillInputBoxIn("description", description); - super.fillInputBoxIn("budget", budget); - super.fillInputBoxIn("startDate",startDate); - super.fillInputBoxIn("endDate", endDate); - super.fillInputBoxIn("moreInfo", moreInfo); - - super.clickOnSubmit("Update"); - - super.signOut(); - } - - @ParameterizedTest - @CsvFileSource(resources = "/inventor/chimpum/chimpum-update-negative.csv", encoding = "utf-8", numLinesToSkip = 1) - public void negativeTest(final int recordIndex, final String pattern,final String title, final String description,final String budget - ,final String startDate,final String endDate, final String moreInfo) { - - super.signIn("inventor1", "inventor1"); - super.clickOnMenu("Inventor", "List my chimpums"); - super.sortListing(1, "asc"); - super.clickOnListingRecord(0); - super.fillInputBoxIn("pattern", pattern); - super.fillInputBoxIn("title", title); - super.fillInputBoxIn("description", description); - super.fillInputBoxIn("budget", budget); - super.fillInputBoxIn("startDate",startDate); - super.fillInputBoxIn("endDate", endDate); - super.fillInputBoxIn("moreInfo", moreInfo); - - super.clickOnSubmit("Update"); - super.checkErrorsExist(); - - - super.signOut(); - } - - -} +//package acme.testing.inventor.chimpum; +// +//import org.junit.jupiter.api.Order; +//import org.junit.jupiter.params.ParameterizedTest; +//import org.junit.jupiter.params.provider.CsvFileSource; +// +//import acme.testing.TestHarness; +// +//public class InventorChimpumUpdateServiceTest extends TestHarness { +// +// @ParameterizedTest +// @Order(10) +// @CsvFileSource(resources = "/inventor/chimpum/chimpum-update.csv", encoding = "utf-8", numLinesToSkip = 1) +// public void positiveTest(final int recordIndex, final String pattern,final String title, final String description,final String budget +// ,final String startDate,final String endDate, final String moreInfo){ +// +// super.signIn("inventor1", "inventor1"); +// super.clickOnMenu("Inventor", "List my chimpums"); +// super.sortListing(1, "asc"); +// super.clickOnListingRecord(0); +// super.fillInputBoxIn("pattern", pattern); +// super.fillInputBoxIn("title", title); +// super.fillInputBoxIn("description", description); +// super.fillInputBoxIn("budget", budget); +// super.fillInputBoxIn("startDate",startDate); +// super.fillInputBoxIn("endDate", endDate); +// super.fillInputBoxIn("moreInfo", moreInfo); +// +// super.clickOnSubmit("Update"); +// +// super.signOut(); +// } +// +// @ParameterizedTest +// @CsvFileSource(resources = "/inventor/chimpum/chimpum-update-negative.csv", encoding = "utf-8", numLinesToSkip = 1) +// public void negativeTest(final int recordIndex, final String pattern,final String title, final String description,final String budget +// ,final String startDate,final String endDate, final String moreInfo) { +// +// super.signIn("inventor1", "inventor1"); +// super.clickOnMenu("Inventor", "List my chimpums"); +// super.sortListing(1, "asc"); +// super.clickOnListingRecord(0); +// super.fillInputBoxIn("pattern", pattern); +// super.fillInputBoxIn("title", title); +// super.fillInputBoxIn("description", description); +// super.fillInputBoxIn("budget", budget); +// super.fillInputBoxIn("startDate",startDate); +// super.fillInputBoxIn("endDate", endDate); +// super.fillInputBoxIn("moreInfo", moreInfo); +// +// super.clickOnSubmit("Update"); +// super.checkErrorsExist(); +// +// +// super.signOut(); +// } +// +// +//}
- +