flowrix 1.0.1-beta.12 → 1.0.1-beta.120
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/dist/module.d.mts +1 -6
- package/dist/module.json +1 -1
- package/dist/module.mjs +170 -30
- package/dist/runtime/composables/Blog/useBlogIndex.d.ts +2 -5
- package/dist/runtime/composables/Blog/useBlogSingle.js +2 -4
- package/dist/runtime/composables/Brand/brand.js +2 -0
- package/dist/runtime/composables/Cart/useCart.d.ts +40 -0
- package/dist/runtime/composables/Cart/useCart.js +10 -0
- package/dist/runtime/composables/Cart/useCartComponent.d.ts +1 -0
- package/dist/runtime/composables/Cart/useCartComponent.js +11 -0
- package/dist/runtime/composables/Cart/useCartDetail.d.ts +15 -5
- package/dist/runtime/composables/Cart/useCartDetail.js +3 -0
- package/dist/runtime/composables/Category/useCategoryIndex.d.ts +25 -32
- package/dist/runtime/composables/Category/useCategoryIndex.js +56 -44
- package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.js +8 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useEway.js +16 -6
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +40 -1
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +10 -2
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +40 -1
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +10 -2
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +3 -14
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.js +8 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +2 -2
- package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.js +8 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.js +8 -0
- package/dist/runtime/composables/Checkout/useCheckout.d.ts +85 -73
- package/dist/runtime/composables/Checkout/useCheckout.js +84 -53
- package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.d.ts +43 -0
- package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.js +84 -0
- package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.d.ts +55 -0
- package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.js +196 -0
- package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +7 -7
- package/dist/runtime/composables/Checkout/useCreateAccount.js +3 -1
- package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +2 -2
- package/dist/runtime/composables/Checkout/useDeliveryMethod.js +18 -11
- package/dist/runtime/composables/Customer/useBillingAddress.d.ts +112 -0
- package/dist/runtime/composables/Customer/useBillingAddress.js +93 -0
- package/dist/runtime/composables/Customer/useLogin.d.ts +9 -0
- package/dist/runtime/composables/Customer/useLogin.js +34 -0
- package/dist/runtime/composables/Customer/useOrders.d.ts +29 -0
- package/dist/runtime/composables/Customer/useOrders.js +56 -0
- package/dist/runtime/composables/Customer/usePasswordReset.d.ts +26 -0
- package/dist/runtime/composables/Customer/usePasswordReset.js +258 -0
- package/dist/runtime/composables/Customer/useProfile.d.ts +75 -0
- package/dist/runtime/composables/Customer/useProfile.js +106 -0
- package/dist/runtime/composables/Customer/useQuotations.d.ts +32 -0
- package/dist/runtime/composables/Customer/useQuotations.js +40 -0
- package/dist/runtime/composables/Customer/useRegister.d.ts +121 -13
- package/dist/runtime/composables/Customer/useRegister.js +310 -35
- package/dist/runtime/composables/Customer/useShippingAddress.d.ts +121 -0
- package/dist/runtime/composables/Customer/useShippingAddress.js +145 -0
- package/dist/runtime/composables/Customer/useUpdatePassword.d.ts +21 -0
- package/dist/runtime/composables/Customer/useUpdatePassword.js +130 -0
- package/dist/runtime/composables/Customer/useUserCards.d.ts +22 -0
- package/dist/runtime/composables/Customer/useUserCards.js +65 -0
- package/dist/runtime/composables/{useWishlists.d.ts → Customer/useWishlists.d.ts} +6 -19
- package/dist/runtime/composables/{useWishlists.js → Customer/useWishlists.js} +21 -29
- package/dist/runtime/composables/Extras/useCountry.d.ts +11 -6
- package/dist/runtime/composables/Extras/useCountry.js +5 -4
- package/dist/runtime/composables/Header/useHeader.d.ts +6 -20
- package/dist/runtime/composables/Header/useHeader.js +3 -2
- package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +4 -5
- package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +1 -1
- package/dist/runtime/composables/Product/useProductComponent.js +110 -0
- package/dist/runtime/composables/Product/useProductSlug.d.ts +8 -1
- package/dist/runtime/composables/Product/useQuickView.d.ts +8 -0
- package/dist/runtime/composables/Product/useQuickView.js +27 -0
- package/dist/runtime/composables/Product/useService.d.ts +1 -1
- package/dist/runtime/composables/Product/useService.js +0 -3
- package/dist/runtime/composables/Samples/useSamples.js +1 -1
- package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +2 -2
- package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +2 -2
- package/dist/runtime/composables/index.d.ts +18 -12
- package/dist/runtime/composables/index.js +18 -12
- package/dist/runtime/composables/useAddresses.js +6 -6
- package/dist/runtime/composables/useApp.d.ts +1 -0
- package/dist/runtime/composables/useApp.js +85 -0
- package/dist/runtime/composables/useCards.js +2 -2
- package/dist/runtime/composables/useDataLayer.js +1 -1
- package/dist/runtime/composables/useDotDigital.d.ts +3 -0
- package/dist/runtime/composables/useDotDigital.js +122 -0
- package/dist/runtime/composables/useLocation.d.ts +2 -12
- package/dist/runtime/composables/useMetaLayer.js +11 -11
- package/dist/runtime/composables/useQuotationCheckout.d.ts +78 -0
- package/dist/runtime/composables/useQuotationCheckout.js +137 -0
- package/dist/runtime/composables/useSubscriptions.d.ts +17 -10
- package/dist/runtime/composables/useSubscriptions.js +68 -33
- package/dist/runtime/composables/useTikTokDatalayer.js +7 -7
- package/dist/runtime/composables/useWebforms.d.ts +38 -9
- package/dist/runtime/composables/useWebforms.js +93 -60
- package/dist/runtime/middleware/flowrix.d.ts +5 -4
- package/dist/runtime/middleware/flowrix.js +40 -21
- package/dist/runtime/pages/404.d.vue.ts +3 -0
- package/dist/runtime/pages/404.vue +6 -0
- package/dist/runtime/pages/404.vue.d.ts +3 -0
- package/dist/runtime/pages/flowrix-default.d.vue.ts +3 -0
- package/dist/runtime/pages/flowrix-default.vue +43 -0
- package/dist/runtime/pages/flowrix-default.vue.d.ts +3 -0
- package/dist/runtime/plugin.d.ts +1 -1
- package/dist/runtime/plugins/router.d.ts +2 -0
- package/dist/runtime/plugins/router.js +11 -0
- package/dist/runtime/server/api/albums.d.ts +1 -0
- package/dist/runtime/server/api/albums.js +35 -7
- package/dist/runtime/server/api/auth/forgot.js +1 -2
- package/dist/runtime/server/api/auth/login.d.ts +7 -0
- package/dist/runtime/server/api/auth/login.js +4 -16
- package/dist/runtime/server/api/auth/logout.js +1 -2
- package/dist/runtime/server/api/auth/register.js +1 -2
- package/dist/runtime/server/api/auth/session.get.js +1 -3
- package/dist/runtime/server/api/auth/user/reset-password.js +1 -2
- package/dist/runtime/server/api/auth/user/session.js +1 -2
- package/dist/runtime/server/api/auth/user/verify-token.js +1 -2
- package/dist/runtime/server/api/banners.js +20 -15
- package/dist/runtime/server/api/brand/[...slug].js +55 -0
- package/dist/runtime/server/api/brand/index.d.ts +3 -0
- package/dist/runtime/server/api/brand/index.js +46 -0
- package/dist/runtime/server/api/cache/[...slug].delete.d.ts +4 -1
- package/dist/runtime/server/api/cache/[...slug].delete.js +4 -7
- package/dist/runtime/server/api/cache/clean.get.d.ts +5 -0
- package/dist/runtime/server/api/cache/clean.get.js +4 -7
- package/dist/runtime/server/api/cart/[slug]/add.d.ts +1 -1
- package/dist/runtime/server/api/cart/[slug]/add.js +11 -11
- package/dist/runtime/server/api/cart/[slug]/update.d.ts +1 -1
- package/dist/runtime/server/api/cart/[slug]/update.js +11 -11
- package/dist/runtime/server/api/{v2/[...slug].d.ts → cart/related.d.ts} +0 -1
- package/dist/runtime/server/api/cart/related.js +21 -0
- package/dist/runtime/server/api/cart/remove.d.ts +1 -1
- package/dist/runtime/server/api/cart/remove.js +10 -10
- package/dist/runtime/server/api/cart/service/[slug]/add.d.ts +1 -1
- package/dist/runtime/server/api/cart/service/[slug]/add.js +12 -12
- package/dist/runtime/server/api/catalog/brands.d.ts +3 -0
- package/dist/runtime/server/api/catalog/brands.js +52 -0
- package/dist/runtime/server/api/catalog/categories.js +28 -19
- package/dist/runtime/server/api/catalog/categoriesall.d.ts +3 -0
- package/dist/runtime/server/api/catalog/categoriesall.js +52 -0
- package/dist/runtime/server/api/catalog/featured.js +28 -17
- package/dist/runtime/server/api/catalog/posts.d.ts +3 -0
- package/dist/runtime/server/api/catalog/posts.js +52 -0
- package/dist/runtime/server/api/catalog/samples.js +28 -19
- package/dist/runtime/server/api/catalog/search.js +28 -19
- package/dist/runtime/server/api/category/[...slug].js +30 -20
- package/dist/runtime/server/api/check-404.d.ts +4 -0
- package/dist/runtime/server/api/check-404.js +8 -0
- package/dist/runtime/server/api/checkout/applyCoupon.d.ts +1 -1
- package/dist/runtime/server/api/checkout/applyCoupon.js +13 -13
- package/dist/runtime/server/api/checkout/configs.d.ts +1 -1
- package/dist/runtime/server/api/checkout/configs.js +11 -11
- package/dist/runtime/server/api/checkout/countries.d.ts +1 -1
- package/dist/runtime/server/api/checkout/countries.js +5 -9
- package/dist/runtime/server/api/checkout/paymentmethod.d.ts +1 -1
- package/dist/runtime/server/api/checkout/paymentmethod.js +16 -11
- package/dist/runtime/server/api/{blog/blog.d.ts → checkout/quotation/[slug].d.ts} +0 -1
- package/dist/runtime/server/api/checkout/quotation/[slug].js +20 -0
- package/dist/runtime/server/api/checkout/quotation/guest/[slug].d.ts +2 -0
- package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +35 -0
- package/dist/runtime/server/api/checkout/quotation/guest/customer.d.ts +2 -0
- package/dist/runtime/server/api/checkout/quotation/guest/customer.js +20 -0
- package/dist/runtime/server/api/checkout/quotation/submit/[slug].d.ts +2 -0
- package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +22 -0
- package/dist/runtime/server/api/checkvariables.d.ts +3 -0
- package/dist/runtime/server/api/checkvariables.js +35 -0
- package/dist/runtime/server/api/cmspost/[...slug].js +54 -0
- package/dist/runtime/server/api/cmspost/all.d.ts +3 -0
- package/dist/runtime/server/api/cmspost/all.js +52 -0
- package/dist/runtime/server/api/company/profile.d.ts +1 -1
- package/dist/runtime/server/api/company/profile.js +12 -7
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.d.ts +1 -1
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +50 -15
- package/dist/runtime/server/api/contact-center/webforms/create.d.ts +1 -1
- package/dist/runtime/server/api/contact-center/webforms/create.js +13 -9
- package/dist/runtime/server/api/countries.d.ts +2 -0
- package/dist/runtime/server/api/countries.js +44 -0
- package/dist/runtime/server/api/customer/address/add.js +1 -2
- package/dist/runtime/server/api/customer/address/delete.js +2 -3
- package/dist/runtime/server/api/customer/address/setshipping.js +1 -2
- package/dist/runtime/server/api/customer/address/update.js +1 -2
- package/dist/runtime/server/api/customer/cards/delete.js +2 -3
- package/dist/runtime/server/api/customer/cards/get.js +2 -3
- package/dist/runtime/server/api/customer/change-password.js +2 -3
- package/dist/runtime/server/api/customer/checkout.js +1 -2
- package/dist/runtime/server/api/customer/orders.js +2 -3
- package/dist/runtime/server/api/customer/profile/update.js +1 -2
- package/dist/runtime/server/api/customer/quotations.js +2 -3
- package/dist/runtime/server/api/customer/search.js +1 -2
- package/dist/runtime/server/api/customer/tax-invoice.js +1 -2
- package/dist/runtime/server/api/customer/wishlist/add.js +1 -2
- package/dist/runtime/server/api/customer/wishlist/createWishList.js +1 -2
- package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +1 -2
- package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +1 -2
- package/dist/runtime/server/api/customer/wishlist/get.js +2 -3
- package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +1 -2
- package/dist/runtime/server/api/customer/wishlist/updateWishList.js +2 -3
- package/dist/runtime/server/api/featured.d.ts +3 -0
- package/dist/runtime/server/api/featured.js +52 -0
- package/dist/runtime/server/api/generate/robots.get.d.ts +2 -0
- package/dist/runtime/server/api/generate/robots.get.js +20 -0
- package/dist/runtime/server/api/generate/sitemap.get.d.ts +2 -0
- package/dist/runtime/server/api/generate/sitemap.get.js +32 -0
- package/dist/runtime/server/api/location.d.ts +1 -1
- package/dist/runtime/server/api/location.js +24 -12
- package/dist/runtime/server/api/nav/[id]/links.d.ts +1 -0
- package/dist/runtime/server/api/nav/[id]/links.js +46 -10
- package/dist/runtime/server/api/page/[...slug].js +54 -0
- package/dist/runtime/server/api/product/[...slug].js +28 -13
- package/dist/runtime/server/api/quickview/[slug].d.ts +2 -0
- package/dist/runtime/server/api/quickview/[slug].js +21 -0
- package/dist/runtime/server/api/reviews.d.ts +2 -0
- package/dist/runtime/server/api/reviews.js +23 -0
- package/dist/runtime/server/api/samples.d.ts +3 -0
- package/dist/runtime/server/api/samples.js +53 -0
- package/dist/runtime/server/api/search.d.ts +3 -0
- package/dist/runtime/server/api/search.js +53 -0
- package/dist/runtime/server/api/service/[slug].js +22 -16
- package/dist/runtime/server/api/service/availability.d.ts +1 -1
- package/dist/runtime/server/api/service/availability.js +14 -12
- package/dist/runtime/server/api/service/getall.d.ts +3 -0
- package/dist/runtime/server/api/service/getall.js +57 -0
- package/dist/runtime/server/api/shop.d.ts +3 -0
- package/dist/runtime/server/api/shop.js +53 -0
- package/dist/runtime/server/api/subscribe.d.ts +1 -1
- package/dist/runtime/server/api/subscribe.js +23 -14
- package/dist/runtime/server/api/v2/[...slug].get.d.ts +2 -0
- package/dist/runtime/server/api/v2/[...slug].get.js +32 -0
- package/dist/runtime/server/api/webform.d.ts +3 -0
- package/dist/runtime/server/api/webform.js +54 -0
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/stores/Cart.d.ts +12 -0
- package/dist/runtime/stores/Cart.js +62 -17
- package/dist/runtime/stores/Checkout.d.ts +9 -15
- package/dist/runtime/stores/Checkout.js +24 -40
- package/dist/runtime/stores/Search.d.ts +1 -1
- package/dist/runtime/stores/Services.js +2 -2
- package/dist/runtime/stores/auth.d.ts +8 -11
- package/dist/runtime/stores/auth.js +385 -8
- package/dist/runtime/stores/countries.d.ts +1 -3
- package/dist/runtime/stores/countries.js +4 -8
- package/dist/runtime/stores/product/README.md +6 -6
- package/dist/runtime/stores/product/slug.d.ts +1 -17
- package/dist/runtime/stores/webforms.d.ts +24 -9
- package/dist/runtime/stores/webforms.js +105 -5
- package/dist/runtime/stores/wishlists.d.ts +114 -7
- package/dist/runtime/stores/wishlists.js +209 -15
- package/dist/runtime/utils/api.js +7 -13
- package/dist/runtime/utils/htmlCache.d.ts +2 -2
- package/dist/runtime/utils/htmlCache.js +23 -13
- package/dist/types.d.mts +6 -2
- package/package.json +15 -5
- package/dist/runtime/composables/Checkout/useBillingAddress.d.ts +0 -19
- package/dist/runtime/composables/Checkout/useBillingAddress.js +0 -82
- package/dist/runtime/composables/Checkout/useShippingAddress.d.ts +0 -9
- package/dist/runtime/composables/Checkout/useShippingAddress.js +0 -121
- package/dist/runtime/composables/useAuth.d.ts +0 -45
- package/dist/runtime/composables/useAuth.js +0 -180
- package/dist/runtime/composables/useCountries.d.ts +0 -12
- package/dist/runtime/composables/useCountries.js +0 -50
- package/dist/runtime/composables/useOrders.d.ts +0 -21
- package/dist/runtime/composables/useOrders.js +0 -82
- package/dist/runtime/composables/useQuotations.d.ts +0 -14
- package/dist/runtime/composables/useQuotations.js +0 -50
- package/dist/runtime/server/api/blog/[slug].js +0 -51
- package/dist/runtime/server/api/blog/blog.js +0 -17
- package/dist/runtime/server/api/brand/[slug].js +0 -58
- package/dist/runtime/server/api/page/[slug].js +0 -51
- package/dist/runtime/server/api/v2/[...slug].js +0 -9
- /package/dist/runtime/server/api/brand/{[slug].d.ts → [...slug].d.ts} +0 -0
- /package/dist/runtime/server/api/{blog/[slug].d.ts → cmspost/[...slug].d.ts} +0 -0
- /package/dist/runtime/server/api/page/{[slug].d.ts → [...slug].d.ts} +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare function useProfile(): {
|
|
2
|
+
profile: import("vue").Ref<{
|
|
3
|
+
firstName: string;
|
|
4
|
+
lastName: string;
|
|
5
|
+
email: string;
|
|
6
|
+
phone: string;
|
|
7
|
+
mobile: string;
|
|
8
|
+
dateOfBirth: string;
|
|
9
|
+
}, {
|
|
10
|
+
firstName: string;
|
|
11
|
+
lastName: string;
|
|
12
|
+
email: string;
|
|
13
|
+
phone: string;
|
|
14
|
+
mobile: string;
|
|
15
|
+
dateOfBirth: string;
|
|
16
|
+
} | {
|
|
17
|
+
firstName: string;
|
|
18
|
+
lastName: string;
|
|
19
|
+
email: string;
|
|
20
|
+
phone: string;
|
|
21
|
+
mobile: string;
|
|
22
|
+
dateOfBirth: string;
|
|
23
|
+
}>;
|
|
24
|
+
isEditing: import("vue").Ref<boolean, boolean>;
|
|
25
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
26
|
+
errorMessage: import("vue").Ref<string, string>;
|
|
27
|
+
successMessage: import("vue").Ref<string, string>;
|
|
28
|
+
dobFormatted: import("vue").WritableComputedRef<string, string>;
|
|
29
|
+
user: import("vue").ComputedRef<{
|
|
30
|
+
id: number;
|
|
31
|
+
fullname: string;
|
|
32
|
+
firstname: string;
|
|
33
|
+
lastname: string;
|
|
34
|
+
email: string;
|
|
35
|
+
avatar: string;
|
|
36
|
+
country_id: number | null;
|
|
37
|
+
country: {
|
|
38
|
+
id: number;
|
|
39
|
+
name: string;
|
|
40
|
+
emoji: string;
|
|
41
|
+
} | null;
|
|
42
|
+
state_id: number | null;
|
|
43
|
+
state: string | null;
|
|
44
|
+
suburb: string | null;
|
|
45
|
+
dob: string | null;
|
|
46
|
+
phone: string | null;
|
|
47
|
+
address: string | null;
|
|
48
|
+
mobile: string | null;
|
|
49
|
+
company: string | null;
|
|
50
|
+
addresses: {
|
|
51
|
+
id: number;
|
|
52
|
+
fullname: string | null;
|
|
53
|
+
firstname: string;
|
|
54
|
+
middlename: string | null;
|
|
55
|
+
lastname: string;
|
|
56
|
+
address: string;
|
|
57
|
+
suburb: string;
|
|
58
|
+
state: string | null;
|
|
59
|
+
state_id: number | null;
|
|
60
|
+
country: string;
|
|
61
|
+
country_id: number;
|
|
62
|
+
postcode: string;
|
|
63
|
+
mobile: string;
|
|
64
|
+
shipping: number;
|
|
65
|
+
billing: number;
|
|
66
|
+
}[];
|
|
67
|
+
created_at: string;
|
|
68
|
+
} | null>;
|
|
69
|
+
formatDisplayDate: (dateString: string) => string;
|
|
70
|
+
clearMessages: () => void;
|
|
71
|
+
cancelEdit: () => void;
|
|
72
|
+
updateCustomerProfile: () => Promise<void>;
|
|
73
|
+
initializeProfile: () => void;
|
|
74
|
+
resetProfile: () => void;
|
|
75
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ref, computed } from "vue";
|
|
2
|
+
import { useAuthStore } from "../../stores/auth.js";
|
|
3
|
+
export function useProfile() {
|
|
4
|
+
const authStore = useAuthStore();
|
|
5
|
+
const user = computed(() => authStore.user);
|
|
6
|
+
const profile = ref({
|
|
7
|
+
firstName: user.value?.firstname || "",
|
|
8
|
+
lastName: user.value?.lastname || "",
|
|
9
|
+
email: user.value?.email || "",
|
|
10
|
+
phone: user.value?.phone || "",
|
|
11
|
+
mobile: user.value?.mobile || "",
|
|
12
|
+
dateOfBirth: user.value?.dob || ""
|
|
13
|
+
});
|
|
14
|
+
const isEditing = ref(false);
|
|
15
|
+
const loading = ref(false);
|
|
16
|
+
const errorMessage = ref("");
|
|
17
|
+
const successMessage = ref("");
|
|
18
|
+
const formatDisplayDate = (dateString) => {
|
|
19
|
+
if (!dateString) return "";
|
|
20
|
+
const date = new Date(dateString);
|
|
21
|
+
if (isNaN(date.getTime())) return dateString;
|
|
22
|
+
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
23
|
+
const day = date.getDate();
|
|
24
|
+
const month = months[date.getMonth()];
|
|
25
|
+
const year = date.getFullYear();
|
|
26
|
+
return `${month} ${day}, ${year}`;
|
|
27
|
+
};
|
|
28
|
+
const dobFormatted = computed({
|
|
29
|
+
get() {
|
|
30
|
+
return profile.value.dateOfBirth ? new Date(profile.value.dateOfBirth).toISOString().split("T")[0] : "";
|
|
31
|
+
},
|
|
32
|
+
set(value) {
|
|
33
|
+
profile.value.dateOfBirth = value;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const clearMessages = () => {
|
|
37
|
+
errorMessage.value = "";
|
|
38
|
+
successMessage.value = "";
|
|
39
|
+
};
|
|
40
|
+
const resetProfile = () => {
|
|
41
|
+
profile.value = {
|
|
42
|
+
firstName: user.value?.firstname || "",
|
|
43
|
+
lastName: user.value?.lastname || "",
|
|
44
|
+
email: user.value?.email || "",
|
|
45
|
+
phone: user.value?.phone || "",
|
|
46
|
+
mobile: user.value?.mobile || "",
|
|
47
|
+
dateOfBirth: user.value?.dob || ""
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const cancelEdit = () => {
|
|
51
|
+
isEditing.value = false;
|
|
52
|
+
resetProfile();
|
|
53
|
+
clearMessages();
|
|
54
|
+
};
|
|
55
|
+
const updateCustomerProfile = async () => {
|
|
56
|
+
if (!profile.value.firstName?.trim() || !profile.value.lastName?.trim() || !profile.value.mobile?.trim()) {
|
|
57
|
+
errorMessage.value = "First name, Last name and Mobile are required!";
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
loading.value = true;
|
|
61
|
+
errorMessage.value = "";
|
|
62
|
+
successMessage.value = "";
|
|
63
|
+
try {
|
|
64
|
+
const requestBody = {
|
|
65
|
+
firstname: profile.value.firstName.trim(),
|
|
66
|
+
lastname: profile.value.lastName.trim(),
|
|
67
|
+
phone: profile.value.phone?.trim() || "",
|
|
68
|
+
mobile: profile.value.mobile?.trim() || "",
|
|
69
|
+
dob: profile.value.dateOfBirth || ""
|
|
70
|
+
};
|
|
71
|
+
const response = await authStore.updateProfile(requestBody);
|
|
72
|
+
if (response.status === "Success") {
|
|
73
|
+
successMessage.value = response.message || "Profile updated successfully!";
|
|
74
|
+
isEditing.value = false;
|
|
75
|
+
} else {
|
|
76
|
+
errorMessage.value = response.message || "Failed to update profile. Please try again.";
|
|
77
|
+
}
|
|
78
|
+
} catch (err) {
|
|
79
|
+
console.error("Update error:", err);
|
|
80
|
+
errorMessage.value = err.message || "Failed to update profile. Please try again.";
|
|
81
|
+
} finally {
|
|
82
|
+
loading.value = false;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const initializeProfile = () => {
|
|
86
|
+
resetProfile();
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
// State
|
|
90
|
+
profile,
|
|
91
|
+
isEditing,
|
|
92
|
+
loading,
|
|
93
|
+
errorMessage,
|
|
94
|
+
successMessage,
|
|
95
|
+
// Computed
|
|
96
|
+
dobFormatted,
|
|
97
|
+
user,
|
|
98
|
+
// Methods
|
|
99
|
+
formatDisplayDate,
|
|
100
|
+
clearMessages,
|
|
101
|
+
cancelEdit,
|
|
102
|
+
updateCustomerProfile,
|
|
103
|
+
initializeProfile,
|
|
104
|
+
resetProfile
|
|
105
|
+
};
|
|
106
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface Quotation {
|
|
2
|
+
quotation_no: string;
|
|
3
|
+
createddate: string;
|
|
4
|
+
quotestatus: string;
|
|
5
|
+
total: number;
|
|
6
|
+
expired?: boolean;
|
|
7
|
+
converted?: boolean;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export declare function useQuotations(): {
|
|
11
|
+
quotations: import("vue").Ref<{
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
quotation_no: string;
|
|
14
|
+
createddate: string;
|
|
15
|
+
quotestatus: string;
|
|
16
|
+
total: number;
|
|
17
|
+
expired?: boolean | undefined;
|
|
18
|
+
converted?: boolean | undefined;
|
|
19
|
+
}[], Quotation[] | {
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
quotation_no: string;
|
|
22
|
+
createddate: string;
|
|
23
|
+
quotestatus: string;
|
|
24
|
+
total: number;
|
|
25
|
+
expired?: boolean | undefined;
|
|
26
|
+
converted?: boolean | undefined;
|
|
27
|
+
}[]>;
|
|
28
|
+
pending: import("vue").Ref<boolean, boolean>;
|
|
29
|
+
loadQuotations: () => Promise<void>;
|
|
30
|
+
hasQuotations: () => boolean;
|
|
31
|
+
getQuotationStatus: (quotation: Quotation) => string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
import { useAuthStore } from "../../stores/auth.js";
|
|
3
|
+
export function useQuotations() {
|
|
4
|
+
const authStore = useAuthStore();
|
|
5
|
+
const quotations = ref([]);
|
|
6
|
+
const pending = ref(true);
|
|
7
|
+
const loadQuotations = async () => {
|
|
8
|
+
pending.value = true;
|
|
9
|
+
try {
|
|
10
|
+
const quotationsData = await authStore.fetchQuotations();
|
|
11
|
+
quotations.value = Array.isArray(quotationsData) ? quotationsData : [];
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.error("Failed to load quotations:", error);
|
|
14
|
+
quotations.value = [];
|
|
15
|
+
} finally {
|
|
16
|
+
pending.value = false;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const hasQuotations = () => {
|
|
20
|
+
return quotations.value && quotations.value.length > 0;
|
|
21
|
+
};
|
|
22
|
+
const getQuotationStatus = (quotation) => {
|
|
23
|
+
if (quotation.expired) {
|
|
24
|
+
return "Expired";
|
|
25
|
+
} else if (quotation.converted) {
|
|
26
|
+
return "Purchased";
|
|
27
|
+
} else {
|
|
28
|
+
return "Available";
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
// State
|
|
33
|
+
quotations,
|
|
34
|
+
pending,
|
|
35
|
+
// Methods
|
|
36
|
+
loadQuotations,
|
|
37
|
+
hasQuotations,
|
|
38
|
+
getQuotationStatus
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -1,18 +1,126 @@
|
|
|
1
|
-
export default function (): {
|
|
2
|
-
router:
|
|
3
|
-
route:
|
|
4
|
-
form_error: import("vue").Ref<string, string>;
|
|
1
|
+
export default function (countries: any): {
|
|
2
|
+
router: any;
|
|
3
|
+
route: any;
|
|
5
4
|
inputData: import("vue").Ref<{
|
|
6
|
-
|
|
5
|
+
abn: string;
|
|
6
|
+
addresses: never[];
|
|
7
|
+
address: string;
|
|
8
|
+
postCode: string;
|
|
9
|
+
suburb: string;
|
|
10
|
+
billing_address: string;
|
|
11
|
+
businessAddress: string;
|
|
12
|
+
billing_country: string;
|
|
13
|
+
billing_firstname: string;
|
|
14
|
+
billing_lastname: string;
|
|
15
|
+
billing_mobile: string;
|
|
16
|
+
billing_postcode: string;
|
|
17
|
+
billing_state: string;
|
|
18
|
+
billing_suburb: string;
|
|
19
|
+
company_name: string;
|
|
20
|
+
email: string;
|
|
21
|
+
email_confirmation: string;
|
|
22
|
+
firstname: string;
|
|
23
|
+
lastname: string;
|
|
24
|
+
mobile: string;
|
|
25
|
+
newsletterSignup: boolean;
|
|
26
|
+
password: string;
|
|
27
|
+
password_confirmation: string;
|
|
28
|
+
recaptcha: string;
|
|
29
|
+
shipping_address: string;
|
|
30
|
+
shipping_country: string;
|
|
31
|
+
shipping_postcode: string;
|
|
32
|
+
shipping_state: string;
|
|
33
|
+
shipping_suburb: string;
|
|
34
|
+
shipping_town: string;
|
|
35
|
+
shipping_mobile: string;
|
|
36
|
+
subscribe: boolean;
|
|
7
37
|
}, {
|
|
8
|
-
|
|
38
|
+
abn: string;
|
|
39
|
+
addresses: never[];
|
|
40
|
+
address: string;
|
|
41
|
+
postCode: string;
|
|
42
|
+
suburb: string;
|
|
43
|
+
billing_address: string;
|
|
44
|
+
businessAddress: string;
|
|
45
|
+
billing_country: string;
|
|
46
|
+
billing_firstname: string;
|
|
47
|
+
billing_lastname: string;
|
|
48
|
+
billing_mobile: string;
|
|
49
|
+
billing_postcode: string;
|
|
50
|
+
billing_state: string;
|
|
51
|
+
billing_suburb: string;
|
|
52
|
+
company_name: string;
|
|
53
|
+
email: string;
|
|
54
|
+
email_confirmation: string;
|
|
55
|
+
firstname: string;
|
|
56
|
+
lastname: string;
|
|
57
|
+
mobile: string;
|
|
58
|
+
newsletterSignup: boolean;
|
|
59
|
+
password: string;
|
|
60
|
+
password_confirmation: string;
|
|
61
|
+
recaptcha: string;
|
|
62
|
+
shipping_address: string;
|
|
63
|
+
shipping_country: string;
|
|
64
|
+
shipping_postcode: string;
|
|
65
|
+
shipping_state: string;
|
|
66
|
+
shipping_suburb: string;
|
|
67
|
+
shipping_town: string;
|
|
68
|
+
shipping_mobile: string;
|
|
69
|
+
subscribe: boolean;
|
|
9
70
|
} | {
|
|
10
|
-
|
|
71
|
+
abn: string;
|
|
72
|
+
addresses: never[];
|
|
73
|
+
address: string;
|
|
74
|
+
postCode: string;
|
|
75
|
+
suburb: string;
|
|
76
|
+
billing_address: string;
|
|
77
|
+
businessAddress: string;
|
|
78
|
+
billing_country: string;
|
|
79
|
+
billing_firstname: string;
|
|
80
|
+
billing_lastname: string;
|
|
81
|
+
billing_mobile: string;
|
|
82
|
+
billing_postcode: string;
|
|
83
|
+
billing_state: string;
|
|
84
|
+
billing_suburb: string;
|
|
85
|
+
company_name: string;
|
|
86
|
+
email: string;
|
|
87
|
+
email_confirmation: string;
|
|
88
|
+
firstname: string;
|
|
89
|
+
lastname: string;
|
|
90
|
+
mobile: string;
|
|
91
|
+
newsletterSignup: boolean;
|
|
92
|
+
password: string;
|
|
93
|
+
password_confirmation: string;
|
|
94
|
+
recaptcha: string;
|
|
95
|
+
shipping_address: string;
|
|
96
|
+
shipping_country: string;
|
|
97
|
+
shipping_postcode: string;
|
|
98
|
+
shipping_state: string;
|
|
99
|
+
shipping_suburb: string;
|
|
100
|
+
shipping_town: string;
|
|
101
|
+
shipping_mobile: string;
|
|
102
|
+
subscribe: boolean;
|
|
11
103
|
}>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
104
|
+
regResponse: import("vue").Ref<null, null>;
|
|
105
|
+
isBusinessAccount: import("vue").Ref<boolean, boolean>;
|
|
106
|
+
companyName: import("vue").Ref<string, string>;
|
|
107
|
+
abn: import("vue").Ref<string, string>;
|
|
108
|
+
address: import("vue").Ref<string, string>;
|
|
109
|
+
sameAsCustomerDetails: import("vue").Ref<boolean, boolean>;
|
|
110
|
+
showPassword: import("vue").Ref<boolean, boolean>;
|
|
111
|
+
showConfirmPassword: import("vue").Ref<boolean, boolean>;
|
|
112
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
113
|
+
getStates: (countryId: any) => any;
|
|
114
|
+
validateForm: () => true | "First Name is required" | "Last Name is required" | "Address is required" | "Country is required" | "State is required" | "Post Code is required" | "Suburb is required" | "Please enter a valid email address" | "Email addresses do not match" | "Password must be at least 6 characters" | "Passwords do not match" | "Mobile Number is required" | "Company Name is required" | "ABN is required" | "Business Address is required" | "Shipping Address is required" | "Shipping country is required." | "Shipping Town is required" | "Shipping State is required" | "Shipping Post Code is required" | "Shipping Mobile is required";
|
|
115
|
+
togglePassword: () => void;
|
|
116
|
+
toggleConfirmPassword: () => void;
|
|
117
|
+
handleSameAsCustomerDetails: () => void;
|
|
118
|
+
alertMessage: import("vue").Ref<string, string>;
|
|
119
|
+
alertType: import("vue").Ref<string, string>;
|
|
120
|
+
showAlert: import("vue").Ref<boolean, boolean>;
|
|
121
|
+
displayAlert: (message: any, type: any) => void;
|
|
122
|
+
dismissAlert: () => void;
|
|
123
|
+
handleSignup: () => Promise<void>;
|
|
124
|
+
initializeShippingData: () => void;
|
|
125
|
+
resetForm: () => void;
|
|
18
126
|
};
|