Skip to content

Commit

Permalink
Merge pull request #11 from f-lab-edu/feature/5-job-posting-close
Browse files Browse the repository at this point in the history
[#5] 공고 마감 기능 구현
  • Loading branch information
Younggun-Kim authored Nov 3, 2024
2 parents 82a9238 + 547fd12 commit 4a55714
Show file tree
Hide file tree
Showing 66 changed files with 1,315 additions and 486 deletions.
29 changes: 28 additions & 1 deletion assets/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,32 @@
"serverError": "서버 에러",
"travelTimeGuideDescription": "긱워커가 현장에서 일할 때\n이동시간이 있는지 체크하는 부분입니다.\n\n비급여시 근무시간에서 이동시간을\n제외해서 급여가 측정됩니다.",
"breakTimeGuideDescription": "긱워커가 현장에서 일할 때\n휴게시간이 있는지 체크하는 부분입니다.\n\n비급여시 근무시간에서 휴게시간을\n제외해서 급여가 측정됩니다.",
"mealGuideDescription": "긱워커가 현장에서 일할 때\n식비를 지급하는 체크하는 부분입니다."
"mealGuideDescription": "긱워커가 현장에서 일할 때\n식비를 지급하는 체크하는 부분입니다.",
"update": "수정",
"delete": "삭제",
"close": "마감",
"cancel": "취소",
"isNotDeadlineYetConfirmClose": "아직 마감날이 아닙니다. 마감할까요?",
"isUpdateContentCorrect": "수정하신 내용이 맞으신가요?",
"canRevertFromPostingManagement": "공고 관리에서 다시 되돌릴 수 있습니다.",
"pleaseEnterJobPostingTitle": "공고 제목을 입력해주세요.",
"validationMessage": {
"jobPosting": {
"title": "공고 제목을 입력해 주세요.",
"content": "근무내용을 입력해 주세요.",
"category": "카테고리를 선택해 주세요.",
"contractType": "기간형식을 선택해 주세요.",
"contractStartDate": "근로 계약 기간을 선택해 주세요.",
"contractEndDate": "근로 계약 종료 기간을 선택해 주세요.",
"workStartTime": "근무 시작 시간을 선택해 주세요.",
"workEndTime": "근무 종료 시간을 선택해 주세요.",
"participants": "모집인원을 0명 이상 입력해 주세요.",
"payType": "급여 방법을 선택해 주세요.",
"payAmount": "급여를 0원 이상 입력해 주세요.",
"address": "주소를 입력해 주세요.",
"preferredQualification": "우대사항을 입력해 주세요.",
"travelTimePaid": "이동시간 급여 여부를 선택해 주세요.",
"breakTimePaid": "휴게시간 급여 여부를 선택해 주세요."
}
}
}
9 changes: 9 additions & 0 deletions lib/core/types/contract_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:withu_app/core/core.dart';
/// 계약 타입
@JsonEnum(valueField: 'serverKey')
enum ContractType with L10nKeyProvider {
none(l10nKey: '', serverKey: ''),

/// 단기
short(l10nKey: 'shortTerm', serverKey: 'SHORT_TERM'),

Expand All @@ -20,9 +22,16 @@ enum ContractType with L10nKeyProvider {
required this.serverKey,
});

/// None 여부
bool get isNone => this == ContractType.none;

/// 단기 여부
bool get isShort => this == ContractType.short;

/// 장기 여부
bool get isLong => this == ContractType.long;

/// None을 제외한 값들
static List<ContractType> get valuesWithoutNone =>
values.where((type) => type != none).toList();
}
9 changes: 9 additions & 0 deletions lib/core/types/job_category_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:withu_app/core/core.dart';
/// 직업 종류
@JsonEnum(valueField: 'serverKey')
enum JobCategoryType with L10nKeyProvider {
none(l10nKey: '', serverKey: ''),

/// 촬영
photography(l10nKey: 'photography', serverKey: 'PHOTOGRAPHY'),

Expand All @@ -25,4 +27,11 @@ enum JobCategoryType with L10nKeyProvider {
required this.l10nKey,
required this.serverKey,
});

/// None 여부
bool get isNone => this == none;

/// None을 제외한 값들
static List<JobCategoryType> get valuesWithoutNone =>
values.where((type) => type != none).toList();
}
21 changes: 17 additions & 4 deletions lib/core/types/job_posting_status_type.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
// 공고 상태 타입
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:withu_app/core/core.dart';

