Add WooCommerce integration: sync orders to invoices/people with webhook, cron, and settings UI.
This commit is contained in:
@@ -121,7 +121,8 @@ export type OrgModuleKey =
|
||||
| "saved_views"
|
||||
| "public_api"
|
||||
| "sms_campaigns"
|
||||
| "teams";
|
||||
| "teams"
|
||||
| "woocommerce";
|
||||
|
||||
export const ORG_MODULE_KEYS: OrgModuleKey[] = [
|
||||
"customers",
|
||||
@@ -153,6 +154,7 @@ export const ORG_MODULE_KEYS: OrgModuleKey[] = [
|
||||
"public_api",
|
||||
"sms_campaigns",
|
||||
"teams",
|
||||
"woocommerce",
|
||||
];
|
||||
|
||||
export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
|
||||
@@ -185,6 +187,7 @@ export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
|
||||
public_api: "API و وبهوک",
|
||||
sms_campaigns: "پیامک گروهی",
|
||||
teams: "تیمها و دیدپذیری",
|
||||
woocommerce: "ووکامرس",
|
||||
};
|
||||
|
||||
export const ORG_MODULE_GROUPS: Array<{
|
||||
@@ -224,6 +227,7 @@ export const ORG_MODULE_GROUPS: Array<{
|
||||
"loyalty",
|
||||
"reports",
|
||||
"saved_views",
|
||||
"woocommerce",
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -3143,3 +3147,59 @@ export interface UpdateTeamRequest {
|
||||
export interface SetTeamMembersRequest {
|
||||
members: Array<{ userId: string; role: TeamMemberRole }>;
|
||||
}
|
||||
|
||||
/* ——— ووکامرس ——— */
|
||||
|
||||
export interface WooCommerceConnectionDto {
|
||||
id: string;
|
||||
label: string;
|
||||
storeUrl: string;
|
||||
consumerKeyMasked: string;
|
||||
webhookSecretSet: boolean;
|
||||
enabled: boolean;
|
||||
lastSyncAt: string | null;
|
||||
lastHealthAt: string | null;
|
||||
lastHealthOk: boolean | null;
|
||||
lastError: string | null;
|
||||
importedOrders: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface CreateWooCommerceConnectionRequest {
|
||||
label: string;
|
||||
storeUrl: string;
|
||||
consumerKey: string;
|
||||
consumerSecret: string;
|
||||
webhookSecret?: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface UpdateWooCommerceConnectionRequest {
|
||||
label?: string;
|
||||
storeUrl?: string;
|
||||
consumerKey?: string;
|
||||
consumerSecret?: string;
|
||||
webhookSecret?: string | null;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface WooCommerceSyncResultDto {
|
||||
fetched: number;
|
||||
created: number;
|
||||
updated: number;
|
||||
skipped: number;
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
export interface WooCommerceOrderLinkDto {
|
||||
id: string;
|
||||
wooOrderId: string;
|
||||
wooOrderNumber: string | null;
|
||||
invoiceId: string;
|
||||
invoiceNumber: string;
|
||||
status: string;
|
||||
total: number;
|
||||
currency: string;
|
||||
syncedAt: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user