class Account(db.Document): ws_cust_id = db.IntField(required=True, length=9) ws_acct_id = db.IntField(required=True, length=9) ws_acct_type = db.StringField(required=True, length=9) ws_acct_balance = db.IntField(required=True) ws_acct_crdate = db.DateField(required=True) ws_acct_lasttrdate = db.DateField()
class Patient(db.Document): name = db.StringField(max_length=25) surname = db.StringField(max_length=25) phone_number = db.StringField(max_length=10, unique=True) address = db.StringField() clinic = db.StringField(max_length=50) registrationDate = db.DateField()
class User(db.Document): user_id = db.IntField(unique=True) first_name = db.StringField(max_length=20) last_name = db.StringField(max_length=20) email = db.EmailField(max_length=30, unique=True) birthday = db.DateField() gender = db.StringField() address = db.StringField() suburb = db.StringField() postcode = db.IntField(length=4) description = db.StringField(max_length = 200) password = db.StringField(max_length=20) available = db.BooleanField(default=True) token = db.StringField() contacts = db.ListField(Contact) # profile_pic = def set_password(self, password): self.password = generate_password_hash(password) def get_password(self, password): return check_password_hash(self.password, password) def assign_token(self, id): secret = 'YUWA' token = str(jwt.encode({'id': id}, secret, algorithm='HS256')) self.token = token db.Users.update( {"_id": id}, {$set: {"token": token}} ) return token def invalidate_token(self, token): self.token = ""
class News(db.Document): news_id = db.IntField(unique=True) author_name = db.StringField() date = db.DateField() title = db.StringField() headline = db.StringField() description = db.StringField()
class Creator(db.Document): fullName = db.StringField() creatorComics = db.StringField() creatorStories = db.StringField() creatorEvents = db.StringField() creatorSeries = db.StringField() modified = db.DateField()
class Transaction(db.Document): ws_cust_id = db.IntField(required=True, length=9) ws_acct_id = db.IntField(required=True, length=9) ws_transaction_id = db.IntField(required=True, length=9) ws_description = db.StringField(required=True, length=9) ws_amount = db.IntField(required=True) ws_trxn_date = db.DateField(required=True)
class Account_Status(db.Document): ws_cust_id = db.IntField(required=True, length=9) ws_acct_id = db.IntField(required=True, length=9) ws_acct_type = db.StringField(required=True, length=9) ws_acct_status = db.StringField(required=True) ws_message = db.StringField() ws_acct_lastUdate = db.DateField()
class Appointment(db.Document): myid = db.IntField( db_field='id', unique=True) prof_id = db.IntField( max_length=50 ) user_id = db.IntField( max_length=50 ) prof_name = db.StringField( max_length=50 ) status = db.StringField( max_length=20 ) slot = db.StringField( max_length=30 ) date = db.DateField()
class Professorslot(db.Document): block_id = db.IntField( unique=True) prof_id = db.IntField( max_length=50 ) date = db.DateField(unique=True) slots = db.ListField()
class Holiday(db.Document): holiday_id = db.IntField( unique=True) date = db.DateField(unique=True)
class Customer_Status(db.Document): ws_ssn_id = db.IntField(length=9) ws_cust_id = db.IntField(required=True, length=9) ws_status = db.StringField(max_length=30) ws_message = db.StringField() ws_cust_lastUdate = db.DateField()