Compare commits
192 Commits
models_rem
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
e6fc99839f | 1 day ago |
|
|
9bdb105212 | 2 weeks ago |
|
|
9c4df54156 | 3 weeks ago |
|
|
a4f86f21e7 | 5 months ago |
|
|
967306f75d | 1 year ago |
|
|
da9c03a30f | 1 year ago |
|
|
6bea3daf78 | 1 year ago |
|
|
3a3868ed7f | 1 year ago |
|
|
113f158079 | 1 year ago |
|
|
59875f5198 | 1 year ago |
|
|
021618fa6b | 1 year ago |
|
|
75c46e5194 | 1 year ago |
|
|
f9a95579dc | 1 year ago |
|
|
85b0965e04 | 1 year ago |
|
|
2215bbd63b | 1 year ago |
|
|
f8514aaf7b | 1 year ago |
|
|
054944e28a | 1 year ago |
|
|
656dbfd5ac | 1 year ago |
|
|
7a93004fba | 1 year ago |
|
|
4b350dbeb6 | 1 year ago |
|
|
0ada291516 | 1 year ago |
|
|
f7356592a0 | 1 year ago |
|
|
272cf1e104 | 1 year ago |
|
|
03ccb1a60c | 1 year ago |
|
|
2ae5effe65 | 1 year ago |
|
|
fd684e9649 | 1 year ago |
|
|
8f8f19b35e | 1 year ago |
|
|
2eb1f22a24 | 1 year ago |
|
|
693083df6f | 1 year ago |
|
|
b8e0304a94 | 1 year ago |
|
|
9efb174e0c | 1 year ago |
|
|
a1d7dcab13 | 1 year ago |
|
|
e51df0651c | 1 year ago |
|
|
4901e8a0fb | 1 year ago |
|
|
04bcf76083 | 1 year ago |
|
|
70870f1903 | 1 year ago |
|
|
1fd69dc2e4 | 1 year ago |
|
|
618a27ab4d | 1 year ago |
|
|
aaa8f68e60 | 1 year ago |
|
|
07c3fa4164 | 1 year ago |
|
|
803e81dbc9 | 1 year ago |
|
|
27c964fc1c | 1 year ago |
|
|
841748a41f | 1 year ago |
|
|
30cffc364b | 1 year ago |
|
|
a97fc8c08d | 1 year ago |
|
|
98b6e03678 | 1 year ago |
|
|
3b02159f3c | 1 year ago |
|
|
481dadf0b3 | 1 year ago |
|
|
30fc25c236 | 1 year ago |
|
|
803ade0b9d | 1 year ago |
|
|
2fcc2792a3 | 1 year ago |
|
|
58db44969f | 1 year ago |
|
|
71ae7cf3e4 | 1 year ago |
|
|
671b9d9e6f | 1 year ago |
|
|
c8e1f6d756 | 1 year ago |
|
|
cef48cb1cb | 1 year ago |
|
|
e79af29c8e | 1 year ago |
|
|
d1fe3163f3 | 1 year ago |
|
|
892f52ced8 | 1 year ago |
|
|
c7446a91b3 | 1 year ago |
|
|
7326886660 | 1 year ago |
|
|
7ab3caa364 | 1 year ago |
|
|
d4ebcf998f | 1 year ago |
|
|
900d32f5bb | 1 year ago |
|
|
382207d8b2 | 1 year ago |
|
|
d414327147 | 1 year ago |
|
|
485285a147 | 1 year ago |
|
|
4c7b289d7e | 1 year ago |
|
|
462c8fa104 | 1 year ago |
|
|
043e187274 | 1 year ago |
|
|
5267d4292a | 1 year ago |
|
|
d0e733ffd3 | 1 year ago |
|
|
0bbc288da9 | 1 year ago |
|
|
3d9099d9e7 | 1 year ago |
|
|
1b37692dd7 | 1 year ago |
|
|
73080483fc | 1 year ago |
|
|
7453c7e2e5 | 1 year ago |
|
|
0d0597ae48 | 1 year ago |
|
|
283c0e9d5a | 1 year ago |
|
|
ee4e7a7c2b | 2 years ago |
|
|
c99878f04a | 2 years ago |
|
|
cfd19346b8 | 2 years ago |
|
|
327f9d41b7 | 2 years ago |
|
|
b18b57ca93 | 2 years ago |
|
|
8d9c4091fb | 2 years ago |
|
|
c1b01c1565 | 2 years ago |
|
|
b2494d00ab | 2 years ago |
|
|
6e74801852 | 2 years ago |
|
|
0230afc5c7 | 2 years ago |
|
|
450dfff6e8 | 2 years ago |
|
|
fb41cd0770 | 2 years ago |
|
|
fea3c806ec | 2 years ago |
|
|
e2f10aba52 | 2 years ago |
|
|
4949a141b9 | 2 years ago |
|
|
3bd72ef382 | 2 years ago |
|
|
56d6bc196b | 2 years ago |
|
|
5eb1a939dc | 2 years ago |
|
|
bb954b9771 | 2 years ago |
|
|
36754b524d | 2 years ago |
|
|
f0a9c294c2 | 2 years ago |
|
|
f5a71aa15b | 2 years ago |
|
|
15577c3cfb | 2 years ago |
|
|
df0bb8fb28 | 2 years ago |
|
|
f290f2e04f | 2 years ago |
|
|
55363e4e9f | 2 years ago |
|
|
623d21fc80 | 2 years ago |
|
|
0ae831e163 | 2 years ago |
|
|
8fc14ee2bc | 2 years ago |
|
|
910e56f64a | 2 years ago |
|
|
c3696586f3 | 2 years ago |
|
|
e7fa2bfac8 | 2 years ago |
|
|
b8c890f15e | 2 years ago |
|
|
1f41907962 | 2 years ago |
|
|
27f670917a | 2 years ago |
|
|
c1eef03f82 | 2 years ago |
|
|
4de57025a9 | 2 years ago |
|
|
31a9b71b83 | 2 years ago |
|
|
3ce3d2b1db | 2 years ago |
|
|
dfa57dbe55 | 2 years ago |
|
|
424942bf58 | 2 years ago |
|
|
e2a5bbfb65 | 2 years ago |
|
|
9457b0b412 | 2 years ago |
|
|
f2ab8529e9 | 2 years ago |
|
|
4777c5c952 | 2 years ago |
|
|
9a8a21e41b | 2 years ago |
|
|
fc2b400845 | 2 years ago |
|
|
5e8a8412d3 | 2 years ago |
|
|
a6d75fdcc3 | 2 years ago |
|
|
9b50be3b05 | 2 years ago |
|
|
b4a3819c36 | 2 years ago |
|
|
cb04d4a2fb | 2 years ago |
|
|
b7d3e4ab72 | 2 years ago |
|
|
cd97cbda78 | 2 years ago |
|
|
13c28a14f1 | 2 years ago |
|
|
7f0df61ff0 | 2 years ago |
|
|
77d08afd0d | 2 years ago |
|
|
de3b37873a | 2 years ago |
|
|
e699b8f4a6 | 2 years ago |
|
|
9d1e463281 | 2 years ago |
|
|
201cbd185c | 2 years ago |
|
|
2e9d665aaf | 2 years ago |
|
|
4abcd4efe3 | 2 years ago |
|
|
b1f8ffab53 | 2 years ago |
|
|
2804003472 | 2 years ago |
|
|
fcd5436fb7 | 2 years ago |
|
|
aebcd089ef | 2 years ago |
|
|
0c5a45f5af | 2 years ago |
|
|
03aa7a5d01 | 2 years ago |
|
|
b228e88a94 | 2 years ago |
|
|
0b5ec2d2f7 | 2 years ago |
|
|
08cb3f4a85 | 2 years ago |
|
|
ca49b99f40 | 2 years ago |
|
|
64dddb0ee6 | 2 years ago |
|
|
926f083e7f | 2 years ago |
|
|
603fa08c42 | 2 years ago |
|
|
06f11e623b | 2 years ago |
|
|
8dbf04f7c9 | 2 years ago |
|
|
81b18659d7 | 2 years ago |
|
|
3ca0b9776b | 2 years ago |
|
|
7ab427e113 | 2 years ago |
|
|
0b073b23fa | 2 years ago |
|
|
cec6d171e0 | 2 years ago |
|
|
f874e1fcb0 | 2 years ago |
|
|
69fc3346c6 | 2 years ago |
|
|
55c3af0540 | 2 years ago |
|
|
342d9b2672 | 2 years ago |
|
|
7c84037601 | 2 years ago |
|
|
d5745847bf | 2 years ago |
|
|
a71c257aab | 2 years ago |
|
|
d375b9dff3 | 2 years ago |
|
|
689460a78d | 2 years ago |
|
|
20125d81ae | 2 years ago |
|
|
e154d6e187 | 2 years ago |
|
|
f970e4a540 | 2 years ago |
|
|
9e38eee149 | 2 years ago |
|
|
6c416ef7a0 | 2 years ago |
|
|
3f7527f4b2 | 2 years ago |
|
|
d029656866 | 2 years ago |
|
|
dc145661c8 | 2 years ago |
|
|
5eb483c3fd | 2 years ago |
|
|
a7ba63d281 | 2 years ago |
|
|
01d9ad68a2 | 2 years ago |
|
|
511342adef | 2 years ago |
|
|
4962ea2d8b | 2 years ago |
|
|
a76b8d8244 | 2 years ago |
|
|
837191a5e1 | 2 years ago |
|
|
04cfd408bd | 2 years ago |
|
|
9e3cc01302 | 2 years ago |
|
|
5999804bc6 | 2 years ago |
|
|
6245aa9ef4 | 2 years ago |
|
|
98b35fbc61 | 2 years ago |
|
|
c5cefa2309 | 2 years ago |
@ -0,0 +1,63 @@
|
|||||||
|
# View-Only Mode: CustomerID Parameter Exclusion
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
Updated all API calls to exclude `customerID` parameter when `AppState().getIsViewOnly` is `true`.
|
||||||
|
|
||||||
|
## Files Modified
|
||||||
|
|
||||||
|
### 1. **request_repo.dart**
|
||||||
|
- ✅ `createRequest()` - Excludes customerID in view-only mode
|
||||||
|
- ✅ `getRequests()` - Excludes customerID for customer app type in view-only mode
|
||||||
|
- ✅ `getRequestBasedOnFilters()` - Excludes customerID for customer app type in view-only mode
|
||||||
|
- ✅ `getOffersFromProvidersByRequest()` - Excludes customerID in view-only mode
|
||||||
|
|
||||||
|
### 2. **ads_repo.dart**
|
||||||
|
- ✅ `cancelMyAdReservation()` - Excludes customerID in view-only mode
|
||||||
|
- ✅ `createReserveAd()` - Excludes customerID in view-only mode
|
||||||
|
- ✅ `uploadBankReceiptsOnReserveDealDone()` - Excludes customerID in view-only mode
|
||||||
|
|
||||||
|
### 3. **appointment_repo.dart**
|
||||||
|
- ✅ `createAppointmentsMulti()` - Excludes customerID in view-only mode
|
||||||
|
- ✅ `getMyAppointmentsForCustomersByFilters()` - Excludes customerID in view-only mode
|
||||||
|
|
||||||
|
### 4. **branch_repo.dart**
|
||||||
|
- ✅ `submitBranchRatings()` - Excludes customerID in view-only mode
|
||||||
|
- ✅ `addProviderToFavourite()` - Excludes customerID in view-only mode
|
||||||
|
- ✅ `getMyFavoriteProviders()` - Excludes customerID in view-only mode
|
||||||
|
|
||||||
|
### 5. **setting_options_repo.dart**
|
||||||
|
- ✅ `appInvitationCreate()` - Excludes customerID for customer app type in view-only mode
|
||||||
|
|
||||||
|
## How It Works
|
||||||
|
|
||||||
|
When `AppState().getIsViewOnly` is `true`, the application is in demonstration/view-only mode. In this mode:
|
||||||
|
|
||||||
|
1. **API parameters are conditionally added**: Instead of always including `customerID`, we check the view-only flag first
|
||||||
|
2. **Pattern used**:
|
||||||
|
```dart
|
||||||
|
var params = {
|
||||||
|
"otherParam": value,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!appState.getIsViewOnly) {
|
||||||
|
params["customerID"] = customerId;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **App types considered**: The changes properly handle both customer and provider app types
|
||||||
|
|
||||||
|
## Testing Recommendations
|
||||||
|
|
||||||
|
1. Test in normal mode (getIsViewOnly = false):
|
||||||
|
- All APIs should include customerID as before
|
||||||
|
- All existing functionality should work
|
||||||
|
|
||||||
|
2. Test in view-only mode (getIsViewOnly = true):
|
||||||
|
- APIs should NOT include customerID parameter
|
||||||
|
- Read-only operations should work
|
||||||
|
- Write operations should be blocked by view-only mode
|
||||||
|
|
||||||
|
## Note
|
||||||
|
|
||||||
|
The `createComplainFromProvider()` method in `common_repo.dart` was NOT modified because the `customerID` in that API represents the target customer being complained about, not the authenticated user making the request.
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="9.688" viewBox="0 0 13 9.688">
|
||||||
|
<g id="Group" transform="translate(6 17.688) rotate(180)">
|
||||||
|
<path id="Vector" d="M13,4.844a.781.781,0,0,1-.781.781H2.674L5.414,8.352a.781.781,0,0,1-1.1,1.108L.23,5.4h0a.782.782,0,0,1,0-1.106h0L4.312.227a.781.781,0,0,1,1.1,1.108L2.674,4.062h9.545A.781.781,0,0,1,13,4.844Z" transform="translate(-7 8)"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 411 B |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
File diff suppressed because it is too large
Load Diff
@ -1,134 +1,13 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:mc_common_app/theme/app_theme.dart';
|
|
||||||
import 'package:logger/logger.dart';
|
import 'package:logger/logger.dart';
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:provider/single_child_widget.dart';
|
|
||||||
import 'package:sizer/sizer.dart';
|
|
||||||
|
|
||||||
|
|
||||||
//testing push
|
|
||||||
final navigatorKey = GlobalKey<NavigatorState>();
|
|
||||||
|
|
||||||
Logger logger = Logger(
|
|
||||||
printer: PrettyPrinter(
|
|
||||||
lineLength: 0,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
class MyHttpOverrides extends HttpOverrides {
|
Logger logger = Logger(printer: PrettyPrinter(printEmojis: false, colors: true, printTime: false));
|
||||||
@override
|
|
||||||
HttpClient createHttpClient(SecurityContext? context) {
|
|
||||||
return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> main() async {
|
bool disableThingsForQA = true;
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
|
||||||
|
|
||||||
await EasyLocalization.ensureInitialized();
|
// Language Tile in Settings
|
||||||
// AppState().setPostParamsInitConfig();
|
|
||||||
HttpOverrides.global = MyHttpOverrides();
|
|
||||||
|
|
||||||
runApp(
|
|
||||||
EasyLocalization(
|
|
||||||
supportedLocales: const <Locale>[
|
|
||||||
Locale('en', 'US'),
|
|
||||||
Locale('ar', 'SA'),
|
|
||||||
],
|
|
||||||
path: 'resources',
|
|
||||||
// assetLoader: const CodegenLoader(),
|
|
||||||
child: MultiProvider(
|
|
||||||
providers: const <SingleChildWidget>[
|
|
||||||
// ChangeNotifierProvider<LoginProviderModel>(
|
|
||||||
// create: (_) => LoginProviderModel(),
|
|
||||||
// ),
|
|
||||||
],
|
|
||||||
child: const MyApp(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// todo terminal command to genertate translation files
|
// todo terminal command to genertate translation files
|
||||||
// flutter pub run easy_localization:generate -S resources -f keys -O lib/generated -o locale_keys.g.dart
|
// flutter pub run easy_localization:generate --source-dir ./assets/langs
|
||||||
|
// todo terminal command to genertate translation keys
|
||||||
class MyApp extends StatelessWidget {
|
// flutter pub run easy_localization:generate --source-dir ./assets/langs -f keys -o locale_keys.g.dart
|
||||||
const MyApp({super.key});
|
// command to generate languages data from json
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return LayoutBuilder(builder: (context, constraints) {
|
|
||||||
return Sizer(
|
|
||||||
builder: (
|
|
||||||
BuildContext context,
|
|
||||||
Orientation orientation,
|
|
||||||
DeviceType deviceType,
|
|
||||||
) {
|
|
||||||
List<LocalizationsDelegate<dynamic>> delegates = context.localizationDelegates;
|
|
||||||
// AppState().setPostParamsModel(
|
|
||||||
// PostParamsModel(
|
|
||||||
// languageID: EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
return MaterialApp(
|
|
||||||
// key: navigatorKey,
|
|
||||||
navigatorKey: navigatorKey,
|
|
||||||
theme: AppTheme.getTheme(
|
|
||||||
isArabic: EasyLocalization.of(context)?.locale.languageCode == "ar",
|
|
||||||
),
|
|
||||||
debugShowCheckedModeBanner: false,
|
|
||||||
localizationsDelegates: delegates,
|
|
||||||
supportedLocales: context.supportedLocales,
|
|
||||||
locale: context.locale,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// class MyApp extends StatelessWidget {
|
|
||||||
// MyApp({super.key}) {
|
|
||||||
// AppDependencies.addDependencies();
|
|
||||||
// AppState = Injector.appInstance.get<AppState>();
|
|
||||||
// // AppState.setPostParamsInitConfig();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return LayoutBuilder(builder: (context, constraints) {
|
|
||||||
// return Sizer(
|
|
||||||
// builder: (
|
|
||||||
// BuildContext context,
|
|
||||||
// Orientation orientation,
|
|
||||||
// DeviceType deviceType,
|
|
||||||
// ) {
|
|
||||||
// SizeConfig().init(constraints, orientation);
|
|
||||||
// List<LocalizationsDelegate<dynamic>> delegates = context.localizationDelegates;
|
|
||||||
// // AppState().setPostParamsModel(
|
|
||||||
// // PostParamsModel(
|
|
||||||
// // languageID: EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2,
|
|
||||||
// // ),
|
|
||||||
// // );
|
|
||||||
// return MaterialApp(
|
|
||||||
// // key: navigatorKey,
|
|
||||||
// navigatorKey: navigatorKey,
|
|
||||||
// theme: AppTheme.getTheme(
|
|
||||||
// EasyLocalization.of(context)?.locale.languageCode == "ar",
|
|
||||||
// ),
|
|
||||||
// debugShowCheckedModeBanner: false,
|
|
||||||
// localizationsDelegates: delegates,
|
|
||||||
// supportedLocales: context.supportedLocales,
|
|
||||||
// locale: context.locale,
|
|
||||||
// initialRoute: AppRoutes.initialPage,
|
|
||||||
// routes: AppRoutes.routes,
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
class PdfReceiptModel {
|
||||||
|
int? id;
|
||||||
|
String? pdfName;
|
||||||
|
String? pdfString;
|
||||||
|
|
||||||
|
PdfReceiptModel({this.id, this.pdfName, this.pdfString});
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
class AppointmentBasicDetailsModel {
|
||||||
|
int? serviceSlotID;
|
||||||
|
String? slotDate;
|
||||||
|
String? startTime;
|
||||||
|
String? endTime;
|
||||||
|
int? appointmentStatusID;
|
||||||
|
String? appointmentStatusText;
|
||||||
|
int? serviceProviderID;
|
||||||
|
int? customerID;
|
||||||
|
|
||||||
|
AppointmentBasicDetailsModel({
|
||||||
|
this.serviceSlotID,
|
||||||
|
this.slotDate,
|
||||||
|
this.startTime,
|
||||||
|
this.endTime,
|
||||||
|
this.appointmentStatusID,
|
||||||
|
this.appointmentStatusText,
|
||||||
|
this.serviceProviderID,
|
||||||
|
this.customerID,
|
||||||
|
});
|
||||||
|
|
||||||
|
AppointmentBasicDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
serviceSlotID = json['serviceSlotID'];
|
||||||
|
slotDate = json['slotDate'];
|
||||||
|
startTime = json['startTime'];
|
||||||
|
endTime = json['endTime'];
|
||||||
|
appointmentStatusID = json['appointmentStatusID'];
|
||||||
|
appointmentStatusText = json['appointmentStatusText'];
|
||||||
|
serviceProviderID = json['serviceProviderID'];
|
||||||
|
customerID = json['customerID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['serviceSlotID'] = serviceSlotID;
|
||||||
|
data['slotDate'] = slotDate;
|
||||||
|
data['startTime'] = startTime;
|
||||||
|
data['endTime'] = endTime;
|
||||||
|
data['appointmentStatusID'] = appointmentStatusID;
|
||||||
|
data['appointmentStatusText'] = appointmentStatusText;
|
||||||
|
data['serviceProviderID'] = serviceProviderID;
|
||||||
|
data['customerID'] = customerID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
class AppointmentSlots {
|
||||||
|
int totalSlots;
|
||||||
|
int occupiedSlots;
|
||||||
|
int emptySlots;
|
||||||
|
|
||||||
|
AppointmentSlots({
|
||||||
|
required this.totalSlots,
|
||||||
|
required this.occupiedSlots,
|
||||||
|
required this.emptySlots,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory AppointmentSlots.fromJson(Map<String, dynamic> json) =>
|
||||||
|
AppointmentSlots(
|
||||||
|
totalSlots: json["totalSlots"],
|
||||||
|
occupiedSlots: json["occupiedSlots"],
|
||||||
|
emptySlots: json["emptySlots"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"totalSlots": totalSlots,
|
||||||
|
"occupiedSlots": occupiedSlots,
|
||||||
|
"emptySlots": emptySlots,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -1,49 +0,0 @@
|
|||||||
class ChatMessageModel {
|
|
||||||
String? senderUserID;
|
|
||||||
String? senderName;
|
|
||||||
int? messageType;
|
|
||||||
String? message;
|
|
||||||
RequestOffer? requestOffer;
|
|
||||||
int? requestID;
|
|
||||||
int? requestOfferID;
|
|
||||||
|
|
||||||
ChatMessageModel({this.senderUserID, this.senderName, this.messageType, this.message, this.requestOffer, this.requestID, this.requestOfferID});
|
|
||||||
|
|
||||||
ChatMessageModel.fromJson(Map<String, dynamic> json) {
|
|
||||||
senderUserID = json['senderUserID'];
|
|
||||||
senderName = json['senderName'];
|
|
||||||
messageType = json['messageType'];
|
|
||||||
message = json['message'];
|
|
||||||
if (json['requestOffer'] != null) {
|
|
||||||
requestOffer = RequestOffer.fromJson(json['requestOffer']);
|
|
||||||
} else {
|
|
||||||
requestOffer = null;
|
|
||||||
}
|
|
||||||
requestID = json['requestID'];
|
|
||||||
requestOfferID = json['requestOfferID'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class RequestOffer {
|
|
||||||
int? id;
|
|
||||||
int? requestID;
|
|
||||||
int? serviceProviderID;
|
|
||||||
int? offerStatus;
|
|
||||||
String? comment;
|
|
||||||
int? price;
|
|
||||||
String? offeredItemCreatedBy;
|
|
||||||
String? offeredItemCreatedOn;
|
|
||||||
|
|
||||||
RequestOffer({this.id, this.requestID, this.serviceProviderID, this.offerStatus, this.comment, this.price, this.offeredItemCreatedBy, this.offeredItemCreatedOn});
|
|
||||||
|
|
||||||
RequestOffer.fromJson(Map<String, dynamic> json) {
|
|
||||||
id = json['id'];
|
|
||||||
requestID = json['requestID'];
|
|
||||||
serviceProviderID = json['serviceProviderID'];
|
|
||||||
offerStatus = json['offerStatus'];
|
|
||||||
comment = json['comment'];
|
|
||||||
price = json['price'];
|
|
||||||
offeredItemCreatedBy = json['offeredItemCreatedBy'];
|
|
||||||
offeredItemCreatedOn = json['offeredItemCreatedOn'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
class BuyersChatForAdsModel {
|
||||||
|
int? id;
|
||||||
|
String? buyerUserID;
|
||||||
|
String? buyerName;
|
||||||
|
int? adsID;
|
||||||
|
int? unReadMessagesCount;
|
||||||
|
String? lastMessage;
|
||||||
|
String? lastMessageDateTime;
|
||||||
|
|
||||||
|
BuyersChatForAdsModel({this.id, this.buyerUserID, this.buyerName, this.adsID});
|
||||||
|
|
||||||
|
BuyersChatForAdsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
buyerUserID = json['buyerUserID'];
|
||||||
|
buyerName = json['buyerName'];
|
||||||
|
adsID = json['adsID'];
|
||||||
|
unReadMessagesCount = json['unReadCount'];
|
||||||
|
lastMessage = json['lastMessage'];
|
||||||
|
lastMessageDateTime = json['lastMessageDateTime'];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,194 @@
|
|||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:mc_common_app/classes/app_state.dart';
|
||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
|
||||||
|
class ChatMessageModel {
|
||||||
|
int? id;
|
||||||
|
String? senderUserID;
|
||||||
|
String? receiverUserID;
|
||||||
|
String? senderName;
|
||||||
|
int? messageType;
|
||||||
|
ChatMessageTypeEnum? chatMessageTypeEnum;
|
||||||
|
String? chatText;
|
||||||
|
int? requestID;
|
||||||
|
int? reqOfferID;
|
||||||
|
int? serviceProviderID;
|
||||||
|
int? offerStatus;
|
||||||
|
ReqOffer? reqOffer;
|
||||||
|
List<MessageImageModel>? messageImages;
|
||||||
|
bool? isRead;
|
||||||
|
String? readOn;
|
||||||
|
bool? isMyMessage;
|
||||||
|
|
||||||
|
ChatMessageModel({
|
||||||
|
this.id,
|
||||||
|
this.senderUserID,
|
||||||
|
this.receiverUserID,
|
||||||
|
this.senderName,
|
||||||
|
this.messageType,
|
||||||
|
this.chatMessageTypeEnum,
|
||||||
|
this.chatText,
|
||||||
|
this.requestID,
|
||||||
|
this.reqOfferID,
|
||||||
|
this.serviceProviderID,
|
||||||
|
this.offerStatus,
|
||||||
|
this.reqOffer,
|
||||||
|
this.messageImages,
|
||||||
|
this.isRead,
|
||||||
|
this.readOn,
|
||||||
|
this.isMyMessage,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'ChatMessageModel{id: $id, senderUserID: $senderUserID, senderName: $senderName, messageType: $messageType, chatMessageTypeEnum: $chatMessageTypeEnum, chatText: $chatText, requestID: $requestID, reqOfferID: $reqOfferID, serviceProviderID: $serviceProviderID, offerStatus: $offerStatus, reqOffer: ${reqOffer.toString()}, isRead: $isRead, readOn: $readOn, isMyMessage: $isMyMessage}';
|
||||||
|
}
|
||||||
|
|
||||||
|
ChatMessageModel.fromJson(Map<String, dynamic> json, {bool isFromNetwork = true, bool isForReqOfferImagesURLs = false}) {
|
||||||
|
final myUserId = AppState().getUser.data!.userInfo!.userId.toString().toUpperCase();
|
||||||
|
id = json['id'];
|
||||||
|
senderUserID = json['senderUserID'];
|
||||||
|
receiverUserID = json['receiverUserID'] ?? "";
|
||||||
|
senderName = json['senderName'];
|
||||||
|
messageType = json['messageType'];
|
||||||
|
chatMessageTypeEnum = (json['messageType'] as int).toChatMessageTypeEnum();
|
||||||
|
chatText = json['chatText'];
|
||||||
|
requestID = json['requestID'];
|
||||||
|
reqOfferID = json['reqOfferID'];
|
||||||
|
serviceProviderID = json['serviceProviderID'];
|
||||||
|
offerStatus = json['offerStatus'];
|
||||||
|
reqOffer = json['reqOffer'] != null ? ReqOffer.fromJson(json['reqOffer'], isFromNetwork, isForReqOfferImagesURLs) : null;
|
||||||
|
if (json['reqOfferImages'] != null) {
|
||||||
|
messageImages = <MessageImageModel>[];
|
||||||
|
json['reqOfferImages'].forEach((v) {
|
||||||
|
messageImages!.add(MessageImageModel.fromJson(v, isFromNetwork));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
isRead = json['isRead'];
|
||||||
|
readOn = json['readOn'];
|
||||||
|
isMyMessage = (json['senderUserID']).toString().toUpperCase() == myUserId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ReqOffer {
|
||||||
|
int? id;
|
||||||
|
int? requestID;
|
||||||
|
int? serviceProviderID;
|
||||||
|
int? offerStatus;
|
||||||
|
String? offerStatusText;
|
||||||
|
String? comment;
|
||||||
|
String? serviceItemName;
|
||||||
|
String? manufacturedByName;
|
||||||
|
String? manufacturedOn;
|
||||||
|
double? price;
|
||||||
|
bool? isDeliveryAvailable;
|
||||||
|
RequestDeliveryOptionEnum? requestDeliveryOption;
|
||||||
|
RequestsTypeEnum? requestsTypeEnum;
|
||||||
|
RequestOfferStatusEnum? requestOfferStatusEnum;
|
||||||
|
List<MessageImageModel>? reqOfferImages;
|
||||||
|
|
||||||
|
ReqOffer({
|
||||||
|
this.id,
|
||||||
|
this.requestID,
|
||||||
|
this.serviceProviderID,
|
||||||
|
this.offerStatus,
|
||||||
|
this.offerStatusText,
|
||||||
|
this.comment,
|
||||||
|
this.serviceItemName,
|
||||||
|
this.manufacturedByName,
|
||||||
|
this.manufacturedOn,
|
||||||
|
this.price,
|
||||||
|
this.isDeliveryAvailable,
|
||||||
|
this.requestDeliveryOption,
|
||||||
|
this.requestOfferStatusEnum,
|
||||||
|
this.requestsTypeEnum,
|
||||||
|
this.reqOfferImages,
|
||||||
|
});
|
||||||
|
|
||||||
|
ReqOffer.fromJson(Map<String, dynamic> json, bool isFromNetwork, bool isForReqOfferImagesURLs) {
|
||||||
|
id = json['id'];
|
||||||
|
requestID = json['requestID'];
|
||||||
|
serviceProviderID = json['serviceProviderID'];
|
||||||
|
offerStatus = json['offerStatus'];
|
||||||
|
offerStatusText = json['offerStatusText'];
|
||||||
|
comment = json['comment'];
|
||||||
|
serviceItemName = json['serviceItem'];
|
||||||
|
manufacturedByName = json['offeredItemCreatedByName'].toString();
|
||||||
|
manufacturedOn = json['offeredItemCreatedOn'] ?? json["createdOn"];
|
||||||
|
price = json['price'];
|
||||||
|
isDeliveryAvailable = json['isDeliveryAvailable'];
|
||||||
|
requestDeliveryOption = ((json['offerDeliveryOption'] ?? 0) as int).toRequestDeliveryOptionEnum();
|
||||||
|
requestOfferStatusEnum = ((json['offerStatus']) as int).toRequestOfferStatusEnum();
|
||||||
|
requestsTypeEnum = RequestsTypeEnum.serviceRequest;
|
||||||
|
// if (isForReqOfferImagesURLs) {
|
||||||
|
// if (json['reqOfferImagesURLs'] != null) {
|
||||||
|
// reqOfferImages = <MessageImageModel>[];
|
||||||
|
// json['reqOfferImagesURLs'].forEach((v) {
|
||||||
|
// reqOfferImages!.add(MessageImageModel.fromJson(v, isFromNetwork));
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
if (json['reqOfferImages'] != null) {
|
||||||
|
reqOfferImages = <MessageImageModel>[];
|
||||||
|
json['reqOfferImages'].forEach((v) {
|
||||||
|
reqOfferImages!.add(MessageImageModel.fromJson(v, isFromNetwork));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'ReqOffer{id: $id, requestID: $requestID, serviceProviderID: $serviceProviderID, offerStatus: $offerStatus, offerStatusText: $offerStatusText, comment: $comment, serviceItemName: $serviceItemName, manufacturedById: $manufacturedByName, manufacturedOn: $manufacturedOn, price: $price, requestsTypeEnum: $requestsTypeEnum, requestOfferStatusEnum: $requestOfferStatusEnum}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OfferRequestCommentModel {
|
||||||
|
int? index;
|
||||||
|
String? title;
|
||||||
|
bool? isSelected;
|
||||||
|
|
||||||
|
OfferRequestCommentModel({this.index, this.title, this.isSelected});
|
||||||
|
}
|
||||||
|
|
||||||
|
class MessageImageModel {
|
||||||
|
int? id;
|
||||||
|
String? imageUrl;
|
||||||
|
String? imageStr;
|
||||||
|
String? imagePath;
|
||||||
|
bool? isFromNetwork;
|
||||||
|
int? reqOfferID;
|
||||||
|
|
||||||
|
MessageImageModel({
|
||||||
|
this.id,
|
||||||
|
this.imageUrl,
|
||||||
|
this.imageStr,
|
||||||
|
this.imagePath,
|
||||||
|
this.reqOfferID,
|
||||||
|
this.isFromNetwork = false,
|
||||||
|
});
|
||||||
|
|
||||||
|
MessageImageModel.fromJson(Map<String, dynamic> json, bool fromNetwork) {
|
||||||
|
id = json['id'];
|
||||||
|
imageUrl = json['imageUrl'];
|
||||||
|
imageStr = json['imageStr'];
|
||||||
|
imagePath = json[''];
|
||||||
|
reqOfferID = json['reqOfferID'];
|
||||||
|
isFromNetwork = fromNetwork;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
return {
|
||||||
|
'id': id,
|
||||||
|
'imageStr': imageStr,
|
||||||
|
'reqOfferID': reqOfferID, // We don't include 'isFromNetwork' since it's set manually when parsing JSON
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'MessageImageModel{id: $id, imageUrl: $imageUrl, imageStr: $imageStr, imagePath: $imagePath, isFromNetwork: $isFromNetwork, reqOfferID: $reqOfferID}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,36 +0,0 @@
|
|||||||
// To parse this JSON data, do
|
|
||||||
//
|
|
||||||
// final mResponse = mResponseFromJson(jsonString);
|
|
||||||
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
MResponse mResponseFromJson(String str) => MResponse.fromJson(json.decode(str));
|
|
||||||
|
|
||||||
String mResponseToJson(MResponse data) => json.encode(data.toJson());
|
|
||||||
|
|
||||||
class MResponse {
|
|
||||||
MResponse({
|
|
||||||
this.totalItemsCount,
|
|
||||||
this.messageStatus,
|
|
||||||
this.message,
|
|
||||||
this.data,
|
|
||||||
});
|
|
||||||
|
|
||||||
int? totalItemsCount;
|
|
||||||
int? messageStatus;
|
|
||||||
String? message;
|
|
||||||
dynamic data;
|
|
||||||
|
|
||||||
factory MResponse.fromJson(Map<String, dynamic> json) => MResponse(
|
|
||||||
totalItemsCount: json["totalItemsCount"],
|
|
||||||
messageStatus: json["messageStatus"],
|
|
||||||
message: json["message"],
|
|
||||||
data: json["data"],
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
|
||||||
"totalItemsCount": totalItemsCount,
|
|
||||||
"messageStatus": messageStatus,
|
|
||||||
"message": message,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
class BranchRatingModel {
|
||||||
|
int? id;
|
||||||
|
String? title;
|
||||||
|
String? review;
|
||||||
|
int? ratNo;
|
||||||
|
int? serviceProviderBranchID;
|
||||||
|
String? serviceProviderBranchName;
|
||||||
|
int? customerID;
|
||||||
|
String? customerName;
|
||||||
|
|
||||||
|
BranchRatingModel({this.id, this.title, this.review, this.ratNo, this.serviceProviderBranchID, this.serviceProviderBranchName, this.customerID, this.customerName});
|
||||||
|
|
||||||
|
BranchRatingModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
title = json['title'];
|
||||||
|
review = json['review'];
|
||||||
|
ratNo = json['ratNo'];
|
||||||
|
serviceProviderBranchID = json['serviceProviderBranchID'];
|
||||||
|
serviceProviderBranchName = json['serviceProviderBranchName'];
|
||||||
|
customerID = json['customerID'];
|
||||||
|
customerName = json['customerName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['title'] = title;
|
||||||
|
data['review'] = review;
|
||||||
|
data['ratNo'] = ratNo;
|
||||||
|
data['serviceProviderBranchID'] = serviceProviderBranchID;
|
||||||
|
data['serviceProviderBranchName'] = serviceProviderBranchName;
|
||||||
|
data['customerID'] = customerID;
|
||||||
|
data['customerName'] = customerName;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
class ProviderContactInfoModel {
|
||||||
|
int? id;
|
||||||
|
int? providerID;
|
||||||
|
String? name;
|
||||||
|
int? allDocStatus;
|
||||||
|
String? companyName;
|
||||||
|
String? companyDescription;
|
||||||
|
int? countryID;
|
||||||
|
String? countryName;
|
||||||
|
String? userID;
|
||||||
|
String? memberSince;
|
||||||
|
String? mobile;
|
||||||
|
String? whatsApp;
|
||||||
|
String? email;
|
||||||
|
|
||||||
|
ProviderContactInfoModel({
|
||||||
|
this.id,
|
||||||
|
this.providerID,
|
||||||
|
this.name,
|
||||||
|
this.allDocStatus,
|
||||||
|
this.companyName,
|
||||||
|
this.companyDescription,
|
||||||
|
this.countryID,
|
||||||
|
this.countryName,
|
||||||
|
this.userID,
|
||||||
|
this.memberSince,
|
||||||
|
this.mobile,
|
||||||
|
this.whatsApp,
|
||||||
|
this.email,
|
||||||
|
});
|
||||||
|
|
||||||
|
ProviderContactInfoModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
providerID = json['providerID'];
|
||||||
|
name = json['name'];
|
||||||
|
allDocStatus = json['allDocStatus'];
|
||||||
|
companyName = json['companyName'];
|
||||||
|
companyDescription = json['companyDescription'];
|
||||||
|
countryID = json['countryID'];
|
||||||
|
countryName = json['countryName'];
|
||||||
|
userID = json['userID'];
|
||||||
|
memberSince = json['memberSince'];
|
||||||
|
mobile = json['mobile'];
|
||||||
|
whatsApp = json['whatsApp'];
|
||||||
|
email = json['email'];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,53 +1,86 @@
|
|||||||
// To parse this JSON data, do
|
|
||||||
//
|
|
||||||
// final branch2 = branch2FromJson(jsonString);
|
|
||||||
|
|
||||||
import 'package:mc_common_app/models/provider_branches_models/branch_detail_model.dart';
|
import 'package:mc_common_app/models/provider_branches_models/branch_detail_model.dart';
|
||||||
|
|
||||||
|
|
||||||
class ProviderProfileModel {
|
class ProviderProfileModel {
|
||||||
ProviderProfileModel({
|
ProviderProfileModel({
|
||||||
this.id,
|
this.id,
|
||||||
this.companyName,
|
this.companyName,
|
||||||
|
this.profileImage,
|
||||||
|
this.name,
|
||||||
this.countryName,
|
this.countryName,
|
||||||
this.companyDescription,
|
this.companyDescription,
|
||||||
this.allDocStatus,
|
this.allDocStatus,
|
||||||
this.isValidSubscription,
|
this.isValidSubscription,
|
||||||
this.userId,
|
this.userId,
|
||||||
|
this.memberSince,
|
||||||
this.serviceProviderBranch,
|
this.serviceProviderBranch,
|
||||||
this.countryID,
|
this.countryID,
|
||||||
|
this.isFavorite,
|
||||||
|
this.providerID,
|
||||||
|
this.noOfBranches,
|
||||||
|
this.customerID,
|
||||||
});
|
});
|
||||||
|
|
||||||
final int? id;
|
final int? id;
|
||||||
|
final String? profileImage;
|
||||||
final String? companyName;
|
final String? companyName;
|
||||||
final String? countryName;
|
|
||||||
int? countryID;
|
|
||||||
final String? companyDescription;
|
final String? companyDescription;
|
||||||
|
int? countryID;
|
||||||
|
final String? countryName;
|
||||||
final int? allDocStatus;
|
final int? allDocStatus;
|
||||||
final bool? isValidSubscription;
|
final bool? isValidSubscription;
|
||||||
|
final String? name;
|
||||||
final String? userId;
|
final String? userId;
|
||||||
|
final String? memberSince;
|
||||||
|
bool? isFavorite;
|
||||||
|
final int? providerID;
|
||||||
|
final int? customerID;
|
||||||
|
final int? noOfBranches;
|
||||||
final List<BranchDetailModel>? serviceProviderBranch;
|
final List<BranchDetailModel>? serviceProviderBranch;
|
||||||
|
|
||||||
factory ProviderProfileModel.fromJson(Map<String, dynamic> json) => ProviderProfileModel(
|
factory ProviderProfileModel.fromJson(Map<String, dynamic> json) => ProviderProfileModel(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
companyName: json["companyName"],
|
companyName: json["companyName"],
|
||||||
|
profileImage: json["profileImage"] ?? "",
|
||||||
|
name: json["name"],
|
||||||
countryName: json["countryName"],
|
countryName: json["countryName"],
|
||||||
countryID: json["countryID"],
|
countryID: json["countryID"],
|
||||||
companyDescription: json["companyDescription"],
|
companyDescription: json["companyDescription"],
|
||||||
allDocStatus: json["allDocStatus"],
|
allDocStatus: json["allDocStatus"],
|
||||||
isValidSubscription: json["isValidSubscription"],
|
isValidSubscription: json["isValidSubscription"],
|
||||||
userId: json["userID"],
|
userId: json["userID"],
|
||||||
|
memberSince: json["memberSince"] ?? "",
|
||||||
|
providerID: json["providerID"] ?? 0,
|
||||||
|
customerID: json["customerID"] ?? 0,
|
||||||
|
noOfBranches: json["noOfBranches"] ?? (json["serviceProviderBranch"] != null ? (json["serviceProviderBranch"] as List).length : 0),
|
||||||
|
isFavorite: json["isFavourite"] ?? false,
|
||||||
serviceProviderBranch: json["serviceProviderBranch"] == null ? null : List<BranchDetailModel>.from(json["serviceProviderBranch"].map((x) => BranchDetailModel.fromJson(x))),
|
serviceProviderBranch: json["serviceProviderBranch"] == null ? null : List<BranchDetailModel>.from(json["serviceProviderBranch"].map((x) => BranchDetailModel.fromJson(x))),
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
|
||||||
"id": id,
|
|
||||||
"companyName": companyName,
|
|
||||||
"companyDescription": companyDescription,
|
|
||||||
"allDocStatus": allDocStatus,
|
|
||||||
"isValidSubscription": isValidSubscription,
|
|
||||||
"userID": userId,
|
|
||||||
"serviceProviderBranch": serviceProviderBranch == null ? null : List<dynamic>.from(serviceProviderBranch!.map((x) => x.toJson())),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// {
|
||||||
|
// "id": 10,
|
||||||
|
// "companyName": "string",
|
||||||
|
// "companyDescription": "",
|
||||||
|
// "countryID": 1,
|
||||||
|
// "countryName": "Saudi Arabia",
|
||||||
|
// "allDocStatus": 0,
|
||||||
|
// "isValidSubscription": true,
|
||||||
|
// "name": null,
|
||||||
|
// "userID": "88e2e2e8-9a6d-4f97-b05c-08dc7e4513b3",
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// {
|
||||||
|
// "id": 0,
|
||||||
|
// "companyName": "string",
|
||||||
|
// "companyDescription": "",
|
||||||
|
// "countryID": 1,
|
||||||
|
// "countryName": "string",
|
||||||
|
// "allDocStatus": 3,
|
||||||
|
// "isValidSubscription": true,
|
||||||
|
// "name": "Mirza Shafique",
|
||||||
|
// "userID": "7db5e1ae-6de4-47d7-984b-08db2842f899",
|
||||||
|
// "providerID": 2,
|
||||||
|
// "customerID": 6,
|
||||||
|
// "noOfBranches": 12,
|
||||||
|
// "memberSince": "2024-08-22T11:36:46.41"
|
||||||
|
// }
|
||||||
|
|||||||
@ -1,138 +0,0 @@
|
|||||||
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
||||||
import 'package:mc_common_app/utils/enums.dart';
|
|
||||||
|
|
||||||
class RequestModel {
|
|
||||||
int requestType;
|
|
||||||
String requestTypeName;
|
|
||||||
String requestStatusName;
|
|
||||||
RequestStatus requestStatus;
|
|
||||||
String cityName;
|
|
||||||
String vehicleTypeName;
|
|
||||||
String countryName;
|
|
||||||
String customerName;
|
|
||||||
dynamic serviceProviders;
|
|
||||||
int offerCount;
|
|
||||||
int id;
|
|
||||||
int customerId;
|
|
||||||
dynamic customer;
|
|
||||||
String brand;
|
|
||||||
String model;
|
|
||||||
int year;
|
|
||||||
bool isNew;
|
|
||||||
String description;
|
|
||||||
List<dynamic> requestImages;
|
|
||||||
int cityId;
|
|
||||||
dynamic city;
|
|
||||||
double price;
|
|
||||||
int paymentStatus;
|
|
||||||
int vehicleTypeId;
|
|
||||||
int countryId;
|
|
||||||
List<dynamic> requestProviderItem;
|
|
||||||
bool isActive;
|
|
||||||
int createdBy;
|
|
||||||
DateTime createdOn;
|
|
||||||
dynamic modifiedBy;
|
|
||||||
dynamic modifiedOn;
|
|
||||||
|
|
||||||
RequestModel({
|
|
||||||
required this.requestType,
|
|
||||||
required this.requestTypeName,
|
|
||||||
required this.requestStatusName,
|
|
||||||
required this.requestStatus,
|
|
||||||
required this.cityName,
|
|
||||||
required this.vehicleTypeName,
|
|
||||||
required this.countryName,
|
|
||||||
required this.customerName,
|
|
||||||
required this.serviceProviders,
|
|
||||||
required this.offerCount,
|
|
||||||
required this.id,
|
|
||||||
required this.customerId,
|
|
||||||
required this.customer,
|
|
||||||
required this.brand,
|
|
||||||
required this.model,
|
|
||||||
required this.year,
|
|
||||||
required this.isNew,
|
|
||||||
required this.description,
|
|
||||||
required this.requestImages,
|
|
||||||
required this.cityId,
|
|
||||||
required this.city,
|
|
||||||
required this.price,
|
|
||||||
required this.paymentStatus,
|
|
||||||
required this.vehicleTypeId,
|
|
||||||
required this.countryId,
|
|
||||||
required this.requestProviderItem,
|
|
||||||
required this.isActive,
|
|
||||||
required this.createdBy,
|
|
||||||
required this.createdOn,
|
|
||||||
required this.modifiedBy,
|
|
||||||
required this.modifiedOn,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory RequestModel.fromJson(Map<String, dynamic> json) => RequestModel(
|
|
||||||
requestType: json["requestType"],
|
|
||||||
requestTypeName: json["requestTypeName"],
|
|
||||||
requestStatusName: json["requestStatusName"],
|
|
||||||
requestStatus: (json['requestStatus'] as int).toRequestStatusEnum(),
|
|
||||||
cityName: json["cityName"],
|
|
||||||
vehicleTypeName: json["vehicleTypeName"],
|
|
||||||
countryName: json["countryName"],
|
|
||||||
customerName: json["customerName"],
|
|
||||||
serviceProviders: json["serviceProviders"],
|
|
||||||
offerCount: json["offerCount"],
|
|
||||||
id: json["id"],
|
|
||||||
customerId: json["customerID"],
|
|
||||||
customer: json["customer"],
|
|
||||||
brand: json["brand"],
|
|
||||||
model: json["model"],
|
|
||||||
year: json["year"],
|
|
||||||
isNew: json["isNew"],
|
|
||||||
description: json["description"],
|
|
||||||
requestImages: List<dynamic>.from(json["requestImages"].map((x) => x)),
|
|
||||||
cityId: json["cityID"],
|
|
||||||
city: json["city"],
|
|
||||||
price: json["price"],
|
|
||||||
paymentStatus: json["paymentStatus"],
|
|
||||||
vehicleTypeId: json["vehicleTypeID"],
|
|
||||||
countryId: json["countryID"],
|
|
||||||
requestProviderItem: List<dynamic>.from(json["requestProviderItem"].map((x) => x)),
|
|
||||||
isActive: json["isActive"],
|
|
||||||
createdBy: json["createdBy"],
|
|
||||||
createdOn: DateTime.parse(json["createdOn"]),
|
|
||||||
modifiedBy: json["modifiedBy"],
|
|
||||||
modifiedOn: json["modifiedOn"],
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
|
||||||
"requestType": requestType,
|
|
||||||
"requestTypeName": requestTypeName,
|
|
||||||
"requestStatusName": requestStatusName,
|
|
||||||
"requestStatus": requestStatus,
|
|
||||||
"cityName": cityName,
|
|
||||||
"vehicleTypeName": vehicleTypeName,
|
|
||||||
"countryName": countryName,
|
|
||||||
"customerName": customerName,
|
|
||||||
"serviceProviders": serviceProviders,
|
|
||||||
"offerCount": offerCount,
|
|
||||||
"id": id,
|
|
||||||
"customerID": customerId,
|
|
||||||
"customer": customer,
|
|
||||||
"brand": brand,
|
|
||||||
"model": model,
|
|
||||||
"year": year,
|
|
||||||
"isNew": isNew,
|
|
||||||
"description": description,
|
|
||||||
"requestImages": List<dynamic>.from(requestImages.map((x) => x)),
|
|
||||||
"cityID": cityId,
|
|
||||||
"city": city,
|
|
||||||
"price": price,
|
|
||||||
"paymentStatus": paymentStatus,
|
|
||||||
"vehicleTypeID": vehicleTypeId,
|
|
||||||
"countryID": countryId,
|
|
||||||
"requestProviderItem": List<dynamic>.from(requestProviderItem.map((x) => x)),
|
|
||||||
"isActive": isActive,
|
|
||||||
"createdBy": createdBy,
|
|
||||||
"createdOn": createdOn.toIso8601String(),
|
|
||||||
"modifiedBy": modifiedBy,
|
|
||||||
"modifiedOn": modifiedOn,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
class OffersUnreadChatModel {
|
||||||
|
final int reqTotal;
|
||||||
|
final List<OffersUnreadChatDataModel> reqChatUnread;
|
||||||
|
|
||||||
|
OffersUnreadChatModel({
|
||||||
|
required this.reqTotal,
|
||||||
|
required this.reqChatUnread,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory OffersUnreadChatModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
return OffersUnreadChatModel(
|
||||||
|
reqTotal: json['total'],
|
||||||
|
reqChatUnread: (json['reqChatCountData'] as List).map((e) => OffersUnreadChatDataModel.fromJson(e)).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OffersUnreadChatDataModel {
|
||||||
|
String reqTitle;
|
||||||
|
int reqTotal;
|
||||||
|
int requestID;
|
||||||
|
String senderUserID;
|
||||||
|
int unreadMessagesCount;
|
||||||
|
String lastChatTime;
|
||||||
|
String lastChatText;
|
||||||
|
String customerName;
|
||||||
|
|
||||||
|
OffersUnreadChatDataModel({
|
||||||
|
required this.reqTitle,
|
||||||
|
required this.reqTotal,
|
||||||
|
required this.requestID,
|
||||||
|
required this.senderUserID,
|
||||||
|
required this.unreadMessagesCount,
|
||||||
|
required this.lastChatTime,
|
||||||
|
required this.lastChatText,
|
||||||
|
required this.customerName,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory OffersUnreadChatDataModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
return OffersUnreadChatDataModel(
|
||||||
|
reqTitle: json['reqTitle'],
|
||||||
|
reqTotal: json['reqTotal'],
|
||||||
|
requestID: json['requestID'],
|
||||||
|
senderUserID: json['senderUserID'],
|
||||||
|
unreadMessagesCount: json['unreadMessagesCount'],
|
||||||
|
lastChatTime: json['lastChatTime'],
|
||||||
|
lastChatText: json['lastChatText'],
|
||||||
|
customerName: json['customerName'],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// "reqTitle": "Spare_Parts / Ford / Edge / 2016",
|
||||||
|
// I/flutter (16941): │ "reqTotal": 1,
|
||||||
|
// I/flutter (16941): │ "requestID": 145,
|
||||||
|
// I/flutter (16941): │ "senderUserID": "b56bc6bd-e45c-4644-b7c4-08dd02460895",
|
||||||
|
// I/flutter (16941): │ "unreadMessagesCount": 0,
|
||||||
|
// I/flutter (16941): │ "lastChatTime": "2025-02-12T10:33:42.1433333",
|
||||||
|
// I/flutter (16941): │ "lastChatText": "I am accepting this offer.",
|
||||||
|
// I/flutter (16941): │ "customerName": "Faiz 100"
|
||||||
@ -0,0 +1,112 @@
|
|||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/main.dart';
|
||||||
|
import 'package:mc_common_app/models/chat_models/chat_message_model.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
|
||||||
|
class ProviderOffersModel {
|
||||||
|
int? id;
|
||||||
|
int? customerID;
|
||||||
|
int? requestType;
|
||||||
|
int? requestStatus;
|
||||||
|
String? brand;
|
||||||
|
String? model;
|
||||||
|
int? year;
|
||||||
|
bool? isNew;
|
||||||
|
String? description;
|
||||||
|
double? price;
|
||||||
|
int? spOfferCount;
|
||||||
|
List<ServiceProvidersOffers>? serviceProviders;
|
||||||
|
|
||||||
|
ProviderOffersModel({
|
||||||
|
this.id,
|
||||||
|
this.customerID,
|
||||||
|
this.requestType,
|
||||||
|
this.requestStatus,
|
||||||
|
this.brand,
|
||||||
|
this.model,
|
||||||
|
this.year,
|
||||||
|
this.isNew,
|
||||||
|
this.description,
|
||||||
|
this.price,
|
||||||
|
this.spOfferCount,
|
||||||
|
this.serviceProviders,
|
||||||
|
});
|
||||||
|
|
||||||
|
ProviderOffersModel.fromJson(Map<String, dynamic> json, int? reqId) {
|
||||||
|
id = json['id'];
|
||||||
|
customerID = json['customerID'];
|
||||||
|
requestType = json['requestType'];
|
||||||
|
requestStatus = json['requestStatus'];
|
||||||
|
brand = json['brand'];
|
||||||
|
model = json['model'];
|
||||||
|
year = json['year'];
|
||||||
|
isNew = json['isNew'];
|
||||||
|
description = json['description'];
|
||||||
|
price = json['price'];
|
||||||
|
spOfferCount = json['spOfferCount'];
|
||||||
|
if (json['serviceProviders'] != null) {
|
||||||
|
serviceProviders = <ServiceProvidersOffers>[];
|
||||||
|
json['serviceProviders'].forEach((v) {
|
||||||
|
serviceProviders!.add(ServiceProvidersOffers.fromJson(v, reqId));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ServiceProvidersOffers {
|
||||||
|
String? providerUserId;
|
||||||
|
int? providerId;
|
||||||
|
String? name;
|
||||||
|
String? mobileNo;
|
||||||
|
String? email;
|
||||||
|
String? companyName;
|
||||||
|
String? createdOn;
|
||||||
|
RequestOfferStatusEnum? requestOfferStatusEnum;
|
||||||
|
int? offerCount;
|
||||||
|
int? requestId;
|
||||||
|
String? providerAddress;
|
||||||
|
String? providerLatitude;
|
||||||
|
String? providerLongitude;
|
||||||
|
List<ChatMessageModel>? chatMessages;
|
||||||
|
|
||||||
|
ServiceProvidersOffers({
|
||||||
|
this.providerId,
|
||||||
|
this.name,
|
||||||
|
this.mobileNo,
|
||||||
|
this.email,
|
||||||
|
this.companyName,
|
||||||
|
this.offerCount,
|
||||||
|
this.requestId,
|
||||||
|
this.chatMessages,
|
||||||
|
this.providerUserId,
|
||||||
|
this.createdOn,
|
||||||
|
this.requestOfferStatusEnum,
|
||||||
|
this.providerAddress,
|
||||||
|
this.providerLatitude,
|
||||||
|
this.providerLongitude,
|
||||||
|
});
|
||||||
|
|
||||||
|
ServiceProvidersOffers.fromJson(Map<String, dynamic> json, int? reqId) {
|
||||||
|
providerId = json['providerID'];
|
||||||
|
providerUserId = json['providerUserID'];
|
||||||
|
name = json['name'];
|
||||||
|
mobileNo = json['mobileNo'];
|
||||||
|
email = json['email'];
|
||||||
|
companyName = json['companyName'];
|
||||||
|
offerCount = json['offerCount'];
|
||||||
|
requestId = reqId;
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
requestOfferStatusEnum = ((json['offerStatusLast']) as int).toRequestOfferStatusEnum();
|
||||||
|
providerAddress = json['address'] ?? "";
|
||||||
|
providerLatitude = json['latititude'] ?? "0.0";
|
||||||
|
providerLongitude = json['langitude'] ?? "0.0";
|
||||||
|
chatMessages = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'ServiceProvidersOffers{providerUserId: $providerUserId, providerId: $providerId, name: $name, mobileNo: $mobileNo, email: $email, companyName: $companyName,offeredItemCreatedOn: $createdOn, requestOfferStatusEnum: $requestOfferStatusEnum, offerCount: $offerCount, chatMessages: $chatMessages}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,158 @@
|
|||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
|
||||||
|
class ProviderOffersChatsModel {
|
||||||
|
int? id;
|
||||||
|
int? requestID;
|
||||||
|
int? serviceProviderID;
|
||||||
|
ServiceProviderModel? serviceProvider;
|
||||||
|
int? offerStatus;
|
||||||
|
RequestOfferStatusEnum? requestOfferStatusEnum;
|
||||||
|
String? offerStatusText;
|
||||||
|
String? comment;
|
||||||
|
String? customerName;
|
||||||
|
double? price;
|
||||||
|
String? serviceItem;
|
||||||
|
String? offeredItemCreatedBy;
|
||||||
|
String? offeredItemCreatedByName;
|
||||||
|
String? offeredItemCreatedOn;
|
||||||
|
String? reqOfferImages;
|
||||||
|
bool? isDeliveryAvailable;
|
||||||
|
String? createdOn;
|
||||||
|
|
||||||
|
ProviderOffersChatsModel({
|
||||||
|
this.id,
|
||||||
|
this.requestID,
|
||||||
|
this.serviceProviderID,
|
||||||
|
this.serviceProvider,
|
||||||
|
this.offerStatus,
|
||||||
|
this.requestOfferStatusEnum,
|
||||||
|
this.offerStatusText,
|
||||||
|
this.comment,
|
||||||
|
this.customerName,
|
||||||
|
this.price,
|
||||||
|
this.serviceItem,
|
||||||
|
this.offeredItemCreatedBy,
|
||||||
|
this.offeredItemCreatedByName,
|
||||||
|
this.offeredItemCreatedOn,
|
||||||
|
this.reqOfferImages,
|
||||||
|
this.isDeliveryAvailable,
|
||||||
|
this.createdOn,
|
||||||
|
});
|
||||||
|
|
||||||
|
ProviderOffersChatsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
requestID = json['requestID'];
|
||||||
|
serviceProviderID = json['serviceProviderID'];
|
||||||
|
serviceProvider = json['serviceProvider'] != null ? ServiceProviderModel.fromJson(json['serviceProvider']) : null;
|
||||||
|
offerStatus = json['offerStatus'];
|
||||||
|
requestOfferStatusEnum = ((json['offerStatus']) as int).toRequestOfferStatusEnum();
|
||||||
|
offerStatusText = json['offerStatusText'];
|
||||||
|
comment = json['comment'];
|
||||||
|
customerName = json['customerName'];
|
||||||
|
price = json['price'];
|
||||||
|
serviceItem = json['serviceItem'];
|
||||||
|
offeredItemCreatedBy = json['offeredItemCreatedBy'];
|
||||||
|
offeredItemCreatedByName = json['offeredItemCreatedByName'];
|
||||||
|
offeredItemCreatedOn = json['offeredItemCreatedOn'];
|
||||||
|
reqOfferImages = json['reqOfferImages'];
|
||||||
|
isDeliveryAvailable = json['isDeliveryAvailable'];
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ServiceProviderModel {
|
||||||
|
int? providerId;
|
||||||
|
String? providerGUID;
|
||||||
|
String? firstName;
|
||||||
|
String? lastName;
|
||||||
|
String? name;
|
||||||
|
int? gender;
|
||||||
|
String? genderName;
|
||||||
|
String? mobileNo;
|
||||||
|
String? email;
|
||||||
|
bool? isEmailVerified;
|
||||||
|
bool? isCompleted;
|
||||||
|
int? city;
|
||||||
|
String? cityName;
|
||||||
|
int? country;
|
||||||
|
String? countryName;
|
||||||
|
int? accountStatus;
|
||||||
|
String? accountStatusText;
|
||||||
|
int? activityStatus;
|
||||||
|
String? activityStatusText;
|
||||||
|
String? bankName;
|
||||||
|
String? iBanNo;
|
||||||
|
bool? isActive;
|
||||||
|
String? subscriptionDate;
|
||||||
|
String? createdOn;
|
||||||
|
String? companyName;
|
||||||
|
String? currency;
|
||||||
|
String? branch;
|
||||||
|
bool? isChatted;
|
||||||
|
bool? isDealership;
|
||||||
|
|
||||||
|
ServiceProviderModel({
|
||||||
|
this.providerId,
|
||||||
|
this.providerGUID,
|
||||||
|
this.firstName,
|
||||||
|
this.lastName,
|
||||||
|
this.name,
|
||||||
|
this.gender,
|
||||||
|
this.genderName,
|
||||||
|
this.mobileNo,
|
||||||
|
this.email,
|
||||||
|
this.isEmailVerified,
|
||||||
|
this.isCompleted,
|
||||||
|
this.city,
|
||||||
|
this.cityName,
|
||||||
|
this.country,
|
||||||
|
this.countryName,
|
||||||
|
this.accountStatus,
|
||||||
|
this.accountStatusText,
|
||||||
|
this.activityStatus,
|
||||||
|
this.activityStatusText,
|
||||||
|
this.bankName,
|
||||||
|
this.iBanNo,
|
||||||
|
this.isActive,
|
||||||
|
this.subscriptionDate,
|
||||||
|
this.createdOn,
|
||||||
|
this.companyName,
|
||||||
|
this.currency,
|
||||||
|
this.branch,
|
||||||
|
this.isChatted,
|
||||||
|
this.isDealership,
|
||||||
|
});
|
||||||
|
|
||||||
|
ServiceProviderModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
providerId = json['providerId'];
|
||||||
|
providerGUID = json['providerGUID'];
|
||||||
|
firstName = json['firstName'];
|
||||||
|
lastName = json['lastName'];
|
||||||
|
name = json['name'];
|
||||||
|
gender = json['gender'];
|
||||||
|
genderName = json['genderName'];
|
||||||
|
mobileNo = json['mobileNo'];
|
||||||
|
email = json['email'];
|
||||||
|
isEmailVerified = json['isEmailVerfied'];
|
||||||
|
isCompleted = json['isCompleted'];
|
||||||
|
city = json['city'];
|
||||||
|
cityName = json['cityName'];
|
||||||
|
country = json['country'];
|
||||||
|
countryName = json['countryName'];
|
||||||
|
accountStatus = json['accountStatus'];
|
||||||
|
accountStatusText = json['accountStatusText'];
|
||||||
|
activityStatus = json['activityStatus'];
|
||||||
|
activityStatusText = json['activityStatusText'];
|
||||||
|
bankName = json['bankName'];
|
||||||
|
iBanNo = json['iBanNo'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
subscriptionDate = json['subscriptionDate'];
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
companyName = json['companyName'];
|
||||||
|
currency = json['currency'];
|
||||||
|
branch = json['branch'];
|
||||||
|
isChatted = json['isChatted'];
|
||||||
|
isDealership = json['isDealership'];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,154 @@
|
|||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart';
|
||||||
|
import 'package:mc_common_app/models/chat_models/chat_message_model.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
|
||||||
|
class RequestModel {
|
||||||
|
int requestType;
|
||||||
|
String requestTypeName;
|
||||||
|
String requestStatusName;
|
||||||
|
RequestStatusEnum requestStatus;
|
||||||
|
int? shippingStatus;
|
||||||
|
ShippingRequestStatusEnum? shippingStatusEnum;
|
||||||
|
SelfPickupRequestStatusEnum? selfPickupRequestStatusEnum;
|
||||||
|
String cityName;
|
||||||
|
String vehicleTypeName;
|
||||||
|
String countryName;
|
||||||
|
String customerName;
|
||||||
|
String customerID;
|
||||||
|
String address;
|
||||||
|
String additionalAddressDetails;
|
||||||
|
dynamic serviceProviders;
|
||||||
|
int offerCount;
|
||||||
|
int id;
|
||||||
|
int customerId;
|
||||||
|
bool isChatted;
|
||||||
|
bool isOfferAccepted;
|
||||||
|
RequestDeliveryOptionEnum offerDeliveryOption;
|
||||||
|
RequestDeliveryOptionEnum selectedDeliveryOptionByCustomer;
|
||||||
|
String customerUserID;
|
||||||
|
dynamic customer;
|
||||||
|
String brand;
|
||||||
|
String model;
|
||||||
|
int year;
|
||||||
|
bool isNew;
|
||||||
|
String description;
|
||||||
|
List<GenericImageModel>? requestImages;
|
||||||
|
int cityId;
|
||||||
|
dynamic city;
|
||||||
|
double price;
|
||||||
|
int paymentStatus;
|
||||||
|
int vehicleTypeId;
|
||||||
|
int countryId;
|
||||||
|
List<dynamic> requestProviderItem;
|
||||||
|
bool isActive;
|
||||||
|
int createdBy;
|
||||||
|
String? createdOn;
|
||||||
|
int? modifiedBy;
|
||||||
|
String? modifiedOn;
|
||||||
|
List<ChatMessageModel> chatMessages;
|
||||||
|
|
||||||
|
RequestModel({
|
||||||
|
required this.requestType,
|
||||||
|
required this.requestTypeName,
|
||||||
|
required this.requestStatusName,
|
||||||
|
required this.requestStatus,
|
||||||
|
required this.shippingStatus,
|
||||||
|
required this.shippingStatusEnum,
|
||||||
|
required this.selfPickupRequestStatusEnum,
|
||||||
|
required this.cityName,
|
||||||
|
required this.vehicleTypeName,
|
||||||
|
required this.countryName,
|
||||||
|
required this.customerName,
|
||||||
|
required this.customerID,
|
||||||
|
required this.serviceProviders,
|
||||||
|
required this.offerCount,
|
||||||
|
required this.id,
|
||||||
|
required this.customerId,
|
||||||
|
required this.isChatted,
|
||||||
|
required this.isOfferAccepted,
|
||||||
|
required this.offerDeliveryOption,
|
||||||
|
required this.selectedDeliveryOptionByCustomer,
|
||||||
|
required this.customerUserID,
|
||||||
|
required this.customer,
|
||||||
|
required this.address,
|
||||||
|
required this.additionalAddressDetails,
|
||||||
|
required this.brand,
|
||||||
|
required this.model,
|
||||||
|
required this.year,
|
||||||
|
required this.isNew,
|
||||||
|
required this.description,
|
||||||
|
required this.requestImages,
|
||||||
|
required this.cityId,
|
||||||
|
required this.city,
|
||||||
|
required this.price,
|
||||||
|
required this.paymentStatus,
|
||||||
|
required this.vehicleTypeId,
|
||||||
|
required this.countryId,
|
||||||
|
required this.requestProviderItem,
|
||||||
|
required this.isActive,
|
||||||
|
required this.createdBy,
|
||||||
|
required this.createdOn,
|
||||||
|
required this.modifiedBy,
|
||||||
|
required this.modifiedOn,
|
||||||
|
required this.chatMessages,
|
||||||
|
});
|
||||||
|
|
||||||
|
List<GenericImageModel> populateRequestImages(value) {
|
||||||
|
List<GenericImageModel> images = [];
|
||||||
|
if (value != null) {
|
||||||
|
value.forEach((v) {
|
||||||
|
images.add(GenericImageModel.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return images;
|
||||||
|
}
|
||||||
|
|
||||||
|
factory RequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
return RequestModel(
|
||||||
|
requestType: json["requestType"],
|
||||||
|
requestTypeName: json["requestTypeName"],
|
||||||
|
requestStatusName: json["requestStatusName"],
|
||||||
|
requestStatus: (json['requestStatus'] as int).toRequestStatusEnum(),
|
||||||
|
shippingStatus: json['shippingRequestStatus'],
|
||||||
|
shippingStatusEnum: json['shippingRequestStatus'] != null ? (json['shippingRequestStatus'] as int).toShippingStatusEnum() : ShippingRequestStatusEnum.pending,
|
||||||
|
selfPickupRequestStatusEnum: json['selfPickupRequestStatus'] != null ? (json['selfPickupRequestStatus'] as int).toSelfPickupStatusEnum() : SelfPickupRequestStatusEnum.preparingToCollect,
|
||||||
|
cityName: json["cityName"],
|
||||||
|
vehicleTypeName: json["vehicleTypeName"],
|
||||||
|
countryName: json["countryName"],
|
||||||
|
customerName: json["customerName"] ?? "",
|
||||||
|
address: json["address"] ?? "",
|
||||||
|
additionalAddressDetails: json['additionalAddress'] ?? "",
|
||||||
|
customerID: json["customerUserID"],
|
||||||
|
serviceProviders: json["serviceProviders"],
|
||||||
|
offerCount: json["offerCount"],
|
||||||
|
id: json["id"],
|
||||||
|
customerId: json["customerID"],
|
||||||
|
isChatted: json["isChatted"],
|
||||||
|
isOfferAccepted: json["isOfferAccepted"],
|
||||||
|
offerDeliveryOption: ((json["offerDeliveryOption"] ?? 0) as int).toRequestDeliveryOptionEnum(),
|
||||||
|
selectedDeliveryOptionByCustomer: ((json["deliveryOption"] ?? 0) as int).toRequestDeliveryOptionEnum(),
|
||||||
|
customerUserID: json["customerUserID"],
|
||||||
|
customer: json["customer"],
|
||||||
|
brand: json["brand"],
|
||||||
|
model: json["model"],
|
||||||
|
year: json["year"],
|
||||||
|
isNew: json["isNew"],
|
||||||
|
description: json["description"],
|
||||||
|
requestImages: List<GenericImageModel>.from(json["requestImages"].map((x) => GenericImageModel.fromJson(x))),
|
||||||
|
cityId: json["cityID"],
|
||||||
|
city: json["city"],
|
||||||
|
price: json["price"],
|
||||||
|
paymentStatus: json["paymentStatus"],
|
||||||
|
vehicleTypeId: json["vehicleTypeID"],
|
||||||
|
countryId: json["countryID"],
|
||||||
|
requestProviderItem: List<dynamic>.from(json["requestProviderItem"].map((x) => x)),
|
||||||
|
isActive: json["isActive"],
|
||||||
|
createdBy: json["createdBy"],
|
||||||
|
createdOn: json["createdOn"],
|
||||||
|
modifiedBy: json["modifiedBy"],
|
||||||
|
modifiedOn: json["modifiedOn"],
|
||||||
|
chatMessages: [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
import 'package:mc_common_app/view_models/ad_view_model.dart';
|
||||||
|
|
||||||
|
class AppInfoModel {
|
||||||
|
int? id;
|
||||||
|
String? header;
|
||||||
|
String? content;
|
||||||
|
bool? isActive;
|
||||||
|
int? channel;
|
||||||
|
List<ImageModel>? images;
|
||||||
|
|
||||||
|
AppInfoModel({this.id, this.header, this.content, this.isActive, this.channel, this.images});
|
||||||
|
|
||||||
|
AppInfoModel.fromJson(Map<String, dynamic> json, {bool isForTermsAndCondition = false}) {
|
||||||
|
String imagesKey = "appInfoImages";
|
||||||
|
if (isForTermsAndCondition) {
|
||||||
|
imagesKey = "termAndConditionImages";
|
||||||
|
}
|
||||||
|
id = json['id'];
|
||||||
|
header = json['header'];
|
||||||
|
content = json['content'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
channel = json['channel'];
|
||||||
|
if (json[imagesKey] != null) {
|
||||||
|
images = <ImageModel>[];
|
||||||
|
json[imagesKey].forEach((v) {
|
||||||
|
images!.add(ImageModel.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
class AppInvitationHistoryModel {
|
||||||
|
int? id;
|
||||||
|
int? customerID;
|
||||||
|
int? channelID;
|
||||||
|
int? appInvitationEnumID;
|
||||||
|
int? noOfInvites;
|
||||||
|
String? comments;
|
||||||
|
|
||||||
|
AppInvitationHistoryModel({
|
||||||
|
this.id,
|
||||||
|
this.customerID,
|
||||||
|
this.channelID,
|
||||||
|
this.appInvitationEnumID,
|
||||||
|
this.noOfInvites,
|
||||||
|
this.comments,
|
||||||
|
});
|
||||||
|
|
||||||
|
AppInvitationHistoryModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
customerID = json['customerID'];
|
||||||
|
channelID = json['channelID'];
|
||||||
|
appInvitationEnumID = json['appInvitationEnumID'];
|
||||||
|
noOfInvites = json['noofInvites'];
|
||||||
|
comments = json['comments'];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
import 'package:mc_common_app/view_models/ad_view_model.dart';
|
||||||
|
|
||||||
|
class ContactInfoModel {
|
||||||
|
int? id;
|
||||||
|
String? companyName;
|
||||||
|
String? mobileNo;
|
||||||
|
String? phoneNo;
|
||||||
|
String? email;
|
||||||
|
String? address;
|
||||||
|
String? latitude;
|
||||||
|
String? longitude;
|
||||||
|
int? channel;
|
||||||
|
bool? isActive;
|
||||||
|
List<ImageModel>? contactInfoImages;
|
||||||
|
|
||||||
|
ContactInfoModel({this.id, this.companyName, this.mobileNo, this.phoneNo, this.email, this.address, this.latitude, this.longitude, this.channel, this.isActive, this.contactInfoImages});
|
||||||
|
|
||||||
|
ContactInfoModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
companyName = json['companyName'];
|
||||||
|
mobileNo = json['mobileNo'];
|
||||||
|
phoneNo = json['phoneNo'];
|
||||||
|
email = json['email'];
|
||||||
|
address = json['address'];
|
||||||
|
latitude = json['latitude'];
|
||||||
|
longitude = json['longitude'];
|
||||||
|
channel = json['channel'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
if (json['contactInfoImages'] != null) {
|
||||||
|
contactInfoImages = <ImageModel>[];
|
||||||
|
json['contactInfoImages'].forEach((v) {
|
||||||
|
contactInfoImages!.add(ImageModel.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
class FAQsModel {
|
||||||
|
int? id;
|
||||||
|
String? question;
|
||||||
|
String? answer;
|
||||||
|
int? sequenceNo;
|
||||||
|
bool? isActive;
|
||||||
|
int? channel;
|
||||||
|
bool? isCollapsed;
|
||||||
|
|
||||||
|
FAQsModel({this.id, this.question, this.answer, this.sequenceNo, this.isActive, this.channel, this.isCollapsed});
|
||||||
|
|
||||||
|
FAQsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
question = json['question'];
|
||||||
|
answer = json['answer'];
|
||||||
|
sequenceNo = json['sequenceNo'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
channel = json['channel'];
|
||||||
|
isCollapsed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['question'] = question;
|
||||||
|
data['answer'] = answer;
|
||||||
|
data['sequenceNo'] = sequenceNo;
|
||||||
|
data['isActive'] = isActive;
|
||||||
|
data['channel'] = channel;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mc_common_app/utils/enums.dart';
|
||||||
|
|
||||||
|
class ShippingRequestModel {
|
||||||
|
int? id;
|
||||||
|
int? requestID;
|
||||||
|
Request? request;
|
||||||
|
int? pickupOrshippingStatus;
|
||||||
|
ShippingRequestStatusEnum? shippingStatusEnum;
|
||||||
|
SelfPickupRequestStatusEnum? selfPickupRequestStatusEnum;
|
||||||
|
String? deliveredorCollectedOn;
|
||||||
|
String? comment;
|
||||||
|
String? createdOn;
|
||||||
|
int? customerID;
|
||||||
|
String? customerName;
|
||||||
|
int? vehicleTypeID;
|
||||||
|
String? vehicleType;
|
||||||
|
|
||||||
|
ShippingRequestModel({
|
||||||
|
this.id,
|
||||||
|
this.requestID,
|
||||||
|
this.request,
|
||||||
|
this.pickupOrshippingStatus,
|
||||||
|
this.deliveredorCollectedOn,
|
||||||
|
this.comment,
|
||||||
|
this.createdOn,
|
||||||
|
this.customerID,
|
||||||
|
this.customerName,
|
||||||
|
this.vehicleTypeID,
|
||||||
|
this.vehicleType,
|
||||||
|
});
|
||||||
|
|
||||||
|
ShippingRequestModel.fromJsonShipping(Map<String, dynamic> json, bool isForShipping) {
|
||||||
|
id = json['id'];
|
||||||
|
requestID = json['requestID'];
|
||||||
|
request = json['request'] != null ? Request.fromJson(json['request']) : null;
|
||||||
|
pickupOrshippingStatus = isForShipping ? json['shippingStatus'] : json['selfPickUpStatus'];
|
||||||
|
shippingStatusEnum = isForShipping ? (json['shippingStatus'] != null ? (json['shippingStatus'] as int).toShippingStatusEnum() : ShippingRequestStatusEnum.initiated) : null;
|
||||||
|
selfPickupRequestStatusEnum =
|
||||||
|
isForShipping ? null : (json['selfPickUpStatus'] != null ? (json['selfPickUpStatus'] as int).toSelfPickupStatusEnum() : SelfPickupRequestStatusEnum.preparingToCollect);
|
||||||
|
deliveredorCollectedOn = isForShipping ? json['deliveredOn'] : json['collectedOn'];
|
||||||
|
comment = json['comment'];
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
customerID = json['customerID'];
|
||||||
|
customerName = json['customerName'];
|
||||||
|
vehicleTypeID = json['vehicleTypeID'];
|
||||||
|
vehicleType = json['vehicleType'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Request {
|
||||||
|
int? requestType;
|
||||||
|
String? brand;
|
||||||
|
String? model;
|
||||||
|
int? year;
|
||||||
|
bool? isNew;
|
||||||
|
String? description;
|
||||||
|
double? price;
|
||||||
|
|
||||||
|
Request({this.requestType, this.brand, this.model, this.year, this.isNew, this.description, this.price});
|
||||||
|
|
||||||
|
Request.fromJson(Map<String, dynamic> json) {
|
||||||
|
requestType = json['requestType'];
|
||||||
|
brand = json['brand'];
|
||||||
|
model = json['model'];
|
||||||
|
year = json['year'];
|
||||||
|
isNew = json['isNew'];
|
||||||
|
description = json['description'];
|
||||||
|
price = json['price'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['requestType'] = requestType;
|
||||||
|
data['brand'] = brand;
|
||||||
|
data['model'] = model;
|
||||||
|
data['year'] = year;
|
||||||
|
data['isNew'] = isNew;
|
||||||
|
data['description'] = description;
|
||||||
|
data['price'] = price;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
class BranchSelectionModel {
|
||||||
|
int branchId;
|
||||||
|
String branchName;
|
||||||
|
bool isSelected;
|
||||||
|
bool isOpend;
|
||||||
|
List<UserSelectionModel> usersList;
|
||||||
|
|
||||||
|
BranchSelectionModel
|
||||||
|
|
||||||
|
({
|
||||||
|
|
||||||
|
required
|
||||||
|
|
||||||
|
this
|
||||||
|
|
||||||
|
.
|
||||||
|
branchId,
|
||||||
|
required this.branchName,
|
||||||
|
required this.isSelected,
|
||||||
|
this.isOpend = false,
|
||||||
|
required this.usersList,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
class UserSelectionModel {
|
||||||
|
int userId;
|
||||||
|
String userName;
|
||||||
|
bool isSelected;
|
||||||
|
|
||||||
|
UserSelectionModel(
|
||||||
|
{required this.userId, required this.userName, required this.isSelected});
|
||||||
|
}
|
||||||
@ -0,0 +1,98 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
class ProviderSubscriptionModel {
|
||||||
|
int? id;
|
||||||
|
int? subscriptionAppliedId;
|
||||||
|
int? serviceProviderId;
|
||||||
|
String? subscriptionName;
|
||||||
|
String? subscriptionDescription;
|
||||||
|
DateTime? dateStart;
|
||||||
|
DateTime? dateEnd;
|
||||||
|
int? branchesRemaining;
|
||||||
|
int? subUsersRemaining;
|
||||||
|
int? subscriptionID;
|
||||||
|
int? adsRemaining;
|
||||||
|
bool? isExpired;
|
||||||
|
bool? isActive;
|
||||||
|
bool? isUpgradeNow;
|
||||||
|
bool? isUpgradeLater;
|
||||||
|
bool? isTrialSubscription;
|
||||||
|
dynamic currentSubscription;
|
||||||
|
int? totalBranches;
|
||||||
|
int? totalSubUsers;
|
||||||
|
int? totalAds;
|
||||||
|
|
||||||
|
|
||||||
|
ProviderSubscriptionModel({
|
||||||
|
this.id,
|
||||||
|
this.subscriptionAppliedId,
|
||||||
|
this.serviceProviderId,
|
||||||
|
this.subscriptionName,
|
||||||
|
this.subscriptionDescription,
|
||||||
|
this.dateStart,
|
||||||
|
this.dateEnd,
|
||||||
|
this.branchesRemaining,
|
||||||
|
this.subUsersRemaining,
|
||||||
|
this.adsRemaining,
|
||||||
|
this.isExpired,
|
||||||
|
this.isActive,
|
||||||
|
this.isUpgradeNow,
|
||||||
|
this.isUpgradeLater,
|
||||||
|
this.isTrialSubscription,
|
||||||
|
this.currentSubscription,
|
||||||
|
this.subscriptionID,
|
||||||
|
this.totalAds,
|
||||||
|
this.totalBranches,
|
||||||
|
this.totalSubUsers,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory ProviderSubscriptionModel.fromRawJson(String str) => ProviderSubscriptionModel.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
String toRawJson() => json.encode(toJson());
|
||||||
|
|
||||||
|
factory ProviderSubscriptionModel.fromJson(Map<String, dynamic> json) => ProviderSubscriptionModel(
|
||||||
|
id: json["id"],
|
||||||
|
subscriptionAppliedId: json["subscriptionAppliedID"],
|
||||||
|
serviceProviderId: json["serviceProviderID"],
|
||||||
|
subscriptionID: json["subscriptionID"],
|
||||||
|
subscriptionName: json["subscriptionName"],
|
||||||
|
subscriptionDescription: json["subscriptionDescription"],
|
||||||
|
dateStart: json["dateStart"] == null ? null : DateTime.parse(json["dateStart"]),
|
||||||
|
dateEnd: json["dateEnd"] == null ? null : DateTime.parse(json["dateEnd"]),
|
||||||
|
branchesRemaining: json["branchesRemaining"],
|
||||||
|
subUsersRemaining: json["subUsersRemaining"],
|
||||||
|
adsRemaining: json["adsRemaining"],
|
||||||
|
isExpired: json["isExpired"],
|
||||||
|
isActive: json["isActive"],
|
||||||
|
isUpgradeNow: json["isUpgradeNow"],
|
||||||
|
isUpgradeLater: json["isUpgradeLater"],
|
||||||
|
isTrialSubscription: json["isTrialSubscription"],
|
||||||
|
currentSubscription: json["currentSubscription"],
|
||||||
|
totalBranches: json["totalBranches"],
|
||||||
|
totalAds: json["totalAds"],
|
||||||
|
totalSubUsers: json["totalSubUsers"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"subscriptionAppliedID": subscriptionAppliedId,
|
||||||
|
"serviceProviderID": serviceProviderId,
|
||||||
|
"subscriptionID": subscriptionID,
|
||||||
|
"subscriptionName": subscriptionName,
|
||||||
|
"subscriptionDescription": subscriptionDescription,
|
||||||
|
"dateStart": dateStart?.toIso8601String(),
|
||||||
|
"dateEnd": dateEnd?.toIso8601String(),
|
||||||
|
"branchesRemaining": branchesRemaining,
|
||||||
|
"subUsersRemaining": subUsersRemaining,
|
||||||
|
"adsRemaining": adsRemaining,
|
||||||
|
"isExpired": isExpired,
|
||||||
|
"isActive": isActive,
|
||||||
|
"isUpgradeNow": isUpgradeNow,
|
||||||
|
"isUpgradeLater": isUpgradeLater,
|
||||||
|
"isTrialSubscription": isTrialSubscription,
|
||||||
|
"currentSubscription": currentSubscription,
|
||||||
|
"totalAds": totalAds,
|
||||||
|
"totalSubUsers": totalSubUsers,
|
||||||
|
"totalBranches": totalBranches,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,128 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final subscription = subscriptionFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||||
|
|
||||||
|
import '../../utils/enums.dart';
|
||||||
|
|
||||||
|
Subscription subscriptionFromJson(String str) => Subscription.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
class SubscriptionModel {
|
||||||
|
SubscriptionModel({
|
||||||
|
this.messageStatus,
|
||||||
|
this.totalItemsCount,
|
||||||
|
this.data,
|
||||||
|
this.message,
|
||||||
|
});
|
||||||
|
|
||||||
|
int? messageStatus;
|
||||||
|
int? totalItemsCount;
|
||||||
|
List<Subscription>? data;
|
||||||
|
String? message;
|
||||||
|
|
||||||
|
factory SubscriptionModel.fromJson(Map<String, dynamic> json) => SubscriptionModel(
|
||||||
|
messageStatus: json["messageStatus"],
|
||||||
|
totalItemsCount: json["totalItemsCount"],
|
||||||
|
data: json["data"] == null ? [] : List<Subscription>.from(json["data"]!.map((x) => Subscription.fromJson(x))),
|
||||||
|
message: json["message"],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Subscription {
|
||||||
|
Subscription(
|
||||||
|
{this.id,
|
||||||
|
this.name,
|
||||||
|
this.description,
|
||||||
|
this.durationName,
|
||||||
|
this.durationDays,
|
||||||
|
this.price,
|
||||||
|
this.currency,
|
||||||
|
this.countryId,
|
||||||
|
this.countryName,
|
||||||
|
this.isSubscribed,
|
||||||
|
this.subscriptionAppliedId,
|
||||||
|
this.serviceProviderId,
|
||||||
|
this.dateStart,
|
||||||
|
this.dateEnd,
|
||||||
|
this.isExpired,
|
||||||
|
this.isActive,
|
||||||
|
this.subscriptionTypeEnum,
|
||||||
|
this.isMyCurrentPackage,
|
||||||
|
this.isRenewable,
|
||||||
|
this.subscriptionBranches,
|
||||||
|
this.subscriptionSubUsers,
|
||||||
|
this.subscriptionAds,
|
||||||
|
this.totalBranches,
|
||||||
|
this.totalSubUsers,
|
||||||
|
this.totalAds,
|
||||||
|
this.branchesRemaining,
|
||||||
|
this.subUsersRemaining,
|
||||||
|
this.subscriptionType,
|
||||||
|
this.adsRemaining});
|
||||||
|
|
||||||
|
int? id;
|
||||||
|
String? name;
|
||||||
|
String? description;
|
||||||
|
String? durationName;
|
||||||
|
int? durationDays;
|
||||||
|
double? price;
|
||||||
|
String? currency;
|
||||||
|
int? countryId;
|
||||||
|
String? countryName;
|
||||||
|
bool? isSubscribed;
|
||||||
|
int? subscriptionAppliedId;
|
||||||
|
int? serviceProviderId;
|
||||||
|
String? dateStart;
|
||||||
|
String? dateEnd;
|
||||||
|
bool? isExpired;
|
||||||
|
bool? isActive;
|
||||||
|
SubscriptionTypeEnum? subscriptionTypeEnum;
|
||||||
|
bool? isMyCurrentPackage;
|
||||||
|
bool? isRenewable;
|
||||||
|
int? subscriptionType;
|
||||||
|
|
||||||
|
int? subscriptionBranches;
|
||||||
|
int? subscriptionSubUsers;
|
||||||
|
int? subscriptionAds;
|
||||||
|
int? totalBranches;
|
||||||
|
int? totalSubUsers;
|
||||||
|
int? totalAds;
|
||||||
|
int? branchesRemaining;
|
||||||
|
int? subUsersRemaining;
|
||||||
|
int? adsRemaining;
|
||||||
|
|
||||||
|
factory Subscription.fromJson(Map<String, dynamic> json) => Subscription(
|
||||||
|
id: json["id"],
|
||||||
|
name: json["name"],
|
||||||
|
description: json["description"],
|
||||||
|
durationName: json["durationName"],
|
||||||
|
durationDays: json["durationDays"],
|
||||||
|
price: json["price"]?.toDouble(),
|
||||||
|
currency: json["currency"],
|
||||||
|
countryId: json["countryID"],
|
||||||
|
countryName: json["countryName"],
|
||||||
|
isSubscribed: json["isSubscribed"],
|
||||||
|
subscriptionAppliedId: json["subscriptionAppliedID"],
|
||||||
|
serviceProviderId: json["serviceProviderID"],
|
||||||
|
dateStart: json["dateStart"],
|
||||||
|
dateEnd: json["dateEnd"],
|
||||||
|
isExpired: json["isExpired"],
|
||||||
|
isActive: json["isActive"],
|
||||||
|
isMyCurrentPackage: false,
|
||||||
|
isRenewable: json["isRenewable"],
|
||||||
|
subscriptionTypeEnum: json["subscriptionType"] == null ? null : ((json['subscriptionType']) as int).toSubscriptionTypeEnum(),
|
||||||
|
subscriptionBranches: json["subscriptionBranches"],
|
||||||
|
subscriptionSubUsers: json["subscriptionSubUsers"],
|
||||||
|
subscriptionAds: json["subscriptionAds"],
|
||||||
|
totalBranches: json["totalBranches"],
|
||||||
|
totalSubUsers: json["totalBranches"],
|
||||||
|
totalAds: json["totalAds"],
|
||||||
|
branchesRemaining: json["branchesRemaining"],
|
||||||
|
subUsersRemaining: json["subUsersRemaining"],
|
||||||
|
adsRemaining: json["adsRemaining"],
|
||||||
|
subscriptionType: json["subscriptionType"],
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,48 +0,0 @@
|
|||||||
class BranchUser {
|
|
||||||
int id;
|
|
||||||
String? userId;
|
|
||||||
int? serviceProviderId;
|
|
||||||
int? dealershipUserID;
|
|
||||||
String firstName;
|
|
||||||
String lastName;
|
|
||||||
String mobileNo;
|
|
||||||
String email;
|
|
||||||
bool isBranchUser;
|
|
||||||
|
|
||||||
BranchUser({
|
|
||||||
required this.id,
|
|
||||||
required this.userId,
|
|
||||||
required this.serviceProviderId,
|
|
||||||
required this.dealershipUserID,
|
|
||||||
required this.firstName,
|
|
||||||
required this.lastName,
|
|
||||||
required this.mobileNo,
|
|
||||||
required this.email,
|
|
||||||
required this.isBranchUser,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory BranchUser.fromJson(Map<String, dynamic> json) =>
|
|
||||||
BranchUser(
|
|
||||||
id: json["id"],
|
|
||||||
userId: json.containsKey("userID") ? json["userID"] : null,
|
|
||||||
serviceProviderId: json.containsKey("serviceProviderID") ? json["serviceProviderID"] : null,
|
|
||||||
dealershipUserID: json.containsKey("dealershipUserID") ? json["dealershipUserID"] : null,
|
|
||||||
firstName: json["firstName"],
|
|
||||||
lastName: json["lastName"],
|
|
||||||
mobileNo: json["mobileNo"],
|
|
||||||
email: json["email"],
|
|
||||||
isBranchUser: json.containsKey("isBranchUser") ? json["isBranchUser"] : false,
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() =>
|
|
||||||
{
|
|
||||||
"id": id,
|
|
||||||
"userID": userId,
|
|
||||||
"serviceProviderID": serviceProviderId,
|
|
||||||
"firstName": firstName,
|
|
||||||
"lastName": lastName,
|
|
||||||
"mobileNo": mobileNo,
|
|
||||||
"email": email,
|
|
||||||
"isBranchUser": isBranchUser,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
class BranchUser {
|
||||||
|
int id;
|
||||||
|
String? userId;
|
||||||
|
int? serviceProviderId;
|
||||||
|
int? dealershipUserID;
|
||||||
|
String? firstName;
|
||||||
|
String? lastName;
|
||||||
|
String? mobileNo;
|
||||||
|
String? email;
|
||||||
|
bool? isBranchUser;
|
||||||
|
int? serviceProviderBranchID;
|
||||||
|
|
||||||
|
BranchUser({
|
||||||
|
required this.id,
|
||||||
|
required this.userId,
|
||||||
|
required this.serviceProviderId,
|
||||||
|
required this.dealershipUserID,
|
||||||
|
required this.firstName,
|
||||||
|
required this.lastName,
|
||||||
|
required this.mobileNo,
|
||||||
|
required this.email,
|
||||||
|
required this.isBranchUser,
|
||||||
|
this.serviceProviderBranchID,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory BranchUser.fromJson(Map<String, dynamic> json) => BranchUser(
|
||||||
|
id: json["id"],
|
||||||
|
userId: json.containsKey("userID") ? json["userID"] : null,
|
||||||
|
serviceProviderId: json.containsKey("serviceProviderID")
|
||||||
|
? json["serviceProviderID"]
|
||||||
|
: null,
|
||||||
|
dealershipUserID: json.containsKey("dealershipUserID")
|
||||||
|
? json["dealershipUserID"]
|
||||||
|
: null,
|
||||||
|
firstName: json.containsKey("firstName") ? json["firstName"] : null,
|
||||||
|
lastName: json.containsKey("lastName") ? json["lastName"] : null,
|
||||||
|
mobileNo: json.containsKey("mobileNo") ? json["mobileNo"] : null,
|
||||||
|
email: json.containsKey("email") ? json["email"] : null,
|
||||||
|
isBranchUser:
|
||||||
|
json.containsKey("isBranchUser") ? json["isBranchUser"] : false,
|
||||||
|
serviceProviderBranchID: json.containsKey("serviceProviderBranchID")
|
||||||
|
? json["serviceProviderBranchID"]
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() =>
|
||||||
|
{
|
||||||
|
"id": id,
|
||||||
|
"userID": userId,
|
||||||
|
"serviceProviderID": serviceProviderId,
|
||||||
|
"firstName": firstName,
|
||||||
|
"lastName": lastName,
|
||||||
|
"mobileNo": mobileNo,
|
||||||
|
"email": email,
|
||||||
|
"isBranchUser": isBranchUser,
|
||||||
|
};
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue