mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 22:58:17 +00:00
customer registration api integration
This commit is contained in:
72
packages/types/src/freight/dropdown_settings.ts
Normal file
72
packages/types/src/freight/dropdown_settings.ts
Normal 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">
|
||||
>;
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user