Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add reward field to job page #72

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Job {
this.accessTypes = const <AccessType>{},
this.accessDescription = '',
required this.belongings,
required this.reward,
this.comment = '',
this.urls = const <String>[],
this.createdAt = const ServerTimestamp(),
Expand All @@ -36,6 +37,9 @@ class Job {
@ReadDefault('')
final String belongings;

@ReadDefault('')
final String reward;

final String comment;

final List<String> urls;
Expand All @@ -62,7 +66,7 @@ enum AccessType {
busAvailable('バスあり'),
parkingAvailable('駐車場あり'),
walkableFromNearest('最寄りから徒歩可能'),
shuttleServiceAvailable('駅から送迎可能'),
shuttleServiceAvailable('最寄りから送迎可能'),
;

// NOTE: ここで enhanced enum で label を定義するのは、Model に View の情報を
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class ReadJob {
required this.accessTypes,
required this.accessDescription,
required this.belongings,
required this.reward,
required this.comment,
required this.urls,
required this.createdAt,
Expand All @@ -36,6 +37,8 @@ class ReadJob {

final String belongings;

final String reward;

final String comment;

final List<String> urls;
Expand All @@ -57,6 +60,7 @@ class ReadJob {
.fromJson(json['accessTypes'] as List<dynamic>?),
accessDescription: json['accessDescription'] as String? ?? '',
belongings: json['belongings'] as String? ?? '',
reward: json['reward'] as String? ?? '',
comment: json['comment'] as String? ?? '',
urls:
(json['urls'] as List<dynamic>?)?.map((e) => e as String).toList() ??
Expand Down Expand Up @@ -89,6 +93,7 @@ class CreateJob {
this.accessTypes = const <AccessType>{},
this.accessDescription = '',
required this.belongings,
required this.reward,
this.comment = '',
this.urls = const <String>[],
this.createdAt = const ServerTimestamp(),
Expand All @@ -101,6 +106,7 @@ class CreateJob {
final Set<AccessType> accessTypes;
final String accessDescription;
final String belongings;
final String reward;
final String comment;
final List<String> urls;
final SealedTimestamp createdAt;
Expand All @@ -114,6 +120,7 @@ class CreateJob {
'accessTypes': _accessTypesConverter.toJson(accessTypes),
'accessDescription': accessDescription,
'belongings': belongings,
'reward': reward,
'comment': comment,
'urls': urls,
'createdAt': sealedTimestampConverter.toJson(createdAt),
Expand All @@ -131,6 +138,7 @@ class UpdateJob {
this.accessTypes,
this.accessDescription,
this.belongings,
this.reward,
this.comment,
this.urls,
this.createdAt,
Expand All @@ -143,6 +151,7 @@ class UpdateJob {
final Set<AccessType>? accessTypes;
final String? accessDescription;
final String? belongings;
final String? reward;
final String? comment;
final List<String>? urls;
final SealedTimestamp? createdAt;
Expand All @@ -157,6 +166,7 @@ class UpdateJob {
'accessTypes': _accessTypesConverter.toJson(accessTypes!),
if (accessDescription != null) 'accessDescription': accessDescription,
if (belongings != null) 'belongings': belongings,
if (reward != null) 'reward': reward,
if (comment != null) 'comment': comment,
if (urls != null) 'urls': urls,
if (createdAt != null)
Expand Down