결재 및 마스터 모듈을 v4 API 계약에 맞게 조정

This commit is contained in:
JiWoong Sul
2025-10-16 17:27:20 +09:00
parent d5c99627db
commit 9e2244f260
34 changed files with 1394 additions and 330 deletions

View File

@@ -9,6 +9,7 @@ class CustomerDto {
this.id,
required this.customerCode,
required this.customerName,
this.contactName,
this.isPartner = false,
this.isGeneral = true,
this.email,
@@ -25,6 +26,7 @@ class CustomerDto {
final int? id;
final String customerCode;
final String customerName;
final String? contactName;
final bool isPartner;
final bool isGeneral;
final String? email;
@@ -43,6 +45,7 @@ class CustomerDto {
id: json['id'] as int?,
customerCode: json['customer_code'] as String,
customerName: json['customer_name'] as String,
contactName: json['contact_name'] as String?,
isPartner: (json['is_partner'] as bool?) ?? false,
isGeneral: (json['is_general'] as bool?) ?? true,
email: json['email'] as String?,
@@ -65,6 +68,7 @@ class CustomerDto {
if (id != null) 'id': id,
'customer_code': customerCode,
'customer_name': customerName,
'contact_name': contactName,
'is_partner': isPartner,
'is_general': isGeneral,
'email': email,
@@ -84,6 +88,7 @@ class CustomerDto {
id: id,
customerCode: customerCode,
customerName: customerName,
contactName: contactName,
isPartner: isPartner,
isGeneral: isGeneral,
email: email,

View File

@@ -33,7 +33,7 @@ class CustomerRepositoryRemote implements CustomerRepository {
if (query != null && query.isNotEmpty) 'q': query,
if (isPartner != null) 'is_partner': isPartner,
if (isGeneral != null) 'is_general': isGeneral,
if (isActive != null) 'is_active': isActive,
if (isActive != null) 'active': isActive,
},
options: Options(responseType: ResponseType.json),
);

View File

@@ -4,6 +4,7 @@ class Customer {
this.id,
required this.customerCode,
required this.customerName,
this.contactName,
this.isPartner = false,
this.isGeneral = true,
this.email,
@@ -20,6 +21,7 @@ class Customer {
final int? id;
final String customerCode;
final String customerName;
final String? contactName;
final bool isPartner;
final bool isGeneral;
final String? email;
@@ -37,6 +39,7 @@ class Customer {
int? id,
String? customerCode,
String? customerName,
String? contactName,
bool? isPartner,
bool? isGeneral,
String? email,
@@ -53,6 +56,7 @@ class Customer {
id: id ?? this.id,
customerCode: customerCode ?? this.customerCode,
customerName: customerName ?? this.customerName,
contactName: contactName ?? this.contactName,
isPartner: isPartner ?? this.isPartner,
isGeneral: isGeneral ?? this.isGeneral,
email: email ?? this.email,
@@ -88,6 +92,7 @@ class CustomerInput {
CustomerInput({
required this.customerCode,
required this.customerName,
this.contactName,
required this.isPartner,
required this.isGeneral,
this.email,
@@ -100,6 +105,7 @@ class CustomerInput {
final String customerCode;
final String customerName;
final String? contactName;
final bool isPartner;
final bool isGeneral;
final String? email;
@@ -114,6 +120,7 @@ class CustomerInput {
return {
'customer_code': customerCode,
'customer_name': customerName,
'contact_name': contactName,
'is_partner': isPartner,
'is_general': isGeneral,
'email': email,

View File

@@ -496,6 +496,9 @@ class _CustomerEnabledPageState extends State<_CustomerEnabledPage> {
final nameController = TextEditingController(
text: existing?.customerName ?? '',
);
final contactController = TextEditingController(
text: existing?.contactName ?? '',
);
final emailController = TextEditingController(text: existing?.email ?? '');
final mobileController = TextEditingController(
text: existing?.mobileNo ?? '',
@@ -597,6 +600,7 @@ class _CustomerEnabledPageState extends State<_CustomerEnabledPage> {
: () async {
final code = codeController.text.trim();
final name = nameController.text.trim();
final contact = contactController.text.trim();
final email = emailController.text.trim();
final mobile = mobileController.text.trim();
final zipcode = zipcodeController.text.trim();
@@ -633,6 +637,7 @@ class _CustomerEnabledPageState extends State<_CustomerEnabledPage> {
final input = CustomerInput(
customerCode: code,
customerName: name,
contactName: contact.isEmpty ? null : contact,
isPartner: partner,
isGeneral: general,
email: email.isEmpty ? null : email,
@@ -748,6 +753,11 @@ class _CustomerEnabledPageState extends State<_CustomerEnabledPage> {
},
),
const SizedBox(height: 16),
_FormField(
label: '담당자',
child: ShadInput(controller: contactController),
),
const SizedBox(height: 16),
ValueListenableBuilder<bool>(
valueListenable: partnerNotifier,
builder: (_, partner, __) {
@@ -949,6 +959,7 @@ class _CustomerEnabledPageState extends State<_CustomerEnabledPage> {
codeController.dispose();
nameController.dispose();
contactController.dispose();
emailController.dispose();
mobileController.dispose();
zipcodeController.dispose();
@@ -1047,6 +1058,7 @@ class _CustomerTable extends StatelessWidget {
'ID',
'고객사코드',
'고객사명',
'담당자',
'유형',
'이메일',
'연락처',
@@ -1072,6 +1084,7 @@ class _CustomerTable extends StatelessWidget {
customer.id?.toString() ?? '-',
customer.customerCode,
customer.customerName,
customer.contactName?.isEmpty ?? true ? '-' : customer.contactName!,
resolveType(customer),
customer.email?.isEmpty ?? true ? '-' : customer.email!,
customer.mobileNo?.isEmpty ?? true ? '-' : customer.mobileNo!,