feat: factory article for product
This commit is contained in:
		@@ -15,6 +15,7 @@ class Product(BaseModel):
 | 
				
			|||||||
    id = Column(Integer, autoincrement=True, primary_key=True, index=True)
 | 
					    id = Column(Integer, autoincrement=True, primary_key=True, index=True)
 | 
				
			||||||
    name = Column(String, nullable=False, index=True)
 | 
					    name = Column(String, nullable=False, index=True)
 | 
				
			||||||
    article = Column(String, nullable=False, default='', server_default='', index=True)
 | 
					    article = Column(String, nullable=False, default='', server_default='', index=True)
 | 
				
			||||||
 | 
					    factory_article = Column(String, nullable=False, default='', server_default='', index=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    client_id = Column(Integer, ForeignKey('clients.id'), nullable=False, comment='ID сделки')
 | 
					    client_id = Column(Integer, ForeignKey('clients.id'), nullable=False, comment='ID сделки')
 | 
				
			||||||
    client = relationship('Client', back_populates='products')
 | 
					    client = relationship('Client', back_populates='products')
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@ class ProductImageSchema(BaseSchema):
 | 
				
			|||||||
class BaseProductSchema(BaseSchema):
 | 
					class BaseProductSchema(BaseSchema):
 | 
				
			||||||
    name: str
 | 
					    name: str
 | 
				
			||||||
    article: str | None = ''
 | 
					    article: str | None = ''
 | 
				
			||||||
 | 
					    factory_article: str | None = ''
 | 
				
			||||||
    client_id: int
 | 
					    client_id: int
 | 
				
			||||||
    barcodes: list[str]
 | 
					    barcodes: list[str]
 | 
				
			||||||
    barcode_template: BarcodeTemplateSchema | None = None
 | 
					    barcode_template: BarcodeTemplateSchema | None = None
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -127,7 +127,8 @@ class ProductService(BaseService):
 | 
				
			|||||||
                    or_(
 | 
					                    or_(
 | 
				
			||||||
                        Product.name.ilike(f'%{search_input}%'),
 | 
					                        Product.name.ilike(f'%{search_input}%'),
 | 
				
			||||||
                        Product.barcodes.any(ProductBarcode.barcode.ilike(f'%{search_input}%')),
 | 
					                        Product.barcodes.any(ProductBarcode.barcode.ilike(f'%{search_input}%')),
 | 
				
			||||||
                        Product.article.ilike(f'%{search_input}%')
 | 
					                        Product.article.ilike(f'%{search_input}%'),
 | 
				
			||||||
 | 
					                        Product.factory_article.ilike(f'%{search_input}%'),
 | 
				
			||||||
                    )
 | 
					                    )
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user