Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bfa00364c | ||
|
|
0b092b5467 |
@@ -1 +1 @@
|
|||||||
__version__ = "12.1.2"
|
__version__ = "12.1.3"
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import uuid
|
|||||||
from datetime import UTC, datetime, timedelta
|
from datetime import UTC, datetime, timedelta
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
import jwt
|
||||||
|
|
||||||
from fastapi import Depends, HTTPException, Security, status
|
from fastapi import Depends, HTTPException, Security, status
|
||||||
from fastapi.security import OAuth2PasswordBearer, SecurityScopes
|
from fastapi.security import OAuth2PasswordBearer, SecurityScopes
|
||||||
from jose import jwt
|
|
||||||
from jose.exceptions import ExpiredSignatureError
|
|
||||||
from jwt import PyJWTError
|
from jwt import PyJWTError
|
||||||
from pydantic import BaseModel, ValidationError
|
from pydantic import BaseModel, ValidationError
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
@@ -82,7 +82,7 @@ async def get_current_user(
|
|||||||
raise credentials_exception
|
raise credentials_exception
|
||||||
token_scopes = payload.get("scopes", [])
|
token_scopes = payload.get("scopes", [])
|
||||||
token_data = TokenData(scopes=token_scopes, username=username)
|
token_data = TokenData(scopes=token_scopes, username=username)
|
||||||
except (PyJWTError, ValidationError, ExpiredSignatureError):
|
except (PyJWTError, ValidationError):
|
||||||
raise credentials_exception
|
raise credentials_exception
|
||||||
user = get_user(
|
user = get_user(
|
||||||
username=token_data.username,
|
username=token_data.username,
|
||||||
|
|||||||
@@ -117,5 +117,5 @@ app.include_router(split.router, prefix="/api", tags=["voucher"])
|
|||||||
app.include_router(change.router, prefix="/api/voucher", tags=["voucher"])
|
app.include_router(change.router, prefix="/api/voucher", tags=["voucher"])
|
||||||
|
|
||||||
|
|
||||||
def init():
|
def init() -> None:
|
||||||
uvicorn.run(app, host=settings.HOST, port=settings.PORT)
|
uvicorn.run(app, host=settings.HOST, port=settings.PORT)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ def product_sale_report_view(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def product_sale_report(s: date, f: date, id_: uuid.UUID, db: Session):
|
def product_sale_report(s: date, f: date, id_: uuid.UUID | None, db: Session):
|
||||||
start_date = datetime.combine(s, time()) + timedelta(
|
start_date = datetime.combine(s, time()) + timedelta(
|
||||||
minutes=settings.NEW_DAY_OFFSET_MINUTES - settings.TIMEZONE_OFFSET_MINUTES
|
minutes=settings.NEW_DAY_OFFSET_MINUTES - settings.TIMEZONE_OFFSET_MINUTES
|
||||||
)
|
)
|
||||||
@@ -128,7 +128,7 @@ def print_report(
|
|||||||
"startDate": start_date.strftime("%d-%b-%Y"),
|
"startDate": start_date.strftime("%d-%b-%Y"),
|
||||||
"finishDate": finish_date.strftime("%d-%b-%Y"),
|
"finishDate": finish_date.strftime("%d-%b-%Y"),
|
||||||
"sectionId": str(section) if section is not None else None,
|
"sectionId": str(section) if section is not None else None,
|
||||||
"amounts": product_sale_report(start_date, finish_date, db),
|
"amounts": product_sale_report(start_date, finish_date, section, db),
|
||||||
}
|
}
|
||||||
print_product_sale_report(report, device_id, db)
|
print_product_sale_report(report, device_id, db)
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "barker"
|
name = "barker"
|
||||||
version = "12.1.2"
|
version = "12.1.3"
|
||||||
description = "Point of Sale for a restaurant"
|
description = "Point of Sale for a restaurant"
|
||||||
authors = ["tanshu <git@tanshu.com>"]
|
authors = ["tanshu <git@tanshu.com>"]
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bookie",
|
"name": "bookie",
|
||||||
"version": "12.1.2",
|
"version": "12.1.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
||||||
version: '12.1.2',
|
version: '12.1.3',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const dateFormat = {
|
export const dateFormat = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "frank"
|
name = "frank"
|
||||||
version = "12.1.2"
|
version = "12.1.3"
|
||||||
description = "Point of Sale for a restaurant"
|
description = "Point of Sale for a restaurant"
|
||||||
authors = ["tanshu <git@tanshu.com>"]
|
authors = ["tanshu <git@tanshu.com>"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user