Skip to content

Commit

Permalink
Merge pull request #229 from mdgspace/services
Browse files Browse the repository at this point in the history
feat: add api service and repositories
  • Loading branch information
aman-singh7 committed Aug 25, 2023
2 parents 4087009 + 44f9193 commit 9f863c6
Show file tree
Hide file tree
Showing 76 changed files with 1,480 additions and 2,146 deletions.
8 changes: 8 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

analyzer:
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
- packages
errors:
invalid_annotation_target: ignore

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
Expand Down
41 changes: 41 additions & 0 deletions lib/data/constants/api_endpoints.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import 'package:appetizer/data/constants/env_config.dart';

class ApiEndpoints {
static const String baseUrl = EnvironmentConfig.BASE_URL;

static const String checkVersion =
'/panel/version/expire/{platform}/{versionNumber}';

static const String coupon = '/api/coupon';
static const String couponWithId = '/api/coupon/{couponId}';

static const String submittedFeedback = '/api/feedback/all/';
static const String responseOfFeedback = '/api/feedback/response/list/';
static const String newFeedback = '/api/feedback/';

static const String remainingLeaves = '/api/leave/count/remaining/';
static const String getLeaves = '/api/leave/all/';
static const String check = '/api/leave/check/';
static const String leave = '/api/leave/';
static const String cancelLeave = '/api/leave/meal/{id}';

static const String weekMenuMultimessing = '/api/menu/week/v2/';
static const String weekMenuForYourMeals = '/api/menu/my_week/';
static const String weekMenu = '/api/menu/week/';
static const String dayMenu = '/api/menu/{week}/{dayOfWeek}';

// TODO: add multimessing endpoints

static const String monthlyRebate = '/api/transaction/rebate/current/';
static const String yearlyRebate = '/api/transaction/list/expenses/';
static const String faqs = '/api/faqs/';

static const String login = '/api/user/login/';
static const String logout = '/api/user/logout/';
static const String user = '/api/user/me/';
static const String password = '/api/user/me/password/';
static const String resetpassword = '/api/user/me/password/reset/';
static const String oAuthRedirect = '/api/user/oauth/omniport/redirect/';
static const String oAuthComplete = '/api/user/oauth/complete/';
static const String notifications = '/api/user/message/list/';
}
6 changes: 6 additions & 0 deletions lib/data/core/router/registry/paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@ part of '../router.dart';
class AppPathsRegistry {
AppPathsRegistry._();

static const String login = '/login';
static const String home = '/home';
static const String notification = '/notifications';
static const String profile = '/profile';
static const String coupon = '/coupon';
static const String weekMenu = '/weekMenu';
static const String leavesAndRebate = '/leavesAndRebate';
}
24 changes: 24 additions & 0 deletions lib/data/core/router/registry/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,33 @@ class AppRoutesRegistry {
AppRoutesRegistry._();

static List<AutoRoute> routes = <AutoRoute>[
CustomRoute(
path: AppPathsRegistry.login,
page: LoginRoute.page,
),
CustomRoute(
path: AppPathsRegistry.home,
page: HomeRoute.page,
),
CustomRoute(
path: AppPathsRegistry.coupon,
page: CouponsRoute.page,
),
CustomRoute(
path: AppPathsRegistry.notification,
page: NotificationRoute.page,
),
CustomRoute(
path: AppPathsRegistry.leavesAndRebate,
page: LeavesAndRebateRoute.page,
),
CustomRoute(
path: AppPathsRegistry.profile,
page: ProfileRoute.page,
),
CustomRoute(
path: AppPathsRegistry.weekMenu,
page: YourWeekMenuRoute.page,
),
];
}
Empty file removed lib/data/repositories/.gitkeep
Empty file.
46 changes: 0 additions & 46 deletions lib/data/services/api/coupon_api.dart

This file was deleted.

77 changes: 0 additions & 77 deletions lib/data/services/api/feedback_api.dart

This file was deleted.

126 changes: 0 additions & 126 deletions lib/data/services/api/leave_api.dart

This file was deleted.

Loading

0 comments on commit 9f863c6

Please sign in to comment.