customer registration api integration

This commit is contained in:
yaschalew
2026-05-21 02:21:32 +03:00
parent fea308a6af
commit c7347b88d7
39 changed files with 2273 additions and 910 deletions

View File

@@ -0,0 +1,72 @@
import type { BaseEntity } from "../common";
export interface IDropdownOptionMeta {
icon?: string;
color?: string;
badge?: string;
}
export interface IDropdownOption extends BaseEntity {
settingId: string;
/** Stored value (machine-readable identifier). */
value: string;
/** Display label shown to end users. */
label: string;
/** Optional helper text. */
note?: string | null;
disabled: boolean;
order: number;
meta?: IDropdownOptionMeta | null;
}
export interface IDropdownSettingMeta {
icon?: string;
color?: string;
searchable?: boolean;
clearable?: boolean;
permissions?: string[];
version?: string;
}
export interface IDropdownSetting extends BaseEntity {
/** Stable code referenced from forms (snake_case). */
code: string;
/** Display label for admins. */
label: string;
description?: string | null;
multiple: boolean;
meta?: IDropdownSettingMeta | null;
/**
* Options that belong to this dropdown. Named `children` to match the shape
* historically consumed by the freight portal.
*/
children: IDropdownOption[];
}
/* ------------------------------------------------------------------ *
* Wire DTOs (shared between API and frontend)
* ------------------------------------------------------------------ */
export interface CreateDropdownOptionDto {
value: string;
label: string;
note?: string;
disabled?: boolean;
order?: number;
meta?: IDropdownOptionMeta;
}
export type UpdateDropdownOptionDto = Partial<CreateDropdownOptionDto>;
export interface CreateDropdownSettingDto {
code: string;
label: string;
description?: string;
multiple?: boolean;
meta?: IDropdownSettingMeta;
children?: CreateDropdownOptionDto[];
}
export type UpdateDropdownSettingDto = Partial<
Omit<CreateDropdownSettingDto, "children">
>;

View File

@@ -1,6 +1,7 @@
import type { BaseEntity } from "../common";
export * from "./file_upload_settings";
export * from "./dropdown_settings";
export enum BookingStatus {
Draft = "DRAFT",
@@ -44,14 +45,41 @@ export enum PaymentStatus {
Refunded = "REFUNDED",
}
export type CustomerStatus = "Active" | "Pending" | "Inactive";
export type CustomerType = "Importer" | "Exporter" | "Supplier";
export interface ICustomer extends BaseEntity {
name: string;
email: string;
phone: string;
company?: string | null;
customerType: CustomerType;
status: CustomerStatus;
tinNumber?: string | null;
city?: string | null;
country?: string | null;
address?: string | null;
taxId?: string | null;
notes?: string | null;
}
export interface CreateCustomerDto {
name: string;
email: string;
phone: string;
company?: string;
customerType?: CustomerType;
status?: CustomerStatus;
tinNumber?: string;
city?: string;
country?: string;
address?: string;
taxId?: string;
notes?: string;
}
export type UpdateCustomerDto = Partial<CreateCustomerDto>;
export interface ITrain extends BaseEntity {
code: string;
capacityTons: number;