feat: discount vendor credit

This commit is contained in:
Ahmed Bouhuolia
2024-11-28 18:17:47 +02:00
parent e02ad1e795
commit 17b3bbe1d8
5 changed files with 135 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function(knex) {
return knex.schema.alterTable('vendor_credits', (table) => {
table.decimal('discount', 10, 2).nullable().after('amount');
table.string('discount_type').nullable().after('discount');
table.decimal('adjustment', 10, 2).nullable().after('discount_type');
});
};
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function(knex) {
return knex.schema.alterTable('vendor_credits', (table) => {
table.dropColumn('discount');
table.dropColumn('discount_type');
table.dropColumn('adjustment');
});
};