@JsonEnum(valueField: 'serverKey')
enum JobPostingStatusType with L10nKeyProvider {
none(l10nKey: '', serverKey: ''),

/// 임시저장
temporary(l10nKey: 'temporarySave'),
temporary(l10nKey: 'temporarySave', serverKey: 'TEMPORARY'),

/// 진행
inProgress(l10nKey: 'inProgress'),
inProgress(l10nKey: 'inProgress', serverKey: 'IN_PROGRESS'),

/// 마감
closed(l10nKey: 'closed');
closed(l10nKey: 'closed', serverKey: 'CLOSED');

@override
final String l10nKey;

const JobPostingStatusType({required this.l10nKey});
final String serverKey;

const JobPostingStatusType({
required this.l10nKey,
required this.serverKey,
});

/// None을 제외한 값들
static List<JobPostingStatusType> get valuesWithoutNone =>
values.where((type) => type != none).toList();
}
9 changes: 9 additions & 0 deletions lib/core/types/pay_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:withu_app/core/core.dart';
/// 급여 타입
@JsonEnum(valueField: 'serverKey')
enum PayType with L10nKeyProvider {
none(l10nKey: '', serverKey: ''),

/// 시급
hour(l10nKey: 'hourlyWage', serverKey: 'HOURLY'),

Expand All @@ -19,4 +21,11 @@ enum PayType with L10nKeyProvider {
required this.l10nKey,
required this.serverKey,
});

/// None 여부
bool get isNone => this == PayType.none;

/// None을 제외한 값들
static List<PayType> get valuesWithoutNone =>
values.where((type) => type != none).toList();
}
1 change: 1 addition & 0 deletions lib/core/utils/mixins/mixins.dart
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export 'l10n_key_provider.dart';
export 'translatable.dart';
8 changes: 8 additions & 0 deletions lib/core/utils/mixins/translatable.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:easy_localization/easy_localization.dart' as easy;

/// Localization
mixin Translatable {
String get path;

String get tr => easy.tr('$path$this');
}
23 changes: 23 additions & 0 deletions lib/core/utils/resource/job_posting_validation_message.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:withu_app/core/core.dart';

/// 공고 관리 유효성 검사 메시지
enum JobPostingValidationMessage with Translatable {
title,
content,
category,
contractType,
contractStartDate,
contractEndDate,
workStartTime,
workEndTime,
participants,
payType,
payAmount,
address,
preferredQualification,
travelTimePaid,
breakTimePaid;

@override
String get path => 'validationMessage.jobPosting.';
}
1 change: 1 addition & 0 deletions lib/core/utils/resource/resource.dart
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export 'string_res.dart';
export 'job_posting_validation_message.dart';
7 changes: 7 additions & 0 deletions lib/core/utils/resource/string_res.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ enum StringRes {
travelTimeGuideDescription,
breakTimeGuideDescription,
mealGuideDescription,
update,
delete,
close,
cancel,
isNotDeadlineYetConfirmClose,
isUpdateContentCorrect,
canRevertFromPostingManagement,
}

extension StringResEx on StringRes {
Expand Down
1 change: 1 addition & 0 deletions lib/core/utils/theme/custom_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class CustomTheme {
textSelectionTheme: const TextSelectionThemeData(
cursorColor: ColorName.primary,
),
highlightColor: ColorName.teritary, // PopupMenu selected color
textTheme: textTheme,
);
}
Expand Down
1 change: 1 addition & 0 deletions lib/core/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export 'theme/custom_theme.dart';
export 'resource/resource.dart';
export 'mixins/mixins.dart';
export 'either/either.dart';
export 'validation/validation.dart';
1 change: 1 addition & 0 deletions lib/core/utils/validation/validation.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'validation_result.dart';
28 changes: 28 additions & 0 deletions lib/core/utils/validation/validation_result.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/// 유효성 검사 결과
class ValidationResult {
/// 유효성 여부
final bool isValid;

/// 유효성 검사 실패 메시지
final String failMessage;

ValidationResult({
required this.isValid,
this.failMessage = '',
});

/// 검사 성공
factory ValidationResult.success() {
return ValidationResult(isValid: true);
}

/// 검사 실패
factory ValidationResult.fail({
required String message,
}) {
return ValidationResult(
isValid: false,
failMessage: message,
);
}
}
1 change: 1 addition & 0 deletions lib/feature/company/company.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'data/data.dart';
1 change: 1 addition & 0 deletions lib/feature/company/data/data.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'data_sources/data_sources.dart';
1 change: 1 addition & 0 deletions lib/feature/company/data/data_sources/data_sources.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export 'dto/dto.dart';
23 changes: 23 additions & 0 deletions lib/feature/company/data/data_sources/dto/base/company_dto.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:freezed_annotation/freezed_annotation.dart';

part 'company_dto.freezed.dart';

part 'company_dto.g.dart';

part 'company_dto.mock.dart';

/// 회사 상세 모델
@freezed
class CompanyDto with _$CompanyDto {
const factory CompanyDto({
required String id, // ID
required String thumbnailUrl, // 썸네일 이미지
required String name, // 회사명
}) = _CompanyDto;

factory CompanyDto.fromJson(Map<String, Object?> json) =>
_$CompanyDtoFromJson(json);

/// Mock 데이터 생성
factory CompanyDto.mock() => CompanyDtoMock.mock();
}
Loading

0 comments on commit 4a55714

Please sign in to comment.