rattail.db.model.batch.vendorcatalog

Models for vendor catalog batches

rattail.db.model.batch.vendorcatalog.VendorCatalog

alias of VendorCatalogBatch

class rattail.db.model.batch.vendorcatalog.VendorCatalogBatch(**kwargs)[source]

Vendor catalog batch, the source data file of which has been provided by a user, and may be further processed in some site-specific way.

cognized

Date and time when the batch data was last cognized.

cognized_by

Reference to the User who last cognized the batch data.

cognized_by_uuid
complete

Flag to indicate whether the batch is complete. This may be used to assist with workflow when entering/executing new batches.

created

Date and time when the batch was first created.

created_by

Reference to the User who first created the batch.

created_by_uuid
data_rows

Collection of data rows for the batch.

Note

I would prefer for this attribute to simply be named “rows” instead of “data_rows”, but unfortunately (as of this writing) “rows” is essentially a reserved word in FormAlchemy.

description

Basic (loosely identifying) description for the batch.

effective

General effective date for the catalog, as determined by the data file. Note that not all catalog files will include this; also, some catalogs include effective dates on a per-product basis.

executed

Date and time when the batch was (last) executed.

executed_by

Reference to the User who (last) executed the batch.

executed_by_uuid
extra_data

Extra field for arbitrary data, useful to the batch handler etc. Note that there is no structure assumed here, it can be JSON or whatever is needed.

filename

Base name of the data file.

future

Flag indicating whether the batch should be treated as a “future cost” batch, as opposed to a “current” cost batch. If set, the batch will create ProductFutureCost records when executed.

id

Numeric ID for the batch, unique across all “new-style” batches within the Rattail database.

notes

Any arbitrary notes for the batch.

params

Extra parameters for the batch, encoded as JSON. This hopefully can be useful for “many” batches, to avoid needing to add extra flags to the schema etc.

parser_key

The key of the parser used to parse the contents of the data file.

purge

Date after which the batch may be purged.

row_class

alias of VendorCatalogBatchRow

rowcount

Cached row count for the batch. No guarantees perhaps, but should be accurate.

status_code

Status code for the batch as a whole. This indicates whether the batch is “okay” and ready to execute, or (why) not etc.

status_text

Text which may briefly explain the batch status code, if needed.

uuid
vendor

Reference to the Vendor to which the catalog pertains.

vendor_id

ID string for the vendor.

vendor_name

Name of the vendor.

class rattail.db.model.batch.vendorcatalog.VendorCatalogBatchRow(**kwargs)[source]

Row of data within a vendor catalog batch.

batch

Reference to the parent batch to which the row belongs.

batch_uuid
brand_name

Brand name of the product.

case_cost

Cost per case of the product.

case_cost_diff

Case cost difference between the catalog and product’s original cost record.

case_size

Number of units in a case of product.

cost

Reference to the ProductCost record with which this row is associated, if any.

department_name

Name of the department to which the product belongs.

department_number

Number of the department to which the product belongs.

description

Description of the product.

discount_amount

Dollar amount of the “allowance” (temporary discount) for the cost, if applicable.

discount_ends

Date and time when the “allowance” (temporary discount) for the cost ends, if applicable.

discount_percent

Percentage amount of the “allowance” (temporary discount) for the cost, if applicable.

discount_starts

Date and time when the “allowance” (temporary discount) for the cost begins, if applicable.

ends

Date and time when the cost stops being effective, if applicable/known. This often will be null, in which case the cost becomes “permanently” effective, i.e. until a newer cost is brought in.

is_preferred_vendor

Flag indicating whether the vendor to which this catalog applies, is already the “preferred” vendor for this product.

item_entry

Raw entry value, as obtained from the initial data source, and which is used to locate the product within the system. This raw value is preserved in case the initial lookup fails and a refresh must attempt further lookup(s) later. Only used by certain batch handlers in practice.

item_id

Generic ID string for the product associated with the row.

make_preferred_vendor

Flag indicating that the vendor to which this catalog applies, should become the “preferred” vendor for this product.

modified

Last modification time of the row. This should be automatically set when the row is first created, as well as anytime it’s updated thereafter.

old_case_cost

Original case cost for the product, if any.

old_case_size

Original case size for the product, if any.

old_unit_cost

Original unit cost for the product, if any.

old_vendor_code

Original vendor code for the product, if any.

product

Reference to the product with which the row is associated, if any.

product_uuid
removed

Flag to indicate a row has been removed from the batch.

sequence

Sequence number of the row within the batch. This number should be from 1 to the actual number of rows in the batch.

size

Size of the product, as string.

starts

Date and time when the cost becomes effective, if applicable/known. This should probably be set for a future batch of course, but otherwise shouldn’t matter.

status_code

Status code for the data row. This indicates whether the row’s product could be found in the system, etc. Ultimately the meaning of this is defined by each particular batch type.

status_text

Short description of row status. Ultimately the meaning and use of this is defined by each particular batch type.

subdepartment_name

Name of the subdepartment to which the product belongs.

subdepartment_number

Number of the subdepartment to which the product belongs.

suggested_retail

Suggested retail price for the item, according to this vendor.

unit_cost

Cost per unit of the product.

unit_cost_diff

Unit cost difference between the catalog and product’s original cost record.

unit_cost_diff_percent

Difference in percentage, between the new and old unit cost amounts.

upc

UPC for the product associated with the row.

uuid
vendor_code

Vendor’s unique code for the product. The meaning of this corresponds to that of the ProductCost.code column.

rattail.db.model.batch.vendorcatalog.VendorCatalogRow

alias of VendorCatalogBatchRow