Add models for StockPurchase and EquityLiveBalance
This commit is contained in:
		
							parent
							
								
									b2622c473d
								
							
						
					
					
						commit
						5a77d14a26
					
				
					 1 changed files with 35 additions and 0 deletions
				
			
		|  | @ -31,6 +31,41 @@ from sqlalchemy import orm | ||||||
| Base = orm.declarative_base() | Base = orm.declarative_base() | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | # TODO: not sure what primary key should be for this?  am trying a | ||||||
|  | # composite one so far, we'll see... | ||||||
|  | class StockPurchase(Base): | ||||||
|  |     """ | ||||||
|  |     Represents a member equity payment. | ||||||
|  |     """ | ||||||
|  |     __tablename__ = 'stockpurchases' | ||||||
|  | 
 | ||||||
|  |     card_number = sa.Column('card_no', sa.Integer(), nullable=False, primary_key=True, autoincrement=False) | ||||||
|  | 
 | ||||||
|  |     amount = sa.Column('stockPurchase', sa.Numeric(precision=10, scale=2), nullable=True) | ||||||
|  | 
 | ||||||
|  |     datetime = sa.Column('tdate', sa.DateTime(), nullable=True, primary_key=True) | ||||||
|  | 
 | ||||||
|  |     transaction_number = sa.Column('trans_num', sa.String(length=50), nullable=True, primary_key=True) | ||||||
|  | 
 | ||||||
|  |     transaction_id = sa.Column('trans_id', sa.Integer(), nullable=True) | ||||||
|  | 
 | ||||||
|  |     department_number = sa.Column('dept', sa.Integer(), nullable=True) | ||||||
|  | 
 | ||||||
|  |     def __str__(self): | ||||||
|  |         return f"#{self.card_number} for ${self.amount}" | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class EquityLiveBalance(Base): | ||||||
|  | 
 | ||||||
|  |     __tablename__ = 'equity_live_balance' | ||||||
|  | 
 | ||||||
|  |     member_number = sa.Column('memnum', sa.Integer(), nullable=False, primary_key=True, autoincrement=False) | ||||||
|  | 
 | ||||||
|  |     payments = sa.Column(sa.Numeric(precision=10, scale=2), nullable=True) | ||||||
|  | 
 | ||||||
|  |     start_date = sa.Column('startdate', sa.DateTime(), nullable=True) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| class TransactionDetailBase(object): | class TransactionDetailBase(object): | ||||||
|     """ |     """ | ||||||
|     Represents a POS transaction detail record. |     Represents a POS transaction detail record. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar