chore: copy kept Tastefully modules and portals into Co-Lite
Backend modules from tastefully 8bd93d15: core-libs, core-session, api-gateway, mobile-api, services-auth, services-system, services-counter, services-member, services-log, services-email. solvway-admin-portal from babyboo f64d096ea, solvway-customer-portal from tastefully 8bd93d15. Copied as tracked files only. Literal secrets replaced with environment placeholders: - services-email: SMTP_PASSWORD, MAILGUN_API_KEY, SENDGRID_API_KEY, MAILJET_API_KEY, MAILJET_SECRET_KEY (optional, empty default) - services-system: JUMIO_TOKEN, JUMIO_SECRET (optional) - services-auth: USER_AUTH_API_SECRET (required); commented JWT secret removed - core-libs: JWT_TOKEN default removed (required), XXL_JOB_TOKEN default removed, ipgeolocation key read from IPGEOLOCATION_API_KEY - services-system EkycAppConfig: commented Jumio credentials removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
e396568cc3
commit
5ee51d1913
2918 files changed
+302373
-3
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
package com.solvway.services.counter;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.retry.annotation.EnableRetry;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"com.solvway"})
|
||||
@EnableRetry
|
||||
@EnableCaching
|
||||
public class SolvwayServicesCounterApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SolvwayServicesCounterApplication.class, args);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.solvway.services.counter.configuration;
|
||||
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class Config {
|
||||
@Bean
|
||||
public ModelMapper modelMapper() {
|
||||
return new ModelMapper();
|
||||
}
|
||||
@Bean
|
||||
public Gson gson() {
|
||||
return new Gson();
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.solvway.services.counter.configuration;
|
||||
|
||||
import com.solvway.services.counter.service.OrderService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
import org.springframework.boot.actuate.health.HealthIndicator;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* Reference to https://www.amitph.com/custom-health-check-spring-boot-actuator/#Add_Custom_Heath_Checks
|
||||
* */
|
||||
|
||||
@Component
|
||||
public class DatabaseHealthIndicator implements HealthIndicator{
|
||||
private static final Logger log = LoggerFactory.getLogger(DatabaseHealthIndicator.class);
|
||||
private final String key1 = "MySQL";
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
@Override
|
||||
public Health health() {
|
||||
try {
|
||||
InetAddress ip = null;
|
||||
String hostname = "";
|
||||
try {
|
||||
ip = InetAddress.getLocalHost();
|
||||
hostname = ip.getHostName();
|
||||
//log.info("Health Check (IP:"+ip+";Hostname:"+hostname+")");
|
||||
// System.out.println("Your current IP address : " + ip);
|
||||
// System.out.println("Your current Hostname : " + hostname);
|
||||
|
||||
} catch (UnknownHostException uhe) {
|
||||
|
||||
}
|
||||
// Optional<Orders> scan = orderService.findById(1L);
|
||||
// if(scan.isPresent()) {
|
||||
// Long id= scan.get().getId();
|
||||
// }else {
|
||||
// throw new Exception("No data available");
|
||||
// }
|
||||
}catch(Exception e) {
|
||||
InetAddress ip = null;
|
||||
String hostname = "";
|
||||
try {
|
||||
ip = InetAddress.getLocalHost();
|
||||
hostname = ip.getHostName();
|
||||
log.info("Failed to retrieve data from database. (IP:{};Hostname:{})", ip, hostname);
|
||||
// System.out.println("Your current IP address : " + ip);
|
||||
// System.out.println("Your current Hostname : " + hostname);
|
||||
|
||||
} catch (UnknownHostException uhe) {
|
||||
|
||||
}
|
||||
|
||||
Map<String, Object> map= new HashMap<>();
|
||||
map.put(key1, "Not Available");
|
||||
map.put("Error", e.getMessage());
|
||||
return Health.down()
|
||||
.withDetails(map)
|
||||
.build();
|
||||
}
|
||||
return Health.up().withDetail(key1, "Available").build();
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.solvway.services.counter.configuration;
|
||||
|
||||
import com.solvway.services.counter.util.paging.PageableRest;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public interface JpaRepositoryCustom<T> {
|
||||
Page<T> findByPropertyAndPageable(HashMap<String, String> property, PageableRest pageableRest);
|
||||
}
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
//package com.solvway.services.counter.configuration;
|
||||
//
|
||||
//import java.util.concurrent.TimeUnit;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
//
|
||||
//import com.mongodb.ConnectionString;
|
||||
//import com.mongodb.MongoClientSettings;
|
||||
//import com.mongodb.MongoCredential;
|
||||
//import com.mongodb.client.MongoClient;
|
||||
//import com.mongodb.client.MongoClients;
|
||||
//
|
||||
//@Configuration
|
||||
//public class MongoConfig {
|
||||
//
|
||||
// @Value("${spring.data.mongodb.host}")
|
||||
// private String host;
|
||||
//
|
||||
// @Value("${spring.data.mongodb.port}")
|
||||
// private int port;
|
||||
//
|
||||
// @Value("${spring.data.mongodb.authentication-database}")
|
||||
// private String authenticateDatabase;
|
||||
//
|
||||
// @Value("${spring.data.mongodb.username}")
|
||||
// private String username;
|
||||
//
|
||||
// @Value("${spring.data.mongodb.password}")
|
||||
// private String password;
|
||||
//
|
||||
// @Value("${spring.data.mongodb.database}")
|
||||
// private String database;
|
||||
//
|
||||
// @Bean
|
||||
// public MongoClient mongoClient() {
|
||||
// char[] pwd = password.toCharArray();
|
||||
// MongoCredential credential = MongoCredential.createCredential(username, authenticateDatabase, pwd);
|
||||
// ConnectionString connectionString = new ConnectionString("mongodb://"+host);
|
||||
// MongoClientSettings settings = MongoClientSettings.builder()
|
||||
// .credential(credential)
|
||||
// .applyConnectionString(connectionString)
|
||||
// .applyToConnectionPoolSettings(builder-> builder.maxConnectionIdleTime(25, TimeUnit.MINUTES))
|
||||
//// .applyToClusterSettings(builder -> builder.requiredClusterType(ClusterType.REPLICA_SET))
|
||||
//// .applyToConnectionPoolSettings(builder-> builder.maxConnectionIdleTime(30, TimeUnit.DAYS).maxConnectionLifeTime(30, TimeUnit.DAYS).maxWaitTime(30, TimeUnit.DAYS))
|
||||
//// .applyToSocketSettings(builder -> builder.connectTimeout(7, TimeUnit.DAYS))
|
||||
//// .retryWrites(true)
|
||||
//// .writeConcern(WriteConcern.ACKNOWLEDGED)
|
||||
// .build();
|
||||
// MongoClient mongoClient = MongoClients.create(settings);
|
||||
// return mongoClient;
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// public MongoTemplate mongoTemplate() {
|
||||
// return new MongoTemplate(mongoClient(), database);
|
||||
// }
|
||||
//
|
||||
//// @Bean
|
||||
//// public MongoDbFactory mongoDbFactory() {
|
||||
//// MongoDbFactory factory = new SimpleMongoDbFactory(mongoClient(), getDatabaseName());
|
||||
//// return factory;
|
||||
//// }
|
||||
//// @Bean
|
||||
//// public MongoTemplate mongoTemplate() {
|
||||
//// MongoCredential mongoCredential = MongoCredential.createCredential("user", "database","password".toCharArray());
|
||||
//// ServerAddress address = new ServerAddress("mymongo.mycompany.com", 62797);
|
||||
//// MongoClient mongoClient = new MongoClient(address, Arrays.asList(mongoCredential));
|
||||
//// MongoTemplate mongoTemplate = new MongoTemplate(mongoClient(), "database");
|
||||
//// }
|
||||
//
|
||||
//// @Bean
|
||||
//// public MongoClient mongoClient() {
|
||||
//// List<ServerAddress> saList = new ArrayList<>();
|
||||
//// saList.add(new ServerAddress(host, port));
|
||||
////
|
||||
//// char[] pwd = password.toCharArray();
|
||||
//// MongoCredential credential = MongoCredential.createCredential(username, authenticateDatabase, pwd);
|
||||
////
|
||||
//// //set sslEnabled to true here
|
||||
//// MongoClientOptions options = MongoClientOptions.builder()
|
||||
//// .readPreference(ReadPreference.primaryPreferred())
|
||||
//// .retryWrites(true)
|
||||
//// .maxConnectionIdleTime(0)
|
||||
//// .maxConnectionLifeTime(0)
|
||||
//// .serverSelectionTimeout(100000)
|
||||
//// .socketKeepAlive(true)
|
||||
//// .build();
|
||||
////
|
||||
//// MongoClient mongoClient = new MongoClient(saList, credential, options);
|
||||
//// return mongoClient;
|
||||
//// }
|
||||
//
|
||||
//
|
||||
////
|
||||
//// public @Bean MongoClientFactoryBean mongoDbFactory() throws Exception {
|
||||
//// MongoClientFactoryBean clientFactoryBean = new MongoClientFactoryBean();
|
||||
//// clientFactoryBean.setHost(host);
|
||||
//// clientFactoryBean.setPort(Integer.parseInt(port));
|
||||
//// MongoCredential credential = MongoCredential.createScramSha1Credential(username, authenticateDatabase,
|
||||
//// password.toCharArray());
|
||||
//// clientFactoryBean.setCredential(new MongoCredential[] { credential });
|
||||
//// return clientFactoryBean;
|
||||
//// }
|
||||
////
|
||||
////
|
||||
//// public @Bean MongoTemplate mongoTemplate() throws Exception {
|
||||
//// List<ServerAddress> lstServer = new ArrayList<ServerAddress>();
|
||||
//// lstServer.add(new ServerAddress(host, Integer.parseInt(port)));
|
||||
//// MongoClient mongo = new MongoClient(lstServer,
|
||||
//// MongoCredential.createScramSha1Credential(username, authenticateDatabase, password.toCharArray()),
|
||||
//// MongoClientOptions.builder().retryWrites(true).writeConcern(WriteConcern.ACKNOWLEDGED).build());
|
||||
//// MongoDbFactory mongoDbFactory =new SimpleMongoDbFactory(mongo, database);
|
||||
////
|
||||
//// MongoMappingContext mappingContext = new MongoMappingContext();
|
||||
//// DbRefResolver dbRefResolver = new DefaultDbRefResolver(mongoDbFactory);
|
||||
//// MappingMongoConverter mongoConverter = new MappingMongoConverter(dbRefResolver, mappingContext);
|
||||
//// mongoConverter.afterPropertiesSet();
|
||||
//// MongoTemplate mongoTemplate = new MongoTemplate(mongoDbFactory, mongoConverter);
|
||||
//// return mongoTemplate;
|
||||
////
|
||||
//// }
|
||||
////// @Bean
|
||||
////// public MongoCustomConversions customConversions() {
|
||||
////// List<Converter<?, ?>> converterList = new ArrayList<Converter<?, ?>>();
|
||||
////// converterList.add(new MongoLocalDateTimeFromStringConverter());
|
||||
////// converterList.add(new MongoLocalDateFromStringConverter());
|
||||
////// return new MongoCustomConversions(converterList);
|
||||
////// }
|
||||
//////
|
||||
////// private static final class MongoLocalDateTimeFromStringConverter implements Converter<String, LocalDateTime> {
|
||||
////// @Override
|
||||
////// public LocalDateTime convert(String source) {
|
||||
////// return source == null ? null : LocalDateTime.parse(source);
|
||||
////// }
|
||||
////// }
|
||||
////// private static final class MongoLocalDateFromStringConverter implements Converter<String, LocalDate> {
|
||||
////// @Override
|
||||
////// public LocalDate convert(String source) {
|
||||
////// return source == null ? null : LocalDate.parse(source);
|
||||
////// }
|
||||
////// }
|
||||
//}
|
||||
+465
@@ -0,0 +1,465 @@
|
||||
package com.solvway.services.counter.configuration;
|
||||
|
||||
import com.google.cloud.pubsub.v1.SubscriptionAdminClient;
|
||||
import com.google.cloud.spring.pubsub.PubSubAdmin;
|
||||
import com.google.cloud.spring.pubsub.core.PubSubTemplate;
|
||||
import com.google.cloud.spring.pubsub.integration.AckMode;
|
||||
import com.google.cloud.spring.pubsub.integration.inbound.PubSubInboundChannelAdapter;
|
||||
import com.google.pubsub.v1.ExpirationPolicy;
|
||||
import com.google.pubsub.v1.Subscription;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.integration.channel.DirectChannel;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Configuration
|
||||
public class PubSubConfig {
|
||||
|
||||
@Autowired
|
||||
private PubSubAdmin pubSubAdmin;
|
||||
|
||||
@Autowired
|
||||
private SubscriptionAdminClient subscriptionAdminClient;
|
||||
|
||||
@Value("${spring.cloud.gcp.project-id}")
|
||||
public String projectId;
|
||||
|
||||
@Value("${pubsub.generate-order-doc.topic}")
|
||||
public String generateOrderDocTopic;
|
||||
|
||||
@Value("${pubsub.generate-order-doc.subscription}")
|
||||
public String generateOrderDocSubscription;
|
||||
|
||||
@Value("${pubsub.order-paid.topic}")
|
||||
public String orderPaidTopic;
|
||||
|
||||
@Value("${pubsub.order-paid.subscription}")
|
||||
public String orderPaidSubscription;
|
||||
|
||||
@Value("${pubsub.new-reg-order.topic}")
|
||||
public String newRegOrderTopic;
|
||||
|
||||
@Value("${pubsub.new-reg-order.subscription}")
|
||||
public String newRegOrderSubscription;
|
||||
|
||||
@Value("${pubsub.new-member.topic}")
|
||||
public String newMemberTopic;
|
||||
|
||||
@Value("${pubsub.new-member.subscription}")
|
||||
public String newMemberSubscription;
|
||||
|
||||
@Value("${pubsub.new-member-add-user.topic}")
|
||||
public String newMemberAddUserTopic;
|
||||
|
||||
@Value("${pubsub.new-member-add-user.subscription}")
|
||||
public String newMemberAddUserSubscription;
|
||||
|
||||
@Value("${pubsub.generate-credit-note-doc.topic}")
|
||||
public String generateCreditNoteDocTopic;
|
||||
|
||||
@Value("${pubsub.generate-credit-note-doc.subscription}")
|
||||
public String generateCreditNoteDocSubscription;
|
||||
|
||||
@Value("${pubsub.extend-member-expiry.topic}")
|
||||
public String extendMemberExpiryTopic;
|
||||
|
||||
@Value("${pubsub.extend-member-expiry.subscription}")
|
||||
public String extendMemberExpirySubscription;
|
||||
|
||||
@Value("${pubsub.voucher-update-invoice.topic}")
|
||||
public String voucherUpdateInvoiceTopic;
|
||||
|
||||
@Value("${pubsub.voucher-update-invoice.subscription}")
|
||||
public String voucherUpdateInvoiceSubscription;
|
||||
|
||||
@Value("${pubsub.wallet-update-invoice.topic}")
|
||||
public String walletUpdateInvoiceTopic;
|
||||
|
||||
|
||||
@Value("${pubsub.save-sales-submission-trxn.topic}")
|
||||
public String saveSalesSubmissionTrxnTopic;
|
||||
|
||||
@Value("${pubsub.save-consignment-trxn.topic}")
|
||||
public String saveConsignmentTrxnTopic;
|
||||
|
||||
@Value("${pubsub.transfer-member-migrate-sales.topic}")
|
||||
public String transferMemberMigrateSalesTopic;
|
||||
|
||||
@Value("${pubsub.transfer-member-migrate-sales.subscription}")
|
||||
public String transferMemberMigrateSalesSubscription;
|
||||
|
||||
@Value("${pubsub.update-stockist-sales-inventory.topic}")
|
||||
public String updateStockistSalesInventoryTopic;
|
||||
|
||||
@Value("${pubsub.inventory-remark-update.topic}")
|
||||
public String inventoryRemarkUpdateTopic;
|
||||
|
||||
@Value("${pubsub.create-merchant-sales.topic}")
|
||||
public String createMerchantSalesTopic;
|
||||
|
||||
@Value("${pubsub.create-merchant-sales.subscription}")
|
||||
public String createMerchantSalesSubscription;
|
||||
|
||||
@Value("${pubsub.activate-member.topic}")
|
||||
public String activateMemberTopic;
|
||||
|
||||
@Value("${pubsub.update-promotion-code.topic}")
|
||||
public String updatePromotionCodeTopic;
|
||||
|
||||
@Value("${pubsub.update-promotion-code.subscription}")
|
||||
public String updatePromotionCodeSubscription;
|
||||
@Value("${pubsub.event-attendance.topic}")
|
||||
public String eventAttendanceTopic;
|
||||
|
||||
@Value("${pubsub.event-attendance.subscription}")
|
||||
public String eventAttendanceSubscription;
|
||||
@PostConstruct
|
||||
public void newTopic() {
|
||||
if(pubSubAdmin.getTopic(generateOrderDocTopic)==null) {
|
||||
pubSubAdmin.createTopic(generateOrderDocTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(orderPaidTopic)==null) {
|
||||
pubSubAdmin.createTopic(orderPaidTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(newRegOrderTopic)==null) {
|
||||
pubSubAdmin.createTopic(newRegOrderTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(newMemberTopic)==null) {
|
||||
pubSubAdmin.createTopic(newMemberTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(newMemberAddUserTopic)==null) {
|
||||
pubSubAdmin.createTopic(newMemberAddUserTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(generateCreditNoteDocTopic)==null) {
|
||||
pubSubAdmin.createTopic(generateCreditNoteDocTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(extendMemberExpiryTopic)==null) {
|
||||
pubSubAdmin.createTopic(extendMemberExpiryTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(voucherUpdateInvoiceTopic)==null) {
|
||||
pubSubAdmin.createTopic(voucherUpdateInvoiceTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(walletUpdateInvoiceTopic)==null) {
|
||||
pubSubAdmin.createTopic(walletUpdateInvoiceTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(saveSalesSubmissionTrxnTopic)==null) {
|
||||
pubSubAdmin.createTopic(saveSalesSubmissionTrxnTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(saveConsignmentTrxnTopic)==null) {
|
||||
pubSubAdmin.createTopic(saveConsignmentTrxnTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(transferMemberMigrateSalesTopic)==null) {
|
||||
pubSubAdmin.createTopic(transferMemberMigrateSalesTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(updateStockistSalesInventoryTopic)==null) {
|
||||
pubSubAdmin.createTopic(updateStockistSalesInventoryTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(inventoryRemarkUpdateTopic)==null) {
|
||||
pubSubAdmin.createTopic(inventoryRemarkUpdateTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(createMerchantSalesTopic)==null) {
|
||||
pubSubAdmin.createTopic(createMerchantSalesTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(activateMemberTopic)==null) {
|
||||
pubSubAdmin.createTopic(activateMemberTopic);
|
||||
}
|
||||
if(pubSubAdmin.getTopic(updatePromotionCodeTopic)==null) {
|
||||
pubSubAdmin.createTopic(updatePromotionCodeTopic);
|
||||
}
|
||||
if (pubSubAdmin.getTopic(eventAttendanceTopic) == null) {
|
||||
pubSubAdmin.createTopic(eventAttendanceTopic);
|
||||
}
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void newSubscription() {
|
||||
if(pubSubAdmin.getSubscription(generateOrderDocSubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+generateOrderDocTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+generateOrderDocSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
if(pubSubAdmin.getSubscription(orderPaidSubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+orderPaidTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+orderPaidSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
if(pubSubAdmin.getSubscription(newRegOrderSubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+newRegOrderTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+newRegOrderSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
if(pubSubAdmin.getSubscription(newMemberSubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+newMemberTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+newMemberSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
if(pubSubAdmin.getSubscription(newMemberAddUserSubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+newMemberAddUserTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+newMemberAddUserSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
if(pubSubAdmin.getSubscription(generateCreditNoteDocSubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+generateCreditNoteDocTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+generateCreditNoteDocSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
if(pubSubAdmin.getSubscription(extendMemberExpirySubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+extendMemberExpiryTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+extendMemberExpirySubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
// if(pubSubAdmin.getSubscription(voucherUpdateInvoiceSubscription)==null) {
|
||||
// Subscription request = Subscription.newBuilder()
|
||||
// .setTopic("projects/"+projectId+"/topics/"+voucherUpdateInvoiceTopic)
|
||||
// .setName("projects/"+projectId+"/subscriptions/"+voucherUpdateInvoiceSubscription)
|
||||
// .setRetainAckedMessages(true)
|
||||
// .setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
// .build();
|
||||
// subscriptionAdminClient.createSubscription(request);
|
||||
// }
|
||||
if(pubSubAdmin.getSubscription(transferMemberMigrateSalesSubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+transferMemberMigrateSalesTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+transferMemberMigrateSalesSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
if(pubSubAdmin.getSubscription(createMerchantSalesSubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+createMerchantSalesTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+createMerchantSalesSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
if(pubSubAdmin.getSubscription(updatePromotionCodeSubscription)==null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/"+projectId+"/topics/"+updatePromotionCodeTopic)
|
||||
.setName("projects/"+projectId+"/subscriptions/"+updatePromotionCodeSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
if (pubSubAdmin.getSubscription(eventAttendanceSubscription) == null) {
|
||||
Subscription request = Subscription.newBuilder()
|
||||
.setTopic("projects/" + projectId + "/topics/" + eventAttendanceTopic)
|
||||
.setName("projects/" + projectId + "/subscriptions/" + eventAttendanceSubscription)
|
||||
.setRetainAckedMessages(true)
|
||||
.setExpirationPolicy(ExpirationPolicy.newBuilder().build())
|
||||
.build();
|
||||
subscriptionAdminClient.createSubscription(request);
|
||||
}
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MessageChannel generateOrderDocSubscriptionChannel() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PubSubInboundChannelAdapter generateOrderDocSubscriptionChannelAdapter(
|
||||
@Qualifier("generateOrderDocSubscriptionChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, generateOrderDocSubscription);
|
||||
adapter.setOutputChannel(inputChannel);
|
||||
adapter.setAckMode(AckMode.MANUAL);
|
||||
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MessageChannel orderPaidSubscriptionChannel() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PubSubInboundChannelAdapter orderPaidSubscriptionChannelAdapter(
|
||||
@Qualifier("orderPaidSubscriptionChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, orderPaidSubscription);
|
||||
adapter.setOutputChannel(inputChannel);
|
||||
adapter.setAckMode(AckMode.MANUAL);
|
||||
|
||||
return adapter;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public MessageChannel newRegOrderChannel() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PubSubInboundChannelAdapter newRegOrderChannelAdapter(
|
||||
@Qualifier("newRegOrderChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, newRegOrderSubscription);
|
||||
adapter.setOutputChannel(inputChannel);
|
||||
adapter.setAckMode(AckMode.MANUAL);
|
||||
|
||||
return adapter;
|
||||
}
|
||||
|
||||
// @Bean
|
||||
// public MessageChannel newMemberChannel() {
|
||||
// return new DirectChannel();
|
||||
// }
|
||||
// @Bean
|
||||
// public PubSubInboundChannelAdapter newMemberChannelAdapter(
|
||||
// @Qualifier("newMemberChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
// PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, newMemberSubscription);
|
||||
// adapter.setOutputChannel(inputChannel);
|
||||
// adapter.setAckMode(AckMode.MANUAL);
|
||||
//
|
||||
// return adapter;
|
||||
// }
|
||||
|
||||
// @Bean
|
||||
// public MessageChannel newMemberAddUserChannel() {
|
||||
// return new DirectChannel();
|
||||
// }
|
||||
// @Bean
|
||||
// public PubSubInboundChannelAdapter newMemberAddUserChannelAdapter(
|
||||
// @Qualifier("newMemberAddUserChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
// PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, newMemberAddUserSubscription);
|
||||
// adapter.setOutputChannel(inputChannel);
|
||||
// adapter.setAckMode(AckMode.MANUAL);
|
||||
//
|
||||
// return adapter;
|
||||
// }
|
||||
|
||||
@Bean
|
||||
public MessageChannel generateCreditNoteDocSubscriptionChannel() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PubSubInboundChannelAdapter generateCreditNoteDocSubscriptionChannelAdapter(
|
||||
@Qualifier("generateCreditNoteDocSubscriptionChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, generateCreditNoteDocSubscription);
|
||||
adapter.setOutputChannel(inputChannel);
|
||||
adapter.setAckMode(AckMode.MANUAL);
|
||||
|
||||
return adapter;
|
||||
}
|
||||
|
||||
// @Bean
|
||||
// public MessageChannel extendMemberExpiryChannel() {
|
||||
// return new DirectChannel();
|
||||
// }
|
||||
// @Bean
|
||||
// public PubSubInboundChannelAdapter extendMemberExpiryChannelAdapter(
|
||||
// @Qualifier("extendMemberExpiryChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
// PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, extendMemberExpirySubscription);
|
||||
// adapter.setOutputChannel(inputChannel);
|
||||
// adapter.setAckMode(AckMode.MANUAL);
|
||||
//
|
||||
// return adapter;
|
||||
// }
|
||||
// @Bean
|
||||
// public MessageChannel voucherUpdateInvoiceSubscriptionChannel() {
|
||||
// return new DirectChannel();
|
||||
// }
|
||||
// @Bean
|
||||
// public PubSubInboundChannelAdapter voucherUpdateInvoiceSubscriptionChannelAdapter(
|
||||
// @Qualifier("voucherUpdateInvoiceSubscriptionChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
// PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, voucherUpdateInvoiceSubscription);
|
||||
// adapter.setOutputChannel(inputChannel);
|
||||
// adapter.setAckMode(AckMode.MANUAL);
|
||||
//
|
||||
// return adapter;
|
||||
// }
|
||||
@Bean
|
||||
public MessageChannel transferMemberMigrateSalesSubscriptionChannel() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PubSubInboundChannelAdapter transferMemberMigrateSalesSubscriptionChannelAdapter(
|
||||
@Qualifier("transferMemberMigrateSalesSubscriptionChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, transferMemberMigrateSalesSubscription);
|
||||
adapter.setOutputChannel(inputChannel);
|
||||
adapter.setAckMode(AckMode.MANUAL);
|
||||
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MessageChannel createMerchantSalesSubscriptionChannel() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PubSubInboundChannelAdapter createMerchantSalesSubscriptionChannelAdapter(
|
||||
@Qualifier("createMerchantSalesSubscriptionChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, createMerchantSalesSubscription);
|
||||
adapter.setOutputChannel(inputChannel);
|
||||
adapter.setAckMode(AckMode.MANUAL);
|
||||
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MessageChannel updatePromotionCodeSubscriptionChannel() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PubSubInboundChannelAdapter updatePromotionCodeSubscriptionChannelAdapter(
|
||||
@Qualifier("updatePromotionCodeSubscriptionChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, updatePromotionCodeSubscription);
|
||||
adapter.setOutputChannel(inputChannel);
|
||||
adapter.setAckMode(AckMode.MANUAL);
|
||||
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MessageChannel eventAttendanceSubscriptionChannel() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PubSubInboundChannelAdapter eventAttendanceSubscriptionChannelAdapter(
|
||||
@Qualifier("eventAttendanceSubscriptionChannel") MessageChannel inputChannel, PubSubTemplate pubSubTemplate) {
|
||||
PubSubInboundChannelAdapter adapter = new PubSubInboundChannelAdapter(pubSubTemplate, eventAttendanceSubscription);
|
||||
adapter.setOutputChannel(inputChannel);
|
||||
adapter.setAckMode(AckMode.MANUAL);
|
||||
return adapter;
|
||||
}
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.solvway.services.counter.configuration;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||
import org.springframework.data.redis.cache.RedisCacheManager;
|
||||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.GenericToStringSerializer;
|
||||
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.RedisSerializationContext.SerializationPair;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@Configuration
|
||||
public class RedisConfig {
|
||||
|
||||
@Value("#{${cache.time-to-live}}")
|
||||
private int DEFAULT_TTL;
|
||||
|
||||
@Value("${spring.data.redis.host}")
|
||||
public String hostname;
|
||||
|
||||
@Value("${spring.data.redis.port}")
|
||||
public int port;
|
||||
|
||||
@Bean
|
||||
JedisConnectionFactory jedisConnectionFactory() {
|
||||
RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(hostname, port);
|
||||
JedisConnectionFactory jedisConFactory = new JedisConnectionFactory(redisStandaloneConfiguration);
|
||||
return jedisConFactory;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisTemplate<String,Object> redisTemplate() {
|
||||
final RedisTemplate<String,Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setHashKeySerializer(new GenericToStringSerializer<>(Object.class));
|
||||
redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());
|
||||
redisTemplate.setValueSerializer(new JdkSerializationRedisSerializer());
|
||||
redisTemplate.setConnectionFactory(jedisConnectionFactory());
|
||||
return redisTemplate;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisCacheConfiguration cacheConfiguration() {
|
||||
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
JdkSerializationRedisSerializer jdkSerializer = new JdkSerializationRedisSerializer(loader);
|
||||
SerializationPair<Object> pair = SerializationPair.fromSerializer(jdkSerializer);
|
||||
|
||||
RedisCacheConfiguration cacheConfig = RedisCacheConfiguration.defaultCacheConfig()
|
||||
.entryTtl(Duration.ofSeconds(DEFAULT_TTL))
|
||||
.disableCachingNullValues().serializeValuesWith(pair);
|
||||
return cacheConfig;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisCacheManager cacheManager() {
|
||||
RedisCacheManager rcm = RedisCacheManager.builder(jedisConnectionFactory())
|
||||
.cacheDefaults(cacheConfiguration())
|
||||
.transactionAware()
|
||||
.build();
|
||||
return rcm;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.solvway.services.counter.constant;
|
||||
|
||||
public class RestApiAuthServiceConstant {
|
||||
|
||||
//auth
|
||||
public final static String API_REST_GET_MEMBER_BY_TOKEN= "/auth/getMemberFromToken/{token}";
|
||||
public final static String API_REST_AES_ENCRYPT="/auth/aes/encrypt";
|
||||
public final static String API_REST_AES_DECRYPT="/auth/aes/decrypt";
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package com.solvway.services.counter.constant;
|
||||
|
||||
public class RestApiBonusServiceConstants {
|
||||
public final static String API_REST_BONUS_FIND_ALL_STMTDATE = "/bonus/findAllStmtdate/{status}";
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.solvway.services.counter.constant;
|
||||
|
||||
public class RestApiEmailServiceConstants {
|
||||
public final static String API_REST_EMAIL_SEND = "/email/send";
|
||||
public final static String API_REST_EMAIL_UPLOAD_ATTACHMENT = "/email/attachment/updateAttachment";
|
||||
public final static String API_REST_EMAIL_SEND_WITH_TEMPLATE = "/email/sendEmailWithTamplate";
|
||||
public final static String API_REST_EMAIL_TEMPLATE_FIND_BY_NAME_AND_ACTIVE = "/email/template/findByNameAndActive/{name}";
|
||||
}
|
||||
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.solvway.services.counter.constant;
|
||||
|
||||
public class RestApiInventoryServiceConstant {
|
||||
|
||||
//Inventory
|
||||
public static final String API_REST_INVENTORY_FREEZE_INVENTORY = "/inventory/freezeInventory";
|
||||
public static final String API_REST_INVENTORY_FREEZE_INVENTORY_V2 = "/inventory/freezeInventoryV2";
|
||||
public static final String API_REST_INVENTORY_UPDATE_FREEZE_INVENTORY = "/inventory/freeze/updateStatusExcludeBackOrder/{status}/{counterReferenceId}";
|
||||
public static final String API_REST_INVENTORY_UPDATE_FREEZE_INVENTORY_INVOICE_OPENED = "/inventory/freeze/setInvoiceOpenedForInventoryFreeze/{invoiceOpened}/{counterReferenceId}";
|
||||
|
||||
//StockReturn
|
||||
public static final String API_REST_INVENTORY_FIND_STOCK_RETURN_BY_UUID="/inventory/findStockReturnByUuid/{uuid}";
|
||||
public static final String API_REST_INVENTORY_FIND_STOCK_RETURN_BY_ID="/inventory/findStockReturnById/{id}";
|
||||
public static final String API_REST_INVENTORY_FIND_STOCK_RETURN_BY_BONUS_DATE="/inventory/findStockReturnByBonusDate/{bonusDate}";
|
||||
|
||||
|
||||
//Delivery Order
|
||||
public static final String API_REST_INVENTORY_FIND_DELIVERY_ORDER_BY_ORDER_UUID ="/deliveryOrder/findDeliveryOrderByOrderUuid/{orderUuid}";
|
||||
|
||||
//BackOrder
|
||||
public static final String API_REST_INVENTORY_GET_BACK_ORDER_FIND_BY_ORDER_UUID = "/backOrder/getBackOrderForOrderByOrderUuid/{orderUuid}";
|
||||
|
||||
//skuvariation
|
||||
public static final String API_REST_SKU_VARIATION_FIND_BYID = "/skuVariation/findById/{id}";
|
||||
public static final String API_REST_SKU_VARIATION_GET_NAME = "/skuVariation/getSkuVariationName/{id}/{locale}";
|
||||
public static final String API_REST_SKU_VARIATION_FIND_SKU_BYID = "/skuVariation/findSkuBySkuVariationId/{id}";
|
||||
|
||||
//Inventory Freeze
|
||||
public static final String API_REST_INVENTORY_FREEZE_CHECK_ORDER_FREEZE_STATUS = "/inventoryFreeze/checkOrderInventoryFreezeStatus/{uuid}";
|
||||
public static final String API_REST_INVENTORY_FREEZE_FREEZE_INVENTORY = "/inventoryFreeze/freezeInventory/{uuid}";
|
||||
|
||||
//Pricing
|
||||
public static final String API_REST_PRICING_FIND_BYID = "/pricing/findById/{id}";
|
||||
//Variation
|
||||
public static final String API_REST_VARIATION_FIND_BYID = "/variation/findById/{id}";
|
||||
//Product
|
||||
public final static String API_REST_PRODUCT_FIND_BYID = "/product/findById/{id}";
|
||||
public final static String API_REST_PRODUCT_FIND_BY_PRODUCT_CODE = "/product/findByProductCode/{productCode}";
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.solvway.services.counter.constant;
|
||||
|
||||
public class RestApiMemberServiceConstant {
|
||||
//member
|
||||
public static final String API_REST_MEMBER_MEMBER_FIND_BY_MEMBERCODE= "/member/findByMemberCode/{memberCode}";
|
||||
public static final String API_REST_MEMBER_MEMBER_FIND_BY_ID= "/member/findById/{id}";
|
||||
public static final String API_REST_MEMBER_MEMBER_FIND_BY_UUID = "/member/findByUuid/{uuid}";
|
||||
public static final String API_REST_MEMBER_UPDATE_LAST_PURCHASE_BD_TREAT_DATE= "/member/setLastPurchaseBdTreatDateForMember/{memberCode}";
|
||||
public static final String API_REST_MEMBER_FIND_BY_MIGRATED_FROM = "/member/findByMigratedFrom/{migratedFrom}";
|
||||
public static final String API_REST_MEMBER_UPDATE_LAST_PURCHASE_NEW_RETENTION_DATE= "/member/setLastPurchaseNewRetentionDateForMember/{memberCode}";
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.solvway.services.counter.constant;
|
||||
|
||||
public class RestApiPaymentServiceConstant {
|
||||
public static final String API_REST_PAYMENT_REVERSE_PAYMENT= "/payment/reversePayment";
|
||||
public static final String API_REST_PAYMENT_TASTEFULLY_POINT_INSERT_TRANSACTION = "/payment/tastefullyPoint/insertTastefullyPoint";
|
||||
public static final String API_REST_PAYMENT_EVENT_PRODUCT_BALANCE_INSERT_TRANSACTION = "/payment/eventProductBalance/insertTransaction";
|
||||
public static final String API_REST_PAYMENT_EVENT_PRODUCT_BALANCE_GET_BALANCE = "/payment/eventProductBalance/getBalanceCache/{uuid}";
|
||||
public static final String API_REST_PAYMENT_TASTEFULLY_POINT_GET_BALANCE = "/payment/tastefullyPoint/getBalanceCache/{uuid}";
|
||||
public static final String API_REST_PAYMENT_TASTEFULLY_POINT_GET_BALANCE_NO_CACHE = "/payment/tastefullyPoint/getBalanceNoCache/{uuid}";
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.solvway.services.counter.constant;
|
||||
|
||||
public class RestApiStockistServiceConstant {
|
||||
//Stockist
|
||||
public static final String API_REST_STOCKIST_FIND_BY_STOCKIST_CODE="/stockist/findByStockistCode/{stockistCode}";
|
||||
public static final String API_REST_STOCKIST_FIND_BY_UUID="/stockist/findByUuid/{uuid}";
|
||||
//Sales Submission
|
||||
public static final String API_REST_STOCKIST_SALES_SUBMISSION_SAVE_TRXN = "/stockist/salesSubmission/saveTrxn";
|
||||
public static final String API_REST_STOCKIST_SALES_SUBMISSION_FIND_BY_STOCKISTCODE ="/stockist/salesSubmission/findByStockistCode/{stockistCode}";
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.solvway.services.counter.constant;
|
||||
|
||||
public class RestApiSystemServiceConstant {
|
||||
//Message
|
||||
public static final String API_REST_SYSTEM_MESSAGE_FIND_BY_CODE = "/message/getMessagesByCode/{code}";
|
||||
public static final String API_REST_SYSTEM_MESSAGE_FIND_BY_CODE_AND_AREA = "/message/getMessagesByCodeAndArea/{code}/{Area}";
|
||||
|
||||
//GeoLocation
|
||||
public static final String API_REST_GEOLOCATION_HIERARCHY_GENERATE_ADDRESS = "/geoLocationHierarchy/generateAddress/{id}";
|
||||
public static final String API_REST_GEOLOCATION_HIERARCHY_GENERATE_ADDRESS_WITH_LOCALE = "/geoLocationHierarchy/generateAddress/{id}/{locale}";
|
||||
public static final String API_REST_GEOLOCATION_HIERARCHY_GET_ADDRESS_LIST = "/geoLocationHierarchy/getAddressList/{id}";
|
||||
//Pickup Point Location
|
||||
public static final String API_REST_PICKUP_POINT_LOCATION_FIND_BY_CODE = "/pickupPointLocation/findByPickupPointTypeCodeAndPickupPointLocationCode/{pickupPointTypeCode}/{pickupPointLocationCode}";
|
||||
|
||||
//Pickup Point Type
|
||||
public static final String API_REST_PICKUP_POINT_TYPE_FIND_BY_CODE = "/pickupPointType/findByCode/{code}";
|
||||
|
||||
//User
|
||||
public static final String API_REST_USER_FIND_BRANCH_CODE = "/user/findUserBranchCode/{username}";
|
||||
public static final String API_REST_USER_FIND_COUNTRY_CODE = "/user/findUserCountryCode/{username}";
|
||||
|
||||
//Bank
|
||||
public static final String API_REST_BANK_FIND_BY_ID = "/bank/findById/{id}";
|
||||
|
||||
//locationhierarchy
|
||||
public static final String API_REST_SYSTEM_LOCATION_HIERARCHY_FIND_BYCODE = "/locationHierarchy/findByCode/{code}";
|
||||
public static final String API_REST_SYSTEM_LOCATION_HIERARCHY_FIND_PARENT_BY_ID_AND_TYPE = "/locationHierarchy/findParentByIdAndType/{id}/{type}";
|
||||
public static final String API_REST_SYSTEM_LOCATION_HIERARCHY_FIND_CONFIG_BY_CTRY_AND_TYPE = "/locationHierarchy/findConfigByCountryAndType/{countryCode}/{type}";
|
||||
|
||||
//Currency
|
||||
public final static String API_REST_CURRENCY_FIND_BY_COUNTRYCODE_AND_EFFECTIVETIME = "/currency/findByCountryCodeAndEffectiveTime/{countryCode}";
|
||||
|
||||
//delivery charges
|
||||
public static final String API_REST_SYSTEM_DELIVERY_CHARGES_FIND_BY_GEOLOCATIONID = "/deliveryCharges/getDeliveryChargesByGeoLocationId/{geoLocationId}";
|
||||
|
||||
//delivery charges campaign
|
||||
public static final String API_REST_SYSTEM_DELIVERY_CHARGES_CAMPAIGN_FIND_ACTIVE_CAMPAIGN_BY_GEO_LOCATION = "/deliveryCharges/deliveryChargesCampaign/getEffectiveCampaignByGeoLocation/{geoLocationId}";
|
||||
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.Cart;
|
||||
import com.solvway.services.counter.service.CartService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RequestMapping("/counter/cart")
|
||||
@RestController
|
||||
|
||||
public class CartController {
|
||||
private static final Logger log = LoggerFactory.getLogger(CartController.class);
|
||||
|
||||
@Autowired
|
||||
private CartService cartService;
|
||||
|
||||
@RequestMapping("/save")
|
||||
public Cart save(@RequestBody Cart cart) {
|
||||
try {
|
||||
return cartService.save(cart);
|
||||
}catch(Exception e) {
|
||||
log.error(e.getLocalizedMessage(),e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@RequestMapping("/deleteById/{id}")
|
||||
public void deleteById(@PathVariable("id") long id) {
|
||||
try {
|
||||
cartService.deleteById(id);
|
||||
}catch(Exception e) {
|
||||
log.error(e.getLocalizedMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/deleteByMemberId/{memberId}")
|
||||
public long deleteByMemberId(@PathVariable("memberId") String memberId) {
|
||||
try {
|
||||
return cartService.deleteByMemberId(memberId);
|
||||
}catch(Exception e) {
|
||||
log.error(e.getLocalizedMessage(),e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@RequestMapping("/setMemberIdForCart/{memberId}/{newMemberId}")
|
||||
public int setMemberIdForCart(@PathVariable("memberId") String memberId, @PathVariable("newMemberId") String newMemberId) {
|
||||
try {
|
||||
cartService.deleteByMemberId(newMemberId);
|
||||
return cartService.setMemberIdForCart(memberId, newMemberId);
|
||||
}catch(Exception e) {
|
||||
log.error(e.getLocalizedMessage(),e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@RequestMapping("/findByMemberId/{memberId}")
|
||||
public List<Cart> findByMemberId(@PathVariable("memberId") String memberId) {
|
||||
return cartService.findByMemberId(memberId);
|
||||
}
|
||||
|
||||
@RequestMapping("/findById/{id}")
|
||||
public Optional<Cart> findById(@PathVariable("id") long id) {
|
||||
return cartService.findById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.google.cloud.spring.pubsub.core.PubSubTemplate;
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import com.solvway.core.enums.OrderEnum;
|
||||
import com.solvway.core.utils.PubSubUtil;
|
||||
import com.solvway.core.utils.StackTraceUtil;
|
||||
import com.solvway.core.utils.ValidateUtil;
|
||||
import com.solvway.services.counter.configuration.PubSubConfig;
|
||||
import com.solvway.services.counter.model.*;
|
||||
import com.solvway.services.counter.service.CheckInBoothService;
|
||||
import com.solvway.services.counter.service.EventBoothService;
|
||||
import com.solvway.services.counter.service.EventRedeemCodeService;
|
||||
import com.solvway.services.counter.service.EventService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/checkInBooth")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class CheckInBoothController {
|
||||
private final EventService eventService;
|
||||
private final CheckInBoothService checkInBoothService;
|
||||
private final EventBoothService eventBoothService;
|
||||
private final EventRedeemCodeService eventRedeemCodeService;
|
||||
private final ValidateUtil validateUtil;
|
||||
private final PubSubUtil pubSubUtil;
|
||||
private final PubSubConfig pubSubConfig;
|
||||
private final PubSubTemplate pubSubTemplate;
|
||||
@PostMapping("/directGetRedeemCode")
|
||||
public EventRedeemCode directGetRedeemCode(@RequestBody CheckInBooth checkInBooth) {
|
||||
Optional<EventBooth> eventBoothOptional = eventBoothService.findByEventUuidAndStockistUuid(checkInBooth.getEventUuid(), checkInBooth.getStockistUuid());
|
||||
if (eventBoothOptional.isPresent()) {
|
||||
boolean generateNewCode = false;
|
||||
EventBooth eventBooth = eventBoothOptional.get();
|
||||
Event event = eventService.findByUuid(checkInBooth.getEventUuid()).orElse(null);
|
||||
boolean allowDaily = eventBooth.getWelcomeGiftDailyBasis().equals(GeneralEnum.FlagYesNo.Y);
|
||||
if (eventBooth.getWelcomeGift().equals(GeneralEnum.FlagYesNo.Y)) {
|
||||
List<EventRedeemCode> eventRedeemCodes = eventRedeemCodeService
|
||||
.findByEventUuidAndStockistUuidAndMemberUuid(checkInBooth.getEventUuid(), checkInBooth.getStockistUuid(), checkInBooth.getMemberUuid());
|
||||
if (eventRedeemCodes.isEmpty()) {
|
||||
generateNewCode = true;
|
||||
} else if (allowDaily) {
|
||||
boolean todayRedeemed = eventRedeemCodes.stream().anyMatch(
|
||||
erc -> erc.getCreateDateTime().isAfter(LocalDate.now().atStartOfDay())
|
||||
);
|
||||
generateNewCode = !todayRedeemed;
|
||||
}
|
||||
|
||||
//[START] Additional Layer to check for cap limit
|
||||
List<EventRedeemCode> redeemCodesByStockist = eventRedeemCodeService
|
||||
.findByEventUuidAndStockistUuid(checkInBooth.getEventUuid(), checkInBooth.getStockistUuid());
|
||||
if (generateNewCode && eventBooth.getWelcomeGiftDailyCap() > 0) {
|
||||
List<EventRedeemCode> todayRedeemCodes = redeemCodesByStockist.stream().filter(er -> er.getCreateDateTime().isAfter(LocalDate.now().atStartOfDay())).toList();
|
||||
generateNewCode = todayRedeemCodes.size() < eventBooth.getWelcomeGiftDailyCap();
|
||||
}
|
||||
if(generateNewCode && eventBooth.getWelcomeGiftEventCap()>0){
|
||||
generateNewCode = redeemCodesByStockist.size() < eventBooth.getWelcomeGiftEventCap();
|
||||
}
|
||||
//[END] Additional Layer to check for cap limit
|
||||
if (generateNewCode) {
|
||||
// Generate new code logic here
|
||||
EventRedeemCode redeemCode = new EventRedeemCode();
|
||||
redeemCode.setEventUuid(eventBooth.getEventUuid());
|
||||
redeemCode.setStockistUuid(eventBooth.getStockistUuid());
|
||||
redeemCode.setMemberUuid(checkInBooth.getMemberUuid());
|
||||
redeemCode.setRedeemCode(redeemCode.getUuid() + validateUtil.getCapitalAlphaNumericString(8));
|
||||
redeemCode.setName("Welcome Gift - " + eventBooth.getStockistUuid());
|
||||
LocalDateTime defaultExpiry = LocalDate.now().atTime(23, 59, 59);
|
||||
redeemCode.setExpiryDateTime(allowDaily || event == null ? defaultExpiry : event.getDateEnd());
|
||||
redeemCode.setDoneBy(checkInBooth.getDoneBy());
|
||||
redeemCode.setCreateBy(checkInBooth.getCreateBy());
|
||||
return eventRedeemCodeService.save(redeemCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/save")
|
||||
public CheckInBooth save(@RequestBody CheckInBooth checkInBooth) {
|
||||
// One attendance per member per event per day, at any booth, whichever caller scans: a repeat
|
||||
// returns the existing check-in with no new row, redeem code or event_attendance message.
|
||||
Optional<CheckInBooth> existing = checkInBoothService.findByEventUuidAndMemberUuidAndCheckInDate(
|
||||
checkInBooth.getEventUuid(), checkInBooth.getMemberUuid(), checkInBooth.getCheckInDate());
|
||||
if (existing.isPresent()) {
|
||||
return existing.get();
|
||||
}
|
||||
if (!checkInBoothService.lockDay(checkInBooth)) {
|
||||
// A simultaneous save for this member and day holds the lock: return its check-in once saved.
|
||||
return checkInBoothService.findByEventUuidAndMemberUuidAndCheckInDate(
|
||||
checkInBooth.getEventUuid(), checkInBooth.getMemberUuid(), checkInBooth.getCheckInDate()).orElse(null);
|
||||
}
|
||||
Optional<EventBooth> eventBoothOptional = eventBoothService.findByEventUuidAndStockistUuid(checkInBooth.getEventUuid(), checkInBooth.getStockistUuid());
|
||||
|
||||
if (eventBoothOptional.isPresent()) {
|
||||
boolean generateNewCode = false;
|
||||
EventBooth eventBooth = eventBoothOptional.get();
|
||||
Event event = eventService.findByUuid(checkInBooth.getEventUuid()).orElse(null);
|
||||
boolean allowDaily = eventBooth.getWelcomeGiftDailyBasis().equals(GeneralEnum.FlagYesNo.Y);
|
||||
if (eventBooth.getWelcomeGift().equals(GeneralEnum.FlagYesNo.Y)) {
|
||||
List<EventRedeemCode> eventRedeemCodes = eventRedeemCodeService
|
||||
.findByEventUuidAndStockistUuidAndMemberUuid(checkInBooth.getEventUuid(), checkInBooth.getStockistUuid(), checkInBooth.getMemberUuid());
|
||||
if (eventRedeemCodes.isEmpty()) {
|
||||
generateNewCode = true;
|
||||
} else if (allowDaily) {
|
||||
boolean todayRedeemed = eventRedeemCodes.stream().anyMatch(
|
||||
erc -> erc.getCreateDateTime().isAfter(LocalDate.now().atStartOfDay())
|
||||
);
|
||||
generateNewCode = !todayRedeemed;
|
||||
}
|
||||
|
||||
//[START] Additional Layer to check for cap limit
|
||||
List<EventRedeemCode> redeemCodesByStockist = eventRedeemCodeService
|
||||
.findByEventUuidAndStockistUuid(checkInBooth.getEventUuid(), checkInBooth.getStockistUuid());
|
||||
if (generateNewCode && eventBooth.getWelcomeGiftDailyCap() > 0) {
|
||||
List<EventRedeemCode> todayRedeemCodes = redeemCodesByStockist.stream().filter(er -> er.getCreateDateTime().isAfter(LocalDate.now().atStartOfDay())).toList();
|
||||
generateNewCode = todayRedeemCodes.size() < eventBooth.getWelcomeGiftDailyCap();
|
||||
}
|
||||
if(generateNewCode && eventBooth.getWelcomeGiftEventCap()>0){
|
||||
generateNewCode = redeemCodesByStockist.size() < eventBooth.getWelcomeGiftEventCap();
|
||||
}
|
||||
//[END] Additional Layer to check for cap limit
|
||||
if (generateNewCode) {
|
||||
// Generate new code logic here
|
||||
EventRedeemCode redeemCode = new EventRedeemCode();
|
||||
redeemCode.setEventUuid(eventBooth.getEventUuid());
|
||||
redeemCode.setStockistUuid(eventBooth.getStockistUuid());
|
||||
redeemCode.setMemberUuid(checkInBooth.getMemberUuid());
|
||||
redeemCode.setRedeemCode(redeemCode.getUuid() + validateUtil.getCapitalAlphaNumericString(8));
|
||||
redeemCode.setName("Welcome Gift - " + eventBooth.getStockistUuid());
|
||||
LocalDateTime defaultExpiry = LocalDate.now().atTime(23, 59, 59);
|
||||
redeemCode.setExpiryDateTime(allowDaily || event == null ? defaultExpiry : event.getDateEnd());
|
||||
redeemCode.setDoneBy(checkInBooth.getDoneBy());
|
||||
redeemCode.setCreateBy(checkInBooth.getCreateBy());
|
||||
eventRedeemCodeService.save(redeemCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
checkInBooth = checkInBoothService.save(checkInBooth);
|
||||
try {
|
||||
EventAttendance ea = new EventAttendance();
|
||||
ea.setOwnerUuid(new BigInteger(String.valueOf(checkInBooth.getMemberUuid())));
|
||||
ea.setEventUuid(checkInBooth.getEventUuid());
|
||||
ea.setAttendanceType(OrderEnum.EventAttendanceType.CI);
|
||||
ea.setCreateBy(checkInBooth.getCreateBy());
|
||||
ea.setDoneBy(checkInBooth.getDoneBy());
|
||||
String topic = pubSubConfig.eventAttendanceTopic;
|
||||
pubSubUtil.publishMessage(pubSubTemplate, topic, ea);
|
||||
} catch (Exception e) {
|
||||
StackTraceUtil.printStackTrace(log, e);
|
||||
}
|
||||
return checkInBooth;
|
||||
}
|
||||
|
||||
@GetMapping("/findByMemberUuid/{memberUuid}")
|
||||
public List<CheckInBooth> findByMemberUuid(@PathVariable("memberUuid") long memberUuid) {
|
||||
return checkInBoothService.findByMemberUuid(memberUuid);
|
||||
}
|
||||
|
||||
@GetMapping("/findByEventUuid/{eventUuid}")
|
||||
public List<CheckInBooth> findByEventUuid(@PathVariable("eventUuid") long eventUuid) {
|
||||
return checkInBoothService.findByEventUuid(eventUuid);
|
||||
}
|
||||
|
||||
@GetMapping("/findByStockistUuid/{stockistUuid}")
|
||||
public List<CheckInBooth> findByStockistUuid(@PathVariable("stockistUuid") long stockistUuid) {
|
||||
return checkInBoothService.findByStockistUuid(stockistUuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param checkInBooth required fields
|
||||
* - eventUuid
|
||||
* - memberUuid
|
||||
* - stockistUuid
|
||||
* - checkInDate
|
||||
**/
|
||||
@PostMapping("/findCheckInExisted")
|
||||
public Optional<CheckInBooth> findCheckInExisted(@RequestBody CheckInBooth checkInBooth) {
|
||||
return checkInBoothService.findByEventUuidAndMemberUuidAndCheckInDate(checkInBooth.getEventUuid(), checkInBooth.getMemberUuid(), checkInBooth.getCheckInDate());
|
||||
}
|
||||
|
||||
@GetMapping("/flushCache")
|
||||
public Boolean flushCache() {
|
||||
checkInBoothService.removeAllCache();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.CheckInEvent;
|
||||
import com.solvway.services.counter.service.CheckInEventService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/checkInEvent")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class CheckInEventController {
|
||||
private final CheckInEventService checkInEventService;
|
||||
|
||||
@PostMapping("/save")
|
||||
public CheckInEvent save(@RequestBody CheckInEvent checkInEvent){
|
||||
return checkInEventService.save(checkInEvent);
|
||||
}
|
||||
@GetMapping("/findByMemberUuid/{memberUuid}")
|
||||
public List<CheckInEvent> findByMemberUuid(@PathVariable("memberUuid")long memberUuid){
|
||||
return checkInEventService.findByMemberUuid(memberUuid);
|
||||
}
|
||||
@GetMapping("/findByEventUuid/{eventUuid}")
|
||||
public List<CheckInEvent> findByEventUuid(@PathVariable("eventUuid")long eventUuid){
|
||||
return checkInEventService.findByEventUuid(eventUuid);
|
||||
}
|
||||
@PostMapping("/findCheckInExisted")
|
||||
public Optional<CheckInEvent> findCheckInExisted(@RequestBody CheckInEvent checkInEvent){
|
||||
return checkInEventService.findByEventUuidAndMemberUuidAndCheckInDate(checkInEvent.getEventUuid(), checkInEvent.getMemberUuid(), checkInEvent.getCheckInDate());
|
||||
}
|
||||
|
||||
@GetMapping("/flushCache")
|
||||
public Boolean flushCache(){
|
||||
checkInEventService.removeAllCache();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+1145
File diff suppressed because it is too large.
Load diff
+95
@@ -0,0 +1,95 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import com.solvway.core.model.Stockist;
|
||||
import com.solvway.services.counter.model.EventBooth;
|
||||
import com.solvway.services.counter.service.EventBoothService;
|
||||
import com.solvway.services.counter.service.PdfEventCheckInQrService;
|
||||
import com.solvway.services.counter.service.StockistService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/eventBooth")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class EventBoothController {
|
||||
private final EventBoothService eventBoothService;
|
||||
private final StockistService stockistService;
|
||||
private final PdfEventCheckInQrService pdfEventCheckInQrService;
|
||||
@GetMapping("/findByEventUuid/{eventUuid}")
|
||||
public List<EventBooth> findByEventUuid(@PathVariable("eventUuid") long eventUuid) {
|
||||
return eventBoothService.findByEventUuid(eventUuid);
|
||||
}
|
||||
|
||||
@GetMapping("/findByStockistUuid/{stockistUuid}")
|
||||
public List<EventBooth> findByStockistUuid(@PathVariable("stockistUuid") long stockistUuid) {
|
||||
return eventBoothService.findByStockistUuid(stockistUuid);
|
||||
}
|
||||
|
||||
@GetMapping("/findByEventUuidAndStockistUuid/{eventUuid}/{stockistUuid}")
|
||||
public Optional<EventBooth> findByEventUuidAndStockistUuid(@PathVariable("eventUuid") long eventUuid, @PathVariable("stockistUuid") long stockistUuid) {
|
||||
return eventBoothService.findByEventUuidAndStockistUuid(eventUuid, stockistUuid);
|
||||
}
|
||||
|
||||
@PostMapping("/updateEventBooth")
|
||||
public List<EventBooth> updateEventBooth(@RequestBody List<EventBooth> eventBoothList) {
|
||||
long eventUuid = eventBoothList.getFirst().getEventUuid();
|
||||
List<EventBooth> existList = eventBoothService.findByEventUuid(eventUuid);
|
||||
|
||||
existList.forEach(eventBooth -> {
|
||||
Optional<EventBooth> eventBoothOptional = eventBoothList.stream()
|
||||
.filter(eb -> eb.getStockistUuid() == eventBooth.getStockistUuid())
|
||||
.findFirst();
|
||||
//Not exist in request list, is deleted by user, update to N
|
||||
if (eventBoothOptional.isEmpty()) {
|
||||
eventBooth.setEnabled(GeneralEnum.FlagYesNo.N);
|
||||
eventBoothService.save(eventBooth);
|
||||
}
|
||||
});
|
||||
eventBoothList.forEach(eventBooth -> {
|
||||
Optional<EventBooth> existBoothOptional = existList.stream()
|
||||
.filter(eb -> eb.getStockistUuid() == eventBooth.getStockistUuid())
|
||||
.findFirst();
|
||||
//Not exist in current list, is added by user, insert new
|
||||
if (existBoothOptional.isEmpty()) {
|
||||
eventBoothService.save(eventBooth);
|
||||
} else {
|
||||
EventBooth exist = existBoothOptional.get();
|
||||
exist.setWelcomeGift(eventBooth.getWelcomeGift());
|
||||
exist.setWelcomeGiftDailyBasis(eventBooth.getWelcomeGiftDailyBasis());
|
||||
exist.setWelcomeGiftDailyCap(eventBooth.getWelcomeGiftDailyCap());
|
||||
exist.setWelcomeGiftEventCap(eventBooth.getWelcomeGiftEventCap());
|
||||
eventBoothService.save(exist);
|
||||
}
|
||||
});
|
||||
return eventBoothService.findByEventUuid(eventUuid);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/printAllBoothQr/{locale}/{eventUuid}")
|
||||
public ResponseEntity<InputStreamResource> printAllBoothQr(@PathVariable("eventUuid") long eventUuid, @PathVariable("locale") String locale) throws IOException, ExecutionException, InterruptedException {
|
||||
List<EventBooth> eventBoothList = eventBoothService.findByEventUuid(eventUuid);
|
||||
eventBoothList = eventBoothList.parallelStream().peek(eventBooth -> {
|
||||
Stockist stockist = stockistService.findByUuid(String.valueOf(eventBooth.getStockistUuid()));
|
||||
eventBooth.setStockistName(stockist != null ? stockist.getName() : "");
|
||||
}).sorted(Comparator.comparing(EventBooth::getStockistName))
|
||||
.toList();
|
||||
ByteArrayInputStream bis = pdfEventCheckInQrService.generatePdf(eventBoothList, locale);
|
||||
var headers = new HttpHeaders();
|
||||
headers.add("Content-Disposition", "inline; filename=CheckInQr.pdf");
|
||||
return ResponseEntity.ok().headers(headers).contentType(MediaType.APPLICATION_PDF)
|
||||
.body(new InputStreamResource(bis));
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.Event;
|
||||
import com.solvway.services.counter.service.EventService;
|
||||
import com.solvway.services.counter.util.paging.PageableRest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.modelmapper.TypeToken;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/event")
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class EventController {
|
||||
private final EventService eventService;
|
||||
private final ModelMapper modelMapper;
|
||||
@GetMapping("/findAll")
|
||||
public List<Event> findAll(){
|
||||
return eventService.findAll();
|
||||
}
|
||||
@GetMapping("/findCurrentEvent")
|
||||
public Optional<Event> findCurrentEvent() {
|
||||
return eventService.findCurrentEvent(false);
|
||||
}
|
||||
@GetMapping("/findByUuid/{uuid}")
|
||||
public Optional<Event> findByUuid(@PathVariable("uuid") long uuid) {
|
||||
return eventService.findByUuid(uuid);
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
public Event save(@RequestBody Event event) {
|
||||
return eventService.save(event);
|
||||
}
|
||||
|
||||
@PostMapping("/findByPropertyAndPageable")
|
||||
public Page<Event> findByPropertyAndPageable(@RequestBody HashMap<String, Object> param) {
|
||||
Type listType = new TypeToken<HashMap<String, String>>() {
|
||||
}.getType();
|
||||
HashMap<String, String> property = modelMapper.map(param.get("property"), listType);
|
||||
PageableRest pageable = modelMapper.map(param.get("pageableRest"), PageableRest.class);
|
||||
return eventService.findByPropertyAndPageable(property, pageable);
|
||||
}
|
||||
@GetMapping("/flushCache")
|
||||
public Boolean flushCache(){
|
||||
eventService.removeAllCache();
|
||||
eventService.findCurrentEvent(true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.EventGiftWithPurchase;
|
||||
import com.solvway.services.counter.service.EventGiftWithPurchaseService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/eventGiftWithPurchase")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class EventGiftWithPurchaseController {
|
||||
private final EventGiftWithPurchaseService eventGiftWithPurchaseService;
|
||||
|
||||
@GetMapping("/findAll")
|
||||
public List<EventGiftWithPurchase> findAll() {
|
||||
return eventGiftWithPurchaseService.findAll();
|
||||
}
|
||||
|
||||
@GetMapping("/findByEventUuidAndMemberUuid/{eventUuid}/{memberUuid}")
|
||||
public List<EventGiftWithPurchase> findByEventUuidAndMemberUuid(@PathVariable("eventUuid") long eventUuid, @PathVariable("memberUuid") long memberUuid) {
|
||||
return eventGiftWithPurchaseService.findByEventUuidAndMemberUuid(eventUuid, memberUuid);
|
||||
}
|
||||
|
||||
@GetMapping("/findByEventUuid/{eventUuid}")
|
||||
public List<EventGiftWithPurchase> findByEventUuid(@PathVariable("eventUuid") long eventUuid) {
|
||||
return eventGiftWithPurchaseService.findByEventUuid(eventUuid);
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
public EventGiftWithPurchase save(@RequestBody EventGiftWithPurchase eventGiftWithPurchase) {
|
||||
return eventGiftWithPurchaseService.save(eventGiftWithPurchase);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.EventLuckyDrawTicket;
|
||||
import com.solvway.services.counter.service.EventLuckyDrawTicketService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/eventLuckyDrawTicket")
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class EventLuckyDrawTicketController {
|
||||
private final EventLuckyDrawTicketService eventLuckyDrawTicketService;
|
||||
|
||||
@PostMapping("/save")
|
||||
public EventLuckyDrawTicket save(@RequestBody EventLuckyDrawTicket eventLuckyDrawTicket) {
|
||||
return eventLuckyDrawTicketService.save(eventLuckyDrawTicket);
|
||||
}
|
||||
@GetMapping("/findByUuid/{uuid}")
|
||||
public Optional<EventLuckyDrawTicket> findByUuid(@PathVariable("uuid") long uuid) {
|
||||
return eventLuckyDrawTicketService.findByUuid(uuid);
|
||||
}
|
||||
@GetMapping("/findByEventUuid/{eventUuid}")
|
||||
public List<EventLuckyDrawTicket> findByEventUuid(@PathVariable("eventUuid") long eventUuid) {
|
||||
return eventLuckyDrawTicketService.findByEventUuid(eventUuid);
|
||||
}
|
||||
@GetMapping("/findByEventUuidAndReceiptUuid/{eventUuid}/{receiptUuid}")
|
||||
public List<EventLuckyDrawTicket> findByEventUuidAndReceiptUuid(@PathVariable("eventUuid") long eventUuid, @PathVariable("receiptUuid") long receiptUuid) {
|
||||
return eventLuckyDrawTicketService.findByEventUuidAndReceiptUuid(eventUuid, receiptUuid);
|
||||
}
|
||||
@GetMapping("/findByEventUuidAndMemberUuid/{eventUuid}/{memberUuid}")
|
||||
public List<EventLuckyDrawTicket> findByEventUuidAndMemberUuid(@PathVariable("eventUuid") long eventUuid, @PathVariable("memberUuid") long memberUuid) {
|
||||
return eventLuckyDrawTicketService.findByEventUuidAndMemberUuid(eventUuid, memberUuid);
|
||||
}
|
||||
@GetMapping("/findByEventUuidAndMemberCode/{eventUuid}/{memberCode}")
|
||||
public List<EventLuckyDrawTicket> findByEventUuidAndMemberCode(@PathVariable("eventUuid") long eventUuid, @PathVariable("memberCode") String memberCode) {
|
||||
return eventLuckyDrawTicketService.findByEventUuidAndMemberCode(eventUuid, memberCode);
|
||||
}
|
||||
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.core.dto.EventRedeemDto;
|
||||
import com.solvway.services.counter.model.EventProduct;
|
||||
import com.solvway.services.counter.service.EventProductService;
|
||||
import com.solvway.services.counter.util.paging.PageableRest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.modelmapper.TypeToken;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigInteger;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/eventProduct")
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class EventProductController {
|
||||
private final ModelMapper modelMapper;
|
||||
private final EventProductService eventProductService;
|
||||
|
||||
@PostMapping("/save")
|
||||
public EventProduct save(@RequestBody EventProduct eventProduct) {
|
||||
return eventProductService.save(eventProduct);
|
||||
}
|
||||
|
||||
@GetMapping("/findByUuid/{uuid}")
|
||||
public Optional<EventProduct> findByUuid(@PathVariable("uuid") BigInteger uuid) {
|
||||
return eventProductService.findByUuid(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* doneBy
|
||||
* remarks
|
||||
* trxType
|
||||
* refNo
|
||||
* uuid
|
||||
* amount
|
||||
**/
|
||||
@PostMapping("/balanceAdjustment")
|
||||
public Boolean balanceAdjustment(@RequestBody Map<String, Object> requestBody) {
|
||||
return eventProductService.balanceAdjustment(requestBody);
|
||||
}
|
||||
@GetMapping("/getBalance/{uuid}")
|
||||
public Integer findBalanceByUuid(@PathVariable("uuid") BigInteger uuid) {
|
||||
return eventProductService.getEventProductBalance(uuid);
|
||||
}
|
||||
|
||||
@GetMapping("/findAllByEventUuid/{eventUuid}")
|
||||
public List<EventProduct> findAllByEventUuid(@PathVariable("eventUuid") BigInteger eventUuid) {
|
||||
return eventProductService.findAllByEventUuid(eventUuid);
|
||||
}
|
||||
@GetMapping("/findByEventUuid/{uuid}")
|
||||
public List<EventProduct> findByEventUuid(@PathVariable("uuid") BigInteger uuid) {
|
||||
return eventProductService.findByEventUuidWithAvailableBalance(uuid);
|
||||
}
|
||||
|
||||
@PostMapping("/findByPropertyAndPageable")
|
||||
public Page<EventProduct> findByPropertyAndPageable(@RequestBody HashMap<String, Object> param) {
|
||||
Type listType = new TypeToken<HashMap<String, String>>() {
|
||||
}.getType();
|
||||
HashMap<String, String> property = modelMapper.map(param.get("property"), listType);
|
||||
PageableRest pageable = modelMapper.map(param.get("pageableRest"), PageableRest.class);
|
||||
return eventProductService.findByPropertyAndPageable(property, pageable);
|
||||
}
|
||||
|
||||
@PostMapping("/redeemEventProduct")
|
||||
public EventRedeemDto redeemEventProduct(@RequestBody EventRedeemDto request) {
|
||||
return eventProductService.redeemEventProduct(request);
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.google.cloud.spring.pubsub.core.PubSubTemplate;
|
||||
import com.solvway.core.enums.OrderEnum;
|
||||
import com.solvway.core.utils.PubSubUtil;
|
||||
import com.solvway.core.utils.StackTraceUtil;
|
||||
import com.solvway.services.counter.configuration.PubSubConfig;
|
||||
import com.solvway.services.counter.model.EventAttendance;
|
||||
import com.solvway.services.counter.model.EventReceipt;
|
||||
import com.solvway.services.counter.model.EventReceiptDetail;
|
||||
import com.solvway.services.counter.service.EventReceiptDetailService;
|
||||
import com.solvway.services.counter.service.EventReceiptService;
|
||||
import com.solvway.services.counter.util.paging.PageableRest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.modelmapper.TypeToken;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigInteger;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/eventReceipt")
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class EventReceiptController {
|
||||
private final ModelMapper modelMapper;
|
||||
private final EventReceiptService eventReceiptService;
|
||||
private final EventReceiptDetailService eventReceiptDetailService;
|
||||
private final PubSubUtil pubSubUtil;
|
||||
private final PubSubConfig pubSubConfig;
|
||||
private final PubSubTemplate pubSubTemplate;
|
||||
@PostMapping("/save")
|
||||
public EventReceipt save(@RequestBody EventReceipt eventReceipt) {
|
||||
eventReceipt = eventReceiptService.save(eventReceipt);
|
||||
if (!OrderEnum.EventReceiptReviewStatus.A.equals(eventReceipt.getReviewStatus())) {
|
||||
return eventReceipt;
|
||||
}
|
||||
try {
|
||||
EventAttendance ea = new EventAttendance();
|
||||
ea.setOwnerUuid(new BigInteger(String.valueOf(eventReceipt.getMemberUuid())));
|
||||
ea.setEventUuid(eventReceipt.getEventUuid());
|
||||
ea.setAttendanceType(OrderEnum.EventAttendanceType.PR);
|
||||
ea.setCreateBy(eventReceipt.getCreateBy());
|
||||
ea.setDoneBy(eventReceipt.getDoneBy());
|
||||
String topic = pubSubConfig.eventAttendanceTopic;
|
||||
pubSubUtil.publishMessage(pubSubTemplate, topic, ea);
|
||||
} catch (Exception e) {
|
||||
StackTraceUtil.printStackTrace(log, e);
|
||||
}
|
||||
return eventReceipt;
|
||||
}
|
||||
@PostMapping("/findByPropertyAndPageable")
|
||||
public Page<EventReceipt> findByPropertyAndPageable(@RequestBody HashMap<String, Object> param) {
|
||||
Type listType = new TypeToken<HashMap<String, String>>() {
|
||||
}.getType();
|
||||
HashMap<String, String> property = modelMapper.map(param.get("property"), listType);
|
||||
PageableRest pageable = modelMapper.map(param.get("pageableRest"), PageableRest.class);
|
||||
//Page<EventReceipt> eventReceiptPage = eventReceiptService.findByPropertyAndPageable(property, pageable);
|
||||
// if(eventReceiptPage.hasContent()){
|
||||
// eventReceiptPage.get().parallel().forEach(er -> eventService.findByUuid(er.getUuid()).ifPresent(e->er.setDisplayEventName(e.getName())));
|
||||
// }
|
||||
// return eventReceiptPage;
|
||||
return eventReceiptService.findByPropertyAndPageable(property, pageable);
|
||||
}
|
||||
@GetMapping("/findByUuid/{uuid}")
|
||||
public Optional<EventReceipt> findByUuid(@PathVariable("uuid") long uuid) {
|
||||
return eventReceiptService.findByUuid(uuid);
|
||||
}
|
||||
@GetMapping("/findByEventUuidAndMemberUuid/{eventUuid}/{memberUuid}")
|
||||
public List<EventReceipt> findByEventUuidAndMemberUuid(@PathVariable("eventUuid") long eventUuid, @PathVariable("memberUuid") long memberUuid) {
|
||||
return eventReceiptService.findByEventUuidAndMemberUuid(eventUuid, memberUuid);
|
||||
}
|
||||
@GetMapping("/findByEventUuidAndMemberCode/{eventUuid}/{memberCode}")
|
||||
public List<EventReceipt> findByEventUuidAndMemberCode(@PathVariable("eventUuid") long eventUuid, @PathVariable("memberCode") String memberCode) {
|
||||
return eventReceiptService.findByEventUuidAndMemberCode(eventUuid, memberCode);
|
||||
}
|
||||
@GetMapping("/detail/findByEventReceiptUuid/{eventReceiptUuid}")
|
||||
public List<EventReceiptDetail> findDetailByEventReceiptUuid(@PathVariable("eventReceiptUuid") BigInteger eventReceiptUuid) {
|
||||
return eventReceiptDetailService.findByEventReceiptUuid(eventReceiptUuid);
|
||||
}
|
||||
@PostMapping("/detail/saveAll")
|
||||
public List<EventReceiptDetail> saveAllDetail(@RequestBody List<EventReceiptDetail> eventReceiptDetails) {
|
||||
return eventReceiptDetailService.saveAll(eventReceiptDetails);
|
||||
}
|
||||
@PostMapping("/detail/findByPropertyAndPageable")
|
||||
public Page<EventReceiptDetail> findDetailByPropertyAndPageable(@RequestBody HashMap<String, Object> param) {
|
||||
Type listType = new TypeToken<HashMap<String, String>>() {
|
||||
}.getType();
|
||||
HashMap<String, String> property = modelMapper.map(param.get("property"), listType);
|
||||
PageableRest pageable = modelMapper.map(param.get("pageableRest"), PageableRest.class);
|
||||
return eventReceiptDetailService.findByPropertyAndPageable(property, pageable);
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.EventRedeemCode;
|
||||
import com.solvway.services.counter.service.EventRedeemCodeService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/eventRedeemCode")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class EventRedeemCodeController {
|
||||
private final EventRedeemCodeService eventRedeemCodeService;
|
||||
|
||||
@GetMapping("/findByUuid/{uuid}")
|
||||
public Optional<EventRedeemCode> findByUuid(@PathVariable("uuid") long uuid) {
|
||||
return eventRedeemCodeService.findByUuid(uuid);
|
||||
}
|
||||
@GetMapping("/findByRedeemCode/{redeemCode}")
|
||||
public Optional<EventRedeemCode> findByRedeemCode(@PathVariable("redeemCode") String redeemCode) {
|
||||
return eventRedeemCodeService.findByRedeemCode(redeemCode);
|
||||
}
|
||||
@PostMapping("/save")
|
||||
public EventRedeemCode save(@RequestBody EventRedeemCode eventRedeemCode) {
|
||||
return eventRedeemCodeService.save(eventRedeemCode);
|
||||
}
|
||||
@PostMapping("/findByEventUuidAndMemberUuid")
|
||||
public List<EventRedeemCode> findByEventUuidAndMemberUuid(@RequestBody EventRedeemCode requestBody) {
|
||||
return eventRedeemCodeService.findByEventUuidAndMemberUuid(requestBody.getEventUuid(), requestBody.getMemberUuid());
|
||||
}
|
||||
@PostMapping("/findByEventUuidAndStockistUuidAndMemberUuid")
|
||||
public List<EventRedeemCode> findByEventUuidAndStockistUuidAndMemberUuid(@RequestBody EventRedeemCode requestBody) {
|
||||
return eventRedeemCodeService.findByEventUuidAndStockistUuidAndMemberUuid(requestBody.getEventUuid(), requestBody.getStockistUuid(), requestBody.getMemberUuid());
|
||||
}
|
||||
@GetMapping("/findByMemberUuid/{memberUuid}")
|
||||
public List<EventRedeemCode> findByMemberUuid(@PathVariable("memberUuid") long memberUuid) {
|
||||
return eventRedeemCodeService.findByMemberUuid(memberUuid);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.EventRewardPlus;
|
||||
import com.solvway.services.counter.model.EventRewardPlusDetail;
|
||||
import com.solvway.services.counter.service.EventRewardPlusService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/eventRewardPlus")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class EventRewardPlusController {
|
||||
private final EventRewardPlusService eventRewardPlusService;
|
||||
|
||||
@GetMapping("/findByUuid/{uuid}")
|
||||
public Optional<EventRewardPlus> findByUuid(@PathVariable("uuid") BigInteger uuid) {
|
||||
return eventRewardPlusService.findByUuid(uuid);
|
||||
}
|
||||
|
||||
@GetMapping("/detail/findByParentUuid/{uuid}")
|
||||
public List<EventRewardPlusDetail> findDetailsByParentUuid(@PathVariable("uuid") BigInteger uuid) {
|
||||
return eventRewardPlusService.findDetailsByParentUuid(uuid);
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.IssueDoListing;
|
||||
import com.solvway.services.counter.model.IssueDoListingWithDetails;
|
||||
import com.solvway.services.counter.service.IssueDoListingService;
|
||||
import com.solvway.services.counter.service.IssueDoListingWithDetailsService;
|
||||
import com.solvway.services.counter.util.paging.PageableRest;
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.modelmapper.TypeToken;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RequestMapping("/counter")
|
||||
@RestController
|
||||
|
||||
public class IssueDoListingController {
|
||||
|
||||
@Autowired
|
||||
private IssueDoListingService issueDoListingService;
|
||||
|
||||
@Autowired
|
||||
private IssueDoListingWithDetailsService issueDoListingWithDetailsService;
|
||||
|
||||
@Autowired
|
||||
private ModelMapper modelMapper;
|
||||
|
||||
@RequestMapping("/order/issueDoListing")
|
||||
public Page<IssueDoListing> issueDoListing(@RequestBody HashMap<String, Object> param) {
|
||||
Type listType = new TypeToken<HashMap<String, String>>() {}.getType();
|
||||
HashMap<String, String> property = modelMapper.map(param.get("property"), listType);
|
||||
PageableRest pageable = modelMapper.map(param.get("pageableRest"), PageableRest.class);
|
||||
|
||||
Page<IssueDoListing> orders = null;
|
||||
|
||||
orders = issueDoListingService.findListingByPropertyAndPageable(property, pageable);
|
||||
|
||||
return orders;
|
||||
}
|
||||
|
||||
@RequestMapping("/order/findByUuidWithoutDetails/{uuid}")
|
||||
public IssueDoListing findByUuidWithoutDetails(@PathVariable("uuid") String uuid) {
|
||||
Optional<IssueDoListing> order = issueDoListingService.findByUuid(uuid);
|
||||
return order.isPresent() ? order.get() : null;
|
||||
}
|
||||
|
||||
@RequestMapping("/order/findByDocumentNoWithoutDetails/{documentNo}")
|
||||
public IssueDoListing findByDocumentNoWithoutDetails(@PathVariable("documentNo") String documentNo) {
|
||||
Optional<IssueDoListing> order = issueDoListingService.findByDocumentNo(documentNo);
|
||||
return order.isPresent() ? order.get() : null;
|
||||
}
|
||||
|
||||
@RequestMapping("/order/findByUuidWithDetails/{uuid}")
|
||||
public IssueDoListingWithDetails findByUuidWithDetails(@PathVariable("uuid") String uuid) {
|
||||
Optional<IssueDoListingWithDetails> order = issueDoListingWithDetailsService.findByUuid(uuid);
|
||||
return order.isPresent() ? order.get() : null;
|
||||
}
|
||||
|
||||
@RequestMapping("/order/findByUuidInWithoutDetails")
|
||||
public List<IssueDoListing> findByIdIn(@RequestBody String[] uuids) {
|
||||
List<IssueDoListing> orders = issueDoListingService.findByUuidIn(uuids);
|
||||
return orders;
|
||||
}
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.MainCart;
|
||||
import com.solvway.services.counter.service.MainCartService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@RequestMapping("/counter/mainCart")
|
||||
@RestController
|
||||
|
||||
|
||||
public class MainCartController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(CartController.class);
|
||||
|
||||
@Autowired
|
||||
private MainCartService mainCartService;
|
||||
|
||||
@RequestMapping("/save")
|
||||
public MainCart save(@RequestBody MainCart cart) {
|
||||
try {
|
||||
return mainCartService.save(cart);
|
||||
}catch(Exception e) {
|
||||
log.error(e.getLocalizedMessage(),e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@RequestMapping("/deleteById/{id}")
|
||||
public void deleteById(@PathVariable("id") long id) {
|
||||
try {
|
||||
mainCartService.deleteById(id);
|
||||
}catch(Exception e) {
|
||||
log.error(e.getLocalizedMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/deleteByMemberId/{memberId}")
|
||||
public long deleteByMemberId(@PathVariable("memberId") String memberId) {
|
||||
try {
|
||||
return mainCartService.deleteByMemberId(memberId);
|
||||
}catch(Exception e) {
|
||||
log.error(e.getLocalizedMessage(),e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@RequestMapping("/findByMemberId/{memberId}")
|
||||
public MainCart findByMemberId(@PathVariable("memberId") String memberId) {
|
||||
return mainCartService.findByMemberId(memberId);
|
||||
}
|
||||
|
||||
@RequestMapping("/findById/{id}")
|
||||
public Optional<MainCart> findById(@PathVariable("id") long id) {
|
||||
return mainCartService.findById(id);
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.core.dto.MemberVoucherEligibilityRequest;
|
||||
import com.solvway.core.dto.MemberVoucherRedeemRequest;
|
||||
import com.solvway.core.dto.MemberVoucherRedeemResult;
|
||||
import com.solvway.core.model.MemberVoucherEligibility;
|
||||
import com.solvway.services.counter.model.MemberVoucher;
|
||||
import com.solvway.services.counter.model.MemberVoucherRedemption;
|
||||
import com.solvway.services.counter.service.MemberVoucherService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/counter/memberVoucher")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class MemberVoucherController {
|
||||
|
||||
private final MemberVoucherService memberVoucherService;
|
||||
|
||||
@PostMapping("/save")
|
||||
public MemberVoucher save(@RequestBody MemberVoucher memberVoucher) {
|
||||
return memberVoucherService.save(memberVoucher);
|
||||
}
|
||||
|
||||
@GetMapping("/findByUuid/{uuid}")
|
||||
public Optional<MemberVoucher> findByUuid(@PathVariable("uuid") long uuid) {
|
||||
return memberVoucherService.findByUuid(uuid);
|
||||
}
|
||||
|
||||
@GetMapping("/findAll")
|
||||
public List<MemberVoucher> findAll() {
|
||||
return memberVoucherService.findAll();
|
||||
}
|
||||
|
||||
@PostMapping("/findEligibility")
|
||||
public List<MemberVoucherEligibility> findEligibility(@RequestBody MemberVoucherEligibilityRequest request) {
|
||||
return memberVoucherService.findEligibilityForMember(request.getMemberUuid(), request.isProfileComplete());
|
||||
}
|
||||
|
||||
@PostMapping("/redeem")
|
||||
public MemberVoucherRedeemResult redeem(@RequestBody MemberVoucherRedeemRequest request) {
|
||||
return memberVoucherService.redeem(request);
|
||||
}
|
||||
|
||||
/** voucherUuid / memberUuid of 0 mean "no filter on that field". */
|
||||
@PostMapping("/findRedemptions")
|
||||
public List<MemberVoucherRedemption> findRedemptions(@RequestBody MemberVoucherRedemption filter) {
|
||||
Long voucherUuid = filter.getVoucherUuid() > 0 ? filter.getVoucherUuid() : null;
|
||||
Long memberUuid = filter.getMemberUuid() > 0 ? filter.getMemberUuid() : null;
|
||||
return memberVoucherService.findRedemptions(voucherUuid, memberUuid);
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.solvway.services.counter.controller;
|
||||
|
||||
import com.solvway.services.counter.model.PromotionCode;
|
||||
import com.solvway.services.counter.model.PromotionCodeUse;
|
||||
import com.solvway.services.counter.service.PromotionCodeService;
|
||||
import com.solvway.services.counter.service.PromotionCodeUseService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@RequestMapping("/counter/promotion")
|
||||
@RestController
|
||||
public class PromotionCodeController {
|
||||
|
||||
@Autowired
|
||||
private PromotionCodeService promotionCodeService;
|
||||
|
||||
@Autowired
|
||||
private PromotionCodeUseService promotionCodeUseService;
|
||||
|
||||
@RequestMapping("/code/findByCode/{code}")
|
||||
public Optional<PromotionCode> findByCode(@PathVariable("code")String code) {
|
||||
return promotionCodeService.findByCode(code);
|
||||
}
|
||||
|
||||
@RequestMapping("/use/findByMemberIdAndPromotionCode/{memberId}/{promotionCode}")
|
||||
public Optional<PromotionCodeUse> findByMemberIdAndPromotionCode(@PathVariable("memberId")Long memberId, @PathVariable("promotionCode")String promotionCode) {
|
||||
return promotionCodeUseService.findByMemberIdAndPromotionCode(memberId, promotionCode);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.solvway.services.counter.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class CounterProductSkuDto {
|
||||
private CounterSkuVariationDto skuVariation;
|
||||
private int qty;
|
||||
private int qtyFoc;
|
||||
private int qtyLeft;
|
||||
private int qtyFocLeft;
|
||||
@JsonIgnore
|
||||
private int qtyBackOrder;
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.solvway.services.counter.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.solvway.services.counter.model.Sku;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class CounterSkuVariationDto {
|
||||
|
||||
private long id;
|
||||
|
||||
private String svPrefix;
|
||||
|
||||
private String svVariant;
|
||||
|
||||
private String svVariantName;
|
||||
|
||||
private Timestamp svTransactiontime;
|
||||
|
||||
@JsonIgnore
|
||||
private String skuName;
|
||||
private Sku sku;
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.solvway.services.counter.dto;
|
||||
|
||||
import com.solvway.core.model.CounterProduct;
|
||||
import com.solvway.core.model.Pricing;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class CounterVariationDto implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3156617923281222274L;
|
||||
private long id;
|
||||
private String vPrefix;
|
||||
private String vRefId;
|
||||
private String vType;
|
||||
private String vVariant;
|
||||
private String vVariantName;
|
||||
private Timestamp vTransactiontime;
|
||||
|
||||
private Long counterProductId;
|
||||
private CounterProduct product;
|
||||
//Each Product Variation might contains multiple SkuVariation
|
||||
private List<CounterProductSkuDto> productSku;
|
||||
|
||||
//Temporary Pricing
|
||||
private Pricing pricing;
|
||||
private CounterProduct preloadProduct;
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class AaStresstest {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name="orders")
|
||||
public class ApproveSalesOrderListing extends OrdersGeneral implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//MappedBy OrdersDetails.order
|
||||
@OneToMany( fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
|
||||
@JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
private List<OrdersDetails> details;
|
||||
|
||||
@OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
|
||||
@JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
private List<OrdersPayments> payments;
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class BeFitInvoiceDto {
|
||||
private String documentNo;
|
||||
private LocalDate transactionDate;
|
||||
private String countryCode;
|
||||
private double grandTotal;
|
||||
private String buyerCode;
|
||||
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.OrderEnum.CreditNoteTrxType;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name = "credit_note")
|
||||
public class BonusCreditNote{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String uuid;
|
||||
private String countryCode;
|
||||
private String branchCode;
|
||||
private String documentNo;
|
||||
private LocalDate bonusDate;
|
||||
private LocalDateTime transactionDateTime;
|
||||
private String bonusDateRemark;
|
||||
//Default to StockReturn as BE mostly use StockReturn not VoidSales
|
||||
@Enumerated(EnumType.STRING)
|
||||
private CreditNoteTrxType trxType = CreditNoteTrxType.SR;
|
||||
private String creditNoteRemarks;
|
||||
private Long stockReturnId;
|
||||
// @Column(name = "order_id")
|
||||
// private Long orderId;
|
||||
private String currencySymbol;
|
||||
private double currencyRate;
|
||||
private double totalAmount;
|
||||
private double roundingAdjustment;
|
||||
private double adminFee;
|
||||
private double grandTotal;
|
||||
private double totalBv;
|
||||
private double totalSv;
|
||||
private LocalDateTime createDateTime;
|
||||
|
||||
//Unidirectional Mapping
|
||||
// @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
|
||||
// @JoinColumn(name = "credit_note_uuid", referencedColumnName = "uuid")
|
||||
// @NotFound(action = NotFoundAction.IGNORE)
|
||||
// @Fetch(value = FetchMode.SUBSELECT)
|
||||
// private List<CreditNoteTaxation> taxations;
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "order_id", referencedColumnName = "id")
|
||||
@NotFound(action = NotFoundAction.IGNORE)
|
||||
@Fetch(value = FetchMode.SELECT)
|
||||
private BonusOrders order;
|
||||
|
||||
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum.CmsPlatform;
|
||||
import com.solvway.core.enums.GeneralEnum.FlagYesNo;
|
||||
import com.solvway.core.enums.OrderEnum.OrderStatus;
|
||||
import com.solvway.core.enums.OrderEnum.TrxType;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name = "orders")
|
||||
public class BonusOrders implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String uuid;
|
||||
private LocalDateTime transactionDateTime;
|
||||
private LocalDate bonusDate;
|
||||
private String countryCode;
|
||||
private String branchCode;
|
||||
private String documentNo;
|
||||
private Long buyerId;
|
||||
private String buyerCode;
|
||||
private double totalAmount;
|
||||
private double totalBv;
|
||||
private double totalSv;
|
||||
private double roundingAdjustment;
|
||||
private double shippingCost;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private TrxType trxType;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderStatus status = OrderStatus.P;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo voidedFlag = FlagYesNo.N;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private CmsPlatform sourcePlatform = CmsPlatform.BO;
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name="orders_details")
|
||||
public class BonusOrdersDetails implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -779692121188489135L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(name="order_uuid")
|
||||
private String orderUuid;
|
||||
private int qty;
|
||||
// @Convert(converter = JSONColumnConverter.class)
|
||||
// private JSONObject variation;
|
||||
private String virtualProductCode;
|
||||
|
||||
// public JSONObject getVariation() {
|
||||
// return variation;
|
||||
// }
|
||||
//
|
||||
// public void setVariation(JSONObject variation) {
|
||||
// this.variation = variation;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
public class Cart {
|
||||
@Setter
|
||||
@Getter
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Setter
|
||||
@Getter
|
||||
private String memberId;
|
||||
@Setter
|
||||
@Getter
|
||||
private String variationId;
|
||||
@Setter
|
||||
@Getter
|
||||
private int quantity;
|
||||
private boolean isSalesKit;
|
||||
@Setter
|
||||
@Getter
|
||||
private LocalDateTime createDateTime;
|
||||
|
||||
public boolean isSalesKit() {
|
||||
return isSalesKit;
|
||||
}
|
||||
public void setSalesKit(boolean isSalesKit) {
|
||||
this.isSalesKit = isSalesKit;
|
||||
}
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ChangeDeliveryAddress {
|
||||
private String uuid;
|
||||
private String deliveryGeoLocationId;
|
||||
private String postcode;
|
||||
private String addressDetails;
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class CheckInBooth implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private long memberUuid;
|
||||
private long eventUuid;
|
||||
private long stockistUuid;
|
||||
private LocalDateTime checkInDateTime = LocalDateTime.now();
|
||||
private LocalDate checkInDate = LocalDate.now();
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo enabled = GeneralEnum.FlagYesNo.Y;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class CheckInEvent {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private long memberUuid;
|
||||
private long eventUuid;
|
||||
private LocalDateTime checkInDateTime = LocalDateTime.now();
|
||||
private LocalDate checkInDate = LocalDate.now();
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo enabled = GeneralEnum.FlagYesNo.Y;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.HierarchyEnum.ConfigCountryType;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ConfigCountry implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Long id;
|
||||
|
||||
|
||||
private List<TaxationSetup> taxationSetupList = new ArrayList<>();
|
||||
|
||||
private ConfigCountryType type;
|
||||
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.OrderEnum.CreditNoteTrxType;
|
||||
import com.solvway.core.model.StockReturn;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class CreditNote implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String uuid;
|
||||
private String effectiveBuyerCode;
|
||||
private String countryCode;
|
||||
private String branchCode;
|
||||
private String documentNo;
|
||||
private LocalDate bonusDate;
|
||||
private LocalDateTime transactionDateTime;
|
||||
private String bonusDateRemark;
|
||||
|
||||
//Default to StockReturn as BE mostly use StockReturn not VoidSales
|
||||
@Enumerated(EnumType.STRING)
|
||||
private CreditNoteTrxType trxType = CreditNoteTrxType.SR;
|
||||
private String creditNoteRemarks;
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name = "order_id", referencedColumnName = "id")
|
||||
@NotFound(action = NotFoundAction.IGNORE)
|
||||
@Fetch(value = FetchMode.SELECT)
|
||||
private Orders order;
|
||||
private Long stockReturnId;
|
||||
private String currencySymbol;
|
||||
private double currencyRate;
|
||||
private double shippingCost;
|
||||
private double totalAmount;
|
||||
private double roundingAdjustment;
|
||||
private double adminFee;
|
||||
private double grandTotal;
|
||||
private double totalBv;
|
||||
private double totalSv;
|
||||
private String doneBy;
|
||||
private String createBy;
|
||||
private LocalDateTime createDateTime;
|
||||
private int printCount;
|
||||
|
||||
//Unidirectional Mapping
|
||||
@OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
|
||||
@JoinColumn(name = "credit_note_uuid", referencedColumnName = "uuid")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
private List<CreditNoteTaxation> taxations;
|
||||
|
||||
@Transient
|
||||
private StockReturn stockReturn;
|
||||
|
||||
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum.FlagYesNo;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class CreditNoteTaxation {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(name="credit_note_uuid")
|
||||
private String creditNoteUuid;
|
||||
// public Orders getOrder() {
|
||||
// return order;
|
||||
// }
|
||||
// public void setOrder(Orders order) {
|
||||
// this.order = order;
|
||||
// }
|
||||
//@ManyToOne(targetEntity = Orders.class, fetch = FetchType.EAGER)
|
||||
// @ManyToOne(targetEntity = Orders.class)
|
||||
// @JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
// @JsonBackReference
|
||||
// private Orders order;
|
||||
private double taxAmount;
|
||||
private String messageTag;
|
||||
private double percentage;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo inclusive = FlagYesNo.N;
|
||||
private String doneBy;
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name="orders")
|
||||
public class DailyCollectionReport extends OrdersGeneral implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.REFRESH})
|
||||
@JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
private List<OrdersPayments> payments;
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.DeliveryOrderEnum.DeliveryChargesStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DeliveryCharges {
|
||||
|
||||
private long id;
|
||||
|
||||
private String countryFrom;
|
||||
private String countryTo;
|
||||
|
||||
private LocalDateTime effectiveDate;
|
||||
|
||||
private String description;
|
||||
private String courierName;
|
||||
private String currencySymbol;
|
||||
private boolean freeDeliveryCharges;
|
||||
private DeliveryChargesStatus status;
|
||||
|
||||
private boolean useFlatRate;
|
||||
private DeliveryFlatRateCharges flatRateCharges;
|
||||
|
||||
private boolean useWeight;
|
||||
private DeliveryWeightCharges weightCharges;
|
||||
|
||||
private boolean useVolume;
|
||||
private DeliveryVolumeCharges volumeCharges;
|
||||
|
||||
private boolean usePackaging;
|
||||
private DeliveryPackagingCharges packagingCharges;
|
||||
|
||||
private List<DeliveryChargesZone> zones;
|
||||
private List<PickupPointType> types;
|
||||
|
||||
private String createby;
|
||||
private LocalDateTime createDateTime;
|
||||
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DeliveryChargesCampaign {
|
||||
|
||||
private long id;
|
||||
private LocalDateTime effectiveDateFrom;
|
||||
private LocalDateTime effectiveDateTo;
|
||||
private String geoLocationId;
|
||||
private double priceApply;
|
||||
private double discountRate;
|
||||
private String status;
|
||||
private LocalDateTime createDateTime;
|
||||
private String createBy;
|
||||
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.DeliveryOrderEnum.DeliveryChargesStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DeliveryChargesZone {
|
||||
|
||||
|
||||
private long id;
|
||||
private String geoLocationId;
|
||||
private DeliveryChargesStatus status;
|
||||
|
||||
private DeliveryCharges deliveryCharges;
|
||||
|
||||
public DeliveryChargesZone() {
|
||||
|
||||
}
|
||||
|
||||
public DeliveryChargesZone(DeliveryCharges deliveryCharges) {
|
||||
this.deliveryCharges = deliveryCharges;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DeliveryFlatRateCharges {
|
||||
|
||||
|
||||
private long id;
|
||||
|
||||
private DeliveryCharges deliveryCharges;
|
||||
|
||||
@Getter
|
||||
public enum FlatRateBaseType{
|
||||
B("BV"),S("SV"), P("PRICE");
|
||||
private final String type;
|
||||
FlatRateBaseType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private FlatRateBaseType flatRateBaseType;
|
||||
private double onlyApplyToAmountBelow;
|
||||
private double flatRateCharges;
|
||||
|
||||
public DeliveryFlatRateCharges() {
|
||||
|
||||
}
|
||||
|
||||
public DeliveryFlatRateCharges(DeliveryCharges deliveryCharges) {
|
||||
this.deliveryCharges = deliveryCharges;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.DeliveryOrderEnum.DeliveryChargesStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DeliveryPackagingCharges {
|
||||
|
||||
|
||||
private long id;
|
||||
|
||||
private DeliveryCharges deliveryCharges;
|
||||
|
||||
private List<DeliveryPackagingChargesRange> deliveryPackagingChargesRange;
|
||||
|
||||
private DeliveryChargesStatus status;
|
||||
|
||||
public DeliveryPackagingCharges() {
|
||||
|
||||
}
|
||||
|
||||
public DeliveryPackagingCharges(DeliveryCharges deliveryCharges) {
|
||||
this.setDeliveryCharges(deliveryCharges);
|
||||
}
|
||||
|
||||
public void addDeliveryPackagingChargesRange(DeliveryPackagingChargesRange... deliveryPackagingChargesRange) {
|
||||
|
||||
if(this.deliveryPackagingChargesRange == null) {
|
||||
this.deliveryPackagingChargesRange = new ArrayList<>();
|
||||
}
|
||||
|
||||
this.deliveryPackagingChargesRange.addAll(Stream.of(deliveryPackagingChargesRange).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DeliveryPackagingChargesRange {
|
||||
|
||||
|
||||
private long id;
|
||||
private double rangeFrom;
|
||||
private double rangeTo;
|
||||
private double charges;
|
||||
|
||||
private DeliveryPackagingCharges deliveryPackagingCharges;
|
||||
|
||||
|
||||
public DeliveryPackagingChargesRange() {}
|
||||
|
||||
public DeliveryPackagingChargesRange(DeliveryPackagingCharges deliveryPackagingCharges) {
|
||||
this.deliveryPackagingCharges = deliveryPackagingCharges;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.Enumerated;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DeliveryVolumeCharges {
|
||||
|
||||
private long id;
|
||||
private DeliveryCharges deliveryCharges;
|
||||
|
||||
/**
|
||||
* Type 1 is only apply when hit certain Volume
|
||||
* <br>
|
||||
* Type 2 is first certain Volume, and subsequent Volume charge
|
||||
*/
|
||||
@Getter
|
||||
public enum VolumeType{
|
||||
T1("TYPE1"), T2("TYPE2");
|
||||
private final String type;
|
||||
VolumeType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private VolumeType volumeType;
|
||||
|
||||
// for type 1
|
||||
private double onlyApplyToVolumeMoreThan;
|
||||
private double chargesType1;
|
||||
|
||||
// for type 2
|
||||
private double firstVolume;
|
||||
private double firstVolumeCharges;
|
||||
private double subSequentVolume;
|
||||
private double subSequentVolumeCharges;
|
||||
|
||||
public DeliveryVolumeCharges() {
|
||||
|
||||
}
|
||||
public DeliveryVolumeCharges(DeliveryCharges deliveryCharges) {
|
||||
this.deliveryCharges = deliveryCharges;
|
||||
}
|
||||
|
||||
public VolumeType getVolume() {
|
||||
return volumeType;
|
||||
}
|
||||
public void setVolume(VolumeType volumeType) {
|
||||
this.volumeType = volumeType;
|
||||
}
|
||||
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DeliveryWeightCharges {
|
||||
|
||||
private long id;
|
||||
|
||||
private DeliveryCharges deliveryCharges;
|
||||
|
||||
/**
|
||||
* Type 1 is only apply when hit certain weight
|
||||
* <br>
|
||||
* Type 2 is first certain weight, and subsequent weight charge
|
||||
*/
|
||||
@Getter
|
||||
public enum WeightType{
|
||||
T1("TYPE1"), T2("TYPE2");
|
||||
private final String type;
|
||||
WeightType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
private WeightType weightType;
|
||||
|
||||
// for type 1
|
||||
private double onlyApplyToWeightMoreThan;
|
||||
private double chargesType1;
|
||||
|
||||
// for type 2
|
||||
private double firstWeight;
|
||||
private double firstWeightCharges;
|
||||
private double subSequentWeight;
|
||||
private double subSequentWeightCharges;
|
||||
|
||||
|
||||
public DeliveryWeightCharges() {
|
||||
|
||||
}
|
||||
|
||||
public DeliveryWeightCharges(DeliveryCharges deliveryCharges) {
|
||||
this.setDeliveryCharges(deliveryCharges);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.OrderEnum.CreditNoteTrxType;
|
||||
import com.solvway.core.model.StockReturn;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DocCreditNote {
|
||||
@Id
|
||||
private String id;
|
||||
private String uuid;
|
||||
private String effectiveBuyerCode;
|
||||
private String documentNo;
|
||||
private LocalDate bonusDate;
|
||||
private LocalDateTime transactionDateTime;
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
private DocOrder order;
|
||||
private StockReturn stockReturn;
|
||||
//Default to StockReturn as BE mostly use StockReturn not VoidSales
|
||||
private CreditNoteTrxType trxType = CreditNoteTrxType.SR;
|
||||
private String creditNoteRemarks;
|
||||
private String doneBy;
|
||||
private String createBy;
|
||||
|
||||
private String currencySymbol;
|
||||
private double currencyRate;
|
||||
private double shippingCost;
|
||||
private double totalAmount;
|
||||
private double roundingAdjustment;
|
||||
private double adminFee;
|
||||
private double grandTotal;
|
||||
private double totalBv;
|
||||
private double totalSv;
|
||||
|
||||
private List<Object> taxations;
|
||||
|
||||
public String getCurrencySymbolDisplay() {
|
||||
if(StringUtils.isEmpty(this.currencySymbol)) {
|
||||
return "";
|
||||
}else {
|
||||
return " ("+this.currencySymbol+")";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.solvway.core.enums.GeneralEnum.CmsPlatform;
|
||||
import com.solvway.core.enums.GeneralEnum.FlagYesNo;
|
||||
import com.solvway.core.enums.OrderEnum;
|
||||
import com.solvway.core.enums.OrderEnum.BuyerType;
|
||||
import com.solvway.core.enums.OrderEnum.TrxType;
|
||||
import com.solvway.core.enums.PaymentEnum.PaymentTerm;
|
||||
import com.solvway.core.model.Buyer;
|
||||
import com.solvway.core.model.PickupPointOsn;
|
||||
import com.solvway.services.counter.util.converter.PickupPointOsnColumnConverter;
|
||||
import jakarta.persistence.Convert;
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.Enumerated;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DocOrder implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
private String id;
|
||||
private String uuid;
|
||||
private LocalDateTime transactionDateTime;
|
||||
private LocalDate bonusDate;
|
||||
private String countryCode;
|
||||
private String branchCode;
|
||||
private String invoicePrefix;
|
||||
private String documentNo;
|
||||
private String currencySymbol;
|
||||
private double currencyRate;
|
||||
private double totalAmount;
|
||||
private double totalDiscount;
|
||||
|
||||
private double grandTotal;
|
||||
|
||||
private double totalBv;
|
||||
private double totalSv;
|
||||
private double roundingAdjustment;
|
||||
private Long buyerId;
|
||||
private String buyerCode;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private BuyerType buyerType = BuyerType.G;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private TrxType trxType;
|
||||
private LocalDateTime createDate = LocalDateTime.now();
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
//@Convert(converter = JSONColumnConverter.class)
|
||||
private String location;
|
||||
private List<Object> details;
|
||||
private List<Object> payments;
|
||||
private List<Object> taxations;
|
||||
private Buyer buyer;
|
||||
private String buyerAddress="";
|
||||
|
||||
private String selfServiceId;
|
||||
private String doneBy;
|
||||
private String createBy;
|
||||
private String remark;
|
||||
private String paymentRemark;
|
||||
private String paymentReference;
|
||||
private String prvNo;
|
||||
private String invoiceHeader;
|
||||
private String invoiceFooter;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PaymentTerm paymentTerm = PaymentTerm.PF;
|
||||
//For Void Sales
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo voidedFlag = FlagYesNo.N;
|
||||
private String voidedReason="";
|
||||
private String voidedBy;
|
||||
private LocalDateTime voidedDateTime;
|
||||
private List<JsonObject> backOrderSummary;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private CmsPlatform sourcePlatform = CmsPlatform.BO;
|
||||
|
||||
//for delivery & pickup
|
||||
private double shippingCost;
|
||||
private double totalWeight;
|
||||
private boolean deliveryOption;
|
||||
private String receiver;
|
||||
private String contactNo;
|
||||
private String deliveryGeoLocationId;
|
||||
private String addressDetails;
|
||||
private String postcode;
|
||||
private boolean pickupOption;
|
||||
private String pickupPoint;
|
||||
private String pickupPointLocation;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo fromEmrm = FlagYesNo.N;
|
||||
private String town;
|
||||
@Convert(converter = PickupPointOsnColumnConverter.class)
|
||||
private PickupPointOsn pickupPointOsn;
|
||||
private LocalDate pickupDate;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderEnum.OsnPickupSlot pickupSlot = OrderEnum.OsnPickupSlot.NA;
|
||||
private int pickupPointOption;
|
||||
|
||||
//STOCKIST
|
||||
private double stockistDepositBalance;
|
||||
|
||||
private String copy;
|
||||
|
||||
private String promotionCode;
|
||||
|
||||
public String getCurrencySymbolDisplay() {
|
||||
if(StringUtils.isEmpty(this.currencySymbol)) {
|
||||
return "";
|
||||
}else {
|
||||
return " ("+this.currencySymbol+")";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class Event implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private long uuid = SnowflakeIdWorker.getUUID();
|
||||
private String name;
|
||||
private String location;
|
||||
private LocalDateTime dateStart;
|
||||
private LocalDateTime dateEnd;
|
||||
private String uploadFloorPlan;
|
||||
private String uploadStageActivities;
|
||||
private String uploadLuckyDraw;
|
||||
private String uploadTasteRewards;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo enabled = GeneralEnum.FlagYesNo.Y;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.OrderEnum;
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class EventAttendance {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private BigInteger uuid = SnowflakeIdWorker.getUUIDBi();
|
||||
private BigInteger ownerUuid;
|
||||
private long eventUuid;
|
||||
private LocalDateTime actionDateTime = LocalDateTime.now();
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderEnum.EventAttendanceType attendanceType = OrderEnum.EventAttendanceType.NA;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class EventBooth {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private long uuid = SnowflakeIdWorker.getUUID();
|
||||
@Column(updatable = false)
|
||||
private long eventUuid;
|
||||
@Column(updatable = false)
|
||||
private long stockistUuid;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo welcomeGift = GeneralEnum.FlagYesNo.Y;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo welcomeGiftDailyBasis = GeneralEnum.FlagYesNo.Y;
|
||||
private int welcomeGiftMaxPerUser=0;
|
||||
private int welcomeGiftDailyCap=0;
|
||||
private int welcomeGiftEventCap=0;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo enabled = GeneralEnum.FlagYesNo.Y;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
|
||||
@Transient
|
||||
private String stockistName;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class EventGiftWithPurchase {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private long eventUuid;
|
||||
private long memberUuid;
|
||||
private int redeemedCount;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo enabled = GeneralEnum.FlagYesNo.Y;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class EventLuckyDrawTicket {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private long uuid = SnowflakeIdWorker.getUUID();
|
||||
private Long eventUuid;
|
||||
private Long receiptUuid;
|
||||
private Long memberUuid;
|
||||
private String memberCode;
|
||||
private String ticketNumber;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo enabled = GeneralEnum.FlagYesNo.Y;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class EventProduct {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private BigInteger uuid = SnowflakeIdWorker.getUUIDBi();
|
||||
private BigInteger eventUuid;
|
||||
private String displayName;
|
||||
private String uploadPath;
|
||||
private double costAmount;
|
||||
private String addOnCostLabel;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo enabled = GeneralEnum.FlagYesNo.Y;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
// Computed available stock (ledger balance − frozen) for the store feed.
|
||||
// Not persisted; populated only on the store-facing findByEventUuid path.
|
||||
@Transient
|
||||
private int stockBalance;
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.converter.ListToJsonColumnConverter;
|
||||
import com.solvway.core.enums.OrderEnum;
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class EventReceipt {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private long uuid = SnowflakeIdWorker.getUUID();
|
||||
private long eventUuid;
|
||||
private long memberUuid;
|
||||
private String memberCode;
|
||||
private LocalDateTime uploadDateTime;
|
||||
@Convert(converter = ListToJsonColumnConverter.class)
|
||||
private List<String> uploadPath = new ArrayList<>();
|
||||
private double purchaseAmount;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderEnum.EventReceiptReviewStatus reviewStatus = OrderEnum.EventReceiptReviewStatus.P;
|
||||
private String reviewRemarks;
|
||||
private String reviewedBy;
|
||||
private LocalDateTime reviewedDateTime;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
|
||||
@Transient
|
||||
private String displayEventName;
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Setter
|
||||
@Getter
|
||||
public class EventReceiptDetail {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private BigInteger uuid;
|
||||
private BigInteger eventUuid;
|
||||
private BigInteger memberUuid;
|
||||
private BigInteger eventReceiptUuid;
|
||||
private BigInteger stockistUuid;
|
||||
private String stockistName;
|
||||
private double amount;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private GeneralEnum.FlagYesNo enabled = GeneralEnum.FlagYesNo.Y;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.OrderEnum;
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class EventRedeemCode implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private long uuid = SnowflakeIdWorker.getUUID();
|
||||
private long eventUuid;
|
||||
private long stockistUuid;
|
||||
private long memberUuid;
|
||||
private String redeemCode;
|
||||
private String name;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderEnum.EventRedeemCodeStatus redeemStatus = OrderEnum.EventRedeemCodeStatus.Y;
|
||||
private LocalDateTime redeemedDateTime;
|
||||
private LocalDateTime expiryDateTime;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class EventRewardPlus {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private BigInteger uuid = SnowflakeIdWorker.getUUIDBi();
|
||||
private BigInteger ownerUuid;
|
||||
private BigInteger eventUuid;
|
||||
private LocalDateTime transactionDateTime;
|
||||
private double totalAmount;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
public class EventRewardPlusDetail {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private BigInteger uuid = SnowflakeIdWorker.getUUIDBi();
|
||||
private BigInteger parentUuid;
|
||||
private BigInteger productUuid;
|
||||
private String productJson;
|
||||
private int quantity;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class HistoryBuyer {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String orderId;
|
||||
private String documentNo;
|
||||
private String uuid;
|
||||
private String buyerId;
|
||||
private String buyerCode;
|
||||
private String newBuyerId;
|
||||
private String newBuyerCode;
|
||||
private String newBuyer;
|
||||
private String doneBy;
|
||||
private LocalDateTime createDateTime;
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class HistoryCreditNoteBonusDate {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String orderId;
|
||||
private String documentNo;
|
||||
private String orderDocumentNo;
|
||||
private String uuid;
|
||||
private LocalDate oldBonusDate;
|
||||
private LocalDate newBonusDate;
|
||||
private String doneBy;
|
||||
private LocalDateTime createDateTime;
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.converter.JSONColumnConverter;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class HistoryOrderBonusDate {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String orderId;
|
||||
private String documentNo;
|
||||
private String uuid;
|
||||
private LocalDate oldBonusDate;
|
||||
private LocalDate newBonusDate;
|
||||
private String bonusDateRemark;
|
||||
private String doneBy;
|
||||
private LocalDateTime createDateTime;
|
||||
@Convert(converter = JSONColumnConverter.class)
|
||||
private JSONObject buyer;
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class HistoryOrderSalesStatus {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String orderId;
|
||||
private String documentNo;
|
||||
private String uuid;
|
||||
private String doneBy;
|
||||
private String oldStatus;
|
||||
private String newStatus;
|
||||
private String statusRemark;
|
||||
private LocalDateTime createDateTime;
|
||||
private String buyerId;
|
||||
private String buyerCode;
|
||||
private String buyerName;
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class HistoryOrderTransactionDateTime {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String orderId;
|
||||
private String uuid;
|
||||
private LocalDateTime transactionDateTime;
|
||||
private LocalDateTime newTransactionDateTime;
|
||||
private String remarks;
|
||||
private LocalDateTime createDateTime;
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import com.solvway.core.converter.JSONColumnConverter;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name="orders_details")
|
||||
public class IssueDoDetailsListing {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
//@ManyToOne(targetEntity = Orders.class, fetch = FetchType.EAGER)
|
||||
@ManyToOne(targetEntity = IssueDoListing.class)
|
||||
@JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
@JsonBackReference
|
||||
// @Fetch(value = FetchMode.JOIN)
|
||||
private IssueDoListing order;
|
||||
|
||||
@Convert(converter = JSONColumnConverter.class)
|
||||
@Column(name="variation")
|
||||
private JSONObject variation;
|
||||
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import com.solvway.core.converter.JSONColumnConverter;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name="orders_details")
|
||||
public class IssueDoDetailsListingWithDetails {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
//@ManyToOne(targetEntity = Orders.class, fetch = FetchType.EAGER)
|
||||
@ManyToOne(targetEntity = IssueDoListingWithDetails.class)
|
||||
@JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
@JsonBackReference
|
||||
// @Fetch(value = FetchMode.JOIN)
|
||||
private IssueDoListingWithDetails order;
|
||||
|
||||
@Convert(converter = JSONColumnConverter.class)
|
||||
@Column(name="variation")
|
||||
private JSONObject variation;
|
||||
private int qty;
|
||||
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.solvway.core.converter.JSONColumnConverter;
|
||||
import com.solvway.core.enums.GeneralEnum.CmsPlatform;
|
||||
import com.solvway.core.enums.GeneralEnum.FlagYesNo;
|
||||
import com.solvway.core.enums.OrderEnum.OrderStatus;
|
||||
import com.solvway.core.enums.OrderEnum.TrxType;
|
||||
import com.solvway.services.counter.model.Orders.DeliveryOrderStatus;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name="orders")
|
||||
public class IssueDoListing implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1532039841311264838L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String uuid;
|
||||
private String documentNo;
|
||||
private String buyerCode;
|
||||
@Convert(converter = JSONColumnConverter.class)
|
||||
private JSONObject buyer;
|
||||
private LocalDateTime transactionDateTime;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderStatus status = OrderStatus.P;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private DeliveryOrderStatus deliveryOrderStatus = DeliveryOrderStatus.PE;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo voidedFlag;
|
||||
private String countryCode;
|
||||
private String branchCode;
|
||||
private String location;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private TrxType trxType;
|
||||
private String doneBy;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo stockistSalesApproval = FlagYesNo.N;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private CmsPlatform sourcePlatform = CmsPlatform.BO;
|
||||
|
||||
private String deliveryGeoLocationId;
|
||||
private String postcode;
|
||||
|
||||
// @Fetch(value = FetchMode.JOIN)
|
||||
@OneToMany(cascade = CascadeType.ALL,mappedBy = "order",fetch = FetchType.LAZY)
|
||||
@JsonIgnore
|
||||
private List<IssueDoDetailsListing> details;
|
||||
|
||||
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.converter.JSONColumnConverter;
|
||||
import com.solvway.core.enums.GeneralEnum.CmsPlatform;
|
||||
import com.solvway.core.enums.GeneralEnum.FlagYesNo;
|
||||
import com.solvway.core.enums.OrderEnum.OrderStatus;
|
||||
import com.solvway.core.enums.OrderEnum.TrxType;
|
||||
import com.solvway.services.counter.model.Orders.DeliveryOrderStatus;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name="orders")
|
||||
public class IssueDoListingWithDetails implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1532039841311264838L;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Setter
|
||||
@Getter
|
||||
private String uuid;
|
||||
@Setter
|
||||
@Getter
|
||||
private String documentNo;
|
||||
@Setter
|
||||
@Getter
|
||||
private String buyerCode;
|
||||
@Setter
|
||||
@Getter
|
||||
@Convert(converter = JSONColumnConverter.class)
|
||||
private JSONObject buyer;
|
||||
@Setter
|
||||
@Getter
|
||||
private LocalDateTime transactionDateTime;
|
||||
@Setter
|
||||
@Getter
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderStatus status = OrderStatus.P;
|
||||
@Setter
|
||||
@Getter
|
||||
@Enumerated(EnumType.STRING)
|
||||
private DeliveryOrderStatus deliveryOrderStatus = DeliveryOrderStatus.PE;
|
||||
@Setter
|
||||
@Getter
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo voidedFlag;
|
||||
@Setter
|
||||
@Getter
|
||||
private String countryCode;
|
||||
@Setter
|
||||
@Getter
|
||||
private String branchCode;
|
||||
@Setter
|
||||
@Getter
|
||||
private String location;
|
||||
@Setter
|
||||
@Getter
|
||||
@Enumerated(EnumType.STRING)
|
||||
private TrxType trxType;
|
||||
@Setter
|
||||
@Getter
|
||||
private String doneBy;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private final FlagYesNo stockistSalesApproval = FlagYesNo.N;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private final CmsPlatform sourcePlatform = CmsPlatform.BO;
|
||||
|
||||
// @Fetch(value = FetchMode.JOIN)
|
||||
@Setter
|
||||
@Getter
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "order", fetch = FetchType.LAZY)
|
||||
private List<IssueDoDetailsListingWithDetails> details;
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class MTDSalesAnalysis {
|
||||
|
||||
private LinkedHashMap<String, MonthlySalesRpt> salesRptMap = new LinkedHashMap<>();
|
||||
private List<String> countryCodeKey;
|
||||
private List<String> dateKey;
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class MainCart {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String countryId;
|
||||
private String memberId;
|
||||
private String buyerCode;
|
||||
private String buyerId;
|
||||
private String trxnType;
|
||||
private String prvNo;
|
||||
private LocalDateTime createDateTime;
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum.FlagYesNo;
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
public class MemberVoucher implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private long uuid = SnowflakeIdWorker.getUUID();
|
||||
private String name;
|
||||
private String description;
|
||||
private String currencySymbol = "RM";
|
||||
/** Stored image path for the voucher; presigned before reaching members. Optional/nullable. */
|
||||
private String uploadPath;
|
||||
private double amount;
|
||||
/** Total redemptions allowed across all members. Null means unlimited. */
|
||||
private Integer redemptionLimit;
|
||||
/**
|
||||
* How many members have redeemed this voucher. Display-only and never a column: the number is
|
||||
* derived by counting redemption rows, and only findAll() fills it in.
|
||||
*/
|
||||
@Transient
|
||||
private int redeemedCount;
|
||||
private LocalDateTime effectiveFrom;
|
||||
private LocalDateTime effectiveTo;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo active = FlagYesNo.Y;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo requireCompleteProfile = FlagYesNo.Y;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
private String doneBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
@Column(updatable = false, insertable = false)
|
||||
private LocalDateTime lastModify = LocalDateTime.now();
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(uniqueConstraints = @UniqueConstraint(
|
||||
name = "uk_member_voucher_redemption_voucher_member",
|
||||
columnNames = {"voucher_uuid", "member_uuid"}))
|
||||
@Getter
|
||||
@Setter
|
||||
public class MemberVoucherRedemption implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
@Column(updatable = false)
|
||||
private long uuid = SnowflakeIdWorker.getUUID();
|
||||
@Column(updatable = false)
|
||||
private long voucherUuid;
|
||||
@Column(updatable = false)
|
||||
private long memberUuid;
|
||||
private LocalDateTime redeemedDateTime = LocalDateTime.now();
|
||||
private String doneBy;
|
||||
private String channel;
|
||||
@Column(updatable = false)
|
||||
private String createBy;
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createDateTime = LocalDateTime.now();
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class Message implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3156617923281222274L;
|
||||
private long id;
|
||||
private String code;
|
||||
private String content;
|
||||
private String description;
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class MongoConnection {
|
||||
@Id
|
||||
private String id;
|
||||
private LocalDateTime transactionDateTime;
|
||||
|
||||
public MongoConnection() {
|
||||
this.transactionDateTime = LocalDateTime.now();
|
||||
}
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class MonthlySMPBOSalesRpt {
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class SmpBoSalesRpt {
|
||||
private String country;
|
||||
private String branch;
|
||||
private String salesItemCode;
|
||||
private String description;
|
||||
private int totalQty;
|
||||
private double unitPrice;
|
||||
private double bv;
|
||||
private double sv;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class SmpBoDeliveryFeeRpt {
|
||||
private String country;
|
||||
private String branch;
|
||||
private double totalBv;
|
||||
private double totalSv;
|
||||
private double deliveryFee;
|
||||
private double totalPrice;
|
||||
|
||||
}
|
||||
|
||||
List<SmpBoSalesRpt> tradingSalesRpt;
|
||||
List<SmpBoSalesRpt> prvSalesRpt;
|
||||
List<SmpBoSalesRpt> nonTradingSalesRpt;
|
||||
List<SmpBoDeliveryFeeRpt> deliveryFeeRpt;
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class MonthlySalesRpt {
|
||||
private double totalBv;
|
||||
private double totalSv;
|
||||
private double grandTotal;
|
||||
private int mbrCount;
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class MonthlySalesSummary {
|
||||
|
||||
private LinkedHashMap<String, MonthlySalesRpt> salesRptMap = new LinkedHashMap<>();
|
||||
private List<String> countryCodeKey;
|
||||
private List<String> dateKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class Orders extends OrdersGeneral implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Getter
|
||||
public enum DeliveryOrderStatus{
|
||||
PE("PENDING"), PA("PARTIAL"), CO("COMPLETE"), SS("SELF_SERVICE");
|
||||
private final String name;
|
||||
DeliveryOrderStatus(String name) {
|
||||
this.name=name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//MappedBy OrdersDetails.order
|
||||
@OneToMany( fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
|
||||
@JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
private List<OrdersDetails> details;
|
||||
|
||||
//MappedBy OrdersPayments.order
|
||||
// @OneToMany(mappedBy = "order", fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
|
||||
@OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
|
||||
@JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
private List<OrdersPayments> payments;
|
||||
|
||||
public void addDetail(OrdersDetails detail) {
|
||||
if(this.details==null) {
|
||||
this.details = new ArrayList<>();
|
||||
}
|
||||
this.details.add(detail);
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.converter.JSONColumnConverter;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
@Getter
|
||||
@Entity
|
||||
public class OrdersDetails {
|
||||
@Setter
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
//@ManyToOne(targetEntity = Orders.class, fetch = FetchType.EAGER)
|
||||
// @ManyToOne(targetEntity = Orders.class,fetch = FetchType.LAZY)
|
||||
// @JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
// @Fetch(value = FetchMode.SELECT)
|
||||
// @JsonBackReference
|
||||
@Setter
|
||||
@Transient
|
||||
private Orders order;
|
||||
|
||||
@Setter
|
||||
private int qty;
|
||||
//MappedBy OrdersDetailsPricing.details
|
||||
@OneToOne(mappedBy = "details", fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
|
||||
@JoinColumn(name = "order_details_id", referencedColumnName = "id")
|
||||
@NotFound(action = NotFoundAction.IGNORE)
|
||||
@Fetch(value = FetchMode.SELECT)
|
||||
private OrdersDetailsPricing pricing;
|
||||
|
||||
@Setter
|
||||
@Convert(converter = JSONColumnConverter.class)
|
||||
private JSONObject variation;
|
||||
|
||||
public void setPricing(OrdersDetailsPricing pricing) {
|
||||
this.pricing = pricing;
|
||||
this.pricing.setDetails(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import com.solvway.core.enums.ProductEnum.PricingStatus;
|
||||
import jakarta.persistence.*;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Entity
|
||||
public class OrdersDetailsPricing {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
//
|
||||
@OneToOne(targetEntity = OrdersDetails.class, fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "order_details_id")
|
||||
@Fetch(value = FetchMode.SELECT)
|
||||
@JsonBackReference
|
||||
private OrdersDetails details;
|
||||
private Long pPricingId;
|
||||
private String pVariationId;
|
||||
private String pPriceType;
|
||||
private String pCountry;
|
||||
private String pRegion;
|
||||
private double pPrice;
|
||||
private double pBv;
|
||||
private double pSv;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PricingStatus pStatus = PricingStatus.Y;
|
||||
private String pDoneBy;
|
||||
private String pUpdateBy ;
|
||||
private LocalDateTime pCreateTime ;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public OrdersDetails getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setDetails(OrdersDetails details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public Long getpPricingId() {
|
||||
return pPricingId;
|
||||
}
|
||||
|
||||
public void setpPricingId(Long pPricingId) {
|
||||
this.pPricingId = pPricingId;
|
||||
}
|
||||
|
||||
public String getpVariationId() {
|
||||
return pVariationId;
|
||||
}
|
||||
|
||||
public void setpVariationId(String pVariationId) {
|
||||
this.pVariationId = pVariationId;
|
||||
}
|
||||
|
||||
public String getpPriceType() {
|
||||
return pPriceType;
|
||||
}
|
||||
|
||||
public void setpPriceType(String pPriceType) {
|
||||
this.pPriceType = pPriceType;
|
||||
}
|
||||
|
||||
public String getpCountry() {
|
||||
return pCountry;
|
||||
}
|
||||
|
||||
public void setpCountry(String pCountry) {
|
||||
this.pCountry = pCountry;
|
||||
}
|
||||
|
||||
public String getpRegion() {
|
||||
return pRegion;
|
||||
}
|
||||
|
||||
public void setpRegion(String pRegion) {
|
||||
this.pRegion = pRegion;
|
||||
}
|
||||
|
||||
public double getpPrice() {
|
||||
return pPrice;
|
||||
}
|
||||
|
||||
public void setpPrice(double pPrice) {
|
||||
this.pPrice = pPrice;
|
||||
}
|
||||
|
||||
public double getpBv() {
|
||||
return pBv;
|
||||
}
|
||||
|
||||
public void setpBv(double pBv) {
|
||||
this.pBv = pBv;
|
||||
}
|
||||
|
||||
public double getpSv() {
|
||||
return pSv;
|
||||
}
|
||||
|
||||
public void setpSv(double pSv) {
|
||||
this.pSv = pSv;
|
||||
}
|
||||
|
||||
public PricingStatus getpStatus() {
|
||||
return pStatus;
|
||||
}
|
||||
|
||||
public void setpStatus(PricingStatus pStatus) {
|
||||
this.pStatus = pStatus;
|
||||
}
|
||||
|
||||
public String getpDoneBy() {
|
||||
return pDoneBy;
|
||||
}
|
||||
|
||||
public void setpDoneBy(String pDoneBy) {
|
||||
this.pDoneBy = pDoneBy;
|
||||
}
|
||||
|
||||
public String getpUpdateBy() {
|
||||
return pUpdateBy;
|
||||
}
|
||||
|
||||
public void setpUpdateBy(String pUpdateBy) {
|
||||
this.pUpdateBy = pUpdateBy;
|
||||
}
|
||||
|
||||
public LocalDateTime getpCreateTime() {
|
||||
return pCreateTime;
|
||||
}
|
||||
|
||||
public void setpCreateTime(LocalDateTime pCreateTime) {
|
||||
this.pCreateTime = pCreateTime;
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
//@Entity
|
||||
@Setter
|
||||
@Getter
|
||||
public class OrdersDetailsProduct {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private Long pId;
|
||||
private String productSub;
|
||||
private String productCode;
|
||||
private String productName;
|
||||
private String productType;
|
||||
private String productBrand;
|
||||
private String productCategory;
|
||||
private String productComponent;
|
||||
private String productSicategory;
|
||||
|
||||
@OneToOne(targetEntity = OrdersDetailsVariation.class)
|
||||
@JoinColumn(name = "orders_details_variation_id")
|
||||
@JsonBackReference
|
||||
private OrdersDetailsVariation variation;
|
||||
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
//@Entity
|
||||
@Setter
|
||||
@Getter
|
||||
public class OrdersDetailsProductSku implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int qty;
|
||||
private int qtyFoc;
|
||||
private int qtyLeft;
|
||||
private int qtyFocLeft;
|
||||
|
||||
|
||||
@Id
|
||||
@ManyToOne(targetEntity = OrdersDetailsVariation.class)
|
||||
@JoinColumn(name = "orders_details_variation_id")
|
||||
@JsonBackReference
|
||||
private OrdersDetailsVariation variation;
|
||||
|
||||
@Id
|
||||
@OneToOne(targetEntity = OrdersDetailsSkuVariation.class, cascade=CascadeType.PERSIST)
|
||||
@JoinColumn(name = "orders_details_sku_variation_id")
|
||||
private OrdersDetailsSkuVariation skuVariation;
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
//@Entity
|
||||
@Setter
|
||||
@Getter
|
||||
public class OrdersDetailsSku {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private Long skuId;
|
||||
private String skuSub;
|
||||
private String skuCode;
|
||||
private String skuName;
|
||||
private String skuBrand;
|
||||
private String skuCategory;
|
||||
private String skuMainitem;
|
||||
|
||||
@OneToOne(targetEntity = OrdersDetailsSkuVariation.class)
|
||||
@JoinColumn(name = "orders_details_sku_variation_id")
|
||||
@JsonBackReference
|
||||
private OrdersDetailsSkuVariation skuVariation;
|
||||
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
//@Entity
|
||||
@Setter
|
||||
@Getter
|
||||
public class OrdersDetailsSkuVariation {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private Long svId;
|
||||
private String svPrefix;
|
||||
private String svVariant;
|
||||
private String svVariantName;
|
||||
|
||||
@OneToOne(mappedBy = "skuVariation", fetch = FetchType.EAGER, cascade=CascadeType.PERSIST)
|
||||
private OrdersDetailsSku sku;
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
//@Entity
|
||||
@Setter
|
||||
@Getter
|
||||
public class OrdersDetailsVariation {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private Long vId;
|
||||
private String vPrefix;
|
||||
private String vVariant;
|
||||
private String vVariantName;
|
||||
private Long ordersDetailsId;
|
||||
|
||||
@OneToOne(mappedBy = "variation", fetch = FetchType.EAGER, cascade=CascadeType.PERSIST)
|
||||
private OrdersDetailsProduct product;
|
||||
|
||||
@OneToMany(mappedBy = "variation", fetch = FetchType.EAGER, cascade=CascadeType.PERSIST)
|
||||
@NotFound(action = NotFoundAction.IGNORE)
|
||||
private List<OrdersDetailsProductSku> productSku;
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.converter.JSONColumnConverter;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name="orders_details")
|
||||
public class OrdersDetailsWithDetails implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -779692121188489135L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
private int qty;
|
||||
@Convert(converter = JSONColumnConverter.class)
|
||||
private JSONObject variation;
|
||||
|
||||
|
||||
}
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.converter.JSONColumnConverter;
|
||||
import com.solvway.core.enums.GeneralEnum.CmsPlatform;
|
||||
import com.solvway.core.enums.GeneralEnum.FlagYesNo;
|
||||
import com.solvway.core.enums.OrderEnum;
|
||||
import com.solvway.core.enums.OrderEnum.BuyerType;
|
||||
import com.solvway.core.enums.OrderEnum.OrderStatus;
|
||||
import com.solvway.core.enums.OrderEnum.TrxType;
|
||||
import com.solvway.core.enums.PaymentEnum.PaymentTerm;
|
||||
import com.solvway.core.model.PickupPointOsn;
|
||||
import com.solvway.services.counter.model.Orders.DeliveryOrderStatus;
|
||||
import com.solvway.services.counter.util.converter.PickupPointOsnColumnConverter;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@MappedSuperclass
|
||||
public class OrdersGeneral {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String uuid;
|
||||
private LocalDateTime transactionDateTime;
|
||||
private LocalDate bonusDate;
|
||||
private String countryCode;
|
||||
private String branchCode;
|
||||
private String invoicePrefix;
|
||||
private String documentNo;
|
||||
//Registration Sales havent generate memberCode, refer to memberId
|
||||
private Long buyerId;
|
||||
private String buyerCode;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private BuyerType buyerType = BuyerType.G;
|
||||
private int printCount = 0;
|
||||
private int deliveryPrintCount = 0;
|
||||
|
||||
private String currencySymbol;
|
||||
private double currencyRate;
|
||||
|
||||
private double grandTotal;
|
||||
private double totalAmount;
|
||||
private double totalDiscount;
|
||||
private double totalBv;
|
||||
private double totalSv;
|
||||
private double roundingAdjustment;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderStatus status = OrderStatus.P;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private DeliveryOrderStatus deliveryOrderStatus = DeliveryOrderStatus.PE;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private TrxType trxType;
|
||||
@Convert(converter = JSONColumnConverter.class)
|
||||
private JSONObject buyer;
|
||||
|
||||
private String location;
|
||||
private String statusRemark;
|
||||
private String bonusDateRemark;
|
||||
//Unidirectional Mapping
|
||||
@OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
|
||||
@JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
private List<OrdersTaxation> taxations;
|
||||
|
||||
// @Convert(converter = ListToJsonColumnConverter.class)
|
||||
// private List<PaymentProcess> payments;
|
||||
|
||||
//Use OrderStatus.N and OrderStatus.Y as flag for indicate the order stock returned.
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderStatus stockReturn = OrderStatus.N;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PaymentTerm paymentTerm = PaymentTerm.PF;
|
||||
|
||||
// for inventory issue stock
|
||||
@Transient
|
||||
private String warehouseId;
|
||||
|
||||
private String selfServiceId;
|
||||
private String doneBy;
|
||||
private String createBy;
|
||||
private LocalDateTime createDate;
|
||||
private String remark;
|
||||
private String paymentRemark;
|
||||
private String paymentReference;
|
||||
private String prvNo;
|
||||
private String invoiceHeader;
|
||||
private String invoiceFooter;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private CmsPlatform sourcePlatform = CmsPlatform.BO;
|
||||
|
||||
//For Void Sales
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo voidedFlag = FlagYesNo.N;
|
||||
private String voidedReason="";
|
||||
private String voidedBy;
|
||||
private LocalDateTime voidedDateTime;
|
||||
|
||||
//for delivery
|
||||
private double shippingCost;
|
||||
private double totalWeight;
|
||||
private double totalVolume;
|
||||
private boolean deliveryOption;
|
||||
private String receiver;
|
||||
private String contactNo;
|
||||
private String deliveryGeoLocationId;
|
||||
private String addressDetails;
|
||||
private String postcode;
|
||||
private boolean pickupOption;
|
||||
private String pickupPoint;
|
||||
private String pickupPointLocation;
|
||||
private String town;
|
||||
@Convert(converter = PickupPointOsnColumnConverter.class)
|
||||
private PickupPointOsn pickupPointOsn;
|
||||
private LocalDate pickupDate;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private OrderEnum.OsnPickupSlot pickupSlot = OrderEnum.OsnPickupSlot.NA;
|
||||
|
||||
private int volumeDivideRate;
|
||||
private double weightMarkupRate;
|
||||
private double volumeMarkupRate;
|
||||
|
||||
private String trackingNo;
|
||||
|
||||
//STOCKIST Sales Approval
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo stockistSalesApproval = FlagYesNo.N;
|
||||
private String stockistSalesApprovedBy;
|
||||
private LocalDateTime stockistSalesApprovalDateTime;
|
||||
private double stockistDepositBalance;
|
||||
|
||||
//for birthday treat flag
|
||||
private boolean containBirthdayTreatItem;
|
||||
private boolean containNewRetention;
|
||||
|
||||
private String locale = "en_US";
|
||||
private String ref1;
|
||||
private String userAgent;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo fromEmrm = FlagYesNo.N;
|
||||
|
||||
private String parentOrderUuid;
|
||||
|
||||
private String promotionCode;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo requiredApproval = FlagYesNo.N;
|
||||
|
||||
|
||||
// public List<PaymentProcess> getPayments() {
|
||||
// return payments;
|
||||
// }
|
||||
//
|
||||
// public void setPayments(List<PaymentProcess> payments) {
|
||||
// this.payments = payments;
|
||||
// }
|
||||
|
||||
public void addTaxation(OrdersTaxation taxation) {
|
||||
if(this.taxations==null) {
|
||||
this.taxations= new ArrayList<>();
|
||||
}
|
||||
this.taxations.add(taxation);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Entity
|
||||
@Table(name="orders")
|
||||
public class OrdersListing extends OrdersGeneral implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.PaymentEnum.PaymentProcessStatus;
|
||||
import com.solvway.core.enums.PaymentEnum.PaymentType;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class OrdersPayments {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
// @ManyToOne(targetEntity = Orders.class)
|
||||
// @JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
// @JsonBackReference
|
||||
// private Orders order;
|
||||
@Transient
|
||||
private String orderUuid;
|
||||
private String buyerCode;
|
||||
// public Orders getOrder() {
|
||||
// return order;
|
||||
// }
|
||||
//
|
||||
// public void setOrder(Orders order) {
|
||||
// this.order = order;
|
||||
// }
|
||||
private double totalAmount;
|
||||
private Long paymentMethodId;
|
||||
private String messageTag;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PaymentType paymentType = PaymentType.PC;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PaymentProcessStatus status = PaymentProcessStatus.P;
|
||||
private String message;
|
||||
private String remarks;
|
||||
private String doneBy;
|
||||
|
||||
//Define information to be stored in the Ref field
|
||||
/**
|
||||
* For PaymentGateway
|
||||
* ref1 = OnlinePaymentType or FPX
|
||||
ref2 = PaymentGatewayRef
|
||||
ref3 = CardNo
|
||||
ref4 = ApprovalCode
|
||||
ref5 = Solvway Ref
|
||||
* **/
|
||||
|
||||
|
||||
//Card Type
|
||||
private String ref1="";
|
||||
|
||||
private String ref2="";
|
||||
//Card No
|
||||
private String ref3="";
|
||||
|
||||
private String ref4="";
|
||||
|
||||
private String ref5="";
|
||||
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.enums.GeneralEnum.FlagYesNo;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class OrdersTaxation {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
// public Orders getOrder() {
|
||||
// return order;
|
||||
// }
|
||||
// public void setOrder(Orders order) {
|
||||
// this.order = order;
|
||||
// }
|
||||
//@ManyToOne(targetEntity = Orders.class, fetch = FetchType.EAGER)
|
||||
// @ManyToOne(targetEntity = Orders.class)
|
||||
// @JoinColumn(name = "order_uuid", referencedColumnName = "uuid")
|
||||
// @JsonBackReference
|
||||
// private Orders order;
|
||||
private double taxAmount;
|
||||
private String messageTag;
|
||||
private double percentage;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private FlagYesNo inclusive = FlagYesNo.N;
|
||||
private String doneBy;
|
||||
|
||||
}
|
||||
Loaded 100 of 2918 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user