@raxonltd/raxon-core 1.1.7 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/component/general.image.tsx +86 -0
- package/core/context/cart.context.tsx +446 -0
- package/core/context/security.context.tsx +151 -0
- package/core/feature/address/api/places.api.ts +92 -0
- package/core/feature/address/form/address-search-input.tsx +125 -0
- package/core/feature/address/hook/use.addres.tsx +63 -0
- package/core/feature/address/hook/use.address-autocomplete.ts +116 -0
- package/core/feature/address/util/address.types.ts +38 -0
- package/core/feature/address/util/parse-google-place.ts +66 -0
- package/core/feature/analytic-event/analytic.event.api.ts +27 -0
- package/core/feature/analytic-event/analytic.event.context.tsx +180 -0
- package/core/feature/analytic-event/analytic.event.util.ts +42 -0
- package/core/feature/analytic-event/use.analytic.auto.tsx +114 -0
- package/core/feature/article/hook/use.article.tsx +33 -0
- package/core/feature/attribute/hook/use.attribute.tsx +24 -0
- package/core/feature/auth/hook/use.auth.tsx +141 -0
- package/core/feature/auth/modal/modal.auth.tsx +80 -0
- package/core/feature/auth/view/view.login.tsx +199 -0
- package/core/feature/auth/view/view.register.tsx +333 -0
- package/core/feature/bank-account/hook/use.bank.account.tsx +47 -0
- package/core/feature/brand/hook/use.brand.tsx +24 -0
- package/core/feature/cart/component/cart.order.summary.tsx +89 -0
- package/core/feature/cart/component/cart.promo.code.section.tsx +208 -0
- package/core/feature/cart/hook/use.cart.tsx +267 -0
- package/core/feature/cart/util/basket-pay.response.ts +67 -0
- package/core/feature/cart/util/cart-optimistic.ts +425 -0
- package/core/feature/cart/util/garanti-payment.ts +27 -0
- package/core/feature/collection/hook/use.collection.tsx +32 -0
- package/core/feature/delivery-method/hook/use.delivery.method.tsx +40 -0
- package/core/feature/delivery-method/util/checkout.delivery.method.ts +11 -0
- package/core/feature/faq/hook/use.faq.tsx +23 -0
- package/core/feature/favorite/hook/use.favorite.tsx +48 -0
- package/core/feature/form-submit/form/form.contact.tsx +118 -0
- package/core/feature/form-submit/hook/use.form.submit.tsx +16 -0
- package/core/feature/invoice/hook/use.invoice.tsx +51 -0
- package/core/feature/newsletter/hook/use.newsletter.tsx +124 -0
- package/core/feature/newsletter/modal/modal.newsletter.product.tsx +163 -0
- package/core/feature/order/hook/use.order.tsx +31 -0
- package/core/feature/payment-method/checkout.payment.options.ts +117 -0
- package/core/feature/payment-method/hook/use.payment.method.tsx +44 -0
- package/core/feature/product/hook/use.product.tsx +122 -0
- package/core/feature/profile/hook/use.profile.tsx +126 -0
- package/core/feature/promo-code/hook/use.promo.code.tsx +27 -0
- package/core/interface/basket.interface.ts +360 -0
- package/core/interface/bootstrap.interface.ts +39 -0
- package/core/interface/context.interface.ts +9 -0
- package/core/interface/inventory.interface.ts +88 -0
- package/core/interface/nexine.interface.ts +4 -0
- package/core/interface/prisma.interface.ts +8844 -0
- package/core/interface/product.interface.ts +111 -0
- package/core/raxon.context.tsx +256 -0
- package/core/schema/checkout.schema.ts +103 -0
- package/core/server/places.proxy.ts +35 -0
- package/core/server/raxon.bootstrap.route.ts +39 -0
- package/core/server/raxon.server.ts +80 -0
- package/core/util/basket.item.display.ts +19 -0
- package/core/util/category.nav.ts +46 -0
- package/core/util/client-ip.ts +35 -0
- package/core/util/collection.util.ts +433 -0
- package/core/util/fetch.bootstrap.ts +21 -0
- package/core/util/garanti-payment.ts +5 -0
- package/core/util/nexine.axios.tsx +104 -0
- package/core/util/no-cache.ts +6 -0
- package/core/util/util.ts +191 -0
- package/core/view/view.checkout.tsx +1964 -0
- package/dist/core/feature/address/api/places.api.d.ts.map +1 -1
- package/dist/core/feature/address/api/places.api.js +18 -4
- package/dist/core/server/places.proxy.d.ts +10 -0
- package/dist/core/server/places.proxy.d.ts.map +1 -0
- package/dist/core/server/places.proxy.js +24 -0
- package/dist/core/server/raxon.bootstrap.route.d.ts +7 -0
- package/dist/core/server/raxon.bootstrap.route.d.ts.map +1 -0
- package/dist/core/server/raxon.bootstrap.route.js +27 -0
- package/dist/core/server/raxon.server.d.ts +24 -0
- package/dist/core/server/raxon.server.d.ts.map +1 -0
- package/dist/core/server/raxon.server.js +59 -0
- package/dist/core/view/view.checkout.js +2 -2
- package/dist/middleware.d.ts +6 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +5 -0
- package/dist/server-bootstrap.d.ts +2 -0
- package/dist/server-bootstrap.d.ts.map +1 -0
- package/dist/server-bootstrap.js +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -3
- package/tailwind.css +11 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { nexineAxios } from "@/core/util/nexine.axios";
|
|
2
|
+
import { IData } from "@/core/interface/nexine.interface";
|
|
3
|
+
import { Product, Status, Variant } from "@/core/interface/prisma.interface";
|
|
4
|
+
import { useQuery } from "@tanstack/react-query";
|
|
5
|
+
import { InventoryDetailResponse, InventoryFetchResponse } from "@/core/interface/inventory.interface";
|
|
6
|
+
import { Product as CustomProduct, ProductDetail } from "@/core/interface/product.interface";
|
|
7
|
+
|
|
8
|
+
const SEARCH_PAGE_SIZE = 12;
|
|
9
|
+
export const PRODUCT_PAGE_SIZE = 24;
|
|
10
|
+
|
|
11
|
+
export interface ProductListResponse {
|
|
12
|
+
data: CustomProduct[];
|
|
13
|
+
count: number;
|
|
14
|
+
hasNextPage: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ProductListFetchParams {
|
|
18
|
+
categoryId?: string | null;
|
|
19
|
+
tags?: string[];
|
|
20
|
+
orderBy?: "createdAt" | "reviewCount" | "avgRating";
|
|
21
|
+
orderDirection?: "asc" | "desc";
|
|
22
|
+
search?: string | null;
|
|
23
|
+
page: number;
|
|
24
|
+
amount?: number;
|
|
25
|
+
materialType?: string;
|
|
26
|
+
status?: Status;
|
|
27
|
+
outOfStock?: boolean;
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
/** Varyant özellik seçenekleri (API destekliyorsa sunucu tarafı filtre) */
|
|
30
|
+
attributeOptionIds?: string[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
interface ProductFetchParams {
|
|
35
|
+
tags?: string[];
|
|
36
|
+
materialType?: string;
|
|
37
|
+
categoryId?: string;
|
|
38
|
+
subCategoryId?: string;
|
|
39
|
+
sortBy?: string;
|
|
40
|
+
order? : {
|
|
41
|
+
column: string;
|
|
42
|
+
direction: 'asc' | 'desc';
|
|
43
|
+
} | undefined;
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
bestCartItem?: boolean;
|
|
47
|
+
page?: number;
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
amount?: number;
|
|
50
|
+
status?: Status;
|
|
51
|
+
outOfStock?: boolean;
|
|
52
|
+
collectionId?: string;
|
|
53
|
+
attributeOptionId?: string[];
|
|
54
|
+
variantCount?: number;
|
|
55
|
+
search?: string;
|
|
56
|
+
isFavorite?: boolean;
|
|
57
|
+
/** Sunucu bu alanları destekliyorsa uygulanır */
|
|
58
|
+
minPrice?: number;
|
|
59
|
+
maxPrice?: number;
|
|
60
|
+
brandId?: string[];
|
|
61
|
+
|
|
62
|
+
campaignId?: string;
|
|
63
|
+
isLimitedTimeOffer?: boolean;
|
|
64
|
+
isDiscountBasket?: boolean;
|
|
65
|
+
isLimitedStock?: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const useProduct = () => {
|
|
69
|
+
return {
|
|
70
|
+
fetch: (params: ProductFetchParams) => {
|
|
71
|
+
const finalCategoryId = params.subCategoryId || params.categoryId;
|
|
72
|
+
return useQuery({
|
|
73
|
+
queryKey: ['product', 'list', params],
|
|
74
|
+
enabled: params.enabled ?? true,
|
|
75
|
+
queryFn: async () => {
|
|
76
|
+
const response = await nexineAxios.get<IData<CustomProduct>>("/customer/product", {
|
|
77
|
+
params: params
|
|
78
|
+
});
|
|
79
|
+
return response.data;
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
searchData: (search: string) => {
|
|
84
|
+
return useQuery({
|
|
85
|
+
queryKey: ["product", "search", search],
|
|
86
|
+
enabled: search != undefined && search != "" && search.length > 2,
|
|
87
|
+
queryFn: async () => {
|
|
88
|
+
var data = await nexineAxios.get<IData<CustomProduct>>("/customer/product", {
|
|
89
|
+
params: {
|
|
90
|
+
materialType: "product",
|
|
91
|
+
search: search,
|
|
92
|
+
amount: 12
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return data.data;
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
related: (productId: string) => {
|
|
100
|
+
return useQuery({
|
|
101
|
+
queryKey: ["product", "related", productId],
|
|
102
|
+
queryFn: async () => {
|
|
103
|
+
var data = await nexineAxios.get<CustomProduct[]>(`/customer/product/${productId}/related`);
|
|
104
|
+
return data.data;
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
detail: (slug: string) => {
|
|
109
|
+
return useQuery({
|
|
110
|
+
queryKey: ["product", slug],
|
|
111
|
+
queryFn: async () => {
|
|
112
|
+
var data = await nexineAxios.get<ProductDetail>(`/customer/product/${slug}`,{
|
|
113
|
+
params : {
|
|
114
|
+
status : Status.PUBLISHED,
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
return data.data;
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { nexineAxios } from "@/core/util/nexine.axios";
|
|
2
|
+
import { CompanyStatus, Media, PaymentMethod, User } from "@/core/interface/prisma.interface";
|
|
3
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
|
|
5
|
+
export interface CompanyProfileData {
|
|
6
|
+
id: string;
|
|
7
|
+
tradingName: string;
|
|
8
|
+
legalName: string | null;
|
|
9
|
+
taxNumber: string | null;
|
|
10
|
+
taxOffice: string | null;
|
|
11
|
+
openAddress: string | null;
|
|
12
|
+
city?: string | null;
|
|
13
|
+
province?: string | null;
|
|
14
|
+
district?: string | null;
|
|
15
|
+
approveStatus: CompanyStatus;
|
|
16
|
+
createdAt?: string;
|
|
17
|
+
updatedAt?: string;
|
|
18
|
+
registerMedia?: Media[];
|
|
19
|
+
paymentMethods?: PaymentMethod[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CompanyProfileResponse {
|
|
23
|
+
hasCompany: boolean;
|
|
24
|
+
canApply: boolean;
|
|
25
|
+
company: CompanyProfileData | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface CompanyApplyPayload {
|
|
29
|
+
legalName: string;
|
|
30
|
+
taxNumber: string;
|
|
31
|
+
taxOffice: string;
|
|
32
|
+
openAddress: string;
|
|
33
|
+
taxCertificateMediaId: string;
|
|
34
|
+
chamberRegistrationMediaId: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const useProfile = () => {
|
|
38
|
+
const queryClient = useQueryClient();
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
fetch: ({isEnabled = false}) => {
|
|
42
|
+
return useQuery({
|
|
43
|
+
queryKey: ["profile"],
|
|
44
|
+
enabled: isEnabled,
|
|
45
|
+
queryFn: async () => {
|
|
46
|
+
var response = await nexineAxios.get<User>("/customer/profile");
|
|
47
|
+
return response.data;
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
update: () => {
|
|
52
|
+
return useMutation({
|
|
53
|
+
mutationFn: async (data: any) => {
|
|
54
|
+
return await nexineAxios.put("/customer/profile", data);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
verifyPhoneNumber: () => {
|
|
59
|
+
return useMutation({
|
|
60
|
+
mutationFn: async (data: { phoneNumber: string; code?: string }) => {
|
|
61
|
+
return await nexineAxios.post("/customer/profile/verify/phone", data);
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
verifyEmail: () => {
|
|
66
|
+
return useMutation({
|
|
67
|
+
mutationFn: async (data: { email: string; code?: string }) => {
|
|
68
|
+
return await nexineAxios.post("/customer/profile/verify/email", data);
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
fetchCompany: ({ isEnabled = true } = {}) => {
|
|
73
|
+
return useQuery({
|
|
74
|
+
queryKey: ["profile", "company"],
|
|
75
|
+
enabled: isEnabled,
|
|
76
|
+
retry: false,
|
|
77
|
+
queryFn: async () => {
|
|
78
|
+
try {
|
|
79
|
+
const response = await nexineAxios.get<{ data: CompanyProfileResponse }>("/customer/profile/company");
|
|
80
|
+
return response.data.data;
|
|
81
|
+
} catch (error: any) {
|
|
82
|
+
if (error?.response?.status === 404) {
|
|
83
|
+
return {
|
|
84
|
+
hasCompany: false,
|
|
85
|
+
canApply: true,
|
|
86
|
+
company: null,
|
|
87
|
+
} satisfies CompanyProfileResponse;
|
|
88
|
+
}
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
applyCompany: () => {
|
|
95
|
+
return useMutation({
|
|
96
|
+
mutationFn: async (data: CompanyApplyPayload) => {
|
|
97
|
+
const response = await nexineAxios.post<{ data: CompanyProfileResponse }>("/customer/profile/company/apply", data);
|
|
98
|
+
return response.data.data;
|
|
99
|
+
},
|
|
100
|
+
onSuccess: () => {
|
|
101
|
+
queryClient.invalidateQueries({ queryKey: ["profile", "company"] });
|
|
102
|
+
queryClient.invalidateQueries({ queryKey: ["profile"] });
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
uploadCompanyDocument: () => {
|
|
107
|
+
return useMutation({
|
|
108
|
+
mutationFn: async (file: File) => {
|
|
109
|
+
const formData = new FormData();
|
|
110
|
+
formData.append("path", "company-registration");
|
|
111
|
+
formData.append("files", file);
|
|
112
|
+
|
|
113
|
+
const response = await nexineAxios.post<{ data: Media[] }>("/customer/media/upload?isCompress=false", formData, {
|
|
114
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const uploaded = Array.isArray(response.data.data) ? response.data.data[0] : response.data.data;
|
|
118
|
+
if (!uploaded?.id) {
|
|
119
|
+
throw new Error("Dosya yüklenemedi");
|
|
120
|
+
}
|
|
121
|
+
return uploaded as Media;
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { nexineAxios } from '@/core/util/nexine.axios';
|
|
2
|
+
import { IData } from '@/core/interface/nexine.interface';
|
|
3
|
+
import { PromoCode } from '@/core/interface/prisma.interface';
|
|
4
|
+
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
5
|
+
|
|
6
|
+
export const usePromoCode = () => {
|
|
7
|
+
return {
|
|
8
|
+
fetch: (params?: { status?: string }) => {
|
|
9
|
+
return useQuery({
|
|
10
|
+
queryKey: ['promo-code', 'list', params],
|
|
11
|
+
queryFn: async () => {
|
|
12
|
+
const response = await nexineAxios.get<IData<PromoCode> | PromoCode[]>('/customer/promo-code', { params });
|
|
13
|
+
const data = response.data;
|
|
14
|
+
return Array.isArray(data) ? data : (data as IData<PromoCode>).data ?? [];
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
findByCode: () => {
|
|
19
|
+
return useMutation({
|
|
20
|
+
mutationFn: async (code: string) => {
|
|
21
|
+
const response = await nexineAxios.get<PromoCode>(`/customer/promo-code/${encodeURIComponent(code.trim())}`);
|
|
22
|
+
return response.data;
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import {CartStatus, CartType, PaymentProvider, PaymentType, SaleType} from './prisma.interface';
|
|
2
|
+
|
|
3
|
+
export interface BasketInterface {
|
|
4
|
+
id: string;
|
|
5
|
+
no: number;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
type: CartType;
|
|
8
|
+
acceptedAlternativeProduct: boolean;
|
|
9
|
+
status: CartStatus;
|
|
10
|
+
company: {
|
|
11
|
+
id: string;
|
|
12
|
+
tradingName: string;
|
|
13
|
+
companyNo: string;
|
|
14
|
+
openAddress: string;
|
|
15
|
+
taxNumber: string;
|
|
16
|
+
group: {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
cashDesk: {
|
|
22
|
+
id: string;
|
|
23
|
+
key: string;
|
|
24
|
+
};
|
|
25
|
+
cashier: {
|
|
26
|
+
id: string;
|
|
27
|
+
firstName: string;
|
|
28
|
+
lastName: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface BasketItemInterface {
|
|
32
|
+
id: string;
|
|
33
|
+
subItems: BasketItemInterface[];
|
|
34
|
+
quantityTable: {
|
|
35
|
+
conversionTable: {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
value: number;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
product: {
|
|
42
|
+
articleNumber: string;
|
|
43
|
+
type: 'product' | 'deposit';
|
|
44
|
+
baseUnit: {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
};
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
};
|
|
51
|
+
productUnit: {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
};
|
|
55
|
+
images: string[] | undefined;
|
|
56
|
+
quantity: number;
|
|
57
|
+
saleType: SaleType;
|
|
58
|
+
weight: number;
|
|
59
|
+
stock: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface BasketDeliveryMethodRule {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
minimumOrderAmount: number | null;
|
|
66
|
+
courierFee: number | null;
|
|
67
|
+
isForceFee: boolean;
|
|
68
|
+
isFaceToFace: boolean;
|
|
69
|
+
deliveryAreas?: {
|
|
70
|
+
name: string;
|
|
71
|
+
minimumOrderAmount: number | null;
|
|
72
|
+
courierFee: number | null;
|
|
73
|
+
}[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface BasketDeliveryWarning {
|
|
77
|
+
code: string;
|
|
78
|
+
message: string;
|
|
79
|
+
productId?: string;
|
|
80
|
+
cartItemId?: string;
|
|
81
|
+
productName?: string;
|
|
82
|
+
action: 'remove' | 'warning' | 'switch_delivery_method' | 'block';
|
|
83
|
+
deliveryMethodId?: string;
|
|
84
|
+
deliveryMethodName?: string;
|
|
85
|
+
allowedDeliveryMethods?: BasketDeliveryMethodRule[];
|
|
86
|
+
suggestedDeliveryMethod?: {
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
};
|
|
90
|
+
quantityMin?: number;
|
|
91
|
+
quantityMax?: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface BasketAddressInterface {
|
|
95
|
+
id: string;
|
|
96
|
+
title?: string | null;
|
|
97
|
+
firstName?: string | null;
|
|
98
|
+
lastName?: string | null;
|
|
99
|
+
phoneNumber?: string | null;
|
|
100
|
+
email?: string | null;
|
|
101
|
+
country?: string | null;
|
|
102
|
+
countryCode?: string | null;
|
|
103
|
+
taxNumber?: string | null;
|
|
104
|
+
taxOffice?: string | null;
|
|
105
|
+
companyName?: string | null;
|
|
106
|
+
description?: string | null;
|
|
107
|
+
administrativeAreaLevel1?: string | null;
|
|
108
|
+
administrativeAreaLevel2?: string | null;
|
|
109
|
+
administrativeAreaLevel3?: string | null;
|
|
110
|
+
streetName?: string | null;
|
|
111
|
+
streetNumber?: string | null;
|
|
112
|
+
buildingName?: string | null;
|
|
113
|
+
floorNumber?: string | null;
|
|
114
|
+
apartmentNumber?: string | null;
|
|
115
|
+
postalCode?: string | null;
|
|
116
|
+
fullAddress?: string | null;
|
|
117
|
+
latitude?: number | null;
|
|
118
|
+
longitude?: number | null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface BasketSummaryInterface {
|
|
122
|
+
id: string;
|
|
123
|
+
acceptedAlternativeProduct: boolean;
|
|
124
|
+
customer : {
|
|
125
|
+
firstName: string;
|
|
126
|
+
lastName: string;
|
|
127
|
+
email : string;
|
|
128
|
+
phoneNumber : string;
|
|
129
|
+
} | undefined;
|
|
130
|
+
bankTransferCode : {
|
|
131
|
+
id: string;
|
|
132
|
+
code: string;
|
|
133
|
+
amount: number;
|
|
134
|
+
bankAccount : {
|
|
135
|
+
id: string;
|
|
136
|
+
bankName: string;
|
|
137
|
+
IBAN: string;
|
|
138
|
+
accountHolderName: string;
|
|
139
|
+
}
|
|
140
|
+
} | undefined;
|
|
141
|
+
promoCode : {
|
|
142
|
+
id: string;
|
|
143
|
+
code: string;
|
|
144
|
+
discount: number;
|
|
145
|
+
type: string;
|
|
146
|
+
status: string;
|
|
147
|
+
} | undefined;
|
|
148
|
+
campaign : {
|
|
149
|
+
id: string;
|
|
150
|
+
name: string;
|
|
151
|
+
type: string;
|
|
152
|
+
status: string;
|
|
153
|
+
} | undefined;
|
|
154
|
+
paymentMethod : {
|
|
155
|
+
id: string;
|
|
156
|
+
name: string;
|
|
157
|
+
provider: PaymentProvider;
|
|
158
|
+
paymentTerms: string;
|
|
159
|
+
} | undefined;
|
|
160
|
+
deliveryMethod : {
|
|
161
|
+
id: string;
|
|
162
|
+
name: string;
|
|
163
|
+
} | undefined;
|
|
164
|
+
deliveryAddress : BasketAddressInterface | undefined;
|
|
165
|
+
invoiceAddress : BasketAddressInterface | undefined;
|
|
166
|
+
deliveryNote: string | null;
|
|
167
|
+
deliveryDate: string | null;
|
|
168
|
+
deliveryTime: string | null;
|
|
169
|
+
timeSlotId: string | null;
|
|
170
|
+
timeSlot: {
|
|
171
|
+
id: string;
|
|
172
|
+
start: string;
|
|
173
|
+
end: string;
|
|
174
|
+
} | undefined;
|
|
175
|
+
email: string | null;
|
|
176
|
+
company: {
|
|
177
|
+
id: string;
|
|
178
|
+
tradingName: string;
|
|
179
|
+
companyNo: string;
|
|
180
|
+
companyGroup : {
|
|
181
|
+
id: string;
|
|
182
|
+
name: string;
|
|
183
|
+
}
|
|
184
|
+
} | undefined;
|
|
185
|
+
cashDesk: {
|
|
186
|
+
id: string;
|
|
187
|
+
key: string;
|
|
188
|
+
} | undefined;
|
|
189
|
+
cashier: {
|
|
190
|
+
id: string;
|
|
191
|
+
firstName: string;
|
|
192
|
+
lastName: string;
|
|
193
|
+
} | undefined;
|
|
194
|
+
items: BasketItemSummaryInterface[];
|
|
195
|
+
warnings?: BasketDeliveryWarning[];
|
|
196
|
+
info: {
|
|
197
|
+
count: {
|
|
198
|
+
VKE: number;
|
|
199
|
+
Basis: number;
|
|
200
|
+
Gesamt: number;
|
|
201
|
+
Artikel: number;
|
|
202
|
+
};
|
|
203
|
+
basePrice: BasketSummaryInfoPrice;
|
|
204
|
+
deposit: BasketSummaryInfoDeposit;
|
|
205
|
+
tax: BasketSummaryInfoTax[];
|
|
206
|
+
delivery: BasketSummaryInfoDelivery;
|
|
207
|
+
discount: BasketSummaryInfoDiscount;
|
|
208
|
+
promotion: BasketSummaryInfoPromotion;
|
|
209
|
+
campaign: BasketSummaryInfoCampaign;
|
|
210
|
+
payPrice: BasketSummaryInfoPayPrice;
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export interface BasketSummaryInfoCampaign {
|
|
215
|
+
info: {
|
|
216
|
+
status: boolean | null;
|
|
217
|
+
message: string | null;
|
|
218
|
+
name: string | null;
|
|
219
|
+
};
|
|
220
|
+
total: number;
|
|
221
|
+
tax: number;
|
|
222
|
+
pay: number;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface BasketSummaryInfoDeposit {
|
|
226
|
+
total: number;
|
|
227
|
+
tax: number;
|
|
228
|
+
pay: number;
|
|
229
|
+
}
|
|
230
|
+
export interface BasketSummaryInfoPrice {
|
|
231
|
+
total: number;
|
|
232
|
+
tax: number;
|
|
233
|
+
pay: number;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface BasketSummaryInfoTax {
|
|
237
|
+
tax: number;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface BasketSummaryInfoDelivery {
|
|
241
|
+
remainingAmount: number;
|
|
242
|
+
deliveryMethod?: {
|
|
243
|
+
title: string;
|
|
244
|
+
minimumPrice: number;
|
|
245
|
+
deliveryFee: number;
|
|
246
|
+
};
|
|
247
|
+
total: number;
|
|
248
|
+
tax: number;
|
|
249
|
+
pay: number;
|
|
250
|
+
warnings?: BasketDeliveryWarning[];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface BasketSummaryInfoDiscount {
|
|
254
|
+
deliveryMethod?: {
|
|
255
|
+
title: string;
|
|
256
|
+
minimumPrice: number;
|
|
257
|
+
deliveryFee: number;
|
|
258
|
+
};
|
|
259
|
+
total: number;
|
|
260
|
+
tax: number;
|
|
261
|
+
pay: number;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface BasketSummaryInfoPromotion {
|
|
265
|
+
info : {
|
|
266
|
+
status : boolean | null;
|
|
267
|
+
message : string | null;
|
|
268
|
+
}
|
|
269
|
+
total: number;
|
|
270
|
+
tax: number;
|
|
271
|
+
pay: number;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface BasketSummaryInfoPayPrice {
|
|
275
|
+
total: number;
|
|
276
|
+
tax: number;
|
|
277
|
+
pay: number;
|
|
278
|
+
}
|
|
279
|
+
export interface BasketVariantAttributeOption {
|
|
280
|
+
id: string;
|
|
281
|
+
name: string;
|
|
282
|
+
color: string | null;
|
|
283
|
+
icon: string | null;
|
|
284
|
+
attribute: {
|
|
285
|
+
id: string;
|
|
286
|
+
name: string;
|
|
287
|
+
} | null;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface BasketItemVariant {
|
|
291
|
+
id: string;
|
|
292
|
+
variantNumber: string | null;
|
|
293
|
+
barcode: string | null;
|
|
294
|
+
stock: number | null;
|
|
295
|
+
images: string[];
|
|
296
|
+
attributeOption1: BasketVariantAttributeOption | null;
|
|
297
|
+
attributeOption2: BasketVariantAttributeOption | null;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface BasketItemSummaryInterface {
|
|
301
|
+
id: string;
|
|
302
|
+
productId: string;
|
|
303
|
+
variantId: string | null;
|
|
304
|
+
variant: BasketItemVariant | null;
|
|
305
|
+
taxPercentage: number;
|
|
306
|
+
images: string[];
|
|
307
|
+
product: {
|
|
308
|
+
articleNumber: string;
|
|
309
|
+
type: 'product' | 'deposit';
|
|
310
|
+
baseUnit: {
|
|
311
|
+
id: string;
|
|
312
|
+
name: string;
|
|
313
|
+
};
|
|
314
|
+
productUnits: {
|
|
315
|
+
id: string;
|
|
316
|
+
quantityPerUnitOfMeasure: number;
|
|
317
|
+
unit: {
|
|
318
|
+
id: string;
|
|
319
|
+
name: string;
|
|
320
|
+
};
|
|
321
|
+
}[];
|
|
322
|
+
id: string;
|
|
323
|
+
name: string;
|
|
324
|
+
};
|
|
325
|
+
productUnit: {
|
|
326
|
+
id: string;
|
|
327
|
+
name: string;
|
|
328
|
+
};
|
|
329
|
+
productSaleUnit: string;
|
|
330
|
+
unitName: string;
|
|
331
|
+
quantityPerUnitOfMeasure: number;
|
|
332
|
+
quantity: number;
|
|
333
|
+
saleType: SaleType;
|
|
334
|
+
weight: number;
|
|
335
|
+
stock: number;
|
|
336
|
+
basePrice: number;
|
|
337
|
+
discountPrice: number;
|
|
338
|
+
lineTotal: number;
|
|
339
|
+
lineTax: number;
|
|
340
|
+
linePay: number;
|
|
341
|
+
taxAmount: {
|
|
342
|
+
baseTaxAmount: number;
|
|
343
|
+
payTaxAmount: number;
|
|
344
|
+
};
|
|
345
|
+
lineDepositUnitPrice?: number;
|
|
346
|
+
lineDepositAmount?: number;
|
|
347
|
+
subItems?: BasketDepositItemInterface[];
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface BasketDepositItemInterface {
|
|
351
|
+
id: string;
|
|
352
|
+
depositProductId: string;
|
|
353
|
+
title: string;
|
|
354
|
+
quantity: number;
|
|
355
|
+
amount: number;
|
|
356
|
+
taxPercentage: number;
|
|
357
|
+
total: number;
|
|
358
|
+
tax: number;
|
|
359
|
+
pay: number;
|
|
360
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Article,
|
|
3
|
+
BankAccount,
|
|
4
|
+
Branch,
|
|
5
|
+
Campaign,
|
|
6
|
+
Category,
|
|
7
|
+
Collection,
|
|
8
|
+
DeliveryMethod,
|
|
9
|
+
DynamicData,
|
|
10
|
+
Faq,
|
|
11
|
+
Feed,
|
|
12
|
+
Holiday,
|
|
13
|
+
Material,
|
|
14
|
+
PaymentMethod,
|
|
15
|
+
Review,
|
|
16
|
+
} from '@/core/interface/prisma.interface';
|
|
17
|
+
import { Product } from '@/core/interface/product.interface';
|
|
18
|
+
import { RaxonContextBrand } from '@/core/interface/context.interface';
|
|
19
|
+
|
|
20
|
+
export interface RaxonBootstrapPayload {
|
|
21
|
+
campaign?: Campaign[];
|
|
22
|
+
collection?: Collection[];
|
|
23
|
+
subHeroCollection?: Collection[];
|
|
24
|
+
branch?: Branch | null;
|
|
25
|
+
category?: Category[];
|
|
26
|
+
product?: Product[];
|
|
27
|
+
holiday?: Holiday[];
|
|
28
|
+
review?: Review[];
|
|
29
|
+
article?: Article[];
|
|
30
|
+
feed?: Feed[];
|
|
31
|
+
bankAccount?: BankAccount[];
|
|
32
|
+
deliveryMethod?: DeliveryMethod[];
|
|
33
|
+
paymentMethod?: PaymentMethod[];
|
|
34
|
+
brand?: RaxonContextBrand[];
|
|
35
|
+
bestSeller?: Product[];
|
|
36
|
+
dynamicData?: DynamicData[];
|
|
37
|
+
faq?: Faq[];
|
|
38
|
+
material?: Material[];
|
|
39
|
+
}
|