Fakultas Ilmu Komputer UI

Commit c24f1337 authored by Tsamara Esperanti Erwin's avatar Tsamara Esperanti Erwin 🦄
Browse files

Merge branch 'PBI-7-Progress_Program' into 'staging'

Pbi 7 progress program

See merge request !89
parents 8ec962cd be518835
Pipeline #61077 failed with stages
in 1 minute and 38 seconds
...@@ -20,7 +20,6 @@ class GoodsDonationBloc extends Bloc<GoodsDonationEvent, GoodsDonationState> { ...@@ -20,7 +20,6 @@ class GoodsDonationBloc extends Bloc<GoodsDonationEvent, GoodsDonationState> {
Stream<GoodsDonationState> mapEventToState(GoodsDonationEvent event) async* { Stream<GoodsDonationState> mapEventToState(GoodsDonationEvent event) async* {
if (event is GoodsDonationButtonClicked) { if (event is GoodsDonationButtonClicked) {
yield const SendingGoodsDonationLoading(); yield const SendingGoodsDonationLoading();
print(event.isFinal);
try { try {
await _donationRepository.createGoodsDonation( await _donationRepository.createGoodsDonation(
event.program, event.program,
......
...@@ -70,7 +70,7 @@ Map<String, dynamic> _$DonationToJson(Donation instance) => <String, dynamic>{ ...@@ -70,7 +70,7 @@ Map<String, dynamic> _$DonationToJson(Donation instance) => <String, dynamic>{
'goods_quantity': instance.goodsQuantity, 'goods_quantity': instance.goodsQuantity,
'goods_description': instance.goodsDescription, 'goods_description': instance.goodsDescription,
'delivery_method': instance.deliveryMethod, 'delivery_method': instance.deliveryMethod,
'delivery_address': instance.deliveryAddress 'delivery_address': instance.deliveryAddress,
}; };
const _$StatusDonationEnumMap = { const _$StatusDonationEnumMap = {
......
...@@ -17,3 +17,10 @@ class FetchProgramByStatus extends ProgramEvent { ...@@ -17,3 +17,10 @@ class FetchProgramByStatus extends ProgramEvent {
@override @override
List<Object> get props => []; List<Object> get props => [];
} }
class FetchProgramByStatus extends ProgramEvent {
const FetchProgramByStatus();
@override
List<Object> get props => [];
}
...@@ -49,8 +49,12 @@ class Transaction { ...@@ -49,8 +49,12 @@ class Transaction {
final DateTime updatedAt; final DateTime updatedAt;
final String subtotal; final String subtotal;
final List<TransactionItem> transactionItems; final List<TransactionItem> transactionItems;
@JsonKey(nullable: true)
final String batch; final String batch;
@JsonKey(nullable: true)
final String batchName; final String batchName;
@JsonKey(nullable: true)
final DateTime batchEndDate; final DateTime batchEndDate;
const Transaction( const Transaction(
......
...@@ -46,7 +46,7 @@ Transaction _$TransactionFromJson(Map<String, dynamic> json) { ...@@ -46,7 +46,7 @@ Transaction _$TransactionFromJson(Map<String, dynamic> json) {
subtotal: json['subtotal'] as String, subtotal: json['subtotal'] as String,
batch: json['batch'] as String, batch: json['batch'] as String,
batchName: json['batch_name'] as String, batchName: json['batch_name'] as String,
batchEndDate: DateTime.parse(json['end_date'] as String) batchEndDate: json['end_date'] != null ? DateTime.parse(json['end_date'] as String) : DateTime.now(),
); );
} }
...@@ -87,8 +87,8 @@ Map<String, dynamic> _$TransactionToJson(Transaction instance) => ...@@ -87,8 +87,8 @@ Map<String, dynamic> _$TransactionToJson(Transaction instance) =>
'transaction_items': 'transaction_items':
instance.transactionItems.map((e) => e.toJson()).toList(), instance.transactionItems.map((e) => e.toJson()).toList(),
'batch': instance.batch, 'batch': instance.batch,
'batch_name':instance.batchName, 'batch_name': instance.batchName,
'end_date':instance.batchEndDate 'end_date': instance.batchEndDate.toIso8601String(),
}; };
const _$PaymentMethodEnumMap = { const _$PaymentMethodEnumMap = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment