mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 05:45:46 +00:00
refactor(FE-327): change closing API paths and sales types
This commit is contained in:
@@ -15,7 +15,7 @@ export class ClosingApiService extends BaseApiService<
|
||||
id: number
|
||||
): Promise<BaseApiResponse<ClosingSales> | undefined> {
|
||||
try {
|
||||
const getPenjualanPath = `http://localhost:4010/api/closing/${id}/penjualan`;
|
||||
const getPenjualanPath = `${id}/penjualan`;
|
||||
return await this.customRequest<BaseApiResponse<ClosingSales>>(
|
||||
getPenjualanPath
|
||||
);
|
||||
@@ -25,4 +25,4 @@ export class ClosingApiService extends BaseApiService<
|
||||
}
|
||||
}
|
||||
|
||||
export const ClosingApi = new ClosingApiService('/closing');
|
||||
export const ClosingApi = new ClosingApiService('/closings');
|
||||
|
||||
Vendored
+8
-12
@@ -1,31 +1,27 @@
|
||||
import { BaseMetadata } from '@/types/api/api-general';
|
||||
import { Kandang } from '@type/api/master-data/kandang';
|
||||
import { Product } from '@type/api/master-data/product';
|
||||
import { ProductCategory } from '@type/api/master-data/product-category';
|
||||
import { Customer } from '@type/api/master-data/customer';
|
||||
|
||||
export type BaseSales = {
|
||||
id: number;
|
||||
realization_date: string;
|
||||
week_age: number;
|
||||
age_label: string;
|
||||
delivery_order_number: string;
|
||||
age: number;
|
||||
do_number: string;
|
||||
product: Product;
|
||||
product_category: ProductCategory;
|
||||
customer: Customer;
|
||||
quantity: number;
|
||||
qty: number;
|
||||
weight: number;
|
||||
average: number;
|
||||
avg_weight: number;
|
||||
price: number;
|
||||
total: number;
|
||||
kandang: Kandang;
|
||||
kandang_id: number;
|
||||
total_price: number;
|
||||
payment_status: string;
|
||||
};
|
||||
|
||||
export type BaseClosingSales = {
|
||||
project_type: string;
|
||||
penjualan: BaseSales[];
|
||||
flock_id: number;
|
||||
period: number;
|
||||
sales: BaseSales[];
|
||||
};
|
||||
|
||||
export type ClosingSales = BaseMetadata & BaseClosingSales;
|
||||
|
||||
Reference in New Issue
Block a user