86ed7bc665
- Updated the `Lot`, `Organization`, and `OrganizationAddress` models to enhance data mapping for tender details. - Revised the `TenderData` model to include additional fields reflecting the API response structure. - Improved UI components across desktop, mobile, and tablet views by commenting out unused sections for future use. - Added new string constants for lot details in the tender information section. - Enhanced unit tests to cover new model fields and ensure resilience to partial API payloads.
24 lines
921 B
Dart
24 lines
921 B
Dart
// ignore_for_file: invalid_annotation_target
|
|
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
import 'package:tm_app/data/services/model/organization/organization_address.dart';
|
|
|
|
part 'organization.freezed.dart';
|
|
part 'organization.g.dart';
|
|
|
|
// company_id and a nested address (OrganizationAddress) surface buyer details
|
|
// on the tender-details page. A dedicated OrganizationAddress type is used
|
|
// instead of the existing `Address` model because the buyer address shape
|
|
// differs (city_name + country_code only) and is unrelated to the user-profile
|
|
// Address.
|
|
@freezed
|
|
abstract class Organization with _$Organization {
|
|
const factory Organization({
|
|
required String? name,
|
|
@JsonKey(name: 'company_id') required String? companyId,
|
|
required OrganizationAddress? address,
|
|
}) = _Organization;
|
|
|
|
factory Organization.fromJson(Map<String, Object?> json) =>
|
|
_$OrganizationFromJson(json);
|
|
} |