Skip to content

Commit

Permalink
Merge pull request #48 from canopas/Mayank/cotnact-support
Browse files Browse the repository at this point in the history
Add Contact support
  • Loading branch information
cp-mayank authored Jun 20, 2024
2 parents 96f77fe + 84656aa commit 4e6ed25
Show file tree
Hide file tree
Showing 19 changed files with 1,380 additions and 4 deletions.
40 changes: 40 additions & 0 deletions data/lib/api/support/support_models.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import 'package:freezed_annotation/freezed_annotation.dart';

part 'support_models.freezed.dart';

part 'support_models.g.dart';

@freezed
class AddSupportCaseRequest with _$AddSupportCaseRequest {
const factory AddSupportCaseRequest({
String? id,
required String title,
String? description,
@Default([]) List<String> attachmentUrls,
required String userId,
required DateTime createdAt,
}) = _AddSupportCaseRequest;

factory AddSupportCaseRequest.fromJson(Map<String, dynamic> json) =>
_$AddSupportCaseRequestFromJson(json);
}

enum AttachmentUploadStatus {
uploading,
uploaded;

bool get isUploading => this == uploading;

bool get isUploaded => this == uploaded;
}

@freezed
class Attachment with _$Attachment {
const factory Attachment({
required String path,
String? url,
@Default('') String name,
@Default(AttachmentUploadStatus.uploading)
AttachmentUploadStatus uploadStatus,
}) = _Attachment;
}
Loading

0 comments on commit 4e6ed25

Please sign in to comment.