import '../app/constant.dart';
import '../models/response_save_work_tunda_model.dart';
import 'base_repository.dart';


class WorkTundaRepository extends BaseRepository {
  WorkTundaRepository({required super.dio});

  Future<ResponseSaveWorkTundaModel> inputWorkTunda({
    required String courierID,
    required String tipeID,
    required String deliveryID,
    required String note
  }) async {
    final param = {
      "id": courierID,
      "tipeid": tipeID,
      "deliveryid": deliveryID,
      "note": note
    };

    print("param : $param");

    // Pengantaran Hasil => tipeID 1
    // Lain-lain => tipeID 4
    // Pengambilan Bahan => tipeID 5

    final service = "${Constant.baseUrl}v1/courier/mobile/pending/add/?id=$courierID&tipeid=$tipeID&deliveryid=$deliveryID&note=$note";
    final resp = await post(param: param, service: service);
    return ResponseSaveWorkTundaModel.fromJson(resp);
  }
}
