Refactor booking system: remove unused classes, update dependencies, and implement date selection logic

This commit is contained in:
mohammad
2025-07-09 16:18:10 +03:00
parent 6534bfae5b
commit 9f28e1ccef
40 changed files with 989 additions and 503 deletions

View File

@ -0,0 +1,65 @@
import 'package:syncrow_web/utils/constants/app_enum.dart';
class PasswordModel {
final dynamic passwordId;
final dynamic invalidTime;
final dynamic effectiveTime;
final dynamic passwordCreated;
final dynamic createdTime;
final dynamic passwordName;
final AccessStatus passwordStatus;
final AccessType passwordType;
final dynamic deviceUuid;
final dynamic authorizerEmail;
final dynamic authorizerDate;
final dynamic deviceName;
PasswordModel({
this.passwordId,
this.invalidTime,
this.effectiveTime,
this.passwordCreated,
this.createdTime,
this.passwordName,
required this.passwordStatus,
required this.passwordType,
this.deviceUuid,
this.authorizerEmail,
this.authorizerDate,
this.deviceName,
});
factory PasswordModel.fromJson(Map<String, dynamic> json) {
return PasswordModel(
passwordId: json['passwordId'],
invalidTime: json['invalidTime'],
effectiveTime: json['effectiveTime'],
passwordCreated: json['passwordCreated'],
createdTime: json['createdTime'],
passwordName: json['passwordName']??'No Name',
passwordStatus: AccessStatusExtension.fromString(json['passwordStatus']),
passwordType: AccessTypeExtension.fromString(json['passwordType']),
deviceUuid: json['deviceUuid'],
authorizerEmail: json['authorizerEmail'],
authorizerDate: json['authorizerDate'],
deviceName: json['deviceName'],
);
}
Map<String, dynamic> toJson() {
return {
'passwordId': passwordId,
'invalidTime': invalidTime,
'effectiveTime': effectiveTime,
'passwordCreated': passwordCreated,
'createdTime': createdTime,
'passwordName': passwordName, // New field
'passwordStatus': passwordStatus,
'passwordType': passwordType,
'deviceUuid': deviceUuid,
'authorizerEmail': authorizerEmail,
'authorizerDate': authorizerDate,
'deviceName': deviceName,
};
}
}