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> {
Stream<GoodsDonationState> mapEventToState(GoodsDonationEvent event) async* {
if (event is GoodsDonationButtonClicked) {
yield const SendingGoodsDonationLoading();
print(event.isFinal);
try {
await _donationRepository.createGoodsDonation(
event.program,
......
......@@ -70,7 +70,7 @@ Map<String, dynamic> _$DonationToJson(Donation instance) => <String, dynamic>{
'goods_quantity': instance.goodsQuantity,
'goods_description': instance.goodsDescription,
'delivery_method': instance.deliveryMethod,
'delivery_address': instance.deliveryAddress
'delivery_address': instance.deliveryAddress,
};
const _$StatusDonationEnumMap = {
......
......@@ -17,3 +17,10 @@ class FetchProgramByStatus extends ProgramEvent {
@override
List<Object> get props => [];
}
class FetchProgramByStatus extends ProgramEvent {
const FetchProgramByStatus();
@override
List<Object> get props => [];
}
......@@ -49,8 +49,12 @@ class Transaction {
final DateTime updatedAt;
final String subtotal;
final List<TransactionItem> transactionItems;
@JsonKey(nullable: true)
final String batch;
@JsonKey(nullable: true)
final String batchName;
@JsonKey(nullable: true)
final DateTime batchEndDate;
const Transaction(
......
......@@ -46,7 +46,7 @@ Transaction _$TransactionFromJson(Map<String, dynamic> json) {
subtotal: json['subtotal'] as String,
batch: json['batch'] 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) =>
'transaction_items':
instance.transactionItems.map((e) => e.toJson()).toList(),
'batch': instance.batch,
'batch_name':instance.batchName,
'end_date':instance.batchEndDate
'batch_name': instance.batchName,
'end_date': instance.batchEndDate.toIso8601String(),
};
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