-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MODBULKOPS-255 - MARC Instance - Content Update request for MARC inst…
…ances
- Loading branch information
1 parent
d84ad34
commit f54bf1b
Showing
31 changed files
with
661 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/java/org/folio/bulkops/domain/entity/BulkOperationMarcRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.folio.bulkops.domain.entity; | ||
|
||
import io.hypersistence.utils.hibernate.type.json.JsonBinaryType; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.With; | ||
import org.folio.bulkops.domain.dto.MarcAction; | ||
import org.folio.bulkops.domain.dto.MarcParameter; | ||
import org.folio.bulkops.domain.dto.MarcSubfieldAction; | ||
import org.hibernate.annotations.Type; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@Data | ||
@Builder | ||
@With | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Entity | ||
@Table(name = "bulk_operation_marc_rule") | ||
public class BulkOperationMarcRule { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private UUID id; | ||
|
||
private UUID bulkOperationId; | ||
private UUID userId; | ||
private String tag; | ||
private String ind1; | ||
private String ind2; | ||
private String subfield; | ||
|
||
@Type(JsonBinaryType.class) | ||
@Column(columnDefinition = "jsonb") | ||
private List<MarcAction> actions; | ||
|
||
@Type(JsonBinaryType.class) | ||
@Column(columnDefinition = "jsonb") | ||
private List<MarcParameter> parameters; | ||
|
||
@Type(JsonBinaryType.class) | ||
@Column(columnDefinition = "jsonb") | ||
private List<MarcSubfieldAction> subfields; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/folio/bulkops/mapper/MarcRulesMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.folio.bulkops.mapper; | ||
|
||
import org.folio.bulkops.domain.entity.BulkOperationMarcRule; | ||
import org.mapstruct.Mapper; | ||
|
||
@Mapper(componentModel = "spring") | ||
public interface MarcRulesMapper { | ||
org.folio.bulkops.domain.dto.BulkOperationMarcRule mapToDto(BulkOperationMarcRule rule); | ||
BulkOperationMarcRule mapToEntity(org.folio.bulkops.domain.dto.BulkOperationMarcRule rule); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/org/folio/bulkops/repository/BulkOperationMarcRuleRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.folio.bulkops.repository; | ||
|
||
import org.folio.bulkops.domain.entity.BulkOperationMarcRule; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@Repository | ||
public interface BulkOperationMarcRuleRepository extends JpaRepository<BulkOperationMarcRule, UUID> { | ||
List<BulkOperationMarcRule> findAllByBulkOperationId(UUID bulkOperationId); | ||
|
||
void deleteAllByBulkOperationId(UUID bulkOperationId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ | |
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@Service | ||
@Log4j2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/resources/db/changelog/changes/18-06-2024_updates_for_editing_marc.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
CREATE TABLE IF NOT EXISTS bulk_operation_marc_rule ( | ||
id UUID PRIMARY KEY, | ||
bulk_operation_id UUID, | ||
user_id UUID, | ||
tag TEXT, | ||
ind1 TEXT, | ||
ind2 TEXT, | ||
subfield TEXT, | ||
actions jsonb, | ||
parameters jsonb, | ||
subfields jsonb, | ||
constraint fk_marc_rule_to_operation foreign key (bulk_operation_id) | ||
references bulk_operation(id) ON DELETE CASCADE); | ||
|
||
ALTER TYPE EntityType RENAME VALUE 'INSTANCE' TO 'INSTANCE_FOLIO'; | ||
ALTER TYPE EntityType ADD VALUE 'INSTANCE_MARC'; | ||
|
||
ALTER TYPE UpdateActionType ADD VALUE 'APPEND'; | ||
ALTER TYPE UpdateActionType ADD VALUE 'ADDITIONAL_SUBFIELD'; | ||
ALTER TYPE UpdateActionType ADD VALUE 'REMOVE_FIELD'; | ||
ALTER TYPE UpdateActionType ADD VALUE 'REMOVE_SUBFIELD'; |
13 changes: 13 additions & 0 deletions
13
src/main/resources/db/changelog/changes/18-06-2024_updates_for_editing_marc.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd"> | ||
|
||
|
||
<changeSet id="18-06-2024_updates_for_editing_marc" author="firebird"> | ||
<sqlFile path="18-06-2024_updates_for_editing_marc.sql" relativeToChangelogFile="true" /> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
Oops, something went wrong.