From 219c611f2e9c2fad8b9c8837ae5fd43d89b89187 Mon Sep 17 00:00:00 2001 From: JHipster Bot Date: Thu, 31 Dec 2020 08:01:20 +0000 Subject: [PATCH 1/2] Add JDL Model `CCWAPP` See https://start.jhipster.tech/jdl-studio/#!/view/ef85c763-04ea-464f-8b58-e9723b993d50 --- ccwapp.jh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ccwapp.jh diff --git a/ccwapp.jh b/ccwapp.jh new file mode 100644 index 0000000..c849d2f --- /dev/null +++ b/ccwapp.jh @@ -0,0 +1,41 @@ + +application { + config { + baseName CCWApplication, + applicationType monolith, + packageName com.finca.ccw, + authenticationType jwt, + prodDatabaseType mysql, + clientFramework angular + } + entities * +} + +entity CollectionTracking { + EmployeeID String required + UnitID String required + EmployeeName String required + BusinessProposal String required + SubProposal String required + MobileNo String required + RelationId String required + AccountNo String required + AccountTitle String required + NoOfVisits Integer required + OsAmount BigDecimal required + OsProfit BigDecimal required + OdDays String required + LoanOfficer String required + VisitedBy String required + PptDate LocalDate required + Remakrs String required + ExtraColumnOne String + ExtraColumnTwo String + ExtraColumnThree String + ExtraColumnFour String + ExtraColumnFive String + +} + + + \ No newline at end of file From 5173d5189ab352d64d31d69be1e1cf09e48a2e0f Mon Sep 17 00:00:00 2001 From: JHipster Bot Date: Thu, 31 Dec 2020 08:01:38 +0000 Subject: [PATCH 2/2] Generate entities from JDL Model `CCWAPP` See https://start.jhipster.tech/jdl-studio/#!/view/ef85c763-04ea-464f-8b58-e9723b993d50 --- .jhipster/CollectionTracking.json | 122 +++ .yo-rc.json | 15 +- pom.xml | 25 +- .../finca/ccw/config/CacheConfiguration.java | 1 + .../finca/ccw/domain/CollectionTracking.java | 449 ++++++++++ .../CollectionTrackingRepository.java | 12 + .../web/rest/CollectionTrackingResource.java | 123 +++ ...080223_added_entity_CollectionTracking.xml | 134 +++ .../fake-data/collection_tracking.csv | 11 + .../resources/config/liquibase/master.xml | 1 + .../resources/i18n/messages_fr.properties | 21 + .../app/core/language/language.constants.ts | 1 + ...tion-tracking-delete-dialog.component.html | 24 + ...ection-tracking-delete-dialog.component.ts | 30 + .../collection-tracking-detail.component.html | 114 +++ .../collection-tracking-detail.component.ts | 22 + .../collection-tracking-update.component.html | 276 ++++++ .../collection-tracking-update.component.ts | 143 ++++ .../collection-tracking.component.html | 103 +++ .../collection-tracking.component.ts | 55 ++ .../collection-tracking.module.ts | 21 + .../collection-tracking.route.ts | 83 ++ .../collection-tracking.service.ts | 75 ++ src/main/webapp/app/entities/entity.module.ts | 4 + .../app/layouts/navbar/navbar.component.html | 6 + .../language/find-language-from-key.pipe.ts | 1 + .../shared/model/collection-tracking.model.ts | 55 ++ .../webapp/i18n/en/collectionTracking.json | 43 + src/main/webapp/i18n/en/global.json | 1 + src/main/webapp/i18n/fr/activate.json | 9 + src/main/webapp/i18n/fr/audits.json | 28 + .../webapp/i18n/fr/collectionTracking.json | 43 + src/main/webapp/i18n/fr/configuration.json | 10 + src/main/webapp/i18n/fr/error.json | 14 + src/main/webapp/i18n/fr/global.json | 141 ++++ src/main/webapp/i18n/fr/health.json | 29 + src/main/webapp/i18n/fr/home.json | 19 + src/main/webapp/i18n/fr/login.json | 19 + src/main/webapp/i18n/fr/logs.json | 11 + src/main/webapp/i18n/fr/metrics.json | 102 +++ src/main/webapp/i18n/fr/password.json | 12 + src/main/webapp/i18n/fr/register.json | 24 + src/main/webapp/i18n/fr/reset.json | 26 + src/main/webapp/i18n/fr/sessions.json | 15 + src/main/webapp/i18n/fr/settings.json | 32 + src/main/webapp/i18n/fr/user-management.json | 30 + .../ccw/domain/CollectionTrackingTest.java | 23 + .../com/finca/ccw/service/MailServiceIT.java | 1 + .../rest/CollectionTrackingResourceIT.java | 788 ++++++++++++++++++ ...n-tracking-delete-dialog.component.spec.ts | 65 ++ ...llection-tracking-detail.component.spec.ts | 37 + ...llection-tracking-update.component.spec.ts | 61 ++ .../collection-tracking.component.spec.ts | 49 ++ .../collection-tracking.service.spec.ts | 193 +++++ .../resources/i18n/messages_fr.properties | 1 + webpack/webpack.common.js | 3 +- webpack/webpack.prod.js | 3 +- 57 files changed, 3733 insertions(+), 26 deletions(-) create mode 100644 .jhipster/CollectionTracking.json create mode 100644 src/main/java/com/finca/ccw/domain/CollectionTracking.java create mode 100644 src/main/java/com/finca/ccw/repository/CollectionTrackingRepository.java create mode 100644 src/main/java/com/finca/ccw/web/rest/CollectionTrackingResource.java create mode 100644 src/main/resources/config/liquibase/changelog/20201231080223_added_entity_CollectionTracking.xml create mode 100644 src/main/resources/config/liquibase/fake-data/collection_tracking.csv create mode 100644 src/main/resources/i18n/messages_fr.properties create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking-delete-dialog.component.html create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking-delete-dialog.component.ts create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking-detail.component.html create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking-detail.component.ts create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking-update.component.html create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking-update.component.ts create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking.component.html create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking.component.ts create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking.module.ts create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking.route.ts create mode 100644 src/main/webapp/app/entities/collection-tracking/collection-tracking.service.ts create mode 100644 src/main/webapp/app/shared/model/collection-tracking.model.ts create mode 100644 src/main/webapp/i18n/en/collectionTracking.json create mode 100644 src/main/webapp/i18n/fr/activate.json create mode 100644 src/main/webapp/i18n/fr/audits.json create mode 100644 src/main/webapp/i18n/fr/collectionTracking.json create mode 100644 src/main/webapp/i18n/fr/configuration.json create mode 100644 src/main/webapp/i18n/fr/error.json create mode 100644 src/main/webapp/i18n/fr/global.json create mode 100644 src/main/webapp/i18n/fr/health.json create mode 100644 src/main/webapp/i18n/fr/home.json create mode 100644 src/main/webapp/i18n/fr/login.json create mode 100644 src/main/webapp/i18n/fr/logs.json create mode 100644 src/main/webapp/i18n/fr/metrics.json create mode 100644 src/main/webapp/i18n/fr/password.json create mode 100644 src/main/webapp/i18n/fr/register.json create mode 100644 src/main/webapp/i18n/fr/reset.json create mode 100644 src/main/webapp/i18n/fr/sessions.json create mode 100644 src/main/webapp/i18n/fr/settings.json create mode 100644 src/main/webapp/i18n/fr/user-management.json create mode 100644 src/test/java/com/finca/ccw/domain/CollectionTrackingTest.java create mode 100644 src/test/java/com/finca/ccw/web/rest/CollectionTrackingResourceIT.java create mode 100644 src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-delete-dialog.component.spec.ts create mode 100644 src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-detail.component.spec.ts create mode 100644 src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-update.component.spec.ts create mode 100644 src/test/javascript/spec/app/entities/collection-tracking/collection-tracking.component.spec.ts create mode 100644 src/test/javascript/spec/app/entities/collection-tracking/collection-tracking.service.spec.ts create mode 100644 src/test/resources/i18n/messages_fr.properties diff --git a/.jhipster/CollectionTracking.json b/.jhipster/CollectionTracking.json new file mode 100644 index 0000000..ac45b27 --- /dev/null +++ b/.jhipster/CollectionTracking.json @@ -0,0 +1,122 @@ +{ + "name": "CollectionTracking", + "fields": [ + { + "fieldName": "employeeID", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "unitID", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "employeeName", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "businessProposal", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "subProposal", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "mobileNo", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "relationId", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "accountNo", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "accountTitle", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "noOfVisits", + "fieldType": "Integer", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "osAmount", + "fieldType": "BigDecimal", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "osProfit", + "fieldType": "BigDecimal", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "odDays", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "loanOfficer", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "visitedBy", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "pptDate", + "fieldType": "LocalDate", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "remakrs", + "fieldType": "String", + "fieldValidateRules": ["required"] + }, + { + "fieldName": "extraColumnOne", + "fieldType": "String" + }, + { + "fieldName": "extraColumnTwo", + "fieldType": "String" + }, + { + "fieldName": "extraColumnThree", + "fieldType": "String" + }, + { + "fieldName": "extraColumnFour", + "fieldType": "String" + }, + { + "fieldName": "extraColumnFive", + "fieldType": "String" + } + ], + "relationships": [], + "changelogDate": "20201231080223", + "entityTableName": "collection_tracking", + "dto": "no", + "pagination": "no", + "service": "no", + "jpaMetamodelFiltering": false, + "fluentMethods": true, + "readOnly": false, + "embedded": false, + "clientRootFolder": "", + "applications": ["CCWApplication"] +} diff --git a/.yo-rc.json b/.yo-rc.json index fbe2171..9d44494 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -5,7 +5,7 @@ "baseName": "CCWApplication", "packageName": "com.finca.ccw", "packageFolder": "com/finca/ccw", - "serverPort": 8080, + "serverPort": "8080", "serviceDiscoveryType": false, "authenticationType": "jwt", "uaaBaseName": "../uaa", @@ -21,10 +21,10 @@ "buildTool": "maven", "useSass": true, "clientPackageManager": "npm", - "testFrameworks": ["cucumber"], + "testFrameworks": [], "enableTranslation": true, "nativeLanguage": "en", - "languages": ["en"], + "languages": ["en", "fr"], "clientFramework": "angularX", "jhiPrefix": "jhi", "jhipsterVersion": "6.10.5", @@ -36,9 +36,14 @@ "dtoSuffix": "DTO", "otherModules": [], "blueprints": [], - "prettierJava": true + "prettierJava": true, + "skipUserManagement": false, + "skipClient": false, + "skipServer": false, + "clientThemeVariant": "" }, "git-provider": "GitHub", "git-company": "ask4abid", - "repository-name": "CCW-application" + "repository-name": "CCW-application", + "entities": ["CollectionTracking"] } diff --git a/pom.xml b/pom.xml index 53b81cd..1968205 100644 --- a/pom.xml +++ b/pom.xml @@ -247,6 +247,12 @@ org.springframework.boot spring-boot-starter-test test + + + org.junit.vintage + junit-vintage-engine + + org.springframework.boot @@ -307,30 +313,11 @@ io.dropwizard.metrics metrics-core - - - io.cucumber - cucumber-junit - test - - - io.cucumber - cucumber-spring - test - spring-boot:run - - - src/test/resources/ - - - src/test/features - - org.apache.maven.plugins diff --git a/src/main/java/com/finca/ccw/config/CacheConfiguration.java b/src/main/java/com/finca/ccw/config/CacheConfiguration.java index 4c5730c..315085d 100644 --- a/src/main/java/com/finca/ccw/config/CacheConfiguration.java +++ b/src/main/java/com/finca/ccw/config/CacheConfiguration.java @@ -47,6 +47,7 @@ public JCacheManagerCustomizer cacheManagerCustomizer() { createCache(cm, com.finca.ccw.domain.User.class.getName()); createCache(cm, com.finca.ccw.domain.Authority.class.getName()); createCache(cm, com.finca.ccw.domain.User.class.getName() + ".authorities"); + createCache(cm, com.finca.ccw.domain.CollectionTracking.class.getName()); // jhipster-needle-ehcache-add-entry }; } diff --git a/src/main/java/com/finca/ccw/domain/CollectionTracking.java b/src/main/java/com/finca/ccw/domain/CollectionTracking.java new file mode 100644 index 0000000..95dd846 --- /dev/null +++ b/src/main/java/com/finca/ccw/domain/CollectionTracking.java @@ -0,0 +1,449 @@ +package com.finca.ccw.domain; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDate; +import javax.persistence.*; +import javax.validation.constraints.*; +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; + +/** + * A CollectionTracking. + */ +@Entity +@Table(name = "collection_tracking") +@Cache(usage = CacheConcurrencyStrategy.READ_WRITE) +public class CollectionTracking implements Serializable { + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @NotNull + @Column(name = "employee_id", nullable = false) + private String employeeID; + + @NotNull + @Column(name = "unit_id", nullable = false) + private String unitID; + + @NotNull + @Column(name = "employee_name", nullable = false) + private String employeeName; + + @NotNull + @Column(name = "business_proposal", nullable = false) + private String businessProposal; + + @NotNull + @Column(name = "sub_proposal", nullable = false) + private String subProposal; + + @NotNull + @Column(name = "mobile_no", nullable = false) + private String mobileNo; + + @NotNull + @Column(name = "relation_id", nullable = false) + private String relationId; + + @NotNull + @Column(name = "account_no", nullable = false) + private String accountNo; + + @NotNull + @Column(name = "account_title", nullable = false) + private String accountTitle; + + @NotNull + @Column(name = "no_of_visits", nullable = false) + private Integer noOfVisits; + + @NotNull + @Column(name = "os_amount", precision = 21, scale = 2, nullable = false) + private BigDecimal osAmount; + + @NotNull + @Column(name = "os_profit", precision = 21, scale = 2, nullable = false) + private BigDecimal osProfit; + + @NotNull + @Column(name = "od_days", nullable = false) + private String odDays; + + @NotNull + @Column(name = "loan_officer", nullable = false) + private String loanOfficer; + + @NotNull + @Column(name = "visited_by", nullable = false) + private String visitedBy; + + @NotNull + @Column(name = "ppt_date", nullable = false) + private LocalDate pptDate; + + @NotNull + @Column(name = "remakrs", nullable = false) + private String remakrs; + + @Column(name = "extra_column_one") + private String extraColumnOne; + + @Column(name = "extra_column_two") + private String extraColumnTwo; + + @Column(name = "extra_column_three") + private String extraColumnThree; + + @Column(name = "extra_column_four") + private String extraColumnFour; + + @Column(name = "extra_column_five") + private String extraColumnFive; + + // jhipster-needle-entity-add-field - JHipster will add fields here + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getEmployeeID() { + return employeeID; + } + + public CollectionTracking employeeID(String employeeID) { + this.employeeID = employeeID; + return this; + } + + public void setEmployeeID(String employeeID) { + this.employeeID = employeeID; + } + + public String getUnitID() { + return unitID; + } + + public CollectionTracking unitID(String unitID) { + this.unitID = unitID; + return this; + } + + public void setUnitID(String unitID) { + this.unitID = unitID; + } + + public String getEmployeeName() { + return employeeName; + } + + public CollectionTracking employeeName(String employeeName) { + this.employeeName = employeeName; + return this; + } + + public void setEmployeeName(String employeeName) { + this.employeeName = employeeName; + } + + public String getBusinessProposal() { + return businessProposal; + } + + public CollectionTracking businessProposal(String businessProposal) { + this.businessProposal = businessProposal; + return this; + } + + public void setBusinessProposal(String businessProposal) { + this.businessProposal = businessProposal; + } + + public String getSubProposal() { + return subProposal; + } + + public CollectionTracking subProposal(String subProposal) { + this.subProposal = subProposal; + return this; + } + + public void setSubProposal(String subProposal) { + this.subProposal = subProposal; + } + + public String getMobileNo() { + return mobileNo; + } + + public CollectionTracking mobileNo(String mobileNo) { + this.mobileNo = mobileNo; + return this; + } + + public void setMobileNo(String mobileNo) { + this.mobileNo = mobileNo; + } + + public String getRelationId() { + return relationId; + } + + public CollectionTracking relationId(String relationId) { + this.relationId = relationId; + return this; + } + + public void setRelationId(String relationId) { + this.relationId = relationId; + } + + public String getAccountNo() { + return accountNo; + } + + public CollectionTracking accountNo(String accountNo) { + this.accountNo = accountNo; + return this; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + + public String getAccountTitle() { + return accountTitle; + } + + public CollectionTracking accountTitle(String accountTitle) { + this.accountTitle = accountTitle; + return this; + } + + public void setAccountTitle(String accountTitle) { + this.accountTitle = accountTitle; + } + + public Integer getNoOfVisits() { + return noOfVisits; + } + + public CollectionTracking noOfVisits(Integer noOfVisits) { + this.noOfVisits = noOfVisits; + return this; + } + + public void setNoOfVisits(Integer noOfVisits) { + this.noOfVisits = noOfVisits; + } + + public BigDecimal getOsAmount() { + return osAmount; + } + + public CollectionTracking osAmount(BigDecimal osAmount) { + this.osAmount = osAmount; + return this; + } + + public void setOsAmount(BigDecimal osAmount) { + this.osAmount = osAmount; + } + + public BigDecimal getOsProfit() { + return osProfit; + } + + public CollectionTracking osProfit(BigDecimal osProfit) { + this.osProfit = osProfit; + return this; + } + + public void setOsProfit(BigDecimal osProfit) { + this.osProfit = osProfit; + } + + public String getOdDays() { + return odDays; + } + + public CollectionTracking odDays(String odDays) { + this.odDays = odDays; + return this; + } + + public void setOdDays(String odDays) { + this.odDays = odDays; + } + + public String getLoanOfficer() { + return loanOfficer; + } + + public CollectionTracking loanOfficer(String loanOfficer) { + this.loanOfficer = loanOfficer; + return this; + } + + public void setLoanOfficer(String loanOfficer) { + this.loanOfficer = loanOfficer; + } + + public String getVisitedBy() { + return visitedBy; + } + + public CollectionTracking visitedBy(String visitedBy) { + this.visitedBy = visitedBy; + return this; + } + + public void setVisitedBy(String visitedBy) { + this.visitedBy = visitedBy; + } + + public LocalDate getPptDate() { + return pptDate; + } + + public CollectionTracking pptDate(LocalDate pptDate) { + this.pptDate = pptDate; + return this; + } + + public void setPptDate(LocalDate pptDate) { + this.pptDate = pptDate; + } + + public String getRemakrs() { + return remakrs; + } + + public CollectionTracking remakrs(String remakrs) { + this.remakrs = remakrs; + return this; + } + + public void setRemakrs(String remakrs) { + this.remakrs = remakrs; + } + + public String getExtraColumnOne() { + return extraColumnOne; + } + + public CollectionTracking extraColumnOne(String extraColumnOne) { + this.extraColumnOne = extraColumnOne; + return this; + } + + public void setExtraColumnOne(String extraColumnOne) { + this.extraColumnOne = extraColumnOne; + } + + public String getExtraColumnTwo() { + return extraColumnTwo; + } + + public CollectionTracking extraColumnTwo(String extraColumnTwo) { + this.extraColumnTwo = extraColumnTwo; + return this; + } + + public void setExtraColumnTwo(String extraColumnTwo) { + this.extraColumnTwo = extraColumnTwo; + } + + public String getExtraColumnThree() { + return extraColumnThree; + } + + public CollectionTracking extraColumnThree(String extraColumnThree) { + this.extraColumnThree = extraColumnThree; + return this; + } + + public void setExtraColumnThree(String extraColumnThree) { + this.extraColumnThree = extraColumnThree; + } + + public String getExtraColumnFour() { + return extraColumnFour; + } + + public CollectionTracking extraColumnFour(String extraColumnFour) { + this.extraColumnFour = extraColumnFour; + return this; + } + + public void setExtraColumnFour(String extraColumnFour) { + this.extraColumnFour = extraColumnFour; + } + + public String getExtraColumnFive() { + return extraColumnFive; + } + + public CollectionTracking extraColumnFive(String extraColumnFive) { + this.extraColumnFive = extraColumnFive; + return this; + } + + public void setExtraColumnFive(String extraColumnFive) { + this.extraColumnFive = extraColumnFive; + } + + // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof CollectionTracking)) { + return false; + } + return id != null && id.equals(((CollectionTracking) o).id); + } + + @Override + public int hashCode() { + return 31; + } + + // prettier-ignore + @Override + public String toString() { + return "CollectionTracking{" + + "id=" + getId() + + ", employeeID='" + getEmployeeID() + "'" + + ", unitID='" + getUnitID() + "'" + + ", employeeName='" + getEmployeeName() + "'" + + ", businessProposal='" + getBusinessProposal() + "'" + + ", subProposal='" + getSubProposal() + "'" + + ", mobileNo='" + getMobileNo() + "'" + + ", relationId='" + getRelationId() + "'" + + ", accountNo='" + getAccountNo() + "'" + + ", accountTitle='" + getAccountTitle() + "'" + + ", noOfVisits=" + getNoOfVisits() + + ", osAmount=" + getOsAmount() + + ", osProfit=" + getOsProfit() + + ", odDays='" + getOdDays() + "'" + + ", loanOfficer='" + getLoanOfficer() + "'" + + ", visitedBy='" + getVisitedBy() + "'" + + ", pptDate='" + getPptDate() + "'" + + ", remakrs='" + getRemakrs() + "'" + + ", extraColumnOne='" + getExtraColumnOne() + "'" + + ", extraColumnTwo='" + getExtraColumnTwo() + "'" + + ", extraColumnThree='" + getExtraColumnThree() + "'" + + ", extraColumnFour='" + getExtraColumnFour() + "'" + + ", extraColumnFive='" + getExtraColumnFive() + "'" + + "}"; + } +} diff --git a/src/main/java/com/finca/ccw/repository/CollectionTrackingRepository.java b/src/main/java/com/finca/ccw/repository/CollectionTrackingRepository.java new file mode 100644 index 0000000..1338457 --- /dev/null +++ b/src/main/java/com/finca/ccw/repository/CollectionTrackingRepository.java @@ -0,0 +1,12 @@ +package com.finca.ccw.repository; + +import com.finca.ccw.domain.CollectionTracking; +import org.springframework.data.jpa.repository.*; +import org.springframework.stereotype.Repository; + +/** + * Spring Data repository for the CollectionTracking entity. + */ +@SuppressWarnings("unused") +@Repository +public interface CollectionTrackingRepository extends JpaRepository {} diff --git a/src/main/java/com/finca/ccw/web/rest/CollectionTrackingResource.java b/src/main/java/com/finca/ccw/web/rest/CollectionTrackingResource.java new file mode 100644 index 0000000..2150970 --- /dev/null +++ b/src/main/java/com/finca/ccw/web/rest/CollectionTrackingResource.java @@ -0,0 +1,123 @@ +package com.finca.ccw.web.rest; + +import com.finca.ccw.domain.CollectionTracking; +import com.finca.ccw.repository.CollectionTrackingRepository; +import com.finca.ccw.web.rest.errors.BadRequestAlertException; +import io.github.jhipster.web.util.HeaderUtil; +import io.github.jhipster.web.util.ResponseUtil; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.Optional; +import javax.validation.Valid; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ResponseEntity; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +/** + * REST controller for managing {@link com.finca.ccw.domain.CollectionTracking}. + */ +@RestController +@RequestMapping("/api") +@Transactional +public class CollectionTrackingResource { + private final Logger log = LoggerFactory.getLogger(CollectionTrackingResource.class); + + private static final String ENTITY_NAME = "collectionTracking"; + + @Value("${jhipster.clientApp.name}") + private String applicationName; + + private final CollectionTrackingRepository collectionTrackingRepository; + + public CollectionTrackingResource(CollectionTrackingRepository collectionTrackingRepository) { + this.collectionTrackingRepository = collectionTrackingRepository; + } + + /** + * {@code POST /collection-trackings} : Create a new collectionTracking. + * + * @param collectionTracking the collectionTracking to create. + * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new collectionTracking, or with status {@code 400 (Bad Request)} if the collectionTracking has already an ID. + * @throws URISyntaxException if the Location URI syntax is incorrect. + */ + @PostMapping("/collection-trackings") + public ResponseEntity createCollectionTracking(@Valid @RequestBody CollectionTracking collectionTracking) + throws URISyntaxException { + log.debug("REST request to save CollectionTracking : {}", collectionTracking); + if (collectionTracking.getId() != null) { + throw new BadRequestAlertException("A new collectionTracking cannot already have an ID", ENTITY_NAME, "idexists"); + } + CollectionTracking result = collectionTrackingRepository.save(collectionTracking); + return ResponseEntity + .created(new URI("/api/collection-trackings/" + result.getId())) + .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())) + .body(result); + } + + /** + * {@code PUT /collection-trackings} : Updates an existing collectionTracking. + * + * @param collectionTracking the collectionTracking to update. + * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated collectionTracking, + * or with status {@code 400 (Bad Request)} if the collectionTracking is not valid, + * or with status {@code 500 (Internal Server Error)} if the collectionTracking couldn't be updated. + * @throws URISyntaxException if the Location URI syntax is incorrect. + */ + @PutMapping("/collection-trackings") + public ResponseEntity updateCollectionTracking(@Valid @RequestBody CollectionTracking collectionTracking) + throws URISyntaxException { + log.debug("REST request to update CollectionTracking : {}", collectionTracking); + if (collectionTracking.getId() == null) { + throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); + } + CollectionTracking result = collectionTrackingRepository.save(collectionTracking); + return ResponseEntity + .ok() + .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, collectionTracking.getId().toString())) + .body(result); + } + + /** + * {@code GET /collection-trackings} : get all the collectionTrackings. + * + * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of collectionTrackings in body. + */ + @GetMapping("/collection-trackings") + public List getAllCollectionTrackings() { + log.debug("REST request to get all CollectionTrackings"); + return collectionTrackingRepository.findAll(); + } + + /** + * {@code GET /collection-trackings/:id} : get the "id" collectionTracking. + * + * @param id the id of the collectionTracking to retrieve. + * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the collectionTracking, or with status {@code 404 (Not Found)}. + */ + @GetMapping("/collection-trackings/{id}") + public ResponseEntity getCollectionTracking(@PathVariable Long id) { + log.debug("REST request to get CollectionTracking : {}", id); + Optional collectionTracking = collectionTrackingRepository.findById(id); + return ResponseUtil.wrapOrNotFound(collectionTracking); + } + + /** + * {@code DELETE /collection-trackings/:id} : delete the "id" collectionTracking. + * + * @param id the id of the collectionTracking to delete. + * @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}. + */ + @DeleteMapping("/collection-trackings/{id}") + public ResponseEntity deleteCollectionTracking(@PathVariable Long id) { + log.debug("REST request to delete CollectionTracking : {}", id); + collectionTrackingRepository.deleteById(id); + return ResponseEntity + .noContent() + .headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString())) + .build(); + } +} diff --git a/src/main/resources/config/liquibase/changelog/20201231080223_added_entity_CollectionTracking.xml b/src/main/resources/config/liquibase/changelog/20201231080223_added_entity_CollectionTracking.xml new file mode 100644 index 0000000..5eddf1c --- /dev/null +++ b/src/main/resources/config/liquibase/changelog/20201231080223_added_entity_CollectionTracking.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/config/liquibase/fake-data/collection_tracking.csv b/src/main/resources/config/liquibase/fake-data/collection_tracking.csv new file mode 100644 index 0000000..bd0017f --- /dev/null +++ b/src/main/resources/config/liquibase/fake-data/collection_tracking.csv @@ -0,0 +1,11 @@ +id;employee_id;unit_id;employee_name;business_proposal;sub_proposal;mobile_no;relation_id;account_no;account_title;no_of_visits;os_amount;os_profit;od_days;loan_officer;visited_by;ppt_date;remakrs;extra_column_one;extra_column_two;extra_column_three;extra_column_four;extra_column_five +1;Identity;Summit;Handmade;Product;Ecuador Technician;bluetooth exploit;solutions compressing;Investment Account;withdrawal;31768;54559;7719;overriding frictionless;olive;Rustic Director;2020-12-30;North Dakota;input pixel;Points Dynamic homogeneous;SMS bandwidth;Garden Associate Concrete;lime +2;deposit Suriname Tasty Rubber Bacon;bandwidth;success Cuban Peso Peso Convertible strategy;copying;sexy client-server;hacking Solutions Research;parsing;cross-platform;Virgin Islands, U.S. silver;18641;69098;37981;logistical;Direct Tasty protocol;Metical Mauritius Rupee Pants;2020-12-30;connecting;plum European Monetary Unit (E.M.U.-6);solutions Granite Persistent;Diverse;channels;Assurance +3;Shoes;cyan Comoro Franc Shoes;Metrics tan;Tasty Cotton Falls;Cambridgeshire Tasty;program Markets;Rwanda Franc;cross-platform;override;17920;94356;23202;backing up online;e-tailers;overriding Sports Fish;2020-12-31;granular Buckinghamshire;middleware aggregate sky blue;Montana solid state application;e-enable Steel;local Slovenia;Security +4;Fiji Generic Plastic Table moderator;Tasty Granite Gloves Central generate;Creative fault-tolerant innovate;Sports Gorgeous Rubber Sausages California;Unbranded Gambia unleash;Steel synergies;Credit Card Account;motivating;connecting bypass Uganda Shilling;47946;24147;15276;bypass Auto Loan Account distributed;protocol;Multi-channelled;2020-12-30;hard drive;Cheese;Movies Licensed Cotton Keyboard;Handmade Steel Bacon Crescent;Rustic;Niger +5;protocol Group;Sleek invoice;Configurable Baby;Factors withdrawal;Cotton;Cross-platform Data Fantastic Steel Sausages;mobile Central e-markets;contextually-based Dynamic;Hat;33619;59941;1572;encompassing parsing Keyboard;Jewelery Triple-buffered;bluetooth;2020-12-30;withdrawal;throughput Producer Bacon;withdrawal;Pa'anga Burundi Afghani;quantifying parsing quantifying;Belarussian Ruble override +6;payment;optimize;Avon;Sleek Soft Chips;Dynamic;Rwanda Rustic;USB innovate artificial intelligence;Alaska;Handmade Rubber Sausages Investment Account matrix;90014;94038;65905;Adaptive Frozen;Cedi;deposit connect;2020-12-30;Fantastic Plastic Computer Turnpike incentivize;Costa Rican Colon Proactive Health;leading edge circuit grey;Assistant Radial black;moderator haptic;Phased 24/7 +7;Shirt solid state Central;HTTP Orchestrator Rhode Island;Ergonomic Fresh Car Illinois New Hampshire;rich;Shoals Plastic Internal;uniform;dynamic;optical;protocol Investor;8193;75891;68896;Berkshire drive Islands;Nevada Baby Books;CFP Franc Automotive;2020-12-31;Cambridgeshire Personal Loan Account Games;solutions;North Carolina bandwidth;JBOD maximize Vanuatu;Fort Sleek copying;Credit Card Account neural +8;Strategist haptic;drive Center;Personal Loan Account copying;engage Computers;GB;Plastic Assurance invoice;global Home Loan Account;wireless Cheese;Assistant Tuna Borders;2374;14456;47878;Shoes users;Nevada optical Research;Handmade Concrete Keyboard deliverables;2020-12-31;Alabama;Group e-commerce;Chair Alabama Texas;withdrawal Berkshire Outdoors;Visionary;Producer Gorgeous Granite Bike +9;Metal Cambridgeshire;Devolved Handcrafted Fresh Shirt Squares;Poland asynchronous Investor;Junctions Branding TCP;Investor overriding Bacon;Ergonomic scalable;Secured;synthesizing XSS;Tasty;84941;14406;6296;Toys Checking Account back-end;Forward card;Alabama uniform National;2020-12-31;niches;Somoni maroon;viral optimal relationships;real-time Handmade;experiences;back-end conglomeration +10;indexing e-tailers;Fantastic Wooden Pizza Soft Quality;Savings Account hacking;frictionless Health generating;Books Automotive SSL;5th generation;wireless niches;California Managed Kwacha;Dynamic definition;48730;8445;95636;redundant Clothing Grocery;Steel;Metal;2020-12-30;hub;Belize JBOD array;Corporate seize;Industrial;Hawaii transmitting;Avon Palau diff --git a/src/main/resources/config/liquibase/master.xml b/src/main/resources/config/liquibase/master.xml index 6b937fe..240dead 100644 --- a/src/main/resources/config/liquibase/master.xml +++ b/src/main/resources/config/liquibase/master.xml @@ -14,6 +14,7 @@ + diff --git a/src/main/resources/i18n/messages_fr.properties b/src/main/resources/i18n/messages_fr.properties new file mode 100644 index 0000000..198d6ee --- /dev/null +++ b/src/main/resources/i18n/messages_fr.properties @@ -0,0 +1,21 @@ +# Error page +error.title=Votre demande ne peut être traitée +error.subtitle=Désolé, une erreur s'est produite. +error.status=Statut : +error.message=Message : + +# Activation email +email.activation.title=Activation de votre compte CCWApplication +email.activation.greeting=Cher {0} +email.activation.text1=Votre compte CCWApplication a été créé, pour l'activer merci de cliquer sur le lien ci-dessous : +email.activation.text2=Cordialement, +email.signature=CCWApplication. + +# Creation email +email.creation.text1=Votre compte CCWApplication a été créé, merci de cliquer sur le lien ci-dessous pour y accéder : + +# Reset email +email.reset.title=CCWApplication Réinitialisation de mot de passe +email.reset.greeting=Cher {0} +email.reset.text1=Un nouveau mot de passe pour votre compte CCWApplication a été demandé, veuillez cliquer sur le lien ci-dessous pour le réinitialiser : +email.reset.text2=Cordialement, diff --git a/src/main/webapp/app/core/language/language.constants.ts b/src/main/webapp/app/core/language/language.constants.ts index aa07208..0679ebb 100644 --- a/src/main/webapp/app/core/language/language.constants.ts +++ b/src/main/webapp/app/core/language/language.constants.ts @@ -4,5 +4,6 @@ */ export const LANGUAGES: string[] = [ 'en', + 'fr', // jhipster-needle-i18n-language-constant - JHipster will add/remove languages in this array ]; diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking-delete-dialog.component.html b/src/main/webapp/app/entities/collection-tracking/collection-tracking-delete-dialog.component.html new file mode 100644 index 0000000..39860c5 --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking-delete-dialog.component.html @@ -0,0 +1,24 @@ +
+ + + + + +
diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking-delete-dialog.component.ts b/src/main/webapp/app/entities/collection-tracking/collection-tracking-delete-dialog.component.ts new file mode 100644 index 0000000..3c154f2 --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking-delete-dialog.component.ts @@ -0,0 +1,30 @@ +import { Component } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { JhiEventManager } from 'ng-jhipster'; + +import { ICollectionTracking } from 'app/shared/model/collection-tracking.model'; +import { CollectionTrackingService } from './collection-tracking.service'; + +@Component({ + templateUrl: './collection-tracking-delete-dialog.component.html', +}) +export class CollectionTrackingDeleteDialogComponent { + collectionTracking?: ICollectionTracking; + + constructor( + protected collectionTrackingService: CollectionTrackingService, + public activeModal: NgbActiveModal, + protected eventManager: JhiEventManager + ) {} + + cancel(): void { + this.activeModal.dismiss(); + } + + confirmDelete(id: number): void { + this.collectionTrackingService.delete(id).subscribe(() => { + this.eventManager.broadcast('collectionTrackingListModification'); + this.activeModal.close(); + }); + } +} diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking-detail.component.html b/src/main/webapp/app/entities/collection-tracking/collection-tracking-detail.component.html new file mode 100644 index 0000000..3136df0 --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking-detail.component.html @@ -0,0 +1,114 @@ +
+
+
+

