import 'package:freezed_annotation/freezed_annotation.dart';

part 'company_branch_flat_dto.freezed.dart';
part 'company_branch_flat_dto.g.dart';

/// /companies/branches API의 평면화된 응답을 위한 DTO
@freezed
class CompanyBranchFlatDto with _$CompanyBranchFlatDto {
  const factory CompanyBranchFlatDto({
    @JsonKey(name: 'company_id') required int companyId,
    @JsonKey(name: 'company_name') required String companyName,
    @JsonKey(name: 'branch_id') int? branchId,
    @JsonKey(name: 'branch_name') String? branchName,
    @JsonKey(name: 'company_types') List<String>? companyTypes,
    @JsonKey(name: 'is_partner') @Default(false) bool isPartner,
    @JsonKey(name: 'is_customer') @Default(false) bool isCustomer,
  }) = _CompanyBranchFlatDto;

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