feat(customers): add initial admin bootstrap and csv import
This commit is contained in:
parent
c816e9869d
commit
ecab0fe6b6
27 changed files with 1197 additions and 34 deletions
|
|
@ -1,6 +1,8 @@
|
|||
export type CustomerStatus = "lead" | "active" | "inactive" | "blocked" | "archived";
|
||||
export type CustomerType = "company" | "private" | "public_sector" | "partner" | "supplier";
|
||||
export type AddressType = "billing" | "shipping" | "primary" | "other";
|
||||
export type CustomerImportMode = "create_only" | "update_existing" | "upsert";
|
||||
export type CustomerImportAction = "create" | "update" | "skip" | "error";
|
||||
|
||||
export interface CustomerAddress {
|
||||
id: number;
|
||||
|
|
@ -87,3 +89,46 @@ export type CustomerContactPayload = {
|
|||
is_primary: boolean;
|
||||
notes: string;
|
||||
};
|
||||
|
||||
export interface CustomerImportIssue {
|
||||
row: number;
|
||||
field: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface CustomerImportPreviewRow {
|
||||
row: number;
|
||||
customer_number: string;
|
||||
company_name: string;
|
||||
action: CustomerImportAction;
|
||||
errors: CustomerImportIssue[];
|
||||
warnings: CustomerImportIssue[];
|
||||
}
|
||||
|
||||
export interface CustomerImportSummary {
|
||||
total_rows: number;
|
||||
valid_rows: number;
|
||||
error_count: number;
|
||||
warning_count: number;
|
||||
duplicate_count: number;
|
||||
create_count: number;
|
||||
update_count: number;
|
||||
skip_count: number;
|
||||
}
|
||||
|
||||
export interface CustomerImportPreviewResponse {
|
||||
mode: CustomerImportMode;
|
||||
summary: CustomerImportSummary;
|
||||
rows: CustomerImportPreviewRow[];
|
||||
errors: CustomerImportIssue[];
|
||||
warnings: CustomerImportIssue[];
|
||||
duplicates: CustomerImportIssue[];
|
||||
}
|
||||
|
||||
export interface CustomerImportCommitResponse {
|
||||
mode: CustomerImportMode;
|
||||
summary: CustomerImportSummary;
|
||||
created: number;
|
||||
updated: number;
|
||||
skipped: number;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ export interface RolePayload {
|
|||
|
||||
export interface CurrentUser {
|
||||
id: number;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
username: string;
|
||||
email: string;
|
||||
role: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue