added identifier for loan creation department to match the department with cm request

cleaner_module_new_flow
WaseemAbbasi22 2 weeks ago
parent d6f2d78351
commit 6cad1866e7

@ -3,9 +3,9 @@ import 'package:test_sa/models/new_models/room_model.dart';
import '../base.dart'; import '../base.dart';
class TrafDepartment extends Base { class TrafDepartment extends Base {
TrafDepartment({ TrafDepartment(
this.departmentName, this.departmentCode, this.ntCode, this.costCenterNumber, this.costCenterName, this.name, this.id, this.createdBy, this.createdDate, this.modifiedBy, this.modifiedDate {this.departmentName, this.departmentCode, this.ntCode, this.costCenterNumber, this.costCenterName, this.name, this.id, this.createdBy, this.createdDate, this.modifiedBy, this.modifiedDate})
}) : super(identifier: id?.toString() ?? '', name: departmentName); // Handle potential null id : super(identifier: id?.toString() ?? '', name: departmentName); // Handle potential null id
TrafDepartment.fromJson(Map<String, dynamic> json) { TrafDepartment.fromJson(Map<String, dynamic> json) {
departmentName = json['departmentName'] ?? json['name']; departmentName = json['departmentName'] ?? json['name'];
@ -15,6 +15,7 @@ class TrafDepartment extends Base {
costCenterName = json['costCenterName']; costCenterName = json['costCenterName'];
name = json['name']; name = json['name'];
id = json['id']; id = json['id'];
identifier = id?.toString() ?? '';
createdBy = json['createdBy']; createdBy = json['createdBy'];
createdDate = json['createdDate']; createdDate = json['createdDate'];
modifiedBy = json['modifiedBy']; modifiedBy = json['modifiedBy'];
@ -49,8 +50,6 @@ class TrafDepartment extends Base {
// ntCode: ntCode ?? this.ntCode, // ntCode: ntCode ?? this.ntCode,
// rooms: rooms ?? this.rooms, // rooms: rooms ?? this.rooms,
// ); // );
} }
// class TrafDepartment extends Base { // class TrafDepartment extends Base {

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:test_sa/controllers/validator/validator.dart'; import 'package:test_sa/controllers/validator/validator.dart';
import 'package:test_sa/extensions/context_extension.dart'; import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/enum_extensions.dart';
import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/string_extensions.dart'; import 'package:test_sa/extensions/string_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart';
@ -315,6 +316,7 @@ class _CreateLoanRequestPageState extends State<CreateLoanRequestPage> with Tick
SingleItemDropDownMenu<TrafDepartment, DepartmentLookupProvider>( SingleItemDropDownMenu<TrafDepartment, DepartmentLookupProvider>(
context: context, context: context,
title: context.translation.department, title: context.translation.department,
matchBy: DropDownMatchType.identifier,
showShadow: false, showShadow: false,
enabled: !isBackUpRequest, enabled: !isBackUpRequest,
validator: (value) { validator: (value) {

Loading…
Cancel
Save