@autobusal/providers 1.0.61 → 1.1.0
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/Errors/Message.tsx +28 -17
- package/Errors/styles.ts +30 -3
- package/Notifications/Notifications.tsx +2 -2
- package/Queries/apiClient.ts +8 -3
- package/Setup/Preload.tsx +17 -14
- package/Setup/Setup.tsx +2 -2
- package/Setup/{utilities/analytics.ts → analytics.ts} +4 -2
- package/Styles/GlobalStyles.ts +1 -1
- package/Styles/Styles.tsx +1 -1
- package/index.ts +0 -2
- package/package.json +1 -1
- package/stores/menu.ts +1 -1
- package/types/account.ts +50 -0
- package/types/admins.ts +17 -0
- package/types/agents.ts +25 -0
- package/types/articles.ts +5 -0
- package/types/buses.ts +3 -0
- package/types/documents.ts +18 -0
- package/types/locations.ts +11 -0
- package/types/operators.ts +27 -0
- package/types/orders.ts +36 -0
- package/types/other.ts +37 -0
- package/types/pages.ts +18 -0
- package/types/pagination.ts +13 -0
- package/types/routes.ts +67 -0
- package/types/settings.ts +88 -0
- package/types/users.ts +91 -1
- package/types/visitors.ts +4 -0
- package/Styles/hooks/useSystemTheme.ts +0 -18
- /package/Setup/{utilities/languages.ts → languages.ts} +0 -0
package/Errors/Message.tsx
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { useNavigate } from 'react-router-dom';
|
|
2
|
-
import { RiAlarmWarningFill, RiFileWarningLine } from 'react-icons/ri';
|
|
3
2
|
import { Button } from '@autobusal/common';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useSystemTheme } from '@autobusal/hooks';
|
|
4
|
+
import { getLanguage } from '../Setup/languages';
|
|
6
5
|
import errors from '@lang/errors';
|
|
6
|
+
import { Background, Container, Logo, Description } from './styles';
|
|
7
|
+
import { GetSettings } from '../services';
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
9
10
|
type: 'error' | 'not_found'
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const Message = ({ type }: Props): JSX.Element => {
|
|
14
|
+
const { data } = GetSettings();
|
|
15
|
+
|
|
16
|
+
const theme = useSystemTheme();
|
|
17
|
+
|
|
13
18
|
const navigate = useNavigate();
|
|
14
19
|
|
|
15
20
|
const language = getLanguage('en');
|
|
@@ -17,20 +22,26 @@ const Message = ({ type }: Props): JSX.Element => {
|
|
|
17
22
|
const translations = errors[language as keyof typeof errors];
|
|
18
23
|
|
|
19
24
|
return (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
<>
|
|
26
|
+
<Background />
|
|
27
|
+
|
|
28
|
+
<Container className="box">
|
|
29
|
+
<Logo>
|
|
30
|
+
<img src={ `${ data.url }/logo-${ theme }.svg` } onClick={ () => navigate('/') } />
|
|
31
|
+
</Logo>
|
|
32
|
+
|
|
33
|
+
<Description>
|
|
34
|
+
{ type === 'not_found' ? translations.not_found : translations.system }
|
|
35
|
+
</Description>
|
|
36
|
+
|
|
37
|
+
<Button
|
|
38
|
+
type="button"
|
|
39
|
+
text={ translations.back }
|
|
40
|
+
noMargin
|
|
41
|
+
onClick={ () => navigate('/') }
|
|
42
|
+
/>
|
|
43
|
+
</Container>
|
|
44
|
+
</>
|
|
34
45
|
);
|
|
35
46
|
};
|
|
36
47
|
|
package/Errors/styles.ts
CHANGED
|
@@ -1,14 +1,41 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
+
export const Background = styled.div`
|
|
4
|
+
position: fixed;
|
|
5
|
+
top: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
z-index: 10000;
|
|
10
|
+
background: ${ props => props.theme.background.normal };
|
|
11
|
+
`;
|
|
12
|
+
|
|
3
13
|
export const Container = styled.div`
|
|
4
|
-
|
|
14
|
+
position: fixed;
|
|
15
|
+
top: 50%;
|
|
16
|
+
right: 50%;
|
|
17
|
+
z-index: 10001;
|
|
18
|
+
max-width: 400px;
|
|
5
19
|
display: flex;
|
|
6
20
|
flex-direction: column;
|
|
7
21
|
justify-content: center;
|
|
8
22
|
align-items: center;
|
|
9
|
-
|
|
23
|
+
transform: translate(50%, -50%);
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export const Logo = styled.div`
|
|
27
|
+
margin-bottom: 20px;
|
|
28
|
+
|
|
29
|
+
& > img {
|
|
30
|
+
display: block;
|
|
31
|
+
width: 250px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
10
34
|
`;
|
|
11
35
|
|
|
12
36
|
export const Description = styled.div`
|
|
13
|
-
margin-bottom:
|
|
37
|
+
margin-bottom: 20px;
|
|
38
|
+
font-weight: 700;
|
|
39
|
+
text-align: center;
|
|
40
|
+
font-size: ${ props => props.theme.size.xxl };
|
|
14
41
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Toaster } from 'react-hot-toast';
|
|
2
|
-
import useSystemTheme from '
|
|
2
|
+
import { useSystemTheme } from '@autobusal/hooks';
|
|
3
3
|
import { GetSettings } from '../services';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
@@ -11,7 +11,7 @@ export const Provider = ({ children }: Props): JSX.Element => {
|
|
|
11
11
|
|
|
12
12
|
const mode = useSystemTheme();
|
|
13
13
|
|
|
14
|
-
const ourTheme
|
|
14
|
+
const ourTheme = data.colors[mode as keyof typeof data.colors];
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
17
|
<>
|
package/Queries/apiClient.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import languages from '@lang/errors';
|
|
3
|
-
import { getLanguage } from '../Setup/
|
|
3
|
+
import { getLanguage } from '../Setup/languages';
|
|
4
4
|
import { error as systemError } from '@autobusal/utilities';
|
|
5
5
|
|
|
6
6
|
const apiClient = axios.create({
|
|
@@ -30,6 +30,11 @@ apiClient.interceptors.response.use(response => (
|
|
|
30
30
|
window.location.href = '/account/logout';
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
// if the user is not valid
|
|
34
|
+
if (error.response.status === 403) {
|
|
35
|
+
window.location.href = '/account/documents';
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
// if we have a 422 error, we display the message
|
|
34
39
|
if (error.response.status === 422) {
|
|
35
40
|
systemError(error.response.data.message);
|
|
@@ -42,9 +47,9 @@ apiClient.interceptors.response.use(response => (
|
|
|
42
47
|
systemError(languages[language as keyof typeof languages].server);
|
|
43
48
|
}
|
|
44
49
|
} else if (error.request) {
|
|
45
|
-
|
|
50
|
+
console.log('REQUEST IS NOT DEFINED');
|
|
46
51
|
} else {
|
|
47
|
-
|
|
52
|
+
console.error('RESPONSE IS NOT DEFINED!');
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
return Promise.reject(error);
|
package/Setup/Preload.tsx
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
import { Helmet } from 'react-helmet';
|
|
2
|
-
import { SettingsData } from '../types';
|
|
2
|
+
import { SettingsData } from '../types/settings';
|
|
3
|
+
import { useSystemTheme } from '@autobusal/hooks';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
5
6
|
data: SettingsData
|
|
6
7
|
children: JSX.Element
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
// @todo: De adaugat din tema Favicons
|
|
10
10
|
const Preload = ({ data, children }: Props): JSX.Element => {
|
|
11
11
|
// we arrange the font family names before inserting them
|
|
12
|
-
const fontTitle = data.theme.fontFamily.title.replace(
|
|
13
|
-
const fontContent = data.theme.fontFamily.content.replace(
|
|
12
|
+
const fontTitle = data.theme.fontFamily.title.replace(/ /g, '+');
|
|
13
|
+
const fontContent = data.theme.fontFamily.content.replace(/ /g, '+');
|
|
14
|
+
|
|
15
|
+
const theme = useSystemTheme();
|
|
16
|
+
|
|
17
|
+
const primaryColor = data.colors[theme].primary.normal;
|
|
14
18
|
|
|
15
19
|
return (
|
|
16
20
|
<>
|
|
17
21
|
<Helmet>
|
|
18
22
|
<title>{ data.preferences.company }</title>
|
|
19
23
|
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{/* <meta name="theme-color" content="#ffffff" /> */}
|
|
24
|
+
<link rel="apple-touch-icon" sizes="180x180" href={ `${ data.url }/favicons/apple-touch-icon.png` } />
|
|
25
|
+
<link rel="icon" type="image/png" sizes="32x32" href={ `${ data.url }/favicons/favicon-32x32.png` } />
|
|
26
|
+
<link rel="icon" type="image/png" sizes="16x16" href={ `${ data.url }/favicons/favicon-16x16.png` } />
|
|
27
|
+
<link rel="manifest" href={ `${ data.url }/favicons/site.webmanifest` } />
|
|
28
|
+
<link rel="mask-icon" href={ `${ data.url }/favicons/safari-pinned-tab.svg` } color={ primaryColor } />
|
|
29
|
+
<link rel="shortcut icon" href={ `${ data.url }/favicons/favicon.ico` } />
|
|
30
|
+
<meta name="msapplication-TileColor" content={ primaryColor } />
|
|
31
|
+
<meta name="msapplication-config" content={ `${ data.url }/favicons/browserconfig.xml` } />
|
|
32
|
+
<meta name="theme-color" content={ primaryColor } />
|
|
30
33
|
|
|
31
34
|
<link href={ `https://fonts.googleapis.com/css2?family=${ fontTitle }:wght@700&family=${ fontContent }:wght@300;400;700&display=swap` } rel="stylesheet" />
|
|
32
35
|
</Helmet>
|
package/Setup/Setup.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Preload from './Preload';
|
|
2
|
-
import languages from './
|
|
3
|
-
import analytics from './
|
|
2
|
+
import languages from './languages';
|
|
3
|
+
import analytics from './analytics';
|
|
4
4
|
import { GetSettings, GetMenu } from '../services';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
package/Styles/GlobalStyles.ts
CHANGED
|
@@ -18,7 +18,7 @@ const GlobalStyles = createGlobalStyle`
|
|
|
18
18
|
height: 100%;
|
|
19
19
|
margin: 0;
|
|
20
20
|
padding: 0;
|
|
21
|
-
font-family: '${props => props.theme.fontFamily.content}', sans-serif;
|
|
21
|
+
font-family: '${ props => props.theme.fontFamily.content }', sans-serif;
|
|
22
22
|
color: ${ props => props.theme.font.normal };
|
|
23
23
|
font-size: ${ props => props.theme.size.m };
|
|
24
24
|
line-height: ${ props => props.theme.lineHeight.content };
|
package/Styles/Styles.tsx
CHANGED
package/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Providers from './Providers';
|
|
2
2
|
import apiClient from './Queries/apiClient';
|
|
3
|
-
import useSystemTheme from './Styles/hooks/useSystemTheme';
|
|
4
3
|
import ErrorBoundary from './Errors/ErrorBoundary';
|
|
5
4
|
import Message from './Errors/Message';
|
|
6
5
|
import useMenuStore from './stores/menu';
|
|
@@ -11,7 +10,6 @@ export {
|
|
|
11
10
|
ErrorBoundary,
|
|
12
11
|
Message,
|
|
13
12
|
useMenuStore,
|
|
14
|
-
useSystemTheme,
|
|
15
13
|
useUserStore
|
|
16
14
|
};
|
|
17
15
|
|
package/package.json
CHANGED
package/stores/menu.ts
CHANGED
package/types/account.ts
CHANGED
|
@@ -4,14 +4,64 @@ import { OperatorData } from './operators';
|
|
|
4
4
|
export interface TransactionData {
|
|
5
5
|
id: number
|
|
6
6
|
public_display: string[]
|
|
7
|
+
private?: string
|
|
7
8
|
from?: OperatorData | AgentData
|
|
8
9
|
to?: OperatorData | AgentData
|
|
9
10
|
amount_display: string
|
|
11
|
+
type: string
|
|
10
12
|
paid_date: string
|
|
13
|
+
status: string
|
|
14
|
+
comment?: string
|
|
15
|
+
updated_at: string
|
|
11
16
|
}
|
|
12
17
|
|
|
13
18
|
export interface NotificationData {
|
|
14
19
|
id: number
|
|
15
20
|
title: string
|
|
21
|
+
title_en?: string
|
|
22
|
+
title_sq?: string
|
|
16
23
|
content: string
|
|
24
|
+
content_en?: string
|
|
25
|
+
content_sq?: string
|
|
26
|
+
name: string
|
|
27
|
+
group: string
|
|
28
|
+
status: number
|
|
29
|
+
from?: string
|
|
30
|
+
to?: string
|
|
31
|
+
created_at?: string
|
|
32
|
+
updated_at?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface SubscriptionData {
|
|
36
|
+
id: number
|
|
37
|
+
name: string
|
|
38
|
+
name_en?: string
|
|
39
|
+
name_sq?: string
|
|
40
|
+
price_display: string
|
|
41
|
+
price?: number
|
|
42
|
+
days: number
|
|
43
|
+
type: string
|
|
44
|
+
description: string
|
|
45
|
+
description_en?: string
|
|
46
|
+
description_sq?: string
|
|
47
|
+
priority: number
|
|
48
|
+
banner: number
|
|
49
|
+
column: number
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface EmailsData {
|
|
53
|
+
email: string
|
|
54
|
+
settings: {
|
|
55
|
+
funds: number
|
|
56
|
+
subscriptions: number
|
|
57
|
+
news: number
|
|
58
|
+
transactions: number
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface SubscribedData {
|
|
63
|
+
subscription: SubscriptionData
|
|
64
|
+
next_billing: string
|
|
65
|
+
cancelled: number
|
|
66
|
+
created_at: string
|
|
17
67
|
}
|
package/types/admins.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UserData } from './users';
|
|
2
|
+
|
|
3
|
+
export interface AdminData {
|
|
4
|
+
id: number
|
|
5
|
+
name: string
|
|
6
|
+
first_name: string
|
|
7
|
+
last_name: string
|
|
8
|
+
user: UserData
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface FinancerData {
|
|
12
|
+
id: number
|
|
13
|
+
name: string
|
|
14
|
+
first_name: string
|
|
15
|
+
last_name: string
|
|
16
|
+
user: UserData
|
|
17
|
+
}
|
package/types/agents.ts
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
|
+
import { UserData } from './users';
|
|
2
|
+
|
|
1
3
|
export interface AgentData {
|
|
2
4
|
id: number
|
|
3
5
|
company: string
|
|
6
|
+
nipt: string
|
|
4
7
|
name: string
|
|
8
|
+
first_name: string
|
|
9
|
+
last_name: string
|
|
10
|
+
address: string
|
|
11
|
+
city: string
|
|
5
12
|
link: string
|
|
6
13
|
logo_url: string
|
|
7
14
|
description: string
|
|
8
15
|
banner?: number
|
|
9
16
|
column?: number
|
|
17
|
+
user: UserData
|
|
18
|
+
funds_display: string
|
|
19
|
+
mobile: string
|
|
20
|
+
mobile2: string
|
|
21
|
+
phone: string
|
|
22
|
+
fax: string
|
|
23
|
+
website: string
|
|
24
|
+
license: string
|
|
25
|
+
operators: number[]
|
|
26
|
+
logo?: string[]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface SubagentData {
|
|
30
|
+
id: number
|
|
31
|
+
name: string
|
|
32
|
+
first_name: string
|
|
33
|
+
last_name: string
|
|
34
|
+
user: UserData
|
|
10
35
|
}
|
package/types/articles.ts
CHANGED
|
@@ -6,6 +6,9 @@ export interface ArticleData {
|
|
|
6
6
|
internal: string
|
|
7
7
|
image_url: string | null
|
|
8
8
|
category: CategoryData
|
|
9
|
+
language: string
|
|
10
|
+
description: string
|
|
11
|
+
image?: string[]
|
|
9
12
|
keywords: string
|
|
10
13
|
created_at: string
|
|
11
14
|
}
|
|
@@ -13,4 +16,6 @@ export interface ArticleData {
|
|
|
13
16
|
export interface CategoryData {
|
|
14
17
|
id: number
|
|
15
18
|
name: string
|
|
19
|
+
name_en?: string
|
|
20
|
+
name_sq?: string
|
|
16
21
|
}
|
package/types/buses.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface GroupData {
|
|
2
|
+
id: number
|
|
3
|
+
name: string
|
|
4
|
+
name_en?: string
|
|
5
|
+
name_sq?: string
|
|
6
|
+
type: 'all' | 'operators' | 'agents'
|
|
7
|
+
allowed: string[] | string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface DocumentData {
|
|
11
|
+
id: number
|
|
12
|
+
name: string
|
|
13
|
+
name_en?: string
|
|
14
|
+
name_sq?: string
|
|
15
|
+
content: string
|
|
16
|
+
content_en?: string
|
|
17
|
+
content_sq?: string
|
|
18
|
+
}
|
package/types/locations.ts
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
export interface LocationData {
|
|
2
2
|
id: number
|
|
3
|
+
tomorrow: number
|
|
3
4
|
departure: string
|
|
4
5
|
arrival: string
|
|
5
6
|
city: CityData
|
|
6
7
|
stop?: StopData
|
|
8
|
+
order_id: number
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export interface CountryData {
|
|
10
12
|
id: number
|
|
11
13
|
name: string
|
|
14
|
+
name_en?: string
|
|
15
|
+
name_sq?: string
|
|
12
16
|
slug?: string
|
|
13
17
|
cities?: CityData[]
|
|
14
18
|
iso_code: string
|
|
19
|
+
available?: number
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export interface CityData {
|
|
18
23
|
id: number
|
|
19
24
|
name: string
|
|
25
|
+
name_en?: string
|
|
26
|
+
name_sq?: string
|
|
20
27
|
location: string[]
|
|
21
28
|
slug: string
|
|
22
29
|
douane?: number
|
|
@@ -24,6 +31,10 @@ export interface CityData {
|
|
|
24
31
|
link?: string
|
|
25
32
|
image_url?: string
|
|
26
33
|
booking_id?: string
|
|
34
|
+
stops?: StopData[]
|
|
35
|
+
front?: number
|
|
36
|
+
front_order?: number
|
|
37
|
+
image?: string[]
|
|
27
38
|
}
|
|
28
39
|
|
|
29
40
|
export interface StopData {
|
package/types/operators.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { RouteData } from './routes';
|
|
2
|
+
import { UserData } from './users';
|
|
2
3
|
|
|
3
4
|
export interface OperatorData {
|
|
4
5
|
id: number
|
|
5
6
|
company: string
|
|
7
|
+
nipt: string
|
|
6
8
|
name: string
|
|
7
9
|
code: string
|
|
10
|
+
address: string
|
|
11
|
+
city: string
|
|
8
12
|
link: string
|
|
9
13
|
logo_url: string
|
|
10
14
|
description: string
|
|
@@ -13,16 +17,39 @@ export interface OperatorData {
|
|
|
13
17
|
first_name?: string
|
|
14
18
|
last_name?: string
|
|
15
19
|
website?: string
|
|
20
|
+
license: string
|
|
16
21
|
full_address?: string
|
|
17
22
|
email?: string
|
|
18
23
|
phone?: string
|
|
19
24
|
mobile?: string
|
|
20
25
|
mobile2?: string
|
|
26
|
+
fax: string
|
|
21
27
|
gallery?: GalleryData[]
|
|
22
28
|
routes?: RouteData[]
|
|
29
|
+
user: UserData
|
|
30
|
+
funds_display: string
|
|
31
|
+
logo?: string[]
|
|
23
32
|
}
|
|
24
33
|
|
|
25
34
|
export interface GalleryData {
|
|
26
35
|
id: number
|
|
27
36
|
image_url: string
|
|
37
|
+
images?: string[]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface EmployeeData {
|
|
41
|
+
id: number
|
|
42
|
+
name: string
|
|
43
|
+
first_name: string
|
|
44
|
+
last_name: string
|
|
45
|
+
user: UserData
|
|
46
|
+
can_print: number
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface DriverData {
|
|
50
|
+
id: number
|
|
51
|
+
name: string
|
|
52
|
+
first_name: string
|
|
53
|
+
last_name: string
|
|
54
|
+
user: UserData
|
|
28
55
|
}
|
package/types/orders.ts
CHANGED
|
@@ -3,21 +3,45 @@ import { PriceData, RouteData } from './routes';
|
|
|
3
3
|
import { UserData } from './users';
|
|
4
4
|
|
|
5
5
|
export interface CouponData {
|
|
6
|
+
id: number
|
|
7
|
+
title: string
|
|
6
8
|
code: string
|
|
7
9
|
discount: string
|
|
10
|
+
used?: boolean
|
|
8
11
|
total: string
|
|
12
|
+
from: string
|
|
13
|
+
to: string
|
|
14
|
+
quantity: number
|
|
15
|
+
operator_edit: string
|
|
16
|
+
obt_edit: string
|
|
17
|
+
status: number
|
|
18
|
+
availability: string[] | string
|
|
19
|
+
routes: number[] | string
|
|
20
|
+
created_at: string
|
|
21
|
+
updated_at: string
|
|
9
22
|
}
|
|
10
23
|
|
|
11
24
|
export interface OrderData {
|
|
25
|
+
id: number
|
|
12
26
|
hash: string
|
|
13
27
|
date_travel: string
|
|
14
28
|
price: PriceData
|
|
15
29
|
route: RouteData
|
|
30
|
+
type: string
|
|
31
|
+
status: number
|
|
16
32
|
contact?: ContactData
|
|
17
33
|
passengers: TicketData[]
|
|
34
|
+
tickets: number
|
|
18
35
|
amount_display: string
|
|
19
36
|
note_cancel: string
|
|
20
37
|
actions: string[]
|
|
38
|
+
created_at: string
|
|
39
|
+
comission_affiliate_display: string
|
|
40
|
+
name_display?: string
|
|
41
|
+
occupied: string
|
|
42
|
+
reference?: OrderData
|
|
43
|
+
updated_at: string
|
|
44
|
+
account?: any
|
|
21
45
|
}
|
|
22
46
|
|
|
23
47
|
export interface ContactData {
|
|
@@ -37,6 +61,7 @@ export interface ContactData {
|
|
|
37
61
|
export interface TicketData {
|
|
38
62
|
id: number
|
|
39
63
|
type: string
|
|
64
|
+
name: string
|
|
40
65
|
first_name: string
|
|
41
66
|
last_name: string
|
|
42
67
|
dob: string
|
|
@@ -44,7 +69,9 @@ export interface TicketData {
|
|
|
44
69
|
passport: string
|
|
45
70
|
phone: string
|
|
46
71
|
bus_seat?: number
|
|
72
|
+
checkedin?: 'yes' | 'no'
|
|
47
73
|
changes?: ChangeData[]
|
|
74
|
+
qr?: string
|
|
48
75
|
}
|
|
49
76
|
|
|
50
77
|
export interface ChangeData {
|
|
@@ -52,4 +79,13 @@ export interface ChangeData {
|
|
|
52
79
|
user: UserData
|
|
53
80
|
changes: string
|
|
54
81
|
updated_at: string
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface InvoiceData {
|
|
85
|
+
id: number
|
|
86
|
+
from: string
|
|
87
|
+
to: string
|
|
88
|
+
amount: string
|
|
89
|
+
status: number
|
|
90
|
+
created_at: string
|
|
55
91
|
}
|
package/types/other.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { UserData } from './users';
|
|
2
|
+
|
|
3
|
+
export interface TableParamsData {
|
|
4
|
+
page?: number
|
|
5
|
+
sort?: number
|
|
6
|
+
order?: string
|
|
7
|
+
q?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface DropdownData {
|
|
11
|
+
id: number | string
|
|
12
|
+
name: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ReportingData {
|
|
16
|
+
id: number
|
|
17
|
+
user: UserData
|
|
18
|
+
type: string
|
|
19
|
+
about: string
|
|
20
|
+
created_at: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface EmailData {
|
|
24
|
+
id: number
|
|
25
|
+
user_email: string
|
|
26
|
+
user?: UserData
|
|
27
|
+
type: string
|
|
28
|
+
hash: string
|
|
29
|
+
created_at: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface NewsletterSendData {
|
|
33
|
+
group: string
|
|
34
|
+
language: string
|
|
35
|
+
subject: string
|
|
36
|
+
content: string
|
|
37
|
+
}
|
package/types/pages.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface PageData {
|
|
2
|
+
id: number
|
|
3
|
+
name: string
|
|
4
|
+
name_en?: string
|
|
5
|
+
name_sq?: string
|
|
6
|
+
internal: string
|
|
7
|
+
title_en: string
|
|
8
|
+
title_sq: string
|
|
9
|
+
content_en: string
|
|
10
|
+
content_sq: string
|
|
11
|
+
content: string
|
|
12
|
+
keywords_en: string
|
|
13
|
+
keywords_sq: string
|
|
14
|
+
keywords: string
|
|
15
|
+
description_en: string
|
|
16
|
+
description_sq: string
|
|
17
|
+
description: string
|
|
18
|
+
}
|
package/types/routes.ts
CHANGED
|
@@ -1,22 +1,47 @@
|
|
|
1
|
+
import { AgentData } from './agents';
|
|
2
|
+
import { BusData } from './buses';
|
|
1
3
|
import { LocationData, CountryData } from './locations';
|
|
2
4
|
import { OperatorData } from './operators';
|
|
5
|
+
import { OrderData } from './orders';
|
|
3
6
|
|
|
4
7
|
export interface RouteData {
|
|
5
8
|
id: number
|
|
6
9
|
name: string
|
|
7
10
|
code: string
|
|
11
|
+
type: string
|
|
8
12
|
operator: OperatorData
|
|
9
13
|
locations: LocationData[]
|
|
10
14
|
available: AvailableData
|
|
15
|
+
unavailable: UnavailableData[]
|
|
11
16
|
transiting: TransitingData[]
|
|
17
|
+
comissions: ComissionData
|
|
18
|
+
prices: PriceData[]
|
|
19
|
+
alternates: AlternateData[]
|
|
20
|
+
drivers: DriversData
|
|
21
|
+
orders: OrderData[]
|
|
22
|
+
features?: number[]
|
|
12
23
|
trip: TripData
|
|
13
24
|
link: string
|
|
14
25
|
link_purchase: string
|
|
26
|
+
language: string
|
|
27
|
+
template: string
|
|
28
|
+
searchable: number
|
|
29
|
+
policies_en: string
|
|
30
|
+
policies_sq: string
|
|
15
31
|
}
|
|
16
32
|
|
|
17
33
|
export interface AvailableData {
|
|
18
34
|
id: number
|
|
19
35
|
schedule_display: string
|
|
36
|
+
schedule: number[]
|
|
37
|
+
start_date: string
|
|
38
|
+
end_date: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface UnavailableData {
|
|
42
|
+
id: number
|
|
43
|
+
start_inactive: string
|
|
44
|
+
end_inactive: string
|
|
20
45
|
}
|
|
21
46
|
|
|
22
47
|
export interface TransitingData {
|
|
@@ -26,13 +51,25 @@ export interface TransitingData {
|
|
|
26
51
|
|
|
27
52
|
export interface TripData {
|
|
28
53
|
id: number
|
|
54
|
+
bus?: BusData
|
|
55
|
+
bags_weight_display: string
|
|
56
|
+
bags_weight: string
|
|
57
|
+
bags_no_display: string
|
|
58
|
+
bags_no: string
|
|
29
59
|
features_data: FeatureData[]
|
|
60
|
+
features: number[]
|
|
61
|
+
available_seats: number
|
|
62
|
+
blocked_seats: number
|
|
63
|
+
seating: string
|
|
30
64
|
}
|
|
31
65
|
|
|
32
66
|
export interface FeatureData {
|
|
33
67
|
id: number
|
|
34
68
|
name: string
|
|
69
|
+
name_en?: string
|
|
70
|
+
name_sq?: string
|
|
35
71
|
image_url: string
|
|
72
|
+
image?: string[]
|
|
36
73
|
}
|
|
37
74
|
|
|
38
75
|
export interface PolicyData {
|
|
@@ -57,4 +94,34 @@ export interface PriceData {
|
|
|
57
94
|
value: number
|
|
58
95
|
from: LocationData
|
|
59
96
|
to: LocationData
|
|
97
|
+
adult: number
|
|
98
|
+
adult_display: string
|
|
99
|
+
child: number
|
|
100
|
+
child_display: string
|
|
101
|
+
baby: number
|
|
102
|
+
baby_display: string
|
|
103
|
+
adult_return: number
|
|
104
|
+
child_return: number
|
|
105
|
+
baby_return: number
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface AlternateData extends PriceData {
|
|
109
|
+
name: string
|
|
110
|
+
date_from: string
|
|
111
|
+
date_to: string
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface ComissionData {
|
|
115
|
+
id: number
|
|
116
|
+
agent?: AgentData
|
|
117
|
+
departure_operator_edit: string
|
|
118
|
+
departure_agent_edit: string
|
|
119
|
+
return_operator_edit: string
|
|
120
|
+
return_agent_edit: string
|
|
121
|
+
departure_self_edit: string
|
|
122
|
+
return_self_edit: string
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface DriversData {
|
|
126
|
+
registered: string[]
|
|
60
127
|
}
|
package/types/settings.ts
CHANGED
|
@@ -42,8 +42,96 @@ export interface SettingsData {
|
|
|
42
42
|
export interface MenuData {
|
|
43
43
|
id: number
|
|
44
44
|
name: string
|
|
45
|
+
name_en?: string
|
|
46
|
+
name_sq?: string
|
|
45
47
|
link: string
|
|
46
48
|
new: 'yes' | 'no'
|
|
47
49
|
children: MenuData[]
|
|
48
50
|
location: 'any' | 'left' | 'right'
|
|
51
|
+
parent_id: number | null
|
|
52
|
+
menu?: MenuData
|
|
53
|
+
order_id: number
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface LabelData {
|
|
57
|
+
type?: string
|
|
58
|
+
|
|
59
|
+
email: string
|
|
60
|
+
phone: string
|
|
61
|
+
currency: string
|
|
62
|
+
affiliate_max_tickets: number
|
|
63
|
+
|
|
64
|
+
legal: {
|
|
65
|
+
kop: string
|
|
66
|
+
njb: string
|
|
67
|
+
city: string
|
|
68
|
+
nipt: string
|
|
69
|
+
nivf: string
|
|
70
|
+
nslf: string
|
|
71
|
+
address: string
|
|
72
|
+
company: string
|
|
73
|
+
invoice_code: string
|
|
74
|
+
customer_service: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
payments: {
|
|
78
|
+
reserve: boolean
|
|
79
|
+
funds: boolean
|
|
80
|
+
bkt: boolean
|
|
81
|
+
paypal: boolean
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
smtp: {
|
|
85
|
+
server: string
|
|
86
|
+
port: number
|
|
87
|
+
security: string
|
|
88
|
+
username: string
|
|
89
|
+
password: string
|
|
90
|
+
email: string
|
|
91
|
+
name: string
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
comissions: {
|
|
95
|
+
label: {
|
|
96
|
+
agent: number
|
|
97
|
+
operator: number
|
|
98
|
+
}
|
|
99
|
+
general: {
|
|
100
|
+
agent: number
|
|
101
|
+
operator: number
|
|
102
|
+
}
|
|
103
|
+
visitor: {
|
|
104
|
+
agent: number
|
|
105
|
+
operator: number
|
|
106
|
+
}
|
|
107
|
+
reservation: number
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
bkt_settings: {
|
|
111
|
+
url: string
|
|
112
|
+
authid: string
|
|
113
|
+
domain: string
|
|
114
|
+
storeKey: string
|
|
115
|
+
currencyId: string
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
devpos_settings: {
|
|
119
|
+
vat: number
|
|
120
|
+
barcode: string
|
|
121
|
+
authorization: string
|
|
122
|
+
exchange_rate: number
|
|
123
|
+
cash_register_index: string
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
social: {
|
|
127
|
+
google: {
|
|
128
|
+
client_id: string
|
|
129
|
+
client_secret: string
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
facebook: {
|
|
133
|
+
client_id: string
|
|
134
|
+
client_secret: string
|
|
135
|
+
}
|
|
136
|
+
}
|
|
49
137
|
}
|
package/types/users.ts
CHANGED
|
@@ -1,9 +1,99 @@
|
|
|
1
|
+
import { SubscriptionData } from './account';
|
|
2
|
+
import { AdminData, FinancerData } from './admins';
|
|
3
|
+
import { AgentData, SubagentData } from './agents';
|
|
4
|
+
import { DocumentData } from './documents';
|
|
5
|
+
import { DriverData, EmployeeData, OperatorData } from './operators';
|
|
6
|
+
import { VisitorData } from './visitors';
|
|
7
|
+
|
|
1
8
|
export interface UserData {
|
|
2
9
|
id: number
|
|
3
10
|
name: string
|
|
4
|
-
|
|
11
|
+
name_display?: string
|
|
12
|
+
email: string
|
|
13
|
+
type: 'admin' | 'financer' | 'operator' | 'employee' | 'driver' | 'agent' | 'subagent' | 'visitor'
|
|
5
14
|
verified: Date
|
|
6
15
|
status: number
|
|
7
16
|
funds: string
|
|
8
17
|
documents: boolean
|
|
18
|
+
comissions: ComissionData
|
|
19
|
+
subscription: SubscribedData
|
|
20
|
+
api: ApiData
|
|
21
|
+
created_at: string
|
|
22
|
+
admin?: AdminData
|
|
23
|
+
financer?: FinancerData
|
|
24
|
+
operator?: OperatorData
|
|
25
|
+
employee?: EmployeeData
|
|
26
|
+
driver?: DriverData
|
|
27
|
+
agent?: AgentData
|
|
28
|
+
subagent?: SubagentData
|
|
29
|
+
visitor?: VisitorData
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface LogData {
|
|
33
|
+
id: number
|
|
34
|
+
ip: string
|
|
35
|
+
user?: UserData
|
|
36
|
+
no?: number
|
|
37
|
+
created_at: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ComissionData {
|
|
41
|
+
unique: number
|
|
42
|
+
external: number
|
|
43
|
+
departure_edit: string
|
|
44
|
+
departure_self_edit: string
|
|
45
|
+
return_edit: string
|
|
46
|
+
return_self_edit: string
|
|
47
|
+
affiliate_edit: string
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ApiData {
|
|
51
|
+
api: number
|
|
52
|
+
bkt: number
|
|
53
|
+
devpos: number
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SubscribedData {
|
|
57
|
+
subscription: SubscriptionData
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ApiDetailsData {
|
|
61
|
+
business_code?: string
|
|
62
|
+
operator_code?: string
|
|
63
|
+
nuis?: string
|
|
64
|
+
fiscalization_number?: string
|
|
65
|
+
username?: string
|
|
66
|
+
password?: string
|
|
67
|
+
bank_name?: string
|
|
68
|
+
bank_swift?: string
|
|
69
|
+
bank_account?: string
|
|
70
|
+
bank_address?: string
|
|
71
|
+
bank_city?: string
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface ChangeData {
|
|
75
|
+
id: number
|
|
76
|
+
type: string
|
|
77
|
+
value: string
|
|
78
|
+
created_at: string
|
|
79
|
+
user: UserData
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface AffiliateData extends UserData {
|
|
83
|
+
affiliate?: string
|
|
84
|
+
made: string
|
|
85
|
+
sold: number
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface AffiliateRequestData {
|
|
89
|
+
affiliate: boolean
|
|
90
|
+
affiliate_request: number
|
|
91
|
+
link: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface DocumentsData {
|
|
95
|
+
id: number
|
|
96
|
+
document: DocumentData
|
|
97
|
+
signed: 'yes' | 'no'
|
|
98
|
+
data: any[]
|
|
9
99
|
}
|
package/types/visitors.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { UserData } from './users';
|
|
2
|
+
|
|
1
3
|
export interface VisitorData {
|
|
2
4
|
id: number
|
|
5
|
+
name: string
|
|
3
6
|
first_name: string
|
|
4
7
|
last_name: string
|
|
5
8
|
sex: number
|
|
@@ -11,4 +14,5 @@ export interface VisitorData {
|
|
|
11
14
|
country_id: number
|
|
12
15
|
company: string
|
|
13
16
|
nipt: string
|
|
17
|
+
user: UserData
|
|
14
18
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
const useSystemTheme = (): ('light' | 'dark') => {
|
|
4
|
-
const queryDarkMode = window.matchMedia("(prefers-color-scheme: dark)");
|
|
5
|
-
|
|
6
|
-
const [ theme, setTheme ] = useState<'light' | 'dark'>(queryDarkMode.matches ? 'dark' : 'light');
|
|
7
|
-
|
|
8
|
-
// setup a listener to respond to future changes of the system theme
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
queryDarkMode.addEventListener('change', (event: MediaQueryListEvent) => {
|
|
11
|
-
setTheme(event.matches ? 'dark' : 'light');
|
|
12
|
-
})
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
return theme;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default useSystemTheme;
|
|
File without changes
|