feat: Implement the core Anjungan queue display system, including clinic room, entry, and counter queues, along with new stores, pages, and API endpoints.

This commit is contained in:
Fanrouver
2026-02-18 12:00:30 +07:00
parent f78bbea4b0
commit 7d07a4f00d
18 changed files with 38 additions and 38 deletions
+15 -15
View File
@@ -350,7 +350,7 @@ export const useQueueStore = defineStore('queue', () => {
};
const config = useRuntimeConfig();
const wsBaseUrl = config.public?.wsBaseUrl || "ws://10.10.150.100:8084/api/v1/ws";
const wsBaseUrl = config.public?.wsBaseUrl || "ws://10.10.123.135:8084/api/v1/ws";
const { connect, disconnect, sendViaPost, isConnected } = useWebSocket({
url: wsBaseUrl,
@@ -640,7 +640,7 @@ export const useQueueStore = defineStore('queue', () => {
try {
console.log(`🔄 [queueStore] Fetching patients for loket ${loketId}...`);
const response = await fetch(`http://10.10.150.131:8089/api/v1/loket/${loketId}`);
const response = await fetch(`http://10.10.123.140:8089/api/v1/loket/${loketId}`);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
@@ -1620,7 +1620,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API when patient is called
try {
fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -1731,7 +1731,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API when patient is called
try {
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -1789,7 +1789,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API when patient finishes at loket
try {
fetch('http://10.10.150.131:8089/api/v1/tiket/selesai', {
fetch('http://10.10.123.140:8089/api/v1/tiket/selesai', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -1860,7 +1860,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API and WAIT for response
try {
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -1952,7 +1952,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API and WAIT for response
try {
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -2035,7 +2035,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API to revert status to sedang diproses (status 8)
try {
fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -2095,7 +2095,7 @@ export const useQueueStore = defineStore('queue', () => {
// POST to external API when patient is being processed (sedang diproses)
try {
fetch('http://10.10.150.131:8089/api/v1/tiket/update', {
fetch('http://10.10.123.140:8089/api/v1/tiket/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -2658,7 +2658,7 @@ export const useQueueStore = defineStore('queue', () => {
case "selesai":
// Send API call to finish endpoint
try {
const apiUrl = 'http://10.10.150.100:8084/api/v1/visit/status/finish';
const apiUrl = 'http://10.10.123.135:8084/api/v1/visit/status/finish';
const requestBody = {
patient_visit_healthcare_service_id: patient.healthcareServiceId,
visit_code: patient.barcode || patient.visitCode,
@@ -2906,7 +2906,7 @@ export const useQueueStore = defineStore('queue', () => {
/**
* Register REGULER patient via API
* POST to http://10.10.150.131:8089/api/v1/tiket/generate
* POST to http://10.10.123.140:8089/api/v1/tiket/generate
*/
const registerRegulerPatientViaApi = async (clinic, paymentType, visitType = 'SEKARANG', isFastTrack = false, fastTrackData = null) => {
try {
@@ -2988,7 +2988,7 @@ export const useQueueStore = defineStore('queue', () => {
console.log('📤 [queueStore] API Body:', body);
// 3. Call API
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/generate', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -3079,7 +3079,7 @@ export const useQueueStore = defineStore('queue', () => {
/**
* Check-in patient via API
* POST to http://10.10.150.131:8089/api/v1/tiket/checkin
* POST to http://10.10.123.140:8089/api/v1/tiket/checkin
*/
const checkInPatientViaApi = async (barcode) => {
try {
@@ -3095,7 +3095,7 @@ export const useQueueStore = defineStore('queue', () => {
console.log('📤 [queueStore] Check-in API Body:', body);
const response = await fetch('http://10.10.150.131:8089/api/v1/tiket/checkin', {
const response = await fetch('http://10.10.123.140:8089/api/v1/tiket/checkin', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -3368,4 +3368,4 @@ export const useQueueStore = defineStore('queue', () => {
return value;
},
},
});
});