Collection Tracking {{ collectionTracking.id }}

+ +
+ + + +
+
Employee ID
+
+ {{ collectionTracking.employeeID }} +
+
Unit ID
+
+ {{ collectionTracking.unitID }} +
+
Employee Name
+
+ {{ collectionTracking.employeeName }} +
+
Business Proposal
+
+ {{ collectionTracking.businessProposal }} +
+
Sub Proposal
+
+ {{ collectionTracking.subProposal }} +
+
Mobile No
+
+ {{ collectionTracking.mobileNo }} +
+
Relation Id
+
+ {{ collectionTracking.relationId }} +
+
Account No
+
+ {{ collectionTracking.accountNo }} +
+
Account Title
+
+ {{ collectionTracking.accountTitle }} +
+
No Of Visits
+
+ {{ collectionTracking.noOfVisits }} +
+
Os Amount
+
+ {{ collectionTracking.osAmount }} +
+
Os Profit
+
+ {{ collectionTracking.osProfit }} +
+
Od Days
+
+ {{ collectionTracking.odDays }} +
+
Loan Officer
+
+ {{ collectionTracking.loanOfficer }} +
+
Visited By
+
+ {{ collectionTracking.visitedBy }} +
+
Ppt Date
+
+ {{ collectionTracking.pptDate }} +
+
Remakrs
+
+ {{ collectionTracking.remakrs }} +
+
Extra Column One
+
+ {{ collectionTracking.extraColumnOne }} +
+
Extra Column Two
+
+ {{ collectionTracking.extraColumnTwo }} +
+
Extra Column Three
+
+ {{ collectionTracking.extraColumnThree }} +
+
Extra Column Four
+
+ {{ collectionTracking.extraColumnFour }} +
+
Extra Column Five
+
+ {{ collectionTracking.extraColumnFive }} +
+
+ + + + +
+
+
diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking-detail.component.ts b/src/main/webapp/app/entities/collection-tracking/collection-tracking-detail.component.ts new file mode 100644 index 0000000..acc253b --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking-detail.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { ICollectionTracking } from 'app/shared/model/collection-tracking.model'; + +@Component({ + selector: 'jhi-collection-tracking-detail', + templateUrl: './collection-tracking-detail.component.html', +}) +export class CollectionTrackingDetailComponent implements OnInit { + collectionTracking: ICollectionTracking | null = null; + + constructor(protected activatedRoute: ActivatedRoute) {} + + ngOnInit(): void { + this.activatedRoute.data.subscribe(({ collectionTracking }) => (this.collectionTracking = collectionTracking)); + } + + previousState(): void { + window.history.back(); + } +} diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking-update.component.html b/src/main/webapp/app/entities/collection-tracking/collection-tracking-update.component.html new file mode 100644 index 0000000..8bd5a5b --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking-update.component.html @@ -0,0 +1,276 @@ +
+
+
+

