From 39a3d511a31a931c19aa171eae8e4bdd320abc10 Mon Sep 17 00:00:00 2001 From: Kosuke Saigusa Date: Wed, 26 Jul 2023 21:54:48 +0900 Subject: [PATCH] feat: add title to job document --- .../lib/src/firestore_documents/job.dart | 4 ++++ .../src/firestore_documents/job.flutterfire_gen.dart | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/firebase_common/lib/src/firestore_documents/job.dart b/packages/firebase_common/lib/src/firestore_documents/job.dart index 96971acf..4d13b557 100644 --- a/packages/firebase_common/lib/src/firestore_documents/job.dart +++ b/packages/firebase_common/lib/src/firestore_documents/job.dart @@ -9,6 +9,7 @@ part 'job.flutterfire_gen.dart'; class Job { const Job({ required this.hostId, + required this.title, required this.content, required this.place, this.accessTypes = const {}, @@ -23,6 +24,9 @@ class Job { final String hostId; + @ReadDefault('') + final String title; + @ReadDefault('') final String content; diff --git a/packages/firebase_common/lib/src/firestore_documents/job.flutterfire_gen.dart b/packages/firebase_common/lib/src/firestore_documents/job.flutterfire_gen.dart index 179882dd..e9486522 100644 --- a/packages/firebase_common/lib/src/firestore_documents/job.flutterfire_gen.dart +++ b/packages/firebase_common/lib/src/firestore_documents/job.flutterfire_gen.dart @@ -9,6 +9,7 @@ class ReadJob { required this.hostLocationId, required this.path, required this.hostId, + required this.title, required this.content, required this.place, required this.accessTypes, @@ -27,6 +28,8 @@ class ReadJob { final String hostId; + final String title; + final String content; final String place; @@ -52,6 +55,7 @@ class ReadJob { hostLocationId: json['hostLocationId'] as String, path: json['path'] as String, hostId: json['hostId'] as String, + title: json['title'] as String? ?? '', content: json['content'] as String? ?? '', place: json['place'] as String? ?? '', accessTypes: json['accessTypes'] == null @@ -88,6 +92,7 @@ class ReadJob { class CreateJob { const CreateJob({ required this.hostId, + required this.title, required this.content, required this.place, this.accessTypes = const {}, @@ -101,6 +106,7 @@ class CreateJob { }); final String hostId; + final String title; final String content; final String place; final Set accessTypes; @@ -115,6 +121,7 @@ class CreateJob { Map toJson() { return { 'hostId': hostId, + 'title': title, 'content': content, 'place': place, 'accessTypes': _accessTypesConverter.toJson(accessTypes), @@ -133,6 +140,7 @@ class CreateJob { class UpdateJob { const UpdateJob({ this.hostId, + this.title, this.content, this.place, this.accessTypes, @@ -146,6 +154,7 @@ class UpdateJob { }); final String? hostId; + final String? title; final String? content; final String? place; final Set? accessTypes; @@ -160,6 +169,7 @@ class UpdateJob { Map toJson() { return { if (hostId != null) 'hostId': hostId, + if (title != null) 'title': title, if (content != null) 'content': content, if (place != null) 'place': place, if (accessTypes != null)