@ -75,6 +75,8 @@ abstract class BranchRepo {
Future < GenericRespModel > updateServiceStatus ( { required int branchId , required List < int > serviceIds , required ServiceStatusEnum serviceStatusEnum } ) ;
Future < GenericRespModel > updateCategoryStatus ( { required int branchId , required int categoryId , required ServiceStatusEnum serviceStatusEnum } ) ;
Future < List < AppointmentBasicDetailsModel > > getAppointmentsByCategoryOrService ( { required int branchId , required int serviceId } ) ;
Future < GenericRespModel > getMatchedServices ( int oldBranchId , int newBranchId , int categoryId ) ;
@ -236,7 +238,7 @@ class BranchRepoImp implements BranchRepo {
GenericRespModel adsGenericModel = await apiClient . getJsonForObject (
token: t ,
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . serviceProviderDDLGet ,
) ;
List < ProviderBasicDataModel > providersList = List . generate ( adsGenericModel . data . length , ( index ) = > ProviderBasicDataModel . fromJson ( adsGenericModel . data [ index ] ) ) ;
@ -268,8 +270,7 @@ class BranchRepoImp implements BranchRepo {
serviceProviderBranchImages . add ( imageMap ) ;
}
String lat = " 0 " ,
long = " 0 " ;
String lat = " 0 " , long = " 0 " ;
try {
lat = latitude . toString ( ) . substring ( 0 , 9 ) ;
long = longitude . toString ( ) . substring ( 0 , 9 ) ;
@ -332,6 +333,19 @@ class BranchRepoImp implements BranchRepo {
return await apiClient . getJsonForObject ( ( json ) = > GenericRespModel . fromJson ( json ) , ApiConsts . serviceProviderServiceStatusUpdate , queryParameters: map , token: t ) ;
}
@ override
Future < GenericRespModel > updateCategoryStatus ( { required int branchId , required int categoryId , required ServiceStatusEnum serviceStatusEnum } ) async {
int providerID = AppState ( ) . getUser . data ! . userInfo ! . providerId ;
var map = {
" ServiceProviderID " : providerID . toString ( ) ,
" ProviderBranchID " : branchId . toString ( ) ,
" ServiceCategoryID " : categoryId . toString ( ) ,
" Status " : serviceStatusEnum . getIdFromServiceStatusEnum ( ) . toString ( ) ,
} ;
String t = AppState ( ) . getUser . data ! . accessToken ? ? " " ;
return await apiClient . getJsonForObject ( ( json ) = > GenericRespModel . fromJson ( json ) , ApiConsts . serviceProviderServiceStatusUpdate , queryParameters: map , token: t ) ;
}
@ override
Future < List < AppointmentBasicDetailsModel > > getAppointmentsByCategoryOrService ( { required int branchId , required int serviceId } ) async {
var map = {
@ -341,7 +355,7 @@ class BranchRepoImp implements BranchRepo {
String t = AppState ( ) . getUser . data ! . accessToken ? ? " " ;
GenericRespModel genericRespModel = await apiClient . getJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . serviceProviderAppointmentGetByCategoryOrService ,
queryParameters: map ,
token: t ,
@ -416,7 +430,7 @@ class BranchRepoImp implements BranchRepo {
String t = AppState ( ) . getUser . data ! . accessToken ? ? " " ;
GenericRespModel adsGenericModel = await apiClient . getJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . getAllNearBranches ,
token: appState . getUser . data ! . accessToken ,
queryParameters: queryParameters ,
@ -444,7 +458,7 @@ class BranchRepoImp implements BranchRepo {
" longitude " : longitude . toString ( ) ,
} ;
GenericRespModel adsGenericModel = await apiClient . getJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . getAllNearBranches ,
token: appState . getUser . data ! . accessToken ,
queryParameters: queryParameters ,
@ -456,7 +470,7 @@ class BranchRepoImp implements BranchRepo {
@ override
Future < List < BranchDetailModel > > getMyRecentBranchesWithServices ( ) async {
GenericRespModel adsGenericModel = await apiClient . getJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . getMyRecentBranches ,
token: appState . getUser . data ! . accessToken ,
) ;
@ -471,7 +485,7 @@ class BranchRepoImp implements BranchRepo {
} ;
GenericRespModel adsGenericModel = await apiClient . getJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . getServiceItems ,
token: appState . getUser . data ! . accessToken ,
queryParameters: serviceId . toString ( ) ! = " -1 " ? queryParameters : null ,
@ -491,7 +505,7 @@ class BranchRepoImp implements BranchRepo {
postParams . addAll ( { " Latitude " : " $ latitude " } ) ;
}
GenericRespModel adsGenericModel =
await apiClient . getJsonForObject ( ( json ) = > GenericRespModel . fromJson ( json ) , ApiConsts . branchesAndServices , token: appState . getUser . data ! . accessToken , queryParameters: postParams ) ;
await apiClient . getJsonForObject ( ( json ) = > GenericRespModel . fromJson ( json ) , ApiConsts . branchesAndServices , token: appState . getUser . data ! . accessToken , queryParameters: postParams ) ;
return ProviderProfileModel . fromJson ( adsGenericModel . data ) ;
}
@ -536,7 +550,7 @@ class BranchRepoImp implements BranchRepo {
} ;
GenericRespModel adsGenericModel = await apiClient . getJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . getAllNearBranches ,
token: appState . getUser . data ! . accessToken ,
queryParameters: postParams ,
@ -550,7 +564,7 @@ class BranchRepoImp implements BranchRepo {
var postParams = { " ServiceProviderBranchID " : serviceProviderBranchID . toString ( ) } ;
GenericRespModel adsGenericModel = await apiClient . getJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . getBranchRatings ,
token: appState . getUser . data ! . accessToken ,
queryParameters: postParams ,
@ -564,7 +578,7 @@ class BranchRepoImp implements BranchRepo {
final customerID = appState . getUser . data ! . userInfo ! . customerId ;
final parameters = { " title " : title , " review " : review , " ratNo " : ratingNo , " serviceProviderBranchID " : serviceProviderBranchID , " customerID " : " $ customerID " } ;
GenericRespModel adsGenericModel = await apiClient . postJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . createBranchRatings ,
parameters ,
token: appState . getUser . data ! . accessToken ,
@ -580,7 +594,7 @@ class BranchRepoImp implements BranchRepo {
" customerID " : customerID . toString ( ) ,
} ;
GenericRespModel adsGenericModel = await apiClient . postJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . favouriteServiceProviderCreate ,
parameters ,
token: appState . getUser . data ! . accessToken ,
@ -592,7 +606,7 @@ class BranchRepoImp implements BranchRepo {
Future < GenericRespModel > removeProviderFromFavourite ( { required int providerID } ) async {
final parameters = { " id " : providerID . toString ( ) } ;
GenericRespModel adsGenericModel = await apiClient . postJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . unFavouriteServiceProvider ,
parameters ,
token: appState . getUser . data ! . accessToken ,
@ -607,7 +621,7 @@ class BranchRepoImp implements BranchRepo {
var postParams = { " customerID " : customerID . toString ( ) } ;
GenericRespModel adsGenericModel = await apiClient . getJsonForObject (
( json ) = > GenericRespModel . fromJson ( json ) ,
( json ) = > GenericRespModel . fromJson ( json ) ,
ApiConsts . favouriteServiceProviderGet ,
token: appState . getUser . data ! . accessToken ,
queryParameters: postParams ,