Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
haiphucnguyen committed Dec 11, 2024
1 parent 27aa978 commit 1a76536
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public ResponseEntity<List<WorkflowDTO>> getWorkflowsByTeam(@PathVariable Long t
*/
@GetMapping("/teams/{teamId}/global-workflows-not-linked-yet")
public ResponseEntity<List<WorkflowDTO>> getGlobalWorkflowsNotLinkedToTeam(
@RequestParam Long teamId) {
@PathVariable Long teamId) {
List<WorkflowDTO> workflows = workflowService.listGlobalWorkflowsNotLinkedToTeam(teamId);
return ResponseEntity.ok(workflows);
}
Expand Down Expand Up @@ -156,21 +156,21 @@ public ResponseEntity<WorkflowDetailedDTO> updateWorkflow(
return ResponseEntity.ok(updatedWorkflow);
}

@PostMapping("/create-workflow-reference")
@PostMapping("/{referencedWorkflowId}/teams/{teamId}/create-workflow-reference")
public ResponseEntity<WorkflowDetailedDTO> createWorkflowByReference(
@PathVariable Long teamId,
@RequestParam Long referencedWorkflowId,
@PathVariable Long referencedWorkflowId,
@RequestBody WorkflowDTO workflowDTO) {
WorkflowDetailedDTO createdWorkflow =
workflowService.createWorkflowByReference(
teamId, referencedWorkflowId, workflowDTO);
return ResponseEntity.status(HttpStatus.CREATED).body(createdWorkflow);
}

@PostMapping("/create-workflow-clone")
@PostMapping("/{workflowToCloneId}/teams/{teamId}/create-workflow-clone")
public ResponseEntity<WorkflowDetailedDTO> createWorkflowByCloning(
@PathVariable Long teamId,
@RequestParam Long workflowToCloneId,
@PathVariable Long workflowToCloneId,
@RequestBody WorkflowDTO workflowDTO) {
WorkflowDetailedDTO clonedWorkflow =
workflowService.createWorkflowByCloning(teamId, workflowToCloneId, workflowDTO);
Expand Down
1 change: 0 additions & 1 deletion server/src/main/resources/config/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


logging:
structured.format.console: logstash
level:
ROOT: WARN
sql: DEBUG # built-in group sql include org.springframework.jdbc.core, org.hibernate.SQL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,47 +40,6 @@
resource="org/springframework/boot/logging/logback/console-appender.xml" />


<logger name="io.flexwork" level="INFO" />
<logger name="angus.activation" level="WARN" />
<logger name="jakarta.activation" level="WARN" />
<logger name="jakarta.json" level="WARN" />
<logger name="jakarta.mail" level="WARN" />
<logger name="jakarta.management.remote" level="WARN" />
<logger name="jakarta.xml.bind" level="WARN" />
<logger name="jdk.event.security" level="INFO" />
<logger name="com.sun" level="WARN" />
<logger name="com.zaxxer" level="WARN" />
<logger name="io.undertow" level="WARN" />
<logger name="io.undertow.websockets.jsr" level="ERROR" />
<logger name="org.apache" level="WARN" />
<logger name="org.apache.catalina.startup.DigesterFactory"
level="OFF" />
<logger name="org.bson" level="WARN" />

<logger name="org.hibernate" level="WARN" />
<logger name="org.hibernate.SQL" level="WARN" />

<logger name="org.postgresql" level="WARN" />
<logger name="org.springframework" level="WARN" />
<logger name="org.springframework.web" level="WARN" />
<logger name="org.springframework.security" level="INFO" />
<logger name="org.springframework.boot.autoconfigure.logging"
level="INFO" />
<logger name="org.springframework.cache" level="WARN" />
<logger name="org.thymeleaf" level="WARN" />
<logger name="org.xnio" level="WARN" />
<logger name="io.swagger.v3" level="INFO" />
<logger name="sun.rmi" level="WARN" />
<logger name="sun.rmi.transport" level="WARN" />
<logger name="javax.management.remote.rmi" level="WARN" />

<logger name="Validator" level="INFO" />
<logger
name="_org.springframework.web.servlet.HandlerMapping.Mappings"
level="INFO" />
<logger name="liquibase" level="WARN" />
<logger name="LiquibaseSchemaResolver" level="INFO" />

<springProperty name="log.level"
source="logging.level.root" defaultValue="INFO" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
author="flexapp">
<createTable tableName="fw_tenant"
schemaName="flexwork_master">
<column name="id" type="bigint">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="name" type="varchar(256)">
Expand All @@ -38,9 +38,6 @@
<column name="modified_by" type="bigint" />
<column name="modified_at" type="timestamptz" />
</createTable>

<addAutoIncrement tableName="fw_tenant"
columnName="id" incrementBy="1" startWith="1000" />
</changeSet>
<changeSet id="00000000000003" author="flexapp">
<insert tableName="fw_tenant" schemaName="flexwork_master">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@


<changeSet id="000:01-core-tables" author="flexapp">
<createSequence sequenceName="sequence_generator"
minValue="100" startValue="100" incrementBy="1" />

<!--Table for shedLock, a distributed lock for spring scheduling service -->
<createTable tableName="shedlock">
Expand All @@ -27,7 +25,7 @@
</createTable>

<createTable tableName="fw_user">
<column name="id" type="bigint">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" />
</column>
<column name="password_hash" type="VARCHAR(61)" />
Expand Down Expand Up @@ -76,9 +74,6 @@
<column name="modified_at" type="timestamptz" />
</createTable>

<addAutoIncrement tableName="fw_user" columnName="id"
incrementBy="1" startWith="1000" />

<createTable tableName="fw_authority">
<column name="name" type="VARCHAR(50)">
<constraints primaryKey="true" nullable="false" />
Expand Down Expand Up @@ -149,7 +144,7 @@

<!-- Create Team Table -->
<createTable tableName="fw_team">
<column name="id" type="BIGINT">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" />
</column>
<column name="name" type="VARCHAR(255)" />
Expand All @@ -159,9 +154,6 @@
<column name="organization_id" type="BIGINT" />
</createTable>

<addAutoIncrement tableName="fw_team" columnName="id"
incrementBy="1" startWith="1000" />

<createTable tableName="fw_team_role">
<column name="name" type="VARCHAR(50)">
<constraints unique="true" nullable="false" />
Expand All @@ -171,7 +163,7 @@

<!-- Create Organization Table -->
<createTable tableName="fw_organization">
<column name="id" type="BIGINT">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" />
</column>
<column name="name" type="VARCHAR(255)" />
Expand All @@ -180,9 +172,6 @@
<column name="description" type="TEXT" />
</createTable>

<addAutoIncrement tableName="fw_organization"
columnName="id" incrementBy="1" startWith="1000" />

<addForeignKeyConstraint
baseTableName="fw_team" baseColumnNames="organization_id"
referencedTableName="fw_organization" referencedColumnNames="id"
Expand Down Expand Up @@ -219,7 +208,7 @@
onDelete="CASCADE" constraintName="fk_user_team_role" />

<createTable tableName="fw_comment">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="content" type="TEXT">
Expand All @@ -243,7 +232,7 @@
referencedColumnNames="id" />

<createTable tableName="fw_notification">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="content" type="TEXT">
Expand All @@ -262,7 +251,7 @@
</createTable>

<createTable tableName="fw_activity_log">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="entity_type" type="VARCHAR(20)">
Expand Down Expand Up @@ -340,6 +329,7 @@
<column name="city" type="STRING" />
<column name="state" type="STRING" />
</loadData>
<sql>SELECT setval('fw_user_id_seq', (SELECT MAX(id) FROM fw_user));</sql>
</changeSet>
<changeSet author="flexapp"
id="000:05-insert-default-user-authority-data">
Expand All @@ -359,19 +349,21 @@
<column name="slogan" type="STRING" />
<column name="description" type="STRING" />
</loadData>
<sql>SELECT setval('fw_organization_id_seq', (SELECT MAX(id) FROM
fw_organization));</sql>
</changeSet>
<changeSet author="flexapp"
id="000:06-insert-default-fw-team-data">
<loadData file="config/liquibase/tenant/data/fw_team.csv"
tableName="fw_team" separator=";">

<column name="id" type="NUMERIC" />
<column name="name" type="STRING" />
<column name="logo_url" type="STRING" />
<column name="slogan" type="STRING" />
<column name="description" type="STRING" />
<column name="organization_id" type="NUMERIC" />
</loadData>
<sql>SELECT setval('fw_team_id_seq', (SELECT MAX(id) FROM fw_team));</sql>
</changeSet>
<changeSet author="flexapp"
id="000:07-insert-default-fw-team-role">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!--Stores metadata about each workflow, allowing different workflows to
be defined and customized by customers. -->
<createTable tableName="fw_workflow">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="name" type="VARCHAR(255)">
Expand Down Expand Up @@ -93,7 +93,7 @@
constraintName="fk_workflow_last_modified_by_user" />

<createTable tableName="fw_team_workflow_selection">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="team_id" type="BIGINT">
Expand All @@ -117,7 +117,7 @@


<createTable tableName="fw_workflow_state">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="workflow_id" type="BIGINT">
Expand All @@ -138,7 +138,7 @@
<!--This table stores each customer request associated with a team, linking
the request to a specific workflow and tracking the current state. -->
<createTable tableName="fw_team_request">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="team_id" type="BIGINT">
Expand Down Expand Up @@ -218,7 +218,7 @@
the event name that triggers each transition, along with the SLA duration
for each transition. -->
<createTable tableName="fw_workflow_transition">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="workflow_id" type="BIGINT">
Expand Down Expand Up @@ -260,7 +260,7 @@
<!--Specifies actions to be taken when a transition is triggered, allowing
for dynamic escalation actions, notifications, or custom business logic. -->
<createTable tableName="fw_workflow_actions">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="transition_id" type="BIGINT">
Expand All @@ -280,7 +280,7 @@
<!--Tracks the history of each request as it progresses through its workflow,
including timestamps, status, and SLA due dates. -->
<createTable tableName="fw_workflow_transition_history">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="team_request_id" type="BIGINT">
Expand Down Expand Up @@ -325,7 +325,7 @@


<createTable tableName="fw_escalation_tracking">
<column name="id" type="BIGINT" autoIncrement="true">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="team_request_id" type="BIGINT">
Expand Down Expand Up @@ -361,6 +361,8 @@
<column name="description" type="string" />
<column name="owner_id" type="numeric" />
</loadData>
<sql>SELECT setval('fw_workflow_id_seq', (SELECT MAX(id) FROM
fw_workflow));</sql>
</changeSet>
<changeSet author="flexapp"
id="001:02-insert-workflow-state-data">
Expand All @@ -374,6 +376,8 @@
<column name="is_initial" type="boolean" />
<column name="is_final" type="boolean" />
</loadData>
<sql>SELECT setval('fw_workflow_state_id_seq', (SELECT MAX(id) FROM
fw_workflow_state));</sql>
</changeSet>
<changeSet author="flexapp"
id="001:03-insert-workflow-transition-data">
Expand All @@ -388,6 +392,8 @@
<column name="event_name" type="string" />
<column name="sla_duration" type="numeric" />
</loadData>
<sql>SELECT setval('fw_workflow_transition_id_seq', (SELECT MAX(id)
FROM fw_workflow_transition));</sql>
</changeSet>
<changeSet author="flexapp"
id="001:04-insert-team-workflow-usage-data">
Expand All @@ -399,5 +405,7 @@
<column name="workflow_id" type="numeric" />
<column name="team_id" type="numeric" />
</loadData>
<sql>SELECT setval('fw_team_workflow_selection_id_seq', (SELECT
MAX(id) FROM fw_team_workflow_selection));</sql>
</changeSet>
</databaseChangeLog>

0 comments on commit 1a76536

Please sign in to comment.