Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @lsetiawan @nikiburggraf @infrared0 @kheimerl
* @philion @nikiburggraf @infrared0 @kheimerl
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# App_config for db backend, so our anon key is not unencrypted in github
src/support_sphere/assets/app_config.json

# Android Studio
.idea/

Expand Down
6 changes: 0 additions & 6 deletions src/support_sphere/assets/app_config.json

This file was deleted.

2 changes: 2 additions & 0 deletions src/support_sphere/lib/constants/string_catalog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class AddResourceInventoryFormStrings {
static String addTitle(String resourceName) =>
"Add $resourceName to Inventory";
static const String howManyAdding = 'How many are you adding?';
static const String setSharingScopeNormal = 'Who can request this item?';
static const String setSharingScopeEmergency = 'Who can request this in an emergency?';
static String askSubtype(String resourceName) =>
"What type of $resourceName is it (if known)?";
static const String notes = 'Any notes on this item?';
Expand Down
10 changes: 10 additions & 0 deletions src/support_sphere/lib/data/models/resource.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ class Resource extends Equatable {
this.qtyNeeded = 0,
this.qtyAvailable = 0,
this.userQuantity = 0,
this.sharingScope = '',
this.sharingScopeEmergency = '',
});

final String id;
final String name;
final String? description;
final String? notes;
final String? sharingScope;
final String? sharingScopeEmergency;
final int qtyNeeded;
final int qtyAvailable;
final int userQuantity;
Expand All @@ -43,6 +47,8 @@ class Resource extends Equatable {
description: resourceTypesJson['description']
),
notes: json['notes'],
sharingScope: json['sharing_scope'],
sharingScopeEmergency: json['sharing_scope_emergency'],
qtyNeeded: neededQuantity < 0 ? 0 : neededQuantity,
qtyAvailable: json['qty_available'] + userQuantity,
);
Expand All @@ -53,6 +59,8 @@ class Resource extends Equatable {
String? name,
String? description,
String? notes,
String? sharingScope,
String? sharingScopeEmergency,
int? qtyNeeded,
int? qtyAvailable,
int? userQuantity,
Expand All @@ -64,6 +72,8 @@ class Resource extends Equatable {
description: description ?? this.description,
resourceType: resourceType ?? this.resourceType,
notes: notes ?? this.notes,
sharingScope: sharingScope ?? this.sharingScope,
sharingScopeEmergency: sharingScopeEmergency ?? this.sharingScopeEmergency,
userQuantity: userQuantity ?? this.userQuantity,
qtyNeeded: qtyNeeded ?? this.qtyNeeded,
qtyAvailable: qtyAvailable ?? this.qtyAvailable,
Expand Down
Loading
Loading