From e8fcaaa2a3a7242d6a079a483a7d41ccd7226840 Mon Sep 17 00:00:00 2001 From: "mirza.shafique" Date: Tue, 6 Jun 2023 11:51:42 +0300 Subject: [PATCH] service days --- lib/classes/consts.dart | 2 ++ lib/models/schedule_model.dart | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index 5c922ce..688eae5 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -65,7 +65,9 @@ class ApiConsts { static String getServicesOfBranch = "${baseUrlServices}api/ServiceProviders/ServiceProviderService_Get"; static String createSchedule = "${baseUrlServices}api/ServiceProviders/BranchAppointmentSchedule_Create"; static String getSchedule = "${baseUrlServices}api/ServiceProviders/BranchAppointmentSchedule_Get"; + static String updateSchedule = "${baseUrlServices}api/ServiceProviders/BranchAppointmentSchedule_Update"; static String createGroup = "${baseUrlServices}api/ServiceProviders/BranchScheduleGroupService_Create"; + static String updateGroup = "${baseUrlServices}api/ServiceProviders/BranchScheduleGroupService_Update"; //Advertisement APIs static String vehicleTypeGet = "${baseUrlServices}api/ServiceProviders/VehicleType_Get"; diff --git a/lib/models/schedule_model.dart b/lib/models/schedule_model.dart index 642c8d8..552d704 100644 --- a/lib/models/schedule_model.dart +++ b/lib/models/schedule_model.dart @@ -50,6 +50,7 @@ class ScheduleData { final String? address; final String? latitude; final String? longitude; + final List? weeklyOffDays; final List? scheduleServices; String branchId; @@ -67,6 +68,7 @@ class ScheduleData { this.address, this.latitude, this.longitude, + this.weeklyOffDays, this.scheduleServices, this.branchId = "", }); @@ -85,6 +87,7 @@ class ScheduleData { address: json["address"], latitude: json["latitude"], longitude: json["longitude"], + weeklyOffDays: json["weeklyOffDays"] == null ? [] : List.from(json["weeklyOffDays"]!.map((x) => WeeklyOffDay.fromJson(x))), scheduleServices: json["scheduleServices"] == null ? [] : List.from(json["scheduleServices"]!.map((x) => ScheduleService.fromJson(x))), ); @@ -125,3 +128,23 @@ class ScheduleService { "providerServiceName": providerServiceName, }; } + +class WeeklyOffDay { + final int? id; + final int? dayNumber; + + WeeklyOffDay({ + this.id, + this.dayNumber, + }); + + factory WeeklyOffDay.fromJson(Map json) => WeeklyOffDay( + id: json["id"], + dayNumber: json["dayNumber"], + ); + + Map toJson() => { + "id": id, + "dayNumber": dayNumber, + }; +}