Create or edit a Collection Tracking

+ +
+ + +
+ + +
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + + + This field should be a number. + +
+
+ +
+ + +
+ + This field is required. + + + This field should be a number. + +
+
+ +
+ + +
+ + This field is required. + + + This field should be a number. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ +
+ + + + +
+
+ + This field is required. + +
+
+ +
+ + +
+ + This field is required. + +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ + + +
+
+
+
diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking-update.component.ts b/src/main/webapp/app/entities/collection-tracking/collection-tracking-update.component.ts new file mode 100644 index 0000000..eb3d9a1 --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking-update.component.ts @@ -0,0 +1,143 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpResponse } from '@angular/common/http'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import { FormBuilder, Validators } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; +import { Observable } from 'rxjs'; + +import { ICollectionTracking, CollectionTracking } from 'app/shared/model/collection-tracking.model'; +import { CollectionTrackingService } from './collection-tracking.service'; + +@Component({ + selector: 'jhi-collection-tracking-update', + templateUrl: './collection-tracking-update.component.html', +}) +export class CollectionTrackingUpdateComponent implements OnInit { + isSaving = false; + pptDateDp: any; + + editForm = this.fb.group({ + id: [], + employeeID: [null, [Validators.required]], + unitID: [null, [Validators.required]], + employeeName: [null, [Validators.required]], + businessProposal: [null, [Validators.required]], + subProposal: [null, [Validators.required]], + mobileNo: [null, [Validators.required]], + relationId: [null, [Validators.required]], + accountNo: [null, [Validators.required]], + accountTitle: [null, [Validators.required]], + noOfVisits: [null, [Validators.required]], + osAmount: [null, [Validators.required]], + osProfit: [null, [Validators.required]], + odDays: [null, [Validators.required]], + loanOfficer: [null, [Validators.required]], + visitedBy: [null, [Validators.required]], + pptDate: [null, [Validators.required]], + remakrs: [null, [Validators.required]], + extraColumnOne: [], + extraColumnTwo: [], + extraColumnThree: [], + extraColumnFour: [], + extraColumnFive: [], + }); + + constructor( + protected collectionTrackingService: CollectionTrackingService, + protected activatedRoute: ActivatedRoute, + private fb: FormBuilder + ) {} + + ngOnInit(): void { + this.activatedRoute.data.subscribe(({ collectionTracking }) => { + this.updateForm(collectionTracking); + }); + } + + updateForm(collectionTracking: ICollectionTracking): void { + this.editForm.patchValue({ + id: collectionTracking.id, + employeeID: collectionTracking.employeeID, + unitID: collectionTracking.unitID, + employeeName: collectionTracking.employeeName, + businessProposal: collectionTracking.businessProposal, + subProposal: collectionTracking.subProposal, + mobileNo: collectionTracking.mobileNo, + relationId: collectionTracking.relationId, + accountNo: collectionTracking.accountNo, + accountTitle: collectionTracking.accountTitle, + noOfVisits: collectionTracking.noOfVisits, + osAmount: collectionTracking.osAmount, + osProfit: collectionTracking.osProfit, + odDays: collectionTracking.odDays, + loanOfficer: collectionTracking.loanOfficer, + visitedBy: collectionTracking.visitedBy, + pptDate: collectionTracking.pptDate, + remakrs: collectionTracking.remakrs, + extraColumnOne: collectionTracking.extraColumnOne, + extraColumnTwo: collectionTracking.extraColumnTwo, + extraColumnThree: collectionTracking.extraColumnThree, + extraColumnFour: collectionTracking.extraColumnFour, + extraColumnFive: collectionTracking.extraColumnFive, + }); + } + + previousState(): void { + window.history.back(); + } + + save(): void { + this.isSaving = true; + const collectionTracking = this.createFromForm(); + if (collectionTracking.id !== undefined) { + this.subscribeToSaveResponse(this.collectionTrackingService.update(collectionTracking)); + } else { + this.subscribeToSaveResponse(this.collectionTrackingService.create(collectionTracking)); + } + } + + private createFromForm(): ICollectionTracking { + return { + ...new CollectionTracking(), + id: this.editForm.get(['id'])!.value, + employeeID: this.editForm.get(['employeeID'])!.value, + unitID: this.editForm.get(['unitID'])!.value, + employeeName: this.editForm.get(['employeeName'])!.value, + businessProposal: this.editForm.get(['businessProposal'])!.value, + subProposal: this.editForm.get(['subProposal'])!.value, + mobileNo: this.editForm.get(['mobileNo'])!.value, + relationId: this.editForm.get(['relationId'])!.value, + accountNo: this.editForm.get(['accountNo'])!.value, + accountTitle: this.editForm.get(['accountTitle'])!.value, + noOfVisits: this.editForm.get(['noOfVisits'])!.value, + osAmount: this.editForm.get(['osAmount'])!.value, + osProfit: this.editForm.get(['osProfit'])!.value, + odDays: this.editForm.get(['odDays'])!.value, + loanOfficer: this.editForm.get(['loanOfficer'])!.value, + visitedBy: this.editForm.get(['visitedBy'])!.value, + pptDate: this.editForm.get(['pptDate'])!.value, + remakrs: this.editForm.get(['remakrs'])!.value, + extraColumnOne: this.editForm.get(['extraColumnOne'])!.value, + extraColumnTwo: this.editForm.get(['extraColumnTwo'])!.value, + extraColumnThree: this.editForm.get(['extraColumnThree'])!.value, + extraColumnFour: this.editForm.get(['extraColumnFour'])!.value, + extraColumnFive: this.editForm.get(['extraColumnFive'])!.value, + }; + } + + protected subscribeToSaveResponse(result: Observable>): void { + result.subscribe( + () => this.onSaveSuccess(), + () => this.onSaveError() + ); + } + + protected onSaveSuccess(): void { + this.isSaving = false; + this.previousState(); + } + + protected onSaveError(): void { + this.isSaving = false; + } +} diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking.component.html b/src/main/webapp/app/entities/collection-tracking/collection-tracking.component.html new file mode 100644 index 0000000..e02c091 --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking.component.html @@ -0,0 +1,103 @@ +
+

+ Collection Trackings + + +

