provision schema
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
from marshmallow import Schema, fields
|
||||
|
||||
class ProvisionSchema(Schema):
|
||||
token = fields.Str(required=True)
|
||||
uid = fields.Str(required=True)
|
||||
product_id = fields.Str(required=True)
|
||||
product_subscription_uid = fields.Str(required=True)
|
||||
@@ -5,15 +5,14 @@ from marshmallow import ValidationError
|
||||
from app.extensions import db
|
||||
from app.models import MembersProducts, Products, Members, ProductsDetails, ProductsDetails, ProvisionActions
|
||||
from app.api.helpers.response_helper import ResponseHelper
|
||||
from werkzeug.security import generate_password_hash, check_password_hash
|
||||
from app.api.schemas.myproduct import MyProductSchema
|
||||
from app.api.schemas.provision import ProvisionSchema
|
||||
|
||||
import datetime
|
||||
import jwt
|
||||
import random
|
||||
from app.config import Config
|
||||
|
||||
|
||||
class MyProductsService(BaseService):
|
||||
|
||||
@staticmethod
|
||||
@@ -21,7 +20,7 @@ class MyProductsService(BaseService):
|
||||
try:
|
||||
with db.session.begin():
|
||||
logger.info(f"Incoming MyProduct data ==>>>> {data}")
|
||||
validated_data = MyProductsService.validate_data(data, MyProductSchema())
|
||||
validated_data = MyProductsService.validate_data(data, ProvisionSchema())
|
||||
token = validated_data.get('token')
|
||||
uid = validated_data.get('uid')
|
||||
member_data = Members.get_member_by_uid(uid)
|
||||
|
||||
Reference in New Issue
Block a user