-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement order states for order cancellation, fulfillment, pickup mi…
…sses, and pickup cancellation (#207) * Adds main code for Order Status routes * Add email templates for pickup missed, pickup cancelled, order cancelled emails * Add validators and requests for editing merch orders * Progress on connecting edit order with email service * Fix field accessing for pickup event in templates * Implement editing merch order states v1 * Add migration for Orders.status field * Add status query param to GET /order route * Refund user when order is cancelled * Implement delete functionality for pickup events * Add check for pickup event timeline in order cancellation logic * Rename map variable to mention name Co-authored-by: Sumeet Bansal <[email protected]> * Update services/MerchStoreService.ts Co-authored-by: Sumeet Bansal <[email protected]> * Update services/MerchStoreService.ts Co-authored-by: Sumeet Bansal <[email protected]> * Split PATCH /order/:uuid into separate routes to serve state machine behavior * Add validation for order state machine * Fix method name in suggestion merge * Integrate order verification changes from master into order state changes * Convert forEach to for loop + remove duplicate variable access * fixed various PR comments * Update templates to display proper portal url for cancelling events * Split merch.test.ts into merch.store.test.ts and merch.order.test.ts * Add skeleton test code * Add email mocking + fix archived collection <-> hidden item invariant + write first test * Update date format in email template * Progress on tests * More progress on tests * Add email for updating pickup event for an order + finish order state tests * Rename merch order and merch store test files * Change 'verify' -> 'validate' in merch controller/service * Rename /order/miss -> /order/missed * Implement partial-order cancellation * Remove OrderStates.PARTIALLY_FULFILLED * Implement gradual fulfillment across multiple requests * Implement partial-order cancellation refund test * Write tests for POST /order/cleanup * Add member.reload() calls to make clearer that credits are refreshed * Add activity logging for orders * Add GET /order/pickup/past route and test * Add tests for order activity * lint * Disallow creating pickup events within 2 days of the event start * Ensure item has at least 1 option on creation * make my tests deterministic * Fix minor style guides * Remove GET status filter from /order and rename to GET /orders * linty lint Co-authored-by: Michael Shao <[email protected]> Co-authored-by: Sumeet Bansal <[email protected]>
- Loading branch information
1 parent
7c34f23
commit c097558
Showing
25 changed files
with
2,078 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { MigrationInterface, QueryRunner, TableColumn, TableIndex } from 'typeorm'; | ||
|
||
const TABLE_NAME = 'Orders'; | ||
|
||
export class AddOrderStatusField1633030219180 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.addColumn(TABLE_NAME, new TableColumn({ | ||
name: 'status', | ||
type: 'varchar(255)', | ||
default: '\'PLACED\'', | ||
})); | ||
await queryRunner.createIndex(TABLE_NAME, new TableIndex({ | ||
name: 'orders_by_status_index', | ||
columnNames: ['status'], | ||
})); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.dropIndex(TABLE_NAME, 'orders_by_status_index'); | ||
await queryRunner.dropColumn(TABLE_NAME, 'status'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.