+ + + + + +
+ No collectionTrackings found +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDEmployee IDUnit IDEmployee NameBusiness ProposalSub ProposalMobile NoRelation IdAccount NoAccount TitleNo Of VisitsOs AmountOs ProfitOd DaysLoan OfficerVisited ByPpt DateRemakrsExtra Column OneExtra Column TwoExtra Column ThreeExtra Column FourExtra Column Five
{{ collectionTracking.id }}{{ collectionTracking.employeeID }}{{ collectionTracking.unitID }}{{ collectionTracking.employeeName }}{{ collectionTracking.businessProposal }}{{ collectionTracking.subProposal }}{{ collectionTracking.mobileNo }}{{ collectionTracking.relationId }}{{ collectionTracking.accountNo }}{{ collectionTracking.accountTitle }}{{ collectionTracking.noOfVisits }}{{ collectionTracking.osAmount }}{{ collectionTracking.osProfit }}{{ collectionTracking.odDays }}{{ collectionTracking.loanOfficer }}{{ collectionTracking.visitedBy }}{{ collectionTracking.pptDate | date:'mediumDate' }}{{ collectionTracking.remakrs }}{{ collectionTracking.extraColumnOne }}{{ collectionTracking.extraColumnTwo }}{{ collectionTracking.extraColumnThree }}{{ collectionTracking.extraColumnFour }}{{ collectionTracking.extraColumnFive }} +
+ + + + + +
+
+
+
diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking.component.ts b/src/main/webapp/app/entities/collection-tracking/collection-tracking.component.ts new file mode 100644 index 0000000..a8bb0fd --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking.component.ts @@ -0,0 +1,55 @@ +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { HttpResponse } from '@angular/common/http'; +import { Subscription } from 'rxjs'; +import { JhiEventManager } from 'ng-jhipster'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; + +import { ICollectionTracking } from 'app/shared/model/collection-tracking.model'; +import { CollectionTrackingService } from './collection-tracking.service'; +import { CollectionTrackingDeleteDialogComponent } from './collection-tracking-delete-dialog.component'; + +@Component({ + selector: 'jhi-collection-tracking', + templateUrl: './collection-tracking.component.html', +}) +export class CollectionTrackingComponent implements OnInit, OnDestroy { + collectionTrackings?: ICollectionTracking[]; + eventSubscriber?: Subscription; + + constructor( + protected collectionTrackingService: CollectionTrackingService, + protected eventManager: JhiEventManager, + protected modalService: NgbModal + ) {} + + loadAll(): void { + this.collectionTrackingService + .query() + .subscribe((res: HttpResponse) => (this.collectionTrackings = res.body || [])); + } + + ngOnInit(): void { + this.loadAll(); + this.registerChangeInCollectionTrackings(); + } + + ngOnDestroy(): void { + if (this.eventSubscriber) { + this.eventManager.destroy(this.eventSubscriber); + } + } + + trackId(index: number, item: ICollectionTracking): number { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + return item.id!; + } + + registerChangeInCollectionTrackings(): void { + this.eventSubscriber = this.eventManager.subscribe('collectionTrackingListModification', () => this.loadAll()); + } + + delete(collectionTracking: ICollectionTracking): void { + const modalRef = this.modalService.open(CollectionTrackingDeleteDialogComponent, { size: 'lg', backdrop: 'static' }); + modalRef.componentInstance.collectionTracking = collectionTracking; + } +} diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking.module.ts b/src/main/webapp/app/entities/collection-tracking/collection-tracking.module.ts new file mode 100644 index 0000000..f1fdd2b --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +import { CcwApplicationSharedModule } from 'app/shared/shared.module'; +import { CollectionTrackingComponent } from './collection-tracking.component'; +import { CollectionTrackingDetailComponent } from './collection-tracking-detail.component'; +import { CollectionTrackingUpdateComponent } from './collection-tracking-update.component'; +import { CollectionTrackingDeleteDialogComponent } from './collection-tracking-delete-dialog.component'; +import { collectionTrackingRoute } from './collection-tracking.route'; + +@NgModule({ + imports: [CcwApplicationSharedModule, RouterModule.forChild(collectionTrackingRoute)], + declarations: [ + CollectionTrackingComponent, + CollectionTrackingDetailComponent, + CollectionTrackingUpdateComponent, + CollectionTrackingDeleteDialogComponent, + ], + entryComponents: [CollectionTrackingDeleteDialogComponent], +}) +export class CcwApplicationCollectionTrackingModule {} diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking.route.ts b/src/main/webapp/app/entities/collection-tracking/collection-tracking.route.ts new file mode 100644 index 0000000..460a959 --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking.route.ts @@ -0,0 +1,83 @@ +import { Injectable } from '@angular/core'; +import { HttpResponse } from '@angular/common/http'; +import { Resolve, ActivatedRouteSnapshot, Routes, Router } from '@angular/router'; +import { Observable, of, EMPTY } from 'rxjs'; +import { flatMap } from 'rxjs/operators'; + +import { Authority } from 'app/shared/constants/authority.constants'; +import { UserRouteAccessService } from 'app/core/auth/user-route-access-service'; +import { ICollectionTracking, CollectionTracking } from 'app/shared/model/collection-tracking.model'; +import { CollectionTrackingService } from './collection-tracking.service'; +import { CollectionTrackingComponent } from './collection-tracking.component'; +import { CollectionTrackingDetailComponent } from './collection-tracking-detail.component'; +import { CollectionTrackingUpdateComponent } from './collection-tracking-update.component'; + +@Injectable({ providedIn: 'root' }) +export class CollectionTrackingResolve implements Resolve { + constructor(private service: CollectionTrackingService, private router: Router) {} + + resolve(route: ActivatedRouteSnapshot): Observable | Observable { + const id = route.params['id']; + if (id) { + return this.service.find(id).pipe( + flatMap((collectionTracking: HttpResponse) => { + if (collectionTracking.body) { + return of(collectionTracking.body); + } else { + this.router.navigate(['404']); + return EMPTY; + } + }) + ); + } + return of(new CollectionTracking()); + } +} + +export const collectionTrackingRoute: Routes = [ + { + path: '', + component: CollectionTrackingComponent, + data: { + authorities: [Authority.USER], + pageTitle: 'ccwApplicationApp.collectionTracking.home.title', + }, + canActivate: [UserRouteAccessService], + }, + { + path: ':id/view', + component: CollectionTrackingDetailComponent, + resolve: { + collectionTracking: CollectionTrackingResolve, + }, + data: { + authorities: [Authority.USER], + pageTitle: 'ccwApplicationApp.collectionTracking.home.title', + }, + canActivate: [UserRouteAccessService], + }, + { + path: 'new', + component: CollectionTrackingUpdateComponent, + resolve: { + collectionTracking: CollectionTrackingResolve, + }, + data: { + authorities: [Authority.USER], + pageTitle: 'ccwApplicationApp.collectionTracking.home.title', + }, + canActivate: [UserRouteAccessService], + }, + { + path: ':id/edit', + component: CollectionTrackingUpdateComponent, + resolve: { + collectionTracking: CollectionTrackingResolve, + }, + data: { + authorities: [Authority.USER], + pageTitle: 'ccwApplicationApp.collectionTracking.home.title', + }, + canActivate: [UserRouteAccessService], + }, +]; diff --git a/src/main/webapp/app/entities/collection-tracking/collection-tracking.service.ts b/src/main/webapp/app/entities/collection-tracking/collection-tracking.service.ts new file mode 100644 index 0000000..1e40bf3 --- /dev/null +++ b/src/main/webapp/app/entities/collection-tracking/collection-tracking.service.ts @@ -0,0 +1,75 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; +import * as moment from 'moment'; + +import { DATE_FORMAT } from 'app/shared/constants/input.constants'; +import { SERVER_API_URL } from 'app/app.constants'; +import { createRequestOption } from 'app/shared/util/request-util'; +import { ICollectionTracking } from 'app/shared/model/collection-tracking.model'; + +type EntityResponseType = HttpResponse; +type EntityArrayResponseType = HttpResponse; + +@Injectable({ providedIn: 'root' }) +export class CollectionTrackingService { + public resourceUrl = SERVER_API_URL + 'api/collection-trackings'; + + constructor(protected http: HttpClient) {} + + create(collectionTracking: ICollectionTracking): Observable { + const copy = this.convertDateFromClient(collectionTracking); + return this.http + .post(this.resourceUrl, copy, { observe: 'response' }) + .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); + } + + update(collectionTracking: ICollectionTracking): Observable { + const copy = this.convertDateFromClient(collectionTracking); + return this.http + .put(this.resourceUrl, copy, { observe: 'response' }) + .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); + } + + find(id: number): Observable { + return this.http + .get(`${this.resourceUrl}/${id}`, { observe: 'response' }) + .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res))); + } + + query(req?: any): Observable { + const options = createRequestOption(req); + return this.http + .get(this.resourceUrl, { params: options, observe: 'response' }) + .pipe(map((res: EntityArrayResponseType) => this.convertDateArrayFromServer(res))); + } + + delete(id: number): Observable> { + return this.http.delete(`${this.resourceUrl}/${id}`, { observe: 'response' }); + } + + protected convertDateFromClient(collectionTracking: ICollectionTracking): ICollectionTracking { + const copy: ICollectionTracking = Object.assign({}, collectionTracking, { + pptDate: + collectionTracking.pptDate && collectionTracking.pptDate.isValid() ? collectionTracking.pptDate.format(DATE_FORMAT) : undefined, + }); + return copy; + } + + protected convertDateFromServer(res: EntityResponseType): EntityResponseType { + if (res.body) { + res.body.pptDate = res.body.pptDate ? moment(res.body.pptDate) : undefined; + } + return res; + } + + protected convertDateArrayFromServer(res: EntityArrayResponseType): EntityArrayResponseType { + if (res.body) { + res.body.forEach((collectionTracking: ICollectionTracking) => { + collectionTracking.pptDate = collectionTracking.pptDate ? moment(collectionTracking.pptDate) : undefined; + }); + } + return res; + } +} diff --git a/src/main/webapp/app/entities/entity.module.ts b/src/main/webapp/app/entities/entity.module.ts index f0e97d3..0a83a27 100644 --- a/src/main/webapp/app/entities/entity.module.ts +++ b/src/main/webapp/app/entities/entity.module.ts @@ -4,6 +4,10 @@ import { RouterModule } from '@angular/router'; @NgModule({ imports: [ RouterModule.forChild([ + { + path: 'collection-tracking', + loadChildren: () => import('./collection-tracking/collection-tracking.module').then(m => m.CcwApplicationCollectionTrackingModule), + }, /* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */ ]), ], diff --git a/src/main/webapp/app/layouts/navbar/navbar.component.html b/src/main/webapp/app/layouts/navbar/navbar.component.html index b73d112..504b346 100644 --- a/src/main/webapp/app/layouts/navbar/navbar.component.html +++ b/src/main/webapp/app/layouts/navbar/navbar.component.html @@ -27,6 +27,12 @@ diff --git a/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts b/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts index d01a5d7..736809c 100644 --- a/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts +++ b/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts @@ -4,6 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core'; export class FindLanguageFromKeyPipe implements PipeTransform { private languages: { [key: string]: { name: string; rtl?: boolean } } = { en: { name: 'English' }, + fr: { name: 'Français' }, // jhipster-needle-i18n-language-key-pipe - JHipster will add/remove languages in this object }; diff --git a/src/main/webapp/app/shared/model/collection-tracking.model.ts b/src/main/webapp/app/shared/model/collection-tracking.model.ts new file mode 100644 index 0000000..b7e168c --- /dev/null +++ b/src/main/webapp/app/shared/model/collection-tracking.model.ts @@ -0,0 +1,55 @@ +import { Moment } from 'moment'; + +export interface ICollectionTracking { + id?: number; + employeeID?: string; + unitID?: string; + employeeName?: string; + businessProposal?: string; + subProposal?: string; + mobileNo?: string; + relationId?: string; + accountNo?: string; + accountTitle?: string; + noOfVisits?: number; + osAmount?: number; + osProfit?: number; + odDays?: string; + loanOfficer?: string; + visitedBy?: string; + pptDate?: Moment; + remakrs?: string; + extraColumnOne?: string; + extraColumnTwo?: string; + extraColumnThree?: string; + extraColumnFour?: string; + extraColumnFive?: string; +} + +export class CollectionTracking implements ICollectionTracking { + constructor( + public id?: number, + public employeeID?: string, + public unitID?: string, + public employeeName?: string, + public businessProposal?: string, + public subProposal?: string, + public mobileNo?: string, + public relationId?: string, + public accountNo?: string, + public accountTitle?: string, + public noOfVisits?: number, + public osAmount?: number, + public osProfit?: number, + public odDays?: string, + public loanOfficer?: string, + public visitedBy?: string, + public pptDate?: Moment, + public remakrs?: string, + public extraColumnOne?: string, + public extraColumnTwo?: string, + public extraColumnThree?: string, + public extraColumnFour?: string, + public extraColumnFive?: string + ) {} +} diff --git a/src/main/webapp/i18n/en/collectionTracking.json b/src/main/webapp/i18n/en/collectionTracking.json new file mode 100644 index 0000000..e60bd8c --- /dev/null +++ b/src/main/webapp/i18n/en/collectionTracking.json @@ -0,0 +1,43 @@ +{ + "ccwApplicationApp": { + "collectionTracking": { + "home": { + "title": "Collection Trackings", + "createLabel": "Create a new Collection Tracking", + "createOrEditLabel": "Create or edit a Collection Tracking", + "notFound": "No Collection Trackings found" + }, + "created": "A new Collection Tracking is created with identifier {{ param }}", + "updated": "A Collection Tracking is updated with identifier {{ param }}", + "deleted": "A Collection Tracking is deleted with identifier {{ param }}", + "delete": { + "question": "Are you sure you want to delete Collection Tracking {{ id }}?" + }, + "detail": { + "title": "Collection Tracking" + }, + "employeeID": "Employee ID", + "unitID": "Unit ID", + "employeeName": "Employee Name", + "businessProposal": "Business Proposal", + "subProposal": "Sub Proposal", + "mobileNo": "Mobile No", + "relationId": "Relation Id", + "accountNo": "Account No", + "accountTitle": "Account Title", + "noOfVisits": "No Of Visits", + "osAmount": "Os Amount", + "osProfit": "Os Profit", + "odDays": "Od Days", + "loanOfficer": "Loan Officer", + "visitedBy": "Visited By", + "pptDate": "Ppt Date", + "remakrs": "Remakrs", + "extraColumnOne": "Extra Column One", + "extraColumnTwo": "Extra Column Two", + "extraColumnThree": "Extra Column Three", + "extraColumnFour": "Extra Column Four", + "extraColumnFive": "Extra Column Five" + } + } +} diff --git a/src/main/webapp/i18n/en/global.json b/src/main/webapp/i18n/en/global.json index 0515005..b40fb93 100644 --- a/src/main/webapp/i18n/en/global.json +++ b/src/main/webapp/i18n/en/global.json @@ -7,6 +7,7 @@ "jhipster-needle-menu-add-element": "JHipster will add additional menu entries here (do not translate!)", "entities": { "main": "Entities", + "collectionTracking": "Collection Tracking", "jhipster-needle-menu-add-entry": "JHipster will add additional entities here (do not translate!)" }, "account": { diff --git a/src/main/webapp/i18n/fr/activate.json b/src/main/webapp/i18n/fr/activate.json new file mode 100644 index 0000000..7b29d28 --- /dev/null +++ b/src/main/webapp/i18n/fr/activate.json @@ -0,0 +1,9 @@ +{ + "activate": { + "title": "Activation", + "messages": { + "success": "Votre compte utilisateur a été activé. Merci de vous ", + "error": "Votre compte utilisateur n'a pas pu être activé. Utilisez le formulaire d'enregistrement pour en créer un nouveau." + } + } +} diff --git a/src/main/webapp/i18n/fr/audits.json b/src/main/webapp/i18n/fr/audits.json new file mode 100644 index 0000000..d67422c --- /dev/null +++ b/src/main/webapp/i18n/fr/audits.json @@ -0,0 +1,28 @@ +{ + "audits": { + "title": "Audits", + "filter": { + "title": "Filtrer par date", + "from": "De", + "to": "à", + "button": { + "weeks": "Semaines", + "today": "Aujourd'hui", + "clear": "Effacer", + "close": "Fermer" + } + }, + "table": { + "header": { + "principal": "Utilisateur", + "date": "Date", + "status": "Status", + "data": "Autres données" + }, + "data": { + "remoteAddress": "Adresse Distante :" + } + }, + "notFound": "Aucun audit trouvé" + } +} diff --git a/src/main/webapp/i18n/fr/collectionTracking.json b/src/main/webapp/i18n/fr/collectionTracking.json new file mode 100644 index 0000000..38f8a5f --- /dev/null +++ b/src/main/webapp/i18n/fr/collectionTracking.json @@ -0,0 +1,43 @@ +{ + "ccwApplicationApp": { + "collectionTracking": { + "home": { + "title": "CollectionTrackings", + "createLabel": "Créer un nouveau Collection Tracking", + "createOrEditLabel": "Créer ou éditer un Collection Tracking", + "notFound": "Aucun Collection Tracking trouvé" + }, + "created": "Un nouveau Collection Tracking a été créé avec l'identifiant {{ param }}", + "updated": "Le Collection Tracking avec l'identifiant {{ param }} a été mis à jour", + "deleted": "Le Collection Tracking avec l'identifiant {{ param }} a été supprimé", + "delete": { + "question": "Etes-vous certain de vouloir supprimer le Collection Tracking {{ id }} ?" + }, + "detail": { + "title": "Collection Tracking" + }, + "employeeID": "Employee ID", + "unitID": "Unit ID", + "employeeName": "Employee Name", + "businessProposal": "Business Proposal", + "subProposal": "Sub Proposal", + "mobileNo": "Mobile No", + "relationId": "Relation Id", + "accountNo": "Account No", + "accountTitle": "Account Title", + "noOfVisits": "No Of Visits", + "osAmount": "Os Amount", + "osProfit": "Os Profit", + "odDays": "Od Days", + "loanOfficer": "Loan Officer", + "visitedBy": "Visited By", + "pptDate": "Ppt Date", + "remakrs": "Remakrs", + "extraColumnOne": "Extra Column One", + "extraColumnTwo": "Extra Column Two", + "extraColumnThree": "Extra Column Three", + "extraColumnFour": "Extra Column Four", + "extraColumnFive": "Extra Column Five" + } + } +} diff --git a/src/main/webapp/i18n/fr/configuration.json b/src/main/webapp/i18n/fr/configuration.json new file mode 100644 index 0000000..a9a014a --- /dev/null +++ b/src/main/webapp/i18n/fr/configuration.json @@ -0,0 +1,10 @@ +{ + "configuration": { + "title": "Configuration", + "filter": "Filtrer (par préfixe)", + "table": { + "prefix": "Préfixe", + "properties": "Propriétés" + } + } +} diff --git a/src/main/webapp/i18n/fr/error.json b/src/main/webapp/i18n/fr/error.json new file mode 100644 index 0000000..71622e5 --- /dev/null +++ b/src/main/webapp/i18n/fr/error.json @@ -0,0 +1,14 @@ +{ + "error": { + "title": "Page d'erreur !", + "http": { + "400": "Mauvaise requête.", + "403": "Vous n'avez pas les droits pour accéder à cette page.", + "404": "La page n'existe pas.", + "405": "Le verbe HTTP que vous avez utilisé n'est pas reconnu par cet URL.", + "500": "Erreur interne du serveur." + }, + "concurrencyFailure": "Un autre utilisateur a modifié ces données en même temps que vous. Vos changements n'ont pas été sauvegardés.", + "validation": "Erreur de validation côté serveur." + } +} diff --git a/src/main/webapp/i18n/fr/global.json b/src/main/webapp/i18n/fr/global.json new file mode 100644 index 0000000..8aebf83 --- /dev/null +++ b/src/main/webapp/i18n/fr/global.json @@ -0,0 +1,141 @@ +{ + "global": { + "title": "CCWApplication", + "browsehappy": "Vous utilisez un ancien navigateur. Veuillez mettre à jour votre navigateur pour une meilleure expérience.", + "menu": { + "home": "Accueil", + "jhipster-needle-menu-add-element": "JHipster will add additional menu entries here (do not translate!)", + "entities": { + "main": "Entités", + "collectionTracking": "Collection Tracking", + "jhipster-needle-menu-add-entry": "JHipster will add additional entities here (do not translate!)" + }, + "account": { + "main": "Compte", + "settings": "Profil", + "password": "Mot de passe", + "sessions": "Sessions", + "login": "S'authentifier", + "logout": "Déconnexion", + "register": "Créer un compte" + }, + "admin": { + "main": "Administration", + "userManagement": "Gestion des utilisateurs", + "tracker": "Suivi des utilisateurs", + "metrics": "Métriques", + "health": "Diagnostics", + "configuration": "Configuration", + "logs": "Logs", + "audits": "Audits", + "apidocs": "API", + "database": "Base de données", + "jhipster-needle-menu-add-admin-element": "JHipster will add additional menu entries here (do not translate!)" + }, + "language": "Langue" + }, + "form": { + "username.label": "Nom d'utilisateur", + "username.placeholder": "Votre nom d'utilisateur", + "currentpassword.label": "Mot de passe actuel", + "currentpassword.placeholder": "Mot de passe actuel", + "newpassword.label": "Nouveau mot de passe", + "newpassword.placeholder": "Nouveau mot de passe", + "confirmpassword.label": "Confirmation du nouveau mot de passe", + "confirmpassword.placeholder": "Confirmation du nouveau mot de passe", + "email.label": "Email", + "email.placeholder": "Votre email" + }, + "messages": { + "info": { + "authenticated": { + "prefix": "Si vous voulez vous ", + "link": "connecter", + "suffix": ", vous pouvez utiliser les comptes par défaut :
- Administrateur (nom d'utilisateur=\"admin\" et mot de passe =\"admin\")
- Utilisateur (nom d'utilisateur=\"user\" et mot de passe =\"user\")." + }, + "register": { + "noaccount": "Vous n'avez pas encore de compte ?", + "link": "Créer un compte" + } + }, + "error": { + "dontmatch": "Le nouveau mot de passe et sa confirmation ne sont pas égaux !" + }, + "validate": { + "newpassword": { + "required": "Votre mot de passe est requis.", + "minlength": "Votre mot de passe doit comporter au moins 4 caractères.", + "maxlength": "Votre mot de passe ne doit pas comporter plus de 50 caractères.", + "strength": "Robustesse du mot de passe :" + }, + "confirmpassword": { + "required": "Votre confirmation du mot de passe est requise.", + "minlength": "Votre confirmation du mot de passe doit comporter au moins 4 caractères.", + "maxlength": "Votre confirmation du mot de passe ne doit pas comporter plus de 50 caractères." + }, + "email": { + "required": "Votre email est requis.", + "minlength": "Votre email doit comporter au moins 5 caractères.", + "maxlength": "Votre email ne doit pas comporter plus de 50 caractères.", + "invalid": "Votre email n'est pas valide." + } + } + }, + "field": { + "id": "ID" + }, + "ribbon": { + "dev": "Développement" + }, + "item-count": "Affichage {{first}} - {{second}} de {{total}} items." + }, + "entity": { + "action": { + "addblob": "Ajouter blob", + "addimage": "Ajouter image", + "back": "Retour", + "cancel": "Annuler", + "edit": "Editer", + "delete": "Supprimer", + "open": "Ouvrir", + "save": "Sauvegarder", + "view": "Voir" + }, + "detail": { + "field": "Champs", + "value": "Valeur" + }, + "delete": { + "title": "Confirmation de suppression" + }, + "validation": { + "required": "Ce champ est obligatoire.", + "minlength": "Ce champ doit faire au minimum {{min}} caractères.", + "maxlength": "Ce champ doit faire moins de {{max}} caractères.", + "min": "Ce champ doit être supérieur à {{min}}.", + "max": "Ce champ doit être inférieur à {{max}}.", + "minbytes": "Ce champ doit être supérieur à {{min}} bytes.", + "maxbytes": "Ce champ doit être inférieur à {{max}} bytes.", + "pattern": "Ce champ doit suivre l'expression régulière {{pattern}}.", + "number": "Ce champ doit être un nombre.", + "datetimelocal": "Ce champ doit être une date et une heure.", + "patternLogin": "Ce champ ne peut contenir que des lettres, des chiffres ou des adresses e-mail." + } + }, + "error": { + "internalServerError": "Erreur interne du serveur", + "server.not.reachable": "Serveur inaccessible", + "url.not.found": "Non trouvé", + "NotNull": "Le champ {{fieldName}} ne peut pas être vide !", + "Size": "Le champ {{fieldName}} ne respecte pas les critères minimum et maximum !", + "userexists": "Login déjà utilisé !", + "emailexists": "Email déjà utilisé !", + "idexists": "Une nouvelle entité {{entityName}} ne peut pas avoir d'identifiant !", + "idnull": "Identifiant invalide", + "file": { + "could.not.extract": "Impossible d'extraire le fichier", + "not.image": "Le fichier doit être une image et non du type \"{{ fileType }}\"" + } + }, + "footer": "Ceci est votre pied de page" +} diff --git a/src/main/webapp/i18n/fr/health.json b/src/main/webapp/i18n/fr/health.json new file mode 100644 index 0000000..71c0822 --- /dev/null +++ b/src/main/webapp/i18n/fr/health.json @@ -0,0 +1,29 @@ +{ + "health": { + "title": "Diagnostics", + "refresh.button": "Rafraîchir", + "stacktrace": "Stacktrace", + "details": { + "details": "Détails", + "properties": "Propriétés", + "name": "Nom", + "value": "Valeur", + "error": "Erreur" + }, + "indicator": { + "diskSpace": "Espace disque", + "mail": "Email", + "ping": "Application", + "db": "Base de données" + }, + "table": { + "service": "Nom du service", + "status": "État" + }, + "status": { + "UNKNOWN": "INCONNU", + "UP": "DISPONIBLE", + "DOWN": "HORS SERVICE" + } + } +} diff --git a/src/main/webapp/i18n/fr/home.json b/src/main/webapp/i18n/fr/home.json new file mode 100644 index 0000000..44dc4b9 --- /dev/null +++ b/src/main/webapp/i18n/fr/home.json @@ -0,0 +1,19 @@ +{ + "home": { + "title": "Bienvenue, Java Hipster !", + "subtitle": "Ceci est votre page d'accueil", + "logged": { + "message": "Vous êtes connecté en tant que \"{{username}}\"." + }, + "question": "Si vous avez des questions à propos de JHipster :", + "link": { + "homepage": "Page d'accueil de JHipster", + "stackoverflow": "JHipster sur Stack Overflow", + "bugtracker": "JHipster bug tracker", + "chat": "JHipster public chat room", + "follow": "Suivez @jhipster sur Twitter" + }, + "like": "Si vous aimez JHipster, donnez nous une étoile sur", + "github": "GitHub " + } +} diff --git a/src/main/webapp/i18n/fr/login.json b/src/main/webapp/i18n/fr/login.json new file mode 100644 index 0000000..f5aa2af --- /dev/null +++ b/src/main/webapp/i18n/fr/login.json @@ -0,0 +1,19 @@ +{ + "login": { + "title": "Authentification", + "form": { + "password": "Mot de passe", + "password.placeholder": "Votre mot de passe", + "rememberme": "Garder la session ouverte", + "button": "Connexion" + }, + "messages": { + "error": { + "authentication": "Erreur d'authentification ! Veuillez vérifier vos identifiants de connexion." + } + }, + "password": { + "forgot": "Avez-vous oublié votre mot de passe ?" + } + } +} diff --git a/src/main/webapp/i18n/fr/logs.json b/src/main/webapp/i18n/fr/logs.json new file mode 100644 index 0000000..e0acb27 --- /dev/null +++ b/src/main/webapp/i18n/fr/logs.json @@ -0,0 +1,11 @@ +{ + "logs": { + "title": "Logs", + "nbloggers": "Total de {{ total }} \"loggers\".", + "filter": "Filtrer", + "table": { + "name": "Nom", + "level": "Niveau" + } + } +} diff --git a/src/main/webapp/i18n/fr/metrics.json b/src/main/webapp/i18n/fr/metrics.json new file mode 100644 index 0000000..cbd5c4a --- /dev/null +++ b/src/main/webapp/i18n/fr/metrics.json @@ -0,0 +1,102 @@ +{ + "metrics": { + "title": "Métriques de l'application", + "refresh.button": "Rafraîchir", + "updating": "Mise à jour...", + "jvm": { + "title": "Métriques de la JVM", + "memory": { + "title": "Mémoire", + "total": "Mémoire totale", + "heap": "Mémoire \"Heap\"", + "nonheap": "Mémoire \"Non-Heap\"" + }, + "threads": { + "title": "Threads", + "all": "Tous", + "runnable": "Exécutable", + "timedwaiting": "Temps d'attente", + "waiting": "En attente", + "blocked": "Bloqué", + "dump": { + "title": "Threads dump", + "id": "Id :", + "blockedtime": "Temps bloqué", + "blockedcount": "Nb fois bloqué", + "waitedtime": "Temps d'attente", + "waitedcount": "Nb fois en attente", + "lockname": "Nom du process bloquant", + "stacktrace": "Stacktrace", + "show": "Afficher", + "hide": "Cacher" + } + }, + "gc": { + "title": "Garbage collections", + "marksweepcount": "Total de \"Mark Sweep\"", + "marksweeptime": "Temps \"Mark Sweep\"", + "scavengecount": "Total \"Scavenge\"", + "scavengetime": "Temps \"Scavenge\"" + }, + "http": { + "title": "Requêtes HTTP (temps en millisecondes)", + "active": "Requêtes actives :", + "total": "Requêtes totales :", + "table": { + "code": "Code", + "count": "Total", + "mean": "Médian", + "average": "Moyenne", + "max": "Max" + }, + "code": { + "ok": "Ok", + "notfound": "Non trouvé", + "servererror": "Erreur serveur" + } + } + }, + "servicesstats": { + "title": "Statistiques des services (temps en millisecondes)", + "table": { + "name": "Nom du server", + "count": "Total", + "mean": "Médian", + "min": "Min", + "max": "Max", + "p50": "p50", + "p75": "p75", + "p95": "p95", + "p99": "p99" + } + }, + "cache": { + "title": "Statistiques de cache", + "cachename": "Nom du cache", + "hits": "Données existantes", + "misses": "Données non existantes", + "gets": "Lectures", + "puts": "Écritures", + "removals": "Suppressions", + "evictions": "Évictions", + "hitPercent": "% données existantes", + "missPercent": "% données non existantes", + "averageGetTime": "Temps de lecture moyen (µs)", + "averagePutTime": "Temps d'écriture moyen (µs)", + "averageRemoveTime": "Temps de suppression moyen (µs)" + }, + "datasource": { + "usage": "Usage du Pool de connexion", + "title": "Statistiques du pool de connexions (temps en millisecondes)", + "name": "Utilisation du pool", + "count": "Total", + "mean": "Médian", + "min": "Min", + "max": "Max", + "p50": "p50", + "p75": "p75", + "p95": "p95", + "p99": "p99" + } + } +} diff --git a/src/main/webapp/i18n/fr/password.json b/src/main/webapp/i18n/fr/password.json new file mode 100644 index 0000000..1c5856b --- /dev/null +++ b/src/main/webapp/i18n/fr/password.json @@ -0,0 +1,12 @@ +{ + "password": { + "title": "Changer le mot de passe pour [{{username}}]", + "form": { + "button": "Sauvegarder" + }, + "messages": { + "error": "Une erreur est survenue ! Le mot de passe n'a pas pu être modifié.", + "success": "Le mot de passe a été modifié !" + } + } +} diff --git a/src/main/webapp/i18n/fr/register.json b/src/main/webapp/i18n/fr/register.json new file mode 100644 index 0000000..08eb09d --- /dev/null +++ b/src/main/webapp/i18n/fr/register.json @@ -0,0 +1,24 @@ +{ + "register": { + "title": "Création de compte utilisateur", + "form": { + "button": "Enregistrement" + }, + "messages": { + "validate": { + "login": { + "required": "Votre nom d'utilisateur est obligatoire.", + "minlength": "Votre nom d'utilisateur doit contenir plus d'un caractère.", + "maxlength": "Votre nom d'utilisateur ne peut pas contenir plus de 50 caractères.", + "pattern": "Votre nom d'utilisateur est invalide." + } + }, + "success": "Compte enregistré ! Merci de vérifier votre email de confirmation.", + "error": { + "fail": "Compte non créé ! Merci d'essayer à nouveau plus tard.", + "userexists": "Ce compte utilisateur existe déjà ! Veuillez en choisir un autre.", + "emailexists": "Cet email est déjà utilisé ! Veuillez en choisir un autre." + } + } + } +} diff --git a/src/main/webapp/i18n/fr/reset.json b/src/main/webapp/i18n/fr/reset.json new file mode 100644 index 0000000..df7c18f --- /dev/null +++ b/src/main/webapp/i18n/fr/reset.json @@ -0,0 +1,26 @@ +{ + "reset": { + "request": { + "title": "Réinitialiser son mot de passe", + "form": { + "button": "Réinitialiser le mot de passe" + }, + "messages": { + "info": "Veuillez renseigner l'adresse email utilisée pour vous enregistrer", + "success": "Veuillez vérifier vos nouveaux emails et suivre les instructions pour réinitialiser votre mot de passe." + } + }, + "finish": { + "title": "Réinitialisation du mot de passe", + "form": { + "button": "Réinitialiser le mot de passe" + }, + "messages": { + "info": "Choisir un nouveau mot de passe", + "success": "Votre mot de passe a été réinitialisé. Merci de ", + "keymissing": "La clef de réinitilisation est manquante", + "error": "Votre mot de passe n'a pas pu être réinitialisé. La demande de réinitialisation n'est valable que 24 heures." + } + } + } +} diff --git a/src/main/webapp/i18n/fr/sessions.json b/src/main/webapp/i18n/fr/sessions.json new file mode 100644 index 0000000..1771ca4 --- /dev/null +++ b/src/main/webapp/i18n/fr/sessions.json @@ -0,0 +1,15 @@ +{ + "sessions": { + "title": "Sessions actives de [{{username}}]", + "table": { + "ipaddress": "Adresse IP", + "useragent": "User Agent", + "date": "Date", + "button": "Invalider" + }, + "messages": { + "success": "La session a été invalidée !", + "error": "Une erreur est survenue ! La session ne peut pas être invalidée." + } + } +} diff --git a/src/main/webapp/i18n/fr/settings.json b/src/main/webapp/i18n/fr/settings.json new file mode 100644 index 0000000..e9581dd --- /dev/null +++ b/src/main/webapp/i18n/fr/settings.json @@ -0,0 +1,32 @@ +{ + "settings": { + "title": "Profil de l'utilisateur [{{username}}]", + "form": { + "firstname": "Prénom", + "firstname.placeholder": "Votre prénom", + "lastname": "Nom", + "lastname.placeholder": "Votre nom", + "language": "Langue", + "button": "Sauvegarder" + }, + "messages": { + "error": { + "fail": "Une erreur est survenue ! Votre profil n'a pas été sauvegardé.", + "emailexists": "Cet email est déjà utilisé ! Veuillez en choisir un autre." + }, + "success": "Votre profil a été sauvegardé !", + "validate": { + "firstname": { + "required": "Votre prénom est requis.", + "minlength": "Votre prénom doit comporter au moins un caractère.", + "maxlength": "Votre prénom ne doit pas comporter plus de 50 caractères." + }, + "lastname": { + "required": "Votre nom est requis.", + "minlength": "Votre nom doit comporter au moins un caractère.", + "maxlength": "Votre nom ne doit pas comporter plus de 50 caractères." + } + } + } + } +} diff --git a/src/main/webapp/i18n/fr/user-management.json b/src/main/webapp/i18n/fr/user-management.json new file mode 100644 index 0000000..93b6b1c --- /dev/null +++ b/src/main/webapp/i18n/fr/user-management.json @@ -0,0 +1,30 @@ +{ + "userManagement": { + "home": { + "title": "Utilisateurs", + "createLabel": "Créer un nouvel utilisateur", + "createOrEditLabel": "Créer ou éditer un utilisateur" + }, + "created": "L'utilisateur {{ param }} a été créé.", + "updated": "L'utilisateur {{ param }} a été mis à jour.", + "deleted": "L'utilisateur {{ param }} a été supprimé.", + "delete": { + "question": "Etes-vous certain de vouloir supprimer l'utilisateur {{ login }} ?" + }, + "detail": { + "title": "Utilisateur" + }, + "login": "Login", + "firstName": "Prénom", + "lastName": "Nom", + "email": "Email", + "activated": "Activé", + "deactivated": "Désactivé", + "profiles": "Droits", + "langKey": "Langue", + "createdBy": "Créé par", + "createdDate": "Créé le", + "lastModifiedBy": "Modifié par", + "lastModifiedDate": "Modifié le" + } +} diff --git a/src/test/java/com/finca/ccw/domain/CollectionTrackingTest.java b/src/test/java/com/finca/ccw/domain/CollectionTrackingTest.java new file mode 100644 index 0000000..a0cfcac --- /dev/null +++ b/src/test/java/com/finca/ccw/domain/CollectionTrackingTest.java @@ -0,0 +1,23 @@ +package com.finca.ccw.domain; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.finca.ccw.web.rest.TestUtil; +import org.junit.jupiter.api.Test; + +public class CollectionTrackingTest { + + @Test + public void equalsVerifier() throws Exception { + TestUtil.equalsVerifier(CollectionTracking.class); + CollectionTracking collectionTracking1 = new CollectionTracking(); + collectionTracking1.setId(1L); + CollectionTracking collectionTracking2 = new CollectionTracking(); + collectionTracking2.setId(collectionTracking1.getId()); + assertThat(collectionTracking1).isEqualTo(collectionTracking2); + collectionTracking2.setId(2L); + assertThat(collectionTracking1).isNotEqualTo(collectionTracking2); + collectionTracking1.setId(null); + assertThat(collectionTracking1).isNotEqualTo(collectionTracking2); + } +} diff --git a/src/test/java/com/finca/ccw/service/MailServiceIT.java b/src/test/java/com/finca/ccw/service/MailServiceIT.java index baca7d4..c98a4cc 100644 --- a/src/test/java/com/finca/ccw/service/MailServiceIT.java +++ b/src/test/java/com/finca/ccw/service/MailServiceIT.java @@ -42,6 +42,7 @@ public class MailServiceIT { private static final String[] languages = { "en", + "fr", // jhipster-needle-i18n-language-constant - JHipster will add/remove languages in this array }; private static final Pattern PATTERN_LOCALE_3 = Pattern.compile("([a-z]{2})-([a-zA-Z]{4})-([a-z]{2})"); diff --git a/src/test/java/com/finca/ccw/web/rest/CollectionTrackingResourceIT.java b/src/test/java/com/finca/ccw/web/rest/CollectionTrackingResourceIT.java new file mode 100644 index 0000000..f731b0d --- /dev/null +++ b/src/test/java/com/finca/ccw/web/rest/CollectionTrackingResourceIT.java @@ -0,0 +1,788 @@ +package com.finca.ccw.web.rest; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.Matchers.hasItem; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +import com.finca.ccw.CcwApplicationApp; +import com.finca.ccw.domain.CollectionTracking; +import com.finca.ccw.repository.CollectionTrackingRepository; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.List; +import javax.persistence.EntityManager; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.MediaType; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.transaction.annotation.Transactional; + +/** + * Integration tests for the {@link CollectionTrackingResource} REST controller. + */ +@SpringBootTest(classes = CcwApplicationApp.class) +@AutoConfigureMockMvc +@WithMockUser +public class CollectionTrackingResourceIT { + private static final String DEFAULT_EMPLOYEE_ID = "AAAAAAAAAA"; + private static final String UPDATED_EMPLOYEE_ID = "BBBBBBBBBB"; + + private static final String DEFAULT_UNIT_ID = "AAAAAAAAAA"; + private static final String UPDATED_UNIT_ID = "BBBBBBBBBB"; + + private static final String DEFAULT_EMPLOYEE_NAME = "AAAAAAAAAA"; + private static final String UPDATED_EMPLOYEE_NAME = "BBBBBBBBBB"; + + private static final String DEFAULT_BUSINESS_PROPOSAL = "AAAAAAAAAA"; + private static final String UPDATED_BUSINESS_PROPOSAL = "BBBBBBBBBB"; + + private static final String DEFAULT_SUB_PROPOSAL = "AAAAAAAAAA"; + private static final String UPDATED_SUB_PROPOSAL = "BBBBBBBBBB"; + + private static final String DEFAULT_MOBILE_NO = "AAAAAAAAAA"; + private static final String UPDATED_MOBILE_NO = "BBBBBBBBBB"; + + private static final String DEFAULT_RELATION_ID = "AAAAAAAAAA"; + private static final String UPDATED_RELATION_ID = "BBBBBBBBBB"; + + private static final String DEFAULT_ACCOUNT_NO = "AAAAAAAAAA"; + private static final String UPDATED_ACCOUNT_NO = "BBBBBBBBBB"; + + private static final String DEFAULT_ACCOUNT_TITLE = "AAAAAAAAAA"; + private static final String UPDATED_ACCOUNT_TITLE = "BBBBBBBBBB"; + + private static final Integer DEFAULT_NO_OF_VISITS = 1; + private static final Integer UPDATED_NO_OF_VISITS = 2; + + private static final BigDecimal DEFAULT_OS_AMOUNT = new BigDecimal(1); + private static final BigDecimal UPDATED_OS_AMOUNT = new BigDecimal(2); + + private static final BigDecimal DEFAULT_OS_PROFIT = new BigDecimal(1); + private static final BigDecimal UPDATED_OS_PROFIT = new BigDecimal(2); + + private static final String DEFAULT_OD_DAYS = "AAAAAAAAAA"; + private static final String UPDATED_OD_DAYS = "BBBBBBBBBB"; + + private static final String DEFAULT_LOAN_OFFICER = "AAAAAAAAAA"; + private static final String UPDATED_LOAN_OFFICER = "BBBBBBBBBB"; + + private static final String DEFAULT_VISITED_BY = "AAAAAAAAAA"; + private static final String UPDATED_VISITED_BY = "BBBBBBBBBB"; + + private static final LocalDate DEFAULT_PPT_DATE = LocalDate.ofEpochDay(0L); + private static final LocalDate UPDATED_PPT_DATE = LocalDate.now(ZoneId.systemDefault()); + + private static final String DEFAULT_REMAKRS = "AAAAAAAAAA"; + private static final String UPDATED_REMAKRS = "BBBBBBBBBB"; + + private static final String DEFAULT_EXTRA_COLUMN_ONE = "AAAAAAAAAA"; + private static final String UPDATED_EXTRA_COLUMN_ONE = "BBBBBBBBBB"; + + private static final String DEFAULT_EXTRA_COLUMN_TWO = "AAAAAAAAAA"; + private static final String UPDATED_EXTRA_COLUMN_TWO = "BBBBBBBBBB"; + + private static final String DEFAULT_EXTRA_COLUMN_THREE = "AAAAAAAAAA"; + private static final String UPDATED_EXTRA_COLUMN_THREE = "BBBBBBBBBB"; + + private static final String DEFAULT_EXTRA_COLUMN_FOUR = "AAAAAAAAAA"; + private static final String UPDATED_EXTRA_COLUMN_FOUR = "BBBBBBBBBB"; + + private static final String DEFAULT_EXTRA_COLUMN_FIVE = "AAAAAAAAAA"; + private static final String UPDATED_EXTRA_COLUMN_FIVE = "BBBBBBBBBB"; + + @Autowired + private CollectionTrackingRepository collectionTrackingRepository; + + @Autowired + private EntityManager em; + + @Autowired + private MockMvc restCollectionTrackingMockMvc; + + private CollectionTracking collectionTracking; + + /** + * Create an entity for this test. + * + * This is a static method, as tests for other entities might also need it, + * if they test an entity which requires the current entity. + */ + public static CollectionTracking createEntity(EntityManager em) { + CollectionTracking collectionTracking = new CollectionTracking() + .employeeID(DEFAULT_EMPLOYEE_ID) + .unitID(DEFAULT_UNIT_ID) + .employeeName(DEFAULT_EMPLOYEE_NAME) + .businessProposal(DEFAULT_BUSINESS_PROPOSAL) + .subProposal(DEFAULT_SUB_PROPOSAL) + .mobileNo(DEFAULT_MOBILE_NO) + .relationId(DEFAULT_RELATION_ID) + .accountNo(DEFAULT_ACCOUNT_NO) + .accountTitle(DEFAULT_ACCOUNT_TITLE) + .noOfVisits(DEFAULT_NO_OF_VISITS) + .osAmount(DEFAULT_OS_AMOUNT) + .osProfit(DEFAULT_OS_PROFIT) + .odDays(DEFAULT_OD_DAYS) + .loanOfficer(DEFAULT_LOAN_OFFICER) + .visitedBy(DEFAULT_VISITED_BY) + .pptDate(DEFAULT_PPT_DATE) + .remakrs(DEFAULT_REMAKRS) + .extraColumnOne(DEFAULT_EXTRA_COLUMN_ONE) + .extraColumnTwo(DEFAULT_EXTRA_COLUMN_TWO) + .extraColumnThree(DEFAULT_EXTRA_COLUMN_THREE) + .extraColumnFour(DEFAULT_EXTRA_COLUMN_FOUR) + .extraColumnFive(DEFAULT_EXTRA_COLUMN_FIVE); + return collectionTracking; + } + + /** + * Create an updated entity for this test. + * + * This is a static method, as tests for other entities might also need it, + * if they test an entity which requires the current entity. + */ + public static CollectionTracking createUpdatedEntity(EntityManager em) { + CollectionTracking collectionTracking = new CollectionTracking() + .employeeID(UPDATED_EMPLOYEE_ID) + .unitID(UPDATED_UNIT_ID) + .employeeName(UPDATED_EMPLOYEE_NAME) + .businessProposal(UPDATED_BUSINESS_PROPOSAL) + .subProposal(UPDATED_SUB_PROPOSAL) + .mobileNo(UPDATED_MOBILE_NO) + .relationId(UPDATED_RELATION_ID) + .accountNo(UPDATED_ACCOUNT_NO) + .accountTitle(UPDATED_ACCOUNT_TITLE) + .noOfVisits(UPDATED_NO_OF_VISITS) + .osAmount(UPDATED_OS_AMOUNT) + .osProfit(UPDATED_OS_PROFIT) + .odDays(UPDATED_OD_DAYS) + .loanOfficer(UPDATED_LOAN_OFFICER) + .visitedBy(UPDATED_VISITED_BY) + .pptDate(UPDATED_PPT_DATE) + .remakrs(UPDATED_REMAKRS) + .extraColumnOne(UPDATED_EXTRA_COLUMN_ONE) + .extraColumnTwo(UPDATED_EXTRA_COLUMN_TWO) + .extraColumnThree(UPDATED_EXTRA_COLUMN_THREE) + .extraColumnFour(UPDATED_EXTRA_COLUMN_FOUR) + .extraColumnFive(UPDATED_EXTRA_COLUMN_FIVE); + return collectionTracking; + } + + @BeforeEach + public void initTest() { + collectionTracking = createEntity(em); + } + + @Test + @Transactional + public void createCollectionTracking() throws Exception { + int databaseSizeBeforeCreate = collectionTrackingRepository.findAll().size(); + // Create the CollectionTracking + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isCreated()); + + // Validate the CollectionTracking in the database + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeCreate + 1); + CollectionTracking testCollectionTracking = collectionTrackingList.get(collectionTrackingList.size() - 1); + assertThat(testCollectionTracking.getEmployeeID()).isEqualTo(DEFAULT_EMPLOYEE_ID); + assertThat(testCollectionTracking.getUnitID()).isEqualTo(DEFAULT_UNIT_ID); + assertThat(testCollectionTracking.getEmployeeName()).isEqualTo(DEFAULT_EMPLOYEE_NAME); + assertThat(testCollectionTracking.getBusinessProposal()).isEqualTo(DEFAULT_BUSINESS_PROPOSAL); + assertThat(testCollectionTracking.getSubProposal()).isEqualTo(DEFAULT_SUB_PROPOSAL); + assertThat(testCollectionTracking.getMobileNo()).isEqualTo(DEFAULT_MOBILE_NO); + assertThat(testCollectionTracking.getRelationId()).isEqualTo(DEFAULT_RELATION_ID); + assertThat(testCollectionTracking.getAccountNo()).isEqualTo(DEFAULT_ACCOUNT_NO); + assertThat(testCollectionTracking.getAccountTitle()).isEqualTo(DEFAULT_ACCOUNT_TITLE); + assertThat(testCollectionTracking.getNoOfVisits()).isEqualTo(DEFAULT_NO_OF_VISITS); + assertThat(testCollectionTracking.getOsAmount()).isEqualTo(DEFAULT_OS_AMOUNT); + assertThat(testCollectionTracking.getOsProfit()).isEqualTo(DEFAULT_OS_PROFIT); + assertThat(testCollectionTracking.getOdDays()).isEqualTo(DEFAULT_OD_DAYS); + assertThat(testCollectionTracking.getLoanOfficer()).isEqualTo(DEFAULT_LOAN_OFFICER); + assertThat(testCollectionTracking.getVisitedBy()).isEqualTo(DEFAULT_VISITED_BY); + assertThat(testCollectionTracking.getPptDate()).isEqualTo(DEFAULT_PPT_DATE); + assertThat(testCollectionTracking.getRemakrs()).isEqualTo(DEFAULT_REMAKRS); + assertThat(testCollectionTracking.getExtraColumnOne()).isEqualTo(DEFAULT_EXTRA_COLUMN_ONE); + assertThat(testCollectionTracking.getExtraColumnTwo()).isEqualTo(DEFAULT_EXTRA_COLUMN_TWO); + assertThat(testCollectionTracking.getExtraColumnThree()).isEqualTo(DEFAULT_EXTRA_COLUMN_THREE); + assertThat(testCollectionTracking.getExtraColumnFour()).isEqualTo(DEFAULT_EXTRA_COLUMN_FOUR); + assertThat(testCollectionTracking.getExtraColumnFive()).isEqualTo(DEFAULT_EXTRA_COLUMN_FIVE); + } + + @Test + @Transactional + public void createCollectionTrackingWithExistingId() throws Exception { + int databaseSizeBeforeCreate = collectionTrackingRepository.findAll().size(); + + // Create the CollectionTracking with an existing ID + collectionTracking.setId(1L); + + // An entity with an existing ID cannot be created, so this API call must fail + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + // Validate the CollectionTracking in the database + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeCreate); + } + + @Test + @Transactional + public void checkEmployeeIDIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setEmployeeID(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkUnitIDIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setUnitID(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkEmployeeNameIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setEmployeeName(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkBusinessProposalIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setBusinessProposal(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkSubProposalIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setSubProposal(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkMobileNoIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setMobileNo(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkRelationIdIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setRelationId(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkAccountNoIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setAccountNo(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkAccountTitleIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setAccountTitle(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkNoOfVisitsIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setNoOfVisits(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkOsAmountIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setOsAmount(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkOsProfitIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setOsProfit(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkOdDaysIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setOdDays(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkLoanOfficerIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setLoanOfficer(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkVisitedByIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setVisitedBy(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkPptDateIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setPptDate(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void checkRemakrsIsRequired() throws Exception { + int databaseSizeBeforeTest = collectionTrackingRepository.findAll().size(); + // set the field null + collectionTracking.setRemakrs(null); + + // Create the CollectionTracking, which fails. + + restCollectionTrackingMockMvc + .perform( + post("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeTest); + } + + @Test + @Transactional + public void getAllCollectionTrackings() throws Exception { + // Initialize the database + collectionTrackingRepository.saveAndFlush(collectionTracking); + + // Get all the collectionTrackingList + restCollectionTrackingMockMvc + .perform(get("/api/collection-trackings?sort=id,desc")) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) + .andExpect(jsonPath("$.[*].id").value(hasItem(collectionTracking.getId().intValue()))) + .andExpect(jsonPath("$.[*].employeeID").value(hasItem(DEFAULT_EMPLOYEE_ID))) + .andExpect(jsonPath("$.[*].unitID").value(hasItem(DEFAULT_UNIT_ID))) + .andExpect(jsonPath("$.[*].employeeName").value(hasItem(DEFAULT_EMPLOYEE_NAME))) + .andExpect(jsonPath("$.[*].businessProposal").value(hasItem(DEFAULT_BUSINESS_PROPOSAL))) + .andExpect(jsonPath("$.[*].subProposal").value(hasItem(DEFAULT_SUB_PROPOSAL))) + .andExpect(jsonPath("$.[*].mobileNo").value(hasItem(DEFAULT_MOBILE_NO))) + .andExpect(jsonPath("$.[*].relationId").value(hasItem(DEFAULT_RELATION_ID))) + .andExpect(jsonPath("$.[*].accountNo").value(hasItem(DEFAULT_ACCOUNT_NO))) + .andExpect(jsonPath("$.[*].accountTitle").value(hasItem(DEFAULT_ACCOUNT_TITLE))) + .andExpect(jsonPath("$.[*].noOfVisits").value(hasItem(DEFAULT_NO_OF_VISITS))) + .andExpect(jsonPath("$.[*].osAmount").value(hasItem(DEFAULT_OS_AMOUNT.intValue()))) + .andExpect(jsonPath("$.[*].osProfit").value(hasItem(DEFAULT_OS_PROFIT.intValue()))) + .andExpect(jsonPath("$.[*].odDays").value(hasItem(DEFAULT_OD_DAYS))) + .andExpect(jsonPath("$.[*].loanOfficer").value(hasItem(DEFAULT_LOAN_OFFICER))) + .andExpect(jsonPath("$.[*].visitedBy").value(hasItem(DEFAULT_VISITED_BY))) + .andExpect(jsonPath("$.[*].pptDate").value(hasItem(DEFAULT_PPT_DATE.toString()))) + .andExpect(jsonPath("$.[*].remakrs").value(hasItem(DEFAULT_REMAKRS))) + .andExpect(jsonPath("$.[*].extraColumnOne").value(hasItem(DEFAULT_EXTRA_COLUMN_ONE))) + .andExpect(jsonPath("$.[*].extraColumnTwo").value(hasItem(DEFAULT_EXTRA_COLUMN_TWO))) + .andExpect(jsonPath("$.[*].extraColumnThree").value(hasItem(DEFAULT_EXTRA_COLUMN_THREE))) + .andExpect(jsonPath("$.[*].extraColumnFour").value(hasItem(DEFAULT_EXTRA_COLUMN_FOUR))) + .andExpect(jsonPath("$.[*].extraColumnFive").value(hasItem(DEFAULT_EXTRA_COLUMN_FIVE))); + } + + @Test + @Transactional + public void getCollectionTracking() throws Exception { + // Initialize the database + collectionTrackingRepository.saveAndFlush(collectionTracking); + + // Get the collectionTracking + restCollectionTrackingMockMvc + .perform(get("/api/collection-trackings/{id}", collectionTracking.getId())) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) + .andExpect(jsonPath("$.id").value(collectionTracking.getId().intValue())) + .andExpect(jsonPath("$.employeeID").value(DEFAULT_EMPLOYEE_ID)) + .andExpect(jsonPath("$.unitID").value(DEFAULT_UNIT_ID)) + .andExpect(jsonPath("$.employeeName").value(DEFAULT_EMPLOYEE_NAME)) + .andExpect(jsonPath("$.businessProposal").value(DEFAULT_BUSINESS_PROPOSAL)) + .andExpect(jsonPath("$.subProposal").value(DEFAULT_SUB_PROPOSAL)) + .andExpect(jsonPath("$.mobileNo").value(DEFAULT_MOBILE_NO)) + .andExpect(jsonPath("$.relationId").value(DEFAULT_RELATION_ID)) + .andExpect(jsonPath("$.accountNo").value(DEFAULT_ACCOUNT_NO)) + .andExpect(jsonPath("$.accountTitle").value(DEFAULT_ACCOUNT_TITLE)) + .andExpect(jsonPath("$.noOfVisits").value(DEFAULT_NO_OF_VISITS)) + .andExpect(jsonPath("$.osAmount").value(DEFAULT_OS_AMOUNT.intValue())) + .andExpect(jsonPath("$.osProfit").value(DEFAULT_OS_PROFIT.intValue())) + .andExpect(jsonPath("$.odDays").value(DEFAULT_OD_DAYS)) + .andExpect(jsonPath("$.loanOfficer").value(DEFAULT_LOAN_OFFICER)) + .andExpect(jsonPath("$.visitedBy").value(DEFAULT_VISITED_BY)) + .andExpect(jsonPath("$.pptDate").value(DEFAULT_PPT_DATE.toString())) + .andExpect(jsonPath("$.remakrs").value(DEFAULT_REMAKRS)) + .andExpect(jsonPath("$.extraColumnOne").value(DEFAULT_EXTRA_COLUMN_ONE)) + .andExpect(jsonPath("$.extraColumnTwo").value(DEFAULT_EXTRA_COLUMN_TWO)) + .andExpect(jsonPath("$.extraColumnThree").value(DEFAULT_EXTRA_COLUMN_THREE)) + .andExpect(jsonPath("$.extraColumnFour").value(DEFAULT_EXTRA_COLUMN_FOUR)) + .andExpect(jsonPath("$.extraColumnFive").value(DEFAULT_EXTRA_COLUMN_FIVE)); + } + + @Test + @Transactional + public void getNonExistingCollectionTracking() throws Exception { + // Get the collectionTracking + restCollectionTrackingMockMvc.perform(get("/api/collection-trackings/{id}", Long.MAX_VALUE)).andExpect(status().isNotFound()); + } + + @Test + @Transactional + public void updateCollectionTracking() throws Exception { + // Initialize the database + collectionTrackingRepository.saveAndFlush(collectionTracking); + + int databaseSizeBeforeUpdate = collectionTrackingRepository.findAll().size(); + + // Update the collectionTracking + CollectionTracking updatedCollectionTracking = collectionTrackingRepository.findById(collectionTracking.getId()).get(); + // Disconnect from session so that the updates on updatedCollectionTracking are not directly saved in db + em.detach(updatedCollectionTracking); + updatedCollectionTracking + .employeeID(UPDATED_EMPLOYEE_ID) + .unitID(UPDATED_UNIT_ID) + .employeeName(UPDATED_EMPLOYEE_NAME) + .businessProposal(UPDATED_BUSINESS_PROPOSAL) + .subProposal(UPDATED_SUB_PROPOSAL) + .mobileNo(UPDATED_MOBILE_NO) + .relationId(UPDATED_RELATION_ID) + .accountNo(UPDATED_ACCOUNT_NO) + .accountTitle(UPDATED_ACCOUNT_TITLE) + .noOfVisits(UPDATED_NO_OF_VISITS) + .osAmount(UPDATED_OS_AMOUNT) + .osProfit(UPDATED_OS_PROFIT) + .odDays(UPDATED_OD_DAYS) + .loanOfficer(UPDATED_LOAN_OFFICER) + .visitedBy(UPDATED_VISITED_BY) + .pptDate(UPDATED_PPT_DATE) + .remakrs(UPDATED_REMAKRS) + .extraColumnOne(UPDATED_EXTRA_COLUMN_ONE) + .extraColumnTwo(UPDATED_EXTRA_COLUMN_TWO) + .extraColumnThree(UPDATED_EXTRA_COLUMN_THREE) + .extraColumnFour(UPDATED_EXTRA_COLUMN_FOUR) + .extraColumnFive(UPDATED_EXTRA_COLUMN_FIVE); + + restCollectionTrackingMockMvc + .perform( + put("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(updatedCollectionTracking)) + ) + .andExpect(status().isOk()); + + // Validate the CollectionTracking in the database + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeUpdate); + CollectionTracking testCollectionTracking = collectionTrackingList.get(collectionTrackingList.size() - 1); + assertThat(testCollectionTracking.getEmployeeID()).isEqualTo(UPDATED_EMPLOYEE_ID); + assertThat(testCollectionTracking.getUnitID()).isEqualTo(UPDATED_UNIT_ID); + assertThat(testCollectionTracking.getEmployeeName()).isEqualTo(UPDATED_EMPLOYEE_NAME); + assertThat(testCollectionTracking.getBusinessProposal()).isEqualTo(UPDATED_BUSINESS_PROPOSAL); + assertThat(testCollectionTracking.getSubProposal()).isEqualTo(UPDATED_SUB_PROPOSAL); + assertThat(testCollectionTracking.getMobileNo()).isEqualTo(UPDATED_MOBILE_NO); + assertThat(testCollectionTracking.getRelationId()).isEqualTo(UPDATED_RELATION_ID); + assertThat(testCollectionTracking.getAccountNo()).isEqualTo(UPDATED_ACCOUNT_NO); + assertThat(testCollectionTracking.getAccountTitle()).isEqualTo(UPDATED_ACCOUNT_TITLE); + assertThat(testCollectionTracking.getNoOfVisits()).isEqualTo(UPDATED_NO_OF_VISITS); + assertThat(testCollectionTracking.getOsAmount()).isEqualTo(UPDATED_OS_AMOUNT); + assertThat(testCollectionTracking.getOsProfit()).isEqualTo(UPDATED_OS_PROFIT); + assertThat(testCollectionTracking.getOdDays()).isEqualTo(UPDATED_OD_DAYS); + assertThat(testCollectionTracking.getLoanOfficer()).isEqualTo(UPDATED_LOAN_OFFICER); + assertThat(testCollectionTracking.getVisitedBy()).isEqualTo(UPDATED_VISITED_BY); + assertThat(testCollectionTracking.getPptDate()).isEqualTo(UPDATED_PPT_DATE); + assertThat(testCollectionTracking.getRemakrs()).isEqualTo(UPDATED_REMAKRS); + assertThat(testCollectionTracking.getExtraColumnOne()).isEqualTo(UPDATED_EXTRA_COLUMN_ONE); + assertThat(testCollectionTracking.getExtraColumnTwo()).isEqualTo(UPDATED_EXTRA_COLUMN_TWO); + assertThat(testCollectionTracking.getExtraColumnThree()).isEqualTo(UPDATED_EXTRA_COLUMN_THREE); + assertThat(testCollectionTracking.getExtraColumnFour()).isEqualTo(UPDATED_EXTRA_COLUMN_FOUR); + assertThat(testCollectionTracking.getExtraColumnFive()).isEqualTo(UPDATED_EXTRA_COLUMN_FIVE); + } + + @Test + @Transactional + public void updateNonExistingCollectionTracking() throws Exception { + int databaseSizeBeforeUpdate = collectionTrackingRepository.findAll().size(); + + // If the entity doesn't have an ID, it will throw BadRequestAlertException + restCollectionTrackingMockMvc + .perform( + put("/api/collection-trackings") + .contentType(MediaType.APPLICATION_JSON) + .content(TestUtil.convertObjectToJsonBytes(collectionTracking)) + ) + .andExpect(status().isBadRequest()); + + // Validate the CollectionTracking in the database + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeUpdate); + } + + @Test + @Transactional + public void deleteCollectionTracking() throws Exception { + // Initialize the database + collectionTrackingRepository.saveAndFlush(collectionTracking); + + int databaseSizeBeforeDelete = collectionTrackingRepository.findAll().size(); + + // Delete the collectionTracking + restCollectionTrackingMockMvc + .perform(delete("/api/collection-trackings/{id}", collectionTracking.getId()).accept(MediaType.APPLICATION_JSON)) + .andExpect(status().isNoContent()); + + // Validate the database contains one less item + List collectionTrackingList = collectionTrackingRepository.findAll(); + assertThat(collectionTrackingList).hasSize(databaseSizeBeforeDelete - 1); + } +} diff --git a/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-delete-dialog.component.spec.ts b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-delete-dialog.component.spec.ts new file mode 100644 index 0000000..56dc91c --- /dev/null +++ b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-delete-dialog.component.spec.ts @@ -0,0 +1,65 @@ +import { ComponentFixture, TestBed, inject, fakeAsync, tick } from '@angular/core/testing'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { of } from 'rxjs'; +import { JhiEventManager } from 'ng-jhipster'; + +import { CcwApplicationTestModule } from '../../../test.module'; +import { MockEventManager } from '../../../helpers/mock-event-manager.service'; +import { MockActiveModal } from '../../../helpers/mock-active-modal.service'; +import { CollectionTrackingDeleteDialogComponent } from 'app/entities/collection-tracking/collection-tracking-delete-dialog.component'; +import { CollectionTrackingService } from 'app/entities/collection-tracking/collection-tracking.service'; + +describe('Component Tests', () => { + describe('CollectionTracking Management Delete Component', () => { + let comp: CollectionTrackingDeleteDialogComponent; + let fixture: ComponentFixture; + let service: CollectionTrackingService; + let mockEventManager: MockEventManager; + let mockActiveModal: MockActiveModal; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [CcwApplicationTestModule], + declarations: [CollectionTrackingDeleteDialogComponent], + }) + .overrideTemplate(CollectionTrackingDeleteDialogComponent, '') + .compileComponents(); + fixture = TestBed.createComponent(CollectionTrackingDeleteDialogComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(CollectionTrackingService); + mockEventManager = TestBed.get(JhiEventManager); + mockActiveModal = TestBed.get(NgbActiveModal); + }); + + describe('confirmDelete', () => { + it('Should call delete service on confirmDelete', inject( + [], + fakeAsync(() => { + // GIVEN + spyOn(service, 'delete').and.returnValue(of({})); + + // WHEN + comp.confirmDelete(123); + tick(); + + // THEN + expect(service.delete).toHaveBeenCalledWith(123); + expect(mockActiveModal.closeSpy).toHaveBeenCalled(); + expect(mockEventManager.broadcastSpy).toHaveBeenCalled(); + }) + )); + + it('Should not call delete service on clear', () => { + // GIVEN + spyOn(service, 'delete'); + + // WHEN + comp.cancel(); + + // THEN + expect(service.delete).not.toHaveBeenCalled(); + expect(mockActiveModal.dismissSpy).toHaveBeenCalled(); + }); + }); + }); +}); diff --git a/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-detail.component.spec.ts b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-detail.component.spec.ts new file mode 100644 index 0000000..82a061a --- /dev/null +++ b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-detail.component.spec.ts @@ -0,0 +1,37 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { of } from 'rxjs'; + +import { CcwApplicationTestModule } from '../../../test.module'; +import { CollectionTrackingDetailComponent } from 'app/entities/collection-tracking/collection-tracking-detail.component'; +import { CollectionTracking } from 'app/shared/model/collection-tracking.model'; + +describe('Component Tests', () => { + describe('CollectionTracking Management Detail Component', () => { + let comp: CollectionTrackingDetailComponent; + let fixture: ComponentFixture; + const route = ({ data: of({ collectionTracking: new CollectionTracking(123) }) } as any) as ActivatedRoute; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [CcwApplicationTestModule], + declarations: [CollectionTrackingDetailComponent], + providers: [{ provide: ActivatedRoute, useValue: route }], + }) + .overrideTemplate(CollectionTrackingDetailComponent, '') + .compileComponents(); + fixture = TestBed.createComponent(CollectionTrackingDetailComponent); + comp = fixture.componentInstance; + }); + + describe('OnInit', () => { + it('Should load collectionTracking on init', () => { + // WHEN + comp.ngOnInit(); + + // THEN + expect(comp.collectionTracking).toEqual(jasmine.objectContaining({ id: 123 })); + }); + }); + }); +}); diff --git a/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-update.component.spec.ts b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-update.component.spec.ts new file mode 100644 index 0000000..61f4030 --- /dev/null +++ b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking-update.component.spec.ts @@ -0,0 +1,61 @@ +import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing'; +import { HttpResponse } from '@angular/common/http'; +import { FormBuilder } from '@angular/forms'; +import { of } from 'rxjs'; + +import { CcwApplicationTestModule } from '../../../test.module'; +import { CollectionTrackingUpdateComponent } from 'app/entities/collection-tracking/collection-tracking-update.component'; +import { CollectionTrackingService } from 'app/entities/collection-tracking/collection-tracking.service'; +import { CollectionTracking } from 'app/shared/model/collection-tracking.model'; + +describe('Component Tests', () => { + describe('CollectionTracking Management Update Component', () => { + let comp: CollectionTrackingUpdateComponent; + let fixture: ComponentFixture; + let service: CollectionTrackingService; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [CcwApplicationTestModule], + declarations: [CollectionTrackingUpdateComponent], + providers: [FormBuilder], + }) + .overrideTemplate(CollectionTrackingUpdateComponent, '') + .compileComponents(); + + fixture = TestBed.createComponent(CollectionTrackingUpdateComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(CollectionTrackingService); + }); + + describe('save', () => { + it('Should call update service on save for existing entity', fakeAsync(() => { + // GIVEN + const entity = new CollectionTracking(123); + spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity }))); + comp.updateForm(entity); + // WHEN + comp.save(); + tick(); // simulate async + + // THEN + expect(service.update).toHaveBeenCalledWith(entity); + expect(comp.isSaving).toEqual(false); + })); + + it('Should call create service on save for new entity', fakeAsync(() => { + // GIVEN + const entity = new CollectionTracking(); + spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity }))); + comp.updateForm(entity); + // WHEN + comp.save(); + tick(); // simulate async + + // THEN + expect(service.create).toHaveBeenCalledWith(entity); + expect(comp.isSaving).toEqual(false); + })); + }); + }); +}); diff --git a/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking.component.spec.ts b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking.component.spec.ts new file mode 100644 index 0000000..18105e2 --- /dev/null +++ b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking.component.spec.ts @@ -0,0 +1,49 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { of } from 'rxjs'; +import { HttpHeaders, HttpResponse } from '@angular/common/http'; + +import { CcwApplicationTestModule } from '../../../test.module'; +import { CollectionTrackingComponent } from 'app/entities/collection-tracking/collection-tracking.component'; +import { CollectionTrackingService } from 'app/entities/collection-tracking/collection-tracking.service'; +import { CollectionTracking } from 'app/shared/model/collection-tracking.model'; + +describe('Component Tests', () => { + describe('CollectionTracking Management Component', () => { + let comp: CollectionTrackingComponent; + let fixture: ComponentFixture; + let service: CollectionTrackingService; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [CcwApplicationTestModule], + declarations: [CollectionTrackingComponent], + }) + .overrideTemplate(CollectionTrackingComponent, '') + .compileComponents(); + + fixture = TestBed.createComponent(CollectionTrackingComponent); + comp = fixture.componentInstance; + service = fixture.debugElement.injector.get(CollectionTrackingService); + }); + + it('Should call load all on init', () => { + // GIVEN + const headers = new HttpHeaders().append('link', 'link;link'); + spyOn(service, 'query').and.returnValue( + of( + new HttpResponse({ + body: [new CollectionTracking(123)], + headers, + }) + ) + ); + + // WHEN + comp.ngOnInit(); + + // THEN + expect(service.query).toHaveBeenCalled(); + expect(comp.collectionTrackings && comp.collectionTrackings[0]).toEqual(jasmine.objectContaining({ id: 123 })); + }); + }); +}); diff --git a/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking.service.spec.ts b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking.service.spec.ts new file mode 100644 index 0000000..300d242 --- /dev/null +++ b/src/test/javascript/spec/app/entities/collection-tracking/collection-tracking.service.spec.ts @@ -0,0 +1,193 @@ +import { TestBed, getTestBed } from '@angular/core/testing'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import * as moment from 'moment'; +import { DATE_FORMAT } from 'app/shared/constants/input.constants'; +import { CollectionTrackingService } from 'app/entities/collection-tracking/collection-tracking.service'; +import { ICollectionTracking, CollectionTracking } from 'app/shared/model/collection-tracking.model'; + +describe('Service Tests', () => { + describe('CollectionTracking Service', () => { + let injector: TestBed; + let service: CollectionTrackingService; + let httpMock: HttpTestingController; + let elemDefault: ICollectionTracking; + let expectedResult: ICollectionTracking | ICollectionTracking[] | boolean | null; + let currentDate: moment.Moment; + + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + }); + expectedResult = null; + injector = getTestBed(); + service = injector.get(CollectionTrackingService); + httpMock = injector.get(HttpTestingController); + currentDate = moment(); + + elemDefault = new CollectionTracking( + 0, + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 0, + 0, + 0, + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + currentDate, + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA', + 'AAAAAAA' + ); + }); + + describe('Service methods', () => { + it('should find an element', () => { + const returnedFromService = Object.assign( + { + pptDate: currentDate.format(DATE_FORMAT), + }, + elemDefault + ); + + service.find(123).subscribe(resp => (expectedResult = resp.body)); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush(returnedFromService); + expect(expectedResult).toMatchObject(elemDefault); + }); + + it('should create a CollectionTracking', () => { + const returnedFromService = Object.assign( + { + id: 0, + pptDate: currentDate.format(DATE_FORMAT), + }, + elemDefault + ); + + const expected = Object.assign( + { + pptDate: currentDate, + }, + returnedFromService + ); + + service.create(new CollectionTracking()).subscribe(resp => (expectedResult = resp.body)); + + const req = httpMock.expectOne({ method: 'POST' }); + req.flush(returnedFromService); + expect(expectedResult).toMatchObject(expected); + }); + + it('should update a CollectionTracking', () => { + const returnedFromService = Object.assign( + { + employeeID: 'BBBBBB', + unitID: 'BBBBBB', + employeeName: 'BBBBBB', + businessProposal: 'BBBBBB', + subProposal: 'BBBBBB', + mobileNo: 'BBBBBB', + relationId: 'BBBBBB', + accountNo: 'BBBBBB', + accountTitle: 'BBBBBB', + noOfVisits: 1, + osAmount: 1, + osProfit: 1, + odDays: 'BBBBBB', + loanOfficer: 'BBBBBB', + visitedBy: 'BBBBBB', + pptDate: currentDate.format(DATE_FORMAT), + remakrs: 'BBBBBB', + extraColumnOne: 'BBBBBB', + extraColumnTwo: 'BBBBBB', + extraColumnThree: 'BBBBBB', + extraColumnFour: 'BBBBBB', + extraColumnFive: 'BBBBBB', + }, + elemDefault + ); + + const expected = Object.assign( + { + pptDate: currentDate, + }, + returnedFromService + ); + + service.update(expected).subscribe(resp => (expectedResult = resp.body)); + + const req = httpMock.expectOne({ method: 'PUT' }); + req.flush(returnedFromService); + expect(expectedResult).toMatchObject(expected); + }); + + it('should return a list of CollectionTracking', () => { + const returnedFromService = Object.assign( + { + employeeID: 'BBBBBB', + unitID: 'BBBBBB', + employeeName: 'BBBBBB', + businessProposal: 'BBBBBB', + subProposal: 'BBBBBB', + mobileNo: 'BBBBBB', + relationId: 'BBBBBB', + accountNo: 'BBBBBB', + accountTitle: 'BBBBBB', + noOfVisits: 1, + osAmount: 1, + osProfit: 1, + odDays: 'BBBBBB', + loanOfficer: 'BBBBBB', + visitedBy: 'BBBBBB', + pptDate: currentDate.format(DATE_FORMAT), + remakrs: 'BBBBBB', + extraColumnOne: 'BBBBBB', + extraColumnTwo: 'BBBBBB', + extraColumnThree: 'BBBBBB', + extraColumnFour: 'BBBBBB', + extraColumnFive: 'BBBBBB', + }, + elemDefault + ); + + const expected = Object.assign( + { + pptDate: currentDate, + }, + returnedFromService + ); + + service.query().subscribe(resp => (expectedResult = resp.body)); + + const req = httpMock.expectOne({ method: 'GET' }); + req.flush([returnedFromService]); + httpMock.verify(); + expect(expectedResult).toContainEqual(expected); + }); + + it('should delete a CollectionTracking', () => { + service.delete(123).subscribe(resp => (expectedResult = resp.ok)); + + const req = httpMock.expectOne({ method: 'DELETE' }); + req.flush({ status: 200 }); + expect(expectedResult); + }); + }); + + afterEach(() => { + httpMock.verify(); + }); + }); +}); diff --git a/src/test/resources/i18n/messages_fr.properties b/src/test/resources/i18n/messages_fr.properties new file mode 100644 index 0000000..2971be6 --- /dev/null +++ b/src/test/resources/i18n/messages_fr.properties @@ -0,0 +1 @@ +email.test.title=Activation de votre compte CCWApplication diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 8912ee6..4c33303 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -88,7 +88,8 @@ module.exports = (options) => ({ new MergeJsonWebpackPlugin({ output: { groupBy: [ - { pattern: "./src/main/webapp/i18n/en/*.json", fileName: "./i18n/en.json" } + { pattern: "./src/main/webapp/i18n/en/*.json", fileName: "./i18n/en.json" }, + { pattern: "./src/main/webapp/i18n/fr/*.json", fileName: "./i18n/fr.json" } // jhipster-needle-i18n-language-webpack - JHipster will add/remove languages in this array ] } diff --git a/webpack/webpack.prod.js b/webpack/webpack.prod.js index 16cdbc8..18c7b2b 100644 --- a/webpack/webpack.prod.js +++ b/webpack/webpack.prod.js @@ -124,7 +124,8 @@ module.exports = webpackMerge(commonConfig({ env: ENV }), { }), new MomentLocalesPlugin({ localesToKeep: [ - 'en' + 'en', + 'fr' // jhipster-needle-i18n-language-moment-webpack - JHipster will add/remove languages in this array ] }),