001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2026 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.model.json.portal;
011
012import ca.cdr.api.model.json.AbstractModelJson;
013import com.fasterxml.jackson.annotation.JsonCreator;
014import com.fasterxml.jackson.annotation.JsonProperty;
015import io.swagger.v3.oas.annotations.media.Schema;
016import jakarta.annotation.Nonnull;
017
018import java.util.Map;
019
020/**
021 * Web applications hosted by the smile portal from a customer-supplied web-jar placed in {@code /customerlib},
022 * served without requiring any Java code changes.
023 */
024public class InternalAppJson extends AbstractModelJson implements IAppType {
025        @Schema(description = "label to display app on menu")
026        public final String label;
027
028        @Schema(description = "used to group menu items together")
029        public final String group;
030
031        @Schema(description = "FHIR base URL the app should launch against (optional)")
032        public final String url;
033
034        @Schema(description = "application type to be used in smile-portal")
035        public final String appType;
036
037        @Schema(description = "path slug under which the web-jar is served, e.g. extra-apps/{pathSlug}/")
038        public final String pathSlug;
039
040        @Schema(description = "id of the web-jar in /customerlib that provides this application")
041        public final String webJarId;
042
043        @Schema(description = "used for custom configuration for the app (optional)")
044        public Map<String, Object> additionalParameters;
045
046        @JsonCreator
047        public InternalAppJson(
048                        @Nonnull @JsonProperty(value = "label", required = true) String theLabel,
049                        @Nonnull @JsonProperty(value = "group", required = true) String theGroup,
050                        @JsonProperty(value = "url") String theUrl,
051                        @Nonnull @JsonProperty(value = "appType", required = true) String theAppType,
052                        @Nonnull @JsonProperty(value = "pathSlug", required = true) String thePathSlug,
053                        @Nonnull @JsonProperty(value = "webJarId", required = true) String theWebJarId) {
054                label = theLabel;
055                group = theGroup;
056                url = theUrl;
057                appType = theAppType;
058                pathSlug = thePathSlug;
059                webJarId = theWebJarId;
060        }
061
062        @Override
063        public String getAppType() {
064                return appType;
065        }
066
067        @Override
068        public boolean equals(Object object) {
069                return super.equals(object);
070        }
071
072        @Override
073        public int hashCode() {
074                return super.hashCode();
075        }
076}