diff --git a/barker/barker/__version__.py b/barker/barker/__version__.py new file mode 100644 index 0000000..5becc17 --- /dev/null +++ b/barker/barker/__version__.py @@ -0,0 +1 @@ +__version__ = "1.0.0" diff --git a/barker/barker/routers/login.py b/barker/barker/routers/login.py index 30c5392..6fc11c1 100644 --- a/barker/barker/routers/login.py +++ b/barker/barker/routers/login.py @@ -15,6 +15,7 @@ from fastapi.responses import JSONResponse from fastapi.security import OAuth2PasswordRequestForm from sqlalchemy.orm import Session +from .. import __version__ from ..core.security import ( Token, authenticate_user, @@ -85,6 +86,7 @@ async def login_for_access_token( ), "userId": str(user.id), "lockedOut": user.locked_out, + "ver": __version__.__version__, }, expires_delta=access_token_expires, ) @@ -100,6 +102,7 @@ async def refresh_token(user: UserToken = Security(get_current_active_user)): "scopes": user.permissions, "userId": str(user.id_), "lockedOut": user.locked_out, + "ver": __version__.__version__, }, expires_delta=access_token_expires, ) diff --git a/barker/pyproject.toml b/barker/pyproject.toml index e670c40..b556791 100644 --- a/barker/pyproject.toml +++ b/barker/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "barker" -version = "0.1.0" +version = "1.0.0" description = "Point of Sale for a restaurant" authors = ["tanshu "] diff --git a/bookie/package.json b/bookie/package.json index 1c185af..6e9ddc4 100644 --- a/bookie/package.json +++ b/bookie/package.json @@ -1,6 +1,6 @@ { "name": "bookie", - "version": "0.0.0", + "version": "1.0.0", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/bookie/src/app/core/user.ts b/bookie/src/app/core/user.ts index bae77d8..e111204 100644 --- a/bookie/src/app/core/user.ts +++ b/bookie/src/app/core/user.ts @@ -10,6 +10,7 @@ export class User { isAuthenticated: boolean; access_token?: string; exp?: number; + ver: string; public constructor(init?: Partial) { Object.assign(this, init); diff --git a/bookie/src/app/home/home.component.html b/bookie/src/app/home/home.component.html index 90bd4ee..fbb3b0a 100644 --- a/bookie/src/app/home/home.component.html +++ b/bookie/src/app/home/home.component.html @@ -198,3 +198,6 @@

Users

+ diff --git a/bookie/src/app/home/home.component.ts b/bookie/src/app/home/home.component.ts index afb8f06..0571be3 100644 --- a/bookie/src/app/home/home.component.ts +++ b/bookie/src/app/home/home.component.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core'; +import { environment } from '../../environments/environment'; import { AuthService } from '../auth/auth.service'; @Component({ @@ -8,5 +9,9 @@ import { AuthService } from '../auth/auth.service'; styleUrls: ['./home.component.css'], }) export class HomeComponent { - constructor(public auth: AuthService) {} + version: string; + + constructor(public auth: AuthService) { + this.version = environment.version; + } } diff --git a/bookie/src/app/sales/running-tables/running-tables.component.ts b/bookie/src/app/sales/running-tables/running-tables.component.ts index 35212ae..0e1e124 100644 --- a/bookie/src/app/sales/running-tables/running-tables.component.ts +++ b/bookie/src/app/sales/running-tables/running-tables.component.ts @@ -22,7 +22,8 @@ export class RunningTablesComponent implements OnInit { navigateToBill(table: Table): void { const qp = { table: table.id }; if (table.voucherId) { - qp.voucher = table.voucherId; + // eslint-disable-next-line @typescript-eslint/dot-notation + qp['voucher'] = table.voucherId; } const navigationExtras: NavigationExtras = { queryParams: qp, diff --git a/bookie/src/environments/environment.prod.ts b/bookie/src/environments/environment.prod.ts index 0dc912d..589b2eb 100644 --- a/bookie/src/environments/environment.prod.ts +++ b/bookie/src/environments/environment.prod.ts @@ -1,4 +1,5 @@ export const environment = { production: true, ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry + version: "1.0.0", }; diff --git a/bookie/src/environments/environment.ts b/bookie/src/environments/environment.ts index 2498792..8cfcdb4 100644 --- a/bookie/src/environments/environment.ts +++ b/bookie/src/environments/environment.ts @@ -5,6 +5,7 @@ export const environment = { production: false, ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry + version: "1.0.0", }; /*