rename package (+schema etc.) credentials to accounts (#185)
Co-authored-by: Michael Hoennig <michael@hoennig.de> Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/185 Reviewed-by: Timotheus Pokorra <timotheus.pokorra@hostsharing.net>
This commit is contained in:
+2
-2
@@ -1,9 +1,9 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import net.hostsharing.hsadminng.config.MessageTranslator;
|
||||
import net.hostsharing.hsadminng.credentials.generated.api.v1.model.ContextResource;
|
||||
import net.hostsharing.hsadminng.accounts.generated.api.v1.model.ContextResource;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import jakarta.persistence.AttributeOverride;
|
||||
import jakarta.persistence.AttributeOverrides;
|
||||
@@ -24,7 +24,7 @@ import static net.hostsharing.hsadminng.rbac.generator.RbacSpec.WITHOUT_IMPLICIT
|
||||
import static net.hostsharing.hsadminng.rbac.generator.RbacSpec.rbacViewFor;
|
||||
|
||||
@Entity
|
||||
@Table(schema = "hs_credentials", name = "context") // TODO_impl: RBAC rules for _rv do not yet work properly
|
||||
@Table(schema = "hs_accounts", name = "context") // TODO_impl: RBAC rules for _rv do not yet work properly
|
||||
@SuperBuilder(toBuilder = true)
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -50,6 +50,6 @@ public class HsCredentialsContextRbacEntity extends HsCredentialsContext {
|
||||
|
||||
// TODO_impl: RBAC rules for _rv do not yet work properly (remove the X)
|
||||
public static void mainX(String[] args) throws IOException {
|
||||
rbacX().generateWithBaseFileName("9-hs-global/950-credentials/9513-hs-credentials-rbac");
|
||||
rbacX().generateWithBaseFileName("9-hs-global/950-accounts/9513-hs-credentials-rbac");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import io.micrometer.core.annotation.Timed;
|
||||
import org.springframework.data.repository.Repository;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import jakarta.persistence.AttributeOverride;
|
||||
import jakarta.persistence.AttributeOverrides;
|
||||
@@ -11,7 +11,7 @@ import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Entity
|
||||
@Table(schema = "hs_credentials", name = "context")
|
||||
@Table(schema = "hs_accounts", name = "context")
|
||||
@SuperBuilder(toBuilder = true)
|
||||
@Getter
|
||||
@Setter
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import io.micrometer.core.annotation.Timed;
|
||||
import org.springframework.data.repository.Repository;
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.micrometer.core.annotation.Timed;
|
||||
import net.hostsharing.hsadminng.config.NoSecurityRequirement;
|
||||
import net.hostsharing.hsadminng.context.Context;
|
||||
import net.hostsharing.hsadminng.credentials.generated.api.v1.api.ContextsApi;
|
||||
import net.hostsharing.hsadminng.credentials.generated.api.v1.model.ContextResource;
|
||||
import net.hostsharing.hsadminng.accounts.generated.api.v1.api.ContextsApi;
|
||||
import net.hostsharing.hsadminng.accounts.generated.api.v1.model.ContextResource;
|
||||
import net.hostsharing.hsadminng.mapper.StrictMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
@@ -10,11 +10,11 @@ import io.micrometer.core.annotation.Timed;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import net.hostsharing.hsadminng.config.MessageTranslator;
|
||||
import net.hostsharing.hsadminng.context.Context;
|
||||
import net.hostsharing.hsadminng.credentials.generated.api.v1.api.CredentialsApi;
|
||||
import net.hostsharing.hsadminng.credentials.generated.api.v1.model.CredentialsInsertResource;
|
||||
import net.hostsharing.hsadminng.credentials.generated.api.v1.model.CredentialsPatchResource;
|
||||
import net.hostsharing.hsadminng.credentials.generated.api.v1.model.CredentialsResource;
|
||||
import net.hostsharing.hsadminng.credentials.generated.api.v1.model.HsOfficePersonResource;
|
||||
import net.hostsharing.hsadminng.accounts.generated.api.v1.api.CredentialsApi;
|
||||
import net.hostsharing.hsadminng.accounts.generated.api.v1.model.CredentialsInsertResource;
|
||||
import net.hostsharing.hsadminng.accounts.generated.api.v1.model.CredentialsPatchResource;
|
||||
import net.hostsharing.hsadminng.accounts.generated.api.v1.model.CredentialsResource;
|
||||
import net.hostsharing.hsadminng.accounts.generated.api.v1.model.HsOfficePersonResource;
|
||||
import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonRbacRepository;
|
||||
import net.hostsharing.hsadminng.mapper.StrictMapper;
|
||||
import net.hostsharing.hsadminng.persistence.EntityManagerWrapper;
|
||||
@@ -118,7 +118,7 @@ public class HsCredentialsController implements CredentialsApi {
|
||||
// return the new credentials as a resource
|
||||
final var uri =
|
||||
MvcUriComponentsBuilder.fromController(getClass())
|
||||
.path("/api/hs/credentials/credentials/{id}")
|
||||
.path("/api/hs/accounts/credentials/{id}")
|
||||
.buildAndExpand(newCredentialsEntity.getUuid())
|
||||
.toUri();
|
||||
final var newCredentialsResource = mapper.map(
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
@@ -19,7 +19,7 @@ import static jakarta.persistence.CascadeType.REFRESH;
|
||||
import static net.hostsharing.hsadminng.repr.Stringify.stringify;
|
||||
|
||||
@Entity
|
||||
@Table(schema = "hs_credentials", name = "credentials")
|
||||
@Table(schema = "hs_accounts", name = "credentials")
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@@ -79,7 +79,7 @@ public class HsCredentialsEntity implements BaseEntity<HsCredentialsEntity>, Str
|
||||
|
||||
@OneToMany(fetch = FetchType.LAZY, cascade = { MERGE, REFRESH }, orphanRemoval = true)
|
||||
@JoinTable(
|
||||
name = "context_mapping", schema = "hs_credentials",
|
||||
name = "context_mapping", schema = "hs_accounts",
|
||||
joinColumns = @JoinColumn(name = "credentials_uuid", referencedColumnName = "uuid"),
|
||||
inverseJoinColumns = @JoinColumn(name = "context_uuid", referencedColumnName = "uuid")
|
||||
)
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import net.hostsharing.hsadminng.credentials.generated.api.v1.model.CredentialsPatchResource;
|
||||
import net.hostsharing.hsadminng.accounts.generated.api.v1.model.CredentialsPatchResource;
|
||||
import net.hostsharing.hsadminng.mapper.EntityPatcher;
|
||||
import net.hostsharing.hsadminng.mapper.OptionalFromJson;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package net.hostsharing.hsadminng.credentials;
|
||||
package net.hostsharing.hsadminng.hs.accounts;
|
||||
|
||||
import io.micrometer.core.annotation.Timed;
|
||||
import net.hostsharing.hsadminng.hs.office.person.HsOfficePerson;
|
||||
Reference in New Issue
Block a user