Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 153x 16x 16x 16x 16x 16x 16x 16x 16x 16x 16x 135x 119x 16x 16x 16x 16x 16x 19x 16x 16x 16x 16x 30x 12x 135x 135x 135x 135x 14x 121x 16x | /**
* Endpoints
*/
export const VUE_APP_ZMS_API_PROVIDERS_AND_SERVICES_ENDPOINT =
"/offices-and-services/";
export const VUE_APP_ZMS_API_CALENDAR_ENDPOINT = "/available-days-by-office/";
export const VUE_APP_ZMS_API_AVAILABLE_TIME_SLOTS_ENDPOINT =
"/available-appointments-by-office/";
export const VUE_APP_ZMS_API_RESERVE_APPOINTMENT_ENDPOINT =
"/reserve-appointment/";
export const VUE_APP_ZMS_API_APPOINTMENT_ENDPOINT = "/appointment/";
export const VUE_APP_ZMS_API_UPDATE_APPOINTMENT_ENDPOINT =
"/update-appointment/";
export const VUE_APP_ZMS_API_CONFIRM_APPOINTMENT_ENDPOINT =
"/confirm-appointment/";
export const VUE_APP_ZMS_API_CANCEL_APPOINTMENT_ENDPOINT =
"/cancel-appointment/";
export const VUE_APP_ZMS_API_PRECONFIRM_APPOINTMENT_ENDPOINT =
"/preconfirm-appointment/";
export const VUE_APP_ZMS_API_CAPTCHA_DETAILS_ENDPOINT = "/captcha-details/";
export const VUE_APP_ZMS_API_CAPTCHA_CHALLENGE_ENDPOINT = "/captcha-challenge/";
export const VUE_APP_ZMS_API_CAPTCHA_VERIFY_ENDPOINT = "/captcha-verify/";
export const VUE_APP_ZMS_API_MYAPPOINTMENTS_ENDPOINT = "/my-appointments/";
export function getServiceBaseURL(): string {
return import.meta.env.VITE_VUE_APP_SERVICE_BASE_URL;
}
export const MAX_SLOTS = 25;
export const OFTEN_SEARCHED_SERVICES = new Map<string, string>([
["1063475", "shortNameResidenceRegistration"],
["1063453", "shortNamePassport"],
["1063441", "shortNameIdentityCard"],
["10295182", "shortNameIdentityCardCollection"],
["10176294", "shortNameDrivingLicenseCollection"],
["10225119", "shortNameEidPin"],
["1064314", "shortNameVehicleReregistration"],
["1064305", "shortNameVehicleDeregistration"],
]);
export const QUERY_PARAM_APPOINTMENT_ID = "ap-id";
export const QUERY_PARAM_APPOINTMENT_DISPLAY_NUMBER = "ap-display";
export const LOCALSTORAGE_PARAM_APPOINTMENT_DATA = "lhm-appointment-data";
export enum APPOINTMENT_ACTION_TYPE {
RESCHEDULE = "reschedule",
CANCEL = "cancel",
}
export const API_BASE_URL_EXTENSION = "/api/citizen";
export const API_BASE_URL_AUTHENTICATED_EXTENSION =
"/authenticated/api/citizen";
function getRawApiBaseURL(baseUrl: string | undefined): string {
// Explicit override from caller always wins.
if (baseUrl) {
return baseUrl;
}
// Special handling for ATAF / in-container runs:
// When the citizenview dev server is accessed via the Docker/DDEV
// service name "citizenview" (e.g. http://citizenview:8082),
// use a container-specific API base URL if configured.
Iif (
typeof window !== "undefined" &&
window.location.hostname === "citizenview" &&
import.meta.env.VITE_VUE_APP_API_URL_CONTAINER
) {
return import.meta.env.VITE_VUE_APP_API_URL_CONTAINER;
}
Iif (import.meta.env.VITE_VUE_APP_API_URL) {
return import.meta.env.VITE_VUE_APP_API_URL;
} else {
return new URL(import.meta.url).origin;
}
}
export const VARIANTS_WITH_HINTS = [1, 2, 3] as const;
export const getVariantHint = (
variantId: number,
t: (key: string) => string
) => {
return VARIANTS_WITH_HINTS.includes(variantId)
? t(`locationVariantText.${variantId}`)
: undefined;
};
export const VARIANT_ID_PRESENCE = 1;
export const VARIANT_ID_TELEPHONE = 2;
export const VARIANT_ID_VIDEO = 3;
export const VARIANT_IDS_REQUIRING_IMPLICIT_PRESENCE = [
VARIANT_ID_TELEPHONE,
VARIANT_ID_VIDEO,
] as const;
export function shouldAddImplicitPresenceVariant(
variantIds: Array<number | null | undefined>
): boolean {
return variantIds.some((variantId) =>
VARIANT_IDS_REQUIRING_IMPLICIT_PRESENCE.includes(
variantId as (typeof VARIANT_IDS_REQUIRING_IMPLICIT_PRESENCE)[number]
)
);
}
export function getAPIBaseURL(
baseUrl: string | undefined,
authenticated: boolean
): string {
let url = getRawApiBaseURL(baseUrl);
// Can be deleted if the configurations have been adjusted on all environments.
Iif (url.endsWith("/api/citizen")) {
url = url.slice(0, -"/api/citizen".length);
} else Iif (url.endsWith("/api/citizen/")) {
url = url.slice(0, -"/api/citizen/".length);
}
if (authenticated) {
return url + API_BASE_URL_AUTHENTICATED_EXTENSION;
} else {
return url + API_BASE_URL_EXTENSION;
}
}
/**
* UI thresholds and limits
*/
// ZMSKVR-110: UX rule for view mode
// Few appointments → group by am/pm (≤ 18 per day); many appointments → hourly (> 18)
// Rationale: accessibility and layout density tradeoff documented in the ticket.
export const APPOINTMENTS_THRESHOLD_FOR_HOURLY_VIEW = 18;
|