api integration inprogress

design_3.0_asset_delivery_module
waseemabbasi22 2 months ago
parent 7291d1b4d8
commit c02fc2f1b1

@ -4,14 +4,14 @@ class URLs {
static const String appReleaseBuildNumber = "28";
// static const host1 = "https://atomsm.hmg.com"; // production url
// static const host1 = "https://atomsmdev.hmg.com"; // local DEV url
static const host1 = "https://atomsmuat.hmg.com"; // local UAT url
static const host1 = "https://atomsmdev.hmg.com"; // local DEV url
// static const host1 = "https://atomsmuat.hmg.com"; // local UAT url
// static const host1 = "http://10.201.111.125:9495"; // temporary Server UAT url
// static String _baseUrl = "$_host/mobile";
// static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
static final String _baseUrl = "$_host/v4/mobile"; // for asset inventory on UAT
static final String _baseUrl = "$_host/v2/mobile"; // new V2 apis
// static final String _baseUrl = "$_host/v4/mobile"; // for asset inventory on UAT
// static final String _baseUrl = "$_host/mobile"; // host local UAT
// static final String _baseUrl = "$_host/v3/mobile"; // v3 for production CM,PM,TM
// static final String _baseUrl = "$_host/v5/mobile"; // v5 for data segregation

@ -40,22 +40,59 @@ class LoanFormModel {
this.department,
});
//{
// "id": 0,
// "employeeId": "fa29a9de-1337-4729-b823-68c6ecffdd33",
// "requestorUserID": "fa29a9de-1337-4729-b823-68c6ecffdd33",
// "employeeName": "engineer-dev",
// "employeeEmail": "Engineer_Dev@yahoo.com",
// "positionName": "High",
// "requesterExtensionNumber": "7726",
// "requesterContactNumber": "72132197",
// "siteId": 1,
// "departmentId": 5,
// "loanTypeId": 6448,
// "doctorName": "Doctor A",
// "doctorContact": "0561432451",
// "doctorEmail": "doctor@test.com",
// "itemDescription": "Test item",
// "requestDescription": "Test request",
// "loanPeriodId": 6453,
// "assetId": null,
// "assetNumber": "",
// "assetName": "",
// "assetSerialNumber": "",
// "model": "Model A",
// "manufacturer": "Siemens",
// "vendorName": "Vendor A",
// "vendorRepName": "Vendor Rep A",
// "vendorContact": "0561432455",
// "vendorEmail": "vendor@test.com",
// "loanStatusId": 1,
// "loanAttachments": [],
// "submittedAt": "2025-11-13T12:11:12.673Z",
// "updatedAt": null,
// "cMWOItemId": null
// }
Map<String, dynamic> toJson() {
return {
"docName": docName,
"docNumber": docNumber,
"docEmail": docEmail,
"doctorName": docName,
"doctorContact": docNumber,
"doctorEmail": docEmail,
"itemDescription": itemDescription,
"requestDescription": requestDescription,
"model": model,
"manufacturer": manufacturer,
"loanProvided": loanProvided?.toJson(),
"loanPeriodId": loanProvided?.id,
"vendorName": vendorName,
"vendorRepresentativeName": vendorRepresentativeName,
"vendorNumber": vendorNumber,
"vendorEmail": vendorEmail,
'site' : site?.toJson(),
"loanAttachment": loanAttachment != null ? loanAttachment!.map((v) => v.toJson()).toList() : [],
'siteId' : site?.id,
'departmentId' : department?.id,
"loanAttachments": loanAttachment != null ? loanAttachment!.map((v) => v.toJson()).toList() : [],
};
}
}

@ -68,7 +68,7 @@ class _CreateLoanRequestViewState extends State<CreateLoanRequestView> with Tick
void initState() {
// TODO: implement initState
super.initState();
Provider.of<TaskTypeProvider>(context, listen: false).reset();
Provider.of<MedicalDepartmentProvider>(context, listen: false).reset();
}
@override
@ -218,6 +218,7 @@ class _CreateLoanRequestViewState extends State<CreateLoanRequestView> with Tick
showShadow: false,
showAsBottomSheet: true,
initialValue: _loanFormModel.department,
requestById: context.userProvider.user?.clientId,
backgroundColor: AppColor.fieldBgColor(context),
onSelect: (value) {
_loanFormModel.department = value;

@ -8,7 +8,7 @@ import 'package:test_sa/providers/loading_list_notifier.dart';
class LoanPeriodProvider extends LoadingListNotifier<Lookup> {
@override
Future getData() async {
Future getData({int?id}) async {
if (loading == true) return -2;
loading = true;
notifyListeners();

Loading…
Cancel
Save