b1simpflemobilewarehousing 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

This b1simpflemobilewarehousing is a library for Flutter/Dart developers that provides a nice collection of business logic classes and functions on top of SAP BusinessOne (B1) Service Layer (SL) for mobile warehousing applications written in Flutter/Dart.

This library based on top of the package b1serviceflayer, which is generic API to use B1 SL. If you are interested what is B1 and SL read the documentation of this package.

Created from templates made available by Stagehand under a BSD-style license.

SAP, SAP Business One are registered trademarks of SAP

Usage #

The library is composed a number of business logic intercases, mixins and concrete classes composed from these mixins. The intercases are abstract classes with the prefix I; each of them defines a functionality group, which are called modules. Their primary goal is to provide a consistent contract between the UI, application layers and the business logic.

  • IActivities
  • IItems
  • IPurchasing

Each of these interfaces has mixin implementation, each of them defined with the on B1Services, shich requires a B1ServiceLayer from the package b1serciceflayer.

  • ActivitiesImpl
  • ItemsImpl
  • PurchasingImpl

Each of them has an abstract class version extending B1services:

  • B1ItemsServicesImpl
  • B1ActivitiesServicesImpl
  • B1PurchasingServicesImpl

In the example below an IWarehousingServices interface is defined combining all the module interfaces. Then, the class WarehousingServicesimpl uses the mixins to implement all interfaces. It is a common practice in well architected applications, that the business logic object is defined with an interface type.

import 'package:b1simpflemobilewarehousing/b1simpflemobilewarehousing.dart';
abstract class IWarehousingServices with IActivities, IItems, IPurchasing {}
class WarehousingServicesImpl extends B1Services 
  with ActivitiesImpl, ItemsImpl, PurchasingImpl 
  implements IWarehousingServices {
  WarehousingServicesImpl(B1ServiceLayer sl) : super(sl);
}

final connection = B1Connection(
  serverUrl: "http://hana93srv:50001/b1s/v1/",
  userName: "manager",
  password: "manager",
  companyDB: "SBODEMOUS",
);
main() async {
  final IWarehousingServices b1s = WarehousingServicesImpl(B1ServiceLayer(connection));
  final List<Document> r = await b1s.queryOpenPurchaseOrdersAsync();
  print("Documents returned ${r.length}");
}

A number of utility classes have been defined for easy handling of the entities. Activity, Document and Item all are derived from the abstract EntityBase, which is implemented on a MapBase class. These objects are actually dynamic maps, which gives a number of advantages. When an JSON string is returned, the library first decodes it to a Map<String,dynamic> or a List<Map<String,dynamic>> and the null values are removed automatically; this, reduces significantly the size of these maps. These classes provide observability, as well as dirty monitoring.

All the typed fields are simple getters and setters supporting String, int, DateTime, double, bool and enumeration data types. Enumeration types are defined with const classes based on the class BoEnums from b1serviceflayer.

The package today is far from complete. When it has a version number 1.0.0, then it could be regarded as complete with at least one Flutter application behind it.

License #

The license is an open source BSD license as suggested by the Dart package publishing documentation, since Dart itself has BSD license.

See the LICENSE.md file.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.0.1 #

  • A work in progress initial version where the architecture is layed out. Next versions will include a lot more functions and modules for activities, tasks, teams, coworkers, quality activities, stocks, items, batches and serial_numbers, picking, outsourcing, cycle_counting, transfers, stock isues and receipts, purchasing, good_receipts, suppliers, deliveries, customers, bin_locations and warehouses and production. This version absolutely usable even with this limited functionality, and all functions have been automated tested.

0.0.2 #

  • Unfortunately, flutter_test depends on meta 1.1.6 today 2019.08.09 and I decremented the meta library version to 1.1.6.

example/b1simpflemobilewarehousing_example.dart

import 'package:b1simpflemobilewarehousing/b1simpflemobilewarehousing.dart';

abstract class IWarehousingServices with IActivities, IItems, IPurchasing {}
class WarehousingServicesImpl extends B1Services 
  with ActivitiesImpl, ItemsImpl, PurchasingImpl 
  implements IWarehousingServices {
  WarehousingServicesImpl(B1ServiceLayer sl) : super(sl);
}

final connection = B1Connection(
  serverUrl: "http://hana93srv:50001/b1s/v1/",
  userName: "manager",
  password: "123qwe",
  companyDB: "SBODEMOUS",
);
main() async {
  final IWarehousingServices b1s = WarehousingServicesImpl(B1ServiceLayer(connection));
  final List<Document> r = await b1s.queryOpenPurchaseOrdersAsync();
  print("Documents returned ${r.length}");
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  b1simpflemobilewarehousing: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:b1simpflemobilewarehousing/b1simpflemobilewarehousing.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
4
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
82
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:b1simpflemobilewarehousing/b1simpflemobilewarehousing.dart with components: io.

Health issues and suggestions

Document public APIs. (-0.30 points)

164 out of 168 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/activities_impl.dart. (-0.50 points)

Analysis of lib/src/activities_impl.dart reported 1 hint:

line 1 col 8: Unused import: 'package:meta/meta.dart'.

Fix lib/src/document.dart. (-0.50 points)

Analysis of lib/src/document.dart reported 1 hint:

line 2 col 8: Unused import: 'package:b1serviceflayer/b1serviceflayer.dart'.

Fix lib/src/items_impl.dart. (-0.50 points)

Analysis of lib/src/items_impl.dart reported 1 hint:

line 1 col 8: Unused import: 'package:meta/meta.dart'.

Fix additional 9 files with analysis or formatting issues. (-0.50 points)

Additional issues in the following files:

  • lib/src/purchasing_impl.dart (1 hint)
  • lib/b1simpflemobilewarehousing.dart (Run dartfmt to format lib/b1simpflemobilewarehousing.dart.)
  • lib/src/activity.dart (Run dartfmt to format lib/src/activity.dart.)
  • lib/src/b1simpflemobilewarehousing_base.dart (Run dartfmt to format lib/src/b1simpflemobilewarehousing_base.dart.)
  • lib/src/entitybase.dart (Run dartfmt to format lib/src/entitybase.dart.)
  • lib/src/iactivities.dart (Run dartfmt to format lib/src/iactivities.dart.)
  • lib/src/iitems.dart (Run dartfmt to format lib/src/iitems.dart.)
  • lib/src/ipurchasing.dart (Run dartfmt to format lib/src/ipurchasing.dart.)
  • lib/src/item.dart (Run dartfmt to format lib/src/item.dart.)

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

The package description is too short. (-8 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
b1serviceflayer ^1.0.2 1.0.3
meta ^1.1.6 1.1.7
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http 0.12.0+2
http_parser 3.1.3
intl 0.15.8 0.16.0
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
pedantic ^1.7.0 1.8.0+1
test ^1.6.0