func (VS *Server) makeServiceFreePurchase(c *gin.Context, servicePurchase Stock) {
	var cost float64
	item, b := VS.getItemByID(c, servicePurchase.IDVideoCourseOrItem, "h_database", "getAllPositiveStockByServiceIDForMakeChecking", "item, b := VS.getItemByID", false)
	if b {
		cost = item.Price
	} else {
		video, _ := VS.getVideoCourseByID(c, servicePurchase.IDVideoCourseOrItem, "h_database", "getAllPositiveStockByServiceIDForMakeChecking", "item, b := VS.getItemByID", false)
		cost = video.Price
	}
	/***********************  Payment ***********************/
	// The service Pays
	wk := VS.getServiceByID(c, servicePurchase.ServiceCreated, "h_transactions", "makeWorkshopPurchase", "wk := VS.getServiceByID", true)
	wk.Balance -= cost
	VS.addServiceToDatabase(c, wk, "h_transactions", "makeWorkshopPurchase", "VS.addServiceToDatabase")
	// The Worker receives the money
	worker := VS.getUserByID(c, servicePurchase.IDUser, "h_transactions", "makeWorkshopPurchase", "worker := VS.getUserByID")
	worker.Balance += cost
	VS.addUserToDatabase(c, worker, "h_transactions", "makeWorkshopPurchase", "VS.addUserToDatabase")
}
// Make all the changes in the inventory, Wallet and Service balance
Make all the changes in the inventory, Wallet and Service balance
// Make all the changes in the inventory Wallet and Service balance
func (VS *Server) makeServiceFreePurchase(c *gin.Context, servicePurchase Stock) {
	var cost float64
	item, b := VS.getItemByID(c, servicePurchase.IDVideoCourseOrItem, "h_database", "getAllPositiveStockByServiceIDForMakeChecking", "item, b := VS.getItemByID", false)
	if b {
		cost = item.Price
	} else {
		video, _ := VS.getVideoCourseByID(c, servicePurchase.IDVideoCourseOrItem, "h_database", "getAllPositiveStockByServiceIDForMakeChecking", "item, b := VS.getItemByID", false)
		cost = video.Price
	}
	wk := VS.getServiceByID(c, servicePurchase.ServiceCreated, "h_transactions", "makeWorkshopPurchase", "wk := VS.getServiceByID", true)
	wk.Balance -= cost
	VS.addServiceToDatabase(c, wk, "h_transactions", "makeWorkshopPurchase", "VS.addServiceToDatabase")
	worker := VS.getUserByID(c, servicePurchase.IDUser, "h_transactions", "makeWorkshopPurchase", "worker := VS.getUserByID")
	worker.Balance += cost
	VS.addUserToDatabase(c, worker, "h_transactions", "makeWorkshopPurchase", "VS.addUserToDatabase")
}
func ( VS * Server ) makeServiceFreePurchase ( c * gin . Context , servicePurchase Stock ) { var cost float64 item , b := VS . getItemByID ( c , servicePurchase . IDVideoCourseOrItem , " " , " " , " " , false ) if b { cost = item . Price } else { video , _ := VS . getVideoCourseByID ( c , servicePurchase . IDVideoCourseOrItem , " " , " " , " " , false ) cost = video . Price } wk := VS . getServiceByID ( c , servicePurchase . ServiceCreated , " " , " " , " " , true ) wk . Balance -= cost VS . addServiceToDatabase ( c , wk , " " , " " , " " ) worker := VS . getUserByID ( c , servicePurchase . IDUser , " " , " " , " " ) worker . Balance += cost VS . addUserToDatabase ( c , worker , " " , " " , " " ) }
Make all the changes in the inventory, Wallet and Service balance
Make all the changes in the inventory Wallet and Service balance
/***********************  Payment ***********************/ // The service Pays // The Worker receives the money