mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 22:05:45 +00:00
feat(FE-181-179-220): Slicing UI, Client Side Validation and API Integration for Delivery Order
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
Marketing,
|
||||
CreateSalesOrderPayload,
|
||||
UpdateSalesOrderPayload,
|
||||
CreateDeliveryOrderPayload,
|
||||
UpdateDeliveryOrderPayload,
|
||||
} from '@/types/api/marketing/marketing';
|
||||
|
||||
/**
|
||||
@@ -120,7 +122,7 @@ export class SalesOrderService extends BaseApiService<
|
||||
notes?: string
|
||||
): Promise<BaseApiResponse<{ message: string }> | undefined> {
|
||||
try {
|
||||
const path = `${this.basePath}/deliveries`;
|
||||
const path = `${this.basePath}/approvals`;
|
||||
return await httpClient<BaseApiResponse<{ message: string }>>(path, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
@@ -137,6 +139,11 @@ export class SalesOrderService extends BaseApiService<
|
||||
}
|
||||
|
||||
export const SalesOrderApi = new SalesOrderService('/marketing/sales-orders');
|
||||
export const DeliveryOrderApi = new BaseApiService<
|
||||
Marketing,
|
||||
CreateDeliveryOrderPayload,
|
||||
UpdateDeliveryOrderPayload
|
||||
>('/marketing/delivery-orders');
|
||||
export const MarketingApi = new BaseApiService<Marketing, unknown, unknown>(
|
||||
'/marketing'
|
||||
);
|
||||
|
||||
@@ -8,13 +8,10 @@ import {
|
||||
BaseApiResponse,
|
||||
BaseGroupedApproval,
|
||||
ErrorApiResponse,
|
||||
GroupedApprovals,
|
||||
SuccessApiResponse,
|
||||
} from '@/types/api/api-general';
|
||||
import { sleep } from '@/lib/helper';
|
||||
import { httpClient } from '@/services/http/client';
|
||||
import axios from 'axios';
|
||||
import { Flock } from '@/types/api/master-data/flock';
|
||||
import { Kandang } from '@/types/api/master-data/kandang';
|
||||
import { RequestOptions } from '@/services/http/base';
|
||||
|
||||
@@ -104,25 +101,34 @@ export class ProjectFlockService extends BaseApiService<
|
||||
/**
|
||||
* Get Next Period of Project Flock
|
||||
*/
|
||||
async getNextPeriod(id: string): Promise<
|
||||
| BaseApiResponse<{
|
||||
flock: Flock;
|
||||
next_period: number;
|
||||
}>
|
||||
async getNextPeriod(locationId: number): Promise<
|
||||
| BaseApiResponse<
|
||||
{
|
||||
id: number;
|
||||
name: string;
|
||||
period: number;
|
||||
}[]
|
||||
>
|
||||
| ErrorApiResponse
|
||||
| SuccessApiResponse<{
|
||||
flock: Flock;
|
||||
next_period: number;
|
||||
}>
|
||||
| SuccessApiResponse<
|
||||
{
|
||||
id: number;
|
||||
name: string;
|
||||
period: number;
|
||||
}[]
|
||||
>
|
||||
| undefined
|
||||
> {
|
||||
try {
|
||||
const path = `${this.basePath}/kandangs/${id}`;
|
||||
const path = `${this.basePath}/kandangs/${locationId.toString()}/periods`;
|
||||
return await httpClient<
|
||||
SuccessApiResponse<{
|
||||
flock: Flock;
|
||||
next_period: number;
|
||||
}>
|
||||
SuccessApiResponse<
|
||||
{
|
||||
id: number;
|
||||
name: string;
|
||||
period: number;
|
||||
}[]
|
||||
>
|
||||
>(path, {
|
||||
method: 'GET',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user