|  |  | @ -70,12 +70,7 @@ export class OrderService { | 
			
		
	
		
			
				
					|  |  |  |     const updateAccountBalance = data.updateAccountBalance ?? false; | 
			
		
	
		
			
				
					|  |  |  |     const userId = data.userId; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     if ( | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'FEE' || | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'INTEREST' || | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'ITEM' || | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'LIABILITY' | 
			
		
	
		
			
				
					|  |  |  |     ) { | 
			
		
	
		
			
				
					|  |  |  |     if (['FEE', 'INTEREST', 'ITEM', 'LIABILITY'].includes(data.type)) { | 
			
		
	
		
			
				
					|  |  |  |       const assetClass = data.assetClass; | 
			
		
	
		
			
				
					|  |  |  |       const assetSubClass = data.assetSubClass; | 
			
		
	
		
			
				
					|  |  |  |       currency = data.SymbolProfile.connectOrCreate.create.currency; | 
			
		
	
	
		
			
				
					|  |  | @ -130,11 +125,7 @@ export class OrderService { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     const orderData: Prisma.OrderCreateInput = data; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     const isDraft = | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'FEE' || | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'INTEREST' || | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'ITEM' || | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'LIABILITY' | 
			
		
	
		
			
				
					|  |  |  |     const isDraft = ['FEE', 'INTEREST', 'ITEM', 'LIABILITY'].includes(data.type) | 
			
		
	
		
			
				
					|  |  |  |       ? false | 
			
		
	
		
			
				
					|  |  |  |       : isAfter(data.date as Date, endOfToday()); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -180,12 +171,7 @@ export class OrderService { | 
			
		
	
		
			
				
					|  |  |  |       where | 
			
		
	
		
			
				
					|  |  |  |     }); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     if ( | 
			
		
	
		
			
				
					|  |  |  |       order.type === 'FEE' || | 
			
		
	
		
			
				
					|  |  |  |       order.type === 'INTEREST' || | 
			
		
	
		
			
				
					|  |  |  |       order.type === 'ITEM' || | 
			
		
	
		
			
				
					|  |  |  |       order.type === 'LIABILITY' | 
			
		
	
		
			
				
					|  |  |  |     ) { | 
			
		
	
		
			
				
					|  |  |  |     if (['FEE', 'INTEREST', 'ITEM', 'LIABILITY'].includes(order.type)) { | 
			
		
	
		
			
				
					|  |  |  |       await this.symbolProfileService.deleteById(order.symbolProfileId); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -377,13 +363,10 @@ export class OrderService { | 
			
		
	
		
			
				
					|  |  |  |       dataSource?: DataSource; | 
			
		
	
		
			
				
					|  |  |  |       symbol?: string; | 
			
		
	
		
			
				
					|  |  |  |       tags?: Tag[]; | 
			
		
	
		
			
				
					|  |  |  |       type?: ActivityType; | 
			
		
	
		
			
				
					|  |  |  |     }; | 
			
		
	
		
			
				
					|  |  |  |     where: Prisma.OrderWhereUniqueInput; | 
			
		
	
		
			
				
					|  |  |  |   }): Promise<Order> { | 
			
		
	
		
			
				
					|  |  |  |     if (data.Account.connect.id_userId.id === null) { | 
			
		
	
		
			
				
					|  |  |  |       delete data.Account; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     if (!data.comment) { | 
			
		
	
		
			
				
					|  |  |  |       data.comment = null; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
	
		
			
				
					|  |  | @ -392,13 +375,12 @@ export class OrderService { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     let isDraft = false; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     if ( | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'FEE' || | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'INTEREST' || | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'ITEM' || | 
			
		
	
		
			
				
					|  |  |  |       data.type === 'LIABILITY' | 
			
		
	
		
			
				
					|  |  |  |     ) { | 
			
		
	
		
			
				
					|  |  |  |     if (['FEE', 'INTEREST', 'ITEM', 'LIABILITY'].includes(data.type)) { | 
			
		
	
		
			
				
					|  |  |  |       delete data.SymbolProfile.connect; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |       if (data.Account?.connect?.id_userId?.id === null) { | 
			
		
	
		
			
				
					|  |  |  |         data.Account = { disconnect: true }; | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |     } else { | 
			
		
	
		
			
				
					|  |  |  |       delete data.SymbolProfile.update; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |