Merge branch 'freight/develop' of github.com:Tria-plc/edr-platform into freight_feature/priority

This commit is contained in:
marshal
2026-06-19 15:58:36 +03:00
44 changed files with 1975 additions and 1417 deletions

View File

@@ -38,6 +38,7 @@ import {
} from "@/types/dropdownSettings";
import type {
CompanyInfoResponse,
CompanyProfileResponse,
CreateCompanyPayload,
DashboardSummary,
} from "./companies.service";
@@ -128,14 +129,19 @@ export const api = {
"getDashboard",
companiesService.getDashboard,
),
addCompanyProfiles: endpoint<{ types: string[] }, CompanyProfileResponse[]>(
"companies",
"addCompanyProfiles",
companiesService.addCompanyProfiles,
),
},
bookings: {
list: endpoint<BookingListFilter | void, PaginatedResponse<Freight.IBooking>>(
"bookings",
"list",
bookingsService.list,
),
list: endpoint<
BookingListFilter | void,
PaginatedResponse<Freight.IBooking>
>("bookings", "list", bookingsService.list),
get: endpoint<{ id: string }, Freight.IBooking>(
"bookings",
@@ -217,8 +223,14 @@ export const api = {
getBookableSchedules: endpoint<
{ originYardId?: string; destinationYardId?: string },
Freight.BookableScheduleItem[]
>("train-scheduling", "bookableSchedules", ({ originYardId, destinationYardId }) =>
bookingsService.getBookableSchedules({ originYardId, destinationYardId }),
>(
"train-scheduling",
"bookableSchedules",
({ originYardId, destinationYardId }) =>
bookingsService.getBookableSchedules({
originYardId,
destinationYardId,
}),
),
getAvailableDays: endpoint<
@@ -291,19 +303,6 @@ export const api = {
({ entity }) => fileUploadSettingsService.getByEntity(entity),
),
create: endpoint<CreateFileUploadSettingDto, FileUploadSetting>(
"file-upload-settings",
"create",
(payload) => fileUploadSettingsService.create(payload),
),
update: endpoint<
{ id: string; dto: UpdateFileUploadSettingDto },
FileUploadSetting
>("file-upload-settings", "update", ({ id, dto }) =>
fileUploadSettingsService.update(id, dto),
),
remove: endpoint<{ id: string }, void>(
"file-upload-settings",
"remove",

View File

@@ -35,6 +35,18 @@ export interface CompanyResponse {
email: string | null;
website: string | null;
attributes: Record<string, any> | null;
companyProfiles?: CompanyProfileResponse[];
createdAt: string;
updatedAt: string;
}
export interface CompanyProfileResponse {
id: string;
type: string;
reference: string;
status: string;
businessLicense: string | null;
attributes: Record<string, any> | null;
createdAt: string;
updatedAt: string;
}
@@ -44,6 +56,11 @@ export interface CompanyInfoResponse {
company: CompanyResponse;
}
export interface CompanyProfileInput {
type: "importer" | "exporter" | "freight_forwarder" | "dj_freight_forwarder" | "transporter";
businessLicense?: string;
}
export interface CreateCompanyPayload {
companyType?: string;
companyName: string;
@@ -57,6 +74,7 @@ export interface CreateCompanyPayload {
jobTitle?: string;
isPrimaryContact?: boolean;
attributes?: Record<string, any>;
companyProfiles?: CompanyProfileInput[];
}
export interface FreightVolumePoint {
@@ -124,6 +142,16 @@ export const companiesService = {
return unwrap(response.data);
},
addCompanyProfiles: async (payload: {
types: string[];
}): Promise<CompanyProfileResponse[]> => {
const response = await client.post<ApiResponse<CompanyProfileResponse[]>>(
URL_CONSTANTS.COMPANIES_API.COMPANY_PROFILES,
payload,
);
return unwrap(response.data);
},
uploadDocuments: async (
companyId: string,
files: Record<string, File | File[] | null>,