Skip to content

Commit

Permalink
Refactoring for multimodal multicampaign
Browse files Browse the repository at this point in the history
  • Loading branch information
kazhamiakin committed Aug 21, 2023
1 parent 304a40a commit cf1d48c
Show file tree
Hide file tree
Showing 43 changed files with 18,856 additions and 744 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ public class AppConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("*");
registry.addMapping("/**")
.allowedMethods("*")
.allowedOrigins("*")
.allowedHeaders("*");
}

@Bean(name = "messageSource")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ public class Campaign {
private String title;
private String description;
private String logo;

@NotEmpty
private String application;
private String territoryId;


@NotNull
private LocalDate from;
Expand All @@ -59,6 +58,7 @@ public class Campaign {

private VirtualScore virtualScore;


/**
* @return the id
*/
Expand Down Expand Up @@ -131,18 +131,6 @@ public List<String> getMeans() {
public void setMeans(List<String> means) {
this.means = means;
}
/**
* @return the application
*/
public String getApplication() {
return application;
}
/**
* @param application the application to set
*/
public void setApplication(String application) {
this.application = application;
}
/**
* @return the description
*/
Expand Down Expand Up @@ -191,6 +179,13 @@ public String getPrivacy() {
public void setPrivacy(String privacy) {
this.privacy = privacy;
}

public String getTerritoryId() {
return territoryId;
}
public void setTerritoryId(String territoryId) {
this.territoryId = territoryId;
}

// /**
// * @return the limits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public class Company {
private String web;
private String contactEmail;
private String contactPhone;


private String territoryId;
private Boolean state;

private List<CompanyLocation> locations = new LinkedList<>();

private List<String> enabledApps = new LinkedList<>();
private List<String> campaigns = new LinkedList<>();

/**
Expand Down Expand Up @@ -147,18 +149,6 @@ public List<CompanyLocation> getLocations() {
public void setLocations(List<CompanyLocation> locations) {
this.locations = locations;
}
/**
* @return the enabledApps
*/
public List<String> getEnabledApps() {
return enabledApps;
}
/**
* @param enabledApps the enabledApps to set
*/
public void setEnabledApps(List<String> enabledApps) {
this.enabledApps = enabledApps;
}
/**
* @return the campaigns
*/
Expand Down Expand Up @@ -255,5 +245,17 @@ public String getCountry() {
public void setCountry(String country) {
this.country = country;
}
public String getTerritoryId() {
return territoryId;
}
public void setTerritoryId(String territoryId) {
this.territoryId = territoryId;
}
public Boolean getState() {
return state;
}
public void setState(Boolean state) {
this.state = state;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

package it.smartcommunitylab.pgazienda.domain;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.springframework.data.annotation.Id;

Expand All @@ -34,6 +36,8 @@ public class Employee {
private String location;
private List<String> campaigns;

private Map<String, TrackingRecord> trackingRecord = new HashMap<>();

/**
* @return the id
*/
Expand Down Expand Up @@ -146,4 +150,44 @@ public String getLocation() {
public void setLocation(String location) {
this.location = location;
}

public Map<String, TrackingRecord> getTrackingRecord() {
return trackingRecord;
}

public void setTrackingRecord(Map<String, TrackingRecord> trackingRecord) {
this.trackingRecord = trackingRecord;
}



public static class TrackingRecord {

public Long getRegistration() {
return registration;
}

public void setRegistration(Long registration) {
this.registration = registration;
}

public Long getLeave() {
return leave;
}

public void setLeave(Long leave) {
this.leave = leave;
}

public Long getTracking() {
return tracking;
}

public void setTracking(Long tracking) {
this.tracking = tracking;
}

public Long registration, leave, tracking;

}
}
105 changes: 0 additions & 105 deletions backend/src/main/java/it/smartcommunitylab/pgazienda/domain/PGApp.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package it.smartcommunitylab.pgazienda.domain;

import java.util.HashMap;
import java.util.Map;

public class Territory {

private String territoryId;
private Map<String, String> name = new HashMap<>();
private Map<String, String> description = new HashMap<>();
private String timezone;

private Map<String, Object> territoryData = new HashMap<>();

public String getTerritoryId() {
return territoryId;
}

public void setTerritoryId(String territoryId) {
this.territoryId = territoryId;
}

public Map<String, String> getName() {
return name;
}

public void setName(Map<String, String> name) {
this.name = name;
}

public Map<String, String> getDescription() {
return description;
}

public void setDescription(Map<String, String> description) {
this.description = description;
}

public String getTimezone() {
return timezone;
}

public void setTimezone(String timezone) {
this.timezone = timezone;
}

public Map<String, Object> getTerritoryData() {
return territoryData;
}

public void setTerritoryData(Map<String, Object> territoryData) {
this.territoryData = territoryData;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@

import it.smartcommunitylab.pgazienda.domain.Campaign;
import it.smartcommunitylab.pgazienda.domain.Company;
import it.smartcommunitylab.pgazienda.domain.PGApp;
import it.smartcommunitylab.pgazienda.domain.Territory;

/**
* @author raman
*
*/
public class DataModelDTO {

private List<PGApp> apps = new LinkedList<>();
private List<Territory> territories = new LinkedList<>();
private List<Company> companies = new LinkedList<>();
private List<Campaign> campaigns = new LinkedList<>();
private List<UserDTO> companyUsers = new LinkedList<>();
/**
* @return the apps
* @return the territories
*/
public List<PGApp> getApps() {
return apps;
public List<Territory> getTerritories() {
return territories;
}
/**
* @param apps the apps to set
* @param territories the territories to set
*/
public void setApps(List<PGApp> apps) {
this.apps = apps;
public void setTerritories(List<Territory> territories) {
this.territories = territories;
}
/**
* @return the companies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ public interface CampaignRepository extends MongoRepository<Campaign, String> {
@Query("{id: {$in: ?0}}")
public List<Campaign> findByIdIn(Collection<String> ids);

public List<Campaign> findByApplication(String app);
}
Loading

0 comments on commit cf1d48c

Please sign in to comment.