minor fixes
This commit is contained in:
@@ -10,7 +10,9 @@ import io.nflow.engine.workflow.instance.WorkflowInstanceAction;
|
||||
import io.nflow.engine.workflow.instance.WorkflowInstanceFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.Equal;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.EqualIgnoreCase;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.In;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.LikeIgnoreCase;
|
||||
import net.kaczmarzyk.spring.data.jpa.web.annotation.Or;
|
||||
import net.kaczmarzyk.spring.data.jpa.web.annotation.Spec;
|
||||
import net.kaczmarzyk.spring.data.jpa.web.annotation.Conjunction;
|
||||
@@ -57,7 +59,8 @@ public class TransactonController {
|
||||
@Conjunction(value = {
|
||||
@Or({
|
||||
@Spec(path = "status", spec = Equal.class),
|
||||
@Spec(path = "createdAt", spec = Equal.class),
|
||||
@Spec(path = "createdAt", spec = Equal.class),
|
||||
@Spec(path = "billName", spec = LikeIgnoreCase.class),
|
||||
@Spec(path = "providerLabel", spec = Equal.class),
|
||||
@Spec(path = "billClientId", spec = Equal.class),
|
||||
@Spec(path = "productUid", spec = Equal.class),
|
||||
|
||||
@@ -39,6 +39,7 @@ public class Transaction extends BaseEntity {
|
||||
private String userId;
|
||||
private String trace;
|
||||
private String region;
|
||||
@Enumerated(EnumType.STRING)
|
||||
private PartyType partyType;
|
||||
private BigDecimal amount;
|
||||
private BigDecimal charge;
|
||||
|
||||
@@ -119,6 +119,7 @@ public class GroupBatchWorkflowService {
|
||||
transaction.setPaymentProcessorName(batch.getPaymentProcessorName());
|
||||
transaction.setPaymentProcessorImage(batch.getPaymentProcessorImage());
|
||||
transaction.setBatchId(batch.getId());
|
||||
transaction.setBillName("Batch - " + batch.getDescription());
|
||||
|
||||
transaction = calculateChargesHandler.process(transaction);
|
||||
transaction = (Transaction) cleanUpHandler.process(transaction);
|
||||
@@ -194,6 +195,9 @@ public class GroupBatchWorkflowService {
|
||||
batch.setStatus(GroupBatchStatus.PARTIAL);
|
||||
} else {
|
||||
batch.setStatus(GroupBatchStatus.COMPLETED);
|
||||
Transaction paymentTransaction = transactionService.findById(batch.getPaymentTransactionId());
|
||||
paymentTransaction.setIntegrationStatus(Status.SUCCESS);
|
||||
transactionService.save(paymentTransaction);
|
||||
}
|
||||
|
||||
batch.setCompletedAt(LocalDateTime.now());
|
||||
|
||||
@@ -7,7 +7,7 @@ server.port=6950
|
||||
|
||||
server.servlet.context-path=/api
|
||||
|
||||
spring.jpa.hibernate.ddl-auto=validate
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/qpay?useLegacyDatetimeCode=false
|
||||
|
||||
@@ -1,8 +1,62 @@
|
||||
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||
<changeSet author="khoza (generated)" id="1781993557092-7">
|
||||
<addColumn tableName="group_batch_item">
|
||||
<column name="recipient_account" type="varchar(255)"/>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-9">
|
||||
<createIndex indexName="IX_charge_exclude_productsPK" tableName="charge_exclude_products" unique="true">
|
||||
<column name="charge_id"/>
|
||||
<column name="charge_condition_id"/>
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-10">
|
||||
<createIndex indexName="IX_charge_include_productsPK" tableName="charge_include_products" unique="true">
|
||||
<column name="charge_id"/>
|
||||
<column name="charge_condition_id"/>
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-11">
|
||||
<createIndex indexName="IX_workspace_usersPK" tableName="workspace_users" unique="true">
|
||||
<column name="workspace_id"/>
|
||||
<column name="user_id"/>
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-1">
|
||||
<dropPrimaryKey tableName="charge_exclude_products"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-2">
|
||||
<addPrimaryKey columnNames="charge_id, charge_condition_id" constraintName="charge_exclude_productsPK" tableName="charge_exclude_products"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-3">
|
||||
<dropPrimaryKey tableName="charge_include_products"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-4">
|
||||
<addPrimaryKey columnNames="charge_id, charge_condition_id" constraintName="charge_include_productsPK" tableName="charge_include_products"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-5">
|
||||
<dropPrimaryKey tableName="workspace_users"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza (generated)" id="1782161994502-6">
|
||||
<addPrimaryKey columnNames="workspace_id, user_id" constraintName="workspace_usersPK" tableName="workspace_users"/>
|
||||
</changeSet>
|
||||
<changeSet author="khoza" id="convert-party-type-to-string">
|
||||
<comment>Convert party_type column from integer ordinal to string enum values to match @Enumerated(EnumType.STRING) in Transaction.java</comment>
|
||||
|
||||
<!-- Add a temporary VARCHAR column -->
|
||||
<addColumn tableName="transaction">
|
||||
<column name="party_type_str" type="VARCHAR(20)">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
</addColumn>
|
||||
|
||||
<!-- Convert existing ordinal integer values (0=INDIVIDUAL, 1=GROUP, 2=BATCH) to strings -->
|
||||
<sql>
|
||||
UPDATE transaction SET party_type_str = 'INDIVIDUAL' WHERE party_type = 0 OR party_type = '0';
|
||||
UPDATE transaction SET party_type_str = 'GROUP' WHERE party_type = 1 OR party_type = '1';
|
||||
UPDATE transaction SET party_type_str = 'BATCH' WHERE party_type = 2 OR party_type = '2';
|
||||
</sql>
|
||||
|
||||
<!-- Drop old integer column -->
|
||||
<dropColumn tableName="transaction" columnName="party_type"/>
|
||||
|
||||
<!-- Rename temp column to original name -->
|
||||
<renameColumn tableName="transaction" oldColumnName="party_type_str" newColumnName="party_type"/>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
|
||||
Reference in New Issue
Block a user