mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat(FE-284): Slicing and API Integration Perhitungan Sapronak
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import DUMMY_SAPRONAK_CALCULATION from '@/dummy/closing.dummy';
|
||||
import { BaseApiService } from './base';
|
||||
import { BaseApiResponse } from '@/types/api/api-general';
|
||||
import { ClosingSales } from '@/types/api/closing/closing';
|
||||
import { ClosingSales, SapronakCalculation } from '@/types/api/closing/closing';
|
||||
|
||||
export class ClosingApiService extends BaseApiService<
|
||||
ClosingSales,
|
||||
@@ -23,6 +24,38 @@ export class ClosingApiService extends BaseApiService<
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
async getPerhitunganSapronak(
|
||||
projectFlockId: number
|
||||
): Promise<BaseApiResponse<SapronakCalculation> | undefined> {
|
||||
// Dummy implementation - simulate API call with delay
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve({
|
||||
code: 200,
|
||||
status: 'success',
|
||||
message: 'Retrieved sapronak calculation successfully',
|
||||
data: DUMMY_SAPRONAK_CALCULATION,
|
||||
});
|
||||
}, 500); // Simulate 500ms network delay
|
||||
});
|
||||
|
||||
/*
|
||||
// Real API implementation - uncomment when backend is ready
|
||||
try {
|
||||
const path = `${this.basePath}/${projectFlockId}/perhitungan_sapronak`;
|
||||
|
||||
return await httpClient<BaseApiResponse<SapronakCalculation>>(path, {
|
||||
method: 'GET',
|
||||
});
|
||||
} catch (error: unknown) {
|
||||
if (axios.isAxiosError<BaseApiResponse<SapronakCalculation>>(error)) {
|
||||
return error.response?.data;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
export const ClosingApi = new ClosingApiService('/closings');
|
||||
|
||||
Reference in New Issue
